@convex-dev/workpool 0.2.19-alpha.1 → 0.2.19-alpha.3

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 (196) hide show
  1. package/README.md +1 -0
  2. package/dist/{commonjs/client → client}/index.d.ts +13 -11
  3. package/dist/client/index.d.ts.map +1 -0
  4. package/dist/{commonjs/client → client}/index.js +6 -7
  5. package/dist/client/index.js.map +1 -0
  6. package/dist/{commonjs/client → client}/utils.d.ts +2 -2
  7. package/dist/client/utils.d.ts.map +1 -0
  8. package/dist/client/utils.js.map +1 -0
  9. package/dist/component/_generated/api.d.ts +151 -0
  10. package/dist/component/_generated/api.d.ts.map +1 -0
  11. package/dist/component/_generated/api.js.map +1 -0
  12. package/dist/component/_generated/dataModel.d.ts +60 -0
  13. package/dist/component/_generated/server.d.ts +149 -0
  14. package/dist/component/_generated/server.d.ts.map +1 -0
  15. package/dist/component/_generated/server.js.map +1 -0
  16. package/dist/{commonjs/component → component}/complete.d.ts +2 -2
  17. package/dist/component/complete.d.ts.map +1 -0
  18. package/dist/{commonjs/component → component}/complete.js +1 -1
  19. package/dist/component/complete.js.map +1 -0
  20. package/dist/component/convex.config.d.ts.map +1 -0
  21. package/dist/component/convex.config.js.map +1 -0
  22. package/dist/component/crons.d.ts.map +1 -0
  23. package/dist/{esm/component → component}/crons.js +4 -4
  24. package/dist/component/crons.js.map +1 -0
  25. package/dist/component/danger.d.ts.map +1 -0
  26. package/dist/component/danger.js.map +1 -0
  27. package/dist/{esm/component → component}/kick.d.ts +2 -2
  28. package/dist/component/kick.d.ts.map +1 -0
  29. package/dist/component/kick.js.map +1 -0
  30. package/dist/{esm/component → component}/lib.d.ts +1 -1
  31. package/dist/component/lib.d.ts.map +1 -0
  32. package/dist/{commonjs/component → component}/lib.js +3 -4
  33. package/dist/component/lib.js.map +1 -0
  34. package/dist/{commonjs/component → component}/logging.d.ts +1 -1
  35. package/dist/component/logging.d.ts.map +1 -0
  36. package/dist/component/logging.js.map +1 -0
  37. package/dist/{commonjs/component → component}/loop.d.ts +2 -2
  38. package/dist/component/loop.d.ts.map +1 -0
  39. package/dist/{commonjs/component → component}/loop.js +1 -1
  40. package/dist/component/loop.js.map +1 -0
  41. package/dist/{esm/component → component}/recovery.d.ts +2 -2
  42. package/dist/component/recovery.d.ts.map +1 -0
  43. package/dist/{commonjs/component → component}/recovery.js +1 -1
  44. package/dist/component/recovery.js.map +1 -0
  45. package/dist/{commonjs/component → component}/schema.d.ts.map +1 -1
  46. package/dist/component/schema.js.map +1 -0
  47. package/dist/{commonjs/component → component}/shared.d.ts +2 -2
  48. package/dist/component/shared.d.ts.map +1 -0
  49. package/dist/component/shared.js.map +1 -0
  50. package/dist/{esm/component → component}/stats.d.ts +4 -4
  51. package/dist/component/stats.d.ts.map +1 -0
  52. package/dist/{commonjs/component → component}/stats.js +0 -3
  53. package/dist/component/stats.js.map +1 -0
  54. package/dist/component/worker.d.ts.map +1 -0
  55. package/dist/component/worker.js.map +1 -0
  56. package/package.json +42 -39
  57. package/src/client/index.ts +32 -29
  58. package/src/client/utils.ts +7 -7
  59. package/src/component/_generated/api.d.ts +1 -0
  60. package/src/component/complete.test.ts +6 -6
  61. package/src/component/complete.ts +9 -5
  62. package/src/component/crons.ts +4 -4
  63. package/src/component/kick.test.ts +3 -3
  64. package/src/component/kick.ts +2 -2
  65. package/src/component/lib.test.ts +6 -6
  66. package/src/component/lib.ts +15 -5
  67. package/src/component/logging.test.ts +1 -1
  68. package/src/component/logging.ts +1 -1
  69. package/src/component/loop.test.ts +7 -7
  70. package/src/component/loop.ts +8 -8
  71. package/src/component/recovery.test.ts +9 -9
  72. package/src/component/recovery.ts +2 -2
  73. package/src/component/shared.ts +2 -2
  74. package/src/component/stats.test.ts +11 -11
  75. package/src/component/stats.ts +4 -7
  76. package/src/test.ts +3 -0
  77. package/dist/commonjs/client/index.d.ts.map +0 -1
  78. package/dist/commonjs/client/index.js.map +0 -1
  79. package/dist/commonjs/client/utils.d.ts.map +0 -1
  80. package/dist/commonjs/client/utils.js.map +0 -1
  81. package/dist/commonjs/component/_generated/api.d.ts +0 -12
  82. package/dist/commonjs/component/_generated/api.d.ts.map +0 -1
  83. package/dist/commonjs/component/_generated/api.js.map +0 -1
  84. package/dist/commonjs/component/_generated/server.d.ts +0 -64
  85. package/dist/commonjs/component/_generated/server.d.ts.map +0 -1
  86. package/dist/commonjs/component/_generated/server.js.map +0 -1
  87. package/dist/commonjs/component/complete.d.ts.map +0 -1
  88. package/dist/commonjs/component/complete.js.map +0 -1
  89. package/dist/commonjs/component/convex.config.d.ts.map +0 -1
  90. package/dist/commonjs/component/convex.config.js.map +0 -1
  91. package/dist/commonjs/component/crons.d.ts.map +0 -1
  92. package/dist/commonjs/component/crons.js +0 -61
  93. package/dist/commonjs/component/crons.js.map +0 -1
  94. package/dist/commonjs/component/danger.d.ts.map +0 -1
  95. package/dist/commonjs/component/danger.js.map +0 -1
  96. package/dist/commonjs/component/kick.d.ts +0 -9
  97. package/dist/commonjs/component/kick.d.ts.map +0 -1
  98. package/dist/commonjs/component/kick.js.map +0 -1
  99. package/dist/commonjs/component/lib.d.ts +0 -79
  100. package/dist/commonjs/component/lib.d.ts.map +0 -1
  101. package/dist/commonjs/component/lib.js.map +0 -1
  102. package/dist/commonjs/component/logging.d.ts.map +0 -1
  103. package/dist/commonjs/component/logging.js.map +0 -1
  104. package/dist/commonjs/component/loop.d.ts.map +0 -1
  105. package/dist/commonjs/component/loop.js.map +0 -1
  106. package/dist/commonjs/component/recovery.d.ts +0 -53
  107. package/dist/commonjs/component/recovery.d.ts.map +0 -1
  108. package/dist/commonjs/component/recovery.js.map +0 -1
  109. package/dist/commonjs/component/schema.js.map +0 -1
  110. package/dist/commonjs/component/shared.d.ts.map +0 -1
  111. package/dist/commonjs/component/shared.js.map +0 -1
  112. package/dist/commonjs/component/stats.d.ts +0 -45
  113. package/dist/commonjs/component/stats.d.ts.map +0 -1
  114. package/dist/commonjs/component/stats.js.map +0 -1
  115. package/dist/commonjs/component/worker.d.ts.map +0 -1
  116. package/dist/commonjs/component/worker.js.map +0 -1
  117. package/dist/commonjs/package.json +0 -3
  118. package/dist/esm/client/index.d.ts +0 -429
  119. package/dist/esm/client/index.d.ts.map +0 -1
  120. package/dist/esm/client/index.js +0 -317
  121. package/dist/esm/client/index.js.map +0 -1
  122. package/dist/esm/client/utils.d.ts +0 -16
  123. package/dist/esm/client/utils.d.ts.map +0 -1
  124. package/dist/esm/client/utils.js +0 -9
  125. package/dist/esm/client/utils.js.map +0 -1
  126. package/dist/esm/component/_generated/api.d.ts +0 -12
  127. package/dist/esm/component/_generated/api.d.ts.map +0 -1
  128. package/dist/esm/component/_generated/api.js +0 -22
  129. package/dist/esm/component/_generated/api.js.map +0 -1
  130. package/dist/esm/component/_generated/server.d.ts +0 -64
  131. package/dist/esm/component/_generated/server.d.ts.map +0 -1
  132. package/dist/esm/component/_generated/server.js +0 -74
  133. package/dist/esm/component/_generated/server.js.map +0 -1
  134. package/dist/esm/component/complete.d.ts +0 -89
  135. package/dist/esm/component/complete.d.ts.map +0 -1
  136. package/dist/esm/component/complete.js +0 -88
  137. package/dist/esm/component/complete.js.map +0 -1
  138. package/dist/esm/component/convex.config.d.ts +0 -3
  139. package/dist/esm/component/convex.config.d.ts.map +0 -1
  140. package/dist/esm/component/convex.config.js +0 -4
  141. package/dist/esm/component/convex.config.js.map +0 -1
  142. package/dist/esm/component/crons.d.ts +0 -4
  143. package/dist/esm/component/crons.d.ts.map +0 -1
  144. package/dist/esm/component/crons.js.map +0 -1
  145. package/dist/esm/component/danger.d.ts +0 -11
  146. package/dist/esm/component/danger.d.ts.map +0 -1
  147. package/dist/esm/component/danger.js +0 -92
  148. package/dist/esm/component/danger.js.map +0 -1
  149. package/dist/esm/component/kick.d.ts.map +0 -1
  150. package/dist/esm/component/kick.js +0 -102
  151. package/dist/esm/component/kick.js.map +0 -1
  152. package/dist/esm/component/lib.d.ts.map +0 -1
  153. package/dist/esm/component/lib.js +0 -179
  154. package/dist/esm/component/lib.js.map +0 -1
  155. package/dist/esm/component/logging.d.ts +0 -16
  156. package/dist/esm/component/logging.d.ts.map +0 -1
  157. package/dist/esm/component/logging.js +0 -71
  158. package/dist/esm/component/logging.js.map +0 -1
  159. package/dist/esm/component/loop.d.ts +0 -14
  160. package/dist/esm/component/loop.d.ts.map +0 -1
  161. package/dist/esm/component/loop.js +0 -503
  162. package/dist/esm/component/loop.js.map +0 -1
  163. package/dist/esm/component/recovery.d.ts.map +0 -1
  164. package/dist/esm/component/recovery.js +0 -97
  165. package/dist/esm/component/recovery.js.map +0 -1
  166. package/dist/esm/component/schema.d.ts +0 -228
  167. package/dist/esm/component/schema.d.ts.map +0 -1
  168. package/dist/esm/component/schema.js +0 -79
  169. package/dist/esm/component/schema.js.map +0 -1
  170. package/dist/esm/component/shared.d.ts +0 -140
  171. package/dist/esm/component/shared.d.ts.map +0 -1
  172. package/dist/esm/component/shared.js +0 -79
  173. package/dist/esm/component/shared.js.map +0 -1
  174. package/dist/esm/component/stats.d.ts.map +0 -1
  175. package/dist/esm/component/stats.js +0 -129
  176. package/dist/esm/component/stats.js.map +0 -1
  177. package/dist/esm/component/worker.d.ts +0 -16
  178. package/dist/esm/component/worker.d.ts.map +0 -1
  179. package/dist/esm/component/worker.js +0 -76
  180. package/dist/esm/component/worker.js.map +0 -1
  181. package/dist/esm/package.json +0 -3
  182. /package/dist/{commonjs/client → client}/utils.js +0 -0
  183. /package/dist/{commonjs/component → component}/_generated/api.js +0 -0
  184. /package/dist/{commonjs/component → component}/_generated/server.js +0 -0
  185. /package/dist/{commonjs/component → component}/convex.config.d.ts +0 -0
  186. /package/dist/{commonjs/component → component}/convex.config.js +0 -0
  187. /package/dist/{commonjs/component → component}/crons.d.ts +0 -0
  188. /package/dist/{commonjs/component → component}/danger.d.ts +0 -0
  189. /package/dist/{commonjs/component → component}/danger.js +0 -0
  190. /package/dist/{commonjs/component → component}/kick.js +0 -0
  191. /package/dist/{commonjs/component → component}/logging.js +0 -0
  192. /package/dist/{commonjs/component → component}/schema.d.ts +0 -0
  193. /package/dist/{commonjs/component → component}/schema.js +0 -0
  194. /package/dist/{commonjs/component → component}/shared.js +0 -0
  195. /package/dist/{commonjs/component → component}/worker.d.ts +0 -0
  196. /package/dist/{commonjs/component → component}/worker.js +0 -0
@@ -1,317 +0,0 @@
1
- import { createFunctionHandle, internalMutationGeneric, } from "convex/server";
2
- import { v } from "convex/values";
3
- import { DEFAULT_LOG_LEVEL } from "../component/logging.js";
4
- import { DEFAULT_MAX_PARALLELISM, vResultValidator, } from "../component/shared.js";
5
- import { safeFunctionName, } from "./utils.js";
6
- export { vResultValidator };
7
- export { retryBehavior as vRetryBehavior } from "../component/shared.js";
8
- export { logLevel as vLogLevel } from "../component/logging.js";
9
- export const vWorkIdValidator = v.string();
10
- export {
11
- /** @deprecated Use `vWorkIdValidator` instead. */
12
- vWorkIdValidator as workIdValidator,
13
- /** @deprecated Use `vResultValidator` instead. */
14
- vResultValidator as resultValidator, };
15
- /** Equivalent to `vOnCompleteArgs(<your-context-validator>)`. */
16
- export const vOnComplete = vOnCompleteArgs(v.any());
17
- /** @deprecated Use `vOnCompleteArgs()` instead. */
18
- export const vOnCompleteValidator = vOnCompleteArgs;
19
- // Attempts will run with delay [0, 250, 500, 1000, 2000] (ms)
20
- export const DEFAULT_RETRY_BEHAVIOR = {
21
- maxAttempts: 5,
22
- initialBackoffMs: 250,
23
- base: 2,
24
- };
25
- export class Workpool {
26
- component;
27
- options;
28
- /**
29
- * Initializes a Workpool.
30
- *
31
- * Note: if you want different pools, you need to *create different instances*
32
- * of Workpool in convex.config.ts. It isn't sufficient to have different
33
- * instances of this class.
34
- *
35
- * @param component - The component to use, like `components.workpool` from
36
- * `./_generated/api.ts`.
37
- * @param options - The {@link WorkpoolOptions} for the Workpool.
38
- */
39
- constructor(component, options) {
40
- this.component = component;
41
- this.options = options;
42
- }
43
- /**
44
- * Enqueues an action to be run.
45
- *
46
- * @param ctx - The mutation or action context that can call ctx.runMutation.
47
- * @param fn - The action to run, like `internal.example.myAction`.
48
- * @param fnArgs - The arguments to pass to the action.
49
- * @param options - The options for the action to specify retry behavior,
50
- * onComplete handling, and scheduling via `runAt` or `runAfter`.
51
- * @returns The ID of the work that was enqueued.
52
- */
53
- async enqueueAction(ctx, fn, fnArgs, options) {
54
- const retryBehavior = getRetryBehavior(this.options.defaultRetryBehavior, this.options.retryActionsByDefault, options?.retry);
55
- return enqueue(this.component, ctx, "action", fn, fnArgs, {
56
- retryBehavior,
57
- ...this.options,
58
- ...options,
59
- });
60
- }
61
- /**
62
- * Enqueues a batch of actions to be run.
63
- * Each action will be run independently, and the onComplete handler will
64
- * be called for each action.
65
- *
66
- * @param ctx - The mutation or action ctx that can call ctx.runMutation.
67
- * @param fn - The action to run, like `internal.example.myAction`.
68
- * @param argsArray - The arguments to pass to the action.
69
- * @param options - The options for the actions to specify retry behavior,
70
- * onComplete handling, and scheduling via `runAt` or `runAfter`.
71
- * @returns The IDs of the work that was enqueued.
72
- */
73
- async enqueueActionBatch(ctx, fn, argsArray, options) {
74
- const retryBehavior = getRetryBehavior(this.options.defaultRetryBehavior, this.options.retryActionsByDefault, options?.retry);
75
- return enqueueBatch(this.component, ctx, "action", fn, argsArray, {
76
- retryBehavior,
77
- ...this.options,
78
- ...options,
79
- });
80
- }
81
- /**
82
- * Enqueues a mutation to be run.
83
- *
84
- * Note: mutations are not retried by the workpool. Convex automatically
85
- * retries them on database conflicts and transient failures.
86
- * Because they're deterministic, external retries don't provide any benefit.
87
- *
88
- * @param ctx - The mutation or action context that can call ctx.runMutation.
89
- * @param fn - The mutation to run, like `internal.example.myMutation`.
90
- * @param fnArgs - The arguments to pass to the mutation.
91
- * @param options - The options for the mutation to specify onComplete handling
92
- * and scheduling via `runAt` or `runAfter`.
93
- */
94
- async enqueueMutation(ctx, fn, fnArgs, options) {
95
- return enqueue(this.component, ctx, "mutation", fn, fnArgs, {
96
- ...this.options,
97
- ...options,
98
- });
99
- }
100
- /**
101
- * Enqueues a batch of mutations to be run.
102
- * Each mutation will be run independently, and the onComplete handler will
103
- * be called for each mutation.
104
- *
105
- * @param ctx - The mutation or action context that can call ctx.runMutation.
106
- * @param fn - The mutation to run, like `internal.example.myMutation`.
107
- * @param argsArray - The arguments to pass to the mutations.
108
- * @param options - The options for the mutations to specify onComplete handling
109
- * and scheduling via `runAt` or `runAfter`.
110
- */
111
- async enqueueMutationBatch(ctx, fn, argsArray, options) {
112
- return enqueueBatch(this.component, ctx, "mutation", fn, argsArray, {
113
- ...this.options,
114
- ...options,
115
- });
116
- }
117
- /**
118
- * Enqueues a query to be run.
119
- * Usually not what you want, but it can be useful during workflows.
120
- * The query is run in a mutation and the result is returned to the caller,
121
- * so it can conflict if other mutations are writing the value.
122
- *
123
- * @param ctx - The mutation or action context that can call ctx.runMutation.
124
- * @param fn - The query to run, like `internal.example.myQuery`.
125
- * @param fnArgs - The arguments to pass to the query.
126
- * @param options - The options for the query to specify onComplete handling
127
- * and scheduling via `runAt` or `runAfter`.
128
- */
129
- async enqueueQuery(ctx, fn, fnArgs, options) {
130
- return enqueue(this.component, ctx, "query", fn, fnArgs, {
131
- ...this.options,
132
- ...options,
133
- });
134
- }
135
- /**
136
- * Enqueues a batch of queries to be run.
137
- * Each query will be run independently, and the onComplete handler will
138
- * be called for each query.
139
- *
140
- * @param ctx - The mutation or action context that can call ctx.runMutation.
141
- * @param fn - The query to run, like `internal.example.myQuery`.
142
- * @param argsArray - The arguments to pass to the queries.
143
- * @param options - The options for the queries to specify onComplete handling
144
- * and scheduling via `runAt` or `runAfter`.
145
- */
146
- async enqueueQueryBatch(ctx, fn, argsArray, options) {
147
- return enqueueBatch(this.component, ctx, "query", fn, argsArray, {
148
- ...this.options,
149
- ...options,
150
- });
151
- }
152
- /**
153
- * Cancels a work item. If it's already started, it will be allowed to finish
154
- * but will not be retried.
155
- *
156
- * @param ctx - The mutation or action context that can call ctx.runMutation.
157
- * @param id - The ID of the work to cancel.
158
- */
159
- async cancel(ctx, id) {
160
- await ctx.runMutation(this.component.lib.cancel, {
161
- id,
162
- logLevel: this.options.logLevel ?? DEFAULT_LOG_LEVEL,
163
- });
164
- }
165
- /**
166
- * Cancels all pending work items. See {@link cancel}.
167
- *
168
- * @param ctx - The mutation or action context that can call ctx.runMutation.
169
- */
170
- async cancelAll(ctx, options) {
171
- await ctx.runMutation(this.component.lib.cancelAll, {
172
- logLevel: this.options.logLevel ?? DEFAULT_LOG_LEVEL,
173
- ...options,
174
- });
175
- }
176
- /**
177
- * Gets the status of a work item.
178
- *
179
- * @param ctx - The query context that can call ctx.runQuery.
180
- * @param id - The ID of the work to get the status of.
181
- * @returns The status of the work item. One of:
182
- * - `{ state: "pending", previousAttempts: number }`
183
- * - `{ state: "running", previousAttempts: number }`
184
- * - `{ state: "finished" }`
185
- */
186
- async status(ctx, id) {
187
- return ctx.runQuery(this.component.lib.status, { id });
188
- }
189
- /**
190
- * Gets the status of a batch of work items.
191
- *
192
- * @param ctx - The query context that can call ctx.runQuery.
193
- * @param ids - The IDs of the work to get the status of.
194
- * @returns The status of the work items.
195
- */
196
- async statusBatch(ctx, ids) {
197
- return ctx.runQuery(this.component.lib.statusBatch, { ids });
198
- }
199
- /**
200
- * Defines a mutation that will be run after a work item completes.
201
- * You can pass this to a call to enqueue* like so:
202
- * ```ts
203
- * export const myOnComplete = workpool.defineOnComplete({
204
- * context: v.literal("myContextValue"), // optional
205
- * handler: async (ctx, {workId, context, result}) => {
206
- * // ... do something with the result
207
- * },
208
- * });
209
- *
210
- * // in some other function:
211
- * const workId = await workpool.enqueueAction(ctx, internal.foo.bar, {
212
- * // ... args to action
213
- * }, {
214
- * onComplete: internal.foo.myOnComplete,
215
- * });
216
- * ```
217
- */
218
- defineOnComplete({ context, handler, }) {
219
- return internalMutationGeneric({
220
- args: vOnCompleteArgs(context),
221
- handler,
222
- });
223
- }
224
- }
225
- /**
226
- * Returns a validator to use for the onComplete mutation.
227
- * To be used like:
228
- * ```ts
229
- * export const myOnComplete = internalMutation({
230
- * args: vOnCompleteArgs(v.string()),
231
- * handler: async (ctx, {workId, context, result}) => {
232
- * // context has been validated as a string
233
- * // ... do something with the result
234
- * },
235
- * });
236
- * @param context - The context validator. If not provided, it will be `v.any()`.
237
- * @returns The validator for the onComplete mutation.
238
- */
239
- export function vOnCompleteArgs(context) {
240
- return v.object({
241
- workId: vWorkIdValidator,
242
- context: (context ?? v.optional(v.any())),
243
- result: vResultValidator,
244
- });
245
- }
246
- // ensure OnCompleteArgs satisfies SharedOnCompleteArgs
247
- const _ = {};
248
- const _2 = {};
249
- //
250
- // Helper functions
251
- //
252
- function getRetryBehavior(defaultRetryBehavior, retryActionsByDefault, retryOverride) {
253
- const defaultRetry = defaultRetryBehavior ?? DEFAULT_RETRY_BEHAVIOR;
254
- const retryByDefault = retryActionsByDefault ?? false;
255
- if (retryOverride === true) {
256
- return defaultRetry;
257
- }
258
- if (retryOverride === false) {
259
- return undefined;
260
- }
261
- return retryOverride ?? (retryByDefault ? defaultRetry : undefined);
262
- }
263
- async function enqueueArgs(fn, opts) {
264
- const [fnHandle, fnName] = typeof fn === "string" && fn.startsWith("function://")
265
- ? [fn, opts?.name ?? fn]
266
- : [await createFunctionHandle(fn), opts?.name ?? safeFunctionName(fn)];
267
- const onComplete = opts?.onComplete
268
- ? {
269
- fnHandle: await createFunctionHandle(opts.onComplete),
270
- context: opts.context,
271
- }
272
- : undefined;
273
- return {
274
- fnHandle,
275
- fnName,
276
- onComplete,
277
- runAt: getRunAt(opts),
278
- retryBehavior: opts?.retryBehavior,
279
- config: {
280
- logLevel: opts?.logLevel ?? DEFAULT_LOG_LEVEL,
281
- maxParallelism: opts?.maxParallelism ?? DEFAULT_MAX_PARALLELISM,
282
- },
283
- };
284
- }
285
- function getRunAt(options) {
286
- if (!options) {
287
- return Date.now();
288
- }
289
- if (options.runAt !== undefined) {
290
- return options.runAt;
291
- }
292
- if (options.runAfter !== undefined) {
293
- return Date.now() + options.runAfter;
294
- }
295
- return Date.now();
296
- }
297
- export async function enqueueBatch(component, ctx, fnType, fn, fnArgsArray, options) {
298
- const { config, ...defaults } = await enqueueArgs(fn, options);
299
- const ids = await ctx.runMutation(component.lib.enqueueBatch, {
300
- items: fnArgsArray.map((fnArgs) => ({
301
- ...defaults,
302
- fnArgs,
303
- fnType,
304
- })),
305
- config,
306
- });
307
- return ids;
308
- }
309
- export async function enqueue(component, ctx, fnType, fn, fnArgs, options) {
310
- const id = await ctx.runMutation(component.lib.enqueue, {
311
- ...(await enqueueArgs(fn, options)),
312
- fnArgs,
313
- fnType,
314
- });
315
- return id;
316
- }
317
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/client/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oBAAoB,EAQpB,uBAAuB,GAExB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAS,CAAC,EAA4B,MAAM,eAAe,CAAC;AAEnE,OAAO,EAAE,iBAAiB,EAAiB,MAAM,yBAAyB,CAAC;AAC3E,OAAO,EAEL,uBAAuB,EAEvB,gBAAgB,GAKjB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAGL,gBAAgB,GAEjB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,gBAAgB,EAAsC,CAAC;AAChE,OAAO,EAAE,aAAa,IAAI,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACzE,OAAO,EAAE,QAAQ,IAAI,SAAS,EAAiB,MAAM,yBAAyB,CAAC;AAE/E,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC,MAAM,EAAqB,CAAC;AAC9D,OAAO;AACL,kDAAkD;AAClD,gBAAgB,IAAI,eAAe;AACnC,kDAAkD;AAClD,gBAAgB,IAAI,eAAe,GACpC,CAAC;AACF,iEAAiE;AACjE,MAAM,CAAC,MAAM,WAAW,GAAG,eAAe,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC;AACpD,mDAAmD;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,EAAE;QACtD,GAAG,CAAC,MAAM,WAAW,CAAC,EAAE,EAAE,OAAO,CAAC,CAAC;QACnC,MAAM;QACN,MAAM;KACP,CAAC,CAAC;IACH,OAAO,EAAY,CAAC;AACtB,CAAC"}
@@ -1,16 +0,0 @@
1
- import { Expand, FunctionArgs, FunctionReference, FunctionReturnType, FunctionType, FunctionVisibility } from "convex/server";
2
- import { GenericId } from "convex/values";
3
- export type RunQueryCtx = {
4
- runQuery: <Query extends FunctionReference<"query", "internal">>(query: Query, args: FunctionArgs<Query>) => Promise<FunctionReturnType<Query>>;
5
- };
6
- export type RunMutationCtx = RunQueryCtx & {
7
- runMutation: <Mutation extends FunctionReference<"mutation", "internal">>(mutation: Mutation, args: FunctionArgs<Mutation>) => Promise<FunctionReturnType<Mutation>>;
8
- };
9
- export type OpaqueIds<T> = T extends GenericId<infer _T> ? string : T extends (infer U)[] ? OpaqueIds<U>[] : T extends object ? {
10
- [K in keyof T]: OpaqueIds<T[K]>;
11
- } : T;
12
- export type UseApi<API> = Expand<{
13
- [mod in keyof API]: API[mod] extends FunctionReference<infer FType, "public", infer FArgs, infer FReturnType, infer FComponentPath> ? FunctionReference<FType, "internal", OpaqueIds<FArgs>, OpaqueIds<FReturnType>, FComponentPath> : UseApi<API[mod]>;
14
- }>;
15
- export declare function safeFunctionName(f: FunctionReference<FunctionType, FunctionVisibility>): any;
16
- //# sourceMappingURL=utils.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/client/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,MAAM,EACN,YAAY,EACZ,iBAAiB,EACjB,kBAAkB,EAClB,YAAY,EACZ,kBAAkB,EAGnB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAI1C,MAAM,MAAM,WAAW,GAAG;IACxB,QAAQ,EAAE,CAAC,KAAK,SAAS,iBAAiB,CAAC,OAAO,EAAE,UAAU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getFunctionName, } from "convex/server";
2
- export function safeFunctionName(f) {
3
- const address = getFunctionAddress(f);
4
- return (address.name ||
5
- address.reference ||
6
- address.functionHandle ||
7
- getFunctionName(f));
8
- }
9
- //# sourceMappingURL=utils.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/client/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAOL,kBAAkB,EAClB,eAAe,GAChB,MAAM,eAAe,CAAC;AA6CvB,MAAM,UAAU,gBAAgB,CAC9B,CAAsD;IAEtD,MAAM,OAAO,GAAG,kBAAkB,CAAC,CAAC,CAAC,CAAC;IACtC,OAAO,CACL,OAAO,CAAC,IAAI;QACZ,OAAO,CAAC,SAAS;QACjB,OAAO,CAAC,cAAc;QACtB,eAAe,CAAC,CAAC,CAAC,CACnB,CAAC;AACJ,CAAC"}
@@ -1,12 +0,0 @@
1
- /**
2
- * A utility for referencing Convex functions in your app's API.
3
- *
4
- * Usage:
5
- * ```js
6
- * const myFunctionReference = api.myModule.myFunction;
7
- * ```
8
- */
9
- export const api: import("convex/server").AnyApi;
10
- export const internal: import("convex/server").AnyApi;
11
- export const components: import("convex/server").AnyChildComponents;
12
- //# sourceMappingURL=api.d.ts.map
@@ -1 +0,0 @@
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,22 +0,0 @@
1
- /* eslint-disable */
2
- /**
3
- * Generated `api` utility.
4
- *
5
- * THIS CODE IS AUTOMATICALLY GENERATED.
6
- *
7
- * To regenerate, run `npx convex dev`.
8
- * @module
9
- */
10
- import { anyApi, componentsGeneric } from "convex/server";
11
- /**
12
- * A utility for referencing Convex functions in your app's API.
13
- *
14
- * Usage:
15
- * ```js
16
- * const myFunctionReference = api.myModule.myFunction;
17
- * ```
18
- */
19
- export const api = anyApi;
20
- export const internal = anyApi;
21
- export const components = componentsGeneric();
22
- //# sourceMappingURL=api.js.map
@@ -1 +0,0 @@
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,64 +0,0 @@
1
- /**
2
- * Define a query in this Convex app's public API.
3
- *
4
- * This function will be allowed to read your Convex database and will be accessible from the client.
5
- *
6
- * @param func - The query function. It receives a {@link QueryCtx} as its first argument.
7
- * @returns The wrapped query. Include this as an `export` to name it and make it accessible.
8
- */
9
- export const query: import("convex/server").QueryBuilder<any, "public">;
10
- /**
11
- * Define a query that is only accessible from other Convex functions (but not from the client).
12
- *
13
- * This function will be allowed to read from your Convex database. It will not be accessible from the client.
14
- *
15
- * @param func - The query function. It receives a {@link QueryCtx} as its first argument.
16
- * @returns The wrapped query. Include this as an `export` to name it and make it accessible.
17
- */
18
- export const internalQuery: import("convex/server").QueryBuilder<any, "internal">;
19
- /**
20
- * Define a mutation in this Convex app's public API.
21
- *
22
- * This function will be allowed to modify your Convex database and will be accessible from the client.
23
- *
24
- * @param func - The mutation function. It receives a {@link MutationCtx} as its first argument.
25
- * @returns The wrapped mutation. Include this as an `export` to name it and make it accessible.
26
- */
27
- export const mutation: import("convex/server").MutationBuilder<any, "public">;
28
- /**
29
- * Define a mutation that is only accessible from other Convex functions (but not from the client).
30
- *
31
- * This function will be allowed to modify your Convex database. It will not be accessible from the client.
32
- *
33
- * @param func - The mutation function. It receives a {@link MutationCtx} as its first argument.
34
- * @returns The wrapped mutation. Include this as an `export` to name it and make it accessible.
35
- */
36
- export const internalMutation: import("convex/server").MutationBuilder<any, "internal">;
37
- /**
38
- * Define an action in this Convex app's public API.
39
- *
40
- * An action is a function which can execute any JavaScript code, including non-deterministic
41
- * code and code with side-effects, like calling third-party services.
42
- * They can be run in Convex's JavaScript environment or in Node.js using the "use node" directive.
43
- * They can interact with the database indirectly by calling queries and mutations using the {@link ActionCtx}.
44
- *
45
- * @param func - The action. It receives an {@link ActionCtx} as its first argument.
46
- * @returns The wrapped action. Include this as an `export` to name it and make it accessible.
47
- */
48
- export const action: import("convex/server").ActionBuilder<any, "public">;
49
- /**
50
- * Define an action that is only accessible from other Convex functions (but not from the client).
51
- *
52
- * @param func - The function. It receives an {@link ActionCtx} as its first argument.
53
- * @returns The wrapped function. Include this as an `export` to name it and make it accessible.
54
- */
55
- export const internalAction: import("convex/server").ActionBuilder<any, "internal">;
56
- /**
57
- * Define a Convex HTTP action.
58
- *
59
- * @param func - The function. It receives an {@link ActionCtx} as its first argument, and a `Request` object
60
- * as its second.
61
- * @returns The wrapped endpoint function. Route a URL path to this function in `convex/http.js`.
62
- */
63
- export const httpAction: (func: (ctx: import("convex/server").GenericActionCtx<import("convex/server").GenericDataModel>, request: Request) => Promise<Response>) => import("convex/server").PublicHttpAction;
64
- //# sourceMappingURL=server.d.ts.map
@@ -1 +0,0 @@
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,74 +0,0 @@
1
- /* eslint-disable */
2
- /**
3
- * Generated utilities for implementing server-side Convex query and mutation functions.
4
- *
5
- * THIS CODE IS AUTOMATICALLY GENERATED.
6
- *
7
- * To regenerate, run `npx convex dev`.
8
- * @module
9
- */
10
- import { actionGeneric, httpActionGeneric, queryGeneric, mutationGeneric, internalActionGeneric, internalMutationGeneric, internalQueryGeneric, componentsGeneric, } from "convex/server";
11
- /**
12
- * Define a query in this Convex app's public API.
13
- *
14
- * This function will be allowed to read your Convex database and will be accessible from the client.
15
- *
16
- * @param func - The query function. It receives a {@link QueryCtx} as its first argument.
17
- * @returns The wrapped query. Include this as an `export` to name it and make it accessible.
18
- */
19
- export const query = queryGeneric;
20
- /**
21
- * Define a query that is only accessible from other Convex functions (but not from the client).
22
- *
23
- * This function will be allowed to read from your Convex database. It will not be accessible from the client.
24
- *
25
- * @param func - The query function. It receives a {@link QueryCtx} as its first argument.
26
- * @returns The wrapped query. Include this as an `export` to name it and make it accessible.
27
- */
28
- export const internalQuery = internalQueryGeneric;
29
- /**
30
- * Define a mutation in this Convex app's public API.
31
- *
32
- * This function will be allowed to modify your Convex database and will be accessible from the client.
33
- *
34
- * @param func - The mutation function. It receives a {@link MutationCtx} as its first argument.
35
- * @returns The wrapped mutation. Include this as an `export` to name it and make it accessible.
36
- */
37
- export const mutation = mutationGeneric;
38
- /**
39
- * Define a mutation that is only accessible from other Convex functions (but not from the client).
40
- *
41
- * This function will be allowed to modify your Convex database. It will not be accessible from the client.
42
- *
43
- * @param func - The mutation function. It receives a {@link MutationCtx} as its first argument.
44
- * @returns The wrapped mutation. Include this as an `export` to name it and make it accessible.
45
- */
46
- export const internalMutation = internalMutationGeneric;
47
- /**
48
- * Define an action in this Convex app's public API.
49
- *
50
- * An action is a function which can execute any JavaScript code, including non-deterministic
51
- * code and code with side-effects, like calling third-party services.
52
- * They can be run in Convex's JavaScript environment or in Node.js using the "use node" directive.
53
- * They can interact with the database indirectly by calling queries and mutations using the {@link ActionCtx}.
54
- *
55
- * @param func - The action. It receives an {@link ActionCtx} as its first argument.
56
- * @returns The wrapped action. Include this as an `export` to name it and make it accessible.
57
- */
58
- export const action = actionGeneric;
59
- /**
60
- * Define an action that is only accessible from other Convex functions (but not from the client).
61
- *
62
- * @param func - The function. It receives an {@link ActionCtx} as its first argument.
63
- * @returns The wrapped function. Include this as an `export` to name it and make it accessible.
64
- */
65
- export const internalAction = internalActionGeneric;
66
- /**
67
- * Define a Convex HTTP action.
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`.
72
- */
73
- export const httpAction = httpActionGeneric;
74
- //# sourceMappingURL=server.js.map
@@ -1 +0,0 @@
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,89 +0,0 @@
1
- import { Infer } from "convex/values";
2
- import { MutationCtx } from "./_generated/server.js";
3
- export type CompleteJob = Infer<typeof completeArgs.fields.jobs.element>;
4
- export declare const completeArgs: import("convex/values").VObject<{
5
- jobs: {
6
- workId: import("convex/values").GenericId<"work">;
7
- runResult: {
8
- kind: "success";
9
- returnValue: any;
10
- } | {
11
- kind: "failed";
12
- error: string;
13
- } | {
14
- kind: "canceled";
15
- };
16
- attempt: number;
17
- }[];
18
- }, {
19
- jobs: import("convex/values").VArray<{
20
- workId: import("convex/values").GenericId<"work">;
21
- runResult: {
22
- kind: "success";
23
- returnValue: any;
24
- } | {
25
- kind: "failed";
26
- error: string;
27
- } | {
28
- kind: "canceled";
29
- };
30
- attempt: number;
31
- }[], import("convex/values").VObject<{
32
- workId: import("convex/values").GenericId<"work">;
33
- runResult: {
34
- kind: "success";
35
- returnValue: any;
36
- } | {
37
- kind: "failed";
38
- error: string;
39
- } | {
40
- kind: "canceled";
41
- };
42
- attempt: number;
43
- }, {
44
- runResult: import("convex/values").VUnion<{
45
- kind: "success";
46
- returnValue: any;
47
- } | {
48
- kind: "failed";
49
- error: string;
50
- } | {
51
- kind: "canceled";
52
- }, [import("convex/values").VObject<{
53
- kind: "success";
54
- returnValue: any;
55
- }, {
56
- kind: import("convex/values").VLiteral<"success", "required">;
57
- returnValue: import("convex/values").VAny<any, "required", string>;
58
- }, "required", "kind" | "returnValue" | `returnValue.${string}`>, import("convex/values").VObject<{
59
- kind: "failed";
60
- error: string;
61
- }, {
62
- kind: import("convex/values").VLiteral<"failed", "required">;
63
- error: import("convex/values").VString<string, "required">;
64
- }, "required", "kind" | "error">, import("convex/values").VObject<{
65
- kind: "canceled";
66
- }, {
67
- kind: import("convex/values").VLiteral<"canceled", "required">;
68
- }, "required", "kind">], "required", "kind" | "returnValue" | `returnValue.${string}` | "error">;
69
- workId: import("convex/values").VId<import("convex/values").GenericId<"work">, "required">;
70
- attempt: import("convex/values").VFloat64<number, "required">;
71
- }, "required", "workId" | "runResult" | "runResult.kind" | "runResult.returnValue" | `runResult.returnValue.${string}` | "runResult.error" | "attempt">, "required">;
72
- }, "required", "jobs">;
73
- export declare function completeHandler(ctx: MutationCtx, args: Infer<typeof completeArgs>): Promise<void>;
74
- export declare const complete: import("convex/server").RegisteredMutation<"internal", {
75
- jobs: {
76
- workId: import("convex/values").GenericId<"work">;
77
- runResult: {
78
- kind: "success";
79
- returnValue: any;
80
- } | {
81
- kind: "failed";
82
- error: string;
83
- } | {
84
- kind: "canceled";
85
- };
86
- attempt: number;
87
- }[];
88
- }, Promise<void>>;
89
- //# sourceMappingURL=complete.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"complete.d.ts","sourceRoot":"","sources":["../../../src/component/complete.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAK,MAAM,eAAe,CAAC;AAEzC,OAAO,EAAoB,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAMvE,MAAM,MAAM,WAAW,GAAG,KAAK,CAAC,OAAO,YAAY,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;AAEzE,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;sBAQvB,CAAC;AACH,wBAAsB,eAAe,CACnC,GAAG,EAAE,WAAW,EAChB,IAAI,EAAE,KAAK,CAAC,OAAO,YAAY,CAAC,iBAiFjC;AASD,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;iBAGnB,CAAC"}