@convex-dev/workpool 0.2.19 → 0.3.0

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.
Files changed (61) hide show
  1. package/README.md +77 -68
  2. package/dist/client/index.d.ts +7 -8
  3. package/dist/client/index.d.ts.map +1 -1
  4. package/dist/client/index.js +2 -8
  5. package/dist/client/index.js.map +1 -1
  6. package/dist/client/utils.d.ts +1 -8
  7. package/dist/client/utils.d.ts.map +1 -1
  8. package/dist/client/utils.js.map +1 -1
  9. package/dist/component/_generated/api.d.ts +27 -124
  10. package/dist/component/_generated/api.d.ts.map +1 -1
  11. package/dist/component/_generated/api.js +10 -1
  12. package/dist/component/_generated/api.js.map +1 -1
  13. package/dist/component/_generated/component.d.ts +98 -0
  14. package/dist/component/_generated/component.d.ts.map +1 -0
  15. package/dist/component/_generated/component.js +11 -0
  16. package/dist/component/_generated/component.js.map +1 -0
  17. package/dist/component/_generated/dataModel.d.ts +4 -18
  18. package/dist/component/_generated/dataModel.d.ts.map +1 -0
  19. package/dist/component/_generated/dataModel.js +11 -0
  20. package/dist/component/_generated/dataModel.js.map +1 -0
  21. package/dist/component/_generated/server.d.ts +10 -38
  22. package/dist/component/_generated/server.d.ts.map +1 -1
  23. package/dist/component/_generated/server.js +9 -5
  24. package/dist/component/_generated/server.js.map +1 -1
  25. package/dist/component/danger.d.ts +2 -2
  26. package/dist/component/lib.d.ts +9 -9
  27. package/dist/component/schema.d.ts +15 -15
  28. package/dist/component/shared.d.ts +4 -3
  29. package/dist/component/shared.d.ts.map +1 -1
  30. package/dist/component/shared.js +6 -0
  31. package/dist/component/shared.js.map +1 -1
  32. package/dist/component/stats.d.ts +2 -2
  33. package/dist/component/worker.d.ts +3 -3
  34. package/package.json +32 -30
  35. package/src/client/index.ts +23 -29
  36. package/src/client/utils.ts +3 -32
  37. package/src/component/README.md +6 -6
  38. package/src/component/_generated/api.ts +70 -0
  39. package/src/component/_generated/component.ts +117 -0
  40. package/src/component/_generated/{server.d.ts → server.ts} +33 -21
  41. package/src/component/complete.test.ts +1 -1
  42. package/src/component/complete.ts +6 -6
  43. package/src/component/danger.ts +3 -3
  44. package/src/component/kick.test.ts +5 -5
  45. package/src/component/kick.ts +6 -6
  46. package/src/component/lib.test.ts +3 -3
  47. package/src/component/lib.ts +8 -8
  48. package/src/component/logging.ts +2 -2
  49. package/src/component/loop.test.ts +9 -9
  50. package/src/component/loop.ts +33 -33
  51. package/src/component/recovery.test.ts +7 -7
  52. package/src/component/recovery.ts +2 -2
  53. package/src/component/schema.ts +2 -2
  54. package/src/component/shared.ts +11 -5
  55. package/src/component/stats.test.ts +3 -3
  56. package/src/component/stats.ts +6 -6
  57. package/src/test.ts +10 -3
  58. package/src/component/_generated/api.d.ts +0 -151
  59. package/src/component/_generated/api.js +0 -23
  60. package/src/component/_generated/server.js +0 -90
  61. /package/src/component/_generated/{dataModel.d.ts → dataModel.ts} +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../../src/component/_generated/api.js"],"names":[],"mappings":"AAYA;;;;;;;GAOG;AACH,iDAA0B;AAC1B,sDAA+B;AAC/B,oEAA8C"}
1
+ {"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../../src/component/_generated/api.ts"],"names":[],"mappings":"AACA;;;;;;;GAOG;AAEH,OAAO,KAAK,KAAK,QAAQ,MAAM,gBAAgB,CAAC;AAChD,OAAO,KAAK,KAAK,KAAK,MAAM,aAAa,CAAC;AAC1C,OAAO,KAAK,KAAK,MAAM,MAAM,cAAc,CAAC;AAC5C,OAAO,KAAK,KAAK,IAAI,MAAM,YAAY,CAAC;AACxC,OAAO,KAAK,KAAK,GAAG,MAAM,WAAW,CAAC;AACtC,OAAO,KAAK,KAAK,OAAO,MAAM,eAAe,CAAC;AAC9C,OAAO,KAAK,KAAK,IAAI,MAAM,YAAY,CAAC;AACxC,OAAO,KAAK,KAAK,QAAQ,MAAM,gBAAgB,CAAC;AAChD,OAAO,KAAK,KAAK,MAAM,MAAM,cAAc,CAAC;AAC5C,OAAO,KAAK,KAAK,KAAK,MAAM,aAAa,CAAC;AAC1C,OAAO,KAAK,KAAK,MAAM,MAAM,cAAc,CAAC;AAE5C,OAAO,KAAK,EACV,cAAc,EACd,SAAS,EACT,iBAAiB,EAClB,MAAM,eAAe,CAAC;AAGvB,QAAA,MAAM,OAAO,EAAE,cAAc,CAAC;IAC5B,QAAQ,EAAE,OAAO,QAAQ,CAAC;IAC1B,KAAK,EAAE,OAAO,KAAK,CAAC;IACpB,MAAM,EAAE,OAAO,MAAM,CAAC;IACtB,IAAI,EAAE,OAAO,IAAI,CAAC;IAClB,GAAG,EAAE,OAAO,GAAG,CAAC;IAChB,OAAO,EAAE,OAAO,OAAO,CAAC;IACxB,IAAI,EAAE,OAAO,IAAI,CAAC;IAClB,QAAQ,EAAE,OAAO,QAAQ,CAAC;IAC1B,MAAM,EAAE,OAAO,MAAM,CAAC;IACtB,KAAK,EAAE,OAAO,KAAK,CAAC;IACpB,MAAM,EAAE,OAAO,MAAM,CAAC;CACvB,CAAiB,CAAC;AAEnB;;;;;;;GAOG;AACH,eAAO,MAAM,GAAG,EAAE,SAAS,CACzB,OAAO,OAAO,EACd,iBAAiB,CAAC,GAAG,EAAE,QAAQ,CAAC,CACjB,CAAC;AAElB;;;;;;;GAOG;AACH,eAAO,MAAM,QAAQ,EAAE,SAAS,CAC9B,OAAO,OAAO,EACd,iBAAiB,CAAC,GAAG,EAAE,UAAU,CAAC,CACnB,CAAC;AAElB,eAAO,MAAM,UAAU,EAAqC,EAAE,CAAC"}
@@ -8,8 +8,9 @@
8
8
  * @module
9
9
  */
10
10
  import { anyApi, componentsGeneric } from "convex/server";
11
+ const fullApi = anyApi;
11
12
  /**
12
- * A utility for referencing Convex functions in your app's API.
13
+ * A utility for referencing Convex functions in your app's public API.
13
14
  *
14
15
  * Usage:
15
16
  * ```js
@@ -17,6 +18,14 @@ import { anyApi, componentsGeneric } from "convex/server";
17
18
  * ```
18
19
  */
19
20
  export const api = anyApi;
21
+ /**
22
+ * A utility for referencing Convex functions in your app's internal API.
23
+ *
24
+ * Usage:
25
+ * ```js
26
+ * const myFunctionReference = internal.myModule.myFunction;
27
+ * ```
28
+ */
20
29
  export const internal = anyApi;
21
30
  export const components = componentsGeneric();
22
31
  //# sourceMappingURL=api.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"api.js","sourceRoot":"","sources":["../../../src/component/_generated/api.js"],"names":[],"mappings":"AAAA,oBAAoB;AACpB;;;;;;;GAOG;AAEH,OAAO,EAAE,MAAM,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAE1D;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,GAAG,GAAG,MAAM,CAAC;AAC1B,MAAM,CAAC,MAAM,QAAQ,GAAG,MAAM,CAAC;AAC/B,MAAM,CAAC,MAAM,UAAU,GAAG,iBAAiB,EAAE,CAAC"}
1
+ {"version":3,"file":"api.js","sourceRoot":"","sources":["../../../src/component/_generated/api.ts"],"names":[],"mappings":"AAAA,oBAAoB;AACpB;;;;;;;GAOG;AAmBH,OAAO,EAAE,MAAM,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAE1D,MAAM,OAAO,GAYR,MAAa,CAAC;AAEnB;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,GAAG,GAGZ,MAAa,CAAC;AAElB;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,QAAQ,GAGjB,MAAa,CAAC;AAElB,MAAM,CAAC,MAAM,UAAU,GAAG,iBAAiB,EAAmB,CAAC"}
@@ -0,0 +1,98 @@
1
+ /**
2
+ * Generated `ComponentApi` utility.
3
+ *
4
+ * THIS CODE IS AUTOMATICALLY GENERATED.
5
+ *
6
+ * To regenerate, run `npx convex dev`.
7
+ * @module
8
+ */
9
+ import type { FunctionReference } from "convex/server";
10
+ /**
11
+ * A utility for referencing a Convex component's exposed API.
12
+ *
13
+ * Useful when expecting a parameter like `components.myComponent`.
14
+ * Usage:
15
+ * ```ts
16
+ * async function myFunction(ctx: QueryCtx, component: ComponentApi) {
17
+ * return ctx.runQuery(component.someFile.someQuery, { ...args });
18
+ * }
19
+ * ```
20
+ */
21
+ export type ComponentApi<Name extends string | undefined = string | undefined> = {
22
+ lib: {
23
+ cancel: FunctionReference<"mutation", "internal", {
24
+ id: string;
25
+ logLevel: "DEBUG" | "TRACE" | "INFO" | "REPORT" | "WARN" | "ERROR";
26
+ }, any, Name>;
27
+ cancelAll: FunctionReference<"mutation", "internal", {
28
+ before?: number;
29
+ limit?: number;
30
+ logLevel: "DEBUG" | "TRACE" | "INFO" | "REPORT" | "WARN" | "ERROR";
31
+ }, any, Name>;
32
+ enqueue: FunctionReference<"mutation", "internal", {
33
+ config: {
34
+ logLevel: "DEBUG" | "TRACE" | "INFO" | "REPORT" | "WARN" | "ERROR";
35
+ maxParallelism: number;
36
+ };
37
+ fnArgs: any;
38
+ fnHandle: string;
39
+ fnName: string;
40
+ fnType: "action" | "mutation" | "query";
41
+ onComplete?: {
42
+ context?: any;
43
+ fnHandle: string;
44
+ };
45
+ retryBehavior?: {
46
+ base: number;
47
+ initialBackoffMs: number;
48
+ maxAttempts: number;
49
+ };
50
+ runAt: number;
51
+ }, string, Name>;
52
+ enqueueBatch: FunctionReference<"mutation", "internal", {
53
+ config: {
54
+ logLevel: "DEBUG" | "TRACE" | "INFO" | "REPORT" | "WARN" | "ERROR";
55
+ maxParallelism: number;
56
+ };
57
+ items: Array<{
58
+ fnArgs: any;
59
+ fnHandle: string;
60
+ fnName: string;
61
+ fnType: "action" | "mutation" | "query";
62
+ onComplete?: {
63
+ context?: any;
64
+ fnHandle: string;
65
+ };
66
+ retryBehavior?: {
67
+ base: number;
68
+ initialBackoffMs: number;
69
+ maxAttempts: number;
70
+ };
71
+ runAt: number;
72
+ }>;
73
+ }, Array<string>, Name>;
74
+ status: FunctionReference<"query", "internal", {
75
+ id: string;
76
+ }, {
77
+ previousAttempts: number;
78
+ state: "pending";
79
+ } | {
80
+ previousAttempts: number;
81
+ state: "running";
82
+ } | {
83
+ state: "finished";
84
+ }, Name>;
85
+ statusBatch: FunctionReference<"query", "internal", {
86
+ ids: Array<string>;
87
+ }, Array<{
88
+ previousAttempts: number;
89
+ state: "pending";
90
+ } | {
91
+ previousAttempts: number;
92
+ state: "running";
93
+ } | {
94
+ state: "finished";
95
+ }>, Name>;
96
+ };
97
+ };
98
+ //# sourceMappingURL=component.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../../../src/component/_generated/component.ts"],"names":[],"mappings":"AACA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAEvD;;;;;;;;;;GAUG;AACH,MAAM,MAAM,YAAY,CAAC,IAAI,SAAS,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,IAC3E;IACE,GAAG,EAAE;QACH,MAAM,EAAE,iBAAiB,CACvB,UAAU,EACV,UAAU,EACV;YACE,EAAE,EAAE,MAAM,CAAC;YACX,QAAQ,EAAE,OAAO,GAAG,OAAO,GAAG,MAAM,GAAG,QAAQ,GAAG,MAAM,GAAG,OAAO,CAAC;SACpE,EACD,GAAG,EACH,IAAI,CACL,CAAC;QACF,SAAS,EAAE,iBAAiB,CAC1B,UAAU,EACV,UAAU,EACV;YACE,MAAM,CAAC,EAAE,MAAM,CAAC;YAChB,KAAK,CAAC,EAAE,MAAM,CAAC;YACf,QAAQ,EAAE,OAAO,GAAG,OAAO,GAAG,MAAM,GAAG,QAAQ,GAAG,MAAM,GAAG,OAAO,CAAC;SACpE,EACD,GAAG,EACH,IAAI,CACL,CAAC;QACF,OAAO,EAAE,iBAAiB,CACxB,UAAU,EACV,UAAU,EACV;YACE,MAAM,EAAE;gBACN,QAAQ,EAAE,OAAO,GAAG,OAAO,GAAG,MAAM,GAAG,QAAQ,GAAG,MAAM,GAAG,OAAO,CAAC;gBACnE,cAAc,EAAE,MA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O,EACP,UAAU,EACV;YAAE,EAAE,EAAE,MAAM,CAAA;SAAE,EACZ;YAAE,gBAAgB,EAAE,MAAM,CAAC;YAAC,KAAK,EAAE,SAAS,CAAA;SAAE,GAC9C;YAAE,gBAAgB,EAAE,MAAM,CAAC;YAAC,KAAK,EAAE,SAAS,CAAA;SAAE,GAC9C;YAAE,KAAK,EAAE,UAAU,CAAA;SAAE,EACvB,IAAI,CACL,CAAC;QACF,WAAW,EAAE,iBAAiB,CAC5B,OAAO,EACP,UAAU,EACV;YAAE,GAAG,EAAE,KAAK,CAAC,MAAM,CAAC,CAAA;SAAE,EACtB,KAAK,CACD;YAAE,gBAAgB,EAAE,MAAM,CAAC;YAAC,KAAK,EAAE,SAAS,CAAA;SAAE,GAC9C;YAAE,gBAAgB,EAAE,MAAM,CAAC;YAAC,KAAK,EAAE,SAAS,CAAA;SAAE,GAC9C;YAAE,KAAK,EAAE,UAAU,CAAA;SAAE,CACxB,EACD,IAAI,CACL,CAAC;KACH,CAAC;CACH,CAAC"}
@@ -0,0 +1,11 @@
1
+ /* eslint-disable */
2
+ /**
3
+ * Generated `ComponentApi` utility.
4
+ *
5
+ * THIS CODE IS AUTOMATICALLY GENERATED.
6
+ *
7
+ * To regenerate, run `npx convex dev`.
8
+ * @module
9
+ */
10
+ export {};
11
+ //# sourceMappingURL=component.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"component.js","sourceRoot":"","sources":["../../../src/component/_generated/component.ts"],"names":[],"mappings":"AAAA,oBAAoB;AACpB;;;;;;;GAOG"}
@@ -1,4 +1,3 @@
1
- /* eslint-disable */
2
1
  /**
3
2
  * Generated data model types.
4
3
  *
@@ -7,31 +6,19 @@
7
6
  * To regenerate, run `npx convex dev`.
8
7
  * @module
9
8
  */
10
-
11
- import type {
12
- DataModelFromSchemaDefinition,
13
- DocumentByName,
14
- TableNamesInDataModel,
15
- SystemTableNames,
16
- } from "convex/server";
9
+ import type { DataModelFromSchemaDefinition, DocumentByName, TableNamesInDataModel, SystemTableNames } from "convex/server";
17
10
  import type { GenericId } from "convex/values";
18
11
  import schema from "../schema.js";
19
-
20
12
  /**
21
13
  * The names of all of your Convex tables.
22
14
  */
23
15
  export type TableNames = TableNamesInDataModel<DataModel>;
24
-
25
16
  /**
26
17
  * The type of a document stored in Convex.
27
18
  *
28
19
  * @typeParam TableName - A string literal type of the table name (like "users").
29
20
  */
30
- export type Doc<TableName extends TableNames> = DocumentByName<
31
- DataModel,
32
- TableName
33
- >;
34
-
21
+ export type Doc<TableName extends TableNames> = DocumentByName<DataModel, TableName>;
35
22
  /**
36
23
  * An identifier for a document in Convex.
37
24
  *
@@ -45,9 +32,7 @@ export type Doc<TableName extends TableNames> = DocumentByName<
45
32
  *
46
33
  * @typeParam TableName - A string literal type of the table name (like "users").
47
34
  */
48
- export type Id<TableName extends TableNames | SystemTableNames> =
49
- GenericId<TableName>;
50
-
35
+ export type Id<TableName extends TableNames | SystemTableNames> = GenericId<TableName>;
51
36
  /**
52
37
  * A type describing your Convex data model.
53
38
  *
@@ -58,3 +43,4 @@ export type Id<TableName extends TableNames | SystemTableNames> =
58
43
  * `mutationGeneric` to make them type-safe.
59
44
  */
60
45
  export type DataModel = DataModelFromSchemaDefinition<typeof schema>;
46
+ //# sourceMappingURL=dataModel.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dataModel.d.ts","sourceRoot":"","sources":["../../../src/component/_generated/dataModel.ts"],"names":[],"mappings":"AACA;;;;;;;GAOG;AAEH,OAAO,KAAK,EACV,6BAA6B,EAC7B,cAAc,EACd,qBAAqB,EACrB,gBAAgB,EACjB,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,MAAM,MAAM,cAAc,CAAC;AAElC;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG,qBAAqB,CAAC,SAAS,CAAC,CAAC;AAE1D;;;;GAIG;AACH,MAAM,MAAM,GAAG,CAAC,SAAS,SAAS,UAAU,IAAI,cAAc,CAC5D,SAAS,EACT,SAAS,CACV,CAAC;AAEF;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,EAAE,CAAC,SAAS,SAAS,UAAU,GAAG,gBAAgB,IAC5D,SAAS,CAAC,SAAS,CAAC,CAAC;AAEvB;;;;;;;;GAQG;AACH,MAAM,MAAM,SAAS,GAAG,6BAA6B,CAAC,OAAO,MAAM,CAAC,CAAC"}
@@ -0,0 +1,11 @@
1
+ /* eslint-disable */
2
+ /**
3
+ * Generated data model types.
4
+ *
5
+ * THIS CODE IS AUTOMATICALLY GENERATED.
6
+ *
7
+ * To regenerate, run `npx convex dev`.
8
+ * @module
9
+ */
10
+ import schema from "../schema.js";
11
+ //# sourceMappingURL=dataModel.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dataModel.js","sourceRoot":"","sources":["../../../src/component/_generated/dataModel.ts"],"names":[],"mappings":"AAAA,oBAAoB;AACpB;;;;;;;GAOG;AASH,OAAO,MAAM,MAAM,cAAc,CAAC"}
@@ -1,4 +1,3 @@
1
- /* eslint-disable */
2
1
  /**
3
2
  * Generated utilities for implementing server-side Convex query and mutation functions.
4
3
  *
@@ -7,27 +6,8 @@
7
6
  * To regenerate, run `npx convex dev`.
8
7
  * @module
9
8
  */
10
-
11
- import {
12
- ActionBuilder,
13
- AnyComponents,
14
- HttpActionBuilder,
15
- MutationBuilder,
16
- QueryBuilder,
17
- GenericActionCtx,
18
- GenericMutationCtx,
19
- GenericQueryCtx,
20
- GenericDatabaseReader,
21
- GenericDatabaseWriter,
22
- FunctionReference,
23
- } from "convex/server";
9
+ import type { ActionBuilder, HttpActionBuilder, MutationBuilder, QueryBuilder, GenericActionCtx, GenericMutationCtx, GenericQueryCtx, GenericDatabaseReader, GenericDatabaseWriter } from "convex/server";
24
10
  import type { DataModel } from "./dataModel.js";
25
-
26
- type GenericCtx =
27
- | GenericActionCtx<DataModel>
28
- | GenericMutationCtx<DataModel>
29
- | GenericQueryCtx<DataModel>;
30
-
31
11
  /**
32
12
  * Define a query in this Convex app's public API.
33
13
  *
@@ -37,7 +17,6 @@ type GenericCtx =
37
17
  * @returns The wrapped query. Include this as an `export` to name it and make it accessible.
38
18
  */
39
19
  export declare const query: QueryBuilder<DataModel, "public">;
40
-
41
20
  /**
42
21
  * Define a query that is only accessible from other Convex functions (but not from the client).
43
22
  *
@@ -47,7 +26,6 @@ export declare const query: QueryBuilder<DataModel, "public">;
47
26
  * @returns The wrapped query. Include this as an `export` to name it and make it accessible.
48
27
  */
49
28
  export declare const internalQuery: QueryBuilder<DataModel, "internal">;
50
-
51
29
  /**
52
30
  * Define a mutation in this Convex app's public API.
53
31
  *
@@ -57,7 +35,6 @@ export declare const internalQuery: QueryBuilder<DataModel, "internal">;
57
35
  * @returns The wrapped mutation. Include this as an `export` to name it and make it accessible.
58
36
  */
59
37
  export declare const mutation: MutationBuilder<DataModel, "public">;
60
-
61
38
  /**
62
39
  * Define a mutation that is only accessible from other Convex functions (but not from the client).
63
40
  *
@@ -67,7 +44,6 @@ export declare const mutation: MutationBuilder<DataModel, "public">;
67
44
  * @returns The wrapped mutation. Include this as an `export` to name it and make it accessible.
68
45
  */
69
46
  export declare const internalMutation: MutationBuilder<DataModel, "internal">;
70
-
71
47
  /**
72
48
  * Define an action in this Convex app's public API.
73
49
  *
@@ -80,7 +56,6 @@ export declare const internalMutation: MutationBuilder<DataModel, "internal">;
80
56
  * @returns The wrapped action. Include this as an `export` to name it and make it accessible.
81
57
  */
82
58
  export declare const action: ActionBuilder<DataModel, "public">;
83
-
84
59
  /**
85
60
  * Define an action that is only accessible from other Convex functions (but not from the client).
86
61
  *
@@ -88,38 +63,36 @@ export declare const action: ActionBuilder<DataModel, "public">;
88
63
  * @returns The wrapped function. Include this as an `export` to name it and make it accessible.
89
64
  */
90
65
  export declare const internalAction: ActionBuilder<DataModel, "internal">;
91
-
92
66
  /**
93
67
  * Define an HTTP action.
94
68
  *
95
- * This function will be used to respond to HTTP requests received by a Convex
96
- * deployment if the requests matches the path and method where this action
97
- * is routed. Be sure to route your action in `convex/http.js`.
69
+ * The wrapped function will be used to respond to HTTP requests received
70
+ * by a Convex deployment if the requests matches the path and method where
71
+ * this action is routed. Be sure to route your httpAction in `convex/http.js`.
98
72
  *
99
- * @param func - The function. It receives an {@link ActionCtx} as its first argument.
73
+ * @param func - The function. It receives an {@link ActionCtx} as its first argument
74
+ * and a Fetch API `Request` object as its second.
100
75
  * @returns The wrapped function. Import this function from `convex/http.js` and route it to hook it up.
101
76
  */
102
77
  export declare const httpAction: HttpActionBuilder;
103
-
104
78
  /**
105
79
  * A set of services for use within Convex query functions.
106
80
  *
107
81
  * The query context is passed as the first argument to any Convex query
108
82
  * function run on the server.
109
83
  *
110
- * This differs from the {@link MutationCtx} because all of the services are
111
- * read-only.
84
+ * If you're using code generation, use the `QueryCtx` type in `convex/_generated/server.d.ts` instead.
112
85
  */
113
86
  export type QueryCtx = GenericQueryCtx<DataModel>;
114
-
115
87
  /**
116
88
  * A set of services for use within Convex mutation functions.
117
89
  *
118
90
  * The mutation context is passed as the first argument to any Convex mutation
119
91
  * function run on the server.
92
+ *
93
+ * If you're using code generation, use the `MutationCtx` type in `convex/_generated/server.d.ts` instead.
120
94
  */
121
95
  export type MutationCtx = GenericMutationCtx<DataModel>;
122
-
123
96
  /**
124
97
  * A set of services for use within Convex action functions.
125
98
  *
@@ -127,7 +100,6 @@ export type MutationCtx = GenericMutationCtx<DataModel>;
127
100
  * function run on the server.
128
101
  */
129
102
  export type ActionCtx = GenericActionCtx<DataModel>;
130
-
131
103
  /**
132
104
  * An interface to read from the database within Convex query functions.
133
105
  *
@@ -136,7 +108,6 @@ export type ActionCtx = GenericActionCtx<DataModel>;
136
108
  * building a query.
137
109
  */
138
110
  export type DatabaseReader = GenericDatabaseReader<DataModel>;
139
-
140
111
  /**
141
112
  * An interface to read from and write to the database within Convex mutation
142
113
  * functions.
@@ -147,3 +118,4 @@ export type DatabaseReader = GenericDatabaseReader<DataModel>;
147
118
  * for the guarantees Convex provides your functions.
148
119
  */
149
120
  export type DatabaseWriter = GenericDatabaseWriter<DataModel>;
121
+ //# sourceMappingURL=server.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../../src/component/_generated/server.js"],"names":[],"mappings":"AAqBA;;;;;;;GAOG;AACH,wEAAkC;AAElC;;;;;;;GAOG;AACH,kFAAkD;AAElD;;;;;;;GAOG;AACH,8EAAwC;AAExC;;;;;;;GAOG;AACH,wFAAwD;AAExD;;;;;;;;;;GAUG;AACH,0EAAoC;AAEpC;;;;;GAKG;AACH,oFAAoD;AAEpD;;;;;;GAMG;AACH,8MAA4C"}
1
+ {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../../src/component/_generated/server.ts"],"names":[],"mappings":"AACA;;;;;;;GAOG;AAEH,OAAO,KAAK,EACV,aAAa,EACb,iBAAiB,EACjB,eAAe,EACf,YAAY,EACZ,gBAAgB,EAChB,kBAAkB,EAClB,eAAe,EACf,qBAAqB,EACrB,qBAAqB,EACtB,MAAM,eAAe,CAAC;AAUvB,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAEhD;;;;;;;GAOG;AACH,eAAO,MAAM,KAAK,EAAE,YAAY,CAAC,SAAS,EAAE,QAAQ,CAAgB,CAAC;AAErE;;;;;;;GAOG;AACH,eAAO,MAAM,aAAa,EAAE,YAAY,CAAC,SAAS,EAAE,UAAU,CACxC,CAAC;AAEvB;;;;;;;GAOG;AACH,eAAO,MAAM,QAAQ,EAAE,eAAe,CAAC,SAAS,EAAE,QAAQ,CAAmB,CAAC;AAE9E;;;;;;;GAOG;AACH,eAAO,MAAM,gBAAgB,EAAE,eAAe,CAAC,SAAS,EAAE,UAAU,CAC3C,CAAC;AAE1B;;;;;;;;;;GAUG;AACH,eAAO,MAAM,MAAM,EAAE,aAAa,CAAC,SAAS,EAAE,QAAQ,CAAiB,CAAC;AAExE;;;;;GAKG;AACH,eAAO,MAAM,cAAc,EAAE,aAAa,CAAC,SAAS,EAAE,UAAU,CACzC,CAAC;AAExB;;;;;;;;;;GAUG;AACH,eAAO,MAAM,UAAU,EAAE,iBAAqC,CAAC;AAO/D;;;;;;;GAOG;AACH,MAAM,MAAM,QAAQ,GAAG,eAAe,CAAC,SAAS,CAAC,CAAC;AAElD;;;;;;;GAOG;AACH,MAAM,MAAM,WAAW,GAAG,kBAAkB,CAAC,SAAS,CAAC,CAAC;AAExD;;;;;GAKG;AACH,MAAM,MAAM,SAAS,GAAG,gBAAgB,CAAC,SAAS,CAAC,CAAC;AAEpD;;;;;;GAMG;AACH,MAAM,MAAM,cAAc,GAAG,qBAAqB,CAAC,SAAS,CAAC,CAAC;AAE9D;;;;;;;;GAQG;AACH,MAAM,MAAM,cAAc,GAAG,qBAAqB,CAAC,SAAS,CAAC,CAAC"}
@@ -7,7 +7,7 @@
7
7
  * To regenerate, run `npx convex dev`.
8
8
  * @module
9
9
  */
10
- import { actionGeneric, httpActionGeneric, queryGeneric, mutationGeneric, internalActionGeneric, internalMutationGeneric, internalQueryGeneric, componentsGeneric, } from "convex/server";
10
+ import { actionGeneric, httpActionGeneric, queryGeneric, mutationGeneric, internalActionGeneric, internalMutationGeneric, internalQueryGeneric, } from "convex/server";
11
11
  /**
12
12
  * Define a query in this Convex app's public API.
13
13
  *
@@ -64,11 +64,15 @@ export const action = actionGeneric;
64
64
  */
65
65
  export const internalAction = internalActionGeneric;
66
66
  /**
67
- * Define a Convex HTTP action.
67
+ * Define an HTTP action.
68
68
  *
69
- * @param func - The function. It receives an {@link ActionCtx} as its first argument, and a `Request` object
70
- * as its second.
71
- * @returns The wrapped endpoint function. Route a URL path to this function in `convex/http.js`.
69
+ * The wrapped function will be used to respond to HTTP requests received
70
+ * by a Convex deployment if the requests matches the path and method where
71
+ * this action is routed. Be sure to route your httpAction in `convex/http.js`.
72
+ *
73
+ * @param func - The function. It receives an {@link ActionCtx} as its first argument
74
+ * and a Fetch API `Request` object as its second.
75
+ * @returns The wrapped function. Import this function from `convex/http.js` and route it to hook it up.
72
76
  */
73
77
  export const httpAction = httpActionGeneric;
74
78
  //# sourceMappingURL=server.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"server.js","sourceRoot":"","sources":["../../../src/component/_generated/server.js"],"names":[],"mappings":"AAAA,oBAAoB;AACpB;;;;;;;GAOG;AAEH,OAAO,EACL,aAAa,EACb,iBAAiB,EACjB,YAAY,EACZ,eAAe,EACf,qBAAqB,EACrB,uBAAuB,EACvB,oBAAoB,EACpB,iBAAiB,GAClB,MAAM,eAAe,CAAC;AAEvB;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,KAAK,GAAG,YAAY,CAAC;AAElC;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,oBAAoB,CAAC;AAElD;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG,eAAe,CAAC;AAExC;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,uBAAuB,CAAC;AAExD;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,aAAa,CAAC;AAEpC;;;;;GAKG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,qBAAqB,CAAC;AAEpD;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,iBAAiB,CAAC"}
1
+ {"version":3,"file":"server.js","sourceRoot":"","sources":["../../../src/component/_generated/server.ts"],"names":[],"mappings":"AAAA,oBAAoB;AACpB;;;;;;;GAOG;AAaH,OAAO,EACL,aAAa,EACb,iBAAiB,EACjB,YAAY,EACZ,eAAe,EACf,qBAAqB,EACrB,uBAAuB,EACvB,oBAAoB,GACrB,MAAM,eAAe,CAAC;AAGvB;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,KAAK,GAAsC,YAAY,CAAC;AAErE;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,aAAa,GACxB,oBAAoB,CAAC;AAEvB;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAyC,eAAe,CAAC;AAE9E;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAC3B,uBAAuB,CAAC;AAE1B;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,MAAM,GAAuC,aAAa,CAAC;AAExE;;;;;GAKG;AACH,MAAM,CAAC,MAAM,cAAc,GACzB,qBAAqB,CAAC;AAExB;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,UAAU,GAAsB,iBAAiB,CAAC"}
@@ -1,11 +1,11 @@
1
1
  export declare const clearPending: import("convex/server").RegisteredMutation<"internal", {
2
- olderThan?: number | undefined;
3
2
  before?: number | undefined;
3
+ olderThan?: number | undefined;
4
4
  cursor?: string | undefined;
5
5
  }, Promise<void>>;
6
6
  export declare const clearOldWork: import("convex/server").RegisteredMutation<"internal", {
7
- olderThan?: number | undefined;
8
7
  before?: number | undefined;
8
+ olderThan?: number | undefined;
9
9
  cursor?: string | undefined;
10
10
  }, Promise<void>>;
11
11
  //# sourceMappingURL=danger.d.ts.map
@@ -9,20 +9,20 @@ export declare const enqueue: import("convex/server").RegisteredMutation<"public
9
9
  initialBackoffMs: number;
10
10
  base: number;
11
11
  } | undefined;
12
- fnHandle: string;
13
- fnType: "action" | "mutation" | "query";
14
- fnName: string;
15
- fnArgs: any;
16
- runAt: number;
17
12
  config: {
18
- maxParallelism: number;
19
13
  logLevel: "DEBUG" | "TRACE" | "INFO" | "REPORT" | "WARN" | "ERROR";
14
+ maxParallelism: number;
20
15
  };
16
+ fnArgs: any;
17
+ fnHandle: string;
18
+ fnName: string;
19
+ fnType: "mutation" | "query" | "action";
20
+ runAt: number;
21
21
  }, Promise<import("convex/values").GenericId<"work">>>;
22
22
  export declare const enqueueBatch: import("convex/server").RegisteredMutation<"public", {
23
23
  config: {
24
- maxParallelism: number;
25
24
  logLevel: "DEBUG" | "TRACE" | "INFO" | "REPORT" | "WARN" | "ERROR";
25
+ maxParallelism: number;
26
26
  };
27
27
  items: {
28
28
  onComplete?: {
@@ -34,10 +34,10 @@ export declare const enqueueBatch: import("convex/server").RegisteredMutation<"p
34
34
  initialBackoffMs: number;
35
35
  base: number;
36
36
  } | undefined;
37
+ fnArgs: any;
37
38
  fnHandle: string;
38
- fnType: "action" | "mutation" | "query";
39
39
  fnName: string;
40
- fnArgs: any;
40
+ fnType: "mutation" | "query" | "action";
41
41
  runAt: number;
42
42
  }[];
43
43
  }, Promise<(string & {
@@ -1,12 +1,17 @@
1
1
  declare const _default: import("convex/server").SchemaDefinition<{
2
2
  globals: import("convex/server").TableDefinition<import("convex/values").VObject<{
3
- maxParallelism: number;
4
3
  logLevel: "DEBUG" | "TRACE" | "INFO" | "REPORT" | "WARN" | "ERROR";
4
+ maxParallelism: number;
5
5
  }, {
6
6
  maxParallelism: import("convex/values").VFloat64<number, "required">;
7
7
  logLevel: import("convex/values").VUnion<"DEBUG" | "TRACE" | "INFO" | "REPORT" | "WARN" | "ERROR", [import("convex/values").VLiteral<"DEBUG", "required">, import("convex/values").VLiteral<"TRACE", "required">, import("convex/values").VLiteral<"INFO", "required">, import("convex/values").VLiteral<"REPORT", "required">, import("convex/values").VLiteral<"WARN", "required">, import("convex/values").VLiteral<"ERROR", "required">], "required", never>;
8
- }, "required", "maxParallelism" | "logLevel">, {}, {}, {}>;
8
+ }, "required", "logLevel" | "maxParallelism">, {}, {}, {}>;
9
9
  internalState: import("convex/server").TableDefinition<import("convex/values").VObject<{
10
+ running: {
11
+ workId: import("convex/values").GenericId<"work">;
12
+ scheduledId: import("convex/values").GenericId<"_scheduled_functions">;
13
+ started: number;
14
+ }[];
10
15
  report: {
11
16
  failed: number;
12
17
  canceled: number;
@@ -15,11 +20,6 @@ declare const _default: import("convex/server").SchemaDefinition<{
15
20
  retries: number;
16
21
  lastReportTs: number;
17
22
  };
18
- running: {
19
- workId: import("convex/values").GenericId<"work">;
20
- scheduledId: import("convex/values").GenericId<"_scheduled_functions">;
21
- started: number;
22
- }[];
23
23
  lastRecovery: bigint;
24
24
  generation: bigint;
25
25
  segmentCursors: {
@@ -67,7 +67,7 @@ declare const _default: import("convex/server").SchemaDefinition<{
67
67
  scheduledId: import("convex/values").VId<import("convex/values").GenericId<"_scheduled_functions">, "required">;
68
68
  started: import("convex/values").VFloat64<number, "required">;
69
69
  }, "required", "workId" | "scheduledId" | "started">, "required">;
70
- }, "required", "report" | "running" | "lastRecovery" | "generation" | "segmentCursors" | "report.failed" | "report.canceled" | "report.completed" | "report.succeeded" | "report.retries" | "report.lastReportTs" | "segmentCursors.incoming" | "segmentCursors.completion" | "segmentCursors.cancelation">, {}, {}, {}>;
70
+ }, "required", "running" | "report" | "lastRecovery" | "generation" | "segmentCursors" | "report.failed" | "report.canceled" | "report.completed" | "report.succeeded" | "report.retries" | "report.lastReportTs" | "segmentCursors.incoming" | "segmentCursors.completion" | "segmentCursors.cancelation">, {}, {}, {}>;
71
71
  runStatus: import("convex/server").TableDefinition<import("convex/values").VObject<{
72
72
  state: {
73
73
  kind: "running";
@@ -118,7 +118,6 @@ declare const _default: import("convex/server").SchemaDefinition<{
118
118
  }, "required", "kind" | "generation">], "required", "kind" | "generation" | "scheduledId" | "segment" | "saturated">;
119
119
  }, "required", "state" | "state.kind" | "state.generation" | "state.scheduledId" | "state.segment" | "state.saturated">, {}, {}, {}>;
120
120
  work: import("convex/server").TableDefinition<import("convex/values").VObject<{
121
- canceled?: boolean | undefined;
122
121
  onComplete?: {
123
122
  context?: any;
124
123
  fnHandle: string;
@@ -128,13 +127,14 @@ declare const _default: import("convex/server").SchemaDefinition<{
128
127
  initialBackoffMs: number;
129
128
  base: number;
130
129
  } | undefined;
130
+ canceled?: boolean | undefined;
131
+ fnArgs: any;
131
132
  fnHandle: string;
132
- fnType: "action" | "mutation" | "query";
133
133
  fnName: string;
134
- fnArgs: any;
134
+ fnType: "mutation" | "query" | "action";
135
135
  attempts: number;
136
136
  }, {
137
- fnType: import("convex/values").VUnion<"action" | "mutation" | "query", [import("convex/values").VLiteral<"action", "required">, import("convex/values").VLiteral<"mutation", "required">, import("convex/values").VLiteral<"query", "required">], "required", never>;
137
+ fnType: import("convex/values").VUnion<"mutation" | "query" | "action", [import("convex/values").VLiteral<"action", "required">, import("convex/values").VLiteral<"mutation", "required">, import("convex/values").VLiteral<"query", "required">], "required", never>;
138
138
  fnHandle: import("convex/values").VString<string, "required">;
139
139
  fnName: import("convex/values").VString<string, "required">;
140
140
  fnArgs: import("convex/values").VAny<any, "required", string>;
@@ -156,7 +156,7 @@ declare const _default: import("convex/server").SchemaDefinition<{
156
156
  base: import("convex/values").VFloat64<number, "required">;
157
157
  }, "optional", "maxAttempts" | "initialBackoffMs" | "base">;
158
158
  canceled: import("convex/values").VBoolean<boolean | undefined, "optional">;
159
- }, "required", "canceled" | "fnHandle" | "fnType" | "fnName" | "fnArgs" | "attempts" | "onComplete" | "retryBehavior" | `fnArgs.${string}` | "onComplete.fnHandle" | "onComplete.context" | `onComplete.context.${string}` | "retryBehavior.maxAttempts" | "retryBehavior.initialBackoffMs" | "retryBehavior.base">, {}, {}, {}>;
159
+ }, "required", "fnArgs" | "fnHandle" | "fnName" | "fnType" | "onComplete" | "retryBehavior" | "canceled" | "attempts" | `fnArgs.${string}` | "onComplete.fnHandle" | "onComplete.context" | `onComplete.context.${string}` | "retryBehavior.maxAttempts" | "retryBehavior.initialBackoffMs" | "retryBehavior.base">, {}, {}, {}>;
160
160
  pendingStart: import("convex/server").TableDefinition<import("convex/values").VObject<{
161
161
  workId: import("convex/values").GenericId<"work">;
162
162
  segment: bigint;
@@ -169,6 +169,7 @@ declare const _default: import("convex/server").SchemaDefinition<{
169
169
  }, {}, {}>;
170
170
  pendingCompletion: import("convex/server").TableDefinition<import("convex/values").VObject<{
171
171
  workId: import("convex/values").GenericId<"work">;
172
+ retry: boolean;
172
173
  segment: bigint;
173
174
  runResult: {
174
175
  kind: "success";
@@ -179,7 +180,6 @@ declare const _default: import("convex/server").SchemaDefinition<{
179
180
  } | {
180
181
  kind: "canceled";
181
182
  };
182
- retry: boolean;
183
183
  }, {
184
184
  segment: import("convex/values").VInt64<bigint, "required">;
185
185
  runResult: import("convex/values").VUnion<{
@@ -209,7 +209,7 @@ declare const _default: import("convex/server").SchemaDefinition<{
209
209
  }, "required", "kind">], "required", "kind" | "returnValue" | `returnValue.${string}` | "error">;
210
210
  workId: import("convex/values").VId<import("convex/values").GenericId<"work">, "required">;
211
211
  retry: import("convex/values").VBoolean<boolean, "required">;
212
- }, "required", "workId" | "segment" | "runResult" | "retry" | "runResult.kind" | "runResult.returnValue" | `runResult.returnValue.${string}` | "runResult.error">, {
212
+ }, "required", "workId" | "retry" | "segment" | "runResult" | "runResult.kind" | "runResult.returnValue" | `runResult.returnValue.${string}` | "runResult.error">, {
213
213
  workId: ["workId", "_creationTime"];
214
214
  segment: ["segment", "_creationTime"];
215
215
  }, {}, {}>;
@@ -1,6 +1,6 @@
1
1
  import type { Infer } from "convex/values";
2
2
  import { type Logger } from "./logging.js";
3
- export declare const fnType: import("convex/values").VUnion<"action" | "mutation" | "query", [import("convex/values").VLiteral<"action", "required">, import("convex/values").VLiteral<"mutation", "required">, import("convex/values").VLiteral<"query", "required">], "required", never>;
3
+ export declare const fnType: import("convex/values").VUnion<"mutation" | "query" | "action", [import("convex/values").VLiteral<"action", "required">, import("convex/values").VLiteral<"mutation", "required">, import("convex/values").VLiteral<"query", "required">], "required", never>;
4
4
  export declare const DEFAULT_MAX_PARALLELISM = 10;
5
5
  export declare const SECOND = 1000;
6
6
  export declare const MINUTE: number;
@@ -12,12 +12,12 @@ export declare function getCurrentSegment(): bigint;
12
12
  export declare function getNextSegment(): bigint;
13
13
  export declare function fromSegment(segment: bigint): number;
14
14
  export declare const config: import("convex/values").VObject<{
15
- maxParallelism: number;
16
15
  logLevel: "DEBUG" | "TRACE" | "INFO" | "REPORT" | "WARN" | "ERROR";
16
+ maxParallelism: number;
17
17
  }, {
18
18
  maxParallelism: import("convex/values").VFloat64<number, "required">;
19
19
  logLevel: import("convex/values").VUnion<"DEBUG" | "TRACE" | "INFO" | "REPORT" | "WARN" | "ERROR", [import("convex/values").VLiteral<"DEBUG", "required">, import("convex/values").VLiteral<"TRACE", "required">, import("convex/values").VLiteral<"INFO", "required">, import("convex/values").VLiteral<"REPORT", "required">, import("convex/values").VLiteral<"WARN", "required">, import("convex/values").VLiteral<"ERROR", "required">], "required", never>;
20
- }, "required", "maxParallelism" | "logLevel">;
20
+ }, "required", "logLevel" | "maxParallelism">;
21
21
  export type Config = Infer<typeof config>;
22
22
  export declare const retryBehavior: import("convex/values").VObject<{
23
23
  maxAttempts: number;
@@ -45,6 +45,7 @@ export type RetryBehavior = {
45
45
  */
46
46
  base: number;
47
47
  };
48
+ export declare const DEFAULT_RETRY_BEHAVIOR: RetryBehavior;
48
49
  export declare const vResultValidator: import("convex/values").VUnion<{
49
50
  kind: "success";
50
51
  returnValue: any;
@@ -1 +1 @@
1
- {"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../src/component/shared.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAG3C,OAAO,EAAE,KAAK,MAAM,EAAY,MAAM,cAAc,CAAC;AAErD,eAAO,MAAM,MAAM,+PAIlB,CAAC;AAEF,eAAO,MAAM,uBAAuB,KAAK,CAAC;AAE1C,eAAO,MAAM,MAAM,OAAO,CAAC;AAC3B,eAAO,MAAM,MAAM,QAAc,CAAC;AAClC,eAAO,MAAM,IAAI,QAAc,CAAC;AAChC,eAAO,MAAM,GAAG,QAAY,CAAC;AAC7B,eAAO,MAAM,IAAI,QAAY,CAAC;AAE9B,wBAAgB,SAAS,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,CAE5C;AAED,wBAAgB,iBAAiB,IAAI,MAAM,CAE1C;AAED,wBAAgB,cAAc,IAAI,MAAM,CAEvC;AAED,wBAAgB,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAEnD;AAED,eAAO,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,UAAU,CAAC,CAAC;AAElD,MAAM,MAAM,cAAc,GAAG;IAC3B;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,OAAO,EAAE,OAAO,CAAC;IACjB;;OAEG;IACH,MAAM,EAAE,SAAS,CAAC;CACnB,CAAC;AAEF,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;+GAclB,CAAC;AACF,MAAM,MAAM,MAAM,GAAG,KAAK,CAAC,OAAO,MAAM,CAAC,CAAC;AAE1C,wBAAgB,kBAAkB,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAatE;AAED;;GAEG;AACH,wBAAgB,GAAG,CAAC,CAAC,SAAS,MAAM,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,GAAG,CAAC,CAEnD;AAED;;GAEG;AACH,wBAAgB,GAAG,CAAC,CAAC,SAAS,MAAM,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,GAAG,CAAC,CAEnD"}
@@ -29,6 +29,12 @@ export const retryBehavior = v.object({
29
29
  initialBackoffMs: v.number(),
30
30
  base: v.number(),
31
31
  });
32
+ // Attempts will run with delay [0, 250, 500, 1000, 2000] (ms)
33
+ export const DEFAULT_RETRY_BEHAVIOR = {
34
+ maxAttempts: 5,
35
+ initialBackoffMs: 250,
36
+ base: 2,
37
+ };
32
38
  // This ensures that the type satisfies the schema.
33
39
  const _ = {};
34
40
  export const vResultValidator = v.union(v.object({