orez-lite 0.9.7
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/LICENSE +21 -0
- package/README.md +12 -0
- package/dist/browser/generated/sqlite3-browser.wasm +0 -0
- package/dist/browser/generated/sync_wasm.js +922 -0
- package/dist/browser/generated/sync_wasm_bg.wasm +0 -0
- package/dist/browser/host.d.ts +10 -0
- package/dist/browser/host.d.ts.map +1 -0
- package/dist/browser/host.js +496 -0
- package/dist/browser/host.js.map +1 -0
- package/dist/browser/idb-snapshot.d.ts +11 -0
- package/dist/browser/idb-snapshot.d.ts.map +1 -0
- package/dist/browser/idb-snapshot.js +122 -0
- package/dist/browser/idb-snapshot.js.map +1 -0
- package/dist/browser/index.d.ts +5 -0
- package/dist/browser/index.d.ts.map +1 -0
- package/dist/browser/index.js +5 -0
- package/dist/browser/index.js.map +1 -0
- package/dist/browser/message-port.d.ts +7 -0
- package/dist/browser/message-port.d.ts.map +1 -0
- package/dist/browser/message-port.js +188 -0
- package/dist/browser/message-port.js.map +1 -0
- package/dist/browser/sqlite-adapter.d.ts +53 -0
- package/dist/browser/sqlite-adapter.d.ts.map +1 -0
- package/dist/browser/sqlite-adapter.js +126 -0
- package/dist/browser/sqlite-adapter.js.map +1 -0
- package/dist/browser/types.d.ts +52 -0
- package/dist/browser/types.d.ts.map +1 -0
- package/dist/browser/types.js +2 -0
- package/dist/browser/types.js.map +1 -0
- package/dist/cf-deploy/bundle.d.ts +18 -0
- package/dist/cf-deploy/bundle.d.ts.map +1 -0
- package/dist/cf-deploy/bundle.js +273 -0
- package/dist/cf-deploy/bundle.js.map +1 -0
- package/dist/cf-deploy/config.d.ts +12 -0
- package/dist/cf-deploy/config.d.ts.map +1 -0
- package/dist/cf-deploy/config.js +11 -0
- package/dist/cf-deploy/config.js.map +1 -0
- package/dist/cf-deploy/index.d.ts +10 -0
- package/dist/cf-deploy/index.d.ts.map +1 -0
- package/dist/cf-deploy/index.js +12 -0
- package/dist/cf-deploy/index.js.map +1 -0
- package/dist/cf-deploy/leaves.d.ts +8 -0
- package/dist/cf-deploy/leaves.d.ts.map +1 -0
- package/dist/cf-deploy/leaves.js +66 -0
- package/dist/cf-deploy/leaves.js.map +1 -0
- package/dist/cf-deploy/migration.d.ts +27 -0
- package/dist/cf-deploy/migration.d.ts.map +1 -0
- package/dist/cf-deploy/migration.js +734 -0
- package/dist/cf-deploy/migration.js.map +1 -0
- package/dist/cf-deploy/nativeMigrations.d.ts +24 -0
- package/dist/cf-deploy/nativeMigrations.d.ts.map +1 -0
- package/dist/cf-deploy/nativeMigrations.js +185 -0
- package/dist/cf-deploy/nativeMigrations.js.map +1 -0
- package/dist/cf-deploy/prune.d.ts +14 -0
- package/dist/cf-deploy/prune.d.ts.map +1 -0
- package/dist/cf-deploy/prune.js +235 -0
- package/dist/cf-deploy/prune.js.map +1 -0
- package/dist/cf-deploy/readiness.d.ts +11 -0
- package/dist/cf-deploy/readiness.d.ts.map +1 -0
- package/dist/cf-deploy/readiness.js +56 -0
- package/dist/cf-deploy/readiness.js.map +1 -0
- package/dist/cf-deploy/sources.d.ts +3 -0
- package/dist/cf-deploy/sources.d.ts.map +1 -0
- package/dist/cf-deploy/sources.js +24 -0
- package/dist/cf-deploy/sources.js.map +1 -0
- package/dist/cf-deploy/wrangler.d.ts +9 -0
- package/dist/cf-deploy/wrangler.d.ts.map +1 -0
- package/dist/cf-deploy/wrangler.js +48 -0
- package/dist/cf-deploy/wrangler.js.map +1 -0
- package/dist/cf-do/application-sql.d.ts +49 -0
- package/dist/cf-do/application-sql.d.ts.map +1 -0
- package/dist/cf-do/application-sql.js +124 -0
- package/dist/cf-do/application-sql.js.map +1 -0
- package/dist/cf-do/cdc.d.ts +155 -0
- package/dist/cf-do/cdc.d.ts.map +1 -0
- package/dist/cf-do/cdc.js +723 -0
- package/dist/cf-do/cdc.js.map +1 -0
- package/dist/cf-do/cursor-pull.d.ts +27 -0
- package/dist/cf-do/cursor-pull.d.ts.map +1 -0
- package/dist/cf-do/cursor-pull.js +78 -0
- package/dist/cf-do/cursor-pull.js.map +1 -0
- package/dist/cf-do/lite-data-worker.d.ts +171 -0
- package/dist/cf-do/lite-data-worker.d.ts.map +1 -0
- package/dist/cf-do/lite-data-worker.js +685 -0
- package/dist/cf-do/lite-data-worker.js.map +1 -0
- package/dist/cf-do/namespace-backup.d.ts +85 -0
- package/dist/cf-do/namespace-backup.d.ts.map +1 -0
- package/dist/cf-do/namespace-backup.js +470 -0
- package/dist/cf-do/namespace-backup.js.map +1 -0
- package/dist/cf-do/row-undo.d.ts +36 -0
- package/dist/cf-do/row-undo.d.ts.map +1 -0
- package/dist/cf-do/row-undo.js +221 -0
- package/dist/cf-do/row-undo.js.map +1 -0
- package/dist/cf-do/tx-journal.d.ts +118 -0
- package/dist/cf-do/tx-journal.d.ts.map +1 -0
- package/dist/cf-do/tx-journal.js +717 -0
- package/dist/cf-do/tx-journal.js.map +1 -0
- package/dist/cf-do/watermark.d.ts +29 -0
- package/dist/cf-do/watermark.d.ts.map +1 -0
- package/dist/cf-do/watermark.js +105 -0
- package/dist/cf-do/watermark.js.map +1 -0
- package/dist/cf-do/worker.d.ts +282 -0
- package/dist/cf-do/worker.d.ts.map +1 -0
- package/dist/cf-do/worker.js +1999 -0
- package/dist/cf-do/worker.js.map +1 -0
- package/dist/client.d.ts +2 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +2 -0
- package/dist/client.js.map +1 -0
- package/dist/cloudflare-build.d.ts +9 -0
- package/dist/cloudflare-build.d.ts.map +1 -0
- package/dist/cloudflare-build.js +9 -0
- package/dist/cloudflare-build.js.map +1 -0
- package/dist/cloudflare-bun-wasm-loader.d.ts +2 -0
- package/dist/cloudflare-bun-wasm-loader.d.ts.map +1 -0
- package/dist/cloudflare-bun-wasm-loader.js +2 -0
- package/dist/cloudflare-bun-wasm-loader.js.map +1 -0
- package/dist/cloudflare-query-compiler.d.ts +2 -0
- package/dist/cloudflare-query-compiler.d.ts.map +1 -0
- package/dist/cloudflare-query-compiler.js +2 -0
- package/dist/cloudflare-query-compiler.js.map +1 -0
- package/dist/cloudflare-runtime.d.ts +15 -0
- package/dist/cloudflare-runtime.d.ts.map +1 -0
- package/dist/cloudflare-runtime.js +11 -0
- package/dist/cloudflare-runtime.js.map +1 -0
- package/dist/cloudflare-sync.d.ts +3 -0
- package/dist/cloudflare-sync.d.ts.map +1 -0
- package/dist/cloudflare-sync.js +3 -0
- package/dist/cloudflare-sync.js.map +1 -0
- package/dist/cloudflare-transaction-query.d.ts +2 -0
- package/dist/cloudflare-transaction-query.d.ts.map +1 -0
- package/dist/cloudflare-transaction-query.js +2 -0
- package/dist/cloudflare-transaction-query.js.map +1 -0
- package/dist/cloudflare-vite-wasm-loader.d.ts +2 -0
- package/dist/cloudflare-vite-wasm-loader.d.ts.map +1 -0
- package/dist/cloudflare-vite-wasm-loader.js +2 -0
- package/dist/cloudflare-vite-wasm-loader.js.map +1 -0
- package/dist/cloudflare.d.ts +3 -0
- package/dist/cloudflare.d.ts.map +1 -0
- package/dist/cloudflare.js +3 -0
- package/dist/cloudflare.js.map +1 -0
- package/dist/do-sql-tracking.d.ts +114 -0
- package/dist/do-sql-tracking.d.ts.map +1 -0
- package/dist/do-sql-tracking.js +280 -0
- package/dist/do-sql-tracking.js.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -0
- package/dist/wake.d.ts +22 -0
- package/dist/wake.d.ts.map +1 -0
- package/dist/wake.js +114 -0
- package/dist/wake.js.map +1 -0
- package/dist/worker/cf-do-shim.d.ts +53 -0
- package/dist/worker/cf-do-shim.d.ts.map +1 -0
- package/dist/worker/cf-do-shim.js +66 -0
- package/dist/worker/cf-do-shim.js.map +1 -0
- package/dist/zero-http/encrypted-column-codec.d.ts +46 -0
- package/dist/zero-http/encrypted-column-codec.d.ts.map +1 -0
- package/dist/zero-http/encrypted-column-codec.js +676 -0
- package/dist/zero-http/encrypted-column-codec.js.map +1 -0
- package/dist/zero-http/encrypted-column-conformance.d.ts +7 -0
- package/dist/zero-http/encrypted-column-conformance.d.ts.map +1 -0
- package/dist/zero-http/encrypted-column-conformance.js +161 -0
- package/dist/zero-http/encrypted-column-conformance.js.map +1 -0
- package/dist/zero-http/fixture-schema.d.ts +127 -0
- package/dist/zero-http/fixture-schema.d.ts.map +1 -0
- package/dist/zero-http/fixture-schema.js +56 -0
- package/dist/zero-http/fixture-schema.js.map +1 -0
- package/dist/zero-http/mount.d.ts +71 -0
- package/dist/zero-http/mount.d.ts.map +1 -0
- package/dist/zero-http/mount.js +594 -0
- package/dist/zero-http/mount.js.map +1 -0
- package/dist/zero-http/payload-codec.d.ts +91 -0
- package/dist/zero-http/payload-codec.d.ts.map +1 -0
- package/dist/zero-http/payload-codec.js +10 -0
- package/dist/zero-http/payload-codec.js.map +1 -0
- package/dist/zero-http/server.d.ts +16 -0
- package/dist/zero-http/server.d.ts.map +1 -0
- package/dist/zero-http/server.js +270 -0
- package/dist/zero-http/server.js.map +1 -0
- package/dist/zero-http/test-harness.d.ts +32 -0
- package/dist/zero-http/test-harness.d.ts.map +1 -0
- package/dist/zero-http/test-harness.js +77 -0
- package/dist/zero-http/test-harness.js.map +1 -0
- package/dist/zero-http/transport.d.ts +71 -0
- package/dist/zero-http/transport.d.ts.map +1 -0
- package/dist/zero-http/transport.js +1106 -0
- package/dist/zero-http/transport.js.map +1 -0
- package/package.json +116 -0
|
@@ -0,0 +1,922 @@
|
|
|
1
|
+
/* @ts-self-types="./sync_wasm.d.ts" */
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Apply one ordered catch-up page to staging without touching the live table
|
|
5
|
+
* namespace or live upstream watermark.
|
|
6
|
+
* @param {any} db
|
|
7
|
+
* @param {any} schema
|
|
8
|
+
* @param {string} generation
|
|
9
|
+
* @param {any} batch
|
|
10
|
+
* @returns {any}
|
|
11
|
+
*/
|
|
12
|
+
export function engine_apply_snapshot_changes(db, schema, generation, batch) {
|
|
13
|
+
const ptr0 = passStringToWasm0(generation, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
14
|
+
const len0 = WASM_VECTOR_LEN;
|
|
15
|
+
const ret = wasm.engine_apply_snapshot_changes(db, schema, ptr0, len0, batch);
|
|
16
|
+
if (ret[2]) {
|
|
17
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
18
|
+
}
|
|
19
|
+
return takeFromExternrefTable0(ret[0]);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Apply one bounded source page to staging and commit its opaque cursor with
|
|
24
|
+
* the rows. The host owns one transaction per call.
|
|
25
|
+
* @param {any} db
|
|
26
|
+
* @param {any} schema
|
|
27
|
+
* @param {string} generation
|
|
28
|
+
* @param {string} table
|
|
29
|
+
* @param {any} rows
|
|
30
|
+
* @param {string | null} [next_cursor]
|
|
31
|
+
* @returns {any}
|
|
32
|
+
*/
|
|
33
|
+
export function engine_apply_snapshot_page(db, schema, generation, table, rows, next_cursor) {
|
|
34
|
+
const ptr0 = passStringToWasm0(generation, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
35
|
+
const len0 = WASM_VECTOR_LEN;
|
|
36
|
+
const ptr1 = passStringToWasm0(table, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
37
|
+
const len1 = WASM_VECTOR_LEN;
|
|
38
|
+
var ptr2 = isLikeNone(next_cursor) ? 0 : passStringToWasm0(next_cursor, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
39
|
+
var len2 = WASM_VECTOR_LEN;
|
|
40
|
+
const ret = wasm.engine_apply_snapshot_page(db, schema, ptr0, len0, ptr1, len1, rows, ptr2, len2);
|
|
41
|
+
if (ret[2]) {
|
|
42
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
43
|
+
}
|
|
44
|
+
return takeFromExternrefTable0(ret[0]);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Apply one ordered page from the upstream ZeroSqlDO change feed. The host
|
|
49
|
+
* owns one transaction around this call; application triggers append the
|
|
50
|
+
* ordinary engine change-log entries consumed by pull/CVR code.
|
|
51
|
+
* @param {any} db
|
|
52
|
+
* @param {any} schema
|
|
53
|
+
* @param {any} batch
|
|
54
|
+
* @returns {any}
|
|
55
|
+
*/
|
|
56
|
+
export function engine_apply_upstream(db, schema, batch) {
|
|
57
|
+
const ret = wasm.engine_apply_upstream(db, schema, batch);
|
|
58
|
+
if (ret[2]) {
|
|
59
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
60
|
+
}
|
|
61
|
+
return takeFromExternrefTable0(ret[0]);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Atomically rebuild application rows from a point-in-time upstream snapshot.
|
|
66
|
+
* @param {any} db
|
|
67
|
+
* @param {any} schema
|
|
68
|
+
* @param {any} snapshot
|
|
69
|
+
* @returns {any}
|
|
70
|
+
*/
|
|
71
|
+
export function engine_apply_upstream_snapshot(db, schema, snapshot) {
|
|
72
|
+
const ret = wasm.engine_apply_upstream_snapshot(db, schema, snapshot);
|
|
73
|
+
if (ret[2]) {
|
|
74
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
75
|
+
}
|
|
76
|
+
return takeFromExternrefTable0(ret[0]);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* @param {any} results
|
|
81
|
+
* @returns {any}
|
|
82
|
+
*/
|
|
83
|
+
export function engine_assemble_push_response(results) {
|
|
84
|
+
const ret = wasm.engine_assemble_push_response(results);
|
|
85
|
+
if (ret[2]) {
|
|
86
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
87
|
+
}
|
|
88
|
+
return takeFromExternrefTable0(ret[0]);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Create a new staged generation. `start_watermark` is captured by the host
|
|
93
|
+
* from the first source snapshot-page response. The host owns the transaction.
|
|
94
|
+
* @param {any} db
|
|
95
|
+
* @param {any} schema
|
|
96
|
+
* @param {string} start_watermark
|
|
97
|
+
* @returns {any}
|
|
98
|
+
*/
|
|
99
|
+
export function engine_begin_snapshot_generation(db, schema, start_watermark) {
|
|
100
|
+
const ptr0 = passStringToWasm0(start_watermark, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
101
|
+
const len0 = WASM_VECTOR_LEN;
|
|
102
|
+
const ret = wasm.engine_begin_snapshot_generation(db, schema, ptr0, len0);
|
|
103
|
+
if (ret[2]) {
|
|
104
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
105
|
+
}
|
|
106
|
+
return takeFromExternrefTable0(ret[0]);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* Compile a validated Zero query AST for a consumer mutator's transactional
|
|
111
|
+
* `tx.run(...)`. Execution remains in the host-owned application transaction.
|
|
112
|
+
* @param {any} schema
|
|
113
|
+
* @param {any} ast
|
|
114
|
+
* @param {any} format
|
|
115
|
+
* @returns {any}
|
|
116
|
+
*/
|
|
117
|
+
export function engine_compile_query(schema, ast, format) {
|
|
118
|
+
const ret = wasm.engine_compile_query(schema, ast, format);
|
|
119
|
+
if (ret[2]) {
|
|
120
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
121
|
+
}
|
|
122
|
+
return takeFromExternrefTable0(ret[0]);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* @param {any} db
|
|
127
|
+
* @param {string} client_group_id
|
|
128
|
+
* @param {string} client_id
|
|
129
|
+
* @param {string} mutation_id
|
|
130
|
+
*/
|
|
131
|
+
export function engine_finalize(db, client_group_id, client_id, mutation_id) {
|
|
132
|
+
const ptr0 = passStringToWasm0(client_group_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
133
|
+
const len0 = WASM_VECTOR_LEN;
|
|
134
|
+
const ptr1 = passStringToWasm0(client_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
135
|
+
const len1 = WASM_VECTOR_LEN;
|
|
136
|
+
const ptr2 = passStringToWasm0(mutation_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
137
|
+
const len2 = WASM_VECTOR_LEN;
|
|
138
|
+
const ret = wasm.engine_finalize(db, ptr0, len0, ptr1, len1, ptr2, len2);
|
|
139
|
+
if (ret[1]) {
|
|
140
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* Atomically rename a drained staged generation into the live namespace,
|
|
146
|
+
* invalidate pre-cutover client cookies, and advance the live source cursor.
|
|
147
|
+
* @param {any} db
|
|
148
|
+
* @param {any} schema
|
|
149
|
+
* @param {string} generation
|
|
150
|
+
* @param {string} watermark
|
|
151
|
+
* @returns {any}
|
|
152
|
+
*/
|
|
153
|
+
export function engine_finalize_snapshot_generation(db, schema, generation, watermark) {
|
|
154
|
+
const ptr0 = passStringToWasm0(generation, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
155
|
+
const len0 = WASM_VECTOR_LEN;
|
|
156
|
+
const ptr1 = passStringToWasm0(watermark, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
157
|
+
const len1 = WASM_VECTOR_LEN;
|
|
158
|
+
const ret = wasm.engine_finalize_snapshot_generation(db, schema, ptr0, len0, ptr1, len1);
|
|
159
|
+
if (ret[2]) {
|
|
160
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
161
|
+
}
|
|
162
|
+
return takeFromExternrefTable0(ret[0]);
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
/**
|
|
166
|
+
* Production pull entry. The TypeScript host owns `transactionSync`.
|
|
167
|
+
* @param {any} db
|
|
168
|
+
* @param {any} schema
|
|
169
|
+
* @param {any} visibility
|
|
170
|
+
* @param {any} caps
|
|
171
|
+
* @param {string} retain_changes
|
|
172
|
+
* @param {any} body
|
|
173
|
+
* @param {string} user_id
|
|
174
|
+
* @returns {any}
|
|
175
|
+
*/
|
|
176
|
+
export function engine_handle_pull(db, schema, visibility, caps, retain_changes, body, user_id) {
|
|
177
|
+
const ptr0 = passStringToWasm0(retain_changes, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
178
|
+
const len0 = WASM_VECTOR_LEN;
|
|
179
|
+
const ptr1 = passStringToWasm0(user_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
180
|
+
const len1 = WASM_VECTOR_LEN;
|
|
181
|
+
const ret = wasm.engine_handle_pull(db, schema, visibility, caps, ptr0, len0, body, ptr1, len1);
|
|
182
|
+
if (ret[2]) {
|
|
183
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
184
|
+
}
|
|
185
|
+
return takeFromExternrefTable0(ret[0]);
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
/**
|
|
189
|
+
* Query-aware pull entry point. Desired-query ASTs are already resolved and
|
|
190
|
+
* validated by the consumer host before crossing this boundary.
|
|
191
|
+
* @param {any} db
|
|
192
|
+
* @param {any} schema
|
|
193
|
+
* @param {string} retain_changes
|
|
194
|
+
* @param {any} body
|
|
195
|
+
* @param {string} user_id
|
|
196
|
+
* @returns {any}
|
|
197
|
+
*/
|
|
198
|
+
export function engine_handle_query_pull(db, schema, retain_changes, body, user_id) {
|
|
199
|
+
const ptr0 = passStringToWasm0(retain_changes, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
200
|
+
const len0 = WASM_VECTOR_LEN;
|
|
201
|
+
const ptr1 = passStringToWasm0(user_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
202
|
+
const len1 = WASM_VECTOR_LEN;
|
|
203
|
+
const ret = wasm.engine_handle_query_pull(db, schema, ptr0, len0, body, ptr1, len1);
|
|
204
|
+
if (ret[2]) {
|
|
205
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
206
|
+
}
|
|
207
|
+
return takeFromExternrefTable0(ret[0]);
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
/**
|
|
211
|
+
* Initialize the additive query-aware durable tables. The host owns the
|
|
212
|
+
* transaction boundary, exactly as it does for the baseline schema.
|
|
213
|
+
* @param {any} db
|
|
214
|
+
*/
|
|
215
|
+
export function engine_init_query_schema(db) {
|
|
216
|
+
const ret = wasm.engine_init_query_schema(db);
|
|
217
|
+
if (ret[1]) {
|
|
218
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
/**
|
|
223
|
+
* Initialize the sync engine's durable metadata and triggers. The host calls
|
|
224
|
+
* this inside startup `transactionSync` after application DDL and seed.
|
|
225
|
+
* @param {any} db
|
|
226
|
+
* @param {any} schema
|
|
227
|
+
*/
|
|
228
|
+
export function engine_init_schema(db, schema) {
|
|
229
|
+
const ret = wasm.engine_init_schema(db, schema);
|
|
230
|
+
if (ret[1]) {
|
|
231
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
/**
|
|
236
|
+
* @param {any} db
|
|
237
|
+
*/
|
|
238
|
+
export function engine_invalidate(db) {
|
|
239
|
+
const ret = wasm.engine_invalidate(db);
|
|
240
|
+
if (ret[1]) {
|
|
241
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
/**
|
|
246
|
+
* Linear-memory size for authenticated operator soak diagnostics. This is a
|
|
247
|
+
* byte count only; it contains no application or query data.
|
|
248
|
+
* @returns {number}
|
|
249
|
+
*/
|
|
250
|
+
export function engine_memory_bytes() {
|
|
251
|
+
const ret = wasm.engine_memory_bytes();
|
|
252
|
+
if (ret[2]) {
|
|
253
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
254
|
+
}
|
|
255
|
+
return ret[0] >>> 0;
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
/**
|
|
259
|
+
* @param {any} db
|
|
260
|
+
* @param {string} client_group_id
|
|
261
|
+
* @param {string} client_id
|
|
262
|
+
* @param {string} mutation_id
|
|
263
|
+
* @param {string} user_id
|
|
264
|
+
* @returns {any}
|
|
265
|
+
*/
|
|
266
|
+
export function engine_preflight(db, client_group_id, client_id, mutation_id, user_id) {
|
|
267
|
+
const ptr0 = passStringToWasm0(client_group_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
268
|
+
const len0 = WASM_VECTOR_LEN;
|
|
269
|
+
const ptr1 = passStringToWasm0(client_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
270
|
+
const len1 = WASM_VECTOR_LEN;
|
|
271
|
+
const ptr2 = passStringToWasm0(mutation_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
272
|
+
const len2 = WASM_VECTOR_LEN;
|
|
273
|
+
const ptr3 = passStringToWasm0(user_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
274
|
+
const len3 = WASM_VECTOR_LEN;
|
|
275
|
+
const ret = wasm.engine_preflight(db, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);
|
|
276
|
+
if (ret[2]) {
|
|
277
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
278
|
+
}
|
|
279
|
+
return takeFromExternrefTable0(ret[0]);
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
/**
|
|
283
|
+
* @param {any} db
|
|
284
|
+
* @param {string} retain_changes
|
|
285
|
+
*/
|
|
286
|
+
export function engine_prune(db, retain_changes) {
|
|
287
|
+
const ptr0 = passStringToWasm0(retain_changes, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
288
|
+
const len0 = WASM_VECTOR_LEN;
|
|
289
|
+
const ret = wasm.engine_prune(db, ptr0, len0);
|
|
290
|
+
if (ret[1]) {
|
|
291
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
/**
|
|
296
|
+
* Validate an entire push before the host opens the first mutation tx.
|
|
297
|
+
* @param {any} body
|
|
298
|
+
* @returns {any}
|
|
299
|
+
*/
|
|
300
|
+
export function engine_push_validate(body) {
|
|
301
|
+
const ret = wasm.engine_push_validate(body);
|
|
302
|
+
if (ret[2]) {
|
|
303
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
304
|
+
}
|
|
305
|
+
return takeFromExternrefTable0(ret[0]);
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
/**
|
|
309
|
+
* Strictly read resumable snapshot progress. Storage and row-shape failures
|
|
310
|
+
* are errors; only a successful query with no active row returns null.
|
|
311
|
+
* @param {any} db
|
|
312
|
+
* @returns {any}
|
|
313
|
+
*/
|
|
314
|
+
export function engine_read_snapshot_progress(db) {
|
|
315
|
+
const ret = wasm.engine_read_snapshot_progress(db);
|
|
316
|
+
if (ret[2]) {
|
|
317
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
318
|
+
}
|
|
319
|
+
return takeFromExternrefTable0(ret[0]);
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
/**
|
|
323
|
+
* @param {any} db
|
|
324
|
+
* @param {string} client_group_id
|
|
325
|
+
* @param {string} client_id
|
|
326
|
+
* @param {string} mutation_id
|
|
327
|
+
* @param {string} user_id
|
|
328
|
+
*/
|
|
329
|
+
export function engine_record_app_error(db, client_group_id, client_id, mutation_id, user_id) {
|
|
330
|
+
const ptr0 = passStringToWasm0(client_group_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
331
|
+
const len0 = WASM_VECTOR_LEN;
|
|
332
|
+
const ptr1 = passStringToWasm0(client_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
333
|
+
const len1 = WASM_VECTOR_LEN;
|
|
334
|
+
const ptr2 = passStringToWasm0(mutation_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
335
|
+
const len2 = WASM_VECTOR_LEN;
|
|
336
|
+
const ptr3 = passStringToWasm0(user_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
337
|
+
const len3 = WASM_VECTOR_LEN;
|
|
338
|
+
const ret = wasm.engine_record_app_error(db, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);
|
|
339
|
+
if (ret[1]) {
|
|
340
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
/**
|
|
345
|
+
* @param {any} db
|
|
346
|
+
* @returns {any}
|
|
347
|
+
*/
|
|
348
|
+
export function engine_state(db) {
|
|
349
|
+
const ret = wasm.engine_state(db);
|
|
350
|
+
if (ret[2]) {
|
|
351
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
352
|
+
}
|
|
353
|
+
return takeFromExternrefTable0(ret[0]);
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
/**
|
|
357
|
+
* @returns {string}
|
|
358
|
+
*/
|
|
359
|
+
export function engine_version() {
|
|
360
|
+
let deferred1_0;
|
|
361
|
+
let deferred1_1;
|
|
362
|
+
try {
|
|
363
|
+
const ret = wasm.engine_version();
|
|
364
|
+
deferred1_0 = ret[0];
|
|
365
|
+
deferred1_1 = ret[1];
|
|
366
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
367
|
+
} finally {
|
|
368
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
function __wbg_get_imports() {
|
|
372
|
+
const import0 = {
|
|
373
|
+
__proto__: null,
|
|
374
|
+
__wbg_Error_92b29b0548f8b746: function(arg0, arg1) {
|
|
375
|
+
const ret = Error(getStringFromWasm0(arg0, arg1));
|
|
376
|
+
return ret;
|
|
377
|
+
},
|
|
378
|
+
__wbg_Number_9a4e0ecb0fa16705: function(arg0) {
|
|
379
|
+
const ret = Number(arg0);
|
|
380
|
+
return ret;
|
|
381
|
+
},
|
|
382
|
+
__wbg_String_8564e559799eccda: function(arg0, arg1) {
|
|
383
|
+
const ret = String(arg1);
|
|
384
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
385
|
+
const len1 = WASM_VECTOR_LEN;
|
|
386
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
387
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
388
|
+
},
|
|
389
|
+
__wbg___wbindgen_bigint_get_as_i64_d968e41184ae354f: function(arg0, arg1) {
|
|
390
|
+
const v = arg1;
|
|
391
|
+
const ret = typeof(v) === 'bigint' ? v : undefined;
|
|
392
|
+
getDataViewMemory0().setBigInt64(arg0 + 8 * 1, isLikeNone(ret) ? BigInt(0) : ret, true);
|
|
393
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
|
|
394
|
+
},
|
|
395
|
+
__wbg___wbindgen_boolean_get_fa956cfa2d1bd751: function(arg0) {
|
|
396
|
+
const v = arg0;
|
|
397
|
+
const ret = typeof(v) === 'boolean' ? v : undefined;
|
|
398
|
+
return isLikeNone(ret) ? 0xFFFFFF : ret ? 1 : 0;
|
|
399
|
+
},
|
|
400
|
+
__wbg___wbindgen_debug_string_c25d447a39f5578f: function(arg0, arg1) {
|
|
401
|
+
const ret = debugString(arg1);
|
|
402
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
403
|
+
const len1 = WASM_VECTOR_LEN;
|
|
404
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
405
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
406
|
+
},
|
|
407
|
+
__wbg___wbindgen_in_aca499c5de7ff5e5: function(arg0, arg1) {
|
|
408
|
+
const ret = arg0 in arg1;
|
|
409
|
+
return ret;
|
|
410
|
+
},
|
|
411
|
+
__wbg___wbindgen_is_bigint_2f76dc55065b4273: function(arg0) {
|
|
412
|
+
const ret = typeof(arg0) === 'bigint';
|
|
413
|
+
return ret;
|
|
414
|
+
},
|
|
415
|
+
__wbg___wbindgen_is_function_1ff95bcc5517c252: function(arg0) {
|
|
416
|
+
const ret = typeof(arg0) === 'function';
|
|
417
|
+
return ret;
|
|
418
|
+
},
|
|
419
|
+
__wbg___wbindgen_is_object_a27215656b807791: function(arg0) {
|
|
420
|
+
const val = arg0;
|
|
421
|
+
const ret = typeof(val) === 'object' && val !== null;
|
|
422
|
+
return ret;
|
|
423
|
+
},
|
|
424
|
+
__wbg___wbindgen_is_string_ea5e6cc2e4141dfe: function(arg0) {
|
|
425
|
+
const ret = typeof(arg0) === 'string';
|
|
426
|
+
return ret;
|
|
427
|
+
},
|
|
428
|
+
__wbg___wbindgen_is_undefined_c05833b95a3cf397: function(arg0) {
|
|
429
|
+
const ret = arg0 === undefined;
|
|
430
|
+
return ret;
|
|
431
|
+
},
|
|
432
|
+
__wbg___wbindgen_jsval_eq_e659fcf7b0e32763: function(arg0, arg1) {
|
|
433
|
+
const ret = arg0 === arg1;
|
|
434
|
+
return ret;
|
|
435
|
+
},
|
|
436
|
+
__wbg___wbindgen_jsval_loose_eq_db4c3b15f63fc170: function(arg0, arg1) {
|
|
437
|
+
const ret = arg0 == arg1;
|
|
438
|
+
return ret;
|
|
439
|
+
},
|
|
440
|
+
__wbg___wbindgen_memory_de265df8aadd6273: function() {
|
|
441
|
+
const ret = wasm.memory;
|
|
442
|
+
return ret;
|
|
443
|
+
},
|
|
444
|
+
__wbg___wbindgen_number_get_394265ed1e1b84ee: function(arg0, arg1) {
|
|
445
|
+
const obj = arg1;
|
|
446
|
+
const ret = typeof(obj) === 'number' ? obj : undefined;
|
|
447
|
+
getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
|
|
448
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
|
|
449
|
+
},
|
|
450
|
+
__wbg___wbindgen_string_get_b0ca35b86a603356: function(arg0, arg1) {
|
|
451
|
+
const obj = arg1;
|
|
452
|
+
const ret = typeof(obj) === 'string' ? obj : undefined;
|
|
453
|
+
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
454
|
+
var len1 = WASM_VECTOR_LEN;
|
|
455
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
456
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
457
|
+
},
|
|
458
|
+
__wbg___wbindgen_throw_344f42d3211c4765: function(arg0, arg1) {
|
|
459
|
+
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
460
|
+
},
|
|
461
|
+
__wbg_buffer_0f212447ac64c53b: function(arg0) {
|
|
462
|
+
const ret = arg0.buffer;
|
|
463
|
+
return ret;
|
|
464
|
+
},
|
|
465
|
+
__wbg_byteLength_47eafd0bff4dce39: function(arg0) {
|
|
466
|
+
const ret = arg0.byteLength;
|
|
467
|
+
return ret;
|
|
468
|
+
},
|
|
469
|
+
__wbg_call_8a2dd23819f8a60a: function() { return handleError(function (arg0, arg1) {
|
|
470
|
+
const ret = arg0.call(arg1);
|
|
471
|
+
return ret;
|
|
472
|
+
}, arguments); },
|
|
473
|
+
__wbg_done_89b2b13e91a60321: function(arg0) {
|
|
474
|
+
const ret = arg0.done;
|
|
475
|
+
return ret;
|
|
476
|
+
},
|
|
477
|
+
__wbg_entries_015dc610cd81ede0: function(arg0) {
|
|
478
|
+
const ret = Object.entries(arg0);
|
|
479
|
+
return ret;
|
|
480
|
+
},
|
|
481
|
+
__wbg_exec_59eb0bc29e4f02ff: function() { return handleError(function (arg0, arg1, arg2, arg3) {
|
|
482
|
+
arg0.exec(getStringFromWasm0(arg1, arg2), arg3);
|
|
483
|
+
}, arguments); },
|
|
484
|
+
__wbg_get_507a50627bffa49b: function(arg0, arg1) {
|
|
485
|
+
const ret = arg0[arg1 >>> 0];
|
|
486
|
+
return ret;
|
|
487
|
+
},
|
|
488
|
+
__wbg_get_c7eb1f358a7654df: function() { return handleError(function (arg0, arg1) {
|
|
489
|
+
const ret = Reflect.get(arg0, arg1);
|
|
490
|
+
return ret;
|
|
491
|
+
}, arguments); },
|
|
492
|
+
__wbg_get_unchecked_6e0ad6d2a41b06f6: function(arg0, arg1) {
|
|
493
|
+
const ret = arg0[arg1 >>> 0];
|
|
494
|
+
return ret;
|
|
495
|
+
},
|
|
496
|
+
__wbg_get_with_ref_key_6412cf3094599694: function(arg0, arg1) {
|
|
497
|
+
const ret = arg0[arg1];
|
|
498
|
+
return ret;
|
|
499
|
+
},
|
|
500
|
+
__wbg_instanceof_ArrayBuffer_4480b9e0068a8adb: function(arg0) {
|
|
501
|
+
let result;
|
|
502
|
+
try {
|
|
503
|
+
result = arg0 instanceof ArrayBuffer;
|
|
504
|
+
} catch (_) {
|
|
505
|
+
result = false;
|
|
506
|
+
}
|
|
507
|
+
const ret = result;
|
|
508
|
+
return ret;
|
|
509
|
+
},
|
|
510
|
+
__wbg_instanceof_Map_e5b5e3db98422fcc: function(arg0) {
|
|
511
|
+
let result;
|
|
512
|
+
try {
|
|
513
|
+
result = arg0 instanceof Map;
|
|
514
|
+
} catch (_) {
|
|
515
|
+
result = false;
|
|
516
|
+
}
|
|
517
|
+
const ret = result;
|
|
518
|
+
return ret;
|
|
519
|
+
},
|
|
520
|
+
__wbg_instanceof_Memory_2550e651acb3f2f1: function(arg0) {
|
|
521
|
+
let result;
|
|
522
|
+
try {
|
|
523
|
+
result = arg0 instanceof WebAssembly.Memory;
|
|
524
|
+
} catch (_) {
|
|
525
|
+
result = false;
|
|
526
|
+
}
|
|
527
|
+
const ret = result;
|
|
528
|
+
return ret;
|
|
529
|
+
},
|
|
530
|
+
__wbg_instanceof_Uint8Array_309b927aaf7a3fc7: function(arg0) {
|
|
531
|
+
let result;
|
|
532
|
+
try {
|
|
533
|
+
result = arg0 instanceof Uint8Array;
|
|
534
|
+
} catch (_) {
|
|
535
|
+
result = false;
|
|
536
|
+
}
|
|
537
|
+
const ret = result;
|
|
538
|
+
return ret;
|
|
539
|
+
},
|
|
540
|
+
__wbg_isArray_0677c962b281d01a: function(arg0) {
|
|
541
|
+
const ret = Array.isArray(arg0);
|
|
542
|
+
return ret;
|
|
543
|
+
},
|
|
544
|
+
__wbg_isSafeInteger_04f36e4056f1b851: function(arg0) {
|
|
545
|
+
const ret = Number.isSafeInteger(arg0);
|
|
546
|
+
return ret;
|
|
547
|
+
},
|
|
548
|
+
__wbg_iterator_6f722e4a93058b71: function() {
|
|
549
|
+
const ret = Symbol.iterator;
|
|
550
|
+
return ret;
|
|
551
|
+
},
|
|
552
|
+
__wbg_length_1f0964f4a5e2c6d8: function(arg0) {
|
|
553
|
+
const ret = arg0.length;
|
|
554
|
+
return ret;
|
|
555
|
+
},
|
|
556
|
+
__wbg_length_370319915dc99107: function(arg0) {
|
|
557
|
+
const ret = arg0.length;
|
|
558
|
+
return ret;
|
|
559
|
+
},
|
|
560
|
+
__wbg_new_32b398fb48b6d94a: function() {
|
|
561
|
+
const ret = new Array();
|
|
562
|
+
return ret;
|
|
563
|
+
},
|
|
564
|
+
__wbg_new_7796ffc7ed656783: function() {
|
|
565
|
+
const ret = new Map();
|
|
566
|
+
return ret;
|
|
567
|
+
},
|
|
568
|
+
__wbg_new_b667d279fd5aa943: function(arg0, arg1) {
|
|
569
|
+
const ret = new Error(getStringFromWasm0(arg0, arg1));
|
|
570
|
+
return ret;
|
|
571
|
+
},
|
|
572
|
+
__wbg_new_cd45aabdf6073e84: function(arg0) {
|
|
573
|
+
const ret = new Uint8Array(arg0);
|
|
574
|
+
return ret;
|
|
575
|
+
},
|
|
576
|
+
__wbg_new_da52cf8fe3429cb2: function() {
|
|
577
|
+
const ret = new Object();
|
|
578
|
+
return ret;
|
|
579
|
+
},
|
|
580
|
+
__wbg_next_6dbf2c0ac8cde20f: function(arg0) {
|
|
581
|
+
const ret = arg0.next;
|
|
582
|
+
return ret;
|
|
583
|
+
},
|
|
584
|
+
__wbg_next_71f2aa1cb3d1e37e: function() { return handleError(function (arg0) {
|
|
585
|
+
const ret = arg0.next();
|
|
586
|
+
return ret;
|
|
587
|
+
}, arguments); },
|
|
588
|
+
__wbg_prototypesetcall_4770620bbe4688a0: function(arg0, arg1, arg2) {
|
|
589
|
+
Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), arg2);
|
|
590
|
+
},
|
|
591
|
+
__wbg_query_03b6ce598fa1096c: function() { return handleError(function (arg0, arg1, arg2, arg3) {
|
|
592
|
+
const ret = arg0.query(getStringFromWasm0(arg1, arg2), arg3);
|
|
593
|
+
return ret;
|
|
594
|
+
}, arguments); },
|
|
595
|
+
__wbg_set_575dd786d51585f8: function(arg0, arg1, arg2) {
|
|
596
|
+
const ret = arg0.set(arg1, arg2);
|
|
597
|
+
return ret;
|
|
598
|
+
},
|
|
599
|
+
__wbg_set_6be42768c690e380: function(arg0, arg1, arg2) {
|
|
600
|
+
arg0[arg1] = arg2;
|
|
601
|
+
},
|
|
602
|
+
__wbg_set_8535240470bf2500: function() { return handleError(function (arg0, arg1, arg2) {
|
|
603
|
+
const ret = Reflect.set(arg0, arg1, arg2);
|
|
604
|
+
return ret;
|
|
605
|
+
}, arguments); },
|
|
606
|
+
__wbg_set_8a16b38e4805b298: function(arg0, arg1, arg2) {
|
|
607
|
+
arg0[arg1 >>> 0] = arg2;
|
|
608
|
+
},
|
|
609
|
+
__wbg_value_a5d5488a9589444a: function(arg0) {
|
|
610
|
+
const ret = arg0.value;
|
|
611
|
+
return ret;
|
|
612
|
+
},
|
|
613
|
+
__wbindgen_cast_0000000000000001: function(arg0) {
|
|
614
|
+
// Cast intrinsic for `F64 -> Externref`.
|
|
615
|
+
const ret = arg0;
|
|
616
|
+
return ret;
|
|
617
|
+
},
|
|
618
|
+
__wbindgen_cast_0000000000000002: function(arg0) {
|
|
619
|
+
// Cast intrinsic for `I64 -> Externref`.
|
|
620
|
+
const ret = arg0;
|
|
621
|
+
return ret;
|
|
622
|
+
},
|
|
623
|
+
__wbindgen_cast_0000000000000003: function(arg0, arg1) {
|
|
624
|
+
// Cast intrinsic for `Ref(String) -> Externref`.
|
|
625
|
+
const ret = getStringFromWasm0(arg0, arg1);
|
|
626
|
+
return ret;
|
|
627
|
+
},
|
|
628
|
+
__wbindgen_cast_0000000000000004: function(arg0) {
|
|
629
|
+
// Cast intrinsic for `U64 -> Externref`.
|
|
630
|
+
const ret = BigInt.asUintN(64, arg0);
|
|
631
|
+
return ret;
|
|
632
|
+
},
|
|
633
|
+
__wbindgen_init_externref_table: function() {
|
|
634
|
+
const table = wasm.__wbindgen_externrefs;
|
|
635
|
+
const offset = table.grow(4);
|
|
636
|
+
table.set(0, undefined);
|
|
637
|
+
table.set(offset + 0, undefined);
|
|
638
|
+
table.set(offset + 1, null);
|
|
639
|
+
table.set(offset + 2, true);
|
|
640
|
+
table.set(offset + 3, false);
|
|
641
|
+
},
|
|
642
|
+
};
|
|
643
|
+
return {
|
|
644
|
+
__proto__: null,
|
|
645
|
+
"./sync_wasm_bg.js": import0,
|
|
646
|
+
};
|
|
647
|
+
}
|
|
648
|
+
|
|
649
|
+
function addToExternrefTable0(obj) {
|
|
650
|
+
const idx = wasm.__externref_table_alloc();
|
|
651
|
+
wasm.__wbindgen_externrefs.set(idx, obj);
|
|
652
|
+
return idx;
|
|
653
|
+
}
|
|
654
|
+
|
|
655
|
+
function debugString(val) {
|
|
656
|
+
// primitive types
|
|
657
|
+
const type = typeof val;
|
|
658
|
+
if (type == 'number' || type == 'boolean' || val == null) {
|
|
659
|
+
return `${val}`;
|
|
660
|
+
}
|
|
661
|
+
if (type == 'string') {
|
|
662
|
+
return `"${val}"`;
|
|
663
|
+
}
|
|
664
|
+
if (type == 'symbol') {
|
|
665
|
+
const description = val.description;
|
|
666
|
+
if (description == null) {
|
|
667
|
+
return 'Symbol';
|
|
668
|
+
} else {
|
|
669
|
+
return `Symbol(${description})`;
|
|
670
|
+
}
|
|
671
|
+
}
|
|
672
|
+
if (type == 'function') {
|
|
673
|
+
const name = val.name;
|
|
674
|
+
if (typeof name == 'string' && name.length > 0) {
|
|
675
|
+
return `Function(${name})`;
|
|
676
|
+
} else {
|
|
677
|
+
return 'Function';
|
|
678
|
+
}
|
|
679
|
+
}
|
|
680
|
+
// objects
|
|
681
|
+
if (Array.isArray(val)) {
|
|
682
|
+
const length = val.length;
|
|
683
|
+
let debug = '[';
|
|
684
|
+
if (length > 0) {
|
|
685
|
+
debug += debugString(val[0]);
|
|
686
|
+
}
|
|
687
|
+
for(let i = 1; i < length; i++) {
|
|
688
|
+
debug += ', ' + debugString(val[i]);
|
|
689
|
+
}
|
|
690
|
+
debug += ']';
|
|
691
|
+
return debug;
|
|
692
|
+
}
|
|
693
|
+
// Test for built-in
|
|
694
|
+
const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
|
|
695
|
+
let className;
|
|
696
|
+
if (builtInMatches && builtInMatches.length > 1) {
|
|
697
|
+
className = builtInMatches[1];
|
|
698
|
+
} else {
|
|
699
|
+
// Failed to match the standard '[object ClassName]'
|
|
700
|
+
return toString.call(val);
|
|
701
|
+
}
|
|
702
|
+
if (className == 'Object') {
|
|
703
|
+
// we're a user defined class or Object
|
|
704
|
+
// JSON.stringify avoids problems with cycles, and is generally much
|
|
705
|
+
// easier than looping through ownProperties of `val`.
|
|
706
|
+
try {
|
|
707
|
+
return 'Object(' + JSON.stringify(val) + ')';
|
|
708
|
+
} catch (_) {
|
|
709
|
+
return 'Object';
|
|
710
|
+
}
|
|
711
|
+
}
|
|
712
|
+
// errors
|
|
713
|
+
if (val instanceof Error) {
|
|
714
|
+
return `${val.name}: ${val.message}\n${val.stack}`;
|
|
715
|
+
}
|
|
716
|
+
// TODO we could test for more things here, like `Set`s and `Map`s.
|
|
717
|
+
return className;
|
|
718
|
+
}
|
|
719
|
+
|
|
720
|
+
function getArrayU8FromWasm0(ptr, len) {
|
|
721
|
+
ptr = ptr >>> 0;
|
|
722
|
+
return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
|
|
723
|
+
}
|
|
724
|
+
|
|
725
|
+
let cachedDataViewMemory0 = null;
|
|
726
|
+
function getDataViewMemory0() {
|
|
727
|
+
if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
|
|
728
|
+
cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
|
|
729
|
+
}
|
|
730
|
+
return cachedDataViewMemory0;
|
|
731
|
+
}
|
|
732
|
+
|
|
733
|
+
function getStringFromWasm0(ptr, len) {
|
|
734
|
+
return decodeText(ptr >>> 0, len);
|
|
735
|
+
}
|
|
736
|
+
|
|
737
|
+
let cachedUint8ArrayMemory0 = null;
|
|
738
|
+
function getUint8ArrayMemory0() {
|
|
739
|
+
if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
|
|
740
|
+
cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
|
|
741
|
+
}
|
|
742
|
+
return cachedUint8ArrayMemory0;
|
|
743
|
+
}
|
|
744
|
+
|
|
745
|
+
function handleError(f, args) {
|
|
746
|
+
try {
|
|
747
|
+
return f.apply(this, args);
|
|
748
|
+
} catch (e) {
|
|
749
|
+
const idx = addToExternrefTable0(e);
|
|
750
|
+
wasm.__wbindgen_exn_store(idx);
|
|
751
|
+
}
|
|
752
|
+
}
|
|
753
|
+
|
|
754
|
+
function isLikeNone(x) {
|
|
755
|
+
return x === undefined || x === null;
|
|
756
|
+
}
|
|
757
|
+
|
|
758
|
+
function passStringToWasm0(arg, malloc, realloc) {
|
|
759
|
+
if (realloc === undefined) {
|
|
760
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
761
|
+
const ptr = malloc(buf.length, 1) >>> 0;
|
|
762
|
+
getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
|
|
763
|
+
WASM_VECTOR_LEN = buf.length;
|
|
764
|
+
return ptr;
|
|
765
|
+
}
|
|
766
|
+
|
|
767
|
+
let len = arg.length;
|
|
768
|
+
let ptr = malloc(len, 1) >>> 0;
|
|
769
|
+
|
|
770
|
+
const mem = getUint8ArrayMemory0();
|
|
771
|
+
|
|
772
|
+
let offset = 0;
|
|
773
|
+
|
|
774
|
+
for (; offset < len; offset++) {
|
|
775
|
+
const code = arg.charCodeAt(offset);
|
|
776
|
+
if (code > 0x7F) break;
|
|
777
|
+
mem[ptr + offset] = code;
|
|
778
|
+
}
|
|
779
|
+
if (offset !== len) {
|
|
780
|
+
if (offset !== 0) {
|
|
781
|
+
arg = arg.slice(offset);
|
|
782
|
+
}
|
|
783
|
+
ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
|
|
784
|
+
const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
|
|
785
|
+
const ret = cachedTextEncoder.encodeInto(arg, view);
|
|
786
|
+
|
|
787
|
+
offset += ret.written;
|
|
788
|
+
ptr = realloc(ptr, len, offset, 1) >>> 0;
|
|
789
|
+
}
|
|
790
|
+
|
|
791
|
+
WASM_VECTOR_LEN = offset;
|
|
792
|
+
return ptr;
|
|
793
|
+
}
|
|
794
|
+
|
|
795
|
+
function takeFromExternrefTable0(idx) {
|
|
796
|
+
const value = wasm.__wbindgen_externrefs.get(idx);
|
|
797
|
+
wasm.__externref_table_dealloc(idx);
|
|
798
|
+
return value;
|
|
799
|
+
}
|
|
800
|
+
|
|
801
|
+
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
802
|
+
cachedTextDecoder.decode();
|
|
803
|
+
const MAX_SAFARI_DECODE_BYTES = 2146435072;
|
|
804
|
+
let numBytesDecoded = 0;
|
|
805
|
+
function decodeText(ptr, len) {
|
|
806
|
+
numBytesDecoded += len;
|
|
807
|
+
if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
|
|
808
|
+
cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
809
|
+
cachedTextDecoder.decode();
|
|
810
|
+
numBytesDecoded = len;
|
|
811
|
+
}
|
|
812
|
+
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
813
|
+
}
|
|
814
|
+
|
|
815
|
+
const cachedTextEncoder = new TextEncoder();
|
|
816
|
+
|
|
817
|
+
if (!('encodeInto' in cachedTextEncoder)) {
|
|
818
|
+
cachedTextEncoder.encodeInto = function (arg, view) {
|
|
819
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
820
|
+
view.set(buf);
|
|
821
|
+
return {
|
|
822
|
+
read: arg.length,
|
|
823
|
+
written: buf.length
|
|
824
|
+
};
|
|
825
|
+
};
|
|
826
|
+
}
|
|
827
|
+
|
|
828
|
+
let WASM_VECTOR_LEN = 0;
|
|
829
|
+
|
|
830
|
+
let wasmModule, wasmInstance, wasm;
|
|
831
|
+
function __wbg_finalize_init(instance, module) {
|
|
832
|
+
wasmInstance = instance;
|
|
833
|
+
wasm = instance.exports;
|
|
834
|
+
wasmModule = module;
|
|
835
|
+
cachedDataViewMemory0 = null;
|
|
836
|
+
cachedUint8ArrayMemory0 = null;
|
|
837
|
+
wasm.__wbindgen_start();
|
|
838
|
+
return wasm;
|
|
839
|
+
}
|
|
840
|
+
|
|
841
|
+
async function __wbg_load(module, imports) {
|
|
842
|
+
if (typeof Response === 'function' && module instanceof Response) {
|
|
843
|
+
if (typeof WebAssembly.instantiateStreaming === 'function') {
|
|
844
|
+
try {
|
|
845
|
+
return await WebAssembly.instantiateStreaming(module, imports);
|
|
846
|
+
} catch (e) {
|
|
847
|
+
const validResponse = module.ok && expectedResponseType(module.type);
|
|
848
|
+
|
|
849
|
+
if (validResponse && module.headers.get('Content-Type') !== 'application/wasm') {
|
|
850
|
+
console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n", e);
|
|
851
|
+
|
|
852
|
+
} else { throw e; }
|
|
853
|
+
}
|
|
854
|
+
}
|
|
855
|
+
|
|
856
|
+
const bytes = await module.arrayBuffer();
|
|
857
|
+
return await WebAssembly.instantiate(bytes, imports);
|
|
858
|
+
} else {
|
|
859
|
+
const instance = await WebAssembly.instantiate(module, imports);
|
|
860
|
+
|
|
861
|
+
if (instance instanceof WebAssembly.Instance) {
|
|
862
|
+
return { instance, module };
|
|
863
|
+
} else {
|
|
864
|
+
return instance;
|
|
865
|
+
}
|
|
866
|
+
}
|
|
867
|
+
|
|
868
|
+
function expectedResponseType(type) {
|
|
869
|
+
switch (type) {
|
|
870
|
+
case 'basic': case 'cors': case 'default': return true;
|
|
871
|
+
}
|
|
872
|
+
return false;
|
|
873
|
+
}
|
|
874
|
+
}
|
|
875
|
+
|
|
876
|
+
function initSync(module) {
|
|
877
|
+
if (wasm !== undefined) return wasm;
|
|
878
|
+
|
|
879
|
+
|
|
880
|
+
if (module !== undefined) {
|
|
881
|
+
if (Object.getPrototypeOf(module) === Object.prototype) {
|
|
882
|
+
({module} = module)
|
|
883
|
+
} else {
|
|
884
|
+
console.warn('using deprecated parameters for `initSync()`; pass a single object instead')
|
|
885
|
+
}
|
|
886
|
+
}
|
|
887
|
+
|
|
888
|
+
const imports = __wbg_get_imports();
|
|
889
|
+
if (!(module instanceof WebAssembly.Module)) {
|
|
890
|
+
module = new WebAssembly.Module(module);
|
|
891
|
+
}
|
|
892
|
+
const instance = new WebAssembly.Instance(module, imports);
|
|
893
|
+
return __wbg_finalize_init(instance, module);
|
|
894
|
+
}
|
|
895
|
+
|
|
896
|
+
async function __wbg_init(module_or_path) {
|
|
897
|
+
if (wasm !== undefined) return wasm;
|
|
898
|
+
|
|
899
|
+
|
|
900
|
+
if (module_or_path !== undefined) {
|
|
901
|
+
if (Object.getPrototypeOf(module_or_path) === Object.prototype) {
|
|
902
|
+
({module_or_path} = module_or_path)
|
|
903
|
+
} else {
|
|
904
|
+
console.warn('using deprecated parameters for the initialization function; pass a single object instead')
|
|
905
|
+
}
|
|
906
|
+
}
|
|
907
|
+
|
|
908
|
+
if (module_or_path === undefined) {
|
|
909
|
+
module_or_path = new URL('sync_wasm_bg.wasm', import.meta.url);
|
|
910
|
+
}
|
|
911
|
+
const imports = __wbg_get_imports();
|
|
912
|
+
|
|
913
|
+
if (typeof module_or_path === 'string' || (typeof Request === 'function' && module_or_path instanceof Request) || (typeof URL === 'function' && module_or_path instanceof URL)) {
|
|
914
|
+
module_or_path = fetch(module_or_path);
|
|
915
|
+
}
|
|
916
|
+
|
|
917
|
+
const { instance, module } = await __wbg_load(await module_or_path, imports);
|
|
918
|
+
|
|
919
|
+
return __wbg_finalize_init(instance, module);
|
|
920
|
+
}
|
|
921
|
+
|
|
922
|
+
export { initSync, __wbg_init as default };
|