convex-batch-processor 1.0.2
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/LICENSE +21 -0
- package/README.md +337 -0
- package/dist/client/index.d.ts +194 -0
- package/dist/client/index.d.ts.map +1 -0
- package/dist/client/index.js +75 -0
- package/dist/client/index.js.map +1 -0
- package/dist/component/_generated/api.d.ts +34 -0
- package/dist/component/_generated/api.d.ts.map +1 -0
- package/dist/component/_generated/api.js +31 -0
- package/dist/component/_generated/api.js.map +1 -0
- package/dist/component/_generated/component.d.ts +77 -0
- package/dist/component/_generated/component.d.ts.map +1 -0
- package/dist/component/_generated/component.js +11 -0
- package/dist/component/_generated/component.js.map +1 -0
- package/dist/component/_generated/dataModel.d.ts +46 -0
- package/dist/component/_generated/dataModel.d.ts.map +1 -0
- package/dist/component/_generated/dataModel.js +11 -0
- package/dist/component/_generated/dataModel.js.map +1 -0
- package/dist/component/_generated/server.d.ts +121 -0
- package/dist/component/_generated/server.d.ts.map +1 -0
- package/dist/component/_generated/server.js +78 -0
- package/dist/component/_generated/server.js.map +1 -0
- package/dist/component/convex.config.d.ts +3 -0
- package/dist/component/convex.config.d.ts.map +1 -0
- package/dist/component/convex.config.js +3 -0
- package/dist/component/convex.config.js.map +1 -0
- package/dist/component/lib.d.ts +261 -0
- package/dist/component/lib.d.ts.map +1 -0
- package/dist/component/lib.js +629 -0
- package/dist/component/lib.js.map +1 -0
- package/dist/component/schema.d.ts +100 -0
- package/dist/component/schema.d.ts.map +1 -0
- package/dist/component/schema.js +49 -0
- package/dist/component/schema.js.map +1 -0
- package/package.json +63 -0
- package/src/client/index.test.ts +121 -0
- package/src/client/index.ts +308 -0
- package/src/component/_generated/api.ts +50 -0
- package/src/component/_generated/component.ts +133 -0
- package/src/component/_generated/dataModel.ts +60 -0
- package/src/component/_generated/server.ts +156 -0
- package/src/component/convex.config.ts +3 -0
- package/src/component/lib.ts +792 -0
- package/src/component/schema.ts +57 -0
|
@@ -0,0 +1,261 @@
|
|
|
1
|
+
export declare const addItems: import("convex/server").RegisteredMutation<"public", {
|
|
2
|
+
items: any[];
|
|
3
|
+
batchId: string;
|
|
4
|
+
config: {
|
|
5
|
+
maxBatchSize: number;
|
|
6
|
+
flushIntervalMs: number;
|
|
7
|
+
processBatchHandle: string;
|
|
8
|
+
};
|
|
9
|
+
}, Promise<{
|
|
10
|
+
batchId: string;
|
|
11
|
+
itemCount: number;
|
|
12
|
+
flushed: boolean;
|
|
13
|
+
status: string;
|
|
14
|
+
}>>;
|
|
15
|
+
export declare const flushBatch: import("convex/server").RegisteredMutation<"public", {
|
|
16
|
+
batchId: string;
|
|
17
|
+
}, Promise<{
|
|
18
|
+
batchId: string;
|
|
19
|
+
itemCount: number;
|
|
20
|
+
flushed: boolean;
|
|
21
|
+
reason: string;
|
|
22
|
+
status?: undefined;
|
|
23
|
+
} | {
|
|
24
|
+
batchId: string;
|
|
25
|
+
itemCount: number;
|
|
26
|
+
flushed: boolean;
|
|
27
|
+
status: string;
|
|
28
|
+
reason?: undefined;
|
|
29
|
+
}>>;
|
|
30
|
+
export declare const getBatchStatus: import("convex/server").RegisteredQuery<"public", {
|
|
31
|
+
batchId: string;
|
|
32
|
+
}, Promise<{
|
|
33
|
+
batchId: string;
|
|
34
|
+
itemCount: number;
|
|
35
|
+
status: "accumulating" | "flushing" | "completed";
|
|
36
|
+
createdAt: number;
|
|
37
|
+
lastUpdatedAt: number;
|
|
38
|
+
config: {
|
|
39
|
+
maxBatchSize: number;
|
|
40
|
+
flushIntervalMs: number;
|
|
41
|
+
processBatchHandle: string;
|
|
42
|
+
};
|
|
43
|
+
} | null>>;
|
|
44
|
+
export declare const getFlushHistory: import("convex/server").RegisteredQuery<"public", {
|
|
45
|
+
limit?: number | undefined;
|
|
46
|
+
batchId: string;
|
|
47
|
+
}, Promise<{
|
|
48
|
+
_id: import("convex/values").GenericId<"flushHistory">;
|
|
49
|
+
_creationTime: number;
|
|
50
|
+
errorMessage?: string | undefined;
|
|
51
|
+
batchId: string;
|
|
52
|
+
itemCount: number;
|
|
53
|
+
flushedAt: number;
|
|
54
|
+
durationMs: number;
|
|
55
|
+
success: boolean;
|
|
56
|
+
}[]>>;
|
|
57
|
+
export declare const deleteBatch: import("convex/server").RegisteredMutation<"public", {
|
|
58
|
+
batchId: string;
|
|
59
|
+
}, Promise<{
|
|
60
|
+
deleted: boolean;
|
|
61
|
+
reason: string;
|
|
62
|
+
} | {
|
|
63
|
+
deleted: boolean;
|
|
64
|
+
reason?: undefined;
|
|
65
|
+
}>>;
|
|
66
|
+
export declare const getBatch: import("convex/server").RegisteredQuery<"internal", {
|
|
67
|
+
batchId: string;
|
|
68
|
+
}, Promise<{
|
|
69
|
+
_id: import("convex/values").GenericId<"batches">;
|
|
70
|
+
_creationTime: number;
|
|
71
|
+
scheduledFlushId?: import("convex/values").GenericId<"_scheduled_functions"> | undefined;
|
|
72
|
+
items: any[];
|
|
73
|
+
batchId: string;
|
|
74
|
+
config: {
|
|
75
|
+
maxBatchSize: number;
|
|
76
|
+
flushIntervalMs: number;
|
|
77
|
+
processBatchHandle: string;
|
|
78
|
+
};
|
|
79
|
+
status: "accumulating" | "flushing" | "completed";
|
|
80
|
+
itemCount: number;
|
|
81
|
+
createdAt: number;
|
|
82
|
+
lastUpdatedAt: number;
|
|
83
|
+
} | null>>;
|
|
84
|
+
export declare const executeFlush: import("convex/server").RegisteredAction<"internal", {
|
|
85
|
+
items: any[];
|
|
86
|
+
processBatchHandle: string;
|
|
87
|
+
batchDocId: import("convex/values").GenericId<"batches">;
|
|
88
|
+
}, Promise<{
|
|
89
|
+
success: boolean;
|
|
90
|
+
errorMessage: string | undefined;
|
|
91
|
+
durationMs: number;
|
|
92
|
+
}>>;
|
|
93
|
+
export declare const recordFlushResult: import("convex/server").RegisteredMutation<"internal", {
|
|
94
|
+
errorMessage?: string | undefined;
|
|
95
|
+
itemCount: number;
|
|
96
|
+
durationMs: number;
|
|
97
|
+
success: boolean;
|
|
98
|
+
batchDocId: import("convex/values").GenericId<"batches">;
|
|
99
|
+
}, Promise<void>>;
|
|
100
|
+
export declare const markBatchFlushing: import("convex/server").RegisteredMutation<"internal", {
|
|
101
|
+
batchDocId: import("convex/values").GenericId<"batches">;
|
|
102
|
+
}, Promise<{
|
|
103
|
+
items: any[];
|
|
104
|
+
processBatchHandle: string;
|
|
105
|
+
} | null>>;
|
|
106
|
+
export declare const scheduledIntervalFlush: import("convex/server").RegisteredAction<"internal", {
|
|
107
|
+
batchDocId: import("convex/values").GenericId<"batches">;
|
|
108
|
+
}, Promise<{
|
|
109
|
+
flushed: boolean;
|
|
110
|
+
reason?: string;
|
|
111
|
+
success?: boolean;
|
|
112
|
+
errorMessage?: string;
|
|
113
|
+
durationMs?: number;
|
|
114
|
+
}>>;
|
|
115
|
+
export declare const startIteratorJob: import("convex/server").RegisteredMutation<"public", {
|
|
116
|
+
jobId: string;
|
|
117
|
+
config: {
|
|
118
|
+
delayBetweenBatchesMs?: number | undefined;
|
|
119
|
+
onCompleteHandle?: string | undefined;
|
|
120
|
+
maxRetries?: number | undefined;
|
|
121
|
+
batchSize: number;
|
|
122
|
+
processBatchHandle: string;
|
|
123
|
+
getNextBatchHandle: string;
|
|
124
|
+
};
|
|
125
|
+
}, Promise<{
|
|
126
|
+
jobId: string;
|
|
127
|
+
status: string;
|
|
128
|
+
}>>;
|
|
129
|
+
export declare const pauseIteratorJob: import("convex/server").RegisteredMutation<"public", {
|
|
130
|
+
jobId: string;
|
|
131
|
+
}, Promise<{
|
|
132
|
+
jobId: string;
|
|
133
|
+
status: string;
|
|
134
|
+
}>>;
|
|
135
|
+
export declare const resumeIteratorJob: import("convex/server").RegisteredMutation<"public", {
|
|
136
|
+
jobId: string;
|
|
137
|
+
}, Promise<{
|
|
138
|
+
jobId: string;
|
|
139
|
+
status: string;
|
|
140
|
+
}>>;
|
|
141
|
+
export declare const cancelIteratorJob: import("convex/server").RegisteredMutation<"public", {
|
|
142
|
+
jobId: string;
|
|
143
|
+
}, Promise<{
|
|
144
|
+
jobId: string;
|
|
145
|
+
status: "completed" | "failed";
|
|
146
|
+
reason: string;
|
|
147
|
+
} | {
|
|
148
|
+
jobId: string;
|
|
149
|
+
status: string;
|
|
150
|
+
reason?: undefined;
|
|
151
|
+
}>>;
|
|
152
|
+
export declare const getIteratorJobStatus: import("convex/server").RegisteredQuery<"public", {
|
|
153
|
+
jobId: string;
|
|
154
|
+
}, Promise<{
|
|
155
|
+
jobId: string;
|
|
156
|
+
status: "completed" | "pending" | "running" | "paused" | "failed";
|
|
157
|
+
processedCount: number;
|
|
158
|
+
cursor: string | undefined;
|
|
159
|
+
retryCount: number;
|
|
160
|
+
errorMessage: string | undefined;
|
|
161
|
+
createdAt: number;
|
|
162
|
+
lastRunAt: number | undefined;
|
|
163
|
+
config: {
|
|
164
|
+
batchSize: number;
|
|
165
|
+
delayBetweenBatchesMs: number;
|
|
166
|
+
};
|
|
167
|
+
} | null>>;
|
|
168
|
+
export declare const listIteratorJobs: import("convex/server").RegisteredQuery<"public", {
|
|
169
|
+
limit?: number | undefined;
|
|
170
|
+
status?: "completed" | "pending" | "running" | "paused" | "failed" | undefined;
|
|
171
|
+
}, Promise<{
|
|
172
|
+
jobId: string;
|
|
173
|
+
status: "completed" | "pending" | "running" | "paused" | "failed";
|
|
174
|
+
processedCount: number;
|
|
175
|
+
createdAt: number;
|
|
176
|
+
lastRunAt: number | undefined;
|
|
177
|
+
errorMessage: string | undefined;
|
|
178
|
+
}[]>>;
|
|
179
|
+
export declare const deleteIteratorJob: import("convex/server").RegisteredMutation<"public", {
|
|
180
|
+
jobId: string;
|
|
181
|
+
}, Promise<{
|
|
182
|
+
deleted: boolean;
|
|
183
|
+
reason: string;
|
|
184
|
+
} | {
|
|
185
|
+
deleted: boolean;
|
|
186
|
+
reason?: undefined;
|
|
187
|
+
}>>;
|
|
188
|
+
export declare const getIteratorJob: import("convex/server").RegisteredQuery<"internal", {
|
|
189
|
+
jobId: string;
|
|
190
|
+
}, Promise<{
|
|
191
|
+
_id: import("convex/values").GenericId<"iteratorJobs">;
|
|
192
|
+
_creationTime: number;
|
|
193
|
+
cursor?: string | undefined;
|
|
194
|
+
errorMessage?: string | undefined;
|
|
195
|
+
lastRunAt?: number | undefined;
|
|
196
|
+
jobId: string;
|
|
197
|
+
processedCount: number;
|
|
198
|
+
config: {
|
|
199
|
+
onCompleteHandle?: string | undefined;
|
|
200
|
+
maxRetries?: number | undefined;
|
|
201
|
+
batchSize: number;
|
|
202
|
+
processBatchHandle: string;
|
|
203
|
+
delayBetweenBatchesMs: number;
|
|
204
|
+
getNextBatchHandle: string;
|
|
205
|
+
};
|
|
206
|
+
status: "completed" | "pending" | "running" | "paused" | "failed";
|
|
207
|
+
createdAt: number;
|
|
208
|
+
retryCount: number;
|
|
209
|
+
} | null>>;
|
|
210
|
+
export declare const getIteratorJobById: import("convex/server").RegisteredQuery<"internal", {
|
|
211
|
+
jobDocId: import("convex/values").GenericId<"iteratorJobs">;
|
|
212
|
+
}, Promise<{
|
|
213
|
+
_id: import("convex/values").GenericId<"iteratorJobs">;
|
|
214
|
+
_creationTime: number;
|
|
215
|
+
cursor?: string | undefined;
|
|
216
|
+
errorMessage?: string | undefined;
|
|
217
|
+
lastRunAt?: number | undefined;
|
|
218
|
+
jobId: string;
|
|
219
|
+
processedCount: number;
|
|
220
|
+
config: {
|
|
221
|
+
onCompleteHandle?: string | undefined;
|
|
222
|
+
maxRetries?: number | undefined;
|
|
223
|
+
batchSize: number;
|
|
224
|
+
processBatchHandle: string;
|
|
225
|
+
delayBetweenBatchesMs: number;
|
|
226
|
+
getNextBatchHandle: string;
|
|
227
|
+
};
|
|
228
|
+
status: "completed" | "pending" | "running" | "paused" | "failed";
|
|
229
|
+
createdAt: number;
|
|
230
|
+
retryCount: number;
|
|
231
|
+
} | null>>;
|
|
232
|
+
export declare const processNextBatch: import("convex/server").RegisteredAction<"internal", {
|
|
233
|
+
jobDocId: import("convex/values").GenericId<"iteratorJobs">;
|
|
234
|
+
}, Promise<{
|
|
235
|
+
processed: boolean;
|
|
236
|
+
done?: boolean;
|
|
237
|
+
processedCount?: number;
|
|
238
|
+
reason?: string;
|
|
239
|
+
error?: string;
|
|
240
|
+
retryCount?: number;
|
|
241
|
+
}>>;
|
|
242
|
+
export declare const updateJobProgress: import("convex/server").RegisteredMutation<"internal", {
|
|
243
|
+
cursor?: string | undefined;
|
|
244
|
+
processedCount: number;
|
|
245
|
+
jobDocId: import("convex/values").GenericId<"iteratorJobs">;
|
|
246
|
+
}, Promise<void>>;
|
|
247
|
+
export declare const markJobCompleted: import("convex/server").RegisteredMutation<"internal", {
|
|
248
|
+
processedCount: number;
|
|
249
|
+
jobDocId: import("convex/values").GenericId<"iteratorJobs">;
|
|
250
|
+
}, Promise<void>>;
|
|
251
|
+
export declare const markJobFailed: import("convex/server").RegisteredMutation<"internal", {
|
|
252
|
+
retryCount: number;
|
|
253
|
+
errorMessage: string;
|
|
254
|
+
jobDocId: import("convex/values").GenericId<"iteratorJobs">;
|
|
255
|
+
}, Promise<void>>;
|
|
256
|
+
export declare const incrementRetryCount: import("convex/server").RegisteredMutation<"internal", {
|
|
257
|
+
retryCount: number;
|
|
258
|
+
errorMessage: string;
|
|
259
|
+
jobDocId: import("convex/values").GenericId<"iteratorJobs">;
|
|
260
|
+
}, Promise<void>>;
|
|
261
|
+
//# sourceMappingURL=lib.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lib.d.ts","sourceRoot":"","sources":["../../src/component/lib.ts"],"names":[],"mappings":"AAgBA,eAAO,MAAM,QAAQ;;;;;;;;;;;;;GAkHnB,CAAC;AAEH,eAAO,MAAM,UAAU;;;;;;;;;;;;;;GA8CrB,CAAC;AAEH,eAAO,MAAM,cAAc;;;;;;;;;;;;;UAqBzB,CAAC;AAEH,eAAO,MAAM,eAAe;;;;;;;;;;;;KAiB1B,CAAC;AAEH,eAAO,MAAM,WAAW;;;;;;;;GA2BtB,CAAC;AAMH,eAAO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