@rivetkit/rivetkit-wasm 2.3.30 → 3.0.0-preview.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.
@@ -1,339 +1,22 @@
1
- let wasm;
2
-
3
- let WASM_VECTOR_LEN = 0;
4
-
5
- let cachedUint8ArrayMemory0 = null;
6
-
7
- function getUint8ArrayMemory0() {
8
- if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
9
- cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
10
- }
11
- return cachedUint8ArrayMemory0;
12
- }
13
-
14
- const cachedTextEncoder = (typeof TextEncoder !== 'undefined' ? new TextEncoder('utf-8') : { encode: () => { throw Error('TextEncoder not available') } } );
15
-
16
- const encodeString = (typeof cachedTextEncoder.encodeInto === 'function'
17
- ? function (arg, view) {
18
- return cachedTextEncoder.encodeInto(arg, view);
19
- }
20
- : function (arg, view) {
21
- const buf = cachedTextEncoder.encode(arg);
22
- view.set(buf);
23
- return {
24
- read: arg.length,
25
- written: buf.length
26
- };
27
- });
28
-
29
- function passStringToWasm0(arg, malloc, realloc) {
30
-
31
- if (realloc === undefined) {
32
- const buf = cachedTextEncoder.encode(arg);
33
- const ptr = malloc(buf.length, 1) >>> 0;
34
- getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
35
- WASM_VECTOR_LEN = buf.length;
36
- return ptr;
37
- }
38
-
39
- let len = arg.length;
40
- let ptr = malloc(len, 1) >>> 0;
41
-
42
- const mem = getUint8ArrayMemory0();
43
-
44
- let offset = 0;
45
-
46
- for (; offset < len; offset++) {
47
- const code = arg.charCodeAt(offset);
48
- if (code > 0x7F) break;
49
- mem[ptr + offset] = code;
50
- }
51
-
52
- if (offset !== len) {
53
- if (offset !== 0) {
54
- arg = arg.slice(offset);
55
- }
56
- ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
57
- const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
58
- const ret = encodeString(arg, view);
59
-
60
- offset += ret.written;
61
- ptr = realloc(ptr, len, offset, 1) >>> 0;
62
- }
63
-
64
- WASM_VECTOR_LEN = offset;
65
- return ptr;
66
- }
67
-
68
- let cachedDataViewMemory0 = null;
69
-
70
- function getDataViewMemory0() {
71
- if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
72
- cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
73
- }
74
- return cachedDataViewMemory0;
75
- }
76
-
77
- function addToExternrefTable0(obj) {
78
- const idx = wasm.__externref_table_alloc();
79
- wasm.__wbindgen_export_4.set(idx, obj);
80
- return idx;
81
- }
82
-
83
- function handleError(f, args) {
84
- try {
85
- return f.apply(this, args);
86
- } catch (e) {
87
- const idx = addToExternrefTable0(e);
88
- wasm.__wbindgen_exn_store(idx);
89
- }
90
- }
91
-
92
- const cachedTextDecoder = (typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }) : { decode: () => { throw Error('TextDecoder not available') } } );
93
-
94
- if (typeof TextDecoder !== 'undefined') { cachedTextDecoder.decode(); };
95
-
96
- function getStringFromWasm0(ptr, len) {
97
- ptr = ptr >>> 0;
98
- return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
99
- }
100
-
101
- function getArrayU8FromWasm0(ptr, len) {
102
- ptr = ptr >>> 0;
103
- return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
104
- }
105
-
106
- function isLikeNone(x) {
107
- return x === undefined || x === null;
108
- }
109
-
110
- const CLOSURE_DTORS = (typeof FinalizationRegistry === 'undefined')
111
- ? { register: () => {}, unregister: () => {} }
112
- : new FinalizationRegistry(state => {
113
- wasm.__wbindgen_export_6.get(state.dtor)(state.a, state.b)
114
- });
115
-
116
- function makeMutClosure(arg0, arg1, dtor, f) {
117
- const state = { a: arg0, b: arg1, cnt: 1, dtor };
118
- const real = (...args) => {
119
- // First up with a closure we increment the internal reference
120
- // count. This ensures that the Rust closure environment won't
121
- // be deallocated while we're invoking it.
122
- state.cnt++;
123
- const a = state.a;
124
- state.a = 0;
125
- try {
126
- return f(a, state.b, ...args);
127
- } finally {
128
- if (--state.cnt === 0) {
129
- wasm.__wbindgen_export_6.get(state.dtor)(a, state.b);
130
- CLOSURE_DTORS.unregister(state);
131
- } else {
132
- state.a = a;
133
- }
134
- }
135
- };
136
- real.original = state;
137
- CLOSURE_DTORS.register(real, state, state);
138
- return real;
139
- }
140
-
141
- function debugString(val) {
142
- // primitive types
143
- const type = typeof val;
144
- if (type == 'number' || type == 'boolean' || val == null) {
145
- return `${val}`;
146
- }
147
- if (type == 'string') {
148
- return `"${val}"`;
149
- }
150
- if (type == 'symbol') {
151
- const description = val.description;
152
- if (description == null) {
153
- return 'Symbol';
154
- } else {
155
- return `Symbol(${description})`;
156
- }
157
- }
158
- if (type == 'function') {
159
- const name = val.name;
160
- if (typeof name == 'string' && name.length > 0) {
161
- return `Function(${name})`;
162
- } else {
163
- return 'Function';
164
- }
165
- }
166
- // objects
167
- if (Array.isArray(val)) {
168
- const length = val.length;
169
- let debug = '[';
170
- if (length > 0) {
171
- debug += debugString(val[0]);
172
- }
173
- for(let i = 1; i < length; i++) {
174
- debug += ', ' + debugString(val[i]);
175
- }
176
- debug += ']';
177
- return debug;
178
- }
179
- // Test for built-in
180
- const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
181
- let className;
182
- if (builtInMatches && builtInMatches.length > 1) {
183
- className = builtInMatches[1];
184
- } else {
185
- // Failed to match the standard '[object ClassName]'
186
- return toString.call(val);
187
- }
188
- if (className == 'Object') {
189
- // we're a user defined class or Object
190
- // JSON.stringify avoids problems with cycles, and is generally much
191
- // easier than looping through ownProperties of `val`.
192
- try {
193
- return 'Object(' + JSON.stringify(val) + ')';
194
- } catch (_) {
195
- return 'Object';
196
- }
197
- }
198
- // errors
199
- if (val instanceof Error) {
200
- return `${val.name}: ${val.message}\n${val.stack}`;
201
- }
202
- // TODO we could test for more things here, like `Set`s and `Map`s.
203
- return className;
204
- }
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
- export function start() {
226
- wasm.start();
227
- }
228
-
229
- /**
230
- * @param {Uint8Array} bytes
231
- * @returns {Uint8Array}
232
- */
233
- export function roundTripBytes(bytes) {
234
- const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
235
- const len0 = WASM_VECTOR_LEN;
236
- const ret = wasm.roundTripBytes(ptr0, len0);
237
- var v2 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
238
- wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
239
- return v2;
240
- }
241
-
242
- /**
243
- * @returns {string}
244
- */
245
- export function bridgeRivetErrorPrefix() {
246
- let deferred1_0;
247
- let deferred1_1;
248
- try {
249
- const ret = wasm.bridgeRivetErrorPrefix();
250
- deferred1_0 = ret[0];
251
- deferred1_1 = ret[1];
252
- return getStringFromWasm0(ret[0], ret[1]);
253
- } finally {
254
- wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
255
- }
256
- }
257
-
258
- /**
259
- * @param {Promise<any>} promise
260
- * @returns {Promise<any>}
261
- */
262
- export function awaitPromise(promise) {
263
- const ret = wasm.awaitPromise(promise);
264
- return ret;
265
- }
266
-
267
- /**
268
- * @param {Uint8Array} bytes
269
- * @returns {Uint8Array}
270
- */
271
- export function uint8ArrayFromBytes(bytes) {
272
- const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
273
- const len0 = WASM_VECTOR_LEN;
274
- const ret = wasm.uint8ArrayFromBytes(ptr0, len0);
275
- return ret;
276
- }
277
-
278
- function __wbg_adapter_50(arg0, arg1, arg2) {
279
- wasm.closure1975_externref_shim(arg0, arg1, arg2);
280
- }
281
-
282
- function __wbg_adapter_59(arg0, arg1, arg2) {
283
- wasm.closure2334_externref_shim(arg0, arg1, arg2);
284
- }
285
-
286
- function __wbg_adapter_273(arg0, arg1, arg2, arg3) {
287
- wasm.closure2571_externref_shim(arg0, arg1, arg2, arg3);
288
- }
289
-
290
- const __wbindgen_enum_BinaryType = ["blob", "arraybuffer"];
291
-
292
- const ActorContextFinalization = (typeof FinalizationRegistry === 'undefined')
293
- ? { register: () => {}, unregister: () => {} }
294
- : new FinalizationRegistry(ptr => wasm.__wbg_actorcontext_free(ptr >>> 0, 1));
1
+ /* @ts-self-types="./rivetkit_wasm.d.ts" */
295
2
 
296
3
  export class ActorContext {
297
-
298
4
  static __wrap(ptr) {
299
- ptr = ptr >>> 0;
300
5
  const obj = Object.create(ActorContext.prototype);
301
6
  obj.__wbg_ptr = ptr;
302
7
  ActorContextFinalization.register(obj, obj.__wbg_ptr, obj);
303
8
  return obj;
304
9
  }
305
-
306
10
  __destroy_into_raw() {
307
11
  const ptr = this.__wbg_ptr;
308
12
  this.__wbg_ptr = 0;
309
13
  ActorContextFinalization.unregister(this);
310
14
  return ptr;
311
15
  }
312
-
313
16
  free() {
314
17
  const ptr = this.__destroy_into_raw();
315
18
  wasm.__wbg_actorcontext_free(ptr, 0);
316
19
  }
317
- /**
318
- * @param {Promise<any>} promise
319
- */
320
- keepAwake(promise) {
321
- wasm.actorcontext_keepAwake(this.__wbg_ptr, promise);
322
- }
323
- /**
324
- * @param {any} payload
325
- * @returns {Promise<void>}
326
- */
327
- saveState(payload) {
328
- const ret = wasm.actorcontext_saveState(this.__wbg_ptr, payload);
329
- return ret;
330
- }
331
- /**
332
- * @param {Promise<any>} promise
333
- */
334
- waitUntil(promise) {
335
- wasm.actorcontext_waitUntil(this.__wbg_ptr, promise);
336
- }
337
20
  /**
338
21
  * @returns {any}
339
22
  */
@@ -345,48 +28,19 @@ export class ActorContext {
345
28
  return takeFromExternrefTable0(ret[0]);
346
29
  }
347
30
  /**
348
- * @param {Uint8Array} params
349
- * @param {any} request
350
- * @returns {Promise<ConnHandle>}
351
- */
352
- connectConn(params, request) {
353
- const ptr0 = passArray8ToWasm0(params, wasm.__wbindgen_malloc);
354
- const len0 = WASM_VECTOR_LEN;
355
- const ret = wasm.actorcontext_connectConn(this.__wbg_ptr, ptr0, len0, request);
356
- return ret;
357
- }
358
- /**
359
- * @param {any} opts
360
- */
361
- requestSave(opts) {
362
- wasm.actorcontext_requestSave(this.__wbg_ptr, opts);
363
- }
364
- /**
365
- * @param {Promise<any>} promise
366
- */
367
- registerTask(promise) {
368
- wasm.actorcontext_registerTask(this.__wbg_ptr, promise);
369
- }
370
- /**
371
- * @returns {any}
372
- */
373
- runtimeState() {
374
- const ret = wasm.actorcontext_runtimeState(this.__wbg_ptr);
375
- return ret;
376
- }
377
- /**
378
- * @param {number} region_id
379
- */
380
- endKeepAwake(region_id) {
381
- wasm.actorcontext_endKeepAwake(this.__wbg_ptr, region_id);
382
- }
383
- /**
384
- * @param {number | null} [timestamp_ms]
385
- * @returns {Promise<void>}
31
+ * @returns {string}
386
32
  */
387
- setRunWakeAt(timestamp_ms) {
388
- const ret = wasm.actorcontext_setRunWakeAt(this.__wbg_ptr, !isLikeNone(timestamp_ms), isLikeNone(timestamp_ms) ? 0 : timestamp_ms);
389
- return ret;
33
+ actorId() {
34
+ let deferred1_0;
35
+ let deferred1_1;
36
+ try {
37
+ const ret = wasm.actorcontext_actorId(this.__wbg_ptr);
38
+ deferred1_0 = ret[0];
39
+ deferred1_1 = ret[1];
40
+ return getStringFromWasm0(ret[0], ret[1]);
41
+ } finally {
42
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
43
+ }
390
44
  }
391
45
  /**
392
46
  * @returns {number}
@@ -395,52 +49,9 @@ export class ActorContext {
395
49
  const ret = wasm.actorcontext_beginKeepAwake(this.__wbg_ptr);
396
50
  return ret >>> 0;
397
51
  }
398
- /**
399
- * @returns {object}
400
- */
401
- inspectorSnapshot() {
402
- const ret = wasm.actorcontext_inspectorSnapshot(this.__wbg_ptr);
403
- if (ret[2]) {
404
- throw takeFromExternrefTable0(ret[1]);
405
- }
406
- return takeFromExternrefTable0(ret[0]);
407
- }
408
- endOnStateChange() {
409
- wasm.actorcontext_endOnStateChange(this.__wbg_ptr);
410
- }
411
- restartRunHandler() {
412
- const ret = wasm.actorcontext_restartRunHandler(this.__wbg_ptr);
413
- if (ret[1]) {
414
- throw takeFromExternrefTable0(ret[0]);
415
- }
416
- }
417
52
  beginOnStateChange() {
418
53
  wasm.actorcontext_beginOnStateChange(this.__wbg_ptr);
419
54
  }
420
- /**
421
- * @param {any} opts
422
- * @returns {Promise<void>}
423
- */
424
- requestSaveAndWait(opts) {
425
- const ret = wasm.actorcontext_requestSaveAndWait(this.__wbg_ptr, opts);
426
- return ret;
427
- }
428
- /**
429
- * @param {string | null} [bearer_token]
430
- * @returns {Promise<void>}
431
- */
432
- verifyInspectorAuth(bearer_token) {
433
- var ptr0 = isLikeNone(bearer_token) ? 0 : passStringToWasm0(bearer_token, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
434
- var len0 = WASM_VECTOR_LEN;
435
- const ret = wasm.actorcontext_verifyInspectorAuth(this.__wbg_ptr, ptr0, len0);
436
- return ret;
437
- }
438
- /**
439
- * @param {number} region_id
440
- */
441
- endWebsocketCallback(region_id) {
442
- wasm.actorcontext_endWebsocketCallback(this.__wbg_ptr, region_id);
443
- }
444
55
  /**
445
56
  * @param {number | null} [timeout_ms]
446
57
  * @returns {Promise<ActorStateTransaction>}
@@ -457,73 +68,94 @@ export class ActorContext {
457
68
  return ret >>> 0;
458
69
  }
459
70
  /**
460
- * @returns {Array<any>}
71
+ * @param {string} name
72
+ * @param {Uint8Array} args
461
73
  */
462
- dirtyHibernatableConns() {
463
- const ret = wasm.actorcontext_dirtyHibernatableConns(this.__wbg_ptr);
464
- return ret;
74
+ broadcast(name, args) {
75
+ const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
76
+ const len0 = WASM_VECTOR_LEN;
77
+ const ptr1 = passArray8ToWasm0(args, wasm.__wbindgen_malloc);
78
+ const len1 = WASM_VECTOR_LEN;
79
+ wasm.actorcontext_broadcast(this.__wbg_ptr, ptr0, len0, ptr1, len1);
465
80
  }
466
81
  /**
467
- * @param {any} writes
468
- * @returns {Promise<void>}
82
+ * @param {Uint8Array} params
83
+ * @param {any} request
84
+ * @returns {Promise<ConnHandle>}
469
85
  */
470
- saveStateAndWorkflowBatch(writes) {
471
- const ret = wasm.actorcontext_saveStateAndWorkflowBatch(this.__wbg_ptr, writes);
86
+ connectConn(params, request) {
87
+ const ptr0 = passArray8ToWasm0(params, wasm.__wbindgen_malloc);
88
+ const len0 = WASM_VECTOR_LEN;
89
+ const ret = wasm.actorcontext_connectConn(this.__wbg_ptr, ptr0, len0, request);
472
90
  return ret;
473
91
  }
474
92
  /**
475
- * @returns {Kv}
93
+ * @returns {Array<any>}
476
94
  */
477
- kv() {
478
- const ret = wasm.actorcontext_kv(this.__wbg_ptr);
479
- return Kv.__wrap(ret);
95
+ conns() {
96
+ const ret = wasm.actorcontext_conns(this.__wbg_ptr);
97
+ return ret;
98
+ }
99
+ destroy() {
100
+ const ret = wasm.actorcontext_destroy(this.__wbg_ptr);
101
+ if (ret[1]) {
102
+ throw takeFromExternrefTable0(ret[0]);
103
+ }
480
104
  }
481
105
  /**
482
- * @returns {Promise<boolean>}
106
+ * @returns {Array<any>}
483
107
  */
484
- waitForTrackedShutdownWork() {
485
- const ret = wasm.actorcontext_waitForTrackedShutdownWork(this.__wbg_ptr);
108
+ dirtyHibernatableConns() {
109
+ const ret = wasm.actorcontext_dirtyHibernatableConns(this.__wbg_ptr);
486
110
  return ret;
487
111
  }
488
112
  /**
489
- * @returns {Array<any>}
113
+ * @param {number} region_id
490
114
  */
491
- takePendingHibernationChanges() {
492
- const ret = wasm.actorcontext_takePendingHibernationChanges(this.__wbg_ptr);
493
- return ret;
115
+ endKeepAwake(region_id) {
116
+ wasm.actorcontext_endKeepAwake(this.__wbg_ptr, region_id);
117
+ }
118
+ endOnStateChange() {
119
+ wasm.actorcontext_endOnStateChange(this.__wbg_ptr);
494
120
  }
495
121
  /**
496
- * @returns {any}
122
+ * @param {number} region_id
497
123
  */
498
- key() {
499
- const ret = wasm.actorcontext_key(this.__wbg_ptr);
124
+ endWebsocketCallback(region_id) {
125
+ wasm.actorcontext_endWebsocketCallback(this.__wbg_ptr, region_id);
126
+ }
127
+ /**
128
+ * @returns {object}
129
+ */
130
+ inspectorSnapshot() {
131
+ const ret = wasm.actorcontext_inspectorSnapshot(this.__wbg_ptr);
500
132
  if (ret[2]) {
501
133
  throw takeFromExternrefTable0(ret[1]);
502
134
  }
503
135
  return takeFromExternrefTable0(ret[0]);
504
136
  }
505
- constructor() {
506
- const ret = wasm.actorcontext_new();
507
- if (ret[2]) {
508
- throw takeFromExternrefTable0(ret[1]);
509
- }
510
- this.__wbg_ptr = ret[0] >>> 0;
511
- ActorContextFinalization.register(this, this.__wbg_ptr, this);
512
- return this;
137
+ /**
138
+ * @param {Promise<any>} promise
139
+ */
140
+ keepAwake(promise) {
141
+ wasm.actorcontext_keepAwake(this.__wbg_ptr, promise);
513
142
  }
514
143
  /**
515
- * @returns {SqliteDb}
144
+ * @returns {any}
516
145
  */
517
- sql() {
518
- const ret = wasm.actorcontext_sql(this.__wbg_ptr);
519
- return SqliteDb.__wrap(ret);
146
+ key() {
147
+ const ret = wasm.actorcontext_key(this.__wbg_ptr);
148
+ if (ret[2]) {
149
+ throw takeFromExternrefTable0(ret[1]);
150
+ }
151
+ return takeFromExternrefTable0(ret[0]);
520
152
  }
521
153
  /**
522
- * @returns {Promise<void>}
154
+ * @returns {Kv}
523
155
  */
524
- waitForTrackedShutdownWorkUnbounded() {
525
- const ret = wasm.actorcontext_waitForTrackedShutdownWorkUnbounded(this.__wbg_ptr);
526
- return ret;
156
+ kv() {
157
+ const ret = wasm.actorcontext_kv(this.__wbg_ptr);
158
+ return Kv.__wrap(ret);
527
159
  }
528
160
  /**
529
161
  * @returns {string}
@@ -540,35 +172,22 @@ export class ActorContext {
540
172
  wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
541
173
  }
542
174
  }
543
- /**
544
- * @returns {Array<any>}
545
- */
546
- conns() {
547
- const ret = wasm.actorcontext_conns(this.__wbg_ptr);
548
- return ret;
175
+ constructor() {
176
+ const ret = wasm.actorcontext_new();
177
+ if (ret[2]) {
178
+ throw takeFromExternrefTable0(ret[1]);
179
+ }
180
+ this.__wbg_ptr = ret[0];
181
+ ActorContextFinalization.register(this, this.__wbg_ptr, this);
182
+ return this;
549
183
  }
550
184
  /**
551
185
  * @returns {Queue}
552
186
  */
553
187
  queue() {
554
- const ret = wasm.actorcontext_kv(this.__wbg_ptr);
188
+ const ret = wasm.actorcontext_queue(this.__wbg_ptr);
555
189
  return Queue.__wrap(ret);
556
190
  }
557
- sleep() {
558
- const ret = wasm.actorcontext_sleep(this.__wbg_ptr);
559
- if (ret[1]) {
560
- throw takeFromExternrefTable0(ret[0]);
561
- }
562
- }
563
- /**
564
- * @returns {Uint8Array}
565
- */
566
- state() {
567
- const ret = wasm.actorcontext_state(this.__wbg_ptr);
568
- var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
569
- wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
570
- return v1;
571
- }
572
191
  /**
573
192
  * @returns {string}
574
193
  */
@@ -584,69 +203,148 @@ export class ActorContext {
584
203
  wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
585
204
  }
586
205
  }
587
- destroy() {
588
- const ret = wasm.actorcontext_destroy(this.__wbg_ptr);
206
+ /**
207
+ * @param {Promise<any>} promise
208
+ */
209
+ registerTask(promise) {
210
+ wasm.actorcontext_registerTask(this.__wbg_ptr, promise);
211
+ }
212
+ /**
213
+ * @param {any} opts
214
+ * @returns {Promise<void>}
215
+ */
216
+ requestSaveAndWait(opts) {
217
+ const ret = wasm.actorcontext_requestSaveAndWait(this.__wbg_ptr, opts);
218
+ return ret;
219
+ }
220
+ /**
221
+ * @param {any} opts
222
+ */
223
+ requestSave(opts) {
224
+ wasm.actorcontext_requestSave(this.__wbg_ptr, opts);
225
+ }
226
+ restartRunHandler() {
227
+ const ret = wasm.actorcontext_restartRunHandler(this.__wbg_ptr);
589
228
  if (ret[1]) {
590
229
  throw takeFromExternrefTable0(ret[0]);
591
230
  }
592
231
  }
593
232
  /**
594
- * @returns {string}
233
+ * @returns {any}
595
234
  */
596
- actorId() {
597
- let deferred1_0;
598
- let deferred1_1;
599
- try {
600
- const ret = wasm.actorcontext_actorId(this.__wbg_ptr);
601
- deferred1_0 = ret[0];
602
- deferred1_1 = ret[1];
603
- return getStringFromWasm0(ret[0], ret[1]);
604
- } finally {
605
- wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
606
- }
235
+ runtimeState() {
236
+ const ret = wasm.actorcontext_runtimeState(this.__wbg_ptr);
237
+ return ret;
238
+ }
239
+ /**
240
+ * @param {any} writes
241
+ * @returns {Promise<void>}
242
+ */
243
+ saveStateAndWorkflowBatch(writes) {
244
+ const ret = wasm.actorcontext_saveStateAndWorkflowBatch(this.__wbg_ptr, writes);
245
+ return ret;
246
+ }
247
+ /**
248
+ * @param {any} payload
249
+ * @returns {Promise<void>}
250
+ */
251
+ saveState(payload) {
252
+ const ret = wasm.actorcontext_saveState(this.__wbg_ptr, payload);
253
+ return ret;
607
254
  }
608
255
  /**
609
256
  * @returns {Schedule}
610
257
  */
611
258
  schedule() {
612
- const ret = wasm.actorcontext_kv(this.__wbg_ptr);
259
+ const ret = wasm.actorcontext_schedule(this.__wbg_ptr);
613
260
  return Schedule.__wrap(ret);
614
261
  }
615
262
  /**
616
- * @param {string} name
617
- * @param {Uint8Array} args
263
+ * @param {number | null} [timestamp_ms]
618
264
  */
619
- broadcast(name, args) {
620
- const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
621
- const len0 = WASM_VECTOR_LEN;
622
- const ptr1 = passArray8ToWasm0(args, wasm.__wbindgen_malloc);
623
- const len1 = WASM_VECTOR_LEN;
624
- wasm.actorcontext_broadcast(this.__wbg_ptr, ptr0, len0, ptr1, len1);
265
+ setAlarm(timestamp_ms) {
266
+ const ret = wasm.actorcontext_setAlarm(this.__wbg_ptr, !isLikeNone(timestamp_ms), isLikeNone(timestamp_ms) ? 0 : timestamp_ms);
267
+ if (ret[1]) {
268
+ throw takeFromExternrefTable0(ret[0]);
269
+ }
625
270
  }
626
271
  /**
627
272
  * @param {number | null} [timestamp_ms]
273
+ * @returns {Promise<void>}
628
274
  */
629
- setAlarm(timestamp_ms) {
630
- const ret = wasm.actorcontext_setAlarm(this.__wbg_ptr, !isLikeNone(timestamp_ms), isLikeNone(timestamp_ms) ? 0 : timestamp_ms);
275
+ setRunWakeAt(timestamp_ms) {
276
+ const ret = wasm.actorcontext_setRunWakeAt(this.__wbg_ptr, !isLikeNone(timestamp_ms), isLikeNone(timestamp_ms) ? 0 : timestamp_ms);
277
+ return ret;
278
+ }
279
+ sleep() {
280
+ const ret = wasm.actorcontext_sleep(this.__wbg_ptr);
631
281
  if (ret[1]) {
632
282
  throw takeFromExternrefTable0(ret[0]);
633
283
  }
634
284
  }
285
+ /**
286
+ * @returns {SqliteDb}
287
+ */
288
+ sql() {
289
+ const ret = wasm.actorcontext_sql(this.__wbg_ptr);
290
+ return SqliteDb.__wrap(ret);
291
+ }
292
+ /**
293
+ * @returns {Uint8Array}
294
+ */
295
+ state() {
296
+ const ret = wasm.actorcontext_state(this.__wbg_ptr);
297
+ var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
298
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
299
+ return v1;
300
+ }
301
+ /**
302
+ * @returns {Array<any>}
303
+ */
304
+ takePendingHibernationChanges() {
305
+ const ret = wasm.actorcontext_takePendingHibernationChanges(this.__wbg_ptr);
306
+ return ret;
307
+ }
308
+ /**
309
+ * @param {string | null} [bearer_token]
310
+ * @returns {Promise<void>}
311
+ */
312
+ verifyInspectorAuth(bearer_token) {
313
+ var ptr0 = isLikeNone(bearer_token) ? 0 : passStringToWasm0(bearer_token, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
314
+ var len0 = WASM_VECTOR_LEN;
315
+ const ret = wasm.actorcontext_verifyInspectorAuth(this.__wbg_ptr, ptr0, len0);
316
+ return ret;
317
+ }
318
+ /**
319
+ * @returns {Promise<void>}
320
+ */
321
+ waitForTrackedShutdownWorkUnbounded() {
322
+ const ret = wasm.actorcontext_waitForTrackedShutdownWorkUnbounded(this.__wbg_ptr);
323
+ return ret;
324
+ }
325
+ /**
326
+ * @returns {Promise<boolean>}
327
+ */
328
+ waitForTrackedShutdownWork() {
329
+ const ret = wasm.actorcontext_waitForTrackedShutdownWork(this.__wbg_ptr);
330
+ return ret;
331
+ }
332
+ /**
333
+ * @param {Promise<any>} promise
334
+ */
335
+ waitUntil(promise) {
336
+ wasm.actorcontext_waitUntil(this.__wbg_ptr, promise);
337
+ }
635
338
  }
636
-
637
- const ActorFactoryFinalization = (typeof FinalizationRegistry === 'undefined')
638
- ? { register: () => {}, unregister: () => {} }
639
- : new FinalizationRegistry(ptr => wasm.__wbg_actorfactory_free(ptr >>> 0, 1));
339
+ if (Symbol.dispose) ActorContext.prototype[Symbol.dispose] = ActorContext.prototype.free;
640
340
 
641
341
  export class ActorFactory {
642
-
643
342
  __destroy_into_raw() {
644
343
  const ptr = this.__wbg_ptr;
645
344
  this.__wbg_ptr = 0;
646
345
  ActorFactoryFinalization.unregister(this);
647
346
  return ptr;
648
347
  }
649
-
650
348
  free() {
651
349
  const ptr = this.__destroy_into_raw();
652
350
  wasm.__wbg_actorfactory_free(ptr, 0);
@@ -660,33 +358,26 @@ export class ActorFactory {
660
358
  if (ret[2]) {
661
359
  throw takeFromExternrefTable0(ret[1]);
662
360
  }
663
- this.__wbg_ptr = ret[0] >>> 0;
361
+ this.__wbg_ptr = ret[0];
664
362
  ActorFactoryFinalization.register(this, this.__wbg_ptr, this);
665
363
  return this;
666
364
  }
667
365
  }
668
-
669
- const ActorStateTransactionFinalization = (typeof FinalizationRegistry === 'undefined')
670
- ? { register: () => {}, unregister: () => {} }
671
- : new FinalizationRegistry(ptr => wasm.__wbg_actorstatetransaction_free(ptr >>> 0, 1));
366
+ if (Symbol.dispose) ActorFactory.prototype[Symbol.dispose] = ActorFactory.prototype.free;
672
367
 
673
368
  export class ActorStateTransaction {
674
-
675
369
  static __wrap(ptr) {
676
- ptr = ptr >>> 0;
677
370
  const obj = Object.create(ActorStateTransaction.prototype);
678
371
  obj.__wbg_ptr = ptr;
679
372
  ActorStateTransactionFinalization.register(obj, obj.__wbg_ptr, obj);
680
373
  return obj;
681
374
  }
682
-
683
375
  __destroy_into_raw() {
684
376
  const ptr = this.__wbg_ptr;
685
377
  this.__wbg_ptr = 0;
686
378
  ActorStateTransactionFinalization.unregister(this);
687
379
  return ptr;
688
380
  }
689
-
690
381
  free() {
691
382
  const ptr = this.__destroy_into_raw();
692
383
  wasm.__wbg_actorstatetransaction_free(ptr, 0);
@@ -718,77 +409,97 @@ export class ActorStateTransaction {
718
409
  return ret;
719
410
  }
720
411
  }
412
+ if (Symbol.dispose) ActorStateTransaction.prototype[Symbol.dispose] = ActorStateTransaction.prototype.free;
721
413
 
722
- const CancellationTokenFinalization = (typeof FinalizationRegistry === 'undefined')
723
- ? { register: () => {}, unregister: () => {} }
724
- : new FinalizationRegistry(ptr => wasm.__wbg_cancellationtoken_free(ptr >>> 0, 1));
414
+ /**
415
+ * Registration returned by `CancellationToken.onCancelled`.
416
+ */
417
+ export class CancellationListener {
418
+ static __wrap(ptr) {
419
+ const obj = Object.create(CancellationListener.prototype);
420
+ obj.__wbg_ptr = ptr;
421
+ CancellationListenerFinalization.register(obj, obj.__wbg_ptr, obj);
422
+ return obj;
423
+ }
424
+ __destroy_into_raw() {
425
+ const ptr = this.__wbg_ptr;
426
+ this.__wbg_ptr = 0;
427
+ CancellationListenerFinalization.unregister(this);
428
+ return ptr;
429
+ }
430
+ free() {
431
+ const ptr = this.__destroy_into_raw();
432
+ wasm.__wbg_cancellationlistener_free(ptr, 0);
433
+ }
434
+ /**
435
+ * Stops waiting for cancellation without calling the callback.
436
+ */
437
+ release() {
438
+ wasm.cancellationlistener_release(this.__wbg_ptr);
439
+ }
440
+ }
441
+ if (Symbol.dispose) CancellationListener.prototype[Symbol.dispose] = CancellationListener.prototype.free;
725
442
 
726
443
  export class CancellationToken {
727
-
728
444
  static __wrap(ptr) {
729
- ptr = ptr >>> 0;
730
445
  const obj = Object.create(CancellationToken.prototype);
731
446
  obj.__wbg_ptr = ptr;
732
447
  CancellationTokenFinalization.register(obj, obj.__wbg_ptr, obj);
733
448
  return obj;
734
449
  }
735
-
736
450
  __destroy_into_raw() {
737
451
  const ptr = this.__wbg_ptr;
738
452
  this.__wbg_ptr = 0;
739
453
  CancellationTokenFinalization.unregister(this);
740
454
  return ptr;
741
455
  }
742
-
743
456
  free() {
744
457
  const ptr = this.__destroy_into_raw();
745
458
  wasm.__wbg_cancellationtoken_free(ptr, 0);
746
459
  }
747
460
  /**
748
- * @param {Function} callback
461
+ * @returns {boolean}
749
462
  */
750
- onCancelled(callback) {
751
- wasm.cancellationtoken_onCancelled(this.__wbg_ptr, callback);
463
+ aborted() {
464
+ const ret = wasm.cancellationtoken_aborted(this.__wbg_ptr);
465
+ return ret !== 0;
466
+ }
467
+ cancel() {
468
+ wasm.cancellationtoken_cancel(this.__wbg_ptr);
752
469
  }
753
470
  constructor() {
754
471
  const ret = wasm.cancellationtoken_new();
755
- this.__wbg_ptr = ret >>> 0;
472
+ this.__wbg_ptr = ret;
756
473
  CancellationTokenFinalization.register(this, this.__wbg_ptr, this);
757
474
  return this;
758
475
  }
759
- cancel() {
760
- wasm.cancellationtoken_cancel(this.__wbg_ptr);
761
- }
762
476
  /**
763
- * @returns {boolean}
477
+ * Calls `callback` once when the token is cancelled. Release the returned
478
+ * listener when cancellation no longer matters; otherwise the waiting task
479
+ * and the callback stay alive until the token is cancelled.
480
+ * @param {Function} callback
481
+ * @returns {CancellationListener}
764
482
  */
765
- aborted() {
766
- const ret = wasm.cancellationtoken_aborted(this.__wbg_ptr);
767
- return ret !== 0;
483
+ onCancelled(callback) {
484
+ const ret = wasm.cancellationtoken_onCancelled(this.__wbg_ptr, callback);
485
+ return CancellationListener.__wrap(ret);
768
486
  }
769
487
  }
770
-
771
- const ConnHandleFinalization = (typeof FinalizationRegistry === 'undefined')
772
- ? { register: () => {}, unregister: () => {} }
773
- : new FinalizationRegistry(ptr => wasm.__wbg_connhandle_free(ptr >>> 0, 1));
488
+ if (Symbol.dispose) CancellationToken.prototype[Symbol.dispose] = CancellationToken.prototype.free;
774
489
 
775
490
  export class ConnHandle {
776
-
777
491
  static __wrap(ptr) {
778
- ptr = ptr >>> 0;
779
492
  const obj = Object.create(ConnHandle.prototype);
780
493
  obj.__wbg_ptr = ptr;
781
494
  ConnHandleFinalization.register(obj, obj.__wbg_ptr, obj);
782
495
  return obj;
783
496
  }
784
-
785
497
  __destroy_into_raw() {
786
498
  const ptr = this.__wbg_ptr;
787
499
  this.__wbg_ptr = 0;
788
500
  ConnHandleFinalization.unregister(this);
789
501
  return ptr;
790
502
  }
791
-
792
503
  free() {
793
504
  const ptr = this.__destroy_into_raw();
794
505
  wasm.__wbg_connhandle_free(ptr, 0);
@@ -803,13 +514,6 @@ export class ConnHandle {
803
514
  const ret = wasm.connhandle_disconnect(this.__wbg_ptr, ptr0, len0);
804
515
  return ret;
805
516
  }
806
- /**
807
- * @returns {boolean}
808
- */
809
- isHibernatable() {
810
- const ret = wasm.connhandle_isHibernatable(this.__wbg_ptr);
811
- return ret !== 0;
812
- }
813
517
  /**
814
518
  * @returns {string}
815
519
  */
@@ -825,6 +529,22 @@ export class ConnHandle {
825
529
  wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
826
530
  }
827
531
  }
532
+ /**
533
+ * @returns {boolean}
534
+ */
535
+ isHibernatable() {
536
+ const ret = wasm.connhandle_isHibernatable(this.__wbg_ptr);
537
+ return ret !== 0;
538
+ }
539
+ /**
540
+ * @returns {Uint8Array}
541
+ */
542
+ params() {
543
+ const ret = wasm.connhandle_params(this.__wbg_ptr);
544
+ var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
545
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
546
+ return v1;
547
+ }
828
548
  /**
829
549
  * @param {string} name
830
550
  * @param {Uint8Array} args
@@ -837,46 +557,32 @@ export class ConnHandle {
837
557
  wasm.connhandle_send(this.__wbg_ptr, ptr0, len0, ptr1, len1);
838
558
  }
839
559
  /**
840
- * @returns {Uint8Array}
560
+ * @param {Uint8Array} state
841
561
  */
842
- state() {
843
- const ret = wasm.connhandle_state(this.__wbg_ptr);
844
- var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
845
- wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
846
- return v1;
562
+ setState(state) {
563
+ const ptr0 = passArray8ToWasm0(state, wasm.__wbindgen_malloc);
564
+ const len0 = WASM_VECTOR_LEN;
565
+ wasm.connhandle_setState(this.__wbg_ptr, ptr0, len0);
847
566
  }
848
567
  /**
849
568
  * @returns {Uint8Array}
850
569
  */
851
- params() {
852
- const ret = wasm.connhandle_params(this.__wbg_ptr);
570
+ state() {
571
+ const ret = wasm.connhandle_state(this.__wbg_ptr);
853
572
  var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
854
573
  wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
855
574
  return v1;
856
575
  }
857
- /**
858
- * @param {Uint8Array} state
859
- */
860
- setState(state) {
861
- const ptr0 = passArray8ToWasm0(state, wasm.__wbindgen_malloc);
862
- const len0 = WASM_VECTOR_LEN;
863
- wasm.connhandle_setState(this.__wbg_ptr, ptr0, len0);
864
- }
865
576
  }
866
-
867
- const CoreRegistryFinalization = (typeof FinalizationRegistry === 'undefined')
868
- ? { register: () => {}, unregister: () => {} }
869
- : new FinalizationRegistry(ptr => wasm.__wbg_coreregistry_free(ptr >>> 0, 1));
577
+ if (Symbol.dispose) ConnHandle.prototype[Symbol.dispose] = ConnHandle.prototype.free;
870
578
 
871
579
  export class CoreRegistry {
872
-
873
580
  __destroy_into_raw() {
874
581
  const ptr = this.__wbg_ptr;
875
582
  this.__wbg_ptr = 0;
876
583
  CoreRegistryFinalization.unregister(this);
877
584
  return ptr;
878
585
  }
879
-
880
586
  free() {
881
587
  const ptr = this.__destroy_into_raw();
882
588
  wasm.__wbg_coreregistry_free(ptr, 0);
@@ -895,18 +601,10 @@ export class CoreRegistry {
895
601
  }
896
602
  constructor() {
897
603
  const ret = wasm.coreregistry_new();
898
- this.__wbg_ptr = ret >>> 0;
604
+ this.__wbg_ptr = ret;
899
605
  CoreRegistryFinalization.register(this, this.__wbg_ptr, this);
900
606
  return this;
901
607
  }
902
- /**
903
- * @param {any} config
904
- * @returns {Promise<void>}
905
- */
906
- serve(config) {
907
- const ret = wasm.coreregistry_serve(this.__wbg_ptr, config);
908
- return ret;
909
- }
910
608
  /**
911
609
  * @param {string} name
912
610
  * @param {ActorFactory} factory
@@ -920,6 +618,14 @@ export class CoreRegistry {
920
618
  throw takeFromExternrefTable0(ret[0]);
921
619
  }
922
620
  }
621
+ /**
622
+ * @param {any} config
623
+ * @returns {Promise<void>}
624
+ */
625
+ serve(config) {
626
+ const ret = wasm.coreregistry_serve(this.__wbg_ptr, config);
627
+ return ret;
628
+ }
923
629
  /**
924
630
  * @returns {Promise<void>}
925
631
  */
@@ -928,73 +634,47 @@ export class CoreRegistry {
928
634
  return ret;
929
635
  }
930
636
  }
931
-
932
- const KvFinalization = (typeof FinalizationRegistry === 'undefined')
933
- ? { register: () => {}, unregister: () => {} }
934
- : new FinalizationRegistry(ptr => wasm.__wbg_kv_free(ptr >>> 0, 1));
637
+ if (Symbol.dispose) CoreRegistry.prototype[Symbol.dispose] = CoreRegistry.prototype.free;
935
638
 
936
639
  export class Kv {
937
-
938
640
  static __wrap(ptr) {
939
- ptr = ptr >>> 0;
940
641
  const obj = Object.create(Kv.prototype);
941
642
  obj.__wbg_ptr = ptr;
942
643
  KvFinalization.register(obj, obj.__wbg_ptr, obj);
943
644
  return obj;
944
645
  }
945
-
946
646
  __destroy_into_raw() {
947
647
  const ptr = this.__wbg_ptr;
948
648
  this.__wbg_ptr = 0;
949
649
  KvFinalization.unregister(this);
950
650
  return ptr;
951
651
  }
952
-
953
652
  free() {
954
653
  const ptr = this.__destroy_into_raw();
955
654
  wasm.__wbg_kv_free(ptr, 0);
956
655
  }
957
656
  /**
958
- * @param {Uint8Array} key
657
+ * @param {Array<any>} keys
959
658
  * @returns {Promise<void>}
960
659
  */
961
- delete(key) {
962
- const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
963
- const len0 = WASM_VECTOR_LEN;
964
- const ret = wasm.kv_delete(this.__wbg_ptr, ptr0, len0);
965
- return ret;
966
- }
967
- /**
968
- * @param {Uint8Array} start
969
- * @param {Uint8Array} end
970
- * @param {any} options
971
- * @returns {Promise<any>}
972
- */
973
- listRange(start, end, options) {
974
- const ptr0 = passArray8ToWasm0(start, wasm.__wbindgen_malloc);
975
- const len0 = WASM_VECTOR_LEN;
976
- const ptr1 = passArray8ToWasm0(end, wasm.__wbindgen_malloc);
977
- const len1 = WASM_VECTOR_LEN;
978
- const ret = wasm.kv_listRange(this.__wbg_ptr, ptr0, len0, ptr1, len1, options);
660
+ batchDelete(keys) {
661
+ const ret = wasm.kv_batchDelete(this.__wbg_ptr, keys);
979
662
  return ret;
980
663
  }
981
664
  /**
982
- * @param {Uint8Array} prefix
983
- * @param {any} options
665
+ * @param {Array<any>} keys
984
666
  * @returns {Promise<any>}
985
667
  */
986
- listPrefix(prefix, options) {
987
- const ptr0 = passArray8ToWasm0(prefix, wasm.__wbindgen_malloc);
988
- const len0 = WASM_VECTOR_LEN;
989
- const ret = wasm.kv_listPrefix(this.__wbg_ptr, ptr0, len0, options);
668
+ batchGet(keys) {
669
+ const ret = wasm.kv_batchGet(this.__wbg_ptr, keys);
990
670
  return ret;
991
671
  }
992
672
  /**
993
- * @param {Array<any>} keys
673
+ * @param {Array<any>} entries
994
674
  * @returns {Promise<void>}
995
675
  */
996
- batchDelete(keys) {
997
- const ret = wasm.kv_batchDelete(this.__wbg_ptr, keys);
676
+ batchPut(entries) {
677
+ const ret = wasm.kv_batchPut(this.__wbg_ptr, entries);
998
678
  return ret;
999
679
  }
1000
680
  /**
@@ -1010,6 +690,16 @@ export class Kv {
1010
690
  const ret = wasm.kv_deleteRange(this.__wbg_ptr, ptr0, len0, ptr1, len1);
1011
691
  return ret;
1012
692
  }
693
+ /**
694
+ * @param {Uint8Array} key
695
+ * @returns {Promise<void>}
696
+ */
697
+ delete(key) {
698
+ const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
699
+ const len0 = WASM_VECTOR_LEN;
700
+ const ret = wasm.kv_delete(this.__wbg_ptr, ptr0, len0);
701
+ return ret;
702
+ }
1013
703
  /**
1014
704
  * @param {Uint8Array} key
1015
705
  * @returns {Promise<any>}
@@ -1021,99 +711,75 @@ export class Kv {
1021
711
  return ret;
1022
712
  }
1023
713
  /**
1024
- * @param {Uint8Array} key
1025
- * @param {Uint8Array} value
1026
- * @returns {Promise<void>}
714
+ * @param {Uint8Array} prefix
715
+ * @param {any} options
716
+ * @returns {Promise<any>}
1027
717
  */
1028
- put(key, value) {
1029
- const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
718
+ listPrefix(prefix, options) {
719
+ const ptr0 = passArray8ToWasm0(prefix, wasm.__wbindgen_malloc);
1030
720
  const len0 = WASM_VECTOR_LEN;
1031
- const ptr1 = passArray8ToWasm0(value, wasm.__wbindgen_malloc);
1032
- const len1 = WASM_VECTOR_LEN;
1033
- const ret = wasm.kv_put(this.__wbg_ptr, ptr0, len0, ptr1, len1);
721
+ const ret = wasm.kv_listPrefix(this.__wbg_ptr, ptr0, len0, options);
1034
722
  return ret;
1035
723
  }
1036
724
  /**
1037
- * @param {Array<any>} keys
725
+ * @param {Uint8Array} start
726
+ * @param {Uint8Array} end
727
+ * @param {any} options
1038
728
  * @returns {Promise<any>}
1039
729
  */
1040
- batchGet(keys) {
1041
- const ret = wasm.kv_batchGet(this.__wbg_ptr, keys);
730
+ listRange(start, end, options) {
731
+ const ptr0 = passArray8ToWasm0(start, wasm.__wbindgen_malloc);
732
+ const len0 = WASM_VECTOR_LEN;
733
+ const ptr1 = passArray8ToWasm0(end, wasm.__wbindgen_malloc);
734
+ const len1 = WASM_VECTOR_LEN;
735
+ const ret = wasm.kv_listRange(this.__wbg_ptr, ptr0, len0, ptr1, len1, options);
1042
736
  return ret;
1043
737
  }
1044
738
  /**
1045
- * @param {Array<any>} entries
739
+ * @param {Uint8Array} key
740
+ * @param {Uint8Array} value
1046
741
  * @returns {Promise<void>}
1047
742
  */
1048
- batchPut(entries) {
1049
- const ret = wasm.kv_batchPut(this.__wbg_ptr, entries);
743
+ put(key, value) {
744
+ const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
745
+ const len0 = WASM_VECTOR_LEN;
746
+ const ptr1 = passArray8ToWasm0(value, wasm.__wbindgen_malloc);
747
+ const len1 = WASM_VECTOR_LEN;
748
+ const ret = wasm.kv_put(this.__wbg_ptr, ptr0, len0, ptr1, len1);
1050
749
  return ret;
1051
750
  }
1052
751
  }
1053
-
1054
- const QueueFinalization = (typeof FinalizationRegistry === 'undefined')
1055
- ? { register: () => {}, unregister: () => {} }
1056
- : new FinalizationRegistry(ptr => wasm.__wbg_queue_free(ptr >>> 0, 1));
752
+ if (Symbol.dispose) Kv.prototype[Symbol.dispose] = Kv.prototype.free;
1057
753
 
1058
754
  export class Queue {
1059
-
1060
755
  static __wrap(ptr) {
1061
- ptr = ptr >>> 0;
1062
756
  const obj = Object.create(Queue.prototype);
1063
757
  obj.__wbg_ptr = ptr;
1064
758
  QueueFinalization.register(obj, obj.__wbg_ptr, obj);
1065
759
  return obj;
1066
760
  }
1067
-
1068
761
  __destroy_into_raw() {
1069
762
  const ptr = this.__wbg_ptr;
1070
763
  this.__wbg_ptr = 0;
1071
764
  QueueFinalization.unregister(this);
1072
765
  return ptr;
1073
766
  }
1074
-
1075
767
  free() {
1076
768
  const ptr = this.__destroy_into_raw();
1077
769
  wasm.__wbg_queue_free(ptr, 0);
1078
770
  }
1079
771
  /**
1080
- * @param {any} options
1081
- * @param {CancellationToken | null} [signal]
1082
- * @returns {Promise<Array<any>>}
1083
- */
1084
- nextBatch(options, signal) {
1085
- let ptr0 = 0;
1086
- if (!isLikeNone(signal)) {
1087
- _assertClass(signal, CancellationToken);
1088
- ptr0 = signal.__destroy_into_raw();
1089
- }
1090
- const ret = wasm.queue_nextBatch(this.__wbg_ptr, options, ptr0);
1091
- return ret;
1092
- }
1093
- /**
1094
- * @param {any} options
1095
- * @returns {Array<any>}
1096
- */
1097
- tryNextBatch(options) {
1098
- const ret = wasm.queue_tryNextBatch(this.__wbg_ptr, options);
1099
- if (ret[2]) {
1100
- throw takeFromExternrefTable0(ret[1]);
1101
- }
1102
- return takeFromExternrefTable0(ret[0]);
1103
- }
1104
- /**
1105
- * @param {any} names
1106
- * @param {any} options
1107
- * @param {CancellationToken | null} [signal]
1108
- * @returns {Promise<QueueMessage>}
772
+ * @param {bigint} message_id
773
+ * @param {string} expected_name
774
+ * @param {Uint8Array | null} [response]
775
+ * @returns {Promise<boolean>}
1109
776
  */
1110
- waitForNames(names, options, signal) {
1111
- let ptr0 = 0;
1112
- if (!isLikeNone(signal)) {
1113
- _assertClass(signal, CancellationToken);
1114
- ptr0 = signal.__destroy_into_raw();
1115
- }
1116
- const ret = wasm.queue_waitForNames(this.__wbg_ptr, names, options, ptr0);
777
+ completePersisted(message_id, expected_name, response) {
778
+ const ptr0 = passStringToWasm0(expected_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
779
+ const len0 = WASM_VECTOR_LEN;
780
+ var ptr1 = isLikeNone(response) ? 0 : passArray8ToWasm0(response, wasm.__wbindgen_malloc);
781
+ var len1 = WASM_VECTOR_LEN;
782
+ const ret = wasm.queue_completePersisted(this.__wbg_ptr, message_id, ptr0, len0, ptr1, len1);
1117
783
  return ret;
1118
784
  }
1119
785
  /**
@@ -1144,26 +810,31 @@ export class Queue {
1144
810
  return ret;
1145
811
  }
1146
812
  /**
1147
- * @param {bigint} message_id
1148
- * @param {string} expected_name
1149
- * @param {Uint8Array | null} [response]
1150
- * @returns {Promise<boolean>}
813
+ * @returns {number}
1151
814
  */
1152
- completePersisted(message_id, expected_name, response) {
1153
- const ptr0 = passStringToWasm0(expected_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1154
- const len0 = WASM_VECTOR_LEN;
1155
- var ptr1 = isLikeNone(response) ? 0 : passArray8ToWasm0(response, wasm.__wbindgen_malloc);
1156
- var len1 = WASM_VECTOR_LEN;
1157
- const ret = wasm.queue_completePersisted(this.__wbg_ptr, message_id, ptr0, len0, ptr1, len1);
1158
- return ret;
815
+ maxSize() {
816
+ const ret = wasm.queue_maxSize(this.__wbg_ptr);
817
+ return ret >>> 0;
1159
818
  }
1160
819
  /**
1161
- * @param {any} names
1162
820
  * @param {any} options
821
+ * @param {CancellationToken | null} [signal]
822
+ * @returns {Promise<Array<any>>}
823
+ */
824
+ nextBatch(options, signal) {
825
+ let ptr0 = 0;
826
+ if (!isLikeNone(signal)) {
827
+ _assertClass(signal, CancellationToken);
828
+ ptr0 = signal.__destroy_into_raw();
829
+ }
830
+ const ret = wasm.queue_nextBatch(this.__wbg_ptr, options, ptr0);
831
+ return ret;
832
+ }
833
+ /**
1163
834
  * @returns {Promise<void>}
1164
835
  */
1165
- waitForNamesAvailable(names, options) {
1166
- const ret = wasm.queue_waitForNamesAvailable(this.__wbg_ptr, names, options);
836
+ reset() {
837
+ const ret = wasm.queue_reset(this.__wbg_ptr);
1167
838
  return ret;
1168
839
  }
1169
840
  /**
@@ -1180,59 +851,83 @@ export class Queue {
1180
851
  return ret;
1181
852
  }
1182
853
  /**
854
+ * @param {any} options
855
+ * @returns {Array<any>}
856
+ */
857
+ tryNextBatch(options) {
858
+ const ret = wasm.queue_tryNextBatch(this.__wbg_ptr, options);
859
+ if (ret[2]) {
860
+ throw takeFromExternrefTable0(ret[1]);
861
+ }
862
+ return takeFromExternrefTable0(ret[0]);
863
+ }
864
+ /**
865
+ * @param {any} names
866
+ * @param {any} options
1183
867
  * @returns {Promise<void>}
1184
868
  */
1185
- reset() {
1186
- const ret = wasm.queue_reset(this.__wbg_ptr);
869
+ waitForNamesAvailable(names, options) {
870
+ const ret = wasm.queue_waitForNamesAvailable(this.__wbg_ptr, names, options);
1187
871
  return ret;
1188
872
  }
1189
873
  /**
1190
- * @returns {number}
874
+ * @param {any} names
875
+ * @param {any} options
876
+ * @param {CancellationToken | null} [signal]
877
+ * @returns {Promise<QueueMessage>}
1191
878
  */
1192
- maxSize() {
1193
- const ret = wasm.queue_maxSize(this.__wbg_ptr);
1194
- return ret >>> 0;
879
+ waitForNames(names, options, signal) {
880
+ let ptr0 = 0;
881
+ if (!isLikeNone(signal)) {
882
+ _assertClass(signal, CancellationToken);
883
+ ptr0 = signal.__destroy_into_raw();
884
+ }
885
+ const ret = wasm.queue_waitForNames(this.__wbg_ptr, names, options, ptr0);
886
+ return ret;
1195
887
  }
1196
888
  }
1197
-
1198
- const QueueMessageFinalization = (typeof FinalizationRegistry === 'undefined')
1199
- ? { register: () => {}, unregister: () => {} }
1200
- : new FinalizationRegistry(ptr => wasm.__wbg_queuemessage_free(ptr >>> 0, 1));
889
+ if (Symbol.dispose) Queue.prototype[Symbol.dispose] = Queue.prototype.free;
1201
890
 
1202
891
  export class QueueMessage {
1203
-
1204
892
  static __wrap(ptr) {
1205
- ptr = ptr >>> 0;
1206
893
  const obj = Object.create(QueueMessage.prototype);
1207
894
  obj.__wbg_ptr = ptr;
1208
895
  QueueMessageFinalization.register(obj, obj.__wbg_ptr, obj);
1209
896
  return obj;
1210
897
  }
1211
-
1212
898
  __destroy_into_raw() {
1213
899
  const ptr = this.__wbg_ptr;
1214
900
  this.__wbg_ptr = 0;
1215
901
  QueueMessageFinalization.unregister(this);
1216
902
  return ptr;
1217
903
  }
1218
-
1219
904
  free() {
1220
905
  const ptr = this.__destroy_into_raw();
1221
906
  wasm.__wbg_queuemessage_free(ptr, 0);
1222
907
  }
1223
908
  /**
1224
- * @returns {number}
909
+ * @returns {Uint8Array}
1225
910
  */
1226
- createdAt() {
1227
- const ret = wasm.queuemessage_createdAt(this.__wbg_ptr);
911
+ body() {
912
+ const ret = wasm.queuemessage_body(this.__wbg_ptr);
913
+ var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
914
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
915
+ return v1;
916
+ }
917
+ /**
918
+ * @param {any} response
919
+ * @returns {Promise<void>}
920
+ */
921
+ complete(response) {
922
+ const ret = wasm.queuemessage_complete(this.__wbg_ptr, response);
1228
923
  return ret;
1229
924
  }
1230
925
  /**
1231
- * @returns {boolean}
926
+ * @returns {number}
1232
927
  */
1233
- isCompletable() {
1234
- const ret = wasm.queuemessage_isCompletable(this.__wbg_ptr);
1235
- return ret !== 0;
928
+ createdAt() {
929
+ const ret = wasm.queuemessage_createdAt(this.__wbg_ptr);
930
+ return ret;
1236
931
  }
1237
932
  /**
1238
933
  * @returns {bigint}
@@ -1242,13 +937,11 @@ export class QueueMessage {
1242
937
  return BigInt.asUintN(64, ret);
1243
938
  }
1244
939
  /**
1245
- * @returns {Uint8Array}
940
+ * @returns {boolean}
1246
941
  */
1247
- body() {
1248
- const ret = wasm.queuemessage_body(this.__wbg_ptr);
1249
- var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
1250
- wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
1251
- return v1;
942
+ isCompletable() {
943
+ const ret = wasm.queuemessage_isCompletable(this.__wbg_ptr);
944
+ return ret !== 0;
1252
945
  }
1253
946
  /**
1254
947
  * @returns {string}
@@ -1265,78 +958,38 @@ export class QueueMessage {
1265
958
  wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
1266
959
  }
1267
960
  }
1268
- /**
1269
- * @param {any} response
1270
- * @returns {Promise<void>}
1271
- */
1272
- complete(response) {
1273
- const ret = wasm.queuemessage_complete(this.__wbg_ptr, response);
1274
- return ret;
1275
- }
1276
961
  }
1277
-
1278
- const ScheduleFinalization = (typeof FinalizationRegistry === 'undefined')
1279
- ? { register: () => {}, unregister: () => {} }
1280
- : new FinalizationRegistry(ptr => wasm.__wbg_schedule_free(ptr >>> 0, 1));
962
+ if (Symbol.dispose) QueueMessage.prototype[Symbol.dispose] = QueueMessage.prototype.free;
1281
963
 
1282
964
  export class Schedule {
1283
-
1284
965
  static __wrap(ptr) {
1285
- ptr = ptr >>> 0;
1286
966
  const obj = Object.create(Schedule.prototype);
1287
967
  obj.__wbg_ptr = ptr;
1288
968
  ScheduleFinalization.register(obj, obj.__wbg_ptr, obj);
1289
969
  return obj;
1290
970
  }
1291
-
1292
971
  __destroy_into_raw() {
1293
972
  const ptr = this.__wbg_ptr;
1294
973
  this.__wbg_ptr = 0;
1295
974
  ScheduleFinalization.unregister(this);
1296
975
  return ptr;
1297
976
  }
1298
-
1299
977
  free() {
1300
978
  const ptr = this.__destroy_into_raw();
1301
979
  wasm.__wbg_schedule_free(ptr, 0);
1302
980
  }
1303
981
  /**
1304
- * @param {string} name
1305
- * @param {number} interval_ms
982
+ * @param {number} duration_ms
1306
983
  * @param {string} action_name
1307
984
  * @param {Uint8Array} args
1308
- * @param {number | null} [max_history]
1309
- * @returns {Promise<void>}
985
+ * @returns {Promise<string>}
1310
986
  */
1311
- cronEvery(name, interval_ms, action_name, args, max_history) {
1312
- const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
987
+ after(duration_ms, action_name, args) {
988
+ const ptr0 = passStringToWasm0(action_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1313
989
  const len0 = WASM_VECTOR_LEN;
1314
- const ptr1 = passStringToWasm0(action_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
990
+ const ptr1 = passArray8ToWasm0(args, wasm.__wbindgen_malloc);
1315
991
  const len1 = WASM_VECTOR_LEN;
1316
- const ptr2 = passArray8ToWasm0(args, wasm.__wbindgen_malloc);
1317
- const len2 = WASM_VECTOR_LEN;
1318
- 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);
1319
- return ret;
1320
- }
1321
- /**
1322
- * @param {string} name
1323
- * @returns {Promise<boolean>}
1324
- */
1325
- cronDelete(name) {
1326
- const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1327
- const len0 = WASM_VECTOR_LEN;
1328
- const ret = wasm.schedule_cronDelete(this.__wbg_ptr, ptr0, len0);
1329
- return ret;
1330
- }
1331
- /**
1332
- * @param {string} name
1333
- * @param {number | null} [limit]
1334
- * @returns {Promise<any>}
1335
- */
1336
- cronHistory(name, limit) {
1337
- const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1338
- const len0 = WASM_VECTOR_LEN;
1339
- const ret = wasm.schedule_cronHistory(this.__wbg_ptr, ptr0, len0, !isLikeNone(limit), isLikeNone(limit) ? 0 : limit);
992
+ const ret = wasm.schedule_after(this.__wbg_ptr, duration_ms, ptr0, len0, ptr1, len1);
1340
993
  return ret;
1341
994
  }
1342
995
  /**
@@ -1355,53 +1008,68 @@ export class Schedule {
1355
1008
  }
1356
1009
  /**
1357
1010
  * @param {string} id
1358
- * @returns {Promise<any>}
1011
+ * @returns {Promise<boolean>}
1359
1012
  */
1360
- get(id) {
1013
+ cancel(id) {
1361
1014
  const ptr0 = passStringToWasm0(id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1362
1015
  const len0 = WASM_VECTOR_LEN;
1363
- const ret = wasm.schedule_get(this.__wbg_ptr, ptr0, len0);
1016
+ const ret = wasm.schedule_cancel(this.__wbg_ptr, ptr0, len0);
1364
1017
  return ret;
1365
1018
  }
1366
1019
  /**
1367
- * @returns {Promise<any>}
1020
+ * @param {string} name
1021
+ * @returns {Promise<boolean>}
1368
1022
  */
1369
- list() {
1370
- const ret = wasm.schedule_list(this.__wbg_ptr);
1023
+ cronDelete(name) {
1024
+ const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1025
+ const len0 = WASM_VECTOR_LEN;
1026
+ const ret = wasm.schedule_cronDelete(this.__wbg_ptr, ptr0, len0);
1371
1027
  return ret;
1372
1028
  }
1373
1029
  /**
1374
- * @param {number} duration_ms
1030
+ * @param {string} name
1031
+ * @param {number} interval_ms
1375
1032
  * @param {string} action_name
1376
1033
  * @param {Uint8Array} args
1377
- * @returns {Promise<string>}
1034
+ * @param {number | null} [max_history]
1035
+ * @returns {Promise<void>}
1378
1036
  */
1379
- after(duration_ms, action_name, args) {
1380
- const ptr0 = passStringToWasm0(action_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1037
+ cronEvery(name, interval_ms, action_name, args, max_history) {
1038
+ const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1381
1039
  const len0 = WASM_VECTOR_LEN;
1382
- const ptr1 = passArray8ToWasm0(args, wasm.__wbindgen_malloc);
1040
+ const ptr1 = passStringToWasm0(action_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1383
1041
  const len1 = WASM_VECTOR_LEN;
1384
- const ret = wasm.schedule_after(this.__wbg_ptr, duration_ms, ptr0, len0, ptr1, len1);
1042
+ const ptr2 = passArray8ToWasm0(args, wasm.__wbindgen_malloc);
1043
+ const len2 = WASM_VECTOR_LEN;
1044
+ 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);
1385
1045
  return ret;
1386
1046
  }
1387
1047
  /**
1388
- * @param {string} id
1389
- * @returns {Promise<boolean>}
1048
+ * @param {string} name
1049
+ * @returns {Promise<any>}
1390
1050
  */
1391
- cancel(id) {
1392
- const ptr0 = passStringToWasm0(id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1051
+ cronGet(name) {
1052
+ const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1393
1053
  const len0 = WASM_VECTOR_LEN;
1394
- const ret = wasm.schedule_cancel(this.__wbg_ptr, ptr0, len0);
1054
+ const ret = wasm.schedule_cronGet(this.__wbg_ptr, ptr0, len0);
1395
1055
  return ret;
1396
1056
  }
1397
1057
  /**
1398
1058
  * @param {string} name
1059
+ * @param {number | null} [limit]
1399
1060
  * @returns {Promise<any>}
1400
1061
  */
1401
- cronGet(name) {
1062
+ cronHistory(name, limit) {
1402
1063
  const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1403
1064
  const len0 = WASM_VECTOR_LEN;
1404
- const ret = wasm.schedule_cronGet(this.__wbg_ptr, ptr0, len0);
1065
+ const ret = wasm.schedule_cronHistory(this.__wbg_ptr, ptr0, len0, !isLikeNone(limit), isLikeNone(limit) ? 0 : limit);
1066
+ return ret;
1067
+ }
1068
+ /**
1069
+ * @returns {Promise<any>}
1070
+ */
1071
+ cronList() {
1072
+ const ret = wasm.schedule_cronList(this.__wbg_ptr);
1405
1073
  return ret;
1406
1074
  }
1407
1075
  /**
@@ -1428,39 +1096,70 @@ export class Schedule {
1428
1096
  return ret;
1429
1097
  }
1430
1098
  /**
1099
+ * @param {string} id
1431
1100
  * @returns {Promise<any>}
1432
1101
  */
1433
- cronList() {
1434
- const ret = wasm.schedule_cronList(this.__wbg_ptr);
1102
+ get(id) {
1103
+ const ptr0 = passStringToWasm0(id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1104
+ const len0 = WASM_VECTOR_LEN;
1105
+ const ret = wasm.schedule_get(this.__wbg_ptr, ptr0, len0);
1106
+ return ret;
1107
+ }
1108
+ /**
1109
+ * @returns {Promise<any>}
1110
+ */
1111
+ list() {
1112
+ const ret = wasm.schedule_list(this.__wbg_ptr);
1435
1113
  return ret;
1436
1114
  }
1437
1115
  }
1438
-
1439
- const SqliteDbFinalization = (typeof FinalizationRegistry === 'undefined')
1440
- ? { register: () => {}, unregister: () => {} }
1441
- : new FinalizationRegistry(ptr => wasm.__wbg_sqlitedb_free(ptr >>> 0, 1));
1116
+ if (Symbol.dispose) Schedule.prototype[Symbol.dispose] = Schedule.prototype.free;
1442
1117
 
1443
1118
  export class SqliteDb {
1444
-
1445
1119
  static __wrap(ptr) {
1446
- ptr = ptr >>> 0;
1447
1120
  const obj = Object.create(SqliteDb.prototype);
1448
1121
  obj.__wbg_ptr = ptr;
1449
1122
  SqliteDbFinalization.register(obj, obj.__wbg_ptr, obj);
1450
1123
  return obj;
1451
1124
  }
1452
-
1453
1125
  __destroy_into_raw() {
1454
1126
  const ptr = this.__wbg_ptr;
1455
1127
  this.__wbg_ptr = 0;
1456
1128
  SqliteDbFinalization.unregister(this);
1457
1129
  return ptr;
1458
1130
  }
1459
-
1460
1131
  free() {
1461
1132
  const ptr = this.__destroy_into_raw();
1462
1133
  wasm.__wbg_sqlitedb_free(ptr, 0);
1463
1134
  }
1135
+ /**
1136
+ * @param {number | null} [timeout_ms]
1137
+ * @param {string | null} [name]
1138
+ * @returns {Promise<SqliteTransaction>}
1139
+ */
1140
+ beginTransaction(timeout_ms, name) {
1141
+ var ptr0 = isLikeNone(name) ? 0 : passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1142
+ var len0 = WASM_VECTOR_LEN;
1143
+ const ret = wasm.sqlitedb_beginTransaction(this.__wbg_ptr, !isLikeNone(timeout_ms), isLikeNone(timeout_ms) ? 0 : timeout_ms, ptr0, len0);
1144
+ return ret;
1145
+ }
1146
+ /**
1147
+ * @returns {Promise<void>}
1148
+ */
1149
+ close() {
1150
+ const ret = wasm.sqlitedb_close(this.__wbg_ptr);
1151
+ return ret;
1152
+ }
1153
+ /**
1154
+ * @param {string} sql
1155
+ * @returns {Promise<any>}
1156
+ */
1157
+ exec(sql) {
1158
+ const ptr0 = passStringToWasm0(sql, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1159
+ const len0 = WASM_VECTOR_LEN;
1160
+ const ret = wasm.sqlitedb_exec(this.__wbg_ptr, ptr0, len0);
1161
+ return ret;
1162
+ }
1464
1163
  /**
1465
1164
  * @param {any} statements
1466
1165
  * @returns {Promise<any>}
@@ -1470,14 +1169,25 @@ export class SqliteDb {
1470
1169
  return ret;
1471
1170
  }
1472
1171
  /**
1473
- * @param {number | null} [timeout_ms]
1474
- * @param {string | null} [name]
1475
- * @returns {Promise<SqliteTransaction>}
1172
+ * @param {string} sql
1173
+ * @param {any} params
1174
+ * @returns {Promise<any>}
1476
1175
  */
1477
- beginTransaction(timeout_ms, name) {
1478
- var ptr0 = isLikeNone(name) ? 0 : passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1479
- var len0 = WASM_VECTOR_LEN;
1480
- const ret = wasm.sqlitedb_beginTransaction(this.__wbg_ptr, !isLikeNone(timeout_ms), isLikeNone(timeout_ms) ? 0 : timeout_ms, ptr0, len0);
1176
+ execute(sql, params) {
1177
+ const ptr0 = passStringToWasm0(sql, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1178
+ const len0 = WASM_VECTOR_LEN;
1179
+ const ret = wasm.sqlitedb_execute(this.__wbg_ptr, ptr0, len0, params);
1180
+ return ret;
1181
+ }
1182
+ /**
1183
+ * @param {string} sql
1184
+ * @param {any} params
1185
+ * @returns {Promise<any>}
1186
+ */
1187
+ query(sql, params) {
1188
+ const ptr0 = passStringToWasm0(sql, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1189
+ const len0 = WASM_VECTOR_LEN;
1190
+ const ret = wasm.sqlitedb_query(this.__wbg_ptr, ptr0, len0, params);
1481
1191
  return ret;
1482
1192
  }
1483
1193
  /**
@@ -1491,6 +1201,33 @@ export class SqliteDb {
1491
1201
  const ret = wasm.sqlitedb_run(this.__wbg_ptr, ptr0, len0, params);
1492
1202
  return ret;
1493
1203
  }
1204
+ }
1205
+ if (Symbol.dispose) SqliteDb.prototype[Symbol.dispose] = SqliteDb.prototype.free;
1206
+
1207
+ export class SqliteTransaction {
1208
+ static __wrap(ptr) {
1209
+ const obj = Object.create(SqliteTransaction.prototype);
1210
+ obj.__wbg_ptr = ptr;
1211
+ SqliteTransactionFinalization.register(obj, obj.__wbg_ptr, obj);
1212
+ return obj;
1213
+ }
1214
+ __destroy_into_raw() {
1215
+ const ptr = this.__wbg_ptr;
1216
+ this.__wbg_ptr = 0;
1217
+ SqliteTransactionFinalization.unregister(this);
1218
+ return ptr;
1219
+ }
1220
+ free() {
1221
+ const ptr = this.__destroy_into_raw();
1222
+ wasm.__wbg_sqlitetransaction_free(ptr, 0);
1223
+ }
1224
+ /**
1225
+ * @returns {Promise<void>}
1226
+ */
1227
+ commit() {
1228
+ const ret = wasm.sqlitetransaction_commit(this.__wbg_ptr);
1229
+ return ret;
1230
+ }
1494
1231
  /**
1495
1232
  * @param {string} sql
1496
1233
  * @returns {Promise<any>}
@@ -1498,751 +1235,1051 @@ export class SqliteDb {
1498
1235
  exec(sql) {
1499
1236
  const ptr0 = passStringToWasm0(sql, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1500
1237
  const len0 = WASM_VECTOR_LEN;
1501
- const ret = wasm.sqlitedb_exec(this.__wbg_ptr, ptr0, len0);
1238
+ const ret = wasm.sqlitetransaction_exec(this.__wbg_ptr, ptr0, len0);
1239
+ return ret;
1240
+ }
1241
+ /**
1242
+ * @param {string} sql
1243
+ * @param {any} params
1244
+ * @returns {Promise<any>}
1245
+ */
1246
+ execute(sql, params) {
1247
+ const ptr0 = passStringToWasm0(sql, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1248
+ const len0 = WASM_VECTOR_LEN;
1249
+ const ret = wasm.sqlitetransaction_execute(this.__wbg_ptr, ptr0, len0, params);
1502
1250
  return ret;
1503
1251
  }
1504
1252
  /**
1505
1253
  * @returns {Promise<void>}
1506
1254
  */
1507
- close() {
1508
- const ret = wasm.sqlitedb_close(this.__wbg_ptr);
1255
+ rollback() {
1256
+ const ret = wasm.sqlitetransaction_rollback(this.__wbg_ptr);
1509
1257
  return ret;
1510
1258
  }
1259
+ }
1260
+ if (Symbol.dispose) SqliteTransaction.prototype[Symbol.dispose] = SqliteTransaction.prototype.free;
1261
+
1262
+ export class WebSocketHandle {
1263
+ static __wrap(ptr) {
1264
+ const obj = Object.create(WebSocketHandle.prototype);
1265
+ obj.__wbg_ptr = ptr;
1266
+ WebSocketHandleFinalization.register(obj, obj.__wbg_ptr, obj);
1267
+ return obj;
1268
+ }
1269
+ __destroy_into_raw() {
1270
+ const ptr = this.__wbg_ptr;
1271
+ this.__wbg_ptr = 0;
1272
+ WebSocketHandleFinalization.unregister(this);
1273
+ return ptr;
1274
+ }
1275
+ free() {
1276
+ const ptr = this.__destroy_into_raw();
1277
+ wasm.__wbg_websockethandle_free(ptr, 0);
1278
+ }
1511
1279
  /**
1512
- * @param {string} sql
1513
- * @param {any} params
1514
- * @returns {Promise<any>}
1280
+ * @param {number | null} [code]
1281
+ * @param {string | null} [reason]
1282
+ * @returns {Promise<void>}
1515
1283
  */
1516
- query(sql, params) {
1517
- const ptr0 = passStringToWasm0(sql, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1518
- const len0 = WASM_VECTOR_LEN;
1519
- const ret = wasm.sqlitedb_query(this.__wbg_ptr, ptr0, len0, params);
1284
+ close(code, reason) {
1285
+ var ptr0 = isLikeNone(reason) ? 0 : passStringToWasm0(reason, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1286
+ var len0 = WASM_VECTOR_LEN;
1287
+ const ret = wasm.websockethandle_close(this.__wbg_ptr, isLikeNone(code) ? 0xFFFFFF : code, ptr0, len0);
1520
1288
  return ret;
1521
1289
  }
1522
1290
  /**
1523
- * @param {string} sql
1524
- * @param {any} params
1525
- * @returns {Promise<any>}
1291
+ * @param {Uint8Array} data
1292
+ * @param {boolean} binary
1526
1293
  */
1527
- execute(sql, params) {
1528
- const ptr0 = passStringToWasm0(sql, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1294
+ send(data, binary) {
1295
+ const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
1529
1296
  const len0 = WASM_VECTOR_LEN;
1530
- const ret = wasm.sqlitedb_execute(this.__wbg_ptr, ptr0, len0, params);
1531
- return ret;
1297
+ const ret = wasm.websockethandle_send(this.__wbg_ptr, ptr0, len0, binary);
1298
+ if (ret[1]) {
1299
+ throw takeFromExternrefTable0(ret[0]);
1300
+ }
1301
+ }
1302
+ /**
1303
+ * @param {Function} callback
1304
+ */
1305
+ setEventCallback(callback) {
1306
+ wasm.websockethandle_setEventCallback(this.__wbg_ptr, callback);
1307
+ }
1308
+ }
1309
+ if (Symbol.dispose) WebSocketHandle.prototype[Symbol.dispose] = WebSocketHandle.prototype.free;
1310
+
1311
+ /**
1312
+ * @param {Promise<any>} promise
1313
+ * @returns {Promise<any>}
1314
+ */
1315
+ export function awaitPromise(promise) {
1316
+ const ret = wasm.awaitPromise(promise);
1317
+ return ret;
1318
+ }
1319
+
1320
+ /**
1321
+ * @returns {string}
1322
+ */
1323
+ export function bridgeRivetErrorPrefix() {
1324
+ let deferred1_0;
1325
+ let deferred1_1;
1326
+ try {
1327
+ const ret = wasm.bridgeRivetErrorPrefix();
1328
+ deferred1_0 = ret[0];
1329
+ deferred1_1 = ret[1];
1330
+ return getStringFromWasm0(ret[0], ret[1]);
1331
+ } finally {
1332
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
1333
+ }
1334
+ }
1335
+
1336
+ /**
1337
+ * @param {Uint8Array} bytes
1338
+ * @returns {Uint8Array}
1339
+ */
1340
+ export function roundTripBytes(bytes) {
1341
+ const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
1342
+ const len0 = WASM_VECTOR_LEN;
1343
+ const ret = wasm.roundTripBytes(ptr0, len0);
1344
+ var v2 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
1345
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
1346
+ return v2;
1347
+ }
1348
+
1349
+ export function start() {
1350
+ wasm.start();
1351
+ }
1352
+
1353
+ /**
1354
+ * @param {Uint8Array} bytes
1355
+ * @returns {Uint8Array}
1356
+ */
1357
+ export function uint8ArrayFromBytes(bytes) {
1358
+ const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
1359
+ const len0 = WASM_VECTOR_LEN;
1360
+ const ret = wasm.uint8ArrayFromBytes(ptr0, len0);
1361
+ return ret;
1362
+ }
1363
+ function __wbg_get_imports() {
1364
+ const import0 = {
1365
+ __proto__: null,
1366
+ __wbg_Error_30c8987f7c2ed4e2: function(arg0, arg1) {
1367
+ const ret = Error(getStringFromWasm0(arg0, arg1));
1368
+ return ret;
1369
+ },
1370
+ __wbg_Number_14af1003b8dd5ead: function(arg0) {
1371
+ const ret = Number(arg0);
1372
+ return ret;
1373
+ },
1374
+ __wbg_String_8564e559799eccda: function(arg0, arg1) {
1375
+ const ret = String(arg1);
1376
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1377
+ const len1 = WASM_VECTOR_LEN;
1378
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1379
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1380
+ },
1381
+ __wbg___wbindgen_boolean_get_5b446f51afd21013: function(arg0) {
1382
+ const v = arg0;
1383
+ const ret = typeof(v) === 'boolean' ? v : undefined;
1384
+ return isLikeNone(ret) ? 0xFFFFFF : ret ? 1 : 0;
1385
+ },
1386
+ __wbg___wbindgen_debug_string_4687d8d8c2017d52: function(arg0, arg1) {
1387
+ const ret = debugString(arg1);
1388
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1389
+ const len1 = WASM_VECTOR_LEN;
1390
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1391
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1392
+ },
1393
+ __wbg___wbindgen_in_92f62ee1427d9e49: function(arg0, arg1) {
1394
+ const ret = arg0 in arg1;
1395
+ return ret;
1396
+ },
1397
+ __wbg___wbindgen_is_function_1f9d30630b8b1d3d: function(arg0) {
1398
+ const ret = typeof(arg0) === 'function';
1399
+ return ret;
1400
+ },
1401
+ __wbg___wbindgen_is_null_e343b7d08827ba72: function(arg0) {
1402
+ const ret = arg0 === null;
1403
+ return ret;
1404
+ },
1405
+ __wbg___wbindgen_is_object_3c45d4f2dde4e749: function(arg0) {
1406
+ const val = arg0;
1407
+ const ret = typeof(val) === 'object' && val !== null;
1408
+ return ret;
1409
+ },
1410
+ __wbg___wbindgen_is_string_90b56bc79aad6f6c: function(arg0) {
1411
+ const ret = typeof(arg0) === 'string';
1412
+ return ret;
1413
+ },
1414
+ __wbg___wbindgen_is_undefined_8865fb403f8fe9d8: function(arg0) {
1415
+ const ret = arg0 === undefined;
1416
+ return ret;
1417
+ },
1418
+ __wbg___wbindgen_jsval_loose_eq_677f21e468d6b461: function(arg0, arg1) {
1419
+ const ret = arg0 == arg1;
1420
+ return ret;
1421
+ },
1422
+ __wbg___wbindgen_number_get_2e0e7dee9f701a71: function(arg0, arg1) {
1423
+ const obj = arg1;
1424
+ const ret = typeof(obj) === 'number' ? obj : undefined;
1425
+ getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
1426
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
1427
+ },
1428
+ __wbg___wbindgen_string_get_0380ccaa2f57f0d9: function(arg0, arg1) {
1429
+ const obj = arg1;
1430
+ const ret = typeof(obj) === 'string' ? obj : undefined;
1431
+ var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1432
+ var len1 = WASM_VECTOR_LEN;
1433
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1434
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1435
+ },
1436
+ __wbg___wbindgen_throw_41e9ee4f547fc59a: function(arg0, arg1) {
1437
+ throw new Error(getStringFromWasm0(arg0, arg1));
1438
+ },
1439
+ __wbg__wbg_cb_unref_dcc1a90847f04c41: function(arg0) {
1440
+ arg0._wbg_cb_unref();
1441
+ },
1442
+ __wbg_actorcontext_new: function(arg0) {
1443
+ const ret = ActorContext.__wrap(arg0);
1444
+ return ret;
1445
+ },
1446
+ __wbg_actorstatetransaction_new: function(arg0) {
1447
+ const ret = ActorStateTransaction.__wrap(arg0);
1448
+ return ret;
1449
+ },
1450
+ __wbg_buffer_56ec2905a66f58b9: function(arg0) {
1451
+ const ret = arg0.buffer;
1452
+ return ret;
1453
+ },
1454
+ __wbg_bufferedAmount_64b8a4229f549d4b: function(arg0) {
1455
+ const ret = arg0.bufferedAmount;
1456
+ return ret;
1457
+ },
1458
+ __wbg_call_1875a20c43a36133: function() { return handleError(function (arg0, arg1, arg2, arg3) {
1459
+ const ret = arg0.call(arg1, arg2, arg3);
1460
+ return ret;
1461
+ }, arguments); },
1462
+ __wbg_call_187d372bd5fdd4aa: function() { return handleError(function (arg0, arg1, arg2) {
1463
+ const ret = arg0.call(arg1, arg2);
1464
+ return ret;
1465
+ }, arguments); },
1466
+ __wbg_call_6137034ef55c9d0f: function() { return handleError(function (arg0, arg1) {
1467
+ const ret = arg0.call(arg1);
1468
+ return ret;
1469
+ }, arguments); },
1470
+ __wbg_cancellationtoken_new: function(arg0) {
1471
+ const ret = CancellationToken.__wrap(arg0);
1472
+ return ret;
1473
+ },
1474
+ __wbg_close_150f701b1a60e0ac: function() { return handleError(function (arg0, arg1, arg2, arg3) {
1475
+ arg0.close(arg1, getStringFromWasm0(arg2, arg3));
1476
+ }, arguments); },
1477
+ __wbg_close_d3ed56b5763be5ae: function() { return handleError(function (arg0) {
1478
+ arg0.close();
1479
+ }, arguments); },
1480
+ __wbg_code_4cb6dbcfceec1eac: function(arg0) {
1481
+ const ret = arg0.code;
1482
+ return ret;
1483
+ },
1484
+ __wbg_connhandle_new: function(arg0) {
1485
+ const ret = ConnHandle.__wrap(arg0);
1486
+ return ret;
1487
+ },
1488
+ __wbg_construct_2cc135b78387ed16: function() { return handleError(function (arg0, arg1) {
1489
+ const ret = Reflect.construct(arg0, arg1);
1490
+ return ret;
1491
+ }, arguments); },
1492
+ __wbg_crypto_38df2bab126b63dc: function(arg0) {
1493
+ const ret = arg0.crypto;
1494
+ return ret;
1495
+ },
1496
+ __wbg_data_522f7abc70721269: function(arg0) {
1497
+ const ret = arg0.data;
1498
+ return ret;
1499
+ },
1500
+ __wbg_done_b41a1d26cdb37fb6: function(arg0) {
1501
+ const ret = arg0.done;
1502
+ return ret;
1503
+ },
1504
+ __wbg_error_757e9472f8410341: function(arg0, arg1) {
1505
+ let deferred0_0;
1506
+ let deferred0_1;
1507
+ try {
1508
+ deferred0_0 = arg0;
1509
+ deferred0_1 = arg1;
1510
+ console.error(getStringFromWasm0(arg0, arg1));
1511
+ } finally {
1512
+ wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
1513
+ }
1514
+ },
1515
+ __wbg_getRandomValues_973dabfb0ad1769f: function() { return handleError(function (arg0, arg1) {
1516
+ globalThis.crypto.getRandomValues(getArrayU8FromWasm0(arg0, arg1));
1517
+ }, arguments); },
1518
+ __wbg_getRandomValues_c44a50d8cfdaebeb: function() { return handleError(function (arg0, arg1) {
1519
+ arg0.getRandomValues(arg1);
1520
+ }, arguments); },
1521
+ __wbg_get_31af05bd4842a84f: function() { return handleError(function (arg0, arg1) {
1522
+ const ret = Reflect.get(arg0, arg1);
1523
+ return ret;
1524
+ }, arguments); },
1525
+ __wbg_get_658f6698067d9515: function() { return handleError(function (arg0, arg1) {
1526
+ const ret = Reflect.get(arg0, arg1);
1527
+ return ret;
1528
+ }, arguments); },
1529
+ __wbg_get_6c896e0571ddae51: function(arg0, arg1) {
1530
+ const ret = arg0[arg1 >>> 0];
1531
+ return ret;
1532
+ },
1533
+ __wbg_get_unchecked_288889d017702237: function(arg0, arg1) {
1534
+ const ret = arg0[arg1 >>> 0];
1535
+ return ret;
1536
+ },
1537
+ __wbg_get_with_ref_key_6412cf3094599694: function(arg0, arg1) {
1538
+ const ret = arg0[arg1];
1539
+ return ret;
1540
+ },
1541
+ __wbg_instanceof_ArrayBuffer_a99f175873e5d9b8: function(arg0) {
1542
+ let result;
1543
+ try {
1544
+ result = arg0 instanceof ArrayBuffer;
1545
+ } catch (_) {
1546
+ result = false;
1547
+ }
1548
+ const ret = result;
1549
+ return ret;
1550
+ },
1551
+ __wbg_instanceof_Error_80a725f81f2e102d: function(arg0) {
1552
+ let result;
1553
+ try {
1554
+ result = arg0 instanceof Error;
1555
+ } catch (_) {
1556
+ result = false;
1557
+ }
1558
+ const ret = result;
1559
+ return ret;
1560
+ },
1561
+ __wbg_instanceof_Object_67a83cdc00c5d141: function(arg0) {
1562
+ let result;
1563
+ try {
1564
+ result = arg0 instanceof Object;
1565
+ } catch (_) {
1566
+ result = false;
1567
+ }
1568
+ const ret = result;
1569
+ return ret;
1570
+ },
1571
+ __wbg_instanceof_Promise_e1dc6893aa1ece28: function(arg0) {
1572
+ let result;
1573
+ try {
1574
+ result = arg0 instanceof Promise;
1575
+ } catch (_) {
1576
+ result = false;
1577
+ }
1578
+ const ret = result;
1579
+ return ret;
1580
+ },
1581
+ __wbg_instanceof_Uint8Array_828cef2aaacafc31: function(arg0) {
1582
+ let result;
1583
+ try {
1584
+ result = arg0 instanceof Uint8Array;
1585
+ } catch (_) {
1586
+ result = false;
1587
+ }
1588
+ const ret = result;
1589
+ return ret;
1590
+ },
1591
+ __wbg_isArray_e15a2ff68ffdbef2: function(arg0) {
1592
+ const ret = Array.isArray(arg0);
1593
+ return ret;
1594
+ },
1595
+ __wbg_isSafeInteger_717808ad6a54bd9e: function(arg0) {
1596
+ const ret = Number.isSafeInteger(arg0);
1597
+ return ret;
1598
+ },
1599
+ __wbg_iterator_e3c31c892080e444: function() {
1600
+ const ret = Symbol.iterator;
1601
+ return ret;
1602
+ },
1603
+ __wbg_keys_440be172f17c0265: function(arg0) {
1604
+ const ret = Object.keys(arg0);
1605
+ return ret;
1606
+ },
1607
+ __wbg_length_7f3c00c40364105e: function(arg0) {
1608
+ const ret = arg0.length;
1609
+ return ret;
1610
+ },
1611
+ __wbg_length_d4bdea10311bd9cf: function(arg0) {
1612
+ const ret = arg0.length;
1613
+ return ret;
1614
+ },
1615
+ __wbg_message_49f5412048473de5: function(arg0, arg1) {
1616
+ const ret = arg1.message;
1617
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1618
+ const len1 = WASM_VECTOR_LEN;
1619
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1620
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1621
+ },
1622
+ __wbg_message_5f8387f0c32b90a7: function(arg0) {
1623
+ const ret = arg0.message;
1624
+ return ret;
1625
+ },
1626
+ __wbg_msCrypto_bd5a034af96bcba6: function(arg0) {
1627
+ const ret = arg0.msCrypto;
1628
+ return ret;
1629
+ },
1630
+ __wbg_new_1dbf7428bba60a42: function(arg0) {
1631
+ const ret = new Uint8Array(arg0);
1632
+ return ret;
1633
+ },
1634
+ __wbg_new_227d7c05414eb861: function() {
1635
+ const ret = new Error();
1636
+ return ret;
1637
+ },
1638
+ __wbg_new_28744009d011f847: function() {
1639
+ const ret = new Map();
1640
+ return ret;
1641
+ },
1642
+ __wbg_new_343a093a3c2ffb4e: function(arg0, arg1) {
1643
+ const ret = new Error(getStringFromWasm0(arg0, arg1));
1644
+ return ret;
1645
+ },
1646
+ __wbg_new_5502aad30c185fc8: function(arg0, arg1) {
1647
+ try {
1648
+ var state0 = {a: arg0, b: arg1};
1649
+ var cb0 = (arg0, arg1) => {
1650
+ const a = state0.a;
1651
+ state0.a = 0;
1652
+ try {
1653
+ return wasm_bindgen_13e07d6143bb6034___convert__closures_____invoke___js_sys_5398293dff02b043___Function_fn_wasm_bindgen_13e07d6143bb6034___JsValue_____wasm_bindgen_13e07d6143bb6034___sys__Undefined___js_sys_5398293dff02b043___Function_fn_wasm_bindgen_13e07d6143bb6034___JsValue_____wasm_bindgen_13e07d6143bb6034___sys__Undefined_______true_(a, state0.b, arg0, arg1);
1654
+ } finally {
1655
+ state0.a = a;
1656
+ }
1657
+ };
1658
+ const ret = new Promise(cb0);
1659
+ return ret;
1660
+ } finally {
1661
+ state0.a = 0;
1662
+ }
1663
+ },
1664
+ __wbg_new_617a8cdb8bb1130e: function() {
1665
+ const ret = new Object();
1666
+ return ret;
1667
+ },
1668
+ __wbg_new_ee2291f50781bf1d: function() {
1669
+ const ret = new Array();
1670
+ return ret;
1671
+ },
1672
+ __wbg_new_from_slice_9a868026ffa4208a: function(arg0, arg1) {
1673
+ const ret = new Uint8Array(getArrayU8FromWasm0(arg0, arg1));
1674
+ return ret;
1675
+ },
1676
+ __wbg_new_typed_b01cb72a8af741a3: function(arg0, arg1) {
1677
+ try {
1678
+ var state0 = {a: arg0, b: arg1};
1679
+ var cb0 = (arg0, arg1) => {
1680
+ const a = state0.a;
1681
+ state0.a = 0;
1682
+ try {
1683
+ return wasm_bindgen_13e07d6143bb6034___convert__closures_____invoke___js_sys_5398293dff02b043___Function_fn_wasm_bindgen_13e07d6143bb6034___JsValue_____wasm_bindgen_13e07d6143bb6034___sys__Undefined___js_sys_5398293dff02b043___Function_fn_wasm_bindgen_13e07d6143bb6034___JsValue_____wasm_bindgen_13e07d6143bb6034___sys__Undefined_______true_(a, state0.b, arg0, arg1);
1684
+ } finally {
1685
+ state0.a = a;
1686
+ }
1687
+ };
1688
+ const ret = new Promise(cb0);
1689
+ return ret;
1690
+ } finally {
1691
+ state0.a = 0;
1692
+ }
1693
+ },
1694
+ __wbg_new_with_length_3da0ad195f6f63ba: function(arg0) {
1695
+ const ret = new Uint8Array(arg0 >>> 0);
1696
+ return ret;
1697
+ },
1698
+ __wbg_new_with_str_sequence_f79e461d58fdeacc: function() { return handleError(function (arg0, arg1, arg2) {
1699
+ const ret = new WebSocket(getStringFromWasm0(arg0, arg1), arg2);
1700
+ return ret;
1701
+ }, arguments); },
1702
+ __wbg_next_33784799010f1bbe: function(arg0) {
1703
+ const ret = arg0.next;
1704
+ return ret;
1705
+ },
1706
+ __wbg_next_f4aac29c42af995c: function() { return handleError(function (arg0) {
1707
+ const ret = arg0.next();
1708
+ return ret;
1709
+ }, arguments); },
1710
+ __wbg_node_84ea875411254db1: function(arg0) {
1711
+ const ret = arg0.node;
1712
+ return ret;
1713
+ },
1714
+ __wbg_now_aa4ccb83129e9e55: function() {
1715
+ const ret = Date.now();
1716
+ return ret;
1717
+ },
1718
+ __wbg_now_e7c6795a7f81e10f: function(arg0) {
1719
+ const ret = arg0.now();
1720
+ return ret;
1721
+ },
1722
+ __wbg_performance_3fcf6e32a7e1ed0a: function(arg0) {
1723
+ const ret = arg0.performance;
1724
+ return ret;
1725
+ },
1726
+ __wbg_process_44c7a14e11e9f69e: function(arg0) {
1727
+ const ret = arg0.process;
1728
+ return ret;
1729
+ },
1730
+ __wbg_prototypesetcall_bc27214492979395: function(arg0, arg1, arg2) {
1731
+ Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), arg2);
1732
+ },
1733
+ __wbg_push_2baf45db356cf468: function(arg0, arg1) {
1734
+ const ret = arg0.push(arg1);
1735
+ return ret;
1736
+ },
1737
+ __wbg_queueMicrotask_9833f9a49df95a49: function(arg0) {
1738
+ const ret = arg0.queueMicrotask;
1739
+ return ret;
1740
+ },
1741
+ __wbg_queueMicrotask_a72f977e97f23c5f: function(arg0) {
1742
+ queueMicrotask(arg0);
1743
+ },
1744
+ __wbg_queuemessage_new: function(arg0) {
1745
+ const ret = QueueMessage.__wrap(arg0);
1746
+ return ret;
1747
+ },
1748
+ __wbg_randomFillSync_6c25eac9869eb53c: function() { return handleError(function (arg0, arg1) {
1749
+ arg0.randomFillSync(arg1);
1750
+ }, arguments); },
1751
+ __wbg_readyState_d8514376867e415b: function(arg0) {
1752
+ const ret = arg0.readyState;
1753
+ return ret;
1754
+ },
1755
+ __wbg_reason_832acaf5f4083b7b: function(arg0, arg1) {
1756
+ const ret = arg1.reason;
1757
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1758
+ const len1 = WASM_VECTOR_LEN;
1759
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1760
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1761
+ },
1762
+ __wbg_require_b4edbdcf3e2a1ef0: function() { return handleError(function () {
1763
+ const ret = module.require;
1764
+ return ret;
1765
+ }, arguments); },
1766
+ __wbg_resolve_0076e10020304ede: function(arg0) {
1767
+ const ret = Promise.resolve(arg0);
1768
+ return ret;
1769
+ },
1770
+ __wbg_send_797960c7a6a0270d: function() { return handleError(function (arg0, arg1) {
1771
+ arg0.send(arg1);
1772
+ }, arguments); },
1773
+ __wbg_set_145a351398b48c65: function() { return handleError(function (arg0, arg1, arg2) {
1774
+ const ret = Reflect.set(arg0, arg1, arg2);
1775
+ return ret;
1776
+ }, arguments); },
1777
+ __wbg_set_6ae97e73113c4f0b: function(arg0, arg1, arg2) {
1778
+ const ret = arg0.set(arg1, arg2);
1779
+ return ret;
1780
+ },
1781
+ __wbg_set_6be42768c690e380: function(arg0, arg1, arg2) {
1782
+ arg0[arg1] = arg2;
1783
+ },
1784
+ __wbg_set_bea140a88be9b277: function(arg0, arg1, arg2) {
1785
+ arg0[arg1 >>> 0] = arg2;
1786
+ },
1787
+ __wbg_set_binaryType_21835bf0df8f70aa: function(arg0, arg1) {
1788
+ arg0.binaryType = __wbindgen_enum_BinaryType[arg1];
1789
+ },
1790
+ __wbg_set_onclose_a84370531f3d2948: function(arg0, arg1) {
1791
+ arg0.onclose = arg1;
1792
+ },
1793
+ __wbg_set_onerror_94ee307653399172: function(arg0, arg1) {
1794
+ arg0.onerror = arg1;
1795
+ },
1796
+ __wbg_set_onmessage_cb6f77d2d8e0402a: function(arg0, arg1) {
1797
+ arg0.onmessage = arg1;
1798
+ },
1799
+ __wbg_set_onopen_c914147e8a2db4b0: function(arg0, arg1) {
1800
+ arg0.onopen = arg1;
1801
+ },
1802
+ __wbg_sqlitetransaction_new: function(arg0) {
1803
+ const ret = SqliteTransaction.__wrap(arg0);
1804
+ return ret;
1805
+ },
1806
+ __wbg_stack_3b0d974bbf31e44f: function(arg0, arg1) {
1807
+ const ret = arg1.stack;
1808
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1809
+ const len1 = WASM_VECTOR_LEN;
1810
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1811
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1812
+ },
1813
+ __wbg_static_accessor_GLOBAL_266715b9d96ba635: function() {
1814
+ const ret = typeof global === 'undefined' ? null : global;
1815
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
1816
+ },
1817
+ __wbg_static_accessor_GLOBAL_THIS_10fb7dc1ae063179: function() {
1818
+ const ret = typeof globalThis === 'undefined' ? null : globalThis;
1819
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
1820
+ },
1821
+ __wbg_static_accessor_SELF_0b583911f537483a: function() {
1822
+ const ret = typeof self === 'undefined' ? null : self;
1823
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
1824
+ },
1825
+ __wbg_static_accessor_WINDOW_d7f903d1508cbdc4: function() {
1826
+ const ret = typeof window === 'undefined' ? null : window;
1827
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
1828
+ },
1829
+ __wbg_stringify_52ff602c1cc4fbb6: function() { return handleError(function (arg0) {
1830
+ const ret = JSON.stringify(arg0);
1831
+ return ret;
1832
+ }, arguments); },
1833
+ __wbg_subarray_002b94d5e13d1411: function(arg0, arg1, arg2) {
1834
+ const ret = arg0.subarray(arg1 >>> 0, arg2 >>> 0);
1835
+ return ret;
1836
+ },
1837
+ __wbg_then_c949d5a25a4e78f8: function(arg0, arg1, arg2) {
1838
+ const ret = arg0.then(arg1, arg2);
1839
+ return ret;
1840
+ },
1841
+ __wbg_then_e71170d78fcf8954: function(arg0, arg1) {
1842
+ const ret = arg0.then(arg1);
1843
+ return ret;
1844
+ },
1845
+ __wbg_value_f3c585ee8f5ba40c: function(arg0) {
1846
+ const ret = arg0.value;
1847
+ return ret;
1848
+ },
1849
+ __wbg_versions_276b2795b1c6a219: function(arg0) {
1850
+ const ret = arg0.versions;
1851
+ return ret;
1852
+ },
1853
+ __wbg_websockethandle_new: function(arg0) {
1854
+ const ret = WebSocketHandle.__wrap(arg0);
1855
+ return ret;
1856
+ },
1857
+ __wbindgen_generic_0000000000000001: function(arg0, arg1) {
1858
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 2659, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
1859
+ const ret = makeMutClosure(arg0, arg1, wasm_bindgen_13e07d6143bb6034___convert__closures_____invoke___wasm_bindgen_13e07d6143bb6034___JsValue__core_608f92abc48d28da___result__Result_____wasm_bindgen_13e07d6143bb6034___JsError___true_);
1860
+ return ret;
1861
+ },
1862
+ __wbindgen_generic_0000000000000002: function(arg0, arg1) {
1863
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("CloseEvent")], shim_idx: 2072, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1864
+ const ret = makeMutClosure(arg0, arg1, wasm_bindgen_13e07d6143bb6034___convert__closures_____invoke___web_sys_dc46127b9b0284ed___features__gen_CloseEvent__CloseEvent______true_);
1865
+ return ret;
1866
+ },
1867
+ __wbindgen_generic_0000000000000003: function(arg0, arg1) {
1868
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("ErrorEvent")], shim_idx: 2072, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1869
+ const ret = makeMutClosure(arg0, arg1, wasm_bindgen_13e07d6143bb6034___convert__closures_____invoke___web_sys_dc46127b9b0284ed___features__gen_CloseEvent__CloseEvent______true__119);
1870
+ return ret;
1871
+ },
1872
+ __wbindgen_generic_0000000000000004: function(arg0, arg1) {
1873
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("Event")], shim_idx: 2072, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1874
+ const ret = makeMutClosure(arg0, arg1, wasm_bindgen_13e07d6143bb6034___convert__closures_____invoke___web_sys_dc46127b9b0284ed___features__gen_CloseEvent__CloseEvent______true__120);
1875
+ return ret;
1876
+ },
1877
+ __wbindgen_generic_0000000000000005: function(arg0, arg1) {
1878
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("MessageEvent")], shim_idx: 2072, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1879
+ const ret = makeMutClosure(arg0, arg1, wasm_bindgen_13e07d6143bb6034___convert__closures_____invoke___web_sys_dc46127b9b0284ed___features__gen_CloseEvent__CloseEvent______true__121);
1880
+ return ret;
1881
+ },
1882
+ __wbindgen_generic_0000000000000006: function(arg0) {
1883
+ // Cast intrinsic for `F64 -> Externref`.
1884
+ const ret = arg0;
1885
+ return ret;
1886
+ },
1887
+ __wbindgen_generic_0000000000000007: function(arg0) {
1888
+ // Cast intrinsic for `I64 -> Externref`.
1889
+ const ret = arg0;
1890
+ return ret;
1891
+ },
1892
+ __wbindgen_generic_0000000000000008: function(arg0, arg1) {
1893
+ // Cast intrinsic for `Ref(Slice(U8)) -> NamedExternref("Uint8Array")`.
1894
+ const ret = getArrayU8FromWasm0(arg0, arg1);
1895
+ return ret;
1896
+ },
1897
+ __wbindgen_generic_0000000000000009: function(arg0, arg1) {
1898
+ // Cast intrinsic for `Ref(String) -> Externref`.
1899
+ const ret = getStringFromWasm0(arg0, arg1);
1900
+ return ret;
1901
+ },
1902
+ __wbindgen_generic_000000000000000a: function(arg0) {
1903
+ // Cast intrinsic for `U64 -> Externref`.
1904
+ const ret = BigInt.asUintN(64, arg0);
1905
+ return ret;
1906
+ },
1907
+ __wbindgen_generic_000000000000000b: function(arg0, arg1) {
1908
+ var v0 = getArrayU8FromWasm0(arg0, arg1).slice();
1909
+ wasm.__wbindgen_free(arg0, arg1 * 1, 1);
1910
+ // Cast intrinsic for `Vector(U8) -> Externref`.
1911
+ const ret = v0;
1912
+ return ret;
1913
+ },
1914
+ __wbindgen_init_externref_table: function() {
1915
+ const table = wasm.__wbindgen_externrefs;
1916
+ const offset = table.grow(4);
1917
+ table.set(0, undefined);
1918
+ table.set(offset + 0, undefined);
1919
+ table.set(offset + 1, null);
1920
+ table.set(offset + 2, true);
1921
+ table.set(offset + 3, false);
1922
+ },
1923
+ };
1924
+ return {
1925
+ __proto__: null,
1926
+ "./rivetkit_wasm_bg.js": import0,
1927
+ };
1928
+ }
1929
+
1930
+ function wasm_bindgen_13e07d6143bb6034___convert__closures_____invoke___web_sys_dc46127b9b0284ed___features__gen_CloseEvent__CloseEvent______true_(arg0, arg1, arg2) {
1931
+ wasm.wasm_bindgen_13e07d6143bb6034___convert__closures_____invoke___web_sys_dc46127b9b0284ed___features__gen_CloseEvent__CloseEvent______true_(arg0, arg1, arg2);
1932
+ }
1933
+
1934
+ function wasm_bindgen_13e07d6143bb6034___convert__closures_____invoke___web_sys_dc46127b9b0284ed___features__gen_CloseEvent__CloseEvent______true__119(arg0, arg1, arg2) {
1935
+ wasm.wasm_bindgen_13e07d6143bb6034___convert__closures_____invoke___web_sys_dc46127b9b0284ed___features__gen_CloseEvent__CloseEvent______true__119(arg0, arg1, arg2);
1936
+ }
1937
+
1938
+ function wasm_bindgen_13e07d6143bb6034___convert__closures_____invoke___web_sys_dc46127b9b0284ed___features__gen_CloseEvent__CloseEvent______true__120(arg0, arg1, arg2) {
1939
+ wasm.wasm_bindgen_13e07d6143bb6034___convert__closures_____invoke___web_sys_dc46127b9b0284ed___features__gen_CloseEvent__CloseEvent______true__120(arg0, arg1, arg2);
1940
+ }
1941
+
1942
+ function wasm_bindgen_13e07d6143bb6034___convert__closures_____invoke___web_sys_dc46127b9b0284ed___features__gen_CloseEvent__CloseEvent______true__121(arg0, arg1, arg2) {
1943
+ wasm.wasm_bindgen_13e07d6143bb6034___convert__closures_____invoke___web_sys_dc46127b9b0284ed___features__gen_CloseEvent__CloseEvent______true__121(arg0, arg1, arg2);
1944
+ }
1945
+
1946
+ function wasm_bindgen_13e07d6143bb6034___convert__closures_____invoke___wasm_bindgen_13e07d6143bb6034___JsValue__core_608f92abc48d28da___result__Result_____wasm_bindgen_13e07d6143bb6034___JsError___true_(arg0, arg1, arg2) {
1947
+ const ret = wasm.wasm_bindgen_13e07d6143bb6034___convert__closures_____invoke___wasm_bindgen_13e07d6143bb6034___JsValue__core_608f92abc48d28da___result__Result_____wasm_bindgen_13e07d6143bb6034___JsError___true_(arg0, arg1, arg2);
1948
+ if (ret[1]) {
1949
+ throw takeFromExternrefTable0(ret[0]);
1532
1950
  }
1533
1951
  }
1534
1952
 
1953
+ function wasm_bindgen_13e07d6143bb6034___convert__closures_____invoke___js_sys_5398293dff02b043___Function_fn_wasm_bindgen_13e07d6143bb6034___JsValue_____wasm_bindgen_13e07d6143bb6034___sys__Undefined___js_sys_5398293dff02b043___Function_fn_wasm_bindgen_13e07d6143bb6034___JsValue_____wasm_bindgen_13e07d6143bb6034___sys__Undefined_______true_(arg0, arg1, arg2, arg3) {
1954
+ wasm.wasm_bindgen_13e07d6143bb6034___convert__closures_____invoke___js_sys_5398293dff02b043___Function_fn_wasm_bindgen_13e07d6143bb6034___JsValue_____wasm_bindgen_13e07d6143bb6034___sys__Undefined___js_sys_5398293dff02b043___Function_fn_wasm_bindgen_13e07d6143bb6034___JsValue_____wasm_bindgen_13e07d6143bb6034___sys__Undefined_______true_(arg0, arg1, arg2, arg3);
1955
+ }
1956
+
1957
+
1958
+ const __wbindgen_enum_BinaryType = ["blob", "arraybuffer"];
1959
+ const ActorContextFinalization = (typeof FinalizationRegistry === 'undefined')
1960
+ ? { register: () => {}, unregister: () => {} }
1961
+ : new FinalizationRegistry(ptr => wasm.__wbg_actorcontext_free(ptr, 1));
1962
+ const ActorFactoryFinalization = (typeof FinalizationRegistry === 'undefined')
1963
+ ? { register: () => {}, unregister: () => {} }
1964
+ : new FinalizationRegistry(ptr => wasm.__wbg_actorfactory_free(ptr, 1));
1965
+ const ActorStateTransactionFinalization = (typeof FinalizationRegistry === 'undefined')
1966
+ ? { register: () => {}, unregister: () => {} }
1967
+ : new FinalizationRegistry(ptr => wasm.__wbg_actorstatetransaction_free(ptr, 1));
1968
+ const CancellationListenerFinalization = (typeof FinalizationRegistry === 'undefined')
1969
+ ? { register: () => {}, unregister: () => {} }
1970
+ : new FinalizationRegistry(ptr => wasm.__wbg_cancellationlistener_free(ptr, 1));
1971
+ const CancellationTokenFinalization = (typeof FinalizationRegistry === 'undefined')
1972
+ ? { register: () => {}, unregister: () => {} }
1973
+ : new FinalizationRegistry(ptr => wasm.__wbg_cancellationtoken_free(ptr, 1));
1974
+ const ConnHandleFinalization = (typeof FinalizationRegistry === 'undefined')
1975
+ ? { register: () => {}, unregister: () => {} }
1976
+ : new FinalizationRegistry(ptr => wasm.__wbg_connhandle_free(ptr, 1));
1977
+ const CoreRegistryFinalization = (typeof FinalizationRegistry === 'undefined')
1978
+ ? { register: () => {}, unregister: () => {} }
1979
+ : new FinalizationRegistry(ptr => wasm.__wbg_coreregistry_free(ptr, 1));
1980
+ const KvFinalization = (typeof FinalizationRegistry === 'undefined')
1981
+ ? { register: () => {}, unregister: () => {} }
1982
+ : new FinalizationRegistry(ptr => wasm.__wbg_kv_free(ptr, 1));
1983
+ const QueueFinalization = (typeof FinalizationRegistry === 'undefined')
1984
+ ? { register: () => {}, unregister: () => {} }
1985
+ : new FinalizationRegistry(ptr => wasm.__wbg_queue_free(ptr, 1));
1986
+ const QueueMessageFinalization = (typeof FinalizationRegistry === 'undefined')
1987
+ ? { register: () => {}, unregister: () => {} }
1988
+ : new FinalizationRegistry(ptr => wasm.__wbg_queuemessage_free(ptr, 1));
1989
+ const ScheduleFinalization = (typeof FinalizationRegistry === 'undefined')
1990
+ ? { register: () => {}, unregister: () => {} }
1991
+ : new FinalizationRegistry(ptr => wasm.__wbg_schedule_free(ptr, 1));
1992
+ const SqliteDbFinalization = (typeof FinalizationRegistry === 'undefined')
1993
+ ? { register: () => {}, unregister: () => {} }
1994
+ : new FinalizationRegistry(ptr => wasm.__wbg_sqlitedb_free(ptr, 1));
1535
1995
  const SqliteTransactionFinalization = (typeof FinalizationRegistry === 'undefined')
1536
1996
  ? { register: () => {}, unregister: () => {} }
1537
- : new FinalizationRegistry(ptr => wasm.__wbg_sqlitetransaction_free(ptr >>> 0, 1));
1997
+ : new FinalizationRegistry(ptr => wasm.__wbg_sqlitetransaction_free(ptr, 1));
1998
+ const WebSocketHandleFinalization = (typeof FinalizationRegistry === 'undefined')
1999
+ ? { register: () => {}, unregister: () => {} }
2000
+ : new FinalizationRegistry(ptr => wasm.__wbg_websockethandle_free(ptr, 1));
1538
2001
 
1539
- export class SqliteTransaction {
2002
+ function addToExternrefTable0(obj) {
2003
+ const idx = wasm.__externref_table_alloc();
2004
+ wasm.__wbindgen_externrefs.set(idx, obj);
2005
+ return idx;
2006
+ }
1540
2007
 
1541
- static __wrap(ptr) {
1542
- ptr = ptr >>> 0;
1543
- const obj = Object.create(SqliteTransaction.prototype);
1544
- obj.__wbg_ptr = ptr;
1545
- SqliteTransactionFinalization.register(obj, obj.__wbg_ptr, obj);
1546
- return obj;
2008
+ function _assertClass(instance, klass) {
2009
+ if (!(instance instanceof klass)) {
2010
+ throw new Error(`expected instance of ${klass.name}`);
1547
2011
  }
2012
+ }
1548
2013
 
1549
- __destroy_into_raw() {
1550
- const ptr = this.__wbg_ptr;
1551
- this.__wbg_ptr = 0;
1552
- SqliteTransactionFinalization.unregister(this);
1553
- return ptr;
1554
- }
2014
+ const CLOSURE_DTORS = (typeof FinalizationRegistry === 'undefined')
2015
+ ? { register: () => {}, unregister: () => {} }
2016
+ : new FinalizationRegistry(state => wasm.__wbindgen_destroy_closure(state.a, state.b));
1555
2017
 
1556
- free() {
1557
- const ptr = this.__destroy_into_raw();
1558
- wasm.__wbg_sqlitetransaction_free(ptr, 0);
2018
+ function debugString(val) {
2019
+ // primitive types
2020
+ const type = typeof val;
2021
+ if (type == 'number' || type == 'boolean' || val == null) {
2022
+ return `${val}`;
1559
2023
  }
1560
- /**
1561
- * @param {string} sql
1562
- * @returns {Promise<any>}
1563
- */
1564
- exec(sql) {
1565
- const ptr0 = passStringToWasm0(sql, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1566
- const len0 = WASM_VECTOR_LEN;
1567
- const ret = wasm.sqlitetransaction_exec(this.__wbg_ptr, ptr0, len0);
1568
- return ret;
2024
+ if (type == 'string') {
2025
+ return `"${val}"`;
1569
2026
  }
1570
- /**
1571
- * @returns {Promise<void>}
1572
- */
1573
- commit() {
1574
- const ret = wasm.sqlitetransaction_commit(this.__wbg_ptr);
1575
- return ret;
2027
+ if (type == 'symbol') {
2028
+ const description = val.description;
2029
+ if (description == null) {
2030
+ return 'Symbol';
2031
+ } else {
2032
+ return `Symbol(${description})`;
2033
+ }
1576
2034
  }
1577
- /**
1578
- * @param {string} sql
1579
- * @param {any} params
1580
- * @returns {Promise<any>}
1581
- */
1582
- execute(sql, params) {
1583
- const ptr0 = passStringToWasm0(sql, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1584
- const len0 = WASM_VECTOR_LEN;
1585
- const ret = wasm.sqlitetransaction_execute(this.__wbg_ptr, ptr0, len0, params);
1586
- return ret;
2035
+ if (type == 'function') {
2036
+ const name = val.name;
2037
+ if (typeof name == 'string' && name.length > 0) {
2038
+ return `Function(${name})`;
2039
+ } else {
2040
+ return 'Function';
2041
+ }
1587
2042
  }
1588
- /**
1589
- * @returns {Promise<void>}
1590
- */
1591
- rollback() {
1592
- const ret = wasm.sqlitetransaction_rollback(this.__wbg_ptr);
1593
- return ret;
2043
+ // objects
2044
+ if (Array.isArray(val)) {
2045
+ const length = val.length;
2046
+ let debug = '[';
2047
+ if (length > 0) {
2048
+ debug += debugString(val[0]);
2049
+ }
2050
+ for(let i = 1; i < length; i++) {
2051
+ debug += ', ' + debugString(val[i]);
2052
+ }
2053
+ debug += ']';
2054
+ return debug;
2055
+ }
2056
+ // Test for built-in
2057
+ const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
2058
+ let className;
2059
+ if (builtInMatches && builtInMatches.length > 1) {
2060
+ className = builtInMatches[1];
2061
+ } else {
2062
+ // Failed to match the standard '[object ClassName]'
2063
+ return toString.call(val);
2064
+ }
2065
+ if (className == 'Object') {
2066
+ // we're a user defined class or Object
2067
+ // JSON.stringify avoids problems with cycles, and is generally much
2068
+ // easier than looping through ownProperties of `val`.
2069
+ try {
2070
+ return 'Object(' + JSON.stringify(val) + ')';
2071
+ } catch (_) {
2072
+ return 'Object';
2073
+ }
1594
2074
  }
2075
+ // errors
2076
+ if (val instanceof Error) {
2077
+ return `${val.name}: ${val.message}\n${val.stack}`;
2078
+ }
2079
+ // TODO we could test for more things here, like `Set`s and `Map`s.
2080
+ return className;
1595
2081
  }
1596
2082
 
1597
- const WebSocketHandleFinalization = (typeof FinalizationRegistry === 'undefined')
1598
- ? { register: () => {}, unregister: () => {} }
1599
- : new FinalizationRegistry(ptr => wasm.__wbg_websockethandle_free(ptr >>> 0, 1));
2083
+ function getArrayU8FromWasm0(ptr, len) {
2084
+ ptr = ptr >>> 0;
2085
+ return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
2086
+ }
1600
2087
 
1601
- export class WebSocketHandle {
2088
+ let cachedDataViewMemory0 = null;
2089
+ function getDataViewMemory0() {
2090
+ if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
2091
+ cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
2092
+ }
2093
+ return cachedDataViewMemory0;
2094
+ }
1602
2095
 
1603
- static __wrap(ptr) {
1604
- ptr = ptr >>> 0;
1605
- const obj = Object.create(WebSocketHandle.prototype);
1606
- obj.__wbg_ptr = ptr;
1607
- WebSocketHandleFinalization.register(obj, obj.__wbg_ptr, obj);
1608
- return obj;
2096
+ function getStringFromWasm0(ptr, len) {
2097
+ return decodeText(ptr >>> 0, len);
2098
+ }
2099
+
2100
+ let cachedUint8ArrayMemory0 = null;
2101
+ function getUint8ArrayMemory0() {
2102
+ if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
2103
+ cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
1609
2104
  }
2105
+ return cachedUint8ArrayMemory0;
2106
+ }
1610
2107
 
1611
- __destroy_into_raw() {
1612
- const ptr = this.__wbg_ptr;
1613
- this.__wbg_ptr = 0;
1614
- WebSocketHandleFinalization.unregister(this);
1615
- return ptr;
2108
+ function handleError(f, args) {
2109
+ try {
2110
+ return f.apply(this, args);
2111
+ } catch (e) {
2112
+ const idx = addToExternrefTable0(e);
2113
+ wasm.__wbindgen_exn_store(idx);
1616
2114
  }
2115
+ }
1617
2116
 
1618
- free() {
1619
- const ptr = this.__destroy_into_raw();
1620
- wasm.__wbg_websockethandle_free(ptr, 0);
2117
+ function isLikeNone(x) {
2118
+ return x === undefined || x === null;
2119
+ }
2120
+
2121
+ function makeMutClosure(arg0, arg1, f) {
2122
+ const state = { a: arg0, b: arg1, cnt: 1 };
2123
+ const real = (...args) => {
2124
+
2125
+ // First up with a closure we increment the internal reference
2126
+ // count. This ensures that the Rust closure environment won't
2127
+ // be deallocated while we're invoking it.
2128
+ state.cnt++;
2129
+ const a = state.a;
2130
+ state.a = 0;
2131
+ try {
2132
+ return f(a, state.b, ...args);
2133
+ } finally {
2134
+ state.a = a;
2135
+ real._wbg_cb_unref();
2136
+ }
2137
+ };
2138
+ real._wbg_cb_unref = () => {
2139
+ if (--state.cnt === 0) {
2140
+ wasm.__wbindgen_destroy_closure(state.a, state.b);
2141
+ state.a = 0;
2142
+ CLOSURE_DTORS.unregister(state);
2143
+ }
2144
+ };
2145
+ CLOSURE_DTORS.register(real, state, state);
2146
+ return real;
2147
+ }
2148
+
2149
+ function passArray8ToWasm0(arg, malloc) {
2150
+ const ptr = malloc(arg.length * 1, 1) >>> 0;
2151
+ getUint8ArrayMemory0().set(arg, ptr / 1);
2152
+ WASM_VECTOR_LEN = arg.length;
2153
+ return ptr;
2154
+ }
2155
+
2156
+ function passStringToWasm0(arg, malloc, realloc) {
2157
+ if (realloc === undefined) {
2158
+ const buf = cachedTextEncoder.encode(arg);
2159
+ const ptr = malloc(buf.length, 1) >>> 0;
2160
+ getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
2161
+ WASM_VECTOR_LEN = buf.length;
2162
+ return ptr;
1621
2163
  }
1622
- /**
1623
- * @param {Function} callback
1624
- */
1625
- setEventCallback(callback) {
1626
- wasm.websockethandle_setEventCallback(this.__wbg_ptr, callback);
2164
+
2165
+ let len = arg.length;
2166
+ let ptr = malloc(len, 1) >>> 0;
2167
+
2168
+ const mem = getUint8ArrayMemory0();
2169
+
2170
+ let offset = 0;
2171
+
2172
+ for (; offset < len; offset++) {
2173
+ const code = arg.charCodeAt(offset);
2174
+ if (code > 0x7F) break;
2175
+ mem[ptr + offset] = code;
1627
2176
  }
1628
- /**
1629
- * @param {Uint8Array} data
1630
- * @param {boolean} binary
1631
- */
1632
- send(data, binary) {
1633
- const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
1634
- const len0 = WASM_VECTOR_LEN;
1635
- const ret = wasm.websockethandle_send(this.__wbg_ptr, ptr0, len0, binary);
1636
- if (ret[1]) {
1637
- throw takeFromExternrefTable0(ret[0]);
2177
+ if (offset !== len) {
2178
+ if (offset !== 0) {
2179
+ arg = arg.slice(offset);
1638
2180
  }
2181
+ ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
2182
+ const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
2183
+ const ret = cachedTextEncoder.encodeInto(arg, view);
2184
+
2185
+ offset += ret.written;
2186
+ ptr = realloc(ptr, len, offset, 1) >>> 0;
1639
2187
  }
1640
- /**
1641
- * @param {number | null} [code]
1642
- * @param {string | null} [reason]
1643
- * @returns {Promise<void>}
1644
- */
1645
- close(code, reason) {
1646
- var ptr0 = isLikeNone(reason) ? 0 : passStringToWasm0(reason, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1647
- var len0 = WASM_VECTOR_LEN;
1648
- const ret = wasm.websockethandle_close(this.__wbg_ptr, isLikeNone(code) ? 0xFFFFFF : code, ptr0, len0);
1649
- return ret;
2188
+
2189
+ WASM_VECTOR_LEN = offset;
2190
+ return ptr;
2191
+ }
2192
+
2193
+ function takeFromExternrefTable0(idx) {
2194
+ const value = wasm.__wbindgen_externrefs.get(idx);
2195
+ wasm.__externref_table_dealloc(idx);
2196
+ return value;
2197
+ }
2198
+
2199
+ let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
2200
+ cachedTextDecoder.decode();
2201
+ const MAX_SAFARI_DECODE_BYTES = 2146435072;
2202
+ let numBytesDecoded = 0;
2203
+ function decodeText(ptr, len) {
2204
+ numBytesDecoded += len;
2205
+ if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
2206
+ cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
2207
+ cachedTextDecoder.decode();
2208
+ numBytesDecoded = len;
1650
2209
  }
2210
+ return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
2211
+ }
2212
+
2213
+ const cachedTextEncoder = new TextEncoder();
2214
+
2215
+ if (!('encodeInto' in cachedTextEncoder)) {
2216
+ cachedTextEncoder.encodeInto = function (arg, view) {
2217
+ const buf = cachedTextEncoder.encode(arg);
2218
+ view.set(buf);
2219
+ return {
2220
+ read: arg.length,
2221
+ written: buf.length
2222
+ };
2223
+ };
2224
+ }
2225
+
2226
+ let WASM_VECTOR_LEN = 0;
2227
+
2228
+ let wasmModule, wasmInstance, wasm;
2229
+ function __wbg_finalize_init(instance, module) {
2230
+ wasmInstance = instance;
2231
+ wasm = instance.exports;
2232
+ wasmModule = module;
2233
+ cachedDataViewMemory0 = null;
2234
+ cachedUint8ArrayMemory0 = null;
2235
+ wasm.__wbindgen_start();
2236
+ return wasm;
1651
2237
  }
1652
2238
 
1653
2239
  async function __wbg_load(module, imports) {
1654
2240
  if (typeof Response === 'function' && module instanceof Response) {
2241
+ if (!module.ok) {
2242
+ throw new Error(`failed to fetch Wasm: ${module.status} ${module.statusText} fetching '${module.url}'`);
2243
+ }
2244
+
1655
2245
  if (typeof WebAssembly.instantiateStreaming === 'function') {
1656
2246
  try {
1657
2247
  return await WebAssembly.instantiateStreaming(module, imports);
1658
-
1659
2248
  } catch (e) {
1660
- if (module.headers.get('Content-Type') != 'application/wasm') {
2249
+ const validResponse = expectedResponseType(module.type);
2250
+
2251
+ if (validResponse && module.headers.get('Content-Type') !== 'application/wasm') {
1661
2252
  console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n", e);
1662
2253
 
1663
- } else {
1664
- throw e;
1665
- }
2254
+ } else { throw e; }
1666
2255
  }
1667
2256
  }
1668
2257
 
1669
2258
  const bytes = await module.arrayBuffer();
1670
2259
  return await WebAssembly.instantiate(bytes, imports);
1671
-
1672
2260
  } else {
1673
2261
  const instance = await WebAssembly.instantiate(module, imports);
1674
2262
 
1675
2263
  if (instance instanceof WebAssembly.Instance) {
1676
2264
  return { instance, module };
1677
-
1678
2265
  } else {
1679
2266
  return instance;
1680
2267
  }
1681
2268
  }
1682
- }
1683
2269
 
1684
- function __wbg_get_imports() {
1685
- const imports = {};
1686
- imports.wbg = {};
1687
- imports.wbg.__wbg_String_8f0eb39a4a4c2f66 = function(arg0, arg1) {
1688
- const ret = String(arg1);
1689
- const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1690
- const len1 = WASM_VECTOR_LEN;
1691
- getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1692
- getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1693
- };
1694
- imports.wbg.__wbg_actorcontext_new = function(arg0) {
1695
- const ret = ActorContext.__wrap(arg0);
1696
- return ret;
1697
- };
1698
- imports.wbg.__wbg_actorstatetransaction_new = function(arg0) {
1699
- const ret = ActorStateTransaction.__wrap(arg0);
1700
- return ret;
1701
- };
1702
- imports.wbg.__wbg_buffer_09165b52af8c5237 = function(arg0) {
1703
- const ret = arg0.buffer;
1704
- return ret;
1705
- };
1706
- imports.wbg.__wbg_buffer_609cc3eee51ed158 = function(arg0) {
1707
- const ret = arg0.buffer;
1708
- return ret;
1709
- };
1710
- imports.wbg.__wbg_bufferedAmount_a482960ac51b25e8 = function(arg0) {
1711
- const ret = arg0.bufferedAmount;
1712
- return ret;
1713
- };
1714
- imports.wbg.__wbg_call_672a4d21634d4a24 = function() { return handleError(function (arg0, arg1) {
1715
- const ret = arg0.call(arg1);
1716
- return ret;
1717
- }, arguments) };
1718
- imports.wbg.__wbg_call_7cccdd69e0791ae2 = function() { return handleError(function (arg0, arg1, arg2) {
1719
- const ret = arg0.call(arg1, arg2);
1720
- return ret;
1721
- }, arguments) };
1722
- imports.wbg.__wbg_call_833bed5770ea2041 = function() { return handleError(function (arg0, arg1, arg2, arg3) {
1723
- const ret = arg0.call(arg1, arg2, arg3);
1724
- return ret;
1725
- }, arguments) };
1726
- imports.wbg.__wbg_cancellationtoken_new = function(arg0) {
1727
- const ret = CancellationToken.__wrap(arg0);
1728
- return ret;
1729
- };
1730
- imports.wbg.__wbg_close_2893b7d056a0627d = function() { return handleError(function (arg0) {
1731
- arg0.close();
1732
- }, arguments) };
1733
- imports.wbg.__wbg_close_e1253d480ed93ce3 = function() { return handleError(function (arg0, arg1, arg2, arg3) {
1734
- arg0.close(arg1, getStringFromWasm0(arg2, arg3));
1735
- }, arguments) };
1736
- imports.wbg.__wbg_code_f4ec1e6e2e1b0417 = function(arg0) {
1737
- const ret = arg0.code;
1738
- return ret;
1739
- };
1740
- imports.wbg.__wbg_connhandle_new = function(arg0) {
1741
- const ret = ConnHandle.__wrap(arg0);
1742
- return ret;
1743
- };
1744
- imports.wbg.__wbg_construct_b91ff0e53b60c0c3 = function() { return handleError(function (arg0, arg1) {
1745
- const ret = Reflect.construct(arg0, arg1);
1746
- return ret;
1747
- }, arguments) };
1748
- imports.wbg.__wbg_crypto_574e78ad8b13b65f = function(arg0) {
1749
- const ret = arg0.crypto;
1750
- return ret;
1751
- };
1752
- imports.wbg.__wbg_data_432d9c3df2630942 = function(arg0) {
1753
- const ret = arg0.data;
1754
- return ret;
1755
- };
1756
- imports.wbg.__wbg_done_769e5ede4b31c67b = function(arg0) {
1757
- const ret = arg0.done;
1758
- return ret;
1759
- };
1760
- imports.wbg.__wbg_error_7534b8e9a36f1ab4 = function(arg0, arg1) {
1761
- let deferred0_0;
1762
- let deferred0_1;
1763
- try {
1764
- deferred0_0 = arg0;
1765
- deferred0_1 = arg1;
1766
- console.error(getStringFromWasm0(arg0, arg1));
1767
- } finally {
1768
- wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
1769
- }
1770
- };
1771
- imports.wbg.__wbg_getRandomValues_430b4ece0366b997 = function() { return handleError(function (arg0, arg1) {
1772
- globalThis.crypto.getRandomValues(getArrayU8FromWasm0(arg0, arg1));
1773
- }, arguments) };
1774
- imports.wbg.__wbg_getRandomValues_b8f5dbd5f3995a9e = function() { return handleError(function (arg0, arg1) {
1775
- arg0.getRandomValues(arg1);
1776
- }, arguments) };
1777
- imports.wbg.__wbg_get_67b2ba62fc30de12 = function() { return handleError(function (arg0, arg1) {
1778
- const ret = Reflect.get(arg0, arg1);
1779
- return ret;
1780
- }, arguments) };
1781
- imports.wbg.__wbg_get_b9b93047fe3cf45b = function(arg0, arg1) {
1782
- const ret = arg0[arg1 >>> 0];
1783
- return ret;
1784
- };
1785
- imports.wbg.__wbg_getwithrefkey_1dc361bd10053bfe = function(arg0, arg1) {
1786
- const ret = arg0[arg1];
1787
- return ret;
1788
- };
1789
- imports.wbg.__wbg_instanceof_ArrayBuffer_e14585432e3737fc = function(arg0) {
1790
- let result;
1791
- try {
1792
- result = arg0 instanceof ArrayBuffer;
1793
- } catch (_) {
1794
- result = false;
1795
- }
1796
- const ret = result;
1797
- return ret;
1798
- };
1799
- imports.wbg.__wbg_instanceof_Error_4d54113b22d20306 = function(arg0) {
1800
- let result;
1801
- try {
1802
- result = arg0 instanceof Error;
1803
- } catch (_) {
1804
- result = false;
1805
- }
1806
- const ret = result;
1807
- return ret;
1808
- };
1809
- imports.wbg.__wbg_instanceof_Object_7f2dcef8f78644a4 = function(arg0) {
1810
- let result;
1811
- try {
1812
- result = arg0 instanceof Object;
1813
- } catch (_) {
1814
- result = false;
1815
- }
1816
- const ret = result;
1817
- return ret;
1818
- };
1819
- imports.wbg.__wbg_instanceof_Promise_935168b8f4b49db3 = function(arg0) {
1820
- let result;
1821
- try {
1822
- result = arg0 instanceof Promise;
1823
- } catch (_) {
1824
- result = false;
1825
- }
1826
- const ret = result;
1827
- return ret;
1828
- };
1829
- imports.wbg.__wbg_instanceof_Uint8Array_17156bcf118086a9 = function(arg0) {
1830
- let result;
1831
- try {
1832
- result = arg0 instanceof Uint8Array;
1833
- } catch (_) {
1834
- result = false;
1835
- }
1836
- const ret = result;
1837
- return ret;
1838
- };
1839
- imports.wbg.__wbg_isArray_a1eab7e0d067391b = function(arg0) {
1840
- const ret = Array.isArray(arg0);
1841
- return ret;
1842
- };
1843
- imports.wbg.__wbg_isSafeInteger_343e2beeeece1bb0 = function(arg0) {
1844
- const ret = Number.isSafeInteger(arg0);
1845
- return ret;
1846
- };
1847
- imports.wbg.__wbg_iterator_9a24c88df860dc65 = function() {
1848
- const ret = Symbol.iterator;
1849
- return ret;
1850
- };
1851
- imports.wbg.__wbg_keys_5c77a08ddc2fb8a6 = function(arg0) {
1852
- const ret = Object.keys(arg0);
1853
- return ret;
1854
- };
1855
- imports.wbg.__wbg_length_a446193dc22c12f8 = function(arg0) {
1856
- const ret = arg0.length;
1857
- return ret;
1858
- };
1859
- imports.wbg.__wbg_length_e2d2a49132c1b256 = function(arg0) {
1860
- const ret = arg0.length;
1861
- return ret;
1862
- };
1863
- imports.wbg.__wbg_message_97a2af9b89d693a3 = function(arg0) {
1864
- const ret = arg0.message;
1865
- return ret;
1866
- };
1867
- imports.wbg.__wbg_message_d1685a448ba00178 = function(arg0, arg1) {
1868
- const ret = arg1.message;
1869
- const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1870
- const len1 = WASM_VECTOR_LEN;
1871
- getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1872
- getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1873
- };
1874
- imports.wbg.__wbg_msCrypto_a61aeb35a24c1329 = function(arg0) {
1875
- const ret = arg0.msCrypto;
1876
- return ret;
1877
- };
1878
- imports.wbg.__wbg_new_23a2665fac83c611 = function(arg0, arg1) {
1879
- try {
1880
- var state0 = {a: arg0, b: arg1};
1881
- var cb0 = (arg0, arg1) => {
1882
- const a = state0.a;
1883
- state0.a = 0;
1884
- try {
1885
- return __wbg_adapter_273(a, state0.b, arg0, arg1);
1886
- } finally {
1887
- state0.a = a;
1888
- }
1889
- };
1890
- const ret = new Promise(cb0);
1891
- return ret;
1892
- } finally {
1893
- state0.a = state0.b = 0;
1894
- }
1895
- };
1896
- imports.wbg.__wbg_new_405e22f390576ce2 = function() {
1897
- const ret = new Object();
1898
- return ret;
1899
- };
1900
- imports.wbg.__wbg_new_5e0be73521bc8c17 = function() {
1901
- const ret = new Map();
1902
- return ret;
1903
- };
1904
- imports.wbg.__wbg_new_78feb108b6472713 = function() {
1905
- const ret = new Array();
1906
- return ret;
1907
- };
1908
- imports.wbg.__wbg_new_8a6f238a6ece86ea = function() {
1909
- const ret = new Error();
1910
- return ret;
1911
- };
1912
- imports.wbg.__wbg_new_a12002a7f91c75be = function(arg0) {
1913
- const ret = new Uint8Array(arg0);
1914
- return ret;
1915
- };
1916
- imports.wbg.__wbg_new_c68d7209be747379 = function(arg0, arg1) {
1917
- const ret = new Error(getStringFromWasm0(arg0, arg1));
1918
- return ret;
1919
- };
1920
- imports.wbg.__wbg_newnoargs_105ed471475aaf50 = function(arg0, arg1) {
1921
- const ret = new Function(getStringFromWasm0(arg0, arg1));
1922
- return ret;
1923
- };
1924
- imports.wbg.__wbg_newwithbyteoffsetandlength_d97e637ebe145a9a = function(arg0, arg1, arg2) {
1925
- const ret = new Uint8Array(arg0, arg1 >>> 0, arg2 >>> 0);
1926
- return ret;
1927
- };
1928
- imports.wbg.__wbg_newwithlength_a381634e90c276d4 = function(arg0) {
1929
- const ret = new Uint8Array(arg0 >>> 0);
1930
- return ret;
1931
- };
1932
- imports.wbg.__wbg_newwithstrsequence_6e9d6479e1cf978d = function() { return handleError(function (arg0, arg1, arg2) {
1933
- const ret = new WebSocket(getStringFromWasm0(arg0, arg1), arg2);
1934
- return ret;
1935
- }, arguments) };
1936
- imports.wbg.__wbg_next_25feadfc0913fea9 = function(arg0) {
1937
- const ret = arg0.next;
1938
- return ret;
1939
- };
1940
- imports.wbg.__wbg_next_6574e1a8a62d1055 = function() { return handleError(function (arg0) {
1941
- const ret = arg0.next();
1942
- return ret;
1943
- }, arguments) };
1944
- imports.wbg.__wbg_node_905d3e251edff8a2 = function(arg0) {
1945
- const ret = arg0.node;
1946
- return ret;
1947
- };
1948
- imports.wbg.__wbg_now_2c95c9de01293173 = function(arg0) {
1949
- const ret = arg0.now();
1950
- return ret;
1951
- };
1952
- imports.wbg.__wbg_now_807e54c39636c349 = function() {
1953
- const ret = Date.now();
1954
- return ret;
1955
- };
1956
- imports.wbg.__wbg_performance_7a3ffd0b17f663ad = function(arg0) {
1957
- const ret = arg0.performance;
1958
- return ret;
1959
- };
1960
- imports.wbg.__wbg_process_dc0fbacc7c1c06f7 = function(arg0) {
1961
- const ret = arg0.process;
1962
- return ret;
1963
- };
1964
- imports.wbg.__wbg_push_737cfc8c1432c2c6 = function(arg0, arg1) {
1965
- const ret = arg0.push(arg1);
1966
- return ret;
1967
- };
1968
- imports.wbg.__wbg_queueMicrotask_97d92b4fcc8a61c5 = function(arg0) {
1969
- queueMicrotask(arg0);
1970
- };
1971
- imports.wbg.__wbg_queueMicrotask_d3219def82552485 = function(arg0) {
1972
- const ret = arg0.queueMicrotask;
1973
- return ret;
1974
- };
1975
- imports.wbg.__wbg_queuemessage_new = function(arg0) {
1976
- const ret = QueueMessage.__wrap(arg0);
1977
- return ret;
1978
- };
1979
- imports.wbg.__wbg_randomFillSync_ac0988aba3254290 = function() { return handleError(function (arg0, arg1) {
1980
- arg0.randomFillSync(arg1);
1981
- }, arguments) };
1982
- imports.wbg.__wbg_readyState_7ef6e63c349899ed = function(arg0) {
1983
- const ret = arg0.readyState;
1984
- return ret;
1985
- };
1986
- imports.wbg.__wbg_reason_49f1cede8bcf23dd = function(arg0, arg1) {
1987
- const ret = arg1.reason;
1988
- const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1989
- const len1 = WASM_VECTOR_LEN;
1990
- getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1991
- getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1992
- };
1993
- imports.wbg.__wbg_require_60cc747a6bc5215a = function() { return handleError(function () {
1994
- const ret = module.require;
1995
- return ret;
1996
- }, arguments) };
1997
- imports.wbg.__wbg_resolve_4851785c9c5f573d = function(arg0) {
1998
- const ret = Promise.resolve(arg0);
1999
- return ret;
2000
- };
2001
- imports.wbg.__wbg_send_7c4769e24cf1d784 = function() { return handleError(function (arg0, arg1) {
2002
- arg0.send(arg1);
2003
- }, arguments) };
2004
- imports.wbg.__wbg_set_37837023f3d740e8 = function(arg0, arg1, arg2) {
2005
- arg0[arg1 >>> 0] = arg2;
2006
- };
2007
- imports.wbg.__wbg_set_3f1d0b984ed272ed = function(arg0, arg1, arg2) {
2008
- arg0[arg1] = arg2;
2009
- };
2010
- imports.wbg.__wbg_set_65595bdd868b3009 = function(arg0, arg1, arg2) {
2011
- arg0.set(arg1, arg2 >>> 0);
2012
- };
2013
- imports.wbg.__wbg_set_8fc6bf8a5b1071d1 = function(arg0, arg1, arg2) {
2014
- const ret = arg0.set(arg1, arg2);
2015
- return ret;
2016
- };
2017
- imports.wbg.__wbg_set_bb8cecf6a62b9f46 = function() { return handleError(function (arg0, arg1, arg2) {
2018
- const ret = Reflect.set(arg0, arg1, arg2);
2019
- return ret;
2020
- }, arguments) };
2021
- imports.wbg.__wbg_setbinaryType_92fa1ffd873b327c = function(arg0, arg1) {
2022
- arg0.binaryType = __wbindgen_enum_BinaryType[arg1];
2023
- };
2024
- imports.wbg.__wbg_setonclose_14fc475a49d488fc = function(arg0, arg1) {
2025
- arg0.onclose = arg1;
2026
- };
2027
- imports.wbg.__wbg_setonerror_8639efe354b947cd = function(arg0, arg1) {
2028
- arg0.onerror = arg1;
2029
- };
2030
- imports.wbg.__wbg_setonmessage_6eccab530a8fb4c7 = function(arg0, arg1) {
2031
- arg0.onmessage = arg1;
2032
- };
2033
- imports.wbg.__wbg_setonopen_2da654e1f39745d5 = function(arg0, arg1) {
2034
- arg0.onopen = arg1;
2035
- };
2036
- imports.wbg.__wbg_sqlitetransaction_new = function(arg0) {
2037
- const ret = SqliteTransaction.__wrap(arg0);
2038
- return ret;
2039
- };
2040
- imports.wbg.__wbg_stack_0ed75d68575b0f3c = function(arg0, arg1) {
2041
- const ret = arg1.stack;
2042
- const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2043
- const len1 = WASM_VECTOR_LEN;
2044
- getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
2045
- getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
2046
- };
2047
- imports.wbg.__wbg_static_accessor_GLOBAL_88a902d13a557d07 = function() {
2048
- const ret = typeof global === 'undefined' ? null : global;
2049
- return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
2050
- };
2051
- imports.wbg.__wbg_static_accessor_GLOBAL_THIS_56578be7e9f832b0 = function() {
2052
- const ret = typeof globalThis === 'undefined' ? null : globalThis;
2053
- return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
2054
- };
2055
- imports.wbg.__wbg_static_accessor_SELF_37c5d418e4bf5819 = function() {
2056
- const ret = typeof self === 'undefined' ? null : self;
2057
- return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
2058
- };
2059
- imports.wbg.__wbg_static_accessor_WINDOW_5de37043a91a9c40 = function() {
2060
- const ret = typeof window === 'undefined' ? null : window;
2061
- return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
2062
- };
2063
- imports.wbg.__wbg_stringify_f7ed6987935b4a24 = function() { return handleError(function (arg0) {
2064
- const ret = JSON.stringify(arg0);
2065
- return ret;
2066
- }, arguments) };
2067
- imports.wbg.__wbg_subarray_aa9065fa9dc5df96 = function(arg0, arg1, arg2) {
2068
- const ret = arg0.subarray(arg1 >>> 0, arg2 >>> 0);
2069
- return ret;
2070
- };
2071
- imports.wbg.__wbg_then_44b73946d2fb3e7d = function(arg0, arg1) {
2072
- const ret = arg0.then(arg1);
2073
- return ret;
2074
- };
2075
- imports.wbg.__wbg_then_48b406749878a531 = function(arg0, arg1, arg2) {
2076
- const ret = arg0.then(arg1, arg2);
2077
- return ret;
2078
- };
2079
- imports.wbg.__wbg_value_cd1ffa7b1ab794f1 = function(arg0) {
2080
- const ret = arg0.value;
2081
- return ret;
2082
- };
2083
- imports.wbg.__wbg_versions_c01dfd4722a88165 = function(arg0) {
2084
- const ret = arg0.versions;
2085
- return ret;
2086
- };
2087
- imports.wbg.__wbg_websockethandle_new = function(arg0) {
2088
- const ret = WebSocketHandle.__wrap(arg0);
2089
- return ret;
2090
- };
2091
- imports.wbg.__wbindgen_as_number = function(arg0) {
2092
- const ret = +arg0;
2093
- return ret;
2094
- };
2095
- imports.wbg.__wbindgen_bigint_from_i64 = function(arg0) {
2096
- const ret = arg0;
2097
- return ret;
2098
- };
2099
- imports.wbg.__wbindgen_bigint_from_u64 = function(arg0) {
2100
- const ret = BigInt.asUintN(64, arg0);
2101
- return ret;
2102
- };
2103
- imports.wbg.__wbindgen_boolean_get = function(arg0) {
2104
- const v = arg0;
2105
- const ret = typeof(v) === 'boolean' ? (v ? 1 : 0) : 2;
2106
- return ret;
2107
- };
2108
- imports.wbg.__wbindgen_cb_drop = function(arg0) {
2109
- const obj = arg0.original;
2110
- if (obj.cnt-- == 1) {
2111
- obj.a = 0;
2112
- return true;
2270
+ function expectedResponseType(type) {
2271
+ switch (type) {
2272
+ case 'basic': case 'cors': case 'default': return true;
2113
2273
  }
2114
- const ret = false;
2115
- return ret;
2116
- };
2117
- imports.wbg.__wbindgen_closure_wrapper4734 = function(arg0, arg1, arg2) {
2118
- const ret = makeMutClosure(arg0, arg1, 1976, __wbg_adapter_50);
2119
- return ret;
2120
- };
2121
- imports.wbg.__wbindgen_closure_wrapper4736 = function(arg0, arg1, arg2) {
2122
- const ret = makeMutClosure(arg0, arg1, 1976, __wbg_adapter_50);
2123
- return ret;
2124
- };
2125
- imports.wbg.__wbindgen_closure_wrapper4738 = function(arg0, arg1, arg2) {
2126
- const ret = makeMutClosure(arg0, arg1, 1976, __wbg_adapter_50);
2127
- return ret;
2128
- };
2129
- imports.wbg.__wbindgen_closure_wrapper4740 = function(arg0, arg1, arg2) {
2130
- const ret = makeMutClosure(arg0, arg1, 1976, __wbg_adapter_50);
2131
- return ret;
2132
- };
2133
- imports.wbg.__wbindgen_closure_wrapper5704 = function(arg0, arg1, arg2) {
2134
- const ret = makeMutClosure(arg0, arg1, 2335, __wbg_adapter_59);
2135
- return ret;
2136
- };
2137
- imports.wbg.__wbindgen_debug_string = function(arg0, arg1) {
2138
- const ret = debugString(arg1);
2139
- const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2140
- const len1 = WASM_VECTOR_LEN;
2141
- getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
2142
- getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
2143
- };
2144
- imports.wbg.__wbindgen_error_new = function(arg0, arg1) {
2145
- const ret = new Error(getStringFromWasm0(arg0, arg1));
2146
- return ret;
2147
- };
2148
- imports.wbg.__wbindgen_in = function(arg0, arg1) {
2149
- const ret = arg0 in arg1;
2150
- return ret;
2151
- };
2152
- imports.wbg.__wbindgen_init_externref_table = function() {
2153
- const table = wasm.__wbindgen_export_4;
2154
- const offset = table.grow(4);
2155
- table.set(0, undefined);
2156
- table.set(offset + 0, undefined);
2157
- table.set(offset + 1, null);
2158
- table.set(offset + 2, true);
2159
- table.set(offset + 3, false);
2160
- ;
2161
- };
2162
- imports.wbg.__wbindgen_is_function = function(arg0) {
2163
- const ret = typeof(arg0) === 'function';
2164
- return ret;
2165
- };
2166
- imports.wbg.__wbindgen_is_null = function(arg0) {
2167
- const ret = arg0 === null;
2168
- return ret;
2169
- };
2170
- imports.wbg.__wbindgen_is_object = function(arg0) {
2171
- const val = arg0;
2172
- const ret = typeof(val) === 'object' && val !== null;
2173
- return ret;
2174
- };
2175
- imports.wbg.__wbindgen_is_string = function(arg0) {
2176
- const ret = typeof(arg0) === 'string';
2177
- return ret;
2178
- };
2179
- imports.wbg.__wbindgen_is_undefined = function(arg0) {
2180
- const ret = arg0 === undefined;
2181
- return ret;
2182
- };
2183
- imports.wbg.__wbindgen_jsval_loose_eq = function(arg0, arg1) {
2184
- const ret = arg0 == arg1;
2185
- return ret;
2186
- };
2187
- imports.wbg.__wbindgen_memory = function() {
2188
- const ret = wasm.memory;
2189
- return ret;
2190
- };
2191
- imports.wbg.__wbindgen_number_get = function(arg0, arg1) {
2192
- const obj = arg1;
2193
- const ret = typeof(obj) === 'number' ? obj : undefined;
2194
- getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
2195
- getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
2196
- };
2197
- imports.wbg.__wbindgen_number_new = function(arg0) {
2198
- const ret = arg0;
2199
- return ret;
2200
- };
2201
- imports.wbg.__wbindgen_string_get = function(arg0, arg1) {
2202
- const obj = arg1;
2203
- const ret = typeof(obj) === 'string' ? obj : undefined;
2204
- var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2205
- var len1 = WASM_VECTOR_LEN;
2206
- getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
2207
- getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
2208
- };
2209
- imports.wbg.__wbindgen_string_new = function(arg0, arg1) {
2210
- const ret = getStringFromWasm0(arg0, arg1);
2211
- return ret;
2212
- };
2213
- imports.wbg.__wbindgen_throw = function(arg0, arg1) {
2214
- throw new Error(getStringFromWasm0(arg0, arg1));
2215
- };
2216
- imports.wbg.__wbindgen_uint8_array_new = function(arg0, arg1) {
2217
- var v0 = getArrayU8FromWasm0(arg0, arg1).slice();
2218
- wasm.__wbindgen_free(arg0, arg1 * 1, 1);
2219
- const ret = v0;
2220
- return ret;
2221
- };
2222
-
2223
- return imports;
2224
- }
2225
-
2226
- function __wbg_init_memory(imports, memory) {
2227
-
2228
- }
2229
-
2230
- function __wbg_finalize_init(instance, module) {
2231
- wasm = instance.exports;
2232
- __wbg_init.__wbindgen_wasm_module = module;
2233
- cachedDataViewMemory0 = null;
2234
- cachedUint8ArrayMemory0 = null;
2235
-
2236
-
2237
- wasm.__wbindgen_start();
2238
- return wasm;
2274
+ return false;
2275
+ }
2239
2276
  }
2240
2277
 
2241
2278
  function initSync(module) {
2242
2279
  if (wasm !== undefined) return wasm;
2243
2280
 
2244
2281
 
2245
- if (typeof module !== 'undefined') {
2282
+ if (module !== undefined) {
2246
2283
  if (Object.getPrototypeOf(module) === Object.prototype) {
2247
2284
  ({module} = module)
2248
2285
  } else {
@@ -2251,15 +2288,10 @@ function initSync(module) {
2251
2288
  }
2252
2289
 
2253
2290
  const imports = __wbg_get_imports();
2254
-
2255
- __wbg_init_memory(imports);
2256
-
2257
2291
  if (!(module instanceof WebAssembly.Module)) {
2258
2292
  module = new WebAssembly.Module(module);
2259
2293
  }
2260
-
2261
2294
  const instance = new WebAssembly.Instance(module, imports);
2262
-
2263
2295
  return __wbg_finalize_init(instance, module);
2264
2296
  }
2265
2297
 
@@ -2267,7 +2299,7 @@ async function __wbg_init(module_or_path) {
2267
2299
  if (wasm !== undefined) return wasm;
2268
2300
 
2269
2301
 
2270
- if (typeof module_or_path !== 'undefined') {
2302
+ if (module_or_path !== undefined) {
2271
2303
  if (Object.getPrototypeOf(module_or_path) === Object.prototype) {
2272
2304
  ({module_or_path} = module_or_path)
2273
2305
  } else {
@@ -2275,7 +2307,7 @@ async function __wbg_init(module_or_path) {
2275
2307
  }
2276
2308
  }
2277
2309
 
2278
- if (typeof module_or_path === 'undefined') {
2310
+ if (module_or_path === undefined) {
2279
2311
  module_or_path = new URL('rivetkit_wasm_bg.wasm', import.meta.url);
2280
2312
  }
2281
2313
  const imports = __wbg_get_imports();
@@ -2284,12 +2316,9 @@ async function __wbg_init(module_or_path) {
2284
2316
  module_or_path = fetch(module_or_path);
2285
2317
  }
2286
2318
 
2287
- __wbg_init_memory(imports);
2288
-
2289
2319
  const { instance, module } = await __wbg_load(await module_or_path, imports);
2290
2320
 
2291
2321
  return __wbg_finalize_init(instance, module);
2292
2322
  }
2293
2323
 
2294
- export { initSync };
2295
- export default __wbg_init;
2324
+ export { initSync, __wbg_init as default };