@rivetkit/rivetkit-wasm 0.0.0-main.4994268 → 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/index.d.ts +2 -212
- package/package.json +7 -2
- package/pkg/package.json +1 -1
- package/pkg/rivetkit_wasm.d.ts +23 -6
- package/pkg/rivetkit_wasm.js +116 -19
- 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": "0.0.0-main.
|
|
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",
|
|
@@ -32,12 +32,17 @@
|
|
|
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
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"typescript": "^5.9.2",
|
|
41
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"
|
|
42
47
|
}
|
|
43
48
|
}
|
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 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;
|
|
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.closure1987_externref_shim(arg0, arg1, arg2);
|
|
278
278
|
}
|
|
279
279
|
|
|
280
280
|
function __wbg_adapter_59(arg0, arg1, arg2) {
|
|
281
|
-
wasm.
|
|
281
|
+
wasm.closure2386_externref_shim(arg0, arg1, arg2);
|
|
282
282
|
}
|
|
283
283
|
|
|
284
|
-
function
|
|
285
|
-
wasm.
|
|
284
|
+
function __wbg_adapter_297(arg0, arg1, arg2, arg3) {
|
|
285
|
+
wasm.closure2623_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));
|
|
@@ -1058,6 +1130,20 @@ export class Queue {
|
|
|
1058
1130
|
const ret = wasm.queue_inspectMessages(this.__wbg_ptr);
|
|
1059
1131
|
return ret;
|
|
1060
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
|
+
}
|
|
1061
1147
|
/**
|
|
1062
1148
|
* @param {any} names
|
|
1063
1149
|
* @param {any} options
|
|
@@ -1383,10 +1469,13 @@ export class SqliteDb {
|
|
|
1383
1469
|
}
|
|
1384
1470
|
/**
|
|
1385
1471
|
* @param {number | null} [timeout_ms]
|
|
1472
|
+
* @param {string | null} [name]
|
|
1386
1473
|
* @returns {Promise<SqliteTransaction>}
|
|
1387
1474
|
*/
|
|
1388
|
-
beginTransaction(timeout_ms) {
|
|
1389
|
-
|
|
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);
|
|
1390
1479
|
return ret;
|
|
1391
1480
|
}
|
|
1392
1481
|
/**
|
|
@@ -1604,6 +1693,10 @@ function __wbg_get_imports() {
|
|
|
1604
1693
|
const ret = ActorContext.__wrap(arg0);
|
|
1605
1694
|
return ret;
|
|
1606
1695
|
};
|
|
1696
|
+
imports.wbg.__wbg_actorstatetransaction_new = function(arg0) {
|
|
1697
|
+
const ret = ActorStateTransaction.__wrap(arg0);
|
|
1698
|
+
return ret;
|
|
1699
|
+
};
|
|
1607
1700
|
imports.wbg.__wbg_buffer_09165b52af8c5237 = function(arg0) {
|
|
1608
1701
|
const ret = arg0.buffer;
|
|
1609
1702
|
return ret;
|
|
@@ -1612,6 +1705,10 @@ function __wbg_get_imports() {
|
|
|
1612
1705
|
const ret = arg0.buffer;
|
|
1613
1706
|
return ret;
|
|
1614
1707
|
};
|
|
1708
|
+
imports.wbg.__wbg_bufferedAmount_a482960ac51b25e8 = function(arg0) {
|
|
1709
|
+
const ret = arg0.bufferedAmount;
|
|
1710
|
+
return ret;
|
|
1711
|
+
};
|
|
1615
1712
|
imports.wbg.__wbg_call_672a4d21634d4a24 = function() { return handleError(function (arg0, arg1) {
|
|
1616
1713
|
const ret = arg0.call(arg1);
|
|
1617
1714
|
return ret;
|
|
@@ -1669,7 +1766,7 @@ function __wbg_get_imports() {
|
|
|
1669
1766
|
wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
|
|
1670
1767
|
}
|
|
1671
1768
|
};
|
|
1672
|
-
imports.wbg.
|
|
1769
|
+
imports.wbg.__wbg_getRandomValues_430b4ece0366b997 = function() { return handleError(function (arg0, arg1) {
|
|
1673
1770
|
globalThis.crypto.getRandomValues(getArrayU8FromWasm0(arg0, arg1));
|
|
1674
1771
|
}, arguments) };
|
|
1675
1772
|
imports.wbg.__wbg_getRandomValues_b8f5dbd5f3995a9e = function() { return handleError(function (arg0, arg1) {
|
|
@@ -1783,7 +1880,7 @@ function __wbg_get_imports() {
|
|
|
1783
1880
|
const a = state0.a;
|
|
1784
1881
|
state0.a = 0;
|
|
1785
1882
|
try {
|
|
1786
|
-
return
|
|
1883
|
+
return __wbg_adapter_297(a, state0.b, arg0, arg1);
|
|
1787
1884
|
} finally {
|
|
1788
1885
|
state0.a = a;
|
|
1789
1886
|
}
|
|
@@ -2015,24 +2112,24 @@ function __wbg_get_imports() {
|
|
|
2015
2112
|
const ret = false;
|
|
2016
2113
|
return ret;
|
|
2017
2114
|
};
|
|
2018
|
-
imports.wbg.
|
|
2019
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
2115
|
+
imports.wbg.__wbindgen_closure_wrapper4959 = function(arg0, arg1, arg2) {
|
|
2116
|
+
const ret = makeMutClosure(arg0, arg1, 1988, __wbg_adapter_50);
|
|
2020
2117
|
return ret;
|
|
2021
2118
|
};
|
|
2022
|
-
imports.wbg.
|
|
2023
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
2119
|
+
imports.wbg.__wbindgen_closure_wrapper4961 = function(arg0, arg1, arg2) {
|
|
2120
|
+
const ret = makeMutClosure(arg0, arg1, 1988, __wbg_adapter_50);
|
|
2024
2121
|
return ret;
|
|
2025
2122
|
};
|
|
2026
|
-
imports.wbg.
|
|
2027
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
2123
|
+
imports.wbg.__wbindgen_closure_wrapper4963 = function(arg0, arg1, arg2) {
|
|
2124
|
+
const ret = makeMutClosure(arg0, arg1, 1988, __wbg_adapter_50);
|
|
2028
2125
|
return ret;
|
|
2029
2126
|
};
|
|
2030
|
-
imports.wbg.
|
|
2031
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
2127
|
+
imports.wbg.__wbindgen_closure_wrapper4965 = function(arg0, arg1, arg2) {
|
|
2128
|
+
const ret = makeMutClosure(arg0, arg1, 1988, __wbg_adapter_50);
|
|
2032
2129
|
return ret;
|
|
2033
2130
|
};
|
|
2034
|
-
imports.wbg.
|
|
2035
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
2131
|
+
imports.wbg.__wbindgen_closure_wrapper5612 = function(arg0, arg1, arg2) {
|
|
2132
|
+
const ret = makeMutClosure(arg0, arg1, 2387, __wbg_adapter_59);
|
|
2036
2133
|
return ret;
|
|
2037
2134
|
};
|
|
2038
2135
|
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 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;
|
|
136
143
|
export const __wbindgen_start: () => void;
|