@nangohq/runner-sdk 0.69.37 → 0.69.39
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.
- package/dist/checkpoint.d.ts +4 -0
- package/dist/checkpoint.js +14 -0
- package/dist/checkpoint.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/scripts.d.ts +4 -4
- package/dist/scripts.js.map +1 -1
- package/dist/types.d.ts +1 -1
- package/package.json +4 -4
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import * as z from 'zod';
|
|
2
|
+
import type { Checkpoint } from '@nangohq/types';
|
|
3
|
+
export declare const checkpointSchema: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
|
|
4
|
+
export declare function validateCheckpoint(data: any): Checkpoint;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as z from 'zod';
|
|
2
|
+
export const checkpointSchema = z.record(z.string(), z.union([z.string(), z.number(), z.boolean()]));
|
|
3
|
+
/*
|
|
4
|
+
* Runtime validation for checkpoints.
|
|
5
|
+
* Checkpoints must be an object with string keys and values that are either strings, numbers or booleans.
|
|
6
|
+
*/
|
|
7
|
+
export function validateCheckpoint(data) {
|
|
8
|
+
const result = checkpointSchema.safeParse(data);
|
|
9
|
+
if (!result.success) {
|
|
10
|
+
throw new Error(`Invalid checkpoint: ${result.error.message}`);
|
|
11
|
+
}
|
|
12
|
+
return result.data;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=checkpoint.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checkpoint.js","sourceRoot":"","sources":["../lib/checkpoint.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AAIzB,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC;AAErG;;;GAGG;AACH,MAAM,UAAU,kBAAkB,CAAC,IAAS;IACxC,MAAM,MAAM,GAAG,gBAAgB,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;IAChD,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;QAClB,MAAM,IAAI,KAAK,CAAC,uBAAuB,MAAM,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;IACnE,CAAC;IACD,OAAO,MAAM,CAAC,IAAI,CAAC;AACvB,CAAC"}
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -3,6 +3,7 @@ export * from './dataValidation.js';
|
|
|
3
3
|
export * from './errors.js';
|
|
4
4
|
export * from './sync.js';
|
|
5
5
|
export * from './scripts.js';
|
|
6
|
+
export * from './checkpoint.js';
|
|
6
7
|
import PaginationService from './paginate.service.js';
|
|
7
8
|
export { PaginationService };
|
|
8
9
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../lib/index.ts"],"names":[],"mappings":"AACA,cAAc,aAAa,CAAC;AAC5B,cAAc,qBAAqB,CAAC;AACpC,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,OAAO,iBAAiB,MAAM,uBAAuB,CAAC;AAEtD,OAAO,EAAE,iBAAiB,EAAE,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../lib/index.ts"],"names":[],"mappings":"AACA,cAAc,aAAa,CAAC;AAC5B,cAAc,qBAAqB,CAAC;AACpC,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC;AAChC,OAAO,iBAAiB,MAAM,uBAAuB,CAAC;AAEtD,OAAO,EAAE,iBAAiB,EAAE,CAAC"}
|
package/dist/scripts.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import type { ZodCheckpoint, ZodMetadata, ZodModel } from './types.js';
|
|
|
4
4
|
import type { NangoSyncEndpointV2 } from '@nangohq/types';
|
|
5
5
|
import type { MaybePromise } from 'rollup';
|
|
6
6
|
import type * as z from 'zod';
|
|
7
|
-
export type CreateAnyResponse = CreateSyncResponse<any,
|
|
7
|
+
export type CreateAnyResponse = CreateSyncResponse<any, ZodMetadata, ZodCheckpoint> | CreateActionResponse<any, any, ZodMetadata, ZodCheckpoint> | CreateOnEventResponse<ZodMetadata, ZodCheckpoint>;
|
|
8
8
|
export type { ActionError } from './errors.js';
|
|
9
9
|
export type { NangoActionBase as NangoAction, ProxyConfiguration } from './action.js';
|
|
10
10
|
export type { NangoSyncBase as NangoSync } from './sync.js';
|
|
@@ -101,7 +101,7 @@ export interface CreateSyncProps<TModels extends Record<string, ZodModel>, TMeta
|
|
|
101
101
|
metadata?: TMetadata;
|
|
102
102
|
/**
|
|
103
103
|
* The checkpoint schema for storing sync progress and resume state.
|
|
104
|
-
* Checkpoint must be an object with string, number
|
|
104
|
+
* Checkpoint must be an object with string, number or boolean values.
|
|
105
105
|
* Nested objects or arrays are not supported.
|
|
106
106
|
*
|
|
107
107
|
* @example
|
|
@@ -239,7 +239,7 @@ export interface CreateActionProps<TInput extends z.ZodTypeAny, TOutput extends
|
|
|
239
239
|
metadata?: TMetadata;
|
|
240
240
|
/**
|
|
241
241
|
* The checkpoint schema for storing action progress and resume state.
|
|
242
|
-
* Checkpoint must be an object with string, number
|
|
242
|
+
* Checkpoint must be an object with string, number or boolean values.
|
|
243
243
|
* Nested objects or arrays are not supported.
|
|
244
244
|
*
|
|
245
245
|
* @example
|
|
@@ -330,7 +330,7 @@ export interface CreateOnEventProps<TMetadata extends ZodMetadata = undefined, T
|
|
|
330
330
|
metadata?: TMetadata;
|
|
331
331
|
/**
|
|
332
332
|
* The checkpoint schema for storing OnEvent script progress and resume state.
|
|
333
|
-
* Checkpoint must be an object with string, number
|
|
333
|
+
* Checkpoint must be an object with string, number or boolean values.
|
|
334
334
|
* Nested objects or arrays are not supported.
|
|
335
335
|
*
|
|
336
336
|
* @example
|
package/dist/scripts.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scripts.js","sourceRoot":"","sources":["../lib/scripts.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"scripts.js","sourceRoot":"","sources":["../lib/scripts.ts"],"names":[],"mappings":"AAiLA;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAU,UAAU,CACtB,MAAwD;IAExD,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,CAAC;AACvC,CAAC;AA+HD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,UAAU,YAAY,CAK1B,MAAkE;IAChE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,MAAM,EAAE,CAAC;AACzC,CAAC;AAoED;;GAEG;AACH,MAAM,UAAU,aAAa,CACzB,MAAkD;IAElD,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,GAAG,MAAM,EAAE,CAAC;AAC1C,CAAC"}
|
package/dist/types.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type * as z from 'zod';
|
|
2
2
|
export type ZodMetadata = z.ZodObject | z.ZodVoid | undefined;
|
|
3
|
-
export type ZodCheckpoint = z.ZodObject<Record<string, z.ZodString | z.ZodNumber | z.ZodBoolean
|
|
3
|
+
export type ZodCheckpoint = z.ZodObject<Record<string, z.ZodString | z.ZodNumber | z.ZodBoolean>> | undefined;
|
|
4
4
|
export type ZodModel = z.ZodObject<{
|
|
5
5
|
id: z.ZodString;
|
|
6
6
|
}>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nangohq/runner-sdk",
|
|
3
|
-
"version": "0.69.
|
|
3
|
+
"version": "0.69.39",
|
|
4
4
|
"description": "Nango's Runner SDK",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -10,15 +10,15 @@
|
|
|
10
10
|
"directory": "packages/runner-sdk"
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@nangohq/node": "0.69.
|
|
14
|
-
"@nangohq/providers": "0.69.
|
|
13
|
+
"@nangohq/node": "0.69.39",
|
|
14
|
+
"@nangohq/providers": "0.69.39",
|
|
15
15
|
"ajv": "8.17.1",
|
|
16
16
|
"ajv-formats": "3.0.1",
|
|
17
17
|
"lodash-es": "4.17.21",
|
|
18
18
|
"parse-link-header": "2.0.0"
|
|
19
19
|
},
|
|
20
20
|
"devDependencies": {
|
|
21
|
-
"@nangohq/types": "0.69.
|
|
21
|
+
"@nangohq/types": "0.69.39",
|
|
22
22
|
"@types/json-schema": "7.0.15",
|
|
23
23
|
"axios": "1.13.5",
|
|
24
24
|
"json-schema": "0.4.0",
|