jazz-wasm 2.0.0-alpha.6 → 2.0.0-alpha.9

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.6",
3
+ "version": "2.0.0-alpha.9",
4
4
  "description": "WebAssembly bindings for the Jazz database engine",
5
5
  "keywords": [
6
6
  "crdt",
@@ -1,74 +1,5 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
- export interface WasmAdded {
4
- kind: number;
5
- id: string;
6
- index: number;
7
- row: WasmRow;
8
- }
9
-
10
- export interface WasmColumnDescriptor {
11
- name: string;
12
- column_type: WasmColumnType;
13
- nullable: boolean;
14
- references?: string;
15
- }
16
-
17
- export interface WasmOperationPolicy {
18
- using?: WasmPolicyExpr;
19
- with_check?: WasmPolicyExpr;
20
- }
21
-
22
- export interface WasmRemoved {
23
- kind: number;
24
- id: string;
25
- index: number;
26
- }
27
-
28
- export interface WasmRow {
29
- id: string;
30
- values: WasmValue[];
31
- }
32
-
33
- export interface WasmSchema {
34
- tables: Record<string, WasmTableSchema>;
35
- }
36
-
37
- export interface WasmTablePolicies {
38
- select?: WasmOperationPolicy;
39
- insert?: WasmOperationPolicy;
40
- update?: WasmOperationPolicy;
41
- delete?: WasmOperationPolicy;
42
- }
43
-
44
- export interface WasmTableSchema {
45
- columns: WasmColumnDescriptor[];
46
- policies?: WasmTablePolicies;
47
- }
48
-
49
- export interface WasmUpdated {
50
- kind: number;
51
- id: string;
52
- index: number;
53
- row?: WasmRow;
54
- }
55
-
56
- export type WasmCmpOp = "Eq" | "Ne" | "Lt" | "Le" | "Gt" | "Ge";
57
-
58
- export type WasmColumnType = { type: "Integer" } | { type: "BigInt" } | { type: "Double" } | { type: "Boolean" } | { type: "Text" } | { type: "Enum"; variants: string[] } | { type: "Timestamp" } | { type: "Uuid" } | { type: "Bytea" } | { type: "Array"; element: WasmColumnType } | { type: "Row"; columns: WasmColumnDescriptor[] };
59
-
60
- export type WasmPolicyExpr = { type: "Cmp"; column: string; op: WasmCmpOp; value: WasmPolicyValue } | { type: "IsNull"; column: string } | { type: "IsNotNull"; column: string } | { type: "Contains"; column: string; value: WasmPolicyValue } | { type: "In"; column: string; session_path: string[] } | { type: "InList"; column: string; values: WasmPolicyValue[] } | { type: "Exists"; table: string; condition: WasmPolicyExpr } | { type: "ExistsRel"; rel: any } | { type: "Inherits"; operation: WasmPolicyOperation; via_column: string; max_depth?: number } | { type: "InheritsReferencing"; operation: WasmPolicyOperation; source_table: string; via_column: string; max_depth?: number } | { type: "And"; exprs: WasmPolicyExpr[] } | { type: "Or"; exprs: WasmPolicyExpr[] } | { type: "Not"; expr: WasmPolicyExpr } | { type: "True" } | { type: "False" };
61
-
62
- export type WasmPolicyOperation = "Select" | "Insert" | "Update" | "Delete";
63
-
64
- export type WasmPolicyValue = { type: "Literal"; value: WasmValue } | { type: "SessionRef"; path: string[] };
65
-
66
- export type WasmRowChange = WasmAdded | WasmRemoved | WasmUpdated;
67
-
68
- export type WasmRowDelta = WasmRowChange[];
69
-
70
- export type WasmValue = { type: "Integer"; value: number } | { type: "BigInt"; value: number } | { type: "Double"; value: number } | { type: "Boolean"; value: boolean } | { type: "Text"; value: string } | { type: "Timestamp"; value: number } | { type: "Uuid"; value: string } | { type: "Bytea"; value: Uint8Array } | { type: "Array"; value: WasmValue[] } | { type: "Row"; value: WasmValue[] } | { type: "Null" };
71
-
72
3
 
73
4
  /**
74
5
  * WASM-exposed QueryBuilder with camelCase methods.
@@ -274,7 +205,7 @@ export class WasmRuntime {
274
205
  *
275
206
  * Optional `settled_tier` holds delivery until the tier confirms.
276
207
  */
277
- query(query_json: string, session_json?: string | null, settled_tier?: string | null): Promise<any>;
208
+ query(query_json: string, session_json?: string | null, settled_tier?: string | null, options_json?: string | null): Promise<any>;
278
209
  /**
279
210
  * Remove the current upstream server connection.
280
211
  */
@@ -299,7 +230,7 @@ export class WasmRuntime {
299
230
  * # Returns
300
231
  * Subscription handle (f64) for later unsubscription.
301
232
  */
302
- subscribe(query_json: string, on_update: Function, session_json?: string | null, settled_tier?: string | null): number;
233
+ subscribe(query_json: string, on_update: Function, session_json?: string | null, settled_tier?: string | null, options_json?: string | null): number;
303
234
  /**
304
235
  * Unsubscribe from a query.
305
236
  */
@@ -408,10 +339,10 @@ export interface InitOutput {
408
339
  readonly wasmruntime_onSyncMessageReceivedFromClient: (a: number, b: number, c: number, d: number, e: number) => [number, number];
409
340
  readonly wasmruntime_onSyncMessageToSend: (a: number, b: any) => void;
410
341
  readonly wasmruntime_openPersistent: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number) => any;
411
- readonly wasmruntime_query: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => [number, number, number];
342
+ readonly wasmruntime_query: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number) => [number, number, number];
412
343
  readonly wasmruntime_removeServer: (a: number) => void;
413
344
  readonly wasmruntime_setClientRole: (a: number, b: number, c: number, d: number, e: number) => [number, number];
414
- readonly wasmruntime_subscribe: (a: number, b: number, c: number, d: any, e: number, f: number, g: number, h: number) => [number, number, number];
345
+ readonly wasmruntime_subscribe: (a: number, b: number, c: number, d: any, e: number, f: number, g: number, h: number, i: number, j: number) => [number, number, number];
415
346
  readonly wasmruntime_unsubscribe: (a: number, b: number) => void;
416
347
  readonly wasmruntime_update: (a: number, b: number, c: number, d: any) => [number, number];
417
348
  readonly wasmruntime_updateWithAck: (a: number, b: number, c: number, d: any, e: number, f: number) => [number, number, number];
@@ -464,9 +395,9 @@ export interface InitOutput {
464
395
  readonly bench_reset_overflow_threshold_bytes: () => void;
465
396
  readonly bench_reset_pin_internal_pages: () => void;
466
397
  readonly bench_reset_read_coalesce_pages: () => void;
467
- readonly wasm_bindgen__closure__destroy__h36582af6159eae23: (a: number, b: number) => void;
468
- readonly wasm_bindgen__convert__closures_____invoke__h87add1091edf4849: (a: number, b: number, c: any, d: any) => void;
469
- readonly wasm_bindgen__convert__closures_____invoke__h2cc017d284ea0daf: (a: number, b: number, c: any) => void;
398
+ readonly wasm_bindgen__closure__destroy__hd6be7d355a1a4111: (a: number, b: number) => void;
399
+ readonly wasm_bindgen__convert__closures_____invoke__h548950b2b037aa8d: (a: number, b: number, c: any, d: any) => void;
400
+ readonly wasm_bindgen__convert__closures_____invoke__h293cf1e74083bd37: (a: number, b: number, c: any) => void;
470
401
  readonly __wbindgen_malloc: (a: number, b: number) => number;
471
402
  readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
472
403
  readonly __wbindgen_exn_store: (a: number) => void;
package/pkg/jazz_wasm.js CHANGED
@@ -609,16 +609,19 @@ export class WasmRuntime {
609
609
  * @param {string} query_json
610
610
  * @param {string | null} [session_json]
611
611
  * @param {string | null} [settled_tier]
612
+ * @param {string | null} [options_json]
612
613
  * @returns {Promise<any>}
613
614
  */
614
- query(query_json, session_json, settled_tier) {
615
+ query(query_json, session_json, settled_tier, options_json) {
615
616
  const ptr0 = passStringToWasm0(query_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
616
617
  const len0 = WASM_VECTOR_LEN;
617
618
  var ptr1 = isLikeNone(session_json) ? 0 : passStringToWasm0(session_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
618
619
  var len1 = WASM_VECTOR_LEN;
619
620
  var ptr2 = isLikeNone(settled_tier) ? 0 : passStringToWasm0(settled_tier, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
620
621
  var len2 = WASM_VECTOR_LEN;
621
- const ret = wasm.wasmruntime_query(this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2);
622
+ var ptr3 = isLikeNone(options_json) ? 0 : passStringToWasm0(options_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
623
+ var len3 = WASM_VECTOR_LEN;
624
+ const ret = wasm.wasmruntime_query(this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);
622
625
  if (ret[2]) {
623
626
  throw takeFromExternrefTable0(ret[1]);
624
627
  }
@@ -664,16 +667,19 @@ export class WasmRuntime {
664
667
  * @param {Function} on_update
665
668
  * @param {string | null} [session_json]
666
669
  * @param {string | null} [settled_tier]
670
+ * @param {string | null} [options_json]
667
671
  * @returns {number}
668
672
  */
669
- subscribe(query_json, on_update, session_json, settled_tier) {
673
+ subscribe(query_json, on_update, session_json, settled_tier, options_json) {
670
674
  const ptr0 = passStringToWasm0(query_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
671
675
  const len0 = WASM_VECTOR_LEN;
672
676
  var ptr1 = isLikeNone(session_json) ? 0 : passStringToWasm0(session_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
673
677
  var len1 = WASM_VECTOR_LEN;
674
678
  var ptr2 = isLikeNone(settled_tier) ? 0 : passStringToWasm0(settled_tier, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
675
679
  var len2 = WASM_VECTOR_LEN;
676
- const ret = wasm.wasmruntime_subscribe(this.__wbg_ptr, ptr0, len0, on_update, ptr1, len1, ptr2, len2);
680
+ var ptr3 = isLikeNone(options_json) ? 0 : passStringToWasm0(options_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
681
+ var len3 = WASM_VECTOR_LEN;
682
+ const ret = wasm.wasmruntime_subscribe(this.__wbg_ptr, ptr0, len0, on_update, ptr1, len1, ptr2, len2, ptr3, len3);
677
683
  if (ret[2]) {
678
684
  throw takeFromExternrefTable0(ret[1]);
679
685
  }
@@ -1149,10 +1155,6 @@ function __wbg_get_imports() {
1149
1155
  __wbg_flush_22b785060592ca5f: function() { return handleError(function (arg0) {
1150
1156
  arg0.flush();
1151
1157
  }, arguments); },
1152
- __wbg_from_bddd64e7d5ff6941: function(arg0) {
1153
- const ret = Array.from(arg0);
1154
- return ret;
1155
- },
1156
1158
  __wbg_getDirectory_b66ae3e79f902982: function(arg0) {
1157
1159
  const ret = arg0.getDirectory();
1158
1160
  return ret;
@@ -1347,7 +1349,7 @@ function __wbg_get_imports() {
1347
1349
  const a = state0.a;
1348
1350
  state0.a = 0;
1349
1351
  try {
1350
- return wasm_bindgen__convert__closures_____invoke__h87add1091edf4849(a, state0.b, arg0, arg1);
1352
+ return wasm_bindgen__convert__closures_____invoke__h548950b2b037aa8d(a, state0.b, arg0, arg1);
1351
1353
  } finally {
1352
1354
  state0.a = a;
1353
1355
  }
@@ -1498,8 +1500,8 @@ function __wbg_get_imports() {
1498
1500
  return ret;
1499
1501
  }, arguments); },
1500
1502
  __wbindgen_cast_0000000000000001: function(arg0, arg1) {
1501
- // Cast intrinsic for `Closure(Closure { dtor_idx: 670, function: Function { arguments: [Externref], shim_idx: 671, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1502
- const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__h36582af6159eae23, wasm_bindgen__convert__closures_____invoke__h2cc017d284ea0daf);
1503
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 2436, function: Function { arguments: [Externref], shim_idx: 2437, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1504
+ const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__hd6be7d355a1a4111, wasm_bindgen__convert__closures_____invoke__h293cf1e74083bd37);
1503
1505
  return ret;
1504
1506
  },
1505
1507
  __wbindgen_cast_0000000000000002: function(arg0) {
@@ -1513,16 +1515,11 @@ function __wbg_get_imports() {
1513
1515
  return ret;
1514
1516
  },
1515
1517
  __wbindgen_cast_0000000000000004: function(arg0, arg1) {
1516
- // Cast intrinsic for `Ref(Slice(U8)) -> NamedExternref("Uint8Array")`.
1517
- const ret = getArrayU8FromWasm0(arg0, arg1);
1518
- return ret;
1519
- },
1520
- __wbindgen_cast_0000000000000005: function(arg0, arg1) {
1521
1518
  // Cast intrinsic for `Ref(String) -> Externref`.
1522
1519
  const ret = getStringFromWasm0(arg0, arg1);
1523
1520
  return ret;
1524
1521
  },
1525
- __wbindgen_cast_0000000000000006: function(arg0) {
1522
+ __wbindgen_cast_0000000000000005: function(arg0) {
1526
1523
  // Cast intrinsic for `U64 -> Externref`.
1527
1524
  const ret = BigInt.asUintN(64, arg0);
1528
1525
  return ret;
@@ -1543,12 +1540,12 @@ function __wbg_get_imports() {
1543
1540
  };
1544
1541
  }
1545
1542
 
1546
- function wasm_bindgen__convert__closures_____invoke__h2cc017d284ea0daf(arg0, arg1, arg2) {
1547
- wasm.wasm_bindgen__convert__closures_____invoke__h2cc017d284ea0daf(arg0, arg1, arg2);
1543
+ function wasm_bindgen__convert__closures_____invoke__h293cf1e74083bd37(arg0, arg1, arg2) {
1544
+ wasm.wasm_bindgen__convert__closures_____invoke__h293cf1e74083bd37(arg0, arg1, arg2);
1548
1545
  }
1549
1546
 
1550
- function wasm_bindgen__convert__closures_____invoke__h87add1091edf4849(arg0, arg1, arg2, arg3) {
1551
- wasm.wasm_bindgen__convert__closures_____invoke__h87add1091edf4849(arg0, arg1, arg2, arg3);
1547
+ function wasm_bindgen__convert__closures_____invoke__h548950b2b037aa8d(arg0, arg1, arg2, arg3) {
1548
+ wasm.wasm_bindgen__convert__closures_____invoke__h548950b2b037aa8d(arg0, arg1, arg2, arg3);
1552
1549
  }
1553
1550
 
1554
1551
  const WasmQueryBuilderFinalization = (typeof FinalizationRegistry === 'undefined')
Binary file