@rivetkit/rivetkit-wasm 0.0.0-main.9d355a2 → 0.0.0-main.b2d3b94

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.
@@ -203,31 +203,8 @@ function debugString(val) {
203
203
  return className;
204
204
  }
205
205
 
206
- function passArray8ToWasm0(arg, malloc) {
207
- const ptr = malloc(arg.length * 1, 1) >>> 0;
208
- getUint8ArrayMemory0().set(arg, ptr / 1);
209
- WASM_VECTOR_LEN = arg.length;
210
- return ptr;
211
- }
212
-
213
- function takeFromExternrefTable0(idx) {
214
- const value = wasm.__wbindgen_export_4.get(idx);
215
- wasm.__externref_table_dealloc(idx);
216
- return value;
217
- }
218
-
219
- function _assertClass(instance, klass) {
220
- if (!(instance instanceof klass)) {
221
- throw new Error(`expected instance of ${klass.name}`);
222
- }
223
- }
224
- /**
225
- * @param {Promise<any>} promise
226
- * @returns {Promise<any>}
227
- */
228
- export function awaitPromise(promise) {
229
- const ret = wasm.awaitPromise(promise);
230
- return ret;
206
+ export function start() {
207
+ wasm.start();
231
208
  }
232
209
 
233
210
  /**
@@ -246,44 +223,66 @@ export function bridgeRivetErrorPrefix() {
246
223
  }
247
224
  }
248
225
 
226
+ function passArray8ToWasm0(arg, malloc) {
227
+ const ptr = malloc(arg.length * 1, 1) >>> 0;
228
+ getUint8ArrayMemory0().set(arg, ptr / 1);
229
+ WASM_VECTOR_LEN = arg.length;
230
+ return ptr;
231
+ }
249
232
  /**
250
233
  * @param {Uint8Array} bytes
251
234
  * @returns {Uint8Array}
252
235
  */
253
- export function uint8ArrayFromBytes(bytes) {
236
+ export function roundTripBytes(bytes) {
254
237
  const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
255
238
  const len0 = WASM_VECTOR_LEN;
256
- const ret = wasm.uint8ArrayFromBytes(ptr0, len0);
257
- return ret;
239
+ const ret = wasm.roundTripBytes(ptr0, len0);
240
+ var v2 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
241
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
242
+ return v2;
258
243
  }
259
244
 
260
245
  /**
261
246
  * @param {Uint8Array} bytes
262
247
  * @returns {Uint8Array}
263
248
  */
264
- export function roundTripBytes(bytes) {
249
+ export function uint8ArrayFromBytes(bytes) {
265
250
  const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
266
251
  const len0 = WASM_VECTOR_LEN;
267
- const ret = wasm.roundTripBytes(ptr0, len0);
268
- var v2 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
269
- wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
270
- return v2;
252
+ const ret = wasm.uint8ArrayFromBytes(ptr0, len0);
253
+ return ret;
271
254
  }
272
255
 
273
- export function start() {
274
- wasm.start();
256
+ /**
257
+ * @param {Promise<any>} promise
258
+ * @returns {Promise<any>}
259
+ */
260
+ export function awaitPromise(promise) {
261
+ const ret = wasm.awaitPromise(promise);
262
+ return ret;
275
263
  }
276
264
 
277
- function __wbg_adapter_46(arg0, arg1, arg2) {
278
- wasm.closure1598_externref_shim(arg0, arg1, arg2);
265
+ function _assertClass(instance, klass) {
266
+ if (!(instance instanceof klass)) {
267
+ throw new Error(`expected instance of ${klass.name}`);
268
+ }
279
269
  }
280
270
 
281
- function __wbg_adapter_55(arg0, arg1, arg2) {
282
- wasm.closure1950_externref_shim(arg0, arg1, arg2);
271
+ function takeFromExternrefTable0(idx) {
272
+ const value = wasm.__wbindgen_export_4.get(idx);
273
+ wasm.__externref_table_dealloc(idx);
274
+ return value;
275
+ }
276
+ function __wbg_adapter_50(arg0, arg1, arg2) {
277
+ wasm.closure1987_externref_shim(arg0, arg1, arg2);
283
278
  }
284
279
 
285
- function __wbg_adapter_268(arg0, arg1, arg2, arg3) {
286
- wasm.closure2181_externref_shim(arg0, arg1, arg2, arg3);
280
+ function __wbg_adapter_59(arg0, arg1, arg2) {
281
+ wasm.closure2385_externref_shim(arg0, arg1, arg2);
282
+ }
283
+
284
+ function __wbg_adapter_297(arg0, arg1, arg2, arg3) {
285
+ wasm.closure2620_externref_shim(arg0, arg1, arg2, arg3);
287
286
  }
288
287
 
289
288
  const __wbindgen_enum_BinaryType = ["blob", "arraybuffer"];
@@ -313,12 +312,6 @@ export class ActorContext {
313
312
  const ptr = this.__destroy_into_raw();
314
313
  wasm.__wbg_actorcontext_free(ptr, 0);
315
314
  }
316
- /**
317
- * @param {Promise<any>} promise
318
- */
319
- keepAwake(promise) {
320
- wasm.actorcontext_keepAwake(this.__wbg_ptr, promise);
321
- }
322
315
  /**
323
316
  * @param {any} payload
324
317
  * @returns {Promise<void>}
@@ -327,6 +320,79 @@ export class ActorContext {
327
320
  const ret = wasm.actorcontext_saveState(this.__wbg_ptr, payload);
328
321
  return ret;
329
322
  }
323
+ /**
324
+ * @param {Uint8Array} params
325
+ * @param {any} request
326
+ * @returns {Promise<ConnHandle>}
327
+ */
328
+ connectConn(params, request) {
329
+ const ptr0 = passArray8ToWasm0(params, wasm.__wbindgen_malloc);
330
+ const len0 = WASM_VECTOR_LEN;
331
+ const ret = wasm.actorcontext_connectConn(this.__wbg_ptr, ptr0, len0, request);
332
+ return ret;
333
+ }
334
+ /**
335
+ * @param {number | null} [timestamp_ms]
336
+ * @returns {Promise<void>}
337
+ */
338
+ setRunWakeAt(timestamp_ms) {
339
+ const ret = wasm.actorcontext_setRunWakeAt(this.__wbg_ptr, !isLikeNone(timestamp_ms), isLikeNone(timestamp_ms) ? 0 : timestamp_ms);
340
+ return ret;
341
+ }
342
+ /**
343
+ * @param {any} opts
344
+ * @returns {Promise<void>}
345
+ */
346
+ requestSaveAndWait(opts) {
347
+ const ret = wasm.actorcontext_requestSaveAndWait(this.__wbg_ptr, opts);
348
+ return ret;
349
+ }
350
+ /**
351
+ * @param {string | null} [bearer_token]
352
+ * @returns {Promise<void>}
353
+ */
354
+ verifyInspectorAuth(bearer_token) {
355
+ var ptr0 = isLikeNone(bearer_token) ? 0 : passStringToWasm0(bearer_token, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
356
+ var len0 = WASM_VECTOR_LEN;
357
+ const ret = wasm.actorcontext_verifyInspectorAuth(this.__wbg_ptr, ptr0, len0);
358
+ return ret;
359
+ }
360
+ /**
361
+ * @param {number | null} [timeout_ms]
362
+ * @returns {Promise<ActorStateTransaction>}
363
+ */
364
+ beginStateTransaction(timeout_ms) {
365
+ const ret = wasm.actorcontext_beginStateTransaction(this.__wbg_ptr, !isLikeNone(timeout_ms), isLikeNone(timeout_ms) ? 0 : timeout_ms);
366
+ return ret;
367
+ }
368
+ /**
369
+ * @param {any} writes
370
+ * @returns {Promise<void>}
371
+ */
372
+ saveStateAndWorkflowBatch(writes) {
373
+ const ret = wasm.actorcontext_saveStateAndWorkflowBatch(this.__wbg_ptr, writes);
374
+ return ret;
375
+ }
376
+ /**
377
+ * @returns {Promise<boolean>}
378
+ */
379
+ waitForTrackedShutdownWork() {
380
+ const ret = wasm.actorcontext_waitForTrackedShutdownWork(this.__wbg_ptr);
381
+ return ret;
382
+ }
383
+ /**
384
+ * @returns {Promise<void>}
385
+ */
386
+ waitForTrackedShutdownWorkUnbounded() {
387
+ const ret = wasm.actorcontext_waitForTrackedShutdownWorkUnbounded(this.__wbg_ptr);
388
+ return ret;
389
+ }
390
+ /**
391
+ * @param {Promise<any>} promise
392
+ */
393
+ keepAwake(promise) {
394
+ wasm.actorcontext_keepAwake(this.__wbg_ptr, promise);
395
+ }
330
396
  /**
331
397
  * @param {Promise<any>} promise
332
398
  */
@@ -343,17 +409,6 @@ export class ActorContext {
343
409
  }
344
410
  return takeFromExternrefTable0(ret[0]);
345
411
  }
346
- /**
347
- * @param {Uint8Array} params
348
- * @param {any} request
349
- * @returns {Promise<ConnHandle>}
350
- */
351
- connectConn(params, request) {
352
- const ptr0 = passArray8ToWasm0(params, wasm.__wbindgen_malloc);
353
- const len0 = WASM_VECTOR_LEN;
354
- const ret = wasm.actorcontext_connectConn(this.__wbg_ptr, ptr0, len0, request);
355
- return ret;
356
- }
357
412
  /**
358
413
  * @param {any} opts
359
414
  */
@@ -400,29 +455,14 @@ export class ActorContext {
400
455
  wasm.actorcontext_endOnStateChange(this.__wbg_ptr);
401
456
  }
402
457
  restartRunHandler() {
403
- wasm.actorcontext_restartRunHandler(this.__wbg_ptr);
458
+ const ret = wasm.actorcontext_restartRunHandler(this.__wbg_ptr);
459
+ if (ret[1]) {
460
+ throw takeFromExternrefTable0(ret[0]);
461
+ }
404
462
  }
405
463
  beginOnStateChange() {
406
464
  wasm.actorcontext_beginOnStateChange(this.__wbg_ptr);
407
465
  }
408
- /**
409
- * @param {any} opts
410
- * @returns {Promise<void>}
411
- */
412
- requestSaveAndWait(opts) {
413
- const ret = wasm.actorcontext_requestSaveAndWait(this.__wbg_ptr, opts);
414
- return ret;
415
- }
416
- /**
417
- * @param {string | null} [bearer_token]
418
- * @returns {Promise<void>}
419
- */
420
- verifyInspectorAuth(bearer_token) {
421
- var ptr0 = isLikeNone(bearer_token) ? 0 : passStringToWasm0(bearer_token, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
422
- var len0 = WASM_VECTOR_LEN;
423
- const ret = wasm.actorcontext_verifyInspectorAuth(this.__wbg_ptr, ptr0, len0);
424
- return ret;
425
- }
426
466
  /**
427
467
  * @param {number} region_id
428
468
  */
@@ -450,13 +490,6 @@ export class ActorContext {
450
490
  const ret = wasm.actorcontext_kv(this.__wbg_ptr);
451
491
  return Kv.__wrap(ret);
452
492
  }
453
- /**
454
- * @returns {Promise<boolean>}
455
- */
456
- waitForTrackedShutdownWork() {
457
- const ret = wasm.actorcontext_waitForTrackedShutdownWork(this.__wbg_ptr);
458
- return ret;
459
- }
460
493
  /**
461
494
  * @returns {Array<any>}
462
495
  */
@@ -490,13 +523,6 @@ export class ActorContext {
490
523
  const ret = wasm.actorcontext_sql(this.__wbg_ptr);
491
524
  return SqliteDb.__wrap(ret);
492
525
  }
493
- /**
494
- * @returns {Promise<void>}
495
- */
496
- waitForTrackedShutdownWorkUnbounded() {
497
- const ret = wasm.actorcontext_waitForTrackedShutdownWorkUnbounded(this.__wbg_ptr);
498
- return ret;
499
- }
500
526
  /**
501
527
  * @returns {string}
502
528
  */
@@ -638,12 +664,73 @@ export class ActorFactory {
638
664
  }
639
665
  }
640
666
 
667
+ const ActorStateTransactionFinalization = (typeof FinalizationRegistry === 'undefined')
668
+ ? { register: () => {}, unregister: () => {} }
669
+ : new FinalizationRegistry(ptr => wasm.__wbg_actorstatetransaction_free(ptr >>> 0, 1));
670
+
671
+ export class ActorStateTransaction {
672
+
673
+ static __wrap(ptr) {
674
+ ptr = ptr >>> 0;
675
+ const obj = Object.create(ActorStateTransaction.prototype);
676
+ obj.__wbg_ptr = ptr;
677
+ ActorStateTransactionFinalization.register(obj, obj.__wbg_ptr, obj);
678
+ return obj;
679
+ }
680
+
681
+ __destroy_into_raw() {
682
+ const ptr = this.__wbg_ptr;
683
+ this.__wbg_ptr = 0;
684
+ ActorStateTransactionFinalization.unregister(this);
685
+ return ptr;
686
+ }
687
+
688
+ free() {
689
+ const ptr = this.__destroy_into_raw();
690
+ wasm.__wbg_actorstatetransaction_free(ptr, 0);
691
+ }
692
+ /**
693
+ * @param {any} payload
694
+ * @returns {Promise<void>}
695
+ */
696
+ commit(payload) {
697
+ const ret = wasm.actorstatetransaction_commit(this.__wbg_ptr, payload);
698
+ return ret;
699
+ }
700
+ /**
701
+ * @param {string} sql
702
+ * @param {any} params
703
+ * @returns {Promise<any>}
704
+ */
705
+ execute(sql, params) {
706
+ const ptr0 = passStringToWasm0(sql, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
707
+ const len0 = WASM_VECTOR_LEN;
708
+ const ret = wasm.actorstatetransaction_execute(this.__wbg_ptr, ptr0, len0, params);
709
+ return ret;
710
+ }
711
+ /**
712
+ * @returns {Promise<void>}
713
+ */
714
+ rollback() {
715
+ const ret = wasm.actorstatetransaction_rollback(this.__wbg_ptr);
716
+ return ret;
717
+ }
718
+ }
719
+
641
720
  const CancellationTokenFinalization = (typeof FinalizationRegistry === 'undefined')
642
721
  ? { register: () => {}, unregister: () => {} }
643
722
  : new FinalizationRegistry(ptr => wasm.__wbg_cancellationtoken_free(ptr >>> 0, 1));
644
723
 
645
724
  export class CancellationToken {
646
725
 
726
+ static __wrap(ptr) {
727
+ ptr = ptr >>> 0;
728
+ const obj = Object.create(CancellationToken.prototype);
729
+ obj.__wbg_ptr = ptr;
730
+ CancellationTokenFinalization.register(obj, obj.__wbg_ptr, obj);
731
+ return obj;
732
+ }
733
+
647
734
  __destroy_into_raw() {
648
735
  const ptr = this.__wbg_ptr;
649
736
  this.__wbg_ptr = 0;
@@ -804,12 +891,6 @@ export class CoreRegistry {
804
891
  const ret = wasm.coreregistry_handleServerlessRequest(this.__wbg_ptr, req, on_stream_event, cancel_token.__wbg_ptr, config);
805
892
  return ret;
806
893
  }
807
- constructor() {
808
- const ret = wasm.coreregistry_new();
809
- this.__wbg_ptr = ret >>> 0;
810
- CoreRegistryFinalization.register(this, this.__wbg_ptr, this);
811
- return this;
812
- }
813
894
  /**
814
895
  * @param {any} config
815
896
  * @returns {Promise<void>}
@@ -818,6 +899,19 @@ export class CoreRegistry {
818
899
  const ret = wasm.coreregistry_serve(this.__wbg_ptr, config);
819
900
  return ret;
820
901
  }
902
+ /**
903
+ * @returns {Promise<void>}
904
+ */
905
+ shutdown() {
906
+ const ret = wasm.coreregistry_shutdown(this.__wbg_ptr);
907
+ return ret;
908
+ }
909
+ constructor() {
910
+ const ret = wasm.coreregistry_new();
911
+ this.__wbg_ptr = ret >>> 0;
912
+ CoreRegistryFinalization.register(this, this.__wbg_ptr, this);
913
+ return this;
914
+ }
821
915
  /**
822
916
  * @param {string} name
823
917
  * @param {ActorFactory} factory
@@ -831,13 +925,6 @@ export class CoreRegistry {
831
925
  throw takeFromExternrefTable0(ret[0]);
832
926
  }
833
927
  }
834
- /**
835
- * @returns {Promise<void>}
836
- */
837
- shutdown() {
838
- const ret = wasm.coreregistry_shutdown(this.__wbg_ptr);
839
- return ret;
840
- }
841
928
  }
842
929
 
843
930
  const KvFinalization = (typeof FinalizationRegistry === 'undefined')
@@ -1001,17 +1088,6 @@ export class Queue {
1001
1088
  const ret = wasm.queue_nextBatch(this.__wbg_ptr, options, ptr0);
1002
1089
  return ret;
1003
1090
  }
1004
- /**
1005
- * @param {any} options
1006
- * @returns {Array<any>}
1007
- */
1008
- tryNextBatch(options) {
1009
- const ret = wasm.queue_tryNextBatch(this.__wbg_ptr, options);
1010
- if (ret[2]) {
1011
- throw takeFromExternrefTable0(ret[1]);
1012
- }
1013
- return takeFromExternrefTable0(ret[0]);
1014
- }
1015
1091
  /**
1016
1092
  * @param {any} names
1017
1093
  * @param {any} options
@@ -1054,6 +1130,20 @@ export class Queue {
1054
1130
  const ret = wasm.queue_inspectMessages(this.__wbg_ptr);
1055
1131
  return ret;
1056
1132
  }
1133
+ /**
1134
+ * @param {bigint} message_id
1135
+ * @param {string} expected_name
1136
+ * @param {Uint8Array | null} [response]
1137
+ * @returns {Promise<boolean>}
1138
+ */
1139
+ completePersisted(message_id, expected_name, response) {
1140
+ const ptr0 = passStringToWasm0(expected_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1141
+ const len0 = WASM_VECTOR_LEN;
1142
+ var ptr1 = isLikeNone(response) ? 0 : passArray8ToWasm0(response, wasm.__wbindgen_malloc);
1143
+ var len1 = WASM_VECTOR_LEN;
1144
+ const ret = wasm.queue_completePersisted(this.__wbg_ptr, message_id, ptr0, len0, ptr1, len1);
1145
+ return ret;
1146
+ }
1057
1147
  /**
1058
1148
  * @param {any} names
1059
1149
  * @param {any} options
@@ -1076,6 +1166,24 @@ export class Queue {
1076
1166
  const ret = wasm.queue_send(this.__wbg_ptr, ptr0, len0, ptr1, len1);
1077
1167
  return ret;
1078
1168
  }
1169
+ /**
1170
+ * @returns {Promise<void>}
1171
+ */
1172
+ reset() {
1173
+ const ret = wasm.queue_reset(this.__wbg_ptr);
1174
+ return ret;
1175
+ }
1176
+ /**
1177
+ * @param {any} options
1178
+ * @returns {Array<any>}
1179
+ */
1180
+ tryNextBatch(options) {
1181
+ const ret = wasm.queue_tryNextBatch(this.__wbg_ptr, options);
1182
+ if (ret[2]) {
1183
+ throw takeFromExternrefTable0(ret[1]);
1184
+ }
1185
+ return takeFromExternrefTable0(ret[0]);
1186
+ }
1079
1187
  /**
1080
1188
  * @returns {number}
1081
1189
  */
@@ -1110,6 +1218,14 @@ export class QueueMessage {
1110
1218
  const ptr = this.__destroy_into_raw();
1111
1219
  wasm.__wbg_queuemessage_free(ptr, 0);
1112
1220
  }
1221
+ /**
1222
+ * @param {any} response
1223
+ * @returns {Promise<void>}
1224
+ */
1225
+ complete(response) {
1226
+ const ret = wasm.queuemessage_complete(this.__wbg_ptr, response);
1227
+ return ret;
1228
+ }
1113
1229
  /**
1114
1230
  * @returns {number}
1115
1231
  */
@@ -1155,14 +1271,6 @@ export class QueueMessage {
1155
1271
  wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
1156
1272
  }
1157
1273
  }
1158
- /**
1159
- * @param {any} response
1160
- * @returns {Promise<void>}
1161
- */
1162
- complete(response) {
1163
- const ret = wasm.queuemessage_complete(this.__wbg_ptr, response);
1164
- return ret;
1165
- }
1166
1274
  }
1167
1275
 
1168
1276
  const ScheduleFinalization = (typeof FinalizationRegistry === 'undefined')
@@ -1190,29 +1298,139 @@ export class Schedule {
1190
1298
  const ptr = this.__destroy_into_raw();
1191
1299
  wasm.__wbg_schedule_free(ptr, 0);
1192
1300
  }
1301
+ /**
1302
+ * @param {string} name
1303
+ * @param {number} interval_ms
1304
+ * @param {string} action_name
1305
+ * @param {Uint8Array} args
1306
+ * @param {number | null} [max_history]
1307
+ * @returns {Promise<void>}
1308
+ */
1309
+ cronEvery(name, interval_ms, action_name, args, max_history) {
1310
+ const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1311
+ const len0 = WASM_VECTOR_LEN;
1312
+ const ptr1 = passStringToWasm0(action_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1313
+ const len1 = WASM_VECTOR_LEN;
1314
+ const ptr2 = passArray8ToWasm0(args, wasm.__wbindgen_malloc);
1315
+ const len2 = WASM_VECTOR_LEN;
1316
+ const ret = wasm.schedule_cronEvery(this.__wbg_ptr, ptr0, len0, interval_ms, ptr1, len1, ptr2, len2, !isLikeNone(max_history), isLikeNone(max_history) ? 0 : max_history);
1317
+ return ret;
1318
+ }
1319
+ /**
1320
+ * @param {string} name
1321
+ * @returns {Promise<boolean>}
1322
+ */
1323
+ cronDelete(name) {
1324
+ const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1325
+ const len0 = WASM_VECTOR_LEN;
1326
+ const ret = wasm.schedule_cronDelete(this.__wbg_ptr, ptr0, len0);
1327
+ return ret;
1328
+ }
1329
+ /**
1330
+ * @param {string} name
1331
+ * @param {number | null} [limit]
1332
+ * @returns {Promise<any>}
1333
+ */
1334
+ cronHistory(name, limit) {
1335
+ const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1336
+ const len0 = WASM_VECTOR_LEN;
1337
+ const ret = wasm.schedule_cronHistory(this.__wbg_ptr, ptr0, len0, !isLikeNone(limit), isLikeNone(limit) ? 0 : limit);
1338
+ return ret;
1339
+ }
1193
1340
  /**
1194
1341
  * @param {number} timestamp_ms
1195
1342
  * @param {string} action_name
1196
1343
  * @param {Uint8Array} args
1344
+ * @returns {Promise<string>}
1197
1345
  */
1198
1346
  at(timestamp_ms, action_name, args) {
1199
1347
  const ptr0 = passStringToWasm0(action_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1200
1348
  const len0 = WASM_VECTOR_LEN;
1201
1349
  const ptr1 = passArray8ToWasm0(args, wasm.__wbindgen_malloc);
1202
1350
  const len1 = WASM_VECTOR_LEN;
1203
- wasm.schedule_at(this.__wbg_ptr, timestamp_ms, ptr0, len0, ptr1, len1);
1351
+ const ret = wasm.schedule_at(this.__wbg_ptr, timestamp_ms, ptr0, len0, ptr1, len1);
1352
+ return ret;
1353
+ }
1354
+ /**
1355
+ * @param {string} id
1356
+ * @returns {Promise<any>}
1357
+ */
1358
+ get(id) {
1359
+ const ptr0 = passStringToWasm0(id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1360
+ const len0 = WASM_VECTOR_LEN;
1361
+ const ret = wasm.schedule_get(this.__wbg_ptr, ptr0, len0);
1362
+ return ret;
1363
+ }
1364
+ /**
1365
+ * @returns {Promise<any>}
1366
+ */
1367
+ list() {
1368
+ const ret = wasm.schedule_list(this.__wbg_ptr);
1369
+ return ret;
1204
1370
  }
1205
1371
  /**
1206
1372
  * @param {number} duration_ms
1207
1373
  * @param {string} action_name
1208
1374
  * @param {Uint8Array} args
1375
+ * @returns {Promise<string>}
1209
1376
  */
1210
1377
  after(duration_ms, action_name, args) {
1211
1378
  const ptr0 = passStringToWasm0(action_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1212
1379
  const len0 = WASM_VECTOR_LEN;
1213
1380
  const ptr1 = passArray8ToWasm0(args, wasm.__wbindgen_malloc);
1214
1381
  const len1 = WASM_VECTOR_LEN;
1215
- wasm.schedule_after(this.__wbg_ptr, duration_ms, ptr0, len0, ptr1, len1);
1382
+ const ret = wasm.schedule_after(this.__wbg_ptr, duration_ms, ptr0, len0, ptr1, len1);
1383
+ return ret;
1384
+ }
1385
+ /**
1386
+ * @param {string} id
1387
+ * @returns {Promise<boolean>}
1388
+ */
1389
+ cancel(id) {
1390
+ const ptr0 = passStringToWasm0(id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1391
+ const len0 = WASM_VECTOR_LEN;
1392
+ const ret = wasm.schedule_cancel(this.__wbg_ptr, ptr0, len0);
1393
+ return ret;
1394
+ }
1395
+ /**
1396
+ * @param {string} name
1397
+ * @returns {Promise<any>}
1398
+ */
1399
+ cronGet(name) {
1400
+ const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1401
+ const len0 = WASM_VECTOR_LEN;
1402
+ const ret = wasm.schedule_cronGet(this.__wbg_ptr, ptr0, len0);
1403
+ return ret;
1404
+ }
1405
+ /**
1406
+ * @param {string} name
1407
+ * @param {string} expression
1408
+ * @param {string | null | undefined} timezone
1409
+ * @param {string} action_name
1410
+ * @param {Uint8Array} args
1411
+ * @param {number | null} [max_history]
1412
+ * @returns {Promise<void>}
1413
+ */
1414
+ cronSet(name, expression, timezone, action_name, args, max_history) {
1415
+ const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1416
+ const len0 = WASM_VECTOR_LEN;
1417
+ const ptr1 = passStringToWasm0(expression, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1418
+ const len1 = WASM_VECTOR_LEN;
1419
+ var ptr2 = isLikeNone(timezone) ? 0 : passStringToWasm0(timezone, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1420
+ var len2 = WASM_VECTOR_LEN;
1421
+ const ptr3 = passStringToWasm0(action_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1422
+ const len3 = WASM_VECTOR_LEN;
1423
+ const ptr4 = passArray8ToWasm0(args, wasm.__wbindgen_malloc);
1424
+ const len4 = WASM_VECTOR_LEN;
1425
+ const ret = wasm.schedule_cronSet(this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, ptr4, len4, !isLikeNone(max_history), isLikeNone(max_history) ? 0 : max_history);
1426
+ return ret;
1427
+ }
1428
+ /**
1429
+ * @returns {Promise<any>}
1430
+ */
1431
+ cronList() {
1432
+ const ret = wasm.schedule_cronList(this.__wbg_ptr);
1433
+ return ret;
1216
1434
  }
1217
1435
  }
1218
1436
 
@@ -1241,6 +1459,25 @@ export class SqliteDb {
1241
1459
  const ptr = this.__destroy_into_raw();
1242
1460
  wasm.__wbg_sqlitedb_free(ptr, 0);
1243
1461
  }
1462
+ /**
1463
+ * @param {any} statements
1464
+ * @returns {Promise<any>}
1465
+ */
1466
+ executeBatch(statements) {
1467
+ const ret = wasm.sqlitedb_executeBatch(this.__wbg_ptr, statements);
1468
+ return ret;
1469
+ }
1470
+ /**
1471
+ * @param {number | null} [timeout_ms]
1472
+ * @param {string | null} [name]
1473
+ * @returns {Promise<SqliteTransaction>}
1474
+ */
1475
+ beginTransaction(timeout_ms, name) {
1476
+ var ptr0 = isLikeNone(name) ? 0 : passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1477
+ var len0 = WASM_VECTOR_LEN;
1478
+ const ret = wasm.sqlitedb_beginTransaction(this.__wbg_ptr, !isLikeNone(timeout_ms), isLikeNone(timeout_ms) ? 0 : timeout_ms, ptr0, len0);
1479
+ return ret;
1480
+ }
1244
1481
  /**
1245
1482
  * @param {string} sql
1246
1483
  * @param {any} params
@@ -1293,6 +1530,68 @@ export class SqliteDb {
1293
1530
  }
1294
1531
  }
1295
1532
 
1533
+ const SqliteTransactionFinalization = (typeof FinalizationRegistry === 'undefined')
1534
+ ? { register: () => {}, unregister: () => {} }
1535
+ : new FinalizationRegistry(ptr => wasm.__wbg_sqlitetransaction_free(ptr >>> 0, 1));
1536
+
1537
+ export class SqliteTransaction {
1538
+
1539
+ static __wrap(ptr) {
1540
+ ptr = ptr >>> 0;
1541
+ const obj = Object.create(SqliteTransaction.prototype);
1542
+ obj.__wbg_ptr = ptr;
1543
+ SqliteTransactionFinalization.register(obj, obj.__wbg_ptr, obj);
1544
+ return obj;
1545
+ }
1546
+
1547
+ __destroy_into_raw() {
1548
+ const ptr = this.__wbg_ptr;
1549
+ this.__wbg_ptr = 0;
1550
+ SqliteTransactionFinalization.unregister(this);
1551
+ return ptr;
1552
+ }
1553
+
1554
+ free() {
1555
+ const ptr = this.__destroy_into_raw();
1556
+ wasm.__wbg_sqlitetransaction_free(ptr, 0);
1557
+ }
1558
+ /**
1559
+ * @param {string} sql
1560
+ * @returns {Promise<any>}
1561
+ */
1562
+ exec(sql) {
1563
+ const ptr0 = passStringToWasm0(sql, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1564
+ const len0 = WASM_VECTOR_LEN;
1565
+ const ret = wasm.sqlitetransaction_exec(this.__wbg_ptr, ptr0, len0);
1566
+ return ret;
1567
+ }
1568
+ /**
1569
+ * @returns {Promise<void>}
1570
+ */
1571
+ commit() {
1572
+ const ret = wasm.sqlitetransaction_commit(this.__wbg_ptr);
1573
+ return ret;
1574
+ }
1575
+ /**
1576
+ * @param {string} sql
1577
+ * @param {any} params
1578
+ * @returns {Promise<any>}
1579
+ */
1580
+ execute(sql, params) {
1581
+ const ptr0 = passStringToWasm0(sql, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1582
+ const len0 = WASM_VECTOR_LEN;
1583
+ const ret = wasm.sqlitetransaction_execute(this.__wbg_ptr, ptr0, len0, params);
1584
+ return ret;
1585
+ }
1586
+ /**
1587
+ * @returns {Promise<void>}
1588
+ */
1589
+ rollback() {
1590
+ const ret = wasm.sqlitetransaction_rollback(this.__wbg_ptr);
1591
+ return ret;
1592
+ }
1593
+ }
1594
+
1296
1595
  const WebSocketHandleFinalization = (typeof FinalizationRegistry === 'undefined')
1297
1596
  ? { register: () => {}, unregister: () => {} }
1298
1597
  : new FinalizationRegistry(ptr => wasm.__wbg_websockethandle_free(ptr >>> 0, 1));
@@ -1318,6 +1617,17 @@ export class WebSocketHandle {
1318
1617
  const ptr = this.__destroy_into_raw();
1319
1618
  wasm.__wbg_websockethandle_free(ptr, 0);
1320
1619
  }
1620
+ /**
1621
+ * @param {number | null} [code]
1622
+ * @param {string | null} [reason]
1623
+ * @returns {Promise<void>}
1624
+ */
1625
+ close(code, reason) {
1626
+ var ptr0 = isLikeNone(reason) ? 0 : passStringToWasm0(reason, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1627
+ var len0 = WASM_VECTOR_LEN;
1628
+ const ret = wasm.websockethandle_close(this.__wbg_ptr, isLikeNone(code) ? 0xFFFFFF : code, ptr0, len0);
1629
+ return ret;
1630
+ }
1321
1631
  /**
1322
1632
  * @param {Function} callback
1323
1633
  */
@@ -1336,17 +1646,6 @@ export class WebSocketHandle {
1336
1646
  throw takeFromExternrefTable0(ret[0]);
1337
1647
  }
1338
1648
  }
1339
- /**
1340
- * @param {number | null} [code]
1341
- * @param {string | null} [reason]
1342
- * @returns {Promise<void>}
1343
- */
1344
- close(code, reason) {
1345
- var ptr0 = isLikeNone(reason) ? 0 : passStringToWasm0(reason, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1346
- var len0 = WASM_VECTOR_LEN;
1347
- const ret = wasm.websockethandle_close(this.__wbg_ptr, isLikeNone(code) ? 0xFFFFFF : code, ptr0, len0);
1348
- return ret;
1349
- }
1350
1649
  }
1351
1650
 
1352
1651
  async function __wbg_load(module, imports) {
@@ -1394,6 +1693,10 @@ function __wbg_get_imports() {
1394
1693
  const ret = ActorContext.__wrap(arg0);
1395
1694
  return ret;
1396
1695
  };
1696
+ imports.wbg.__wbg_actorstatetransaction_new = function(arg0) {
1697
+ const ret = ActorStateTransaction.__wrap(arg0);
1698
+ return ret;
1699
+ };
1397
1700
  imports.wbg.__wbg_buffer_09165b52af8c5237 = function(arg0) {
1398
1701
  const ret = arg0.buffer;
1399
1702
  return ret;
@@ -1402,6 +1705,10 @@ function __wbg_get_imports() {
1402
1705
  const ret = arg0.buffer;
1403
1706
  return ret;
1404
1707
  };
1708
+ imports.wbg.__wbg_bufferedAmount_a482960ac51b25e8 = function(arg0) {
1709
+ const ret = arg0.bufferedAmount;
1710
+ return ret;
1711
+ };
1405
1712
  imports.wbg.__wbg_call_672a4d21634d4a24 = function() { return handleError(function (arg0, arg1) {
1406
1713
  const ret = arg0.call(arg1);
1407
1714
  return ret;
@@ -1414,6 +1721,10 @@ function __wbg_get_imports() {
1414
1721
  const ret = arg0.call(arg1, arg2, arg3);
1415
1722
  return ret;
1416
1723
  }, arguments) };
1724
+ imports.wbg.__wbg_cancellationtoken_new = function(arg0) {
1725
+ const ret = CancellationToken.__wrap(arg0);
1726
+ return ret;
1727
+ };
1417
1728
  imports.wbg.__wbg_close_2893b7d056a0627d = function() { return handleError(function (arg0) {
1418
1729
  arg0.close();
1419
1730
  }, arguments) };
@@ -1569,7 +1880,7 @@ function __wbg_get_imports() {
1569
1880
  const a = state0.a;
1570
1881
  state0.a = 0;
1571
1882
  try {
1572
- return __wbg_adapter_268(a, state0.b, arg0, arg1);
1883
+ return __wbg_adapter_297(a, state0.b, arg0, arg1);
1573
1884
  } finally {
1574
1885
  state0.a = a;
1575
1886
  }
@@ -1584,6 +1895,10 @@ function __wbg_get_imports() {
1584
1895
  const ret = new Object();
1585
1896
  return ret;
1586
1897
  };
1898
+ imports.wbg.__wbg_new_5e0be73521bc8c17 = function() {
1899
+ const ret = new Map();
1900
+ return ret;
1901
+ };
1587
1902
  imports.wbg.__wbg_new_78feb108b6472713 = function() {
1588
1903
  const ret = new Array();
1589
1904
  return ret;
@@ -1693,6 +2008,10 @@ function __wbg_get_imports() {
1693
2008
  imports.wbg.__wbg_set_65595bdd868b3009 = function(arg0, arg1, arg2) {
1694
2009
  arg0.set(arg1, arg2 >>> 0);
1695
2010
  };
2011
+ imports.wbg.__wbg_set_8fc6bf8a5b1071d1 = function(arg0, arg1, arg2) {
2012
+ const ret = arg0.set(arg1, arg2);
2013
+ return ret;
2014
+ };
1696
2015
  imports.wbg.__wbg_set_bb8cecf6a62b9f46 = function() { return handleError(function (arg0, arg1, arg2) {
1697
2016
  const ret = Reflect.set(arg0, arg1, arg2);
1698
2017
  return ret;
@@ -1712,6 +2031,10 @@ function __wbg_get_imports() {
1712
2031
  imports.wbg.__wbg_setonopen_2da654e1f39745d5 = function(arg0, arg1) {
1713
2032
  arg0.onopen = arg1;
1714
2033
  };
2034
+ imports.wbg.__wbg_sqlitetransaction_new = function(arg0) {
2035
+ const ret = SqliteTransaction.__wrap(arg0);
2036
+ return ret;
2037
+ };
1715
2038
  imports.wbg.__wbg_stack_0ed75d68575b0f3c = function(arg0, arg1) {
1716
2039
  const ret = arg1.stack;
1717
2040
  const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
@@ -1767,6 +2090,14 @@ function __wbg_get_imports() {
1767
2090
  const ret = +arg0;
1768
2091
  return ret;
1769
2092
  };
2093
+ imports.wbg.__wbindgen_bigint_from_i64 = function(arg0) {
2094
+ const ret = arg0;
2095
+ return ret;
2096
+ };
2097
+ imports.wbg.__wbindgen_bigint_from_u64 = function(arg0) {
2098
+ const ret = BigInt.asUintN(64, arg0);
2099
+ return ret;
2100
+ };
1770
2101
  imports.wbg.__wbindgen_boolean_get = function(arg0) {
1771
2102
  const v = arg0;
1772
2103
  const ret = typeof(v) === 'boolean' ? (v ? 1 : 0) : 2;
@@ -1781,24 +2112,24 @@ function __wbg_get_imports() {
1781
2112
  const ret = false;
1782
2113
  return ret;
1783
2114
  };
1784
- imports.wbg.__wbindgen_closure_wrapper3727 = function(arg0, arg1, arg2) {
1785
- const ret = makeMutClosure(arg0, arg1, 1599, __wbg_adapter_46);
2115
+ imports.wbg.__wbindgen_closure_wrapper4951 = function(arg0, arg1, arg2) {
2116
+ const ret = makeMutClosure(arg0, arg1, 1988, __wbg_adapter_50);
1786
2117
  return ret;
1787
2118
  };
1788
- imports.wbg.__wbindgen_closure_wrapper3729 = function(arg0, arg1, arg2) {
1789
- const ret = makeMutClosure(arg0, arg1, 1599, __wbg_adapter_46);
2119
+ imports.wbg.__wbindgen_closure_wrapper4953 = function(arg0, arg1, arg2) {
2120
+ const ret = makeMutClosure(arg0, arg1, 1988, __wbg_adapter_50);
1790
2121
  return ret;
1791
2122
  };
1792
- imports.wbg.__wbindgen_closure_wrapper3731 = function(arg0, arg1, arg2) {
1793
- const ret = makeMutClosure(arg0, arg1, 1599, __wbg_adapter_46);
2123
+ imports.wbg.__wbindgen_closure_wrapper4955 = function(arg0, arg1, arg2) {
2124
+ const ret = makeMutClosure(arg0, arg1, 1988, __wbg_adapter_50);
1794
2125
  return ret;
1795
2126
  };
1796
- imports.wbg.__wbindgen_closure_wrapper3733 = function(arg0, arg1, arg2) {
1797
- const ret = makeMutClosure(arg0, arg1, 1599, __wbg_adapter_46);
2127
+ imports.wbg.__wbindgen_closure_wrapper4957 = function(arg0, arg1, arg2) {
2128
+ const ret = makeMutClosure(arg0, arg1, 1988, __wbg_adapter_50);
1798
2129
  return ret;
1799
2130
  };
1800
- imports.wbg.__wbindgen_closure_wrapper4575 = function(arg0, arg1, arg2) {
1801
- const ret = makeMutClosure(arg0, arg1, 1951, __wbg_adapter_55);
2131
+ imports.wbg.__wbindgen_closure_wrapper5599 = function(arg0, arg1, arg2) {
2132
+ const ret = makeMutClosure(arg0, arg1, 2386, __wbg_adapter_59);
1802
2133
  return ret;
1803
2134
  };
1804
2135
  imports.wbg.__wbindgen_debug_string = function(arg0, arg1) {