@rivetkit/rivetkit-wasm 2.3.11-rc.8 → 2.3.11
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/index.d.ts +2 -212
- package/package.json +2 -2
- package/pkg/package.json +1 -1
- package/pkg/rivetkit_wasm.d.ts +23 -6
- package/pkg/rivetkit_wasm.js +111 -18
- package/pkg/rivetkit_wasm_bg.wasm +0 -0
- package/pkg/rivetkit_wasm_bg.wasm.d.ts +12 -5
package/index.d.ts
CHANGED
|
@@ -1,212 +1,2 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
3
|
-
export function uint8ArrayFromBytes(bytes: Uint8Array): Uint8Array;
|
|
4
|
-
export function bridgeRivetErrorPrefix(): string;
|
|
5
|
-
export function roundTripBytes(bytes: Uint8Array): Uint8Array;
|
|
6
|
-
|
|
7
|
-
export class ActorContext {
|
|
8
|
-
free(): void;
|
|
9
|
-
keepAwake(promise: Promise<any>): void;
|
|
10
|
-
saveState(payload: any): Promise<void>;
|
|
11
|
-
saveStateAndWorkflowBatch(
|
|
12
|
-
writes: Array<{ key: Uint8Array; value: Uint8Array }>,
|
|
13
|
-
): Promise<void>;
|
|
14
|
-
waitUntil(promise: Promise<any>): void;
|
|
15
|
-
abortSignal(): any;
|
|
16
|
-
connectConn(params: Uint8Array, request: any): Promise<ConnHandle>;
|
|
17
|
-
requestSave(opts: any): void;
|
|
18
|
-
registerTask(promise: Promise<any>): void;
|
|
19
|
-
runtimeState(): any;
|
|
20
|
-
endKeepAwake(region_id: number): void;
|
|
21
|
-
beginKeepAwake(): number;
|
|
22
|
-
inspectorSnapshot(): object;
|
|
23
|
-
endOnStateChange(): void;
|
|
24
|
-
restartRunHandler(): void;
|
|
25
|
-
beginOnStateChange(): void;
|
|
26
|
-
requestSaveAndWait(opts: any): Promise<void>;
|
|
27
|
-
verifyInspectorAuth(bearer_token?: string | null): Promise<void>;
|
|
28
|
-
endWebsocketCallback(region_id: number): void;
|
|
29
|
-
beginWebsocketCallback(): number;
|
|
30
|
-
dirtyHibernatableConns(): Array<any>;
|
|
31
|
-
kv(): Kv;
|
|
32
|
-
waitForTrackedShutdownWork(): Promise<boolean>;
|
|
33
|
-
takePendingHibernationChanges(): Array<any>;
|
|
34
|
-
key(): any;
|
|
35
|
-
constructor();
|
|
36
|
-
sql(): SqliteDb;
|
|
37
|
-
name(): string;
|
|
38
|
-
conns(): Array<any>;
|
|
39
|
-
queue(): Queue;
|
|
40
|
-
sleep(): void;
|
|
41
|
-
state(): Uint8Array;
|
|
42
|
-
region(): string;
|
|
43
|
-
destroy(): void;
|
|
44
|
-
actorId(): string;
|
|
45
|
-
schedule(): Schedule;
|
|
46
|
-
broadcast(name: string, args: Uint8Array): void;
|
|
47
|
-
setAlarm(timestamp_ms?: number | null): void;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
export class ActorFactory {
|
|
51
|
-
free(): void;
|
|
52
|
-
constructor(callbacks: any, config: any);
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
export class CancellationToken {
|
|
56
|
-
free(): void;
|
|
57
|
-
onCancelled(callback: Function): void;
|
|
58
|
-
constructor();
|
|
59
|
-
cancel(): void;
|
|
60
|
-
aborted(): boolean;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
export class ConnHandle {
|
|
64
|
-
private constructor();
|
|
65
|
-
free(): void;
|
|
66
|
-
disconnect(reason?: string | null): Promise<void>;
|
|
67
|
-
isHibernatable(): boolean;
|
|
68
|
-
id(): string;
|
|
69
|
-
send(name: string, args: Uint8Array): void;
|
|
70
|
-
state(): Uint8Array;
|
|
71
|
-
params(): Uint8Array;
|
|
72
|
-
setState(state: Uint8Array): void;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
export class CoreRegistry {
|
|
76
|
-
free(): void;
|
|
77
|
-
handleServerlessRequest(
|
|
78
|
-
req: any,
|
|
79
|
-
on_stream_event: Function,
|
|
80
|
-
cancel_token: CancellationToken,
|
|
81
|
-
config: any,
|
|
82
|
-
): Promise<any>;
|
|
83
|
-
constructor();
|
|
84
|
-
serve(config: any): Promise<void>;
|
|
85
|
-
register(name: string, factory: ActorFactory): void;
|
|
86
|
-
shutdown(): Promise<void>;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
export class Kv {
|
|
90
|
-
private constructor();
|
|
91
|
-
free(): void;
|
|
92
|
-
delete(key: Uint8Array): Promise<void>;
|
|
93
|
-
listRange(start: Uint8Array, end: Uint8Array, options: any): Promise<any>;
|
|
94
|
-
listPrefix(prefix: Uint8Array, options: any): Promise<any>;
|
|
95
|
-
batchDelete(keys: Array<any>): Promise<void>;
|
|
96
|
-
deleteRange(start: Uint8Array, end: Uint8Array): Promise<void>;
|
|
97
|
-
get(key: Uint8Array): Promise<any>;
|
|
98
|
-
put(key: Uint8Array, value: Uint8Array): Promise<void>;
|
|
99
|
-
batchGet(keys: Array<any>): Promise<any>;
|
|
100
|
-
batchPut(entries: Array<any>): Promise<void>;
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
export class Queue {
|
|
104
|
-
private constructor();
|
|
105
|
-
free(): void;
|
|
106
|
-
nextBatch(
|
|
107
|
-
options: any,
|
|
108
|
-
signal?: CancellationToken | null,
|
|
109
|
-
): Promise<Array<any>>;
|
|
110
|
-
tryNextBatch(options: any): Array<any>;
|
|
111
|
-
waitForNames(
|
|
112
|
-
names: any,
|
|
113
|
-
options: any,
|
|
114
|
-
signal?: CancellationToken | null,
|
|
115
|
-
): Promise<QueueMessage>;
|
|
116
|
-
enqueueAndWait(
|
|
117
|
-
name: string,
|
|
118
|
-
body: Uint8Array,
|
|
119
|
-
options: any,
|
|
120
|
-
signal?: CancellationToken | null,
|
|
121
|
-
): Promise<Uint8Array | undefined>;
|
|
122
|
-
inspectMessages(): Promise<Array<any>>;
|
|
123
|
-
waitForNamesAvailable(names: any, options: any): Promise<void>;
|
|
124
|
-
send(name: string, body: Uint8Array): Promise<QueueMessage>;
|
|
125
|
-
maxSize(): number;
|
|
126
|
-
reset(): Promise<void>;
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
export class QueueMessage {
|
|
130
|
-
private constructor();
|
|
131
|
-
free(): void;
|
|
132
|
-
createdAt(): number;
|
|
133
|
-
isCompletable(): boolean;
|
|
134
|
-
id(): bigint;
|
|
135
|
-
body(): Uint8Array;
|
|
136
|
-
name(): string;
|
|
137
|
-
complete(response: any): Promise<void>;
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
export class Schedule {
|
|
141
|
-
private constructor();
|
|
142
|
-
free(): void;
|
|
143
|
-
after(duration_ms: number, action_name: string, args: Uint8Array): Promise<string>;
|
|
144
|
-
at(timestamp_ms: number, action_name: string, args: Uint8Array): Promise<string>;
|
|
145
|
-
cancel(id: string): Promise<boolean>;
|
|
146
|
-
get(id: string): Promise<any>;
|
|
147
|
-
list(): Promise<any>;
|
|
148
|
-
cronSet(
|
|
149
|
-
name: string,
|
|
150
|
-
expression: string,
|
|
151
|
-
timezone: string | null | undefined,
|
|
152
|
-
action_name: string,
|
|
153
|
-
args: Uint8Array,
|
|
154
|
-
max_history?: number | null,
|
|
155
|
-
): Promise<void>;
|
|
156
|
-
cronEvery(
|
|
157
|
-
name: string,
|
|
158
|
-
interval_ms: number,
|
|
159
|
-
action_name: string,
|
|
160
|
-
args: Uint8Array,
|
|
161
|
-
max_history?: number | null,
|
|
162
|
-
): Promise<void>;
|
|
163
|
-
cronGet(name: string): Promise<any>;
|
|
164
|
-
cronList(): Promise<any>;
|
|
165
|
-
cronDelete(name: string): Promise<boolean>;
|
|
166
|
-
cronHistory(name: string, limit?: number | null): Promise<any>;
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
export class SqliteDb {
|
|
170
|
-
private constructor();
|
|
171
|
-
free(): void;
|
|
172
|
-
run(sql: string, params: any): Promise<any>;
|
|
173
|
-
exec(sql: string): Promise<any>;
|
|
174
|
-
close(): Promise<void>;
|
|
175
|
-
query(sql: string, params: any): Promise<any>;
|
|
176
|
-
execute(sql: string, params: any): Promise<any>;
|
|
177
|
-
executeBatch(statements: Array<any>): Promise<Array<any>>;
|
|
178
|
-
beginTransaction(timeout_ms?: number | null): Promise<SqliteTransaction>;
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
export class SqliteTransaction {
|
|
182
|
-
private constructor();
|
|
183
|
-
free(): void;
|
|
184
|
-
exec(sql: string): Promise<any>;
|
|
185
|
-
execute(sql: string, params: any): Promise<any>;
|
|
186
|
-
commit(): Promise<void>;
|
|
187
|
-
rollback(): Promise<void>;
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
export class WebSocketHandle {
|
|
191
|
-
private constructor();
|
|
192
|
-
free(): void;
|
|
193
|
-
setEventCallback(callback: Function): void;
|
|
194
|
-
send(data: Uint8Array, binary: boolean): void;
|
|
195
|
-
close(code?: number | null, reason?: string | null): Promise<void>;
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
export type InitInput =
|
|
199
|
-
| RequestInfo
|
|
200
|
-
| URL
|
|
201
|
-
| Response
|
|
202
|
-
| BufferSource
|
|
203
|
-
| WebAssembly.Module;
|
|
204
|
-
export type SyncInitInput = BufferSource | WebAssembly.Module;
|
|
205
|
-
export interface InitOutput {
|
|
206
|
-
readonly memory: WebAssembly.Memory;
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
declare function init(
|
|
210
|
-
module_or_path?: InitInput | Promise<InitInput>,
|
|
211
|
-
): Promise<InitOutput>;
|
|
212
|
-
export default init;
|
|
1
|
+
export * from "./pkg/rivetkit_wasm.js";
|
|
2
|
+
export { default } from "./pkg/rivetkit_wasm.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rivetkit/rivetkit-wasm",
|
|
3
|
-
"version": "2.3.11
|
|
3
|
+
"version": "2.3.11",
|
|
4
4
|
"description": "WebAssembly bindings for RivetKit core on edge JavaScript runtimes",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"build:cloudflare": "node scripts/build.mjs --target bundler --out-dir pkg-cloudflare",
|
|
33
33
|
"build:deno": "node scripts/build.mjs --target web --out-dir pkg-deno",
|
|
34
34
|
"check:package": "node scripts/check-package.mjs",
|
|
35
|
-
"check-types": "tsc --noEmit",
|
|
35
|
+
"check-types": "pnpm run build && tsc --noEmit",
|
|
36
36
|
"check:wasm": "cargo check -p rivetkit-wasm --target wasm32-unknown-unknown",
|
|
37
37
|
"prepack": "node scripts/build.mjs"
|
|
38
38
|
},
|
package/pkg/package.json
CHANGED
package/pkg/rivetkit_wasm.d.ts
CHANGED
|
@@ -9,8 +9,10 @@ export class ActorContext {
|
|
|
9
9
|
free(): void;
|
|
10
10
|
saveState(payload: any): Promise<void>;
|
|
11
11
|
connectConn(params: Uint8Array, request: any): Promise<ConnHandle>;
|
|
12
|
+
setRunWakeAt(timestamp_ms?: number | null): Promise<void>;
|
|
12
13
|
requestSaveAndWait(opts: any): Promise<void>;
|
|
13
14
|
verifyInspectorAuth(bearer_token?: string | null): Promise<void>;
|
|
15
|
+
beginStateTransaction(timeout_ms?: number | null): Promise<ActorStateTransaction>;
|
|
14
16
|
saveStateAndWorkflowBatch(writes: any): Promise<void>;
|
|
15
17
|
waitForTrackedShutdownWork(): Promise<boolean>;
|
|
16
18
|
waitForTrackedShutdownWorkUnbounded(): Promise<void>;
|
|
@@ -50,6 +52,13 @@ export class ActorFactory {
|
|
|
50
52
|
free(): void;
|
|
51
53
|
constructor(callbacks: any, config: any);
|
|
52
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
|
+
}
|
|
53
62
|
export class CancellationToken {
|
|
54
63
|
free(): void;
|
|
55
64
|
onCancelled(callback: Function): void;
|
|
@@ -96,6 +105,7 @@ export class Queue {
|
|
|
96
105
|
waitForNames(names: any, options: any, signal?: CancellationToken | null): Promise<QueueMessage>;
|
|
97
106
|
enqueueAndWait(name: string, body: Uint8Array, options: any, signal?: CancellationToken | null): Promise<Uint8Array | undefined>;
|
|
98
107
|
inspectMessages(): Promise<Array<any>>;
|
|
108
|
+
completePersisted(message_id: bigint, expected_name: string, response?: Uint8Array | null): Promise<boolean>;
|
|
99
109
|
waitForNamesAvailable(names: any, options: any): Promise<void>;
|
|
100
110
|
send(name: string, body: Uint8Array): Promise<QueueMessage>;
|
|
101
111
|
reset(): Promise<void>;
|
|
@@ -131,7 +141,7 @@ export class SqliteDb {
|
|
|
131
141
|
private constructor();
|
|
132
142
|
free(): void;
|
|
133
143
|
executeBatch(statements: any): Promise<any>;
|
|
134
|
-
beginTransaction(timeout_ms?: number | null): Promise<SqliteTransaction>;
|
|
144
|
+
beginTransaction(timeout_ms?: number | null, name?: string | null): Promise<SqliteTransaction>;
|
|
135
145
|
run(sql: string, params: any): Promise<any>;
|
|
136
146
|
exec(sql: string): Promise<any>;
|
|
137
147
|
close(): Promise<void>;
|
|
@@ -160,6 +170,7 @@ export interface InitOutput {
|
|
|
160
170
|
readonly memory: WebAssembly.Memory;
|
|
161
171
|
readonly __wbg_actorcontext_free: (a: number, b: number) => void;
|
|
162
172
|
readonly __wbg_actorfactory_free: (a: number, b: number) => void;
|
|
173
|
+
readonly __wbg_actorstatetransaction_free: (a: number, b: number) => void;
|
|
163
174
|
readonly __wbg_cancellationtoken_free: (a: number, b: number) => void;
|
|
164
175
|
readonly __wbg_connhandle_free: (a: number, b: number) => void;
|
|
165
176
|
readonly __wbg_coreregistry_free: (a: number, b: number) => void;
|
|
@@ -172,6 +183,7 @@ export interface InitOutput {
|
|
|
172
183
|
readonly actorcontext_actorId: (a: number) => [number, number];
|
|
173
184
|
readonly actorcontext_beginKeepAwake: (a: number) => number;
|
|
174
185
|
readonly actorcontext_beginOnStateChange: (a: number) => void;
|
|
186
|
+
readonly actorcontext_beginStateTransaction: (a: number, b: number, c: number) => any;
|
|
175
187
|
readonly actorcontext_beginWebsocketCallback: (a: number) => number;
|
|
176
188
|
readonly actorcontext_broadcast: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
177
189
|
readonly actorcontext_connectConn: (a: number, b: number, c: number, d: any) => any;
|
|
@@ -191,11 +203,12 @@ export interface InitOutput {
|
|
|
191
203
|
readonly actorcontext_registerTask: (a: number, b: any) => void;
|
|
192
204
|
readonly actorcontext_requestSave: (a: number, b: any) => void;
|
|
193
205
|
readonly actorcontext_requestSaveAndWait: (a: number, b: any) => any;
|
|
194
|
-
readonly actorcontext_restartRunHandler: (a: number) =>
|
|
206
|
+
readonly actorcontext_restartRunHandler: (a: number) => [number, number];
|
|
195
207
|
readonly actorcontext_runtimeState: (a: number) => any;
|
|
196
208
|
readonly actorcontext_saveState: (a: number, b: any) => any;
|
|
197
209
|
readonly actorcontext_saveStateAndWorkflowBatch: (a: number, b: any) => any;
|
|
198
210
|
readonly actorcontext_setAlarm: (a: number, b: number, c: number) => [number, number];
|
|
211
|
+
readonly actorcontext_setRunWakeAt: (a: number, b: number, c: number) => any;
|
|
199
212
|
readonly actorcontext_sleep: (a: number) => [number, number];
|
|
200
213
|
readonly actorcontext_sql: (a: number) => number;
|
|
201
214
|
readonly actorcontext_state: (a: number) => [number, number];
|
|
@@ -205,6 +218,9 @@ export interface InitOutput {
|
|
|
205
218
|
readonly actorcontext_waitForTrackedShutdownWorkUnbounded: (a: number) => any;
|
|
206
219
|
readonly actorcontext_waitUntil: (a: number, b: any) => void;
|
|
207
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;
|
|
208
224
|
readonly awaitPromise: (a: any) => any;
|
|
209
225
|
readonly bridgeRivetErrorPrefix: () => [number, number];
|
|
210
226
|
readonly cancellationtoken_aborted: (a: number) => number;
|
|
@@ -232,6 +248,7 @@ export interface InitOutput {
|
|
|
232
248
|
readonly kv_listPrefix: (a: number, b: number, c: number, d: any) => any;
|
|
233
249
|
readonly kv_listRange: (a: number, b: number, c: number, d: number, e: number, f: any) => any;
|
|
234
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;
|
|
235
252
|
readonly queue_enqueueAndWait: (a: number, b: number, c: number, d: number, e: number, f: any, g: number) => any;
|
|
236
253
|
readonly queue_inspectMessages: (a: number) => any;
|
|
237
254
|
readonly queue_maxSize: (a: number) => number;
|
|
@@ -259,7 +276,7 @@ export interface InitOutput {
|
|
|
259
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;
|
|
260
277
|
readonly schedule_get: (a: number, b: number, c: number) => any;
|
|
261
278
|
readonly schedule_list: (a: number) => any;
|
|
262
|
-
readonly sqlitedb_beginTransaction: (a: number, b: number, c: number) => any;
|
|
279
|
+
readonly sqlitedb_beginTransaction: (a: number, b: number, c: number, d: number, e: number) => any;
|
|
263
280
|
readonly sqlitedb_close: (a: number) => any;
|
|
264
281
|
readonly sqlitedb_exec: (a: number, b: number, c: number) => any;
|
|
265
282
|
readonly sqlitedb_execute: (a: number, b: number, c: number, d: any) => any;
|
|
@@ -287,9 +304,9 @@ export interface InitOutput {
|
|
|
287
304
|
readonly __wbindgen_free: (a: number, b: number, c: number) => void;
|
|
288
305
|
readonly __wbindgen_export_6: WebAssembly.Table;
|
|
289
306
|
readonly __externref_table_dealloc: (a: number) => void;
|
|
290
|
-
readonly
|
|
291
|
-
readonly
|
|
292
|
-
readonly
|
|
307
|
+
readonly closure1967_externref_shim: (a: number, b: number, c: any) => void;
|
|
308
|
+
readonly closure2328_externref_shim: (a: number, b: number, c: any) => void;
|
|
309
|
+
readonly closure2561_externref_shim: (a: number, b: number, c: any, d: any) => void;
|
|
293
310
|
readonly __wbindgen_start: () => void;
|
|
294
311
|
}
|
|
295
312
|
|
package/pkg/rivetkit_wasm.js
CHANGED
|
@@ -274,15 +274,15 @@ function takeFromExternrefTable0(idx) {
|
|
|
274
274
|
return value;
|
|
275
275
|
}
|
|
276
276
|
function __wbg_adapter_50(arg0, arg1, arg2) {
|
|
277
|
-
wasm.
|
|
277
|
+
wasm.closure1967_externref_shim(arg0, arg1, arg2);
|
|
278
278
|
}
|
|
279
279
|
|
|
280
280
|
function __wbg_adapter_59(arg0, arg1, arg2) {
|
|
281
|
-
wasm.
|
|
281
|
+
wasm.closure2328_externref_shim(arg0, arg1, arg2);
|
|
282
282
|
}
|
|
283
283
|
|
|
284
|
-
function
|
|
285
|
-
wasm.
|
|
284
|
+
function __wbg_adapter_293(arg0, arg1, arg2, arg3) {
|
|
285
|
+
wasm.closure2561_externref_shim(arg0, arg1, arg2, arg3);
|
|
286
286
|
}
|
|
287
287
|
|
|
288
288
|
const __wbindgen_enum_BinaryType = ["blob", "arraybuffer"];
|
|
@@ -331,6 +331,14 @@ export class ActorContext {
|
|
|
331
331
|
const ret = wasm.actorcontext_connectConn(this.__wbg_ptr, ptr0, len0, request);
|
|
332
332
|
return ret;
|
|
333
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
|
+
}
|
|
334
342
|
/**
|
|
335
343
|
* @param {any} opts
|
|
336
344
|
* @returns {Promise<void>}
|
|
@@ -349,6 +357,14 @@ export class ActorContext {
|
|
|
349
357
|
const ret = wasm.actorcontext_verifyInspectorAuth(this.__wbg_ptr, ptr0, len0);
|
|
350
358
|
return ret;
|
|
351
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
|
+
}
|
|
352
368
|
/**
|
|
353
369
|
* @param {any} writes
|
|
354
370
|
* @returns {Promise<void>}
|
|
@@ -439,7 +455,10 @@ export class ActorContext {
|
|
|
439
455
|
wasm.actorcontext_endOnStateChange(this.__wbg_ptr);
|
|
440
456
|
}
|
|
441
457
|
restartRunHandler() {
|
|
442
|
-
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
|
+
}
|
|
443
462
|
}
|
|
444
463
|
beginOnStateChange() {
|
|
445
464
|
wasm.actorcontext_beginOnStateChange(this.__wbg_ptr);
|
|
@@ -645,6 +664,59 @@ export class ActorFactory {
|
|
|
645
664
|
}
|
|
646
665
|
}
|
|
647
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
|
+
|
|
648
720
|
const CancellationTokenFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
649
721
|
? { register: () => {}, unregister: () => {} }
|
|
650
722
|
: new FinalizationRegistry(ptr => wasm.__wbg_cancellationtoken_free(ptr >>> 0, 1));
|
|
@@ -1050,6 +1122,20 @@ export class Queue {
|
|
|
1050
1122
|
const ret = wasm.queue_inspectMessages(this.__wbg_ptr);
|
|
1051
1123
|
return ret;
|
|
1052
1124
|
}
|
|
1125
|
+
/**
|
|
1126
|
+
* @param {bigint} message_id
|
|
1127
|
+
* @param {string} expected_name
|
|
1128
|
+
* @param {Uint8Array | null} [response]
|
|
1129
|
+
* @returns {Promise<boolean>}
|
|
1130
|
+
*/
|
|
1131
|
+
completePersisted(message_id, expected_name, response) {
|
|
1132
|
+
const ptr0 = passStringToWasm0(expected_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1133
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1134
|
+
var ptr1 = isLikeNone(response) ? 0 : passArray8ToWasm0(response, wasm.__wbindgen_malloc);
|
|
1135
|
+
var len1 = WASM_VECTOR_LEN;
|
|
1136
|
+
const ret = wasm.queue_completePersisted(this.__wbg_ptr, message_id, ptr0, len0, ptr1, len1);
|
|
1137
|
+
return ret;
|
|
1138
|
+
}
|
|
1053
1139
|
/**
|
|
1054
1140
|
* @param {any} names
|
|
1055
1141
|
* @param {any} options
|
|
@@ -1375,10 +1461,13 @@ export class SqliteDb {
|
|
|
1375
1461
|
}
|
|
1376
1462
|
/**
|
|
1377
1463
|
* @param {number | null} [timeout_ms]
|
|
1464
|
+
* @param {string | null} [name]
|
|
1378
1465
|
* @returns {Promise<SqliteTransaction>}
|
|
1379
1466
|
*/
|
|
1380
|
-
beginTransaction(timeout_ms) {
|
|
1381
|
-
|
|
1467
|
+
beginTransaction(timeout_ms, name) {
|
|
1468
|
+
var ptr0 = isLikeNone(name) ? 0 : passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1469
|
+
var len0 = WASM_VECTOR_LEN;
|
|
1470
|
+
const ret = wasm.sqlitedb_beginTransaction(this.__wbg_ptr, !isLikeNone(timeout_ms), isLikeNone(timeout_ms) ? 0 : timeout_ms, ptr0, len0);
|
|
1382
1471
|
return ret;
|
|
1383
1472
|
}
|
|
1384
1473
|
/**
|
|
@@ -1596,6 +1685,10 @@ function __wbg_get_imports() {
|
|
|
1596
1685
|
const ret = ActorContext.__wrap(arg0);
|
|
1597
1686
|
return ret;
|
|
1598
1687
|
};
|
|
1688
|
+
imports.wbg.__wbg_actorstatetransaction_new = function(arg0) {
|
|
1689
|
+
const ret = ActorStateTransaction.__wrap(arg0);
|
|
1690
|
+
return ret;
|
|
1691
|
+
};
|
|
1599
1692
|
imports.wbg.__wbg_buffer_09165b52af8c5237 = function(arg0) {
|
|
1600
1693
|
const ret = arg0.buffer;
|
|
1601
1694
|
return ret;
|
|
@@ -1771,7 +1864,7 @@ function __wbg_get_imports() {
|
|
|
1771
1864
|
const a = state0.a;
|
|
1772
1865
|
state0.a = 0;
|
|
1773
1866
|
try {
|
|
1774
|
-
return
|
|
1867
|
+
return __wbg_adapter_293(a, state0.b, arg0, arg1);
|
|
1775
1868
|
} finally {
|
|
1776
1869
|
state0.a = a;
|
|
1777
1870
|
}
|
|
@@ -2003,24 +2096,24 @@ function __wbg_get_imports() {
|
|
|
2003
2096
|
const ret = false;
|
|
2004
2097
|
return ret;
|
|
2005
2098
|
};
|
|
2006
|
-
imports.wbg.
|
|
2007
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
2099
|
+
imports.wbg.__wbindgen_closure_wrapper4816 = function(arg0, arg1, arg2) {
|
|
2100
|
+
const ret = makeMutClosure(arg0, arg1, 1968, __wbg_adapter_50);
|
|
2008
2101
|
return ret;
|
|
2009
2102
|
};
|
|
2010
|
-
imports.wbg.
|
|
2011
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
2103
|
+
imports.wbg.__wbindgen_closure_wrapper4818 = function(arg0, arg1, arg2) {
|
|
2104
|
+
const ret = makeMutClosure(arg0, arg1, 1968, __wbg_adapter_50);
|
|
2012
2105
|
return ret;
|
|
2013
2106
|
};
|
|
2014
|
-
imports.wbg.
|
|
2015
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
2107
|
+
imports.wbg.__wbindgen_closure_wrapper4820 = function(arg0, arg1, arg2) {
|
|
2108
|
+
const ret = makeMutClosure(arg0, arg1, 1968, __wbg_adapter_50);
|
|
2016
2109
|
return ret;
|
|
2017
2110
|
};
|
|
2018
|
-
imports.wbg.
|
|
2019
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
2111
|
+
imports.wbg.__wbindgen_closure_wrapper4822 = function(arg0, arg1, arg2) {
|
|
2112
|
+
const ret = makeMutClosure(arg0, arg1, 1968, __wbg_adapter_50);
|
|
2020
2113
|
return ret;
|
|
2021
2114
|
};
|
|
2022
|
-
imports.wbg.
|
|
2023
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
2115
|
+
imports.wbg.__wbindgen_closure_wrapper5405 = function(arg0, arg1, arg2) {
|
|
2116
|
+
const ret = makeMutClosure(arg0, arg1, 2329, __wbg_adapter_59);
|
|
2024
2117
|
return ret;
|
|
2025
2118
|
};
|
|
2026
2119
|
imports.wbg.__wbindgen_debug_string = function(arg0, arg1) {
|
|
Binary file
|
|
@@ -3,6 +3,7 @@
|
|
|
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;
|
|
@@ -15,6 +16,7 @@ export const actorcontext_abortSignal: (a: number) => [number, number, number];
|
|
|
15
16
|
export const actorcontext_actorId: (a: number) => [number, number];
|
|
16
17
|
export const actorcontext_beginKeepAwake: (a: number) => number;
|
|
17
18
|
export const actorcontext_beginOnStateChange: (a: number) => void;
|
|
19
|
+
export const actorcontext_beginStateTransaction: (a: number, b: number, c: number) => any;
|
|
18
20
|
export const actorcontext_beginWebsocketCallback: (a: number) => number;
|
|
19
21
|
export const actorcontext_broadcast: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
20
22
|
export const actorcontext_connectConn: (a: number, b: number, c: number, d: any) => any;
|
|
@@ -34,11 +36,12 @@ export const actorcontext_region: (a: number) => [number, number];
|
|
|
34
36
|
export const actorcontext_registerTask: (a: number, b: any) => void;
|
|
35
37
|
export const actorcontext_requestSave: (a: number, b: any) => void;
|
|
36
38
|
export const actorcontext_requestSaveAndWait: (a: number, b: any) => any;
|
|
37
|
-
export const actorcontext_restartRunHandler: (a: number) =>
|
|
39
|
+
export const actorcontext_restartRunHandler: (a: number) => [number, number];
|
|
38
40
|
export const actorcontext_runtimeState: (a: number) => any;
|
|
39
41
|
export const actorcontext_saveState: (a: number, b: any) => any;
|
|
40
42
|
export const actorcontext_saveStateAndWorkflowBatch: (a: number, b: any) => any;
|
|
41
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;
|
|
42
45
|
export const actorcontext_sleep: (a: number) => [number, number];
|
|
43
46
|
export const actorcontext_sql: (a: number) => number;
|
|
44
47
|
export const actorcontext_state: (a: number) => [number, number];
|
|
@@ -48,6 +51,9 @@ export const actorcontext_waitForTrackedShutdownWork: (a: number) => any;
|
|
|
48
51
|
export const actorcontext_waitForTrackedShutdownWorkUnbounded: (a: number) => any;
|
|
49
52
|
export const actorcontext_waitUntil: (a: number, b: any) => void;
|
|
50
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;
|
|
51
57
|
export const awaitPromise: (a: any) => any;
|
|
52
58
|
export const bridgeRivetErrorPrefix: () => [number, number];
|
|
53
59
|
export const cancellationtoken_aborted: (a: number) => number;
|
|
@@ -75,6 +81,7 @@ export const kv_get: (a: number, b: number, c: number) => any;
|
|
|
75
81
|
export const kv_listPrefix: (a: number, b: number, c: number, d: any) => any;
|
|
76
82
|
export const kv_listRange: (a: number, b: number, c: number, d: number, e: number, f: any) => any;
|
|
77
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;
|
|
78
85
|
export const queue_enqueueAndWait: (a: number, b: number, c: number, d: number, e: number, f: any, g: number) => any;
|
|
79
86
|
export const queue_inspectMessages: (a: number) => any;
|
|
80
87
|
export const queue_maxSize: (a: number) => number;
|
|
@@ -102,7 +109,7 @@ export const schedule_cronList: (a: number) => any;
|
|
|
102
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;
|
|
103
110
|
export const schedule_get: (a: number, b: number, c: number) => any;
|
|
104
111
|
export const schedule_list: (a: number) => any;
|
|
105
|
-
export const sqlitedb_beginTransaction: (a: number, b: number, c: number) => any;
|
|
112
|
+
export const sqlitedb_beginTransaction: (a: number, b: number, c: number, d: number, e: number) => any;
|
|
106
113
|
export const sqlitedb_close: (a: number) => any;
|
|
107
114
|
export const sqlitedb_exec: (a: number, b: number, c: number) => any;
|
|
108
115
|
export const sqlitedb_execute: (a: number, b: number, c: number, d: any) => any;
|
|
@@ -130,7 +137,7 @@ export const __wbindgen_export_4: WebAssembly.Table;
|
|
|
130
137
|
export const __wbindgen_free: (a: number, b: number, c: number) => void;
|
|
131
138
|
export const __wbindgen_export_6: WebAssembly.Table;
|
|
132
139
|
export const __externref_table_dealloc: (a: number) => void;
|
|
133
|
-
export const
|
|
134
|
-
export const
|
|
135
|
-
export const
|
|
140
|
+
export const closure1967_externref_shim: (a: number, b: number, c: any) => void;
|
|
141
|
+
export const closure2328_externref_shim: (a: number, b: number, c: any) => void;
|
|
142
|
+
export const closure2561_externref_shim: (a: number, b: number, c: any, d: any) => void;
|
|
136
143
|
export const __wbindgen_start: () => void;
|