diff --git a/client/init.ts b/client/init.ts index 8b4f726..f6da76b 100644 --- a/client/init.ts +++ b/client/init.ts @@ -108,7 +108,7 @@ const fetchJSON = async ( init?: RequestInit, ): Promise => { const response = await fetchSuccessResponse(path, opts, init); - return response.json(); + return response.json() as Promise; }; export const start = async < @@ -189,7 +189,7 @@ export const get = async < if (!response.ok) { throw new Error(`error was thrown from durable ${response.status}`); } - return response.json>(); + return response.json() as Promise>; }; export const cancel = async ( diff --git a/context.ts b/context.ts index 603077b..a091bd2 100644 --- a/context.ts +++ b/context.ts @@ -67,7 +67,7 @@ export class WorkflowContext { exec: WorkflowExecutionBase, opts?: ClientOptions, ): LocalActivityCommand { - return this.callLocalActivity(() => start(exec, opts)); + return this.callLocalActivity(() => start(exec, true, opts)); } /** diff --git a/security/channel.ts b/security/channel.ts index e032ae6..5069edc 100644 --- a/security/channel.ts +++ b/security/channel.ts @@ -69,7 +69,8 @@ export const asChannel = async ( recv.push(event.data); }); socket.addEventListener("error", (event) => { - console.log("error", JSON.stringify(event.error), event.message); + const evt = event as any; + console.log("error", JSON.stringify(evt.error), evt.message); }); await Promise.race([ready.wait(), closed.wait()]); diff --git a/security/jwks.ts b/security/jwks.ts index afe7522..01cf3e2 100644 --- a/security/jwks.ts +++ b/security/jwks.ts @@ -26,7 +26,7 @@ const fetchKeyFromAddr = async ( if (!response.ok) { return null; } - const { keys = [] } = await response.json(); + const { keys = [] } = await (response.json() as Promise); const key = kid ? keys.find((key) => key?.kid === kid) ?? keys[0] : keys[0]; if (!key) { return null; diff --git a/security/keys.ts b/security/keys.ts index 2bc170b..5d32e90 100644 --- a/security/keys.ts +++ b/security/keys.ts @@ -27,6 +27,7 @@ export const importJWK = ( jwk: JsonWebKey, usages?: string[], ): Promise => + // @ts-ignore crypto.subtle.importKey( "jwk", jwk, @@ -45,19 +46,24 @@ export const importJWKFromString = ( ); const getOrGenerateKeyPair = async (): Promise<[JsonWebKey, JsonWebKey]> => { - const hasProcess = typeof process !== "undefined"; // @ts-ignore - const publicKeyEnvValue = typeof Deno !== "undefined" + const isDeno = typeof Deno !== "undefined"; + // @ts-ignore + const publicKeyEnvValue = isDeno // @ts-ignore ? Deno.env.get(PUBLIC_KEY_ENV_VAR) - : hasProcess + // @ts-ignore + : typeof process !== "undefined" + // @ts-ignore ? process.env[PUBLIC_KEY_ENV_VAR] : undefined; // @ts-ignore - const privateKeyEnvValue = typeof Deno !== "undefined" + const privateKeyEnvValue = isDeno // @ts-ignore ? Deno.env.get(PRIVATE_KEY_ENV_VAR) - : hasProcess + // @ts-ignore + : typeof process !== "undefined" + // @ts-ignore ? process.env[PRIVATE_KEY_ENV_VAR] : undefined; if (!publicKeyEnvValue || !privateKeyEnvValue) {