jazz-wasm 2.0.0-alpha.20 → 2.0.0-alpha.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jazz-wasm",
3
- "version": "2.0.0-alpha.20",
3
+ "version": "2.0.0-alpha.22",
4
4
  "description": "WebAssembly bindings for the Jazz database engine",
5
5
  "keywords": [
6
6
  "crdt",
@@ -24,9 +24,6 @@
24
24
  "access": "public",
25
25
  "tag": "alpha"
26
26
  },
27
- "devDependencies": {
28
- "wasm-pack": "^0.14.0"
29
- },
30
27
  "scripts": {
31
28
  "build": "wasm-pack build --target web --profiling"
32
29
  }
@@ -122,7 +122,7 @@ export class WasmRuntime {
122
122
  * catalogue sync messages (from queue_full_sync_to_server) are sent
123
123
  * before the call returns, rather than being deferred to a microtask.
124
124
  */
125
- addServer(): void;
125
+ addServer(server_catalogue_state_hash?: string | null): void;
126
126
  /**
127
127
  * Phase 1 of 2-phase subscribe: allocate a handle and store query params.
128
128
  * No compilation, no sync, no tick — just bookkeeping.
@@ -140,11 +140,11 @@ export class WasmRuntime {
140
140
  * Delete a row and return a Promise that resolves when the tier acks,
141
141
  * scoped to an explicit session principal.
142
142
  */
143
- deleteDurableWithSession(object_id: string, session_json: string | null | undefined, tier: string): Promise<any>;
143
+ deleteDurableWithSession(object_id: string, write_context_json: string | null | undefined, tier: string): Promise<any>;
144
144
  /**
145
145
  * Delete a row by ObjectId as an explicit session principal.
146
146
  */
147
- deleteWithSession(object_id: string, session_json?: string | null): void;
147
+ deleteWithSession(object_id: string, write_context_json?: string | null): void;
148
148
  /**
149
149
  * Phase 2 of 2-phase subscribe: compile graph, register subscription,
150
150
  * sync to servers, attach callback, and deliver the first delta.
@@ -185,11 +185,11 @@ export class WasmRuntime {
185
185
  * Insert a row and return a Promise that resolves when the tier acks,
186
186
  * scoped to an explicit session principal.
187
187
  */
188
- insertDurableWithSession(table: string, values: any, session_json: string | null | undefined, tier: string): Promise<any>;
188
+ insertDurableWithSession(table: string, values: any, write_context_json: string | null | undefined, tier: string): Promise<any>;
189
189
  /**
190
190
  * Insert a row into a table as an explicit session principal.
191
191
  */
192
- insertWithSession(table: string, values: any, session_json?: string | null): any;
192
+ insertWithSession(table: string, values: any, write_context_json?: string | null): any;
193
193
  /**
194
194
  * Create a new WasmRuntime.
195
195
  *
@@ -280,7 +280,7 @@ export class WasmRuntime {
280
280
  * Update a row and return a Promise that resolves when the tier acks,
281
281
  * scoped to an explicit session principal.
282
282
  */
283
- updateDurableWithSession(object_id: string, values: any, session_json: string | null | undefined, tier: string): Promise<any>;
283
+ updateDurableWithSession(object_id: string, values: any, write_context_json: string | null | undefined, tier: string): Promise<any>;
284
284
  /**
285
285
  * Update a row by ObjectId as an explicit session principal.
286
286
  *
@@ -289,7 +289,7 @@ export class WasmRuntime {
289
289
  * * `values` - Partial update map (`{ columnName: Value }`)
290
290
  * * `session_json` - Optional JSON-encoded Session used for policy checks
291
291
  */
292
- updateWithSession(object_id: string, values: any, session_json?: string | null): void;
292
+ updateWithSession(object_id: string, values: any, write_context_json?: string | null): void;
293
293
  }
294
294
 
295
295
  export function bench_get_cache_bytes(): number;
@@ -368,11 +368,37 @@ export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembl
368
368
 
369
369
  export interface InitOutput {
370
370
  readonly memory: WebAssembly.Memory;
371
+ readonly __wbg_wasmquerybuilder_free: (a: number, b: number) => void;
372
+ readonly currentTimestamp: () => bigint;
373
+ readonly generateId: () => [number, number];
374
+ readonly parseSchema: (a: number, b: number) => [number, number, number];
375
+ readonly wasmquerybuilder_alias: (a: number, b: number, c: number) => number;
376
+ readonly wasmquerybuilder_branch: (a: number, b: number, c: number) => number;
377
+ readonly wasmquerybuilder_branches: (a: number, b: number, c: number) => number;
378
+ readonly wasmquerybuilder_build: (a: number) => [number, number, number, number];
379
+ readonly wasmquerybuilder_buildJs: (a: number) => [number, number, number];
380
+ readonly wasmquerybuilder_filterEq: (a: number, b: number, c: number, d: any) => [number, number, number];
381
+ readonly wasmquerybuilder_filterGe: (a: number, b: number, c: number, d: any) => [number, number, number];
382
+ readonly wasmquerybuilder_filterGt: (a: number, b: number, c: number, d: any) => [number, number, number];
383
+ readonly wasmquerybuilder_filterLe: (a: number, b: number, c: number, d: any) => [number, number, number];
384
+ readonly wasmquerybuilder_filterLt: (a: number, b: number, c: number, d: any) => [number, number, number];
385
+ readonly wasmquerybuilder_filterNe: (a: number, b: number, c: number, d: any) => [number, number, number];
386
+ readonly wasmquerybuilder_includeDeleted: (a: number) => number;
387
+ readonly wasmquerybuilder_join: (a: number, b: number, c: number) => number;
388
+ readonly wasmquerybuilder_limit: (a: number, b: number) => number;
389
+ readonly wasmquerybuilder_new: (a: number, b: number) => number;
390
+ readonly wasmquerybuilder_offset: (a: number, b: number) => number;
391
+ readonly wasmquerybuilder_on: (a: number, b: number, c: number, d: number, e: number) => number;
392
+ readonly wasmquerybuilder_or: (a: number) => number;
393
+ readonly wasmquerybuilder_orderBy: (a: number, b: number, c: number) => number;
394
+ readonly wasmquerybuilder_orderByDesc: (a: number, b: number, c: number) => number;
395
+ readonly wasmquerybuilder_select: (a: number, b: number, c: number) => number;
396
+ readonly init: () => void;
371
397
  readonly __wbg_wasmruntime_free: (a: number, b: number) => void;
372
398
  readonly wasmruntime___debugSchemaState: (a: number) => [number, number, number];
373
399
  readonly wasmruntime___debugSeedLiveSchema: (a: number, b: number, c: number) => [number, number];
374
400
  readonly wasmruntime_addClient: (a: number) => [number, number];
375
- readonly wasmruntime_addServer: (a: number) => void;
401
+ readonly wasmruntime_addServer: (a: number, b: number, c: number) => void;
376
402
  readonly wasmruntime_createSubscription: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number) => [number, number, number];
377
403
  readonly wasmruntime_delete: (a: number, b: number, c: number) => [number, number];
378
404
  readonly wasmruntime_deleteDurable: (a: number, b: number, c: number, d: number, e: number) => [number, number, number];
@@ -401,32 +427,6 @@ export interface InitOutput {
401
427
  readonly wasmruntime_updateDurable: (a: number, b: number, c: number, d: any, e: number, f: number) => [number, number, number];
402
428
  readonly wasmruntime_updateDurableWithSession: (a: number, b: number, c: number, d: any, e: number, f: number, g: number, h: number) => [number, number, number];
403
429
  readonly wasmruntime_updateWithSession: (a: number, b: number, c: number, d: any, e: number, f: number) => [number, number];
404
- readonly __wbg_wasmquerybuilder_free: (a: number, b: number) => void;
405
- readonly currentTimestamp: () => bigint;
406
- readonly generateId: () => [number, number];
407
- readonly parseSchema: (a: number, b: number) => [number, number, number];
408
- readonly wasmquerybuilder_alias: (a: number, b: number, c: number) => number;
409
- readonly wasmquerybuilder_branch: (a: number, b: number, c: number) => number;
410
- readonly wasmquerybuilder_branches: (a: number, b: number, c: number) => number;
411
- readonly wasmquerybuilder_build: (a: number) => [number, number, number, number];
412
- readonly wasmquerybuilder_buildJs: (a: number) => [number, number, number];
413
- readonly wasmquerybuilder_filterEq: (a: number, b: number, c: number, d: any) => [number, number, number];
414
- readonly wasmquerybuilder_filterGe: (a: number, b: number, c: number, d: any) => [number, number, number];
415
- readonly wasmquerybuilder_filterGt: (a: number, b: number, c: number, d: any) => [number, number, number];
416
- readonly wasmquerybuilder_filterLe: (a: number, b: number, c: number, d: any) => [number, number, number];
417
- readonly wasmquerybuilder_filterLt: (a: number, b: number, c: number, d: any) => [number, number, number];
418
- readonly wasmquerybuilder_filterNe: (a: number, b: number, c: number, d: any) => [number, number, number];
419
- readonly wasmquerybuilder_includeDeleted: (a: number) => number;
420
- readonly wasmquerybuilder_join: (a: number, b: number, c: number) => number;
421
- readonly wasmquerybuilder_limit: (a: number, b: number) => number;
422
- readonly wasmquerybuilder_new: (a: number, b: number) => number;
423
- readonly wasmquerybuilder_offset: (a: number, b: number) => number;
424
- readonly wasmquerybuilder_on: (a: number, b: number, c: number, d: number, e: number) => number;
425
- readonly wasmquerybuilder_or: (a: number) => number;
426
- readonly wasmquerybuilder_orderBy: (a: number, b: number, c: number) => number;
427
- readonly wasmquerybuilder_orderByDesc: (a: number, b: number, c: number) => number;
428
- readonly wasmquerybuilder_select: (a: number, b: number, c: number) => number;
429
- readonly init: () => void;
430
430
  readonly bench_get_pin_internal_pages: () => number;
431
431
  readonly bench_opfs_cold_random_read: (a: number, b: number) => any;
432
432
  readonly bench_opfs_cold_sequential_read: (a: number, b: number) => any;
package/pkg/jazz_wasm.js CHANGED
@@ -374,9 +374,12 @@ export class WasmRuntime {
374
374
  * After adding the server, immediately flushes the outbox so that
375
375
  * catalogue sync messages (from queue_full_sync_to_server) are sent
376
376
  * before the call returns, rather than being deferred to a microtask.
377
+ * @param {string | null} [server_catalogue_state_hash]
377
378
  */
378
- addServer() {
379
- wasm.wasmruntime_addServer(this.__wbg_ptr);
379
+ addServer(server_catalogue_state_hash) {
380
+ var ptr0 = isLikeNone(server_catalogue_state_hash) ? 0 : passStringToWasm0(server_catalogue_state_hash, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
381
+ var len0 = WASM_VECTOR_LEN;
382
+ wasm.wasmruntime_addServer(this.__wbg_ptr, ptr0, len0);
380
383
  }
381
384
  /**
382
385
  * Phase 1 of 2-phase subscribe: allocate a handle and store query params.
@@ -435,14 +438,14 @@ export class WasmRuntime {
435
438
  * Delete a row and return a Promise that resolves when the tier acks,
436
439
  * scoped to an explicit session principal.
437
440
  * @param {string} object_id
438
- * @param {string | null | undefined} session_json
441
+ * @param {string | null | undefined} write_context_json
439
442
  * @param {string} tier
440
443
  * @returns {Promise<any>}
441
444
  */
442
- deleteDurableWithSession(object_id, session_json, tier) {
445
+ deleteDurableWithSession(object_id, write_context_json, tier) {
443
446
  const ptr0 = passStringToWasm0(object_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
444
447
  const len0 = WASM_VECTOR_LEN;
445
- var ptr1 = isLikeNone(session_json) ? 0 : passStringToWasm0(session_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
448
+ var ptr1 = isLikeNone(write_context_json) ? 0 : passStringToWasm0(write_context_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
446
449
  var len1 = WASM_VECTOR_LEN;
447
450
  const ptr2 = passStringToWasm0(tier, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
448
451
  const len2 = WASM_VECTOR_LEN;
@@ -455,12 +458,12 @@ export class WasmRuntime {
455
458
  /**
456
459
  * Delete a row by ObjectId as an explicit session principal.
457
460
  * @param {string} object_id
458
- * @param {string | null} [session_json]
461
+ * @param {string | null} [write_context_json]
459
462
  */
460
- deleteWithSession(object_id, session_json) {
463
+ deleteWithSession(object_id, write_context_json) {
461
464
  const ptr0 = passStringToWasm0(object_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
462
465
  const len0 = WASM_VECTOR_LEN;
463
- var ptr1 = isLikeNone(session_json) ? 0 : passStringToWasm0(session_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
466
+ var ptr1 = isLikeNone(write_context_json) ? 0 : passStringToWasm0(write_context_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
464
467
  var len1 = WASM_VECTOR_LEN;
465
468
  const ret = wasm.wasmruntime_deleteWithSession(this.__wbg_ptr, ptr0, len0, ptr1, len1);
466
469
  if (ret[1]) {
@@ -563,14 +566,14 @@ export class WasmRuntime {
563
566
  * scoped to an explicit session principal.
564
567
  * @param {string} table
565
568
  * @param {any} values
566
- * @param {string | null | undefined} session_json
569
+ * @param {string | null | undefined} write_context_json
567
570
  * @param {string} tier
568
571
  * @returns {Promise<any>}
569
572
  */
570
- insertDurableWithSession(table, values, session_json, tier) {
573
+ insertDurableWithSession(table, values, write_context_json, tier) {
571
574
  const ptr0 = passStringToWasm0(table, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
572
575
  const len0 = WASM_VECTOR_LEN;
573
- var ptr1 = isLikeNone(session_json) ? 0 : passStringToWasm0(session_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
576
+ var ptr1 = isLikeNone(write_context_json) ? 0 : passStringToWasm0(write_context_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
574
577
  var len1 = WASM_VECTOR_LEN;
575
578
  const ptr2 = passStringToWasm0(tier, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
576
579
  const len2 = WASM_VECTOR_LEN;
@@ -584,13 +587,13 @@ export class WasmRuntime {
584
587
  * Insert a row into a table as an explicit session principal.
585
588
  * @param {string} table
586
589
  * @param {any} values
587
- * @param {string | null} [session_json]
590
+ * @param {string | null} [write_context_json]
588
591
  * @returns {any}
589
592
  */
590
- insertWithSession(table, values, session_json) {
593
+ insertWithSession(table, values, write_context_json) {
591
594
  const ptr0 = passStringToWasm0(table, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
592
595
  const len0 = WASM_VECTOR_LEN;
593
- var ptr1 = isLikeNone(session_json) ? 0 : passStringToWasm0(session_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
596
+ var ptr1 = isLikeNone(write_context_json) ? 0 : passStringToWasm0(write_context_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
594
597
  var len1 = WASM_VECTOR_LEN;
595
598
  const ret = wasm.wasmruntime_insertWithSession(this.__wbg_ptr, ptr0, len0, values, ptr1, len1);
596
599
  if (ret[2]) {
@@ -832,14 +835,14 @@ export class WasmRuntime {
832
835
  * scoped to an explicit session principal.
833
836
  * @param {string} object_id
834
837
  * @param {any} values
835
- * @param {string | null | undefined} session_json
838
+ * @param {string | null | undefined} write_context_json
836
839
  * @param {string} tier
837
840
  * @returns {Promise<any>}
838
841
  */
839
- updateDurableWithSession(object_id, values, session_json, tier) {
842
+ updateDurableWithSession(object_id, values, write_context_json, tier) {
840
843
  const ptr0 = passStringToWasm0(object_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
841
844
  const len0 = WASM_VECTOR_LEN;
842
- var ptr1 = isLikeNone(session_json) ? 0 : passStringToWasm0(session_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
845
+ var ptr1 = isLikeNone(write_context_json) ? 0 : passStringToWasm0(write_context_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
843
846
  var len1 = WASM_VECTOR_LEN;
844
847
  const ptr2 = passStringToWasm0(tier, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
845
848
  const len2 = WASM_VECTOR_LEN;
@@ -858,12 +861,12 @@ export class WasmRuntime {
858
861
  * * `session_json` - Optional JSON-encoded Session used for policy checks
859
862
  * @param {string} object_id
860
863
  * @param {any} values
861
- * @param {string | null} [session_json]
864
+ * @param {string | null} [write_context_json]
862
865
  */
863
- updateWithSession(object_id, values, session_json) {
866
+ updateWithSession(object_id, values, write_context_json) {
864
867
  const ptr0 = passStringToWasm0(object_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
865
868
  const len0 = WASM_VECTOR_LEN;
866
- var ptr1 = isLikeNone(session_json) ? 0 : passStringToWasm0(session_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
869
+ var ptr1 = isLikeNone(write_context_json) ? 0 : passStringToWasm0(write_context_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
867
870
  var len1 = WASM_VECTOR_LEN;
868
871
  const ret = wasm.wasmruntime_updateWithSession(this.__wbg_ptr, ptr0, len0, values, ptr1, len1);
869
872
  if (ret[1]) {
@@ -1354,6 +1357,16 @@ function __wbg_get_imports() {
1354
1357
  const ret = result;
1355
1358
  return ret;
1356
1359
  },
1360
+ __wbg_instanceof_DomException_2bdcf7791a2d7d09: function(arg0) {
1361
+ let result;
1362
+ try {
1363
+ result = arg0 instanceof DOMException;
1364
+ } catch (_) {
1365
+ result = false;
1366
+ }
1367
+ const ret = result;
1368
+ return ret;
1369
+ },
1357
1370
  __wbg_instanceof_FileSystemDirectoryHandle_2944d0641b4ea10c: function(arg0) {
1358
1371
  let result;
1359
1372
  try {
@@ -1509,6 +1522,24 @@ function __wbg_get_imports() {
1509
1522
  const ret = new Object();
1510
1523
  return ret;
1511
1524
  },
1525
+ __wbg_new_d098e265629cd10f: function(arg0, arg1) {
1526
+ try {
1527
+ var state0 = {a: arg0, b: arg1};
1528
+ var cb0 = (arg0, arg1) => {
1529
+ const a = state0.a;
1530
+ state0.a = 0;
1531
+ try {
1532
+ return wasm_bindgen__convert__closures_____invoke__h4abc8a55d4718cb4(a, state0.b, arg0, arg1);
1533
+ } finally {
1534
+ state0.a = a;
1535
+ }
1536
+ };
1537
+ const ret = new Promise(cb0);
1538
+ return ret;
1539
+ } finally {
1540
+ state0.a = state0.b = 0;
1541
+ }
1542
+ },
1512
1543
  __wbg_new_from_slice_22da9388ac046e50: function(arg0, arg1) {
1513
1544
  const ret = new Uint8Array(getArrayU8FromWasm0(arg0, arg1));
1514
1545
  return ret;
@@ -1569,6 +1600,9 @@ function __wbg_get_imports() {
1569
1600
  const ret = Promise.resolve(arg0);
1570
1601
  return ret;
1571
1602
  },
1603
+ __wbg_setTimeout_90ea1b70d376baa9: function(arg0, arg1) {
1604
+ setTimeout(arg0, arg1);
1605
+ },
1572
1606
  __wbg_set_282384002438957f: function(arg0, arg1, arg2) {
1573
1607
  arg0[arg1 >>> 0] = arg2;
1574
1608
  },
@@ -1659,7 +1693,7 @@ function __wbg_get_imports() {
1659
1693
  return ret;
1660
1694
  }, arguments); },
1661
1695
  __wbindgen_cast_0000000000000001: function(arg0, arg1) {
1662
- // Cast intrinsic for `Closure(Closure { dtor_idx: 2477, function: Function { arguments: [Externref], shim_idx: 2478, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
1696
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 2575, function: Function { arguments: [Externref], shim_idx: 2576, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
1663
1697
  const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__h91062c162630e93c, wasm_bindgen__convert__closures_____invoke__hc8651b792d0b9061);
1664
1698
  return ret;
1665
1699
  },
Binary file