@getpara/server-sdk 2.0.0-alpha.7 → 2.0.0-alpha.71

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,3 @@
1
- /// <reference types="node" />
2
- /// <reference types="node" />
3
1
  import type { Ctx, SignatureRes, PlatformUtils, TPregenIdentifierType, TWalletType } from '@getpara/core-sdk';
4
2
  import { BackupKitEmailProps, SDKType } from '@getpara/user-management-client';
5
3
  import { ServerLocalStorage } from './ServerLocalStorage.js';
@@ -41,5 +39,6 @@ export declare class ServerUtils implements PlatformUtils {
41
39
  secureStorage: any;
42
40
  isSyncStorage: boolean;
43
41
  disableProviderModal: boolean;
44
- openPopup(_popupUrl: string): Window;
42
+ openPopup(_popupUrl: string): Promise<Window>;
43
+ initializeWorker(ctx: Ctx): Promise<void>;
45
44
  }
@@ -22,3 +22,4 @@ export declare function ed25519PreKeygen(ctx: Ctx, pregenIdentifier: string, pre
22
22
  walletId: string;
23
23
  recoveryShare: string | null;
24
24
  }>;
25
+ export declare function initializeWorker(ctx: Ctx): Promise<void>;
@@ -7,9 +7,7 @@ export declare function ed25519PreKeygen(ctx: Ctx, pregenIdentifier: string, pre
7
7
  signer: string;
8
8
  walletId: string;
9
9
  }>;
10
- export declare function ed25519Sign(ctx: Ctx, share: string, userId: string, walletId: string, base64Bytes: string): Promise<{
11
- signature: string;
12
- }>;
10
+ export declare function ed25519Sign(ctx: Ctx, share: string, userId: string, walletId: string, base64Bytes: string): Promise<SignatureRes>;
13
11
  export declare function keygen(ctx: Ctx, userId: string, type: Exclude<TWalletType, 'SOLANA'>, secretKey: string | null): Promise<{
14
12
  signer: string;
15
13
  walletId: string;
@@ -13,6 +13,14 @@ interface Message {
13
13
  workId: string;
14
14
  }
15
15
  export declare function requestWasmWithRetries(ctx: Ctx, retries?: number): Promise<import("axios").AxiosResponse<any, any>>;
16
+ /**
17
+ * Executes an operation with retry capabilities
18
+ * @param operation The function to execute
19
+ * @param maxRetries Maximum number of retries (default: 2)
20
+ * @param timeoutMs Timeout in milliseconds (default: 10000)
21
+ * @returns The result of the operation
22
+ */
23
+ export declare function withRetry<T>(operation: () => Promise<T>, maxRetries?: number, timeoutMs?: number): Promise<T>;
16
24
  export declare function handleMessage(e: {
17
25
  data: Message;
18
26
  }): Promise<any>;
@@ -1,4 +1,4 @@
1
- /// <reference types="node" />
2
1
  import { Worker } from 'worker_threads';
3
2
  import { Ctx } from '@getpara/core-sdk';
4
- export declare function setupWorker(ctx: Ctx, resFunction: (arg: any) => Promise<void>, workId: string): Promise<Worker>;
3
+ export declare function resetWorker(): void;
4
+ export declare function setupWorker(ctx: Ctx, resFunction: (arg: any) => Promise<void>, errorFunction: (error: Error) => void, workId: string, errorContext: object): Promise<Worker>;
package/package.json CHANGED
@@ -1,35 +1,34 @@
1
1
  {
2
2
  "name": "@getpara/server-sdk",
3
- "version": "2.0.0-alpha.7",
4
- "main": "dist/cjs/index.js",
5
- "module": "dist/esm/index.js",
6
- "types": "dist/types/index.d.ts",
7
- "typings": "dist/types/index.d.ts",
8
- "sideEffects": [
9
- "wasm_exec.js"
10
- ],
3
+ "version": "2.0.0-alpha.71",
11
4
  "dependencies": {
12
- "@getpara/core-sdk": "2.0.0-alpha.7",
13
- "@getpara/user-management-client": "2.0.0-alpha.7",
14
- "@sentry/node": "^9.1.0",
5
+ "@getpara/core-sdk": "2.0.0-alpha.71",
6
+ "@getpara/user-management-client": "2.0.0-alpha.71",
15
7
  "uuid": "^11.1.0",
16
8
  "ws": "^8.14.2"
17
9
  },
10
+ "devDependencies": {
11
+ "@types/ws": "^8.5.7",
12
+ "typescript": "^5.8.3"
13
+ },
14
+ "files": [
15
+ "dist",
16
+ "package.json"
17
+ ],
18
+ "gitHead": "30e5bad6a141f1b56959432f11aaf1536b84dece",
19
+ "main": "dist/cjs/index.js",
20
+ "module": "dist/esm/index.js",
18
21
  "scripts": {
19
22
  "build": "rm -rf dist && node ./scripts/build.mjs && yarn build:types",
20
- "old-build": "yarn build:cjs && yarn build:esm && yarn build:types",
21
23
  "build:cjs": "rm -rf dist/cjs && tsc --module commonjs --outDir dist/cjs && printf '{\"type\":\"commonjs\"}' > dist/cjs/package.json",
22
24
  "build:esm": "rm -rf dist/esm && tsc --module es2020 --outDir dist/esm && printf '{\"type\":\"module\",\"sideEffects\":[\"wasm_exec.js\"]}' > dist/esm/package.json",
23
25
  "build:types": "rm -rf dist/types && tsc --module es2020 --declarationDir dist/types --emitDeclarationOnly --declaration",
26
+ "old-build": "yarn build:cjs && yarn build:esm && yarn build:types",
24
27
  "test": "vitest run --coverage"
25
28
  },
26
- "devDependencies": {
27
- "@types/ws": "^8.5.7",
28
- "typescript": "5.1.6"
29
- },
30
- "files": [
31
- "dist",
32
- "package.json"
29
+ "sideEffects": [
30
+ "wasm_exec.js"
33
31
  ],
34
- "gitHead": "0a6b297b70c7f9b7b93381944e3f5314252ad6a5"
32
+ "types": "dist/types/index.d.ts",
33
+ "typings": "dist/types/index.d.ts"
35
34
  }