@perspective-dev/client 5.8.0 → 5.9.0

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.
@@ -1,8 +1,8 @@
1
1
  // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
2
- import type { ViewOnRemoveResp } from "./ViewOnRemoveResp.d.ts";
2
+ import type { RemoveCause } from "./RemoveCause.d.ts";
3
3
 
4
4
  /**
5
- * Removed index values and port ID corresponding to a remove batch, provided
6
- * to the callback argument to [`View::on_remove`].
5
+ * The keys of rows which left a [`View`], the port ID and the [`RemoveCause`]
6
+ * they left under, provided to the callback argument to [`View::on_remove`].
7
7
  */
8
- export type OnRemoveData = ViewOnRemoveResp;
8
+ export type OnRemoveData = { port_id: number, indices: Uint8Array | undefined, cause: RemoveCause, };
@@ -0,0 +1,7 @@
1
+ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
2
+
3
+ /**
4
+ * The rule under which the rows reported by [`View::on_remove`] left the
5
+ * [`View`].
6
+ */
7
+ export type RemoveCause = "key" | "group" | "filter";
@@ -152,7 +152,7 @@ export type * from "../ts-rs/ColumnWindow.d.ts";
152
152
  export type * from "../ts-rs/TableInitOptions.d.ts";
153
153
  export type * from "../ts-rs/ViewConfigUpdate.d.ts";
154
154
  export type * from "../ts-rs/ViewOnUpdateResp.d.ts";
155
- export type * from "../ts-rs/ViewOnRemoveResp.d.ts";
155
+ export type * from "../ts-rs/RemoveCause.d.ts";
156
156
  export type * from "../ts-rs/OnRemoveData.d.ts";
157
157
  export type * from "../ts-rs/OnUpdateData.d.ts";
158
158
  export type * from "../ts-rs/OnUpdateOptions.d.ts";
@@ -889,19 +889,24 @@ export class View {
889
889
  */
890
890
  on_delete(on_delete: Function): Promise<any>;
891
891
  /**
892
- * Register a callback which is invoked whenever rows are removed from
893
- * this [`View`]'s [`Table`] by [`Table::remove`], with an object
894
- * containing `port_id` and `indices`, the removed `index` column
895
- * values as an Arrow of one column named after the index.
892
+ * Register a callback which is invoked whenever rows leave this
893
+ * [`View`], with an object containing `port_id`, `indices` (their keys
894
+ * as an Arrow of one column per key column named after it) and `cause`,
895
+ * one of `"key"`, `"filter"` or `"group"`.
896
896
  *
897
- * [`Table::replace`] reports the keys it does not re-supply and
898
- * [`Table::clear`] reports every key. `on_remove` never fires for a
899
- * [`Table`] without an `index`.
897
+ * For a [`View`] without `group_by` the keys are the `index` columns of
898
+ * the [`Table`], which must have one: `"key"` when [`Table::remove`]
899
+ * removed them ([`Table::replace`] reports the keys it does not
900
+ * re-supply and [`Table::clear`] every key) and `"filter"` when
901
+ * [`Table::update`] moved them outside the [`View`]'s `filter`. For a
902
+ * [`View`] with `group_by` the keys are the `group_by` columns of each
903
+ * group which no longer has any rows, `"group"`, `null` below the
904
+ * group's depth. It fires once per cause per update step.
900
905
  *
901
906
  * # JavaScript Examples
902
907
  *
903
908
  * ```javascript
904
- * const id = await view.on_remove(({ indices, port_id }) => {
909
+ * const id = await view.on_remove(({ indices, port_id, cause }) => {
905
910
  * replica.remove(indices);
906
911
  * });
907
912
  * ```
@@ -1163,12 +1168,12 @@ export interface InitOutput {
1163
1168
  readonly virtualdataslice_setStringCol: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
1164
1169
  readonly virtualserver_handleRequest: (a: number, b: number, c: number) => number;
1165
1170
  readonly virtualserver_new: (a: number, b: number) => void;
1166
- readonly __wasm_bindgen_func_elem_1738: (a: number, b: number) => void;
1167
- readonly __wasm_bindgen_func_elem_4802: (a: number, b: number) => void;
1168
- readonly __wasm_bindgen_func_elem_13337: (a: number, b: number, c: number, d: number) => void;
1169
- readonly __wasm_bindgen_func_elem_4804: (a: number, b: number, c: number) => void;
1170
- readonly __wasm_bindgen_func_elem_2108: (a: number, b: number) => number;
1171
- readonly __wasm_bindgen_func_elem_2109: (a: number, b: number) => void;
1171
+ readonly __wasm_bindgen_func_elem_1751: (a: number, b: number) => void;
1172
+ readonly __wasm_bindgen_func_elem_4765: (a: number, b: number) => void;
1173
+ readonly __wasm_bindgen_func_elem_13332: (a: number, b: number, c: number, d: number) => void;
1174
+ readonly __wasm_bindgen_func_elem_4767: (a: number, b: number, c: number) => void;
1175
+ readonly __wasm_bindgen_func_elem_2093: (a: number, b: number) => number;
1176
+ readonly __wasm_bindgen_func_elem_2094: (a: number, b: number) => void;
1172
1177
  readonly __wbindgen_export: (a: number, b: number) => number;
1173
1178
  readonly __wbindgen_export2: (a: number, b: number, c: number, d: number) => number;
1174
1179
  readonly __wbindgen_export3: (a: number) => void;
@@ -1557,19 +1557,24 @@ export class View {
1557
1557
  return takeObject(ret);
1558
1558
  }
1559
1559
  /**
1560
- * Register a callback which is invoked whenever rows are removed from
1561
- * this [`View`]'s [`Table`] by [`Table::remove`], with an object
1562
- * containing `port_id` and `indices`, the removed `index` column
1563
- * values as an Arrow of one column named after the index.
1564
- *
1565
- * [`Table::replace`] reports the keys it does not re-supply and
1566
- * [`Table::clear`] reports every key. `on_remove` never fires for a
1567
- * [`Table`] without an `index`.
1560
+ * Register a callback which is invoked whenever rows leave this
1561
+ * [`View`], with an object containing `port_id`, `indices` (their keys
1562
+ * as an Arrow of one column per key column named after it) and `cause`,
1563
+ * one of `"key"`, `"filter"` or `"group"`.
1564
+ *
1565
+ * For a [`View`] without `group_by` the keys are the `index` columns of
1566
+ * the [`Table`], which must have one: `"key"` when [`Table::remove`]
1567
+ * removed them ([`Table::replace`] reports the keys it does not
1568
+ * re-supply and [`Table::clear`] every key) and `"filter"` when
1569
+ * [`Table::update`] moved them outside the [`View`]'s `filter`. For a
1570
+ * [`View`] with `group_by` the keys are the `group_by` columns of each
1571
+ * group which no longer has any rows, `"group"`, `null` below the
1572
+ * group's depth. It fires once per cause per update step.
1568
1573
  *
1569
1574
  * # JavaScript Examples
1570
1575
  *
1571
1576
  * ```javascript
1572
- * const id = await view.on_remove(({ indices, port_id }) => {
1577
+ * const id = await view.on_remove(({ indices, port_id, cause }) => {
1573
1578
  * replica.remove(indices);
1574
1579
  * });
1575
1580
  * ```
@@ -2342,7 +2347,7 @@ function __wbg_get_imports() {
2342
2347
  const a = state0.a;
2343
2348
  state0.a = 0;
2344
2349
  try {
2345
- return __wasm_bindgen_func_elem_13337(a, state0.b, arg0, arg1);
2350
+ return __wasm_bindgen_func_elem_13332(a, state0.b, arg0, arg1);
2346
2351
  } finally {
2347
2352
  state0.a = a;
2348
2353
  }
@@ -2417,7 +2422,7 @@ function __wbg_get_imports() {
2417
2422
  const ret = Promise.resolve(getObject(arg0));
2418
2423
  return addHeapObject(ret);
2419
2424
  },
2420
- __wbg_run_9572f64bdbcca74b: function() { return handleError(function (arg0, arg1) {
2425
+ __wbg_run_ce6bcc7f4952334e: function() { return handleError(function (arg0, arg1) {
2421
2426
  const ret = getObject(arg0).run(getObject(arg1));
2422
2427
  return addHeapObject(ret);
2423
2428
  }, arguments); },
@@ -2509,17 +2514,17 @@ function __wbg_get_imports() {
2509
2514
  },
2510
2515
  __wbindgen_cast_0000000000000001: function(arg0, arg1) {
2511
2516
  // Cast intrinsic for `Closure(Closure { dtor_idx: 12, function: Function { arguments: [], shim_idx: 34, ret: NamedExternref("Promise<any>"), inner_ret: Some(NamedExternref("Promise<any>")) }, mutable: false }) -> Externref`.
2512
- const ret = makeClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_1738, __wasm_bindgen_func_elem_2108);
2517
+ const ret = makeClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_1751, __wasm_bindgen_func_elem_2093);
2513
2518
  return addHeapObject(ret);
2514
2519
  },
2515
2520
  __wbindgen_cast_0000000000000002: function(arg0, arg1) {
2516
2521
  // Cast intrinsic for `Closure(Closure { dtor_idx: 12, function: Function { arguments: [], shim_idx: 35, ret: Unit, inner_ret: Some(Unit) }, mutable: false }) -> Externref`.
2517
- const ret = makeClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_1738, __wasm_bindgen_func_elem_2109);
2522
+ const ret = makeClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_1751, __wasm_bindgen_func_elem_2094);
2518
2523
  return addHeapObject(ret);
2519
2524
  },
2520
2525
  __wbindgen_cast_0000000000000003: function(arg0, arg1) {
2521
- // Cast intrinsic for `Closure(Closure { dtor_idx: 637, function: Function { arguments: [Externref], shim_idx: 638, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
2522
- const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_4802, __wasm_bindgen_func_elem_4804);
2526
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 635, function: Function { arguments: [Externref], shim_idx: 636, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
2527
+ const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_4765, __wasm_bindgen_func_elem_4767);
2523
2528
  return addHeapObject(ret);
2524
2529
  },
2525
2530
  __wbindgen_cast_0000000000000004: function(arg0) {
@@ -2596,21 +2601,21 @@ function __wbg_get_imports() {
2596
2601
  };
2597
2602
  }
2598
2603
 
2599
- function __wasm_bindgen_func_elem_2109(arg0, arg1) {
2600
- wasm.__wasm_bindgen_func_elem_2109(arg0, arg1);
2604
+ function __wasm_bindgen_func_elem_2094(arg0, arg1) {
2605
+ wasm.__wasm_bindgen_func_elem_2094(arg0, arg1);
2601
2606
  }
2602
2607
 
2603
- function __wasm_bindgen_func_elem_2108(arg0, arg1) {
2604
- const ret = wasm.__wasm_bindgen_func_elem_2108(arg0, arg1);
2608
+ function __wasm_bindgen_func_elem_2093(arg0, arg1) {
2609
+ const ret = wasm.__wasm_bindgen_func_elem_2093(arg0, arg1);
2605
2610
  return takeObject(ret);
2606
2611
  }
2607
2612
 
2608
- function __wasm_bindgen_func_elem_4804(arg0, arg1, arg2) {
2609
- wasm.__wasm_bindgen_func_elem_4804(arg0, arg1, addHeapObject(arg2));
2613
+ function __wasm_bindgen_func_elem_4767(arg0, arg1, arg2) {
2614
+ wasm.__wasm_bindgen_func_elem_4767(arg0, arg1, addHeapObject(arg2));
2610
2615
  }
2611
2616
 
2612
- function __wasm_bindgen_func_elem_13337(arg0, arg1, arg2, arg3) {
2613
- wasm.__wasm_bindgen_func_elem_13337(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
2617
+ function __wasm_bindgen_func_elem_13332(arg0, arg1, arg2, arg3) {
2618
+ wasm.__wasm_bindgen_func_elem_13332(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
2614
2619
  }
2615
2620
 
2616
2621
  const ClientFinalization = (typeof FinalizationRegistry === 'undefined')
Binary file
@@ -105,12 +105,12 @@ export const virtualdataslice_setIntegerCol: (a: number, b: number, c: number, d
105
105
  export const virtualdataslice_setStringCol: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
106
106
  export const virtualserver_handleRequest: (a: number, b: number, c: number) => number;
107
107
  export const virtualserver_new: (a: number, b: number) => void;
108
- export const __wasm_bindgen_func_elem_1738: (a: number, b: number) => void;
109
- export const __wasm_bindgen_func_elem_4802: (a: number, b: number) => void;
110
- export const __wasm_bindgen_func_elem_13337: (a: number, b: number, c: number, d: number) => void;
111
- export const __wasm_bindgen_func_elem_4804: (a: number, b: number, c: number) => void;
112
- export const __wasm_bindgen_func_elem_2108: (a: number, b: number) => number;
113
- export const __wasm_bindgen_func_elem_2109: (a: number, b: number) => void;
108
+ export const __wasm_bindgen_func_elem_1751: (a: number, b: number) => void;
109
+ export const __wasm_bindgen_func_elem_4765: (a: number, b: number) => void;
110
+ export const __wasm_bindgen_func_elem_13332: (a: number, b: number, c: number, d: number) => void;
111
+ export const __wasm_bindgen_func_elem_4767: (a: number, b: number, c: number) => void;
112
+ export const __wasm_bindgen_func_elem_2093: (a: number, b: number) => number;
113
+ export const __wasm_bindgen_func_elem_2094: (a: number, b: number) => void;
114
114
  export const __wbindgen_export: (a: number, b: number) => number;
115
115
  export const __wbindgen_export2: (a: number, b: number, c: number, d: number) => number;
116
116
  export const __wbindgen_export3: (a: number) => void;
@@ -7,11 +7,18 @@
7
7
  */
8
8
  export function migrate(kind: string, from: string | null | undefined, value: any): any;
9
9
 
10
+ /**
11
+ * Check that a config is valid for the current schema without migrating it,
12
+ * where `strict` requires the complete `save()` form.
13
+ */
14
+ export function validate_config(kind: string, value: any, strict?: boolean | null): void;
15
+
10
16
  export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
11
17
 
12
18
  export interface InitOutput {
13
19
  readonly memory: WebAssembly.Memory;
14
20
  readonly migrate: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
21
+ readonly validate_config: (a: number, b: number, c: number, d: number, e: number) => void;
15
22
  readonly __wbindgen_export: (a: number, b: number) => number;
16
23
  readonly __wbindgen_export2: (a: number, b: number, c: number, d: number) => number;
17
24
  readonly __wbindgen_export3: (a: number) => void;
@@ -28,6 +28,29 @@ export function migrate(kind, from, value) {
28
28
  }
29
29
  }
30
30
 
31
+ /**
32
+ * Check that a config is valid for the current schema without migrating it,
33
+ * where `strict` requires the complete `save()` form.
34
+ * @param {string} kind
35
+ * @param {any} value
36
+ * @param {boolean | null} [strict]
37
+ */
38
+ export function validate_config(kind, value, strict) {
39
+ try {
40
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
41
+ const ptr0 = passStringToWasm0(kind, wasm.__wbindgen_export, wasm.__wbindgen_export2);
42
+ const len0 = WASM_VECTOR_LEN;
43
+ wasm.validate_config(retptr, ptr0, len0, addHeapObject(value), isLikeNone(strict) ? 0xFFFFFF : strict ? 1 : 0);
44
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
45
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
46
+ if (r1) {
47
+ throw takeObject(r0);
48
+ }
49
+ } finally {
50
+ wasm.__wbindgen_add_to_stack_pointer(16);
51
+ }
52
+ }
53
+
31
54
  function __wbg_get_imports() {
32
55
  const import0 = {
33
56
  __proto__: null,
Binary file
@@ -2,6 +2,7 @@
2
2
  /* eslint-disable */
3
3
  export const memory: WebAssembly.Memory;
4
4
  export const migrate: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
5
+ export const validate_config: (a: number, b: number, c: number, d: number, e: number) => void;
5
6
  export const __wbindgen_export: (a: number, b: number) => number;
6
7
  export const __wbindgen_export2: (a: number, b: number, c: number, d: number) => number;
7
8
  export const __wbindgen_export3: (a: number) => void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@perspective-dev/client",
3
- "version": "5.8.0",
3
+ "version": "5.9.0",
4
4
  "description": "Streaming query engine for data grids, pivot tables and charts over large, real-time datasets — WebAssembly in the browser, native in Node.js, or remote over WebSocket.",
5
5
  "keywords": [
6
6
  "perspective",
@@ -68,7 +68,7 @@
68
68
  "access": "public"
69
69
  },
70
70
  "dependencies": {
71
- "@perspective-dev/server": "^5.8.0",
71
+ "@perspective-dev/server": "^5.9.0",
72
72
  "stoppable": "=1.1.0",
73
73
  "ws": "^8.17.0"
74
74
  },
@@ -88,9 +88,9 @@
88
88
  }
89
89
  },
90
90
  "devDependencies": {
91
- "@perspective-dev/esbuild-plugin": "^5.8.0",
92
- "@perspective-dev/metadata": "^5.8.0",
93
- "@perspective-dev/test": "^5.8.0",
91
+ "@perspective-dev/esbuild-plugin": "^5.9.0",
92
+ "@perspective-dev/metadata": "^5.9.0",
93
+ "@perspective-dev/test": "^5.9.0",
94
94
  "@clickhouse/client-web": "^1.12.0",
95
95
  "@duckdb/duckdb-wasm": "^1.32.0",
96
96
  "@playwright/experimental-ct-react": "=1.62.0",
@@ -1,3 +0,0 @@
1
- // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
2
-
3
- export type ViewOnRemoveResp = { indices: Uint8Array, port_id: number, };