@perspective-dev/client 5.7.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.
- package/dist/cdn/perspective.js +3 -3
- package/dist/cdn/perspective.js.map +4 -4
- package/dist/esm/perspective.browser.d.ts +35 -5
- package/dist/esm/perspective.js +2 -2
- package/dist/esm/perspective.js.map +3 -3
- package/dist/esm/perspective.node.d.ts +34 -4
- package/dist/esm/perspective.node.js +142 -84
- package/dist/esm/perspective.node.js.map +4 -4
- package/dist/esm/public_types.d.ts +1 -1
- package/dist/esm/virtual_servers/clickhouse.d.ts +5 -1
- package/dist/esm/virtual_servers/clickhouse.js +6 -1
- package/dist/esm/virtual_servers/clickhouse.js.map +3 -3
- package/dist/esm/virtual_servers/duckdb.d.ts +5 -0
- package/dist/esm/virtual_servers/duckdb.js +1 -1
- package/dist/esm/virtual_servers/duckdb.js.map +3 -3
- package/dist/esm/wasm/migrate.d.ts +39 -11
- package/dist/esm/wasm/registry.d.ts +6 -12
- package/dist/esm/wasm/registry.js +2 -2
- package/dist/esm/wasm/registry.js.map +4 -4
- package/dist/ts-rs/OnRemoveData.d.ts +4 -4
- package/dist/ts-rs/RemoveCause.d.ts +7 -0
- package/dist/ts-rs/ViewOnUpdateResp.d.ts +1 -1
- package/dist/wasm/perspective-js.d.ts +35 -19
- package/dist/wasm/perspective-js.js +94 -26
- package/dist/wasm/perspective-js.wasm +0 -0
- package/dist/wasm/perspective-js.wasm.d.ts +10 -8
- package/dist/wasm/{perspective-migrate-js.d.ts → perspective-migrate.d.ts} +7 -0
- package/dist/wasm/{perspective-migrate-js.js → perspective-migrate.js} +25 -2
- package/dist/wasm/perspective-migrate.wasm +0 -0
- package/dist/wasm/{perspective-migrate-js.wasm.d.ts → perspective-migrate.wasm.d.ts} +1 -0
- package/package.json +5 -5
- package/dist/ts-rs/ViewOnRemoveResp.d.ts +0 -3
- package/dist/wasm/perspective-migrate-js.wasm +0 -0
|
@@ -4,12 +4,26 @@ import http from "node:http";
|
|
|
4
4
|
import * as perspective_client from "../../dist/wasm/perspective-js.js";
|
|
5
5
|
import { host_supports_memory64 } from "./wasm/features.ts";
|
|
6
6
|
import * as engine from "./wasm/engine.ts";
|
|
7
|
-
import type { MigrateKind, MigrateResult } from "./wasm/migrate.ts";
|
|
7
|
+
import type { MigrateKind, MigrateResult, Validator } from "./wasm/migrate.ts";
|
|
8
8
|
export { host_supports_memory64 } from "./wasm/features.ts";
|
|
9
9
|
export type { InitOptions, WasmBinary, WasmRegistration, WasmSource, } from "./wasm/registry.ts";
|
|
10
|
-
export type { MigrateKind, MigrateNotice, MigrateResult, } from "./wasm/migrate.ts";
|
|
10
|
+
export type { MigrateKind, MigrateNotice, MigrateResult, Validator, } from "./wasm/migrate.ts";
|
|
11
11
|
import * as virtual_server from "./virtual_server.ts";
|
|
12
12
|
export { GenericSQLVirtualServerModel, VirtualDataSlice, VirtualServer, } from "../../dist/wasm/perspective-js.js";
|
|
13
|
+
/**
|
|
14
|
+
* Load the `perspective-migrate` binary and return synchronous `migrate()`
|
|
15
|
+
* and `validate()` over it; the process shares one instance.
|
|
16
|
+
*
|
|
17
|
+
* # Examples
|
|
18
|
+
*
|
|
19
|
+
* ```javascript
|
|
20
|
+
* const validator = await perspective.create_validator();
|
|
21
|
+
* for (const token of tokens) {
|
|
22
|
+
* validator.validate("viewer", token, { strict: true });
|
|
23
|
+
* }
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
26
|
+
export declare function create_validator(): Promise<Validator>;
|
|
13
27
|
/**
|
|
14
28
|
* Upgrade a persisted config written by any Perspective release since 2.0.0
|
|
15
29
|
* to the current schema.
|
|
@@ -17,13 +31,27 @@ export { GenericSQLVirtualServerModel, VirtualDataSlice, VirtualServer, } from "
|
|
|
17
31
|
* # Arguments
|
|
18
32
|
*
|
|
19
33
|
* - `kind` - `"view"` for a `ViewConfig`, `"viewer"` for a
|
|
20
|
-
* `<perspective-viewer>` `save()` token,
|
|
21
|
-
* `saveWorkspace()` token.
|
|
34
|
+
* `<perspective-viewer>` `save()` token, `"panel"` for one workspace
|
|
35
|
+
* panel, or `"workspace"` for a `saveWorkspace()` token.
|
|
22
36
|
* - `config` - The config to upgrade.
|
|
23
37
|
* - `from_version` - The release which wrote `config`, used only when it has
|
|
24
38
|
* no `version` field.
|
|
25
39
|
*/
|
|
26
40
|
export declare function migrate<T = Record<string, unknown>>(kind: MigrateKind, config: unknown, from_version?: string): Promise<MigrateResult<T>>;
|
|
41
|
+
/**
|
|
42
|
+
* Check that a config is valid for this release without migrating it,
|
|
43
|
+
* rejecting with the offending JSON pointer and reason otherwise.
|
|
44
|
+
*
|
|
45
|
+
* # Arguments
|
|
46
|
+
*
|
|
47
|
+
* - `kind` - `"view"`, `"viewer"`, `"panel"` or `"workspace"`.
|
|
48
|
+
* - `config` - The config to check.
|
|
49
|
+
* - `options.strict` - Require the complete `save()` form rather than the
|
|
50
|
+
* field-wise `restore()` update form.
|
|
51
|
+
*/
|
|
52
|
+
export declare function validate(kind: MigrateKind, config: unknown, options?: {
|
|
53
|
+
strict?: boolean;
|
|
54
|
+
}): Promise<void>;
|
|
27
55
|
export declare class PerspectiveServer extends engine.PerspectiveServer {
|
|
28
56
|
constructor(options?: engine.PerspectiveServerOptions);
|
|
29
57
|
}
|
|
@@ -101,7 +129,9 @@ declare const _default: {
|
|
|
101
129
|
join: typeof join;
|
|
102
130
|
websocket: typeof websocket;
|
|
103
131
|
worker: typeof worker;
|
|
132
|
+
create_validator: typeof create_validator;
|
|
104
133
|
migrate: typeof migrate;
|
|
134
|
+
validate: typeof validate;
|
|
105
135
|
host_supports_memory64: typeof host_supports_memory64;
|
|
106
136
|
get_hosted_table_names: typeof get_hosted_table_names;
|
|
107
137
|
on_hosted_tables_update: typeof on_hosted_tables_update;
|
|
@@ -508,6 +508,33 @@ var GenericSQLVirtualServerModel = class {
|
|
|
508
508
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
509
509
|
}
|
|
510
510
|
}
|
|
511
|
+
/**
|
|
512
|
+
* Returns the SQL relation reference for an entity id.
|
|
513
|
+
* @param {string} entity_id
|
|
514
|
+
* @returns {string}
|
|
515
|
+
*/
|
|
516
|
+
quoteEntity(entity_id) {
|
|
517
|
+
try {
|
|
518
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
519
|
+
const ptr0 = passStringToWasm0(entity_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
520
|
+
const len0 = WASM_VECTOR_LEN;
|
|
521
|
+
wasm.genericsqlvirtualservermodel_quoteEntity(retptr, this.__wbg_ptr, ptr0, len0);
|
|
522
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
523
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
524
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
525
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
526
|
+
if (r3) {
|
|
527
|
+
throw takeObject(r2);
|
|
528
|
+
}
|
|
529
|
+
var v2 = getCachedStringFromWasm0(r0, r1);
|
|
530
|
+
if (r0 !== 0) {
|
|
531
|
+
wasm.__wbindgen_export4(r0, r1, 1);
|
|
532
|
+
}
|
|
533
|
+
return v2;
|
|
534
|
+
} finally {
|
|
535
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
536
|
+
}
|
|
537
|
+
}
|
|
511
538
|
/**
|
|
512
539
|
* Returns the SQL query that plans the view `config` would build and
|
|
513
540
|
* reports its result columns without materializing it (`split_by` folded
|
|
@@ -516,14 +543,15 @@ var GenericSQLVirtualServerModel = class {
|
|
|
516
543
|
* @param {string} table_id
|
|
517
544
|
* @param {any} config
|
|
518
545
|
* @param {any} schema
|
|
546
|
+
* @param {boolean | null} [unordered]
|
|
519
547
|
* @returns {string}
|
|
520
548
|
*/
|
|
521
|
-
tableDescribe(table_id, config, schema) {
|
|
549
|
+
tableDescribe(table_id, config, schema, unordered) {
|
|
522
550
|
try {
|
|
523
551
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
524
552
|
const ptr0 = passStringToWasm0(table_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
525
553
|
const len0 = WASM_VECTOR_LEN;
|
|
526
|
-
wasm.genericsqlvirtualservermodel_tableDescribe(retptr, this.__wbg_ptr, ptr0, len0, addHeapObject(config), addHeapObject(schema));
|
|
554
|
+
wasm.genericsqlvirtualservermodel_tableDescribe(retptr, this.__wbg_ptr, ptr0, len0, addHeapObject(config), addHeapObject(schema), isLikeNone(unordered) ? 16777215 : unordered ? 1 : 0);
|
|
527
555
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
528
556
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
529
557
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
@@ -547,16 +575,17 @@ var GenericSQLVirtualServerModel = class {
|
|
|
547
575
|
* @param {string} view_id
|
|
548
576
|
* @param {any} config
|
|
549
577
|
* @param {any} schema
|
|
578
|
+
* @param {boolean | null} [unordered]
|
|
550
579
|
* @returns {string}
|
|
551
580
|
*/
|
|
552
|
-
tableMakeView(table_id, view_id, config, schema) {
|
|
581
|
+
tableMakeView(table_id, view_id, config, schema, unordered) {
|
|
553
582
|
try {
|
|
554
583
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
555
584
|
const ptr0 = passStringToWasm0(table_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
556
585
|
const len0 = WASM_VECTOR_LEN;
|
|
557
586
|
const ptr1 = passStringToWasm0(view_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
558
587
|
const len1 = WASM_VECTOR_LEN;
|
|
559
|
-
wasm.genericsqlvirtualservermodel_tableMakeView(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1, addHeapObject(config), addHeapObject(schema));
|
|
588
|
+
wasm.genericsqlvirtualservermodel_tableMakeView(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1, addHeapObject(config), addHeapObject(schema), isLikeNone(unordered) ? 16777215 : unordered ? 1 : 0);
|
|
560
589
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
561
590
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
562
591
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
@@ -573,6 +602,34 @@ var GenericSQLVirtualServerModel = class {
|
|
|
573
602
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
574
603
|
}
|
|
575
604
|
}
|
|
605
|
+
/**
|
|
606
|
+
* Returns the entity id of the hosted table at relation path `parts`,
|
|
607
|
+
* each part quoted only when it is not a bare identifier.
|
|
608
|
+
* @param {string[]} parts
|
|
609
|
+
* @returns {string}
|
|
610
|
+
*/
|
|
611
|
+
tablePath(parts) {
|
|
612
|
+
try {
|
|
613
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
614
|
+
const ptr0 = passArrayJsValueToWasm0(parts, wasm.__wbindgen_export);
|
|
615
|
+
const len0 = WASM_VECTOR_LEN;
|
|
616
|
+
wasm.genericsqlvirtualservermodel_tablePath(retptr, this.__wbg_ptr, ptr0, len0);
|
|
617
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
618
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
619
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
620
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
621
|
+
if (r3) {
|
|
622
|
+
throw takeObject(r2);
|
|
623
|
+
}
|
|
624
|
+
var v2 = getCachedStringFromWasm0(r0, r1);
|
|
625
|
+
if (r0 !== 0) {
|
|
626
|
+
wasm.__wbindgen_export4(r0, r1, 1);
|
|
627
|
+
}
|
|
628
|
+
return v2;
|
|
629
|
+
} finally {
|
|
630
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
631
|
+
}
|
|
632
|
+
}
|
|
576
633
|
/**
|
|
577
634
|
* Returns the SQL query to describe a table's schema.
|
|
578
635
|
* @param {string} table_id
|
|
@@ -1519,19 +1576,24 @@ var View = class _View {
|
|
|
1519
1576
|
return takeObject(ret);
|
|
1520
1577
|
}
|
|
1521
1578
|
/**
|
|
1522
|
-
* Register a callback which is invoked whenever rows
|
|
1523
|
-
*
|
|
1524
|
-
*
|
|
1525
|
-
*
|
|
1579
|
+
* Register a callback which is invoked whenever rows leave this
|
|
1580
|
+
* [`View`], with an object containing `port_id`, `indices` (their keys
|
|
1581
|
+
* as an Arrow of one column per key column named after it) and `cause`,
|
|
1582
|
+
* one of `"key"`, `"filter"` or `"group"`.
|
|
1526
1583
|
*
|
|
1527
|
-
* [`
|
|
1528
|
-
* [`Table
|
|
1529
|
-
* [`Table`]
|
|
1584
|
+
* For a [`View`] without `group_by` the keys are the `index` columns of
|
|
1585
|
+
* the [`Table`], which must have one: `"key"` when [`Table::remove`]
|
|
1586
|
+
* removed them ([`Table::replace`] reports the keys it does not
|
|
1587
|
+
* re-supply and [`Table::clear`] every key) and `"filter"` when
|
|
1588
|
+
* [`Table::update`] moved them outside the [`View`]'s `filter`. For a
|
|
1589
|
+
* [`View`] with `group_by` the keys are the `group_by` columns of each
|
|
1590
|
+
* group which no longer has any rows, `"group"`, `null` below the
|
|
1591
|
+
* group's depth. It fires once per cause per update step.
|
|
1530
1592
|
*
|
|
1531
1593
|
* # JavaScript Examples
|
|
1532
1594
|
*
|
|
1533
1595
|
* ```javascript
|
|
1534
|
-
* const id = await view.on_remove(({ indices, port_id }) => {
|
|
1596
|
+
* const id = await view.on_remove(({ indices, port_id, cause }) => {
|
|
1535
1597
|
* replica.remove(indices);
|
|
1536
1598
|
* });
|
|
1537
1599
|
* ```
|
|
@@ -2320,7 +2382,7 @@ function __wbg_get_imports() {
|
|
|
2320
2382
|
const a = state0.a;
|
|
2321
2383
|
state0.a = 0;
|
|
2322
2384
|
try {
|
|
2323
|
-
return
|
|
2385
|
+
return __wasm_bindgen_func_elem_13332(a, state0.b, arg02, arg12);
|
|
2324
2386
|
} finally {
|
|
2325
2387
|
state0.a = a;
|
|
2326
2388
|
}
|
|
@@ -2399,7 +2461,7 @@ function __wbg_get_imports() {
|
|
|
2399
2461
|
const ret = Promise.resolve(getObject(arg0));
|
|
2400
2462
|
return addHeapObject(ret);
|
|
2401
2463
|
},
|
|
2402
|
-
|
|
2464
|
+
__wbg_run_ce6bcc7f4952334e: function() {
|
|
2403
2465
|
return handleError(function(arg0, arg1) {
|
|
2404
2466
|
const ret = getObject(arg0).run(getObject(arg1));
|
|
2405
2467
|
return addHeapObject(ret);
|
|
@@ -2496,15 +2558,15 @@ function __wbg_get_imports() {
|
|
|
2496
2558
|
console.warn(getObject(arg0));
|
|
2497
2559
|
},
|
|
2498
2560
|
__wbindgen_cast_0000000000000001: function(arg0, arg1) {
|
|
2499
|
-
const ret = makeClosure(arg0, arg1, wasm.
|
|
2561
|
+
const ret = makeClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_1751, __wasm_bindgen_func_elem_2093);
|
|
2500
2562
|
return addHeapObject(ret);
|
|
2501
2563
|
},
|
|
2502
2564
|
__wbindgen_cast_0000000000000002: function(arg0, arg1) {
|
|
2503
|
-
const ret = makeClosure(arg0, arg1, wasm.
|
|
2565
|
+
const ret = makeClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_1751, __wasm_bindgen_func_elem_2094);
|
|
2504
2566
|
return addHeapObject(ret);
|
|
2505
2567
|
},
|
|
2506
2568
|
__wbindgen_cast_0000000000000003: function(arg0, arg1) {
|
|
2507
|
-
const ret = makeMutClosure(arg0, arg1, wasm.
|
|
2569
|
+
const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_4765, __wasm_bindgen_func_elem_4767);
|
|
2508
2570
|
return addHeapObject(ret);
|
|
2509
2571
|
},
|
|
2510
2572
|
__wbindgen_cast_0000000000000004: function(arg0) {
|
|
@@ -2569,18 +2631,18 @@ function __wbg_get_imports() {
|
|
|
2569
2631
|
"./perspective-js.wasm_bg.js": import0
|
|
2570
2632
|
};
|
|
2571
2633
|
}
|
|
2572
|
-
function
|
|
2573
|
-
wasm.
|
|
2634
|
+
function __wasm_bindgen_func_elem_2094(arg0, arg1) {
|
|
2635
|
+
wasm.__wasm_bindgen_func_elem_2094(arg0, arg1);
|
|
2574
2636
|
}
|
|
2575
|
-
function
|
|
2576
|
-
const ret = wasm.
|
|
2637
|
+
function __wasm_bindgen_func_elem_2093(arg0, arg1) {
|
|
2638
|
+
const ret = wasm.__wasm_bindgen_func_elem_2093(arg0, arg1);
|
|
2577
2639
|
return takeObject(ret);
|
|
2578
2640
|
}
|
|
2579
|
-
function
|
|
2580
|
-
wasm.
|
|
2641
|
+
function __wasm_bindgen_func_elem_4767(arg0, arg1, arg2) {
|
|
2642
|
+
wasm.__wasm_bindgen_func_elem_4767(arg0, arg1, addHeapObject(arg2));
|
|
2581
2643
|
}
|
|
2582
|
-
function
|
|
2583
|
-
wasm.
|
|
2644
|
+
function __wasm_bindgen_func_elem_13332(arg0, arg1, arg2, arg3) {
|
|
2645
|
+
wasm.__wasm_bindgen_func_elem_13332(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
|
|
2584
2646
|
}
|
|
2585
2647
|
var ClientFinalization = typeof FinalizationRegistry === "undefined" ? { register: () => {
|
|
2586
2648
|
}, unregister: () => {
|
|
@@ -2831,6 +2893,15 @@ function passArray8ToWasm0(arg, malloc) {
|
|
|
2831
2893
|
WASM_VECTOR_LEN = arg.length;
|
|
2832
2894
|
return ptr;
|
|
2833
2895
|
}
|
|
2896
|
+
function passArrayJsValueToWasm0(array, malloc) {
|
|
2897
|
+
const ptr = malloc(array.length * 4, 4) >>> 0;
|
|
2898
|
+
const mem = getDataViewMemory0();
|
|
2899
|
+
for (let i = 0; i < array.length; i++) {
|
|
2900
|
+
mem.setUint32(ptr + 4 * i, addHeapObject(array[i]), true);
|
|
2901
|
+
}
|
|
2902
|
+
WASM_VECTOR_LEN = array.length;
|
|
2903
|
+
return ptr;
|
|
2904
|
+
}
|
|
2834
2905
|
function passStringToWasm0(arg, malloc, realloc) {
|
|
2835
2906
|
if (realloc === void 0) {
|
|
2836
2907
|
const buf = cachedTextEncoder.encode(arg);
|
|
@@ -3211,13 +3282,7 @@ async function decode_api_responses(core, ptr, callback) {
|
|
|
3211
3282
|
}
|
|
3212
3283
|
}
|
|
3213
3284
|
|
|
3214
|
-
// dist/wasm/perspective-migrate
|
|
3215
|
-
var perspective_migrate_js_exports = {};
|
|
3216
|
-
__export(perspective_migrate_js_exports, {
|
|
3217
|
-
default: () => __wbg_init2,
|
|
3218
|
-
initSync: () => initSync2,
|
|
3219
|
-
migrate: () => migrate
|
|
3220
|
-
});
|
|
3285
|
+
// dist/wasm/perspective-migrate.js
|
|
3221
3286
|
function migrate(kind, from, value) {
|
|
3222
3287
|
try {
|
|
3223
3288
|
const retptr = wasm2.__wbindgen_add_to_stack_pointer(-16);
|
|
@@ -3237,6 +3302,21 @@ function migrate(kind, from, value) {
|
|
|
3237
3302
|
wasm2.__wbindgen_add_to_stack_pointer(16);
|
|
3238
3303
|
}
|
|
3239
3304
|
}
|
|
3305
|
+
function validate_config(kind, value, strict) {
|
|
3306
|
+
try {
|
|
3307
|
+
const retptr = wasm2.__wbindgen_add_to_stack_pointer(-16);
|
|
3308
|
+
const ptr0 = passStringToWasm02(kind, wasm2.__wbindgen_export, wasm2.__wbindgen_export2);
|
|
3309
|
+
const len0 = WASM_VECTOR_LEN2;
|
|
3310
|
+
wasm2.validate_config(retptr, ptr0, len0, addHeapObject2(value), isLikeNone2(strict) ? 16777215 : strict ? 1 : 0);
|
|
3311
|
+
var r0 = getDataViewMemory02().getInt32(retptr + 4 * 0, true);
|
|
3312
|
+
var r1 = getDataViewMemory02().getInt32(retptr + 4 * 1, true);
|
|
3313
|
+
if (r1) {
|
|
3314
|
+
throw takeObject2(r0);
|
|
3315
|
+
}
|
|
3316
|
+
} finally {
|
|
3317
|
+
wasm2.__wbindgen_add_to_stack_pointer(16);
|
|
3318
|
+
}
|
|
3319
|
+
}
|
|
3240
3320
|
function __wbg_get_imports2() {
|
|
3241
3321
|
const import0 = {
|
|
3242
3322
|
__proto__: null,
|
|
@@ -3454,7 +3534,7 @@ function __wbg_get_imports2() {
|
|
|
3454
3534
|
};
|
|
3455
3535
|
return {
|
|
3456
3536
|
__proto__: null,
|
|
3457
|
-
"./perspective-migrate
|
|
3537
|
+
"./perspective-migrate.wasm_bg.js": import0
|
|
3458
3538
|
};
|
|
3459
3539
|
}
|
|
3460
3540
|
function addHeapObject2(obj) {
|
|
@@ -3656,22 +3736,6 @@ async function __wbg_load2(module, imports) {
|
|
|
3656
3736
|
return false;
|
|
3657
3737
|
}
|
|
3658
3738
|
}
|
|
3659
|
-
function initSync2(module) {
|
|
3660
|
-
if (wasm2 !== void 0) return wasm2;
|
|
3661
|
-
if (module !== void 0) {
|
|
3662
|
-
if (Object.getPrototypeOf(module) === Object.prototype) {
|
|
3663
|
-
({ module } = module);
|
|
3664
|
-
} else {
|
|
3665
|
-
console.warn("using deprecated parameters for `initSync()`; pass a single object instead");
|
|
3666
|
-
}
|
|
3667
|
-
}
|
|
3668
|
-
const imports = __wbg_get_imports2();
|
|
3669
|
-
if (!(module instanceof WebAssembly.Module)) {
|
|
3670
|
-
module = new WebAssembly.Module(module);
|
|
3671
|
-
}
|
|
3672
|
-
const instance = new WebAssembly.Instance(module, imports);
|
|
3673
|
-
return __wbg_finalize_init2(instance, module);
|
|
3674
|
-
}
|
|
3675
3739
|
async function __wbg_init2(module_or_path) {
|
|
3676
3740
|
if (wasm2 !== void 0) return wasm2;
|
|
3677
3741
|
if (module_or_path !== void 0) {
|
|
@@ -3690,34 +3754,21 @@ async function __wbg_init2(module_or_path) {
|
|
|
3690
3754
|
}
|
|
3691
3755
|
|
|
3692
3756
|
// src/ts/wasm/migrate.ts
|
|
3693
|
-
|
|
3694
|
-
|
|
3695
|
-
|
|
3696
|
-
|
|
3697
|
-
|
|
3698
|
-
|
|
3699
|
-
|
|
3700
|
-
|
|
3701
|
-
|
|
3702
|
-
|
|
3703
|
-
|
|
3704
|
-
|
|
3705
|
-
const source = this.source;
|
|
3706
|
-
const module = source().then(async (module_or_path) => {
|
|
3707
|
-
await __wbg_init2({ module_or_path });
|
|
3708
|
-
return perspective_migrate_js_exports;
|
|
3709
|
-
});
|
|
3710
|
-
this.module = module;
|
|
3711
|
-
module.catch(() => {
|
|
3712
|
-
if (this.module === module) {
|
|
3713
|
-
this.module = void 0;
|
|
3714
|
-
}
|
|
3715
|
-
});
|
|
3757
|
+
async function load_validator(binary) {
|
|
3758
|
+
await __wbg_init2({ module_or_path: binary });
|
|
3759
|
+
return {
|
|
3760
|
+
migrate(kind, config, from_version) {
|
|
3761
|
+
return migrate(
|
|
3762
|
+
kind,
|
|
3763
|
+
from_version,
|
|
3764
|
+
config
|
|
3765
|
+
);
|
|
3766
|
+
},
|
|
3767
|
+
validate(kind, config, options) {
|
|
3768
|
+
validate_config(kind, config, options?.strict);
|
|
3716
3769
|
}
|
|
3717
|
-
|
|
3718
|
-
|
|
3719
|
-
}
|
|
3720
|
-
};
|
|
3770
|
+
};
|
|
3771
|
+
}
|
|
3721
3772
|
|
|
3722
3773
|
// src/ts/wasm/perspective-server.poly.ts
|
|
3723
3774
|
var out = console.log.bind(console);
|
|
@@ -4196,15 +4247,18 @@ if (!globalThis.crypto) {
|
|
|
4196
4247
|
}
|
|
4197
4248
|
var uncompressed_client_wasm = await fs.readFile(path.join(__dirname, "../../dist/wasm/perspective-js.wasm")).then((buffer) => load_wasm_stage_0(buffer.buffer));
|
|
4198
4249
|
await __wbg_init({ module_or_path: uncompressed_client_wasm });
|
|
4199
|
-
var
|
|
4200
|
-
|
|
4201
|
-
|
|
4202
|
-
path.join(__dirname, "../../dist/wasm/perspective-migrate
|
|
4203
|
-
);
|
|
4204
|
-
return await
|
|
4205
|
-
}
|
|
4250
|
+
var VALIDATOR;
|
|
4251
|
+
async function create_validator() {
|
|
4252
|
+
VALIDATOR ??= fs.readFile(
|
|
4253
|
+
path.join(__dirname, "../../dist/wasm/perspective-migrate.wasm")
|
|
4254
|
+
).then((buffer) => load_wasm_stage_0(buffer.buffer)).then(load_validator);
|
|
4255
|
+
return await VALIDATOR;
|
|
4256
|
+
}
|
|
4206
4257
|
async function migrate2(kind, config, from_version) {
|
|
4207
|
-
return await
|
|
4258
|
+
return (await create_validator()).migrate(kind, config, from_version);
|
|
4259
|
+
}
|
|
4260
|
+
async function validate(kind, config, options) {
|
|
4261
|
+
(await create_validator()).validate(kind, config, options);
|
|
4208
4262
|
}
|
|
4209
4263
|
function make_node_disk_bridge({
|
|
4210
4264
|
heap: heap3,
|
|
@@ -4527,7 +4581,9 @@ var perspective_node_default = {
|
|
|
4527
4581
|
join,
|
|
4528
4582
|
websocket: websocket2,
|
|
4529
4583
|
worker,
|
|
4584
|
+
create_validator,
|
|
4530
4585
|
migrate: migrate2,
|
|
4586
|
+
validate,
|
|
4531
4587
|
host_supports_memory64,
|
|
4532
4588
|
get_hosted_table_names,
|
|
4533
4589
|
on_hosted_tables_update,
|
|
@@ -4546,6 +4602,7 @@ export {
|
|
|
4546
4602
|
VirtualServer,
|
|
4547
4603
|
WebSocketServer,
|
|
4548
4604
|
createMessageHandler2 as createMessageHandler,
|
|
4605
|
+
create_validator,
|
|
4549
4606
|
cwd_static_file_handler,
|
|
4550
4607
|
perspective_node_default as default,
|
|
4551
4608
|
get_hosted_table_names,
|
|
@@ -4559,6 +4616,7 @@ export {
|
|
|
4559
4616
|
remove_hosted_tables_update,
|
|
4560
4617
|
system_info,
|
|
4561
4618
|
table,
|
|
4619
|
+
validate,
|
|
4562
4620
|
perspective_js_exports as wasmModule,
|
|
4563
4621
|
websocket2 as websocket,
|
|
4564
4622
|
worker
|