@sqd-pipes/delta-db-wasm 0.0.1-alpha.13
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/delta-db.d.ts +98 -0
- package/delta-db.js +678 -0
- package/delta-db_bg.wasm +0 -0
- package/package.json +8 -0
package/delta-db.d.ts
ADDED
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* WASM binding for DeltaDb.
|
|
6
|
+
*/
|
|
7
|
+
export class DeltaDb {
|
|
8
|
+
free(): void;
|
|
9
|
+
[Symbol.dispose](): void;
|
|
10
|
+
/**
|
|
11
|
+
* Acknowledge a flushed batch by sequence number.
|
|
12
|
+
*/
|
|
13
|
+
ack(sequence: number): void;
|
|
14
|
+
/**
|
|
15
|
+
* Flush buffered deltas. Returns a delta batch object, or null if empty.
|
|
16
|
+
*/
|
|
17
|
+
flush(): any;
|
|
18
|
+
/**
|
|
19
|
+
* Atomic ingest: process all tables, finalize, and return delta batch.
|
|
20
|
+
* Input and output are plain JS objects — no msgpack encoding needed.
|
|
21
|
+
*/
|
|
22
|
+
ingest(input: any): any;
|
|
23
|
+
/**
|
|
24
|
+
* Create a new DeltaDb with in-memory storage.
|
|
25
|
+
*/
|
|
26
|
+
constructor(schema: string);
|
|
27
|
+
/**
|
|
28
|
+
* Register an external reducer with a JS batch callback.
|
|
29
|
+
*
|
|
30
|
+
* The callback receives an array of `{ state, rows }` groups and must
|
|
31
|
+
* return an array of `{ state, emits }` results (same length, same order).
|
|
32
|
+
*
|
|
33
|
+
* Must be called before any `ingest` calls that use this reducer.
|
|
34
|
+
*/
|
|
35
|
+
register_reducer(name: string, source: string, group_by: any, state: any, callback: Function): void;
|
|
36
|
+
/**
|
|
37
|
+
* Find the common ancestor between our state and the portal's chain.
|
|
38
|
+
* Returns the matching block cursor, or null if no common ancestor found.
|
|
39
|
+
*/
|
|
40
|
+
resolve_fork_cursor(previous_blocks: any): any;
|
|
41
|
+
/**
|
|
42
|
+
* Current cursor: latest processed block + hash. Null if no blocks processed.
|
|
43
|
+
*/
|
|
44
|
+
readonly cursor: any;
|
|
45
|
+
/**
|
|
46
|
+
* Whether backpressure should be applied.
|
|
47
|
+
*/
|
|
48
|
+
readonly isBackpressured: boolean;
|
|
49
|
+
/**
|
|
50
|
+
* Number of pending (unflushed) delta records.
|
|
51
|
+
*/
|
|
52
|
+
readonly pendingCount: number;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
|
|
56
|
+
|
|
57
|
+
export interface InitOutput {
|
|
58
|
+
readonly memory: WebAssembly.Memory;
|
|
59
|
+
readonly __wbg_deltadb_free: (a: number, b: number) => void;
|
|
60
|
+
readonly deltadb_ack: (a: number, b: number) => void;
|
|
61
|
+
readonly deltadb_cursor: (a: number) => any;
|
|
62
|
+
readonly deltadb_flush: (a: number) => [number, number, number];
|
|
63
|
+
readonly deltadb_ingest: (a: number, b: any) => [number, number, number];
|
|
64
|
+
readonly deltadb_isBackpressured: (a: number) => number;
|
|
65
|
+
readonly deltadb_new: (a: number, b: number) => [number, number, number];
|
|
66
|
+
readonly deltadb_pendingCount: (a: number) => number;
|
|
67
|
+
readonly deltadb_register_reducer: (a: number, b: number, c: number, d: number, e: number, f: any, g: any, h: any) => [number, number];
|
|
68
|
+
readonly deltadb_resolve_fork_cursor: (a: number, b: any) => [number, number, number];
|
|
69
|
+
readonly __wbindgen_malloc: (a: number, b: number) => number;
|
|
70
|
+
readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|
|
71
|
+
readonly __wbindgen_exn_store: (a: number) => void;
|
|
72
|
+
readonly __externref_table_alloc: () => number;
|
|
73
|
+
readonly __wbindgen_externrefs: WebAssembly.Table;
|
|
74
|
+
readonly __externref_table_dealloc: (a: number) => void;
|
|
75
|
+
readonly __wbindgen_start: () => void;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export type SyncInitInput = BufferSource | WebAssembly.Module;
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Instantiates the given `module`, which can either be bytes or
|
|
82
|
+
* a precompiled `WebAssembly.Module`.
|
|
83
|
+
*
|
|
84
|
+
* @param {{ module: SyncInitInput }} module - Passing `SyncInitInput` directly is deprecated.
|
|
85
|
+
*
|
|
86
|
+
* @returns {InitOutput}
|
|
87
|
+
*/
|
|
88
|
+
export function initSync(module: { module: SyncInitInput } | SyncInitInput): InitOutput;
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* If `module_or_path` is {RequestInfo} or {URL}, makes a request and
|
|
92
|
+
* for everything else, calls `WebAssembly.instantiate` directly.
|
|
93
|
+
*
|
|
94
|
+
* @param {{ module_or_path: InitInput | Promise<InitInput> }} module_or_path - Passing `InitInput` directly is deprecated.
|
|
95
|
+
*
|
|
96
|
+
* @returns {Promise<InitOutput>}
|
|
97
|
+
*/
|
|
98
|
+
export default function __wbg_init (module_or_path?: { module_or_path: InitInput | Promise<InitInput> } | InitInput | Promise<InitInput>): Promise<InitOutput>;
|
package/delta-db.js
ADDED
|
@@ -0,0 +1,678 @@
|
|
|
1
|
+
/* @ts-self-types="./delta_db.d.ts" */
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* WASM binding for DeltaDb.
|
|
5
|
+
*/
|
|
6
|
+
export class DeltaDb {
|
|
7
|
+
__destroy_into_raw() {
|
|
8
|
+
const ptr = this.__wbg_ptr;
|
|
9
|
+
this.__wbg_ptr = 0;
|
|
10
|
+
DeltaDbFinalization.unregister(this);
|
|
11
|
+
return ptr;
|
|
12
|
+
}
|
|
13
|
+
free() {
|
|
14
|
+
const ptr = this.__destroy_into_raw();
|
|
15
|
+
wasm.__wbg_deltadb_free(ptr, 0);
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Acknowledge a flushed batch by sequence number.
|
|
19
|
+
* @param {number} sequence
|
|
20
|
+
*/
|
|
21
|
+
ack(sequence) {
|
|
22
|
+
wasm.deltadb_ack(this.__wbg_ptr, sequence);
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Current cursor: latest processed block + hash. Null if no blocks processed.
|
|
26
|
+
* @returns {any}
|
|
27
|
+
*/
|
|
28
|
+
get cursor() {
|
|
29
|
+
const ret = wasm.deltadb_cursor(this.__wbg_ptr);
|
|
30
|
+
return ret;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Flush buffered deltas. Returns a delta batch object, or null if empty.
|
|
34
|
+
* @returns {any}
|
|
35
|
+
*/
|
|
36
|
+
flush() {
|
|
37
|
+
const ret = wasm.deltadb_flush(this.__wbg_ptr);
|
|
38
|
+
if (ret[2]) {
|
|
39
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
40
|
+
}
|
|
41
|
+
return takeFromExternrefTable0(ret[0]);
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Atomic ingest: process all tables, finalize, and return delta batch.
|
|
45
|
+
* Input and output are plain JS objects — no msgpack encoding needed.
|
|
46
|
+
* @param {any} input
|
|
47
|
+
* @returns {any}
|
|
48
|
+
*/
|
|
49
|
+
ingest(input) {
|
|
50
|
+
const ret = wasm.deltadb_ingest(this.__wbg_ptr, input);
|
|
51
|
+
if (ret[2]) {
|
|
52
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
53
|
+
}
|
|
54
|
+
return takeFromExternrefTable0(ret[0]);
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Whether backpressure should be applied.
|
|
58
|
+
* @returns {boolean}
|
|
59
|
+
*/
|
|
60
|
+
get isBackpressured() {
|
|
61
|
+
const ret = wasm.deltadb_isBackpressured(this.__wbg_ptr);
|
|
62
|
+
return ret !== 0;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Create a new DeltaDb with in-memory storage.
|
|
66
|
+
* @param {string} schema
|
|
67
|
+
*/
|
|
68
|
+
constructor(schema) {
|
|
69
|
+
const ptr0 = passStringToWasm0(schema, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
70
|
+
const len0 = WASM_VECTOR_LEN;
|
|
71
|
+
const ret = wasm.deltadb_new(ptr0, len0);
|
|
72
|
+
if (ret[2]) {
|
|
73
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
74
|
+
}
|
|
75
|
+
this.__wbg_ptr = ret[0] >>> 0;
|
|
76
|
+
DeltaDbFinalization.register(this, this.__wbg_ptr, this);
|
|
77
|
+
return this;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Number of pending (unflushed) delta records.
|
|
81
|
+
* @returns {number}
|
|
82
|
+
*/
|
|
83
|
+
get pendingCount() {
|
|
84
|
+
const ret = wasm.deltadb_pendingCount(this.__wbg_ptr);
|
|
85
|
+
return ret >>> 0;
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Register an external reducer with a JS batch callback.
|
|
89
|
+
*
|
|
90
|
+
* The callback receives an array of `{ state, rows }` groups and must
|
|
91
|
+
* return an array of `{ state, emits }` results (same length, same order).
|
|
92
|
+
*
|
|
93
|
+
* Must be called before any `ingest` calls that use this reducer.
|
|
94
|
+
* @param {string} name
|
|
95
|
+
* @param {string} source
|
|
96
|
+
* @param {any} group_by
|
|
97
|
+
* @param {any} state
|
|
98
|
+
* @param {Function} callback
|
|
99
|
+
*/
|
|
100
|
+
register_reducer(name, source, group_by, state, callback) {
|
|
101
|
+
const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
102
|
+
const len0 = WASM_VECTOR_LEN;
|
|
103
|
+
const ptr1 = passStringToWasm0(source, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
104
|
+
const len1 = WASM_VECTOR_LEN;
|
|
105
|
+
const ret = wasm.deltadb_register_reducer(this.__wbg_ptr, ptr0, len0, ptr1, len1, group_by, state, callback);
|
|
106
|
+
if (ret[1]) {
|
|
107
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Find the common ancestor between our state and the portal's chain.
|
|
112
|
+
* Returns the matching block cursor, or null if no common ancestor found.
|
|
113
|
+
* @param {any} previous_blocks
|
|
114
|
+
* @returns {any}
|
|
115
|
+
*/
|
|
116
|
+
resolve_fork_cursor(previous_blocks) {
|
|
117
|
+
const ret = wasm.deltadb_resolve_fork_cursor(this.__wbg_ptr, previous_blocks);
|
|
118
|
+
if (ret[2]) {
|
|
119
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
120
|
+
}
|
|
121
|
+
return takeFromExternrefTable0(ret[0]);
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
if (Symbol.dispose) DeltaDb.prototype[Symbol.dispose] = DeltaDb.prototype.free;
|
|
125
|
+
|
|
126
|
+
function __wbg_get_imports() {
|
|
127
|
+
const import0 = {
|
|
128
|
+
__proto__: null,
|
|
129
|
+
__wbg_Error_55538483de6e3abe: function(arg0, arg1) {
|
|
130
|
+
const ret = Error(getStringFromWasm0(arg0, arg1));
|
|
131
|
+
return ret;
|
|
132
|
+
},
|
|
133
|
+
__wbg_Number_f257194b7002d6f9: function(arg0) {
|
|
134
|
+
const ret = Number(arg0);
|
|
135
|
+
return ret;
|
|
136
|
+
},
|
|
137
|
+
__wbg_String_8564e559799eccda: function(arg0, arg1) {
|
|
138
|
+
const ret = String(arg1);
|
|
139
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
140
|
+
const len1 = WASM_VECTOR_LEN;
|
|
141
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
142
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
143
|
+
},
|
|
144
|
+
__wbg___wbindgen_bigint_get_as_i64_a738e80c0fe6f6a7: function(arg0, arg1) {
|
|
145
|
+
const v = arg1;
|
|
146
|
+
const ret = typeof(v) === 'bigint' ? v : undefined;
|
|
147
|
+
getDataViewMemory0().setBigInt64(arg0 + 8 * 1, isLikeNone(ret) ? BigInt(0) : ret, true);
|
|
148
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
|
|
149
|
+
},
|
|
150
|
+
__wbg___wbindgen_boolean_get_fe2a24fdfdb4064f: function(arg0) {
|
|
151
|
+
const v = arg0;
|
|
152
|
+
const ret = typeof(v) === 'boolean' ? v : undefined;
|
|
153
|
+
return isLikeNone(ret) ? 0xFFFFFF : ret ? 1 : 0;
|
|
154
|
+
},
|
|
155
|
+
__wbg___wbindgen_debug_string_d89627202d0155b7: function(arg0, arg1) {
|
|
156
|
+
const ret = debugString(arg1);
|
|
157
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
158
|
+
const len1 = WASM_VECTOR_LEN;
|
|
159
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
160
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
161
|
+
},
|
|
162
|
+
__wbg___wbindgen_in_fe3eb6a509f75744: function(arg0, arg1) {
|
|
163
|
+
const ret = arg0 in arg1;
|
|
164
|
+
return ret;
|
|
165
|
+
},
|
|
166
|
+
__wbg___wbindgen_is_bigint_ca270ac12ef71091: function(arg0) {
|
|
167
|
+
const ret = typeof(arg0) === 'bigint';
|
|
168
|
+
return ret;
|
|
169
|
+
},
|
|
170
|
+
__wbg___wbindgen_is_function_2a95406423ea8626: function(arg0) {
|
|
171
|
+
const ret = typeof(arg0) === 'function';
|
|
172
|
+
return ret;
|
|
173
|
+
},
|
|
174
|
+
__wbg___wbindgen_is_null_8d90524c9e0af183: function(arg0) {
|
|
175
|
+
const ret = arg0 === null;
|
|
176
|
+
return ret;
|
|
177
|
+
},
|
|
178
|
+
__wbg___wbindgen_is_object_59a002e76b059312: function(arg0) {
|
|
179
|
+
const val = arg0;
|
|
180
|
+
const ret = typeof(val) === 'object' && val !== null;
|
|
181
|
+
return ret;
|
|
182
|
+
},
|
|
183
|
+
__wbg___wbindgen_is_string_624d5244bb2bc87c: function(arg0) {
|
|
184
|
+
const ret = typeof(arg0) === 'string';
|
|
185
|
+
return ret;
|
|
186
|
+
},
|
|
187
|
+
__wbg___wbindgen_is_undefined_87a3a837f331fef5: function(arg0) {
|
|
188
|
+
const ret = arg0 === undefined;
|
|
189
|
+
return ret;
|
|
190
|
+
},
|
|
191
|
+
__wbg___wbindgen_jsval_eq_eedd705f9f2a4f35: function(arg0, arg1) {
|
|
192
|
+
const ret = arg0 === arg1;
|
|
193
|
+
return ret;
|
|
194
|
+
},
|
|
195
|
+
__wbg___wbindgen_jsval_loose_eq_cf851f110c48f9ba: function(arg0, arg1) {
|
|
196
|
+
const ret = arg0 == arg1;
|
|
197
|
+
return ret;
|
|
198
|
+
},
|
|
199
|
+
__wbg___wbindgen_number_get_769f3676dc20c1d7: function(arg0, arg1) {
|
|
200
|
+
const obj = arg1;
|
|
201
|
+
const ret = typeof(obj) === 'number' ? obj : undefined;
|
|
202
|
+
getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
|
|
203
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
|
|
204
|
+
},
|
|
205
|
+
__wbg___wbindgen_string_get_f1161390414f9b59: function(arg0, arg1) {
|
|
206
|
+
const obj = arg1;
|
|
207
|
+
const ret = typeof(obj) === 'string' ? obj : undefined;
|
|
208
|
+
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
209
|
+
var len1 = WASM_VECTOR_LEN;
|
|
210
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
211
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
212
|
+
},
|
|
213
|
+
__wbg___wbindgen_throw_5549492daedad139: function(arg0, arg1) {
|
|
214
|
+
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
215
|
+
},
|
|
216
|
+
__wbg_call_6ae20895a60069a2: function() { return handleError(function (arg0, arg1) {
|
|
217
|
+
const ret = arg0.call(arg1);
|
|
218
|
+
return ret;
|
|
219
|
+
}, arguments); },
|
|
220
|
+
__wbg_call_8f5d7bb070283508: function() { return handleError(function (arg0, arg1, arg2) {
|
|
221
|
+
const ret = arg0.call(arg1, arg2);
|
|
222
|
+
return ret;
|
|
223
|
+
}, arguments); },
|
|
224
|
+
__wbg_done_19f92cb1f8738aba: function(arg0) {
|
|
225
|
+
const ret = arg0.done;
|
|
226
|
+
return ret;
|
|
227
|
+
},
|
|
228
|
+
__wbg_entries_28ed7cb892e12eff: function(arg0) {
|
|
229
|
+
const ret = Object.entries(arg0);
|
|
230
|
+
return ret;
|
|
231
|
+
},
|
|
232
|
+
__wbg_get_94f5fc088edd3138: function(arg0, arg1) {
|
|
233
|
+
const ret = arg0[arg1 >>> 0];
|
|
234
|
+
return ret;
|
|
235
|
+
},
|
|
236
|
+
__wbg_get_a50328e7325d7f9b: function() { return handleError(function (arg0, arg1) {
|
|
237
|
+
const ret = Reflect.get(arg0, arg1);
|
|
238
|
+
return ret;
|
|
239
|
+
}, arguments); },
|
|
240
|
+
__wbg_get_ff5f1fb220233477: function() { return handleError(function (arg0, arg1) {
|
|
241
|
+
const ret = Reflect.get(arg0, arg1);
|
|
242
|
+
return ret;
|
|
243
|
+
}, arguments); },
|
|
244
|
+
__wbg_get_unchecked_7c6bbabf5b0b1fbf: function(arg0, arg1) {
|
|
245
|
+
const ret = arg0[arg1 >>> 0];
|
|
246
|
+
return ret;
|
|
247
|
+
},
|
|
248
|
+
__wbg_get_with_ref_key_6412cf3094599694: function(arg0, arg1) {
|
|
249
|
+
const ret = arg0[arg1];
|
|
250
|
+
return ret;
|
|
251
|
+
},
|
|
252
|
+
__wbg_instanceof_ArrayBuffer_8d855993947fc3a2: function(arg0) {
|
|
253
|
+
let result;
|
|
254
|
+
try {
|
|
255
|
+
result = arg0 instanceof ArrayBuffer;
|
|
256
|
+
} catch (_) {
|
|
257
|
+
result = false;
|
|
258
|
+
}
|
|
259
|
+
const ret = result;
|
|
260
|
+
return ret;
|
|
261
|
+
},
|
|
262
|
+
__wbg_instanceof_Map_238410f1463c05ed: function(arg0) {
|
|
263
|
+
let result;
|
|
264
|
+
try {
|
|
265
|
+
result = arg0 instanceof Map;
|
|
266
|
+
} catch (_) {
|
|
267
|
+
result = false;
|
|
268
|
+
}
|
|
269
|
+
const ret = result;
|
|
270
|
+
return ret;
|
|
271
|
+
},
|
|
272
|
+
__wbg_instanceof_Object_d622a5764f4f9002: function(arg0) {
|
|
273
|
+
let result;
|
|
274
|
+
try {
|
|
275
|
+
result = arg0 instanceof Object;
|
|
276
|
+
} catch (_) {
|
|
277
|
+
result = false;
|
|
278
|
+
}
|
|
279
|
+
const ret = result;
|
|
280
|
+
return ret;
|
|
281
|
+
},
|
|
282
|
+
__wbg_instanceof_Uint8Array_ce24d58a5f4bdcc3: function(arg0) {
|
|
283
|
+
let result;
|
|
284
|
+
try {
|
|
285
|
+
result = arg0 instanceof Uint8Array;
|
|
286
|
+
} catch (_) {
|
|
287
|
+
result = false;
|
|
288
|
+
}
|
|
289
|
+
const ret = result;
|
|
290
|
+
return ret;
|
|
291
|
+
},
|
|
292
|
+
__wbg_isArray_867202cf8f195ed8: function(arg0) {
|
|
293
|
+
const ret = Array.isArray(arg0);
|
|
294
|
+
return ret;
|
|
295
|
+
},
|
|
296
|
+
__wbg_isSafeInteger_1dfae065cbfe1915: function(arg0) {
|
|
297
|
+
const ret = Number.isSafeInteger(arg0);
|
|
298
|
+
return ret;
|
|
299
|
+
},
|
|
300
|
+
__wbg_iterator_54661826e186eb6a: function() {
|
|
301
|
+
const ret = Symbol.iterator;
|
|
302
|
+
return ret;
|
|
303
|
+
},
|
|
304
|
+
__wbg_keys_e84d806594765111: function(arg0) {
|
|
305
|
+
const ret = Object.keys(arg0);
|
|
306
|
+
return ret;
|
|
307
|
+
},
|
|
308
|
+
__wbg_length_e6e1633fbea6cfa9: function(arg0) {
|
|
309
|
+
const ret = arg0.length;
|
|
310
|
+
return ret;
|
|
311
|
+
},
|
|
312
|
+
__wbg_length_fae3e439140f48a4: function(arg0) {
|
|
313
|
+
const ret = arg0.length;
|
|
314
|
+
return ret;
|
|
315
|
+
},
|
|
316
|
+
__wbg_new_0934b88171ef61b0: function() {
|
|
317
|
+
const ret = new Map();
|
|
318
|
+
return ret;
|
|
319
|
+
},
|
|
320
|
+
__wbg_new_1d96678aaacca32e: function(arg0) {
|
|
321
|
+
const ret = new Uint8Array(arg0);
|
|
322
|
+
return ret;
|
|
323
|
+
},
|
|
324
|
+
__wbg_new_4370be21fa2b2f80: function() {
|
|
325
|
+
const ret = new Array();
|
|
326
|
+
return ret;
|
|
327
|
+
},
|
|
328
|
+
__wbg_new_48e1d86cfd30c8e7: function() {
|
|
329
|
+
const ret = new Object();
|
|
330
|
+
return ret;
|
|
331
|
+
},
|
|
332
|
+
__wbg_next_55d835fe0ab5b3e7: function(arg0) {
|
|
333
|
+
const ret = arg0.next;
|
|
334
|
+
return ret;
|
|
335
|
+
},
|
|
336
|
+
__wbg_next_e34cfb9df1518d7c: function() { return handleError(function (arg0) {
|
|
337
|
+
const ret = arg0.next();
|
|
338
|
+
return ret;
|
|
339
|
+
}, arguments); },
|
|
340
|
+
__wbg_prototypesetcall_3875d54d12ef2eec: function(arg0, arg1, arg2) {
|
|
341
|
+
Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), arg2);
|
|
342
|
+
},
|
|
343
|
+
__wbg_push_d0006a37f9fcda6d: function(arg0, arg1) {
|
|
344
|
+
const ret = arg0.push(arg1);
|
|
345
|
+
return ret;
|
|
346
|
+
},
|
|
347
|
+
__wbg_set_4702dfa37c77f492: function(arg0, arg1, arg2) {
|
|
348
|
+
arg0[arg1 >>> 0] = arg2;
|
|
349
|
+
},
|
|
350
|
+
__wbg_set_6be42768c690e380: function(arg0, arg1, arg2) {
|
|
351
|
+
arg0[arg1] = arg2;
|
|
352
|
+
},
|
|
353
|
+
__wbg_set_8c6629931852a4a5: function(arg0, arg1, arg2) {
|
|
354
|
+
const ret = arg0.set(arg1, arg2);
|
|
355
|
+
return ret;
|
|
356
|
+
},
|
|
357
|
+
__wbg_set_991082a7a49971cf: function() { return handleError(function (arg0, arg1, arg2) {
|
|
358
|
+
const ret = Reflect.set(arg0, arg1, arg2);
|
|
359
|
+
return ret;
|
|
360
|
+
}, arguments); },
|
|
361
|
+
__wbg_value_d5b248ce8419bd1b: function(arg0) {
|
|
362
|
+
const ret = arg0.value;
|
|
363
|
+
return ret;
|
|
364
|
+
},
|
|
365
|
+
__wbindgen_cast_0000000000000001: function(arg0) {
|
|
366
|
+
// Cast intrinsic for `F64 -> Externref`.
|
|
367
|
+
const ret = arg0;
|
|
368
|
+
return ret;
|
|
369
|
+
},
|
|
370
|
+
__wbindgen_cast_0000000000000002: function(arg0) {
|
|
371
|
+
// Cast intrinsic for `I64 -> Externref`.
|
|
372
|
+
const ret = arg0;
|
|
373
|
+
return ret;
|
|
374
|
+
},
|
|
375
|
+
__wbindgen_cast_0000000000000003: function(arg0, arg1) {
|
|
376
|
+
// Cast intrinsic for `Ref(String) -> Externref`.
|
|
377
|
+
const ret = getStringFromWasm0(arg0, arg1);
|
|
378
|
+
return ret;
|
|
379
|
+
},
|
|
380
|
+
__wbindgen_cast_0000000000000004: function(arg0) {
|
|
381
|
+
// Cast intrinsic for `U64 -> Externref`.
|
|
382
|
+
const ret = BigInt.asUintN(64, arg0);
|
|
383
|
+
return ret;
|
|
384
|
+
},
|
|
385
|
+
__wbindgen_init_externref_table: function() {
|
|
386
|
+
const table = wasm.__wbindgen_externrefs;
|
|
387
|
+
const offset = table.grow(4);
|
|
388
|
+
table.set(0, undefined);
|
|
389
|
+
table.set(offset + 0, undefined);
|
|
390
|
+
table.set(offset + 1, null);
|
|
391
|
+
table.set(offset + 2, true);
|
|
392
|
+
table.set(offset + 3, false);
|
|
393
|
+
},
|
|
394
|
+
};
|
|
395
|
+
return {
|
|
396
|
+
__proto__: null,
|
|
397
|
+
"./delta_db_bg.js": import0,
|
|
398
|
+
};
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
const DeltaDbFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
402
|
+
? { register: () => {}, unregister: () => {} }
|
|
403
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_deltadb_free(ptr >>> 0, 1));
|
|
404
|
+
|
|
405
|
+
function addToExternrefTable0(obj) {
|
|
406
|
+
const idx = wasm.__externref_table_alloc();
|
|
407
|
+
wasm.__wbindgen_externrefs.set(idx, obj);
|
|
408
|
+
return idx;
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
function debugString(val) {
|
|
412
|
+
// primitive types
|
|
413
|
+
const type = typeof val;
|
|
414
|
+
if (type == 'number' || type == 'boolean' || val == null) {
|
|
415
|
+
return `${val}`;
|
|
416
|
+
}
|
|
417
|
+
if (type == 'string') {
|
|
418
|
+
return `"${val}"`;
|
|
419
|
+
}
|
|
420
|
+
if (type == 'symbol') {
|
|
421
|
+
const description = val.description;
|
|
422
|
+
if (description == null) {
|
|
423
|
+
return 'Symbol';
|
|
424
|
+
} else {
|
|
425
|
+
return `Symbol(${description})`;
|
|
426
|
+
}
|
|
427
|
+
}
|
|
428
|
+
if (type == 'function') {
|
|
429
|
+
const name = val.name;
|
|
430
|
+
if (typeof name == 'string' && name.length > 0) {
|
|
431
|
+
return `Function(${name})`;
|
|
432
|
+
} else {
|
|
433
|
+
return 'Function';
|
|
434
|
+
}
|
|
435
|
+
}
|
|
436
|
+
// objects
|
|
437
|
+
if (Array.isArray(val)) {
|
|
438
|
+
const length = val.length;
|
|
439
|
+
let debug = '[';
|
|
440
|
+
if (length > 0) {
|
|
441
|
+
debug += debugString(val[0]);
|
|
442
|
+
}
|
|
443
|
+
for(let i = 1; i < length; i++) {
|
|
444
|
+
debug += ', ' + debugString(val[i]);
|
|
445
|
+
}
|
|
446
|
+
debug += ']';
|
|
447
|
+
return debug;
|
|
448
|
+
}
|
|
449
|
+
// Test for built-in
|
|
450
|
+
const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
|
|
451
|
+
let className;
|
|
452
|
+
if (builtInMatches && builtInMatches.length > 1) {
|
|
453
|
+
className = builtInMatches[1];
|
|
454
|
+
} else {
|
|
455
|
+
// Failed to match the standard '[object ClassName]'
|
|
456
|
+
return toString.call(val);
|
|
457
|
+
}
|
|
458
|
+
if (className == 'Object') {
|
|
459
|
+
// we're a user defined class or Object
|
|
460
|
+
// JSON.stringify avoids problems with cycles, and is generally much
|
|
461
|
+
// easier than looping through ownProperties of `val`.
|
|
462
|
+
try {
|
|
463
|
+
return 'Object(' + JSON.stringify(val) + ')';
|
|
464
|
+
} catch (_) {
|
|
465
|
+
return 'Object';
|
|
466
|
+
}
|
|
467
|
+
}
|
|
468
|
+
// errors
|
|
469
|
+
if (val instanceof Error) {
|
|
470
|
+
return `${val.name}: ${val.message}\n${val.stack}`;
|
|
471
|
+
}
|
|
472
|
+
// TODO we could test for more things here, like `Set`s and `Map`s.
|
|
473
|
+
return className;
|
|
474
|
+
}
|
|
475
|
+
|
|
476
|
+
function getArrayU8FromWasm0(ptr, len) {
|
|
477
|
+
ptr = ptr >>> 0;
|
|
478
|
+
return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
|
|
479
|
+
}
|
|
480
|
+
|
|
481
|
+
let cachedDataViewMemory0 = null;
|
|
482
|
+
function getDataViewMemory0() {
|
|
483
|
+
if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
|
|
484
|
+
cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
|
|
485
|
+
}
|
|
486
|
+
return cachedDataViewMemory0;
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
function getStringFromWasm0(ptr, len) {
|
|
490
|
+
ptr = ptr >>> 0;
|
|
491
|
+
return decodeText(ptr, len);
|
|
492
|
+
}
|
|
493
|
+
|
|
494
|
+
let cachedUint8ArrayMemory0 = null;
|
|
495
|
+
function getUint8ArrayMemory0() {
|
|
496
|
+
if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
|
|
497
|
+
cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
|
|
498
|
+
}
|
|
499
|
+
return cachedUint8ArrayMemory0;
|
|
500
|
+
}
|
|
501
|
+
|
|
502
|
+
function handleError(f, args) {
|
|
503
|
+
try {
|
|
504
|
+
return f.apply(this, args);
|
|
505
|
+
} catch (e) {
|
|
506
|
+
const idx = addToExternrefTable0(e);
|
|
507
|
+
wasm.__wbindgen_exn_store(idx);
|
|
508
|
+
}
|
|
509
|
+
}
|
|
510
|
+
|
|
511
|
+
function isLikeNone(x) {
|
|
512
|
+
return x === undefined || x === null;
|
|
513
|
+
}
|
|
514
|
+
|
|
515
|
+
function passStringToWasm0(arg, malloc, realloc) {
|
|
516
|
+
if (realloc === undefined) {
|
|
517
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
518
|
+
const ptr = malloc(buf.length, 1) >>> 0;
|
|
519
|
+
getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
|
|
520
|
+
WASM_VECTOR_LEN = buf.length;
|
|
521
|
+
return ptr;
|
|
522
|
+
}
|
|
523
|
+
|
|
524
|
+
let len = arg.length;
|
|
525
|
+
let ptr = malloc(len, 1) >>> 0;
|
|
526
|
+
|
|
527
|
+
const mem = getUint8ArrayMemory0();
|
|
528
|
+
|
|
529
|
+
let offset = 0;
|
|
530
|
+
|
|
531
|
+
for (; offset < len; offset++) {
|
|
532
|
+
const code = arg.charCodeAt(offset);
|
|
533
|
+
if (code > 0x7F) break;
|
|
534
|
+
mem[ptr + offset] = code;
|
|
535
|
+
}
|
|
536
|
+
if (offset !== len) {
|
|
537
|
+
if (offset !== 0) {
|
|
538
|
+
arg = arg.slice(offset);
|
|
539
|
+
}
|
|
540
|
+
ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
|
|
541
|
+
const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
|
|
542
|
+
const ret = cachedTextEncoder.encodeInto(arg, view);
|
|
543
|
+
|
|
544
|
+
offset += ret.written;
|
|
545
|
+
ptr = realloc(ptr, len, offset, 1) >>> 0;
|
|
546
|
+
}
|
|
547
|
+
|
|
548
|
+
WASM_VECTOR_LEN = offset;
|
|
549
|
+
return ptr;
|
|
550
|
+
}
|
|
551
|
+
|
|
552
|
+
function takeFromExternrefTable0(idx) {
|
|
553
|
+
const value = wasm.__wbindgen_externrefs.get(idx);
|
|
554
|
+
wasm.__externref_table_dealloc(idx);
|
|
555
|
+
return value;
|
|
556
|
+
}
|
|
557
|
+
|
|
558
|
+
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
559
|
+
cachedTextDecoder.decode();
|
|
560
|
+
const MAX_SAFARI_DECODE_BYTES = 2146435072;
|
|
561
|
+
let numBytesDecoded = 0;
|
|
562
|
+
function decodeText(ptr, len) {
|
|
563
|
+
numBytesDecoded += len;
|
|
564
|
+
if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
|
|
565
|
+
cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
566
|
+
cachedTextDecoder.decode();
|
|
567
|
+
numBytesDecoded = len;
|
|
568
|
+
}
|
|
569
|
+
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
570
|
+
}
|
|
571
|
+
|
|
572
|
+
const cachedTextEncoder = new TextEncoder();
|
|
573
|
+
|
|
574
|
+
if (!('encodeInto' in cachedTextEncoder)) {
|
|
575
|
+
cachedTextEncoder.encodeInto = function (arg, view) {
|
|
576
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
577
|
+
view.set(buf);
|
|
578
|
+
return {
|
|
579
|
+
read: arg.length,
|
|
580
|
+
written: buf.length
|
|
581
|
+
};
|
|
582
|
+
};
|
|
583
|
+
}
|
|
584
|
+
|
|
585
|
+
let WASM_VECTOR_LEN = 0;
|
|
586
|
+
|
|
587
|
+
let wasmModule, wasm;
|
|
588
|
+
function __wbg_finalize_init(instance, module) {
|
|
589
|
+
wasm = instance.exports;
|
|
590
|
+
wasmModule = module;
|
|
591
|
+
cachedDataViewMemory0 = null;
|
|
592
|
+
cachedUint8ArrayMemory0 = null;
|
|
593
|
+
wasm.__wbindgen_start();
|
|
594
|
+
return wasm;
|
|
595
|
+
}
|
|
596
|
+
|
|
597
|
+
async function __wbg_load(module, imports) {
|
|
598
|
+
if (typeof Response === 'function' && module instanceof Response) {
|
|
599
|
+
if (typeof WebAssembly.instantiateStreaming === 'function') {
|
|
600
|
+
try {
|
|
601
|
+
return await WebAssembly.instantiateStreaming(module, imports);
|
|
602
|
+
} catch (e) {
|
|
603
|
+
const validResponse = module.ok && expectedResponseType(module.type);
|
|
604
|
+
|
|
605
|
+
if (validResponse && module.headers.get('Content-Type') !== 'application/wasm') {
|
|
606
|
+
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);
|
|
607
|
+
|
|
608
|
+
} else { throw e; }
|
|
609
|
+
}
|
|
610
|
+
}
|
|
611
|
+
|
|
612
|
+
const bytes = await module.arrayBuffer();
|
|
613
|
+
return await WebAssembly.instantiate(bytes, imports);
|
|
614
|
+
} else {
|
|
615
|
+
const instance = await WebAssembly.instantiate(module, imports);
|
|
616
|
+
|
|
617
|
+
if (instance instanceof WebAssembly.Instance) {
|
|
618
|
+
return { instance, module };
|
|
619
|
+
} else {
|
|
620
|
+
return instance;
|
|
621
|
+
}
|
|
622
|
+
}
|
|
623
|
+
|
|
624
|
+
function expectedResponseType(type) {
|
|
625
|
+
switch (type) {
|
|
626
|
+
case 'basic': case 'cors': case 'default': return true;
|
|
627
|
+
}
|
|
628
|
+
return false;
|
|
629
|
+
}
|
|
630
|
+
}
|
|
631
|
+
|
|
632
|
+
function initSync(module) {
|
|
633
|
+
if (wasm !== undefined) return wasm;
|
|
634
|
+
|
|
635
|
+
|
|
636
|
+
if (module !== undefined) {
|
|
637
|
+
if (Object.getPrototypeOf(module) === Object.prototype) {
|
|
638
|
+
({module} = module)
|
|
639
|
+
} else {
|
|
640
|
+
console.warn('using deprecated parameters for `initSync()`; pass a single object instead')
|
|
641
|
+
}
|
|
642
|
+
}
|
|
643
|
+
|
|
644
|
+
const imports = __wbg_get_imports();
|
|
645
|
+
if (!(module instanceof WebAssembly.Module)) {
|
|
646
|
+
module = new WebAssembly.Module(module);
|
|
647
|
+
}
|
|
648
|
+
const instance = new WebAssembly.Instance(module, imports);
|
|
649
|
+
return __wbg_finalize_init(instance, module);
|
|
650
|
+
}
|
|
651
|
+
|
|
652
|
+
async function __wbg_init(module_or_path) {
|
|
653
|
+
if (wasm !== undefined) return wasm;
|
|
654
|
+
|
|
655
|
+
|
|
656
|
+
if (module_or_path !== undefined) {
|
|
657
|
+
if (Object.getPrototypeOf(module_or_path) === Object.prototype) {
|
|
658
|
+
({module_or_path} = module_or_path)
|
|
659
|
+
} else {
|
|
660
|
+
console.warn('using deprecated parameters for the initialization function; pass a single object instead')
|
|
661
|
+
}
|
|
662
|
+
}
|
|
663
|
+
|
|
664
|
+
if (module_or_path === undefined) {
|
|
665
|
+
module_or_path = new URL('delta_db_bg.wasm', import.meta.url);
|
|
666
|
+
}
|
|
667
|
+
const imports = __wbg_get_imports();
|
|
668
|
+
|
|
669
|
+
if (typeof module_or_path === 'string' || (typeof Request === 'function' && module_or_path instanceof Request) || (typeof URL === 'function' && module_or_path instanceof URL)) {
|
|
670
|
+
module_or_path = fetch(module_or_path);
|
|
671
|
+
}
|
|
672
|
+
|
|
673
|
+
const { instance, module } = await __wbg_load(await module_or_path, imports);
|
|
674
|
+
|
|
675
|
+
return __wbg_finalize_init(instance, module);
|
|
676
|
+
}
|
|
677
|
+
|
|
678
|
+
export { initSync, __wbg_init as default };
|
package/delta-db_bg.wasm
ADDED
|
Binary file
|