@rivetkit/rivetkit-wasm 0.0.0-main.72cbc7c → 0.0.0-main.78336a1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rivetkit/rivetkit-wasm",
3
- "version": "0.0.0-main.72cbc7c",
3
+ "version": "0.0.0-main.78336a1",
4
4
  "description": "WebAssembly bindings for RivetKit core on edge JavaScript runtimes",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
@@ -28,15 +28,21 @@
28
28
  ],
29
29
  "scripts": {
30
30
  "build": "node scripts/build.mjs",
31
+ "build:embed": "node scripts/build.mjs",
31
32
  "build:cloudflare": "node scripts/build.mjs --target bundler --out-dir pkg-cloudflare",
32
33
  "build:deno": "node scripts/build.mjs --target web --out-dir pkg-deno",
33
34
  "check:package": "node scripts/check-package.mjs",
34
- "check-types": "tsc --noEmit",
35
+ "check-types": "pnpm run build && tsc --noEmit",
35
36
  "check:wasm": "cargo check -p rivetkit-wasm --target wasm32-unknown-unknown",
36
37
  "prepack": "node scripts/build.mjs"
37
38
  },
38
39
  "devDependencies": {
39
40
  "typescript": "^5.9.2",
40
- "wasm-pack": "0.14.0"
41
+ "wasm-pack": "0.15.0"
42
+ },
43
+ "repository": {
44
+ "type": "git",
45
+ "url": "https://github.com/rivet-dev/actors.git",
46
+ "directory": "rivetkit-typescript/packages/rivetkit-wasm"
41
47
  }
42
48
  }
@@ -0,0 +1,19 @@
1
+ {
2
+ "name": "rivetkit-wasm",
3
+ "type": "module",
4
+ "collaborators": [
5
+ "Rivet Gaming, LLC <developer@rivet.dev>"
6
+ ],
7
+ "version": "2.3.17",
8
+ "license": "Apache-2.0",
9
+ "files": [
10
+ "rivetkit_wasm_bg.wasm",
11
+ "rivetkit_wasm.js",
12
+ "rivetkit_wasm.d.ts"
13
+ ],
14
+ "main": "rivetkit_wasm.js",
15
+ "types": "rivetkit_wasm.d.ts",
16
+ "sideEffects": [
17
+ "./snippets/*"
18
+ ]
19
+ }
@@ -1,17 +1,24 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
- export function roundTripBytes(bytes: Uint8Array): Uint8Array;
4
3
  export function start(): void;
5
- export function awaitPromise(promise: Promise<any>): Promise<any>;
6
4
  export function bridgeRivetErrorPrefix(): string;
5
+ export function roundTripBytes(bytes: Uint8Array): Uint8Array;
7
6
  export function uint8ArrayFromBytes(bytes: Uint8Array): Uint8Array;
7
+ export function awaitPromise(promise: Promise<any>): Promise<any>;
8
8
  export class ActorContext {
9
9
  free(): void;
10
- keepAwake(promise: Promise<any>): void;
11
10
  saveState(payload: any): Promise<void>;
11
+ connectConn(params: Uint8Array, request: any): Promise<ConnHandle>;
12
+ setRunWakeAt(timestamp_ms?: number | null): Promise<void>;
13
+ requestSaveAndWait(opts: any): Promise<void>;
14
+ verifyInspectorAuth(bearer_token?: string | null): Promise<void>;
15
+ beginStateTransaction(timeout_ms?: number | null): Promise<ActorStateTransaction>;
16
+ saveStateAndWorkflowBatch(writes: any): Promise<void>;
17
+ waitForTrackedShutdownWork(): Promise<boolean>;
18
+ waitForTrackedShutdownWorkUnbounded(): Promise<void>;
19
+ keepAwake(promise: Promise<any>): void;
12
20
  waitUntil(promise: Promise<any>): void;
13
21
  abortSignal(): any;
14
- connectConn(params: Uint8Array, request: any): Promise<ConnHandle>;
15
22
  requestSave(opts: any): void;
16
23
  registerTask(promise: Promise<any>): void;
17
24
  runtimeState(): any;
@@ -21,13 +28,10 @@ export class ActorContext {
21
28
  endOnStateChange(): void;
22
29
  restartRunHandler(): void;
23
30
  beginOnStateChange(): void;
24
- requestSaveAndWait(opts: any): Promise<void>;
25
- verifyInspectorAuth(bearer_token?: string | null): Promise<void>;
26
31
  endWebsocketCallback(region_id: number): void;
27
32
  beginWebsocketCallback(): number;
28
33
  dirtyHibernatableConns(): Array<any>;
29
34
  kv(): Kv;
30
- waitForTrackedShutdownWork(): Promise<boolean>;
31
35
  takePendingHibernationChanges(): Array<any>;
32
36
  key(): any;
33
37
  constructor();
@@ -48,6 +52,13 @@ export class ActorFactory {
48
52
  free(): void;
49
53
  constructor(callbacks: any, config: any);
50
54
  }
55
+ export class ActorStateTransaction {
56
+ private constructor();
57
+ free(): void;
58
+ commit(payload: any): Promise<void>;
59
+ execute(sql: string, params: any): Promise<any>;
60
+ rollback(): Promise<void>;
61
+ }
51
62
  export class CancellationToken {
52
63
  free(): void;
53
64
  onCancelled(callback: Function): void;
@@ -69,10 +80,10 @@ export class ConnHandle {
69
80
  export class CoreRegistry {
70
81
  free(): void;
71
82
  handleServerlessRequest(req: any, on_stream_event: Function, cancel_token: CancellationToken, config: any): Promise<any>;
72
- constructor();
73
83
  serve(config: any): Promise<void>;
74
- register(name: string, factory: ActorFactory): void;
75
84
  shutdown(): Promise<void>;
85
+ constructor();
86
+ register(name: string, factory: ActorFactory): void;
76
87
  }
77
88
  export class Kv {
78
89
  private constructor();
@@ -91,45 +102,66 @@ export class Queue {
91
102
  private constructor();
92
103
  free(): void;
93
104
  nextBatch(options: any, signal?: CancellationToken | null): Promise<Array<any>>;
94
- tryNextBatch(options: any): Array<any>;
95
105
  waitForNames(names: any, options: any, signal?: CancellationToken | null): Promise<QueueMessage>;
96
106
  enqueueAndWait(name: string, body: Uint8Array, options: any, signal?: CancellationToken | null): Promise<Uint8Array | undefined>;
97
107
  inspectMessages(): Promise<Array<any>>;
108
+ completePersisted(message_id: bigint, expected_name: string, response?: Uint8Array | null): Promise<boolean>;
98
109
  waitForNamesAvailable(names: any, options: any): Promise<void>;
99
110
  send(name: string, body: Uint8Array): Promise<QueueMessage>;
111
+ reset(): Promise<void>;
112
+ tryNextBatch(options: any): Array<any>;
100
113
  maxSize(): number;
101
114
  }
102
115
  export class QueueMessage {
103
116
  private constructor();
104
117
  free(): void;
118
+ complete(response: any): Promise<void>;
105
119
  createdAt(): number;
106
120
  isCompletable(): boolean;
107
121
  id(): bigint;
108
122
  body(): Uint8Array;
109
123
  name(): string;
110
- complete(response: any): Promise<void>;
111
124
  }
112
125
  export class Schedule {
113
126
  private constructor();
114
127
  free(): void;
115
- at(timestamp_ms: number, action_name: string, args: Uint8Array): void;
116
- after(duration_ms: number, action_name: string, args: Uint8Array): void;
128
+ cronEvery(name: string, interval_ms: number, action_name: string, args: Uint8Array, max_history?: number | null): Promise<void>;
129
+ cronDelete(name: string): Promise<boolean>;
130
+ cronHistory(name: string, limit?: number | null): Promise<any>;
131
+ at(timestamp_ms: number, action_name: string, args: Uint8Array): Promise<string>;
132
+ get(id: string): Promise<any>;
133
+ list(): Promise<any>;
134
+ after(duration_ms: number, action_name: string, args: Uint8Array): Promise<string>;
135
+ cancel(id: string): Promise<boolean>;
136
+ cronGet(name: string): Promise<any>;
137
+ cronSet(name: string, expression: string, timezone: string | null | undefined, action_name: string, args: Uint8Array, max_history?: number | null): Promise<void>;
138
+ cronList(): Promise<any>;
117
139
  }
118
140
  export class SqliteDb {
119
141
  private constructor();
120
142
  free(): void;
143
+ executeBatch(statements: any): Promise<any>;
144
+ beginTransaction(timeout_ms?: number | null, name?: string | null): Promise<SqliteTransaction>;
121
145
  run(sql: string, params: any): Promise<any>;
122
146
  exec(sql: string): Promise<any>;
123
147
  close(): Promise<void>;
124
148
  query(sql: string, params: any): Promise<any>;
125
149
  execute(sql: string, params: any): Promise<any>;
126
150
  }
151
+ export class SqliteTransaction {
152
+ private constructor();
153
+ free(): void;
154
+ exec(sql: string): Promise<any>;
155
+ commit(): Promise<void>;
156
+ execute(sql: string, params: any): Promise<any>;
157
+ rollback(): Promise<void>;
158
+ }
127
159
  export class WebSocketHandle {
128
160
  private constructor();
129
161
  free(): void;
162
+ close(code?: number | null, reason?: string | null): Promise<void>;
130
163
  setEventCallback(callback: Function): void;
131
164
  send(data: Uint8Array, binary: boolean): void;
132
- close(code?: number | null, reason?: string | null): Promise<void>;
133
165
  }
134
166
 
135
167
  export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
@@ -138,17 +170,20 @@ export interface InitOutput {
138
170
  readonly memory: WebAssembly.Memory;
139
171
  readonly __wbg_actorcontext_free: (a: number, b: number) => void;
140
172
  readonly __wbg_actorfactory_free: (a: number, b: number) => void;
173
+ readonly __wbg_actorstatetransaction_free: (a: number, b: number) => void;
141
174
  readonly __wbg_cancellationtoken_free: (a: number, b: number) => void;
142
175
  readonly __wbg_connhandle_free: (a: number, b: number) => void;
143
176
  readonly __wbg_coreregistry_free: (a: number, b: number) => void;
144
177
  readonly __wbg_kv_free: (a: number, b: number) => void;
145
178
  readonly __wbg_queuemessage_free: (a: number, b: number) => void;
146
179
  readonly __wbg_sqlitedb_free: (a: number, b: number) => void;
180
+ readonly __wbg_sqlitetransaction_free: (a: number, b: number) => void;
147
181
  readonly __wbg_websockethandle_free: (a: number, b: number) => void;
148
182
  readonly actorcontext_abortSignal: (a: number) => [number, number, number];
149
183
  readonly actorcontext_actorId: (a: number) => [number, number];
150
184
  readonly actorcontext_beginKeepAwake: (a: number) => number;
151
185
  readonly actorcontext_beginOnStateChange: (a: number) => void;
186
+ readonly actorcontext_beginStateTransaction: (a: number, b: number, c: number) => any;
152
187
  readonly actorcontext_beginWebsocketCallback: (a: number) => number;
153
188
  readonly actorcontext_broadcast: (a: number, b: number, c: number, d: number, e: number) => void;
154
189
  readonly actorcontext_connectConn: (a: number, b: number, c: number, d: any) => any;
@@ -168,18 +203,24 @@ export interface InitOutput {
168
203
  readonly actorcontext_registerTask: (a: number, b: any) => void;
169
204
  readonly actorcontext_requestSave: (a: number, b: any) => void;
170
205
  readonly actorcontext_requestSaveAndWait: (a: number, b: any) => any;
171
- readonly actorcontext_restartRunHandler: (a: number) => void;
206
+ readonly actorcontext_restartRunHandler: (a: number) => [number, number];
172
207
  readonly actorcontext_runtimeState: (a: number) => any;
173
208
  readonly actorcontext_saveState: (a: number, b: any) => any;
209
+ readonly actorcontext_saveStateAndWorkflowBatch: (a: number, b: any) => any;
174
210
  readonly actorcontext_setAlarm: (a: number, b: number, c: number) => [number, number];
211
+ readonly actorcontext_setRunWakeAt: (a: number, b: number, c: number) => any;
175
212
  readonly actorcontext_sleep: (a: number) => [number, number];
176
213
  readonly actorcontext_sql: (a: number) => number;
177
214
  readonly actorcontext_state: (a: number) => [number, number];
178
215
  readonly actorcontext_takePendingHibernationChanges: (a: number) => any;
179
216
  readonly actorcontext_verifyInspectorAuth: (a: number, b: number, c: number) => any;
180
217
  readonly actorcontext_waitForTrackedShutdownWork: (a: number) => any;
218
+ readonly actorcontext_waitForTrackedShutdownWorkUnbounded: (a: number) => any;
181
219
  readonly actorcontext_waitUntil: (a: number, b: any) => void;
182
220
  readonly actorfactory_new: (a: any, b: any) => [number, number, number];
221
+ readonly actorstatetransaction_commit: (a: number, b: any) => any;
222
+ readonly actorstatetransaction_execute: (a: number, b: number, c: number, d: any) => any;
223
+ readonly actorstatetransaction_rollback: (a: number) => any;
183
224
  readonly awaitPromise: (a: any) => any;
184
225
  readonly bridgeRivetErrorPrefix: () => [number, number];
185
226
  readonly cancellationtoken_aborted: (a: number) => number;
@@ -207,10 +248,12 @@ export interface InitOutput {
207
248
  readonly kv_listPrefix: (a: number, b: number, c: number, d: any) => any;
208
249
  readonly kv_listRange: (a: number, b: number, c: number, d: number, e: number, f: any) => any;
209
250
  readonly kv_put: (a: number, b: number, c: number, d: number, e: number) => any;
251
+ readonly queue_completePersisted: (a: number, b: bigint, c: number, d: number, e: number, f: number) => any;
210
252
  readonly queue_enqueueAndWait: (a: number, b: number, c: number, d: number, e: number, f: any, g: number) => any;
211
253
  readonly queue_inspectMessages: (a: number) => any;
212
254
  readonly queue_maxSize: (a: number) => number;
213
255
  readonly queue_nextBatch: (a: number, b: any, c: number) => any;
256
+ readonly queue_reset: (a: number) => any;
214
257
  readonly queue_send: (a: number, b: number, c: number, d: number, e: number) => any;
215
258
  readonly queue_tryNextBatch: (a: number, b: any) => [number, number, number];
216
259
  readonly queue_waitForNames: (a: number, b: any, c: any, d: number) => any;
@@ -222,13 +265,28 @@ export interface InitOutput {
222
265
  readonly queuemessage_isCompletable: (a: number) => number;
223
266
  readonly queuemessage_name: (a: number) => [number, number];
224
267
  readonly roundTripBytes: (a: number, b: number) => [number, number];
225
- readonly schedule_after: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
226
- readonly schedule_at: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
268
+ readonly schedule_after: (a: number, b: number, c: number, d: number, e: number, f: number) => any;
269
+ readonly schedule_at: (a: number, b: number, c: number, d: number, e: number, f: number) => any;
270
+ readonly schedule_cancel: (a: number, b: number, c: number) => any;
271
+ readonly schedule_cronDelete: (a: number, b: number, c: number) => any;
272
+ readonly schedule_cronEvery: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number) => any;
273
+ readonly schedule_cronGet: (a: number, b: number, c: number) => any;
274
+ readonly schedule_cronHistory: (a: number, b: number, c: number, d: number, e: number) => any;
275
+ readonly schedule_cronList: (a: number) => any;
276
+ readonly schedule_cronSet: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number, m: number) => any;
277
+ readonly schedule_get: (a: number, b: number, c: number) => any;
278
+ readonly schedule_list: (a: number) => any;
279
+ readonly sqlitedb_beginTransaction: (a: number, b: number, c: number, d: number, e: number) => any;
227
280
  readonly sqlitedb_close: (a: number) => any;
228
281
  readonly sqlitedb_exec: (a: number, b: number, c: number) => any;
229
282
  readonly sqlitedb_execute: (a: number, b: number, c: number, d: any) => any;
283
+ readonly sqlitedb_executeBatch: (a: number, b: any) => any;
230
284
  readonly sqlitedb_query: (a: number, b: number, c: number, d: any) => any;
231
285
  readonly sqlitedb_run: (a: number, b: number, c: number, d: any) => any;
286
+ readonly sqlitetransaction_commit: (a: number) => any;
287
+ readonly sqlitetransaction_exec: (a: number, b: number, c: number) => any;
288
+ readonly sqlitetransaction_execute: (a: number, b: number, c: number, d: any) => any;
289
+ readonly sqlitetransaction_rollback: (a: number) => any;
232
290
  readonly uint8ArrayFromBytes: (a: number, b: number) => any;
233
291
  readonly websockethandle_close: (a: number, b: number, c: number, d: number) => any;
234
292
  readonly websockethandle_send: (a: number, b: number, c: number, d: number) => [number, number];
@@ -246,9 +304,9 @@ export interface InitOutput {
246
304
  readonly __wbindgen_free: (a: number, b: number, c: number) => void;
247
305
  readonly __wbindgen_export_6: WebAssembly.Table;
248
306
  readonly __externref_table_dealloc: (a: number) => void;
249
- readonly closure1600_externref_shim: (a: number, b: number, c: any) => void;
250
- readonly closure1804_externref_shim: (a: number, b: number, c: any) => void;
251
- readonly closure2027_externref_shim: (a: number, b: number, c: any, d: any) => void;
307
+ readonly closure1987_externref_shim: (a: number, b: number, c: any) => void;
308
+ readonly closure2386_externref_shim: (a: number, b: number, c: any) => void;
309
+ readonly closure2623_externref_shim: (a: number, b: number, c: any, d: any) => void;
252
310
  readonly __wbindgen_start: () => void;
253
311
  }
254
312
 
@@ -203,24 +203,32 @@ function debugString(val) {
203
203
  return className;
204
204
  }
205
205
 
206
+ export function start() {
207
+ wasm.start();
208
+ }
209
+
210
+ /**
211
+ * @returns {string}
212
+ */
213
+ export function bridgeRivetErrorPrefix() {
214
+ let deferred1_0;
215
+ let deferred1_1;
216
+ try {
217
+ const ret = wasm.bridgeRivetErrorPrefix();
218
+ deferred1_0 = ret[0];
219
+ deferred1_1 = ret[1];
220
+ return getStringFromWasm0(ret[0], ret[1]);
221
+ } finally {
222
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
223
+ }
224
+ }
225
+
206
226
  function passArray8ToWasm0(arg, malloc) {
207
227
  const ptr = malloc(arg.length * 1, 1) >>> 0;
208
228
  getUint8ArrayMemory0().set(arg, ptr / 1);
209
229
  WASM_VECTOR_LEN = arg.length;
210
230
  return ptr;
211
231
  }
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
232
  /**
225
233
  * @param {Uint8Array} bytes
226
234
  * @returns {Uint8Array}
@@ -234,8 +242,15 @@ export function roundTripBytes(bytes) {
234
242
  return v2;
235
243
  }
236
244
 
237
- export function start() {
238
- wasm.start();
245
+ /**
246
+ * @param {Uint8Array} bytes
247
+ * @returns {Uint8Array}
248
+ */
249
+ export function uint8ArrayFromBytes(bytes) {
250
+ const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
251
+ const len0 = WASM_VECTOR_LEN;
252
+ const ret = wasm.uint8ArrayFromBytes(ptr0, len0);
253
+ return ret;
239
254
  }
240
255
 
241
256
  /**
@@ -247,43 +262,27 @@ export function awaitPromise(promise) {
247
262
  return ret;
248
263
  }
249
264
 
250
- /**
251
- * @returns {string}
252
- */
253
- export function bridgeRivetErrorPrefix() {
254
- let deferred1_0;
255
- let deferred1_1;
256
- try {
257
- const ret = wasm.bridgeRivetErrorPrefix();
258
- deferred1_0 = ret[0];
259
- deferred1_1 = ret[1];
260
- return getStringFromWasm0(ret[0], ret[1]);
261
- } finally {
262
- wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
265
+ function _assertClass(instance, klass) {
266
+ if (!(instance instanceof klass)) {
267
+ throw new Error(`expected instance of ${klass.name}`);
263
268
  }
264
269
  }
265
270
 
266
- /**
267
- * @param {Uint8Array} bytes
268
- * @returns {Uint8Array}
269
- */
270
- export function uint8ArrayFromBytes(bytes) {
271
- const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
272
- const len0 = WASM_VECTOR_LEN;
273
- const ret = wasm.uint8ArrayFromBytes(ptr0, len0);
274
- return ret;
271
+ function takeFromExternrefTable0(idx) {
272
+ const value = wasm.__wbindgen_export_4.get(idx);
273
+ wasm.__externref_table_dealloc(idx);
274
+ return value;
275
275
  }
276
-
277
- function __wbg_adapter_46(arg0, arg1, arg2) {
278
- wasm.closure1600_externref_shim(arg0, arg1, arg2);
276
+ function __wbg_adapter_50(arg0, arg1, arg2) {
277
+ wasm.closure1987_externref_shim(arg0, arg1, arg2);
279
278
  }
280
279
 
281
- function __wbg_adapter_55(arg0, arg1, arg2) {
282
- wasm.closure1804_externref_shim(arg0, arg1, arg2);
280
+ function __wbg_adapter_59(arg0, arg1, arg2) {
281
+ wasm.closure2386_externref_shim(arg0, arg1, arg2);
283
282
  }
284
283
 
285
- function __wbg_adapter_225(arg0, arg1, arg2, arg3) {
286
- wasm.closure2027_externref_shim(arg0, arg1, arg2, arg3);
284
+ function __wbg_adapter_297(arg0, arg1, arg2, arg3) {
285
+ wasm.closure2623_externref_shim(arg0, arg1, arg2, arg3);
287
286
  }
288
287
 
289
288
  const __wbindgen_enum_BinaryType = ["blob", "arraybuffer"];
@@ -313,12 +312,6 @@ export class ActorContext {
313
312
  const ptr = this.__destroy_into_raw();
314
313
  wasm.__wbg_actorcontext_free(ptr, 0);
315
314
  }
316
- /**
317
- * @param {Promise<any>} promise
318
- */
319
- keepAwake(promise) {
320
- wasm.actorcontext_keepAwake(this.__wbg_ptr, promise);
321
- }
322
315
  /**
323
316
  * @param {any} payload
324
317
  * @returns {Promise<void>}
@@ -327,6 +320,79 @@ export class ActorContext {
327
320
  const ret = wasm.actorcontext_saveState(this.__wbg_ptr, payload);
328
321
  return ret;
329
322
  }
323
+ /**
324
+ * @param {Uint8Array} params
325
+ * @param {any} request
326
+ * @returns {Promise<ConnHandle>}
327
+ */
328
+ connectConn(params, request) {
329
+ const ptr0 = passArray8ToWasm0(params, wasm.__wbindgen_malloc);
330
+ const len0 = WASM_VECTOR_LEN;
331
+ const ret = wasm.actorcontext_connectConn(this.__wbg_ptr, ptr0, len0, request);
332
+ return ret;
333
+ }
334
+ /**
335
+ * @param {number | null} [timestamp_ms]
336
+ * @returns {Promise<void>}
337
+ */
338
+ setRunWakeAt(timestamp_ms) {
339
+ const ret = wasm.actorcontext_setRunWakeAt(this.__wbg_ptr, !isLikeNone(timestamp_ms), isLikeNone(timestamp_ms) ? 0 : timestamp_ms);
340
+ return ret;
341
+ }
342
+ /**
343
+ * @param {any} opts
344
+ * @returns {Promise<void>}
345
+ */
346
+ requestSaveAndWait(opts) {
347
+ const ret = wasm.actorcontext_requestSaveAndWait(this.__wbg_ptr, opts);
348
+ return ret;
349
+ }
350
+ /**
351
+ * @param {string | null} [bearer_token]
352
+ * @returns {Promise<void>}
353
+ */
354
+ verifyInspectorAuth(bearer_token) {
355
+ var ptr0 = isLikeNone(bearer_token) ? 0 : passStringToWasm0(bearer_token, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
356
+ var len0 = WASM_VECTOR_LEN;
357
+ const ret = wasm.actorcontext_verifyInspectorAuth(this.__wbg_ptr, ptr0, len0);
358
+ return ret;
359
+ }
360
+ /**
361
+ * @param {number | null} [timeout_ms]
362
+ * @returns {Promise<ActorStateTransaction>}
363
+ */
364
+ beginStateTransaction(timeout_ms) {
365
+ const ret = wasm.actorcontext_beginStateTransaction(this.__wbg_ptr, !isLikeNone(timeout_ms), isLikeNone(timeout_ms) ? 0 : timeout_ms);
366
+ return ret;
367
+ }
368
+ /**
369
+ * @param {any} writes
370
+ * @returns {Promise<void>}
371
+ */
372
+ saveStateAndWorkflowBatch(writes) {
373
+ const ret = wasm.actorcontext_saveStateAndWorkflowBatch(this.__wbg_ptr, writes);
374
+ return ret;
375
+ }
376
+ /**
377
+ * @returns {Promise<boolean>}
378
+ */
379
+ waitForTrackedShutdownWork() {
380
+ const ret = wasm.actorcontext_waitForTrackedShutdownWork(this.__wbg_ptr);
381
+ return ret;
382
+ }
383
+ /**
384
+ * @returns {Promise<void>}
385
+ */
386
+ waitForTrackedShutdownWorkUnbounded() {
387
+ const ret = wasm.actorcontext_waitForTrackedShutdownWorkUnbounded(this.__wbg_ptr);
388
+ return ret;
389
+ }
390
+ /**
391
+ * @param {Promise<any>} promise
392
+ */
393
+ keepAwake(promise) {
394
+ wasm.actorcontext_keepAwake(this.__wbg_ptr, promise);
395
+ }
330
396
  /**
331
397
  * @param {Promise<any>} promise
332
398
  */
@@ -343,17 +409,6 @@ export class ActorContext {
343
409
  }
344
410
  return takeFromExternrefTable0(ret[0]);
345
411
  }
346
- /**
347
- * @param {Uint8Array} params
348
- * @param {any} request
349
- * @returns {Promise<ConnHandle>}
350
- */
351
- connectConn(params, request) {
352
- const ptr0 = passArray8ToWasm0(params, wasm.__wbindgen_malloc);
353
- const len0 = WASM_VECTOR_LEN;
354
- const ret = wasm.actorcontext_connectConn(this.__wbg_ptr, ptr0, len0, request);
355
- return ret;
356
- }
357
412
  /**
358
413
  * @param {any} opts
359
414
  */
@@ -400,29 +455,14 @@ export class ActorContext {
400
455
  wasm.actorcontext_endOnStateChange(this.__wbg_ptr);
401
456
  }
402
457
  restartRunHandler() {
403
- wasm.actorcontext_restartRunHandler(this.__wbg_ptr);
458
+ const ret = wasm.actorcontext_restartRunHandler(this.__wbg_ptr);
459
+ if (ret[1]) {
460
+ throw takeFromExternrefTable0(ret[0]);
461
+ }
404
462
  }
405
463
  beginOnStateChange() {
406
464
  wasm.actorcontext_beginOnStateChange(this.__wbg_ptr);
407
465
  }
408
- /**
409
- * @param {any} opts
410
- * @returns {Promise<void>}
411
- */
412
- requestSaveAndWait(opts) {
413
- const ret = wasm.actorcontext_requestSaveAndWait(this.__wbg_ptr, opts);
414
- return ret;
415
- }
416
- /**
417
- * @param {string | null} [bearer_token]
418
- * @returns {Promise<void>}
419
- */
420
- verifyInspectorAuth(bearer_token) {
421
- var ptr0 = isLikeNone(bearer_token) ? 0 : passStringToWasm0(bearer_token, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
422
- var len0 = WASM_VECTOR_LEN;
423
- const ret = wasm.actorcontext_verifyInspectorAuth(this.__wbg_ptr, ptr0, len0);
424
- return ret;
425
- }
426
466
  /**
427
467
  * @param {number} region_id
428
468
  */
@@ -450,13 +490,6 @@ export class ActorContext {
450
490
  const ret = wasm.actorcontext_kv(this.__wbg_ptr);
451
491
  return Kv.__wrap(ret);
452
492
  }
453
- /**
454
- * @returns {Promise<boolean>}
455
- */
456
- waitForTrackedShutdownWork() {
457
- const ret = wasm.actorcontext_waitForTrackedShutdownWork(this.__wbg_ptr);
458
- return ret;
459
- }
460
493
  /**
461
494
  * @returns {Array<any>}
462
495
  */
@@ -631,12 +664,73 @@ export class ActorFactory {
631
664
  }
632
665
  }
633
666
 
667
+ const ActorStateTransactionFinalization = (typeof FinalizationRegistry === 'undefined')
668
+ ? { register: () => {}, unregister: () => {} }
669
+ : new FinalizationRegistry(ptr => wasm.__wbg_actorstatetransaction_free(ptr >>> 0, 1));
670
+
671
+ export class ActorStateTransaction {
672
+
673
+ static __wrap(ptr) {
674
+ ptr = ptr >>> 0;
675
+ const obj = Object.create(ActorStateTransaction.prototype);
676
+ obj.__wbg_ptr = ptr;
677
+ ActorStateTransactionFinalization.register(obj, obj.__wbg_ptr, obj);
678
+ return obj;
679
+ }
680
+
681
+ __destroy_into_raw() {
682
+ const ptr = this.__wbg_ptr;
683
+ this.__wbg_ptr = 0;
684
+ ActorStateTransactionFinalization.unregister(this);
685
+ return ptr;
686
+ }
687
+
688
+ free() {
689
+ const ptr = this.__destroy_into_raw();
690
+ wasm.__wbg_actorstatetransaction_free(ptr, 0);
691
+ }
692
+ /**
693
+ * @param {any} payload
694
+ * @returns {Promise<void>}
695
+ */
696
+ commit(payload) {
697
+ const ret = wasm.actorstatetransaction_commit(this.__wbg_ptr, payload);
698
+ return ret;
699
+ }
700
+ /**
701
+ * @param {string} sql
702
+ * @param {any} params
703
+ * @returns {Promise<any>}
704
+ */
705
+ execute(sql, params) {
706
+ const ptr0 = passStringToWasm0(sql, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
707
+ const len0 = WASM_VECTOR_LEN;
708
+ const ret = wasm.actorstatetransaction_execute(this.__wbg_ptr, ptr0, len0, params);
709
+ return ret;
710
+ }
711
+ /**
712
+ * @returns {Promise<void>}
713
+ */
714
+ rollback() {
715
+ const ret = wasm.actorstatetransaction_rollback(this.__wbg_ptr);
716
+ return ret;
717
+ }
718
+ }
719
+
634
720
  const CancellationTokenFinalization = (typeof FinalizationRegistry === 'undefined')
635
721
  ? { register: () => {}, unregister: () => {} }
636
722
  : new FinalizationRegistry(ptr => wasm.__wbg_cancellationtoken_free(ptr >>> 0, 1));
637
723
 
638
724
  export class CancellationToken {
639
725
 
726
+ static __wrap(ptr) {
727
+ ptr = ptr >>> 0;
728
+ const obj = Object.create(CancellationToken.prototype);
729
+ obj.__wbg_ptr = ptr;
730
+ CancellationTokenFinalization.register(obj, obj.__wbg_ptr, obj);
731
+ return obj;
732
+ }
733
+
640
734
  __destroy_into_raw() {
641
735
  const ptr = this.__wbg_ptr;
642
736
  this.__wbg_ptr = 0;
@@ -797,12 +891,6 @@ export class CoreRegistry {
797
891
  const ret = wasm.coreregistry_handleServerlessRequest(this.__wbg_ptr, req, on_stream_event, cancel_token.__wbg_ptr, config);
798
892
  return ret;
799
893
  }
800
- constructor() {
801
- const ret = wasm.coreregistry_new();
802
- this.__wbg_ptr = ret >>> 0;
803
- CoreRegistryFinalization.register(this, this.__wbg_ptr, this);
804
- return this;
805
- }
806
894
  /**
807
895
  * @param {any} config
808
896
  * @returns {Promise<void>}
@@ -811,6 +899,19 @@ export class CoreRegistry {
811
899
  const ret = wasm.coreregistry_serve(this.__wbg_ptr, config);
812
900
  return ret;
813
901
  }
902
+ /**
903
+ * @returns {Promise<void>}
904
+ */
905
+ shutdown() {
906
+ const ret = wasm.coreregistry_shutdown(this.__wbg_ptr);
907
+ return ret;
908
+ }
909
+ constructor() {
910
+ const ret = wasm.coreregistry_new();
911
+ this.__wbg_ptr = ret >>> 0;
912
+ CoreRegistryFinalization.register(this, this.__wbg_ptr, this);
913
+ return this;
914
+ }
814
915
  /**
815
916
  * @param {string} name
816
917
  * @param {ActorFactory} factory
@@ -824,13 +925,6 @@ export class CoreRegistry {
824
925
  throw takeFromExternrefTable0(ret[0]);
825
926
  }
826
927
  }
827
- /**
828
- * @returns {Promise<void>}
829
- */
830
- shutdown() {
831
- const ret = wasm.coreregistry_shutdown(this.__wbg_ptr);
832
- return ret;
833
- }
834
928
  }
835
929
 
836
930
  const KvFinalization = (typeof FinalizationRegistry === 'undefined')
@@ -994,17 +1088,6 @@ export class Queue {
994
1088
  const ret = wasm.queue_nextBatch(this.__wbg_ptr, options, ptr0);
995
1089
  return ret;
996
1090
  }
997
- /**
998
- * @param {any} options
999
- * @returns {Array<any>}
1000
- */
1001
- tryNextBatch(options) {
1002
- const ret = wasm.queue_tryNextBatch(this.__wbg_ptr, options);
1003
- if (ret[2]) {
1004
- throw takeFromExternrefTable0(ret[1]);
1005
- }
1006
- return takeFromExternrefTable0(ret[0]);
1007
- }
1008
1091
  /**
1009
1092
  * @param {any} names
1010
1093
  * @param {any} options
@@ -1047,6 +1130,20 @@ export class Queue {
1047
1130
  const ret = wasm.queue_inspectMessages(this.__wbg_ptr);
1048
1131
  return ret;
1049
1132
  }
1133
+ /**
1134
+ * @param {bigint} message_id
1135
+ * @param {string} expected_name
1136
+ * @param {Uint8Array | null} [response]
1137
+ * @returns {Promise<boolean>}
1138
+ */
1139
+ completePersisted(message_id, expected_name, response) {
1140
+ const ptr0 = passStringToWasm0(expected_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1141
+ const len0 = WASM_VECTOR_LEN;
1142
+ var ptr1 = isLikeNone(response) ? 0 : passArray8ToWasm0(response, wasm.__wbindgen_malloc);
1143
+ var len1 = WASM_VECTOR_LEN;
1144
+ const ret = wasm.queue_completePersisted(this.__wbg_ptr, message_id, ptr0, len0, ptr1, len1);
1145
+ return ret;
1146
+ }
1050
1147
  /**
1051
1148
  * @param {any} names
1052
1149
  * @param {any} options
@@ -1069,6 +1166,24 @@ export class Queue {
1069
1166
  const ret = wasm.queue_send(this.__wbg_ptr, ptr0, len0, ptr1, len1);
1070
1167
  return ret;
1071
1168
  }
1169
+ /**
1170
+ * @returns {Promise<void>}
1171
+ */
1172
+ reset() {
1173
+ const ret = wasm.queue_reset(this.__wbg_ptr);
1174
+ return ret;
1175
+ }
1176
+ /**
1177
+ * @param {any} options
1178
+ * @returns {Array<any>}
1179
+ */
1180
+ tryNextBatch(options) {
1181
+ const ret = wasm.queue_tryNextBatch(this.__wbg_ptr, options);
1182
+ if (ret[2]) {
1183
+ throw takeFromExternrefTable0(ret[1]);
1184
+ }
1185
+ return takeFromExternrefTable0(ret[0]);
1186
+ }
1072
1187
  /**
1073
1188
  * @returns {number}
1074
1189
  */
@@ -1103,6 +1218,14 @@ export class QueueMessage {
1103
1218
  const ptr = this.__destroy_into_raw();
1104
1219
  wasm.__wbg_queuemessage_free(ptr, 0);
1105
1220
  }
1221
+ /**
1222
+ * @param {any} response
1223
+ * @returns {Promise<void>}
1224
+ */
1225
+ complete(response) {
1226
+ const ret = wasm.queuemessage_complete(this.__wbg_ptr, response);
1227
+ return ret;
1228
+ }
1106
1229
  /**
1107
1230
  * @returns {number}
1108
1231
  */
@@ -1148,14 +1271,6 @@ export class QueueMessage {
1148
1271
  wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
1149
1272
  }
1150
1273
  }
1151
- /**
1152
- * @param {any} response
1153
- * @returns {Promise<void>}
1154
- */
1155
- complete(response) {
1156
- const ret = wasm.queuemessage_complete(this.__wbg_ptr, response);
1157
- return ret;
1158
- }
1159
1274
  }
1160
1275
 
1161
1276
  const ScheduleFinalization = (typeof FinalizationRegistry === 'undefined')
@@ -1183,29 +1298,139 @@ export class Schedule {
1183
1298
  const ptr = this.__destroy_into_raw();
1184
1299
  wasm.__wbg_schedule_free(ptr, 0);
1185
1300
  }
1301
+ /**
1302
+ * @param {string} name
1303
+ * @param {number} interval_ms
1304
+ * @param {string} action_name
1305
+ * @param {Uint8Array} args
1306
+ * @param {number | null} [max_history]
1307
+ * @returns {Promise<void>}
1308
+ */
1309
+ cronEvery(name, interval_ms, action_name, args, max_history) {
1310
+ const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1311
+ const len0 = WASM_VECTOR_LEN;
1312
+ const ptr1 = passStringToWasm0(action_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1313
+ const len1 = WASM_VECTOR_LEN;
1314
+ const ptr2 = passArray8ToWasm0(args, wasm.__wbindgen_malloc);
1315
+ const len2 = WASM_VECTOR_LEN;
1316
+ const ret = wasm.schedule_cronEvery(this.__wbg_ptr, ptr0, len0, interval_ms, ptr1, len1, ptr2, len2, !isLikeNone(max_history), isLikeNone(max_history) ? 0 : max_history);
1317
+ return ret;
1318
+ }
1319
+ /**
1320
+ * @param {string} name
1321
+ * @returns {Promise<boolean>}
1322
+ */
1323
+ cronDelete(name) {
1324
+ const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1325
+ const len0 = WASM_VECTOR_LEN;
1326
+ const ret = wasm.schedule_cronDelete(this.__wbg_ptr, ptr0, len0);
1327
+ return ret;
1328
+ }
1329
+ /**
1330
+ * @param {string} name
1331
+ * @param {number | null} [limit]
1332
+ * @returns {Promise<any>}
1333
+ */
1334
+ cronHistory(name, limit) {
1335
+ const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1336
+ const len0 = WASM_VECTOR_LEN;
1337
+ const ret = wasm.schedule_cronHistory(this.__wbg_ptr, ptr0, len0, !isLikeNone(limit), isLikeNone(limit) ? 0 : limit);
1338
+ return ret;
1339
+ }
1186
1340
  /**
1187
1341
  * @param {number} timestamp_ms
1188
1342
  * @param {string} action_name
1189
1343
  * @param {Uint8Array} args
1344
+ * @returns {Promise<string>}
1190
1345
  */
1191
1346
  at(timestamp_ms, action_name, args) {
1192
1347
  const ptr0 = passStringToWasm0(action_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1193
1348
  const len0 = WASM_VECTOR_LEN;
1194
1349
  const ptr1 = passArray8ToWasm0(args, wasm.__wbindgen_malloc);
1195
1350
  const len1 = WASM_VECTOR_LEN;
1196
- wasm.schedule_at(this.__wbg_ptr, timestamp_ms, ptr0, len0, ptr1, len1);
1351
+ const ret = wasm.schedule_at(this.__wbg_ptr, timestamp_ms, ptr0, len0, ptr1, len1);
1352
+ return ret;
1353
+ }
1354
+ /**
1355
+ * @param {string} id
1356
+ * @returns {Promise<any>}
1357
+ */
1358
+ get(id) {
1359
+ const ptr0 = passStringToWasm0(id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1360
+ const len0 = WASM_VECTOR_LEN;
1361
+ const ret = wasm.schedule_get(this.__wbg_ptr, ptr0, len0);
1362
+ return ret;
1363
+ }
1364
+ /**
1365
+ * @returns {Promise<any>}
1366
+ */
1367
+ list() {
1368
+ const ret = wasm.schedule_list(this.__wbg_ptr);
1369
+ return ret;
1197
1370
  }
1198
1371
  /**
1199
1372
  * @param {number} duration_ms
1200
1373
  * @param {string} action_name
1201
1374
  * @param {Uint8Array} args
1375
+ * @returns {Promise<string>}
1202
1376
  */
1203
1377
  after(duration_ms, action_name, args) {
1204
1378
  const ptr0 = passStringToWasm0(action_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1205
1379
  const len0 = WASM_VECTOR_LEN;
1206
1380
  const ptr1 = passArray8ToWasm0(args, wasm.__wbindgen_malloc);
1207
1381
  const len1 = WASM_VECTOR_LEN;
1208
- wasm.schedule_after(this.__wbg_ptr, duration_ms, ptr0, len0, ptr1, len1);
1382
+ const ret = wasm.schedule_after(this.__wbg_ptr, duration_ms, ptr0, len0, ptr1, len1);
1383
+ return ret;
1384
+ }
1385
+ /**
1386
+ * @param {string} id
1387
+ * @returns {Promise<boolean>}
1388
+ */
1389
+ cancel(id) {
1390
+ const ptr0 = passStringToWasm0(id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1391
+ const len0 = WASM_VECTOR_LEN;
1392
+ const ret = wasm.schedule_cancel(this.__wbg_ptr, ptr0, len0);
1393
+ return ret;
1394
+ }
1395
+ /**
1396
+ * @param {string} name
1397
+ * @returns {Promise<any>}
1398
+ */
1399
+ cronGet(name) {
1400
+ const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1401
+ const len0 = WASM_VECTOR_LEN;
1402
+ const ret = wasm.schedule_cronGet(this.__wbg_ptr, ptr0, len0);
1403
+ return ret;
1404
+ }
1405
+ /**
1406
+ * @param {string} name
1407
+ * @param {string} expression
1408
+ * @param {string | null | undefined} timezone
1409
+ * @param {string} action_name
1410
+ * @param {Uint8Array} args
1411
+ * @param {number | null} [max_history]
1412
+ * @returns {Promise<void>}
1413
+ */
1414
+ cronSet(name, expression, timezone, action_name, args, max_history) {
1415
+ const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1416
+ const len0 = WASM_VECTOR_LEN;
1417
+ const ptr1 = passStringToWasm0(expression, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1418
+ const len1 = WASM_VECTOR_LEN;
1419
+ var ptr2 = isLikeNone(timezone) ? 0 : passStringToWasm0(timezone, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1420
+ var len2 = WASM_VECTOR_LEN;
1421
+ const ptr3 = passStringToWasm0(action_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1422
+ const len3 = WASM_VECTOR_LEN;
1423
+ const ptr4 = passArray8ToWasm0(args, wasm.__wbindgen_malloc);
1424
+ const len4 = WASM_VECTOR_LEN;
1425
+ const ret = wasm.schedule_cronSet(this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, ptr4, len4, !isLikeNone(max_history), isLikeNone(max_history) ? 0 : max_history);
1426
+ return ret;
1427
+ }
1428
+ /**
1429
+ * @returns {Promise<any>}
1430
+ */
1431
+ cronList() {
1432
+ const ret = wasm.schedule_cronList(this.__wbg_ptr);
1433
+ return ret;
1209
1434
  }
1210
1435
  }
1211
1436
 
@@ -1234,6 +1459,25 @@ export class SqliteDb {
1234
1459
  const ptr = this.__destroy_into_raw();
1235
1460
  wasm.__wbg_sqlitedb_free(ptr, 0);
1236
1461
  }
1462
+ /**
1463
+ * @param {any} statements
1464
+ * @returns {Promise<any>}
1465
+ */
1466
+ executeBatch(statements) {
1467
+ const ret = wasm.sqlitedb_executeBatch(this.__wbg_ptr, statements);
1468
+ return ret;
1469
+ }
1470
+ /**
1471
+ * @param {number | null} [timeout_ms]
1472
+ * @param {string | null} [name]
1473
+ * @returns {Promise<SqliteTransaction>}
1474
+ */
1475
+ beginTransaction(timeout_ms, name) {
1476
+ var ptr0 = isLikeNone(name) ? 0 : passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1477
+ var len0 = WASM_VECTOR_LEN;
1478
+ const ret = wasm.sqlitedb_beginTransaction(this.__wbg_ptr, !isLikeNone(timeout_ms), isLikeNone(timeout_ms) ? 0 : timeout_ms, ptr0, len0);
1479
+ return ret;
1480
+ }
1237
1481
  /**
1238
1482
  * @param {string} sql
1239
1483
  * @param {any} params
@@ -1286,6 +1530,68 @@ export class SqliteDb {
1286
1530
  }
1287
1531
  }
1288
1532
 
1533
+ const SqliteTransactionFinalization = (typeof FinalizationRegistry === 'undefined')
1534
+ ? { register: () => {}, unregister: () => {} }
1535
+ : new FinalizationRegistry(ptr => wasm.__wbg_sqlitetransaction_free(ptr >>> 0, 1));
1536
+
1537
+ export class SqliteTransaction {
1538
+
1539
+ static __wrap(ptr) {
1540
+ ptr = ptr >>> 0;
1541
+ const obj = Object.create(SqliteTransaction.prototype);
1542
+ obj.__wbg_ptr = ptr;
1543
+ SqliteTransactionFinalization.register(obj, obj.__wbg_ptr, obj);
1544
+ return obj;
1545
+ }
1546
+
1547
+ __destroy_into_raw() {
1548
+ const ptr = this.__wbg_ptr;
1549
+ this.__wbg_ptr = 0;
1550
+ SqliteTransactionFinalization.unregister(this);
1551
+ return ptr;
1552
+ }
1553
+
1554
+ free() {
1555
+ const ptr = this.__destroy_into_raw();
1556
+ wasm.__wbg_sqlitetransaction_free(ptr, 0);
1557
+ }
1558
+ /**
1559
+ * @param {string} sql
1560
+ * @returns {Promise<any>}
1561
+ */
1562
+ exec(sql) {
1563
+ const ptr0 = passStringToWasm0(sql, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1564
+ const len0 = WASM_VECTOR_LEN;
1565
+ const ret = wasm.sqlitetransaction_exec(this.__wbg_ptr, ptr0, len0);
1566
+ return ret;
1567
+ }
1568
+ /**
1569
+ * @returns {Promise<void>}
1570
+ */
1571
+ commit() {
1572
+ const ret = wasm.sqlitetransaction_commit(this.__wbg_ptr);
1573
+ return ret;
1574
+ }
1575
+ /**
1576
+ * @param {string} sql
1577
+ * @param {any} params
1578
+ * @returns {Promise<any>}
1579
+ */
1580
+ execute(sql, params) {
1581
+ const ptr0 = passStringToWasm0(sql, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1582
+ const len0 = WASM_VECTOR_LEN;
1583
+ const ret = wasm.sqlitetransaction_execute(this.__wbg_ptr, ptr0, len0, params);
1584
+ return ret;
1585
+ }
1586
+ /**
1587
+ * @returns {Promise<void>}
1588
+ */
1589
+ rollback() {
1590
+ const ret = wasm.sqlitetransaction_rollback(this.__wbg_ptr);
1591
+ return ret;
1592
+ }
1593
+ }
1594
+
1289
1595
  const WebSocketHandleFinalization = (typeof FinalizationRegistry === 'undefined')
1290
1596
  ? { register: () => {}, unregister: () => {} }
1291
1597
  : new FinalizationRegistry(ptr => wasm.__wbg_websockethandle_free(ptr >>> 0, 1));
@@ -1311,6 +1617,17 @@ export class WebSocketHandle {
1311
1617
  const ptr = this.__destroy_into_raw();
1312
1618
  wasm.__wbg_websockethandle_free(ptr, 0);
1313
1619
  }
1620
+ /**
1621
+ * @param {number | null} [code]
1622
+ * @param {string | null} [reason]
1623
+ * @returns {Promise<void>}
1624
+ */
1625
+ close(code, reason) {
1626
+ var ptr0 = isLikeNone(reason) ? 0 : passStringToWasm0(reason, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1627
+ var len0 = WASM_VECTOR_LEN;
1628
+ const ret = wasm.websockethandle_close(this.__wbg_ptr, isLikeNone(code) ? 0xFFFFFF : code, ptr0, len0);
1629
+ return ret;
1630
+ }
1314
1631
  /**
1315
1632
  * @param {Function} callback
1316
1633
  */
@@ -1329,17 +1646,6 @@ export class WebSocketHandle {
1329
1646
  throw takeFromExternrefTable0(ret[0]);
1330
1647
  }
1331
1648
  }
1332
- /**
1333
- * @param {number | null} [code]
1334
- * @param {string | null} [reason]
1335
- * @returns {Promise<void>}
1336
- */
1337
- close(code, reason) {
1338
- var ptr0 = isLikeNone(reason) ? 0 : passStringToWasm0(reason, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1339
- var len0 = WASM_VECTOR_LEN;
1340
- const ret = wasm.websockethandle_close(this.__wbg_ptr, isLikeNone(code) ? 0xFFFFFF : code, ptr0, len0);
1341
- return ret;
1342
- }
1343
1649
  }
1344
1650
 
1345
1651
  async function __wbg_load(module, imports) {
@@ -1387,6 +1693,10 @@ function __wbg_get_imports() {
1387
1693
  const ret = ActorContext.__wrap(arg0);
1388
1694
  return ret;
1389
1695
  };
1696
+ imports.wbg.__wbg_actorstatetransaction_new = function(arg0) {
1697
+ const ret = ActorStateTransaction.__wrap(arg0);
1698
+ return ret;
1699
+ };
1390
1700
  imports.wbg.__wbg_buffer_09165b52af8c5237 = function(arg0) {
1391
1701
  const ret = arg0.buffer;
1392
1702
  return ret;
@@ -1395,6 +1705,10 @@ function __wbg_get_imports() {
1395
1705
  const ret = arg0.buffer;
1396
1706
  return ret;
1397
1707
  };
1708
+ imports.wbg.__wbg_bufferedAmount_a482960ac51b25e8 = function(arg0) {
1709
+ const ret = arg0.bufferedAmount;
1710
+ return ret;
1711
+ };
1398
1712
  imports.wbg.__wbg_call_672a4d21634d4a24 = function() { return handleError(function (arg0, arg1) {
1399
1713
  const ret = arg0.call(arg1);
1400
1714
  return ret;
@@ -1407,6 +1721,10 @@ function __wbg_get_imports() {
1407
1721
  const ret = arg0.call(arg1, arg2, arg3);
1408
1722
  return ret;
1409
1723
  }, arguments) };
1724
+ imports.wbg.__wbg_cancellationtoken_new = function(arg0) {
1725
+ const ret = CancellationToken.__wrap(arg0);
1726
+ return ret;
1727
+ };
1410
1728
  imports.wbg.__wbg_close_2893b7d056a0627d = function() { return handleError(function (arg0) {
1411
1729
  arg0.close();
1412
1730
  }, arguments) };
@@ -1448,7 +1766,7 @@ function __wbg_get_imports() {
1448
1766
  wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
1449
1767
  }
1450
1768
  };
1451
- imports.wbg.__wbg_getRandomValues_38097e921c2494c3 = function() { return handleError(function (arg0, arg1) {
1769
+ imports.wbg.__wbg_getRandomValues_430b4ece0366b997 = function() { return handleError(function (arg0, arg1) {
1452
1770
  globalThis.crypto.getRandomValues(getArrayU8FromWasm0(arg0, arg1));
1453
1771
  }, arguments) };
1454
1772
  imports.wbg.__wbg_getRandomValues_b8f5dbd5f3995a9e = function() { return handleError(function (arg0, arg1) {
@@ -1562,7 +1880,7 @@ function __wbg_get_imports() {
1562
1880
  const a = state0.a;
1563
1881
  state0.a = 0;
1564
1882
  try {
1565
- return __wbg_adapter_225(a, state0.b, arg0, arg1);
1883
+ return __wbg_adapter_297(a, state0.b, arg0, arg1);
1566
1884
  } finally {
1567
1885
  state0.a = a;
1568
1886
  }
@@ -1577,6 +1895,10 @@ function __wbg_get_imports() {
1577
1895
  const ret = new Object();
1578
1896
  return ret;
1579
1897
  };
1898
+ imports.wbg.__wbg_new_5e0be73521bc8c17 = function() {
1899
+ const ret = new Map();
1900
+ return ret;
1901
+ };
1580
1902
  imports.wbg.__wbg_new_78feb108b6472713 = function() {
1581
1903
  const ret = new Array();
1582
1904
  return ret;
@@ -1686,6 +2008,10 @@ function __wbg_get_imports() {
1686
2008
  imports.wbg.__wbg_set_65595bdd868b3009 = function(arg0, arg1, arg2) {
1687
2009
  arg0.set(arg1, arg2 >>> 0);
1688
2010
  };
2011
+ imports.wbg.__wbg_set_8fc6bf8a5b1071d1 = function(arg0, arg1, arg2) {
2012
+ const ret = arg0.set(arg1, arg2);
2013
+ return ret;
2014
+ };
1689
2015
  imports.wbg.__wbg_set_bb8cecf6a62b9f46 = function() { return handleError(function (arg0, arg1, arg2) {
1690
2016
  const ret = Reflect.set(arg0, arg1, arg2);
1691
2017
  return ret;
@@ -1705,6 +2031,10 @@ function __wbg_get_imports() {
1705
2031
  imports.wbg.__wbg_setonopen_2da654e1f39745d5 = function(arg0, arg1) {
1706
2032
  arg0.onopen = arg1;
1707
2033
  };
2034
+ imports.wbg.__wbg_sqlitetransaction_new = function(arg0) {
2035
+ const ret = SqliteTransaction.__wrap(arg0);
2036
+ return ret;
2037
+ };
1708
2038
  imports.wbg.__wbg_stack_0ed75d68575b0f3c = function(arg0, arg1) {
1709
2039
  const ret = arg1.stack;
1710
2040
  const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
@@ -1760,6 +2090,14 @@ function __wbg_get_imports() {
1760
2090
  const ret = +arg0;
1761
2091
  return ret;
1762
2092
  };
2093
+ imports.wbg.__wbindgen_bigint_from_i64 = function(arg0) {
2094
+ const ret = arg0;
2095
+ return ret;
2096
+ };
2097
+ imports.wbg.__wbindgen_bigint_from_u64 = function(arg0) {
2098
+ const ret = BigInt.asUintN(64, arg0);
2099
+ return ret;
2100
+ };
1763
2101
  imports.wbg.__wbindgen_boolean_get = function(arg0) {
1764
2102
  const v = arg0;
1765
2103
  const ret = typeof(v) === 'boolean' ? (v ? 1 : 0) : 2;
@@ -1774,24 +2112,24 @@ function __wbg_get_imports() {
1774
2112
  const ret = false;
1775
2113
  return ret;
1776
2114
  };
1777
- imports.wbg.__wbindgen_closure_wrapper3776 = function(arg0, arg1, arg2) {
1778
- const ret = makeMutClosure(arg0, arg1, 1601, __wbg_adapter_46);
2115
+ imports.wbg.__wbindgen_closure_wrapper4959 = function(arg0, arg1, arg2) {
2116
+ const ret = makeMutClosure(arg0, arg1, 1988, __wbg_adapter_50);
1779
2117
  return ret;
1780
2118
  };
1781
- imports.wbg.__wbindgen_closure_wrapper3778 = function(arg0, arg1, arg2) {
1782
- const ret = makeMutClosure(arg0, arg1, 1601, __wbg_adapter_46);
2119
+ imports.wbg.__wbindgen_closure_wrapper4961 = function(arg0, arg1, arg2) {
2120
+ const ret = makeMutClosure(arg0, arg1, 1988, __wbg_adapter_50);
1783
2121
  return ret;
1784
2122
  };
1785
- imports.wbg.__wbindgen_closure_wrapper3780 = function(arg0, arg1, arg2) {
1786
- const ret = makeMutClosure(arg0, arg1, 1601, __wbg_adapter_46);
2123
+ imports.wbg.__wbindgen_closure_wrapper4963 = function(arg0, arg1, arg2) {
2124
+ const ret = makeMutClosure(arg0, arg1, 1988, __wbg_adapter_50);
1787
2125
  return ret;
1788
2126
  };
1789
- imports.wbg.__wbindgen_closure_wrapper3782 = function(arg0, arg1, arg2) {
1790
- const ret = makeMutClosure(arg0, arg1, 1601, __wbg_adapter_46);
2127
+ imports.wbg.__wbindgen_closure_wrapper4965 = function(arg0, arg1, arg2) {
2128
+ const ret = makeMutClosure(arg0, arg1, 1988, __wbg_adapter_50);
1791
2129
  return ret;
1792
2130
  };
1793
- imports.wbg.__wbindgen_closure_wrapper4382 = function(arg0, arg1, arg2) {
1794
- const ret = makeMutClosure(arg0, arg1, 1805, __wbg_adapter_55);
2131
+ imports.wbg.__wbindgen_closure_wrapper5612 = function(arg0, arg1, arg2) {
2132
+ const ret = makeMutClosure(arg0, arg1, 2387, __wbg_adapter_59);
1795
2133
  return ret;
1796
2134
  };
1797
2135
  imports.wbg.__wbindgen_debug_string = function(arg0, arg1) {
Binary file
@@ -3,17 +3,20 @@
3
3
  export const memory: WebAssembly.Memory;
4
4
  export const __wbg_actorcontext_free: (a: number, b: number) => void;
5
5
  export const __wbg_actorfactory_free: (a: number, b: number) => void;
6
+ export const __wbg_actorstatetransaction_free: (a: number, b: number) => void;
6
7
  export const __wbg_cancellationtoken_free: (a: number, b: number) => void;
7
8
  export const __wbg_connhandle_free: (a: number, b: number) => void;
8
9
  export const __wbg_coreregistry_free: (a: number, b: number) => void;
9
10
  export const __wbg_kv_free: (a: number, b: number) => void;
10
11
  export const __wbg_queuemessage_free: (a: number, b: number) => void;
11
12
  export const __wbg_sqlitedb_free: (a: number, b: number) => void;
13
+ export const __wbg_sqlitetransaction_free: (a: number, b: number) => void;
12
14
  export const __wbg_websockethandle_free: (a: number, b: number) => void;
13
15
  export const actorcontext_abortSignal: (a: number) => [number, number, number];
14
16
  export const actorcontext_actorId: (a: number) => [number, number];
15
17
  export const actorcontext_beginKeepAwake: (a: number) => number;
16
18
  export const actorcontext_beginOnStateChange: (a: number) => void;
19
+ export const actorcontext_beginStateTransaction: (a: number, b: number, c: number) => any;
17
20
  export const actorcontext_beginWebsocketCallback: (a: number) => number;
18
21
  export const actorcontext_broadcast: (a: number, b: number, c: number, d: number, e: number) => void;
19
22
  export const actorcontext_connectConn: (a: number, b: number, c: number, d: any) => any;
@@ -33,18 +36,24 @@ export const actorcontext_region: (a: number) => [number, number];
33
36
  export const actorcontext_registerTask: (a: number, b: any) => void;
34
37
  export const actorcontext_requestSave: (a: number, b: any) => void;
35
38
  export const actorcontext_requestSaveAndWait: (a: number, b: any) => any;
36
- export const actorcontext_restartRunHandler: (a: number) => void;
39
+ export const actorcontext_restartRunHandler: (a: number) => [number, number];
37
40
  export const actorcontext_runtimeState: (a: number) => any;
38
41
  export const actorcontext_saveState: (a: number, b: any) => any;
42
+ export const actorcontext_saveStateAndWorkflowBatch: (a: number, b: any) => any;
39
43
  export const actorcontext_setAlarm: (a: number, b: number, c: number) => [number, number];
44
+ export const actorcontext_setRunWakeAt: (a: number, b: number, c: number) => any;
40
45
  export const actorcontext_sleep: (a: number) => [number, number];
41
46
  export const actorcontext_sql: (a: number) => number;
42
47
  export const actorcontext_state: (a: number) => [number, number];
43
48
  export const actorcontext_takePendingHibernationChanges: (a: number) => any;
44
49
  export const actorcontext_verifyInspectorAuth: (a: number, b: number, c: number) => any;
45
50
  export const actorcontext_waitForTrackedShutdownWork: (a: number) => any;
51
+ export const actorcontext_waitForTrackedShutdownWorkUnbounded: (a: number) => any;
46
52
  export const actorcontext_waitUntil: (a: number, b: any) => void;
47
53
  export const actorfactory_new: (a: any, b: any) => [number, number, number];
54
+ export const actorstatetransaction_commit: (a: number, b: any) => any;
55
+ export const actorstatetransaction_execute: (a: number, b: number, c: number, d: any) => any;
56
+ export const actorstatetransaction_rollback: (a: number) => any;
48
57
  export const awaitPromise: (a: any) => any;
49
58
  export const bridgeRivetErrorPrefix: () => [number, number];
50
59
  export const cancellationtoken_aborted: (a: number) => number;
@@ -72,10 +81,12 @@ export const kv_get: (a: number, b: number, c: number) => any;
72
81
  export const kv_listPrefix: (a: number, b: number, c: number, d: any) => any;
73
82
  export const kv_listRange: (a: number, b: number, c: number, d: number, e: number, f: any) => any;
74
83
  export const kv_put: (a: number, b: number, c: number, d: number, e: number) => any;
84
+ export const queue_completePersisted: (a: number, b: bigint, c: number, d: number, e: number, f: number) => any;
75
85
  export const queue_enqueueAndWait: (a: number, b: number, c: number, d: number, e: number, f: any, g: number) => any;
76
86
  export const queue_inspectMessages: (a: number) => any;
77
87
  export const queue_maxSize: (a: number) => number;
78
88
  export const queue_nextBatch: (a: number, b: any, c: number) => any;
89
+ export const queue_reset: (a: number) => any;
79
90
  export const queue_send: (a: number, b: number, c: number, d: number, e: number) => any;
80
91
  export const queue_tryNextBatch: (a: number, b: any) => [number, number, number];
81
92
  export const queue_waitForNames: (a: number, b: any, c: any, d: number) => any;
@@ -87,13 +98,28 @@ export const queuemessage_id: (a: number) => bigint;
87
98
  export const queuemessage_isCompletable: (a: number) => number;
88
99
  export const queuemessage_name: (a: number) => [number, number];
89
100
  export const roundTripBytes: (a: number, b: number) => [number, number];
90
- export const schedule_after: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
91
- export const schedule_at: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
101
+ export const schedule_after: (a: number, b: number, c: number, d: number, e: number, f: number) => any;
102
+ export const schedule_at: (a: number, b: number, c: number, d: number, e: number, f: number) => any;
103
+ export const schedule_cancel: (a: number, b: number, c: number) => any;
104
+ export const schedule_cronDelete: (a: number, b: number, c: number) => any;
105
+ export const schedule_cronEvery: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number) => any;
106
+ export const schedule_cronGet: (a: number, b: number, c: number) => any;
107
+ export const schedule_cronHistory: (a: number, b: number, c: number, d: number, e: number) => any;
108
+ export const schedule_cronList: (a: number) => any;
109
+ export const schedule_cronSet: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number, m: number) => any;
110
+ export const schedule_get: (a: number, b: number, c: number) => any;
111
+ export const schedule_list: (a: number) => any;
112
+ export const sqlitedb_beginTransaction: (a: number, b: number, c: number, d: number, e: number) => any;
92
113
  export const sqlitedb_close: (a: number) => any;
93
114
  export const sqlitedb_exec: (a: number, b: number, c: number) => any;
94
115
  export const sqlitedb_execute: (a: number, b: number, c: number, d: any) => any;
116
+ export const sqlitedb_executeBatch: (a: number, b: any) => any;
95
117
  export const sqlitedb_query: (a: number, b: number, c: number, d: any) => any;
96
118
  export const sqlitedb_run: (a: number, b: number, c: number, d: any) => any;
119
+ export const sqlitetransaction_commit: (a: number) => any;
120
+ export const sqlitetransaction_exec: (a: number, b: number, c: number) => any;
121
+ export const sqlitetransaction_execute: (a: number, b: number, c: number, d: any) => any;
122
+ export const sqlitetransaction_rollback: (a: number) => any;
97
123
  export const uint8ArrayFromBytes: (a: number, b: number) => any;
98
124
  export const websockethandle_close: (a: number, b: number, c: number, d: number) => any;
99
125
  export const websockethandle_send: (a: number, b: number, c: number, d: number) => [number, number];
@@ -111,7 +137,7 @@ export const __wbindgen_export_4: WebAssembly.Table;
111
137
  export const __wbindgen_free: (a: number, b: number, c: number) => void;
112
138
  export const __wbindgen_export_6: WebAssembly.Table;
113
139
  export const __externref_table_dealloc: (a: number) => void;
114
- export const closure1600_externref_shim: (a: number, b: number, c: any) => void;
115
- export const closure1804_externref_shim: (a: number, b: number, c: any) => void;
116
- export const closure2027_externref_shim: (a: number, b: number, c: any, d: any) => void;
140
+ export const closure1987_externref_shim: (a: number, b: number, c: any) => void;
141
+ export const closure2386_externref_shim: (a: number, b: number, c: any) => void;
142
+ export const closure2623_externref_shim: (a: number, b: number, c: any, d: any) => void;
117
143
  export const __wbindgen_start: () => void;