@getpara/server-sdk 2.0.0-alpha.6 → 2.0.0-alpha.61

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.
@@ -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.6",
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.61",
11
4
  "dependencies": {
12
- "@getpara/core-sdk": "2.0.0-alpha.6",
13
- "@getpara/user-management-client": "2.0.0-alpha.6",
14
- "@sentry/node": "^9.1.0",
5
+ "@getpara/core-sdk": "2.0.0-alpha.61",
6
+ "@getpara/user-management-client": "2.0.0-alpha.61",
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": "3a84954ff65c95d95fa96794bf0b0d4dc646c624",
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": "d3b01a8fb475c2af9bf255800bc10d05e011b2eb"
32
+ "types": "dist/types/index.d.ts",
33
+ "typings": "dist/types/index.d.ts"
35
34
  }