@feltdb/core 0.11.1 → 0.11.3
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/cli/commands.js +27 -2
- package/dist/create/package-versions.js +1 -1
- package/dist/create/server-source/crates/feltdb/src/lib.rs +31 -30
- package/dist/create/server-source/crates/feltdb/src/semantic_decision.rs +1917 -0
- package/dist/create/server-source/crates/feltdb/tests/semantic_decision.rs +1165 -0
- package/dist/create/server-source/crates/feltdb-server/src/main.rs +231 -94
- package/dist/create/server-source/crates/feltdb-wasm/src/lib.rs +73 -8
- package/dist/db.d.ts +4 -0
- package/dist/db.d.ts.map +1 -1
- package/dist/db.js +8 -0
- package/dist/http-db.d.ts +2 -0
- package/dist/http-db.d.ts.map +1 -1
- package/dist/http-db.js +3 -0
- package/dist/index-core.d.ts +1 -0
- package/dist/index-core.d.ts.map +1 -1
- package/dist/index-core.js +1 -0
- package/dist/semantic-decision.d.ts +167 -0
- package/dist/semantic-decision.d.ts.map +1 -0
- package/dist/semantic-decision.js +1 -0
- package/dist/studio-app/assets/feltdb_wasm-BGgGSBOP.js +1 -0
- package/dist/studio-app/assets/feltdb_wasm_bg-ClM6Qpod.wasm +0 -0
- package/dist/studio-app/assets/{index-H_L5pjur.js → index-CSLtbbtP.js} +2 -2
- package/dist/studio-app/index.html +1 -1
- package/dist/wasm/feltdb_wasm.d.ts +20 -0
- package/dist/wasm/feltdb_wasm.js +91 -0
- package/dist/wasm/feltdb_wasm_bg.wasm +0 -0
- package/dist/wasm/feltdb_wasm_bg.wasm.d.ts +4 -0
- package/package.json +2 -2
- package/dist/studio-app/assets/feltdb_wasm-Dlr_kLlk.js +0 -1
- package/dist/studio-app/assets/feltdb_wasm_bg-CkozAQKb.wasm +0 -0
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
<!doctype html><html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#17211b"/><title>FeltDB Studio</title> <script type="module" crossorigin src="/assets/index-
|
|
1
|
+
<!doctype html><html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#17211b"/><title>FeltDB Studio</title> <script type="module" crossorigin src="/assets/index-CSLtbbtP.js"></script>
|
|
2
2
|
<link rel="stylesheet" crossorigin href="/assets/index-BrsF-kWL.css">
|
|
3
3
|
</head><body><div id="root"></div></body></html>
|
|
@@ -35,6 +35,7 @@ export class JsDb {
|
|
|
35
35
|
delete(key: string): JsResult;
|
|
36
36
|
execute_canonical_query(schema: string, authorization: string, state_namespace: string, query: string): JsResult;
|
|
37
37
|
execute_canonical_transaction(schema: string, request: string): JsResult;
|
|
38
|
+
execute_semantic_decision(request: string): JsResult;
|
|
38
39
|
/**
|
|
39
40
|
* Retrieve a record from the database
|
|
40
41
|
*
|
|
@@ -314,6 +315,11 @@ export function compare_state_schemas(before: string, after: string): string;
|
|
|
314
315
|
|
|
315
316
|
export function diff_application_revisions(from: string | null | undefined, to: string): string;
|
|
316
317
|
|
|
318
|
+
/**
|
|
319
|
+
* Execute one semantic decision through the Rust-authoritative WASM boundary.
|
|
320
|
+
*/
|
|
321
|
+
export function execute_semantic_decision(request: string): string;
|
|
322
|
+
|
|
317
323
|
export function hash_application_manifest(input: string): string;
|
|
318
324
|
|
|
319
325
|
export function hash_application_runtime(revision: string, environment: string): string;
|
|
@@ -335,6 +341,16 @@ export function resolve_application_runtime(revision: string, environment: strin
|
|
|
335
341
|
|
|
336
342
|
export function validate_mesh_claim(claim: string, worker: string, workload: string, now: bigint): void;
|
|
337
343
|
|
|
344
|
+
/**
|
|
345
|
+
* Validate and canonicalize a typed semantic decision definition in the Rust core.
|
|
346
|
+
*/
|
|
347
|
+
export function validate_semantic_decision_definition(definition: string): string;
|
|
348
|
+
|
|
349
|
+
/**
|
|
350
|
+
* Validate a runtime-produced semantic decision result against the Rust contract.
|
|
351
|
+
*/
|
|
352
|
+
export function validate_semantic_decision_result(request: string, result: string): string;
|
|
353
|
+
|
|
338
354
|
export function validate_state_schema(schema: string): string;
|
|
339
355
|
|
|
340
356
|
export function validate_sync_operation(operation: string): string;
|
|
@@ -367,6 +383,7 @@ export interface InitOutput {
|
|
|
367
383
|
readonly canonicalize_application_manifest: (a: number, b: number) => [number, number, number, number];
|
|
368
384
|
readonly compare_state_schemas: (a: number, b: number, c: number, d: number) => [number, number, number, number];
|
|
369
385
|
readonly diff_application_revisions: (a: number, b: number, c: number, d: number) => [number, number, number, number];
|
|
386
|
+
readonly execute_semantic_decision: (a: number, b: number) => [number, number, number, number];
|
|
370
387
|
readonly hash_application_manifest: (a: number, b: number) => [number, number, number, number];
|
|
371
388
|
readonly hash_application_runtime: (a: number, b: number, c: number, d: number) => [number, number, number, number];
|
|
372
389
|
readonly hash_state_schema: (a: number, b: number) => [number, number, number, number];
|
|
@@ -375,6 +392,7 @@ export interface InitOutput {
|
|
|
375
392
|
readonly jsdb_delete: (a: number, b: number, c: number) => number;
|
|
376
393
|
readonly jsdb_execute_canonical_query: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number) => number;
|
|
377
394
|
readonly jsdb_execute_canonical_transaction: (a: number, b: number, c: number, d: number, e: number) => number;
|
|
395
|
+
readonly jsdb_execute_semantic_decision: (a: number, b: number, c: number) => number;
|
|
378
396
|
readonly jsdb_get: (a: number, b: number, c: number) => number;
|
|
379
397
|
readonly jsdb_get_capability_records: (a: number, b: number, c: number) => number;
|
|
380
398
|
readonly jsdb_get_pending_for_peer: (a: number, b: number, c: number, d: bigint) => number;
|
|
@@ -392,6 +410,8 @@ export interface InitOutput {
|
|
|
392
410
|
readonly open: (a: number, b: number) => [number, number, number];
|
|
393
411
|
readonly resolve_application_runtime: (a: number, b: number, c: number, d: number) => [number, number, number, number];
|
|
394
412
|
readonly validate_mesh_claim: (a: number, b: number, c: number, d: number, e: number, f: number, g: bigint) => [number, number];
|
|
413
|
+
readonly validate_semantic_decision_definition: (a: number, b: number) => [number, number, number, number];
|
|
414
|
+
readonly validate_semantic_decision_result: (a: number, b: number, c: number, d: number) => [number, number, number, number];
|
|
395
415
|
readonly validate_state_schema: (a: number, b: number) => [number, number, number, number];
|
|
396
416
|
readonly validate_sync_operation: (a: number, b: number) => [number, number, number, number];
|
|
397
417
|
readonly validate_worker_transition: (a: number, b: number, c: number, d: number) => [number, number, number];
|
package/dist/wasm/feltdb_wasm.js
CHANGED
|
@@ -99,6 +99,16 @@ export class JsDb {
|
|
|
99
99
|
const ret = wasm.jsdb_execute_canonical_transaction(this.__wbg_ptr, ptr0, len0, ptr1, len1);
|
|
100
100
|
return JsResult.__wrap(ret);
|
|
101
101
|
}
|
|
102
|
+
/**
|
|
103
|
+
* @param {string} request
|
|
104
|
+
* @returns {JsResult}
|
|
105
|
+
*/
|
|
106
|
+
execute_semantic_decision(request) {
|
|
107
|
+
const ptr0 = passStringToWasm0(request, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
108
|
+
const len0 = WASM_VECTOR_LEN;
|
|
109
|
+
const ret = wasm.jsdb_execute_semantic_decision(this.__wbg_ptr, ptr0, len0);
|
|
110
|
+
return JsResult.__wrap(ret);
|
|
111
|
+
}
|
|
102
112
|
/**
|
|
103
113
|
* Retrieve a record from the database
|
|
104
114
|
*
|
|
@@ -1173,6 +1183,32 @@ export function diff_application_revisions(from, to) {
|
|
|
1173
1183
|
}
|
|
1174
1184
|
}
|
|
1175
1185
|
|
|
1186
|
+
/**
|
|
1187
|
+
* Execute one semantic decision through the Rust-authoritative WASM boundary.
|
|
1188
|
+
* @param {string} request
|
|
1189
|
+
* @returns {string}
|
|
1190
|
+
*/
|
|
1191
|
+
export function execute_semantic_decision(request) {
|
|
1192
|
+
let deferred3_0;
|
|
1193
|
+
let deferred3_1;
|
|
1194
|
+
try {
|
|
1195
|
+
const ptr0 = passStringToWasm0(request, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1196
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1197
|
+
const ret = wasm.execute_semantic_decision(ptr0, len0);
|
|
1198
|
+
var ptr2 = ret[0];
|
|
1199
|
+
var len2 = ret[1];
|
|
1200
|
+
if (ret[3]) {
|
|
1201
|
+
ptr2 = 0; len2 = 0;
|
|
1202
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
1203
|
+
}
|
|
1204
|
+
deferred3_0 = ptr2;
|
|
1205
|
+
deferred3_1 = len2;
|
|
1206
|
+
return getStringFromWasm0(ptr2, len2);
|
|
1207
|
+
} finally {
|
|
1208
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
1209
|
+
}
|
|
1210
|
+
}
|
|
1211
|
+
|
|
1176
1212
|
/**
|
|
1177
1213
|
* @param {string} input
|
|
1178
1214
|
* @returns {string}
|
|
@@ -1319,6 +1355,61 @@ export function validate_mesh_claim(claim, worker, workload, now) {
|
|
|
1319
1355
|
}
|
|
1320
1356
|
}
|
|
1321
1357
|
|
|
1358
|
+
/**
|
|
1359
|
+
* Validate and canonicalize a typed semantic decision definition in the Rust core.
|
|
1360
|
+
* @param {string} definition
|
|
1361
|
+
* @returns {string}
|
|
1362
|
+
*/
|
|
1363
|
+
export function validate_semantic_decision_definition(definition) {
|
|
1364
|
+
let deferred3_0;
|
|
1365
|
+
let deferred3_1;
|
|
1366
|
+
try {
|
|
1367
|
+
const ptr0 = passStringToWasm0(definition, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1368
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1369
|
+
const ret = wasm.validate_semantic_decision_definition(ptr0, len0);
|
|
1370
|
+
var ptr2 = ret[0];
|
|
1371
|
+
var len2 = ret[1];
|
|
1372
|
+
if (ret[3]) {
|
|
1373
|
+
ptr2 = 0; len2 = 0;
|
|
1374
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
1375
|
+
}
|
|
1376
|
+
deferred3_0 = ptr2;
|
|
1377
|
+
deferred3_1 = len2;
|
|
1378
|
+
return getStringFromWasm0(ptr2, len2);
|
|
1379
|
+
} finally {
|
|
1380
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
1381
|
+
}
|
|
1382
|
+
}
|
|
1383
|
+
|
|
1384
|
+
/**
|
|
1385
|
+
* Validate a runtime-produced semantic decision result against the Rust contract.
|
|
1386
|
+
* @param {string} request
|
|
1387
|
+
* @param {string} result
|
|
1388
|
+
* @returns {string}
|
|
1389
|
+
*/
|
|
1390
|
+
export function validate_semantic_decision_result(request, result) {
|
|
1391
|
+
let deferred4_0;
|
|
1392
|
+
let deferred4_1;
|
|
1393
|
+
try {
|
|
1394
|
+
const ptr0 = passStringToWasm0(request, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1395
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1396
|
+
const ptr1 = passStringToWasm0(result, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1397
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1398
|
+
const ret = wasm.validate_semantic_decision_result(ptr0, len0, ptr1, len1);
|
|
1399
|
+
var ptr3 = ret[0];
|
|
1400
|
+
var len3 = ret[1];
|
|
1401
|
+
if (ret[3]) {
|
|
1402
|
+
ptr3 = 0; len3 = 0;
|
|
1403
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
1404
|
+
}
|
|
1405
|
+
deferred4_0 = ptr3;
|
|
1406
|
+
deferred4_1 = len3;
|
|
1407
|
+
return getStringFromWasm0(ptr3, len3);
|
|
1408
|
+
} finally {
|
|
1409
|
+
wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
|
|
1410
|
+
}
|
|
1411
|
+
}
|
|
1412
|
+
|
|
1322
1413
|
/**
|
|
1323
1414
|
* @param {string} schema
|
|
1324
1415
|
* @returns {string}
|
|
Binary file
|
|
@@ -13,6 +13,7 @@ export const canonical_bundle_hash: (a: number, b: number) => [number, number, n
|
|
|
13
13
|
export const canonicalize_application_manifest: (a: number, b: number) => [number, number, number, number];
|
|
14
14
|
export const compare_state_schemas: (a: number, b: number, c: number, d: number) => [number, number, number, number];
|
|
15
15
|
export const diff_application_revisions: (a: number, b: number, c: number, d: number) => [number, number, number, number];
|
|
16
|
+
export const execute_semantic_decision: (a: number, b: number) => [number, number, number, number];
|
|
16
17
|
export const hash_application_manifest: (a: number, b: number) => [number, number, number, number];
|
|
17
18
|
export const hash_application_runtime: (a: number, b: number, c: number, d: number) => [number, number, number, number];
|
|
18
19
|
export const hash_state_schema: (a: number, b: number) => [number, number, number, number];
|
|
@@ -21,6 +22,7 @@ export const jsdb_add_sync_peer: (a: number, b: number, c: number) => number;
|
|
|
21
22
|
export const jsdb_delete: (a: number, b: number, c: number) => number;
|
|
22
23
|
export const jsdb_execute_canonical_query: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number) => number;
|
|
23
24
|
export const jsdb_execute_canonical_transaction: (a: number, b: number, c: number, d: number, e: number) => number;
|
|
25
|
+
export const jsdb_execute_semantic_decision: (a: number, b: number, c: number) => number;
|
|
24
26
|
export const jsdb_get: (a: number, b: number, c: number) => number;
|
|
25
27
|
export const jsdb_get_capability_records: (a: number, b: number, c: number) => number;
|
|
26
28
|
export const jsdb_get_pending_for_peer: (a: number, b: number, c: number, d: bigint) => number;
|
|
@@ -38,6 +40,8 @@ export const jsresult_success: (a: number) => number;
|
|
|
38
40
|
export const open: (a: number, b: number) => [number, number, number];
|
|
39
41
|
export const resolve_application_runtime: (a: number, b: number, c: number, d: number) => [number, number, number, number];
|
|
40
42
|
export const validate_mesh_claim: (a: number, b: number, c: number, d: number, e: number, f: number, g: bigint) => [number, number];
|
|
43
|
+
export const validate_semantic_decision_definition: (a: number, b: number) => [number, number, number, number];
|
|
44
|
+
export const validate_semantic_decision_result: (a: number, b: number, c: number, d: number) => [number, number, number, number];
|
|
41
45
|
export const validate_state_schema: (a: number, b: number) => [number, number, number, number];
|
|
42
46
|
export const validate_sync_operation: (a: number, b: number) => [number, number, number, number];
|
|
43
47
|
export const validate_worker_transition: (a: number, b: number, c: number, d: number) => [number, number, number];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@feltdb/core",
|
|
3
|
-
"version": "0.11.
|
|
3
|
+
"version": "0.11.3",
|
|
4
4
|
"description": "FeltDB Core - Application-facing database with Browser, Local, and Server runtimes. Durable state, reactive APIs.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
"README.md"
|
|
62
62
|
],
|
|
63
63
|
"scripts": {
|
|
64
|
-
"build": "rm -rf dist && tsc && node ../../tools/stage-core-wasm.mjs && npm run build --workspace @feltdb/react && npm run build --workspace @feltdb/migration-sherpa && npm run build --workspace @feltdb/studio && npm run build --workspace
|
|
64
|
+
"build": "rm -rf dist && tsc && node ../../tools/stage-core-wasm.mjs && npm run build --workspace @feltdb/react && npm run build --workspace @feltdb/migration-sherpa && npm run build --workspace @feltdb/studio && npm run build --workspace create-feltdb && npm run build --workspace @feltdb/cli && node ../../tools/assemble-core-sdk.mjs",
|
|
65
65
|
"test": "node ../../test-runner.ts",
|
|
66
66
|
"test:workspace-e2e": "node --test test/workspace-connection.e2e.test.mjs test/local-development-authority-read-contract.test.mjs",
|
|
67
67
|
"type-check": "tsc --noEmit"
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var e=class e{static __wrap(t){let n=Object.create(e.prototype);return n.__wbg_ptr=t,T.register(n,n.__wbg_ptr,n),n}__destroy_into_raw(){let e=this.__wbg_ptr;return this.__wbg_ptr=0,T.unregister(this),e}free(){let e=this.__destroy_into_raw();U.__wbg_jsdb_free(e,0)}acknowledge_peer_operations(e,n){let r=F(e,U.__wbindgen_malloc,U.__wbindgen_realloc),i=H,a=U.jsdb_acknowledge_peer_operations(this.__wbg_ptr,r,i,n);return t.__wrap(a)}add_sync_peer(e){let n=F(e,U.__wbindgen_malloc,U.__wbindgen_realloc),r=H,i=U.jsdb_add_sync_peer(this.__wbg_ptr,n,r);return t.__wrap(i)}delete(e){let n=F(e,U.__wbindgen_malloc,U.__wbindgen_realloc),r=H,i=U.jsdb_delete(this.__wbg_ptr,n,r);return t.__wrap(i)}execute_canonical_query(e,n,r,i){let a=F(e,U.__wbindgen_malloc,U.__wbindgen_realloc),o=H,s=F(n,U.__wbindgen_malloc,U.__wbindgen_realloc),c=H,l=F(r,U.__wbindgen_malloc,U.__wbindgen_realloc),u=H,d=F(i,U.__wbindgen_malloc,U.__wbindgen_realloc),f=H,p=U.jsdb_execute_canonical_query(this.__wbg_ptr,a,o,s,c,l,u,d,f);return t.__wrap(p)}execute_canonical_transaction(e,n){let r=F(e,U.__wbindgen_malloc,U.__wbindgen_realloc),i=H,a=F(n,U.__wbindgen_malloc,U.__wbindgen_realloc),o=H,s=U.jsdb_execute_canonical_transaction(this.__wbg_ptr,r,i,a,o);return t.__wrap(s)}get(e){let n=F(e,U.__wbindgen_malloc,U.__wbindgen_realloc),r=H,i=U.jsdb_get(this.__wbg_ptr,n,r);return t.__wrap(i)}get_capability_records(e){let n=F(e,U.__wbindgen_malloc,U.__wbindgen_realloc),r=H,i=U.jsdb_get_capability_records(this.__wbg_ptr,n,r);return t.__wrap(i)}get_pending_for_peer(e,n){let r=F(e,U.__wbindgen_malloc,U.__wbindgen_realloc),i=H,a=U.jsdb_get_pending_for_peer(this.__wbg_ptr,r,i,n);return t.__wrap(a)}get_sequence(){let e=U.jsdb_get_sequence(this.__wbg_ptr);return BigInt.asUintN(64,e)}insert(e,n){let r=F(e,U.__wbindgen_malloc,U.__wbindgen_realloc),i=H,a=F(n,U.__wbindgen_malloc,U.__wbindgen_realloc),o=H,s=U.jsdb_insert(this.__wbg_ptr,r,i,a,o);return t.__wrap(s)}instance_id(){let e,t;try{let n=U.jsdb_instance_id(this.__wbg_ptr);return e=n[0],t=n[1],j(n[0],n[1])}finally{U.__wbindgen_free(e,t,1)}}is_auto_indexed(){return U.jsdb_is_auto_indexed(this.__wbg_ptr)!==0}query(e){let n=F(e,U.__wbindgen_malloc,U.__wbindgen_realloc),r=H,i=U.jsdb_query(this.__wbg_ptr,n,r);return t.__wrap(i)}remove_sync_peer(e){let n=F(e,U.__wbindgen_malloc,U.__wbindgen_realloc),r=H,i=U.jsdb_remove_sync_peer(this.__wbg_ptr,n,r);return t.__wrap(i)}sync_info(){let e=U.jsdb_sync_info(this.__wbg_ptr);return t.__wrap(e)}update(e,n){let r=F(e,U.__wbindgen_malloc,U.__wbindgen_realloc),i=H,a=F(n,U.__wbindgen_malloc,U.__wbindgen_realloc),o=H,s=U.jsdb_update(this.__wbg_ptr,r,i,a,o);return t.__wrap(s)}};Symbol.dispose&&(e.prototype[Symbol.dispose]=e.prototype.free);var t=class e{static __wrap(t){let n=Object.create(e.prototype);return n.__wbg_ptr=t,E.register(n,n.__wbg_ptr,n),n}__destroy_into_raw(){let e=this.__wbg_ptr;return this.__wbg_ptr=0,E.unregister(this),e}free(){let e=this.__destroy_into_raw();U.__wbg_jsresult_free(e,0)}get data(){let e=U.jsresult_data(this.__wbg_ptr),t;return e[0]!==0&&(t=j(e[0],e[1]),U.__wbindgen_free(e[0],e[1]*1,1)),t}get error(){let e=U.jsresult_error(this.__wbg_ptr),t;return e[0]!==0&&(t=j(e[0],e[1]),U.__wbindgen_free(e[0],e[1]*1,1)),t}get success(){return U.jsresult_success(this.__wbg_ptr)!==0}};Symbol.dispose&&(t.prototype[Symbol.dispose]=t.prototype.free);var n=class{__destroy_into_raw(){let e=this.__wbg_ptr;return this.__wbg_ptr=0,D.unregister(this),e}free(){let e=this.__destroy_into_raw();U.__wbg_wasmanalytics_free(e,0)}generate_report(e,t){let n,r;try{let o=F(e,U.__wbindgen_malloc,U.__wbindgen_realloc),s=H,c=F(t,U.__wbindgen_malloc,U.__wbindgen_realloc),l=H,u=U.wasmanalytics_generate_report(this.__wbg_ptr,o,s,c,l);var i=u[0],a=u[1];if(u[3])throw i=0,a=0,I(u[2]);return n=i,r=a,j(i,a)}finally{U.__wbindgen_free(n,r,1)}}get_all_metrics(){let e,t;try{let i=U.wasmanalytics_get_all_metrics(this.__wbg_ptr);var n=i[0],r=i[1];if(i[3])throw n=0,r=0,I(i[2]);return e=n,t=r,j(n,r)}finally{U.__wbindgen_free(e,t,1)}}get_frequent_fields(e){let t,n;try{let a=U.wasmanalytics_get_frequent_fields(this.__wbg_ptr,e);var r=a[0],i=a[1];if(a[3])throw r=0,i=0,I(a[2]);return t=r,n=i,j(r,i)}finally{U.__wbindgen_free(t,n,1)}}get_index_metrics(e){let t,n;try{let a=F(e,U.__wbindgen_malloc,U.__wbindgen_realloc),o=H,s=U.wasmanalytics_get_index_metrics(this.__wbg_ptr,a,o);var r=s[0],i=s[1];if(s[3])throw r=0,i=0,I(s[2]);return t=r,n=i,j(r,i)}finally{U.__wbindgen_free(t,n,1)}}get_slowest_queries(e){let t,n;try{let a=U.wasmanalytics_get_slowest_queries(this.__wbg_ptr,e);var r=a[0],i=a[1];if(a[3])throw r=0,i=0,I(a[2]);return t=r,n=i,j(r,i)}finally{U.__wbindgen_free(t,n,1)}}constructor(){let e=U.wasmanalytics_new();return this.__wbg_ptr=e,D.register(this,this.__wbg_ptr,this),this}record_index_usage(e,t,n){let r=F(e,U.__wbindgen_malloc,U.__wbindgen_realloc),i=H,a=F(t,U.__wbindgen_malloc,U.__wbindgen_realloc),o=H;U.wasmanalytics_record_index_usage(this.__wbg_ptr,r,i,a,o,n)}record_query(e,t,n,r,i,a){let o=F(e,U.__wbindgen_malloc,U.__wbindgen_realloc),s=H,c=F(t,U.__wbindgen_malloc,U.__wbindgen_realloc),l=H;var u=P(a)?0:F(a,U.__wbindgen_malloc,U.__wbindgen_realloc),d=H;let f=U.wasmanalytics_record_query(this.__wbg_ptr,o,s,c,l,n,r,i,u,d);if(f[1])throw I(f[0])}reset(){U.wasmanalytics_reset(this.__wbg_ptr)}};Symbol.dispose&&(n.prototype[Symbol.dispose]=n.prototype.free);var r=class{__destroy_into_raw(){let e=this.__wbg_ptr;return this.__wbg_ptr=0,O.unregister(this),e}free(){let e=this.__destroy_into_raw();U.__wbg_wasmdistributedindexmanager_free(e,0)}create_replicated_index(e,t,n){let r=F(e,U.__wbindgen_malloc,U.__wbindgen_realloc),i=H,a=F(t,U.__wbindgen_malloc,U.__wbindgen_realloc),o=H,s=F(n,U.__wbindgen_malloc,U.__wbindgen_realloc),c=H,l=U.wasmdistributedindexmanager_create_replicated_index(this.__wbg_ptr,r,i,a,o,s,c);if(l[1])throw I(l[0])}detect_conflicts(e){let t,n;try{let a=F(e,U.__wbindgen_malloc,U.__wbindgen_realloc),o=H,s=U.wasmdistributedindexmanager_detect_conflicts(this.__wbg_ptr,a,o);var r=s[0],i=s[1];if(s[3])throw r=0,i=0,I(s[2]);return t=r,n=i,j(r,i)}finally{U.__wbindgen_free(t,n,1)}}get_replication_status(e){let t,n;try{let a=F(e,U.__wbindgen_malloc,U.__wbindgen_realloc),o=H,s=U.wasmdistributedindexmanager_get_replication_status(this.__wbg_ptr,a,o);var r=s[0],i=s[1];if(s[3])throw r=0,i=0,I(s[2]);return t=r,n=i,j(r,i)}finally{U.__wbindgen_free(t,n,1)}}get_replication_targets(e){let t,n;try{let a=F(e,U.__wbindgen_malloc,U.__wbindgen_realloc),o=H,s=U.wasmdistributedindexmanager_get_replication_targets(this.__wbg_ptr,a,o);var r=s[0],i=s[1];if(s[3])throw r=0,i=0,I(s[2]);return t=r,n=i,j(r,i)}finally{U.__wbindgen_free(t,n,1)}}get_sync_status(){let e,t;try{let i=U.wasmdistributedindexmanager_get_sync_status(this.__wbg_ptr);var n=i[0],r=i[1];if(i[3])throw n=0,r=0,I(i[2]);return e=n,t=r,j(n,r)}finally{U.__wbindgen_free(e,t,1)}}merge_versions(e){let t=F(e,U.__wbindgen_malloc,U.__wbindgen_realloc),n=H,r=U.wasmdistributedindexmanager_merge_versions(this.__wbg_ptr,t,n);if(r[1])throw I(r[0])}constructor(e){let t=F(e,U.__wbindgen_malloc,U.__wbindgen_realloc),n=H,r=U.wasmdistributedindexmanager_new(t,n);return this.__wbg_ptr=r,O.register(this,this.__wbg_ptr,this),this}register_peer(e){let t=F(e,U.__wbindgen_malloc,U.__wbindgen_realloc),n=H;U.wasmdistributedindexmanager_register_peer(this.__wbg_ptr,t,n)}set_peer_reachable(e,t){let n=F(e,U.__wbindgen_malloc,U.__wbindgen_realloc),r=H;U.wasmdistributedindexmanager_set_peer_reachable(this.__wbg_ptr,n,r,t)}};Symbol.dispose&&(r.prototype[Symbol.dispose]=r.prototype.free);var i=class{__destroy_into_raw(){let e=this.__wbg_ptr;return this.__wbg_ptr=0,k.unregister(this),e}free(){let e=this.__destroy_into_raw();U.__wbg_wasmindexmanager_free(e,0)}create_index(e){let t=F(e,U.__wbindgen_malloc,U.__wbindgen_realloc),n=H,r=U.wasmindexmanager_create_index(this.__wbg_ptr,t,n);if(r[1])throw I(r[0])}get_stats(e){let t,n;try{let a=F(e,U.__wbindgen_malloc,U.__wbindgen_realloc),o=H,s=U.wasmindexmanager_get_stats(this.__wbg_ptr,a,o);var r=s[0],i=s[1];if(s[3])throw r=0,i=0,I(s[2]);return t=r,n=i,j(r,i)}finally{U.__wbindgen_free(t,n,1)}}list_indexes(){let e,t;try{let i=U.wasmindexmanager_list_indexes(this.__wbg_ptr);var n=i[0],r=i[1];if(i[3])throw n=0,r=0,I(i[2]);return e=n,t=r,j(n,r)}finally{U.__wbindgen_free(e,t,1)}}constructor(){let e=U.wasmindexmanager_new();return this.__wbg_ptr=e,k.register(this,this.__wbg_ptr,this),this}query_index(e,t,n){let r,i;try{let s=F(e,U.__wbindgen_malloc,U.__wbindgen_realloc),c=H,l=F(t,U.__wbindgen_malloc,U.__wbindgen_realloc),u=H,d=F(n,U.__wbindgen_malloc,U.__wbindgen_realloc),f=H,p=U.wasmindexmanager_query_index(this.__wbg_ptr,s,c,l,u,d,f);var a=p[0],o=p[1];if(p[3])throw a=0,o=0,I(p[2]);return r=a,i=o,j(a,o)}finally{U.__wbindgen_free(r,i,1)}}update_record(e,t,n){let r=F(e,U.__wbindgen_malloc,U.__wbindgen_realloc),i=H;var a=P(t)?0:F(t,U.__wbindgen_malloc,U.__wbindgen_realloc),o=H;let s=F(n,U.__wbindgen_malloc,U.__wbindgen_realloc),c=H,l=U.wasmindexmanager_update_record(this.__wbg_ptr,r,i,a,o,s,c);if(l[1])throw I(l[0])}};Symbol.dispose&&(i.prototype[Symbol.dispose]=i.prototype.free);var a=class{__destroy_into_raw(){let e=this.__wbg_ptr;return this.__wbg_ptr=0,A.unregister(this),e}free(){let e=this.__destroy_into_raw();U.__wbg_wasmshardmanager_free(e,0)}detect_hotspots(){let e,t;try{let i=U.wasmshardmanager_detect_hotspots(this.__wbg_ptr);var n=i[0],r=i[1];if(i[3])throw n=0,r=0,I(i[2]);return e=n,t=r,j(n,r)}finally{U.__wbindgen_free(e,t,1)}}generate_rebalance_ops(){let e,t;try{let i=U.wasmshardmanager_generate_rebalance_ops(this.__wbg_ptr);var n=i[0],r=i[1];if(i[3])throw n=0,r=0,I(i[2]);return e=n,t=r,j(n,r)}finally{U.__wbindgen_free(e,t,1)}}get_all_metrics(){let e,t;try{let i=U.wasmshardmanager_get_all_metrics(this.__wbg_ptr);var n=i[0],r=i[1];if(i[3])throw n=0,r=0,I(i[2]);return e=n,t=r,j(n,r)}finally{U.__wbindgen_free(e,t,1)}}get_distribution_summary(){let e,t;try{let i=U.wasmshardmanager_get_distribution_summary(this.__wbg_ptr);var n=i[0],r=i[1];if(i[3])throw n=0,r=0,I(i[2]);return e=n,t=r,j(n,r)}finally{U.__wbindgen_free(e,t,1)}}get_shard_for_key(e){let t,n;try{let a=F(e,U.__wbindgen_malloc,U.__wbindgen_realloc),o=H,s=U.wasmshardmanager_get_shard_for_key(this.__wbg_ptr,a,o);var r=s[0],i=s[1];if(s[3])throw r=0,i=0,I(s[2]);return t=r,n=i,j(r,i)}finally{U.__wbindgen_free(t,n,1)}}initialize_shards(e){let t=F(e,U.__wbindgen_malloc,U.__wbindgen_realloc),n=H,r=U.wasmshardmanager_initialize_shards(this.__wbg_ptr,t,n);if(r[1])throw I(r[0])}constructor(e,t){let n=F(e,U.__wbindgen_malloc,U.__wbindgen_realloc),r=H,i=F(t,U.__wbindgen_malloc,U.__wbindgen_realloc),a=H,o=U.wasmshardmanager_new(n,r,i,a);return this.__wbg_ptr=o,A.register(this,this.__wbg_ptr,this),this}record_shard_operation(e,t,n,r,i){let a=F(e,U.__wbindgen_malloc,U.__wbindgen_realloc),o=H,s=F(t,U.__wbindgen_malloc,U.__wbindgen_realloc),c=H;U.wasmshardmanager_record_shard_operation(this.__wbg_ptr,a,o,s,c,n,r,i)}};Symbol.dispose&&(a.prototype[Symbol.dispose]=a.prototype.free);function o(e,t){let n,r;try{let o=F(e,U.__wbindgen_malloc,U.__wbindgen_realloc),s=H,c=F(t,U.__wbindgen_malloc,U.__wbindgen_realloc),l=H,u=U.apply_sync_result(o,s,c,l);var i=u[0],a=u[1];if(u[3])throw i=0,a=0,I(u[2]);return n=i,r=a,j(i,a)}finally{U.__wbindgen_free(n,r,1)}}function s(e,t,n,r,i,a){let o,s;try{let u=F(e,U.__wbindgen_malloc,U.__wbindgen_realloc),d=H,f=F(t,U.__wbindgen_malloc,U.__wbindgen_realloc),p=H,m=F(n,U.__wbindgen_malloc,U.__wbindgen_realloc),h=H,g=F(r,U.__wbindgen_malloc,U.__wbindgen_realloc),_=H,v=F(i,U.__wbindgen_malloc,U.__wbindgen_realloc),y=H,b=F(a,U.__wbindgen_malloc,U.__wbindgen_realloc),x=H,S=U.authorize_offline(u,d,f,p,m,h,g,_,v,y,b,x);var c=S[0],l=S[1];if(S[3])throw c=0,l=0,I(S[2]);return o=c,s=l,j(c,l)}finally{U.__wbindgen_free(o,s,1)}}function c(e){let t,n;try{let a=F(e,U.__wbindgen_malloc,U.__wbindgen_realloc),o=H,s=U.canonical_bundle_hash(a,o);var r=s[0],i=s[1];if(s[3])throw r=0,i=0,I(s[2]);return t=r,n=i,j(r,i)}finally{U.__wbindgen_free(t,n,1)}}function l(e){let t,n;try{let a=F(e,U.__wbindgen_malloc,U.__wbindgen_realloc),o=H,s=U.canonicalize_application_manifest(a,o);var r=s[0],i=s[1];if(s[3])throw r=0,i=0,I(s[2]);return t=r,n=i,j(r,i)}finally{U.__wbindgen_free(t,n,1)}}function u(e,t){let n,r;try{let o=F(e,U.__wbindgen_malloc,U.__wbindgen_realloc),s=H,c=F(t,U.__wbindgen_malloc,U.__wbindgen_realloc),l=H,u=U.compare_state_schemas(o,s,c,l);var i=u[0],a=u[1];if(u[3])throw i=0,a=0,I(u[2]);return n=i,r=a,j(i,a)}finally{U.__wbindgen_free(n,r,1)}}function d(e,t){let n,r;try{var i=P(e)?0:F(e,U.__wbindgen_malloc,U.__wbindgen_realloc),a=H;let c=F(t,U.__wbindgen_malloc,U.__wbindgen_realloc),l=H,u=U.diff_application_revisions(i,a,c,l);var o=u[0],s=u[1];if(u[3])throw o=0,s=0,I(u[2]);return n=o,r=s,j(o,s)}finally{U.__wbindgen_free(n,r,1)}}function f(e){let t,n;try{let a=F(e,U.__wbindgen_malloc,U.__wbindgen_realloc),o=H,s=U.hash_application_manifest(a,o);var r=s[0],i=s[1];if(s[3])throw r=0,i=0,I(s[2]);return t=r,n=i,j(r,i)}finally{U.__wbindgen_free(t,n,1)}}function p(e,t){let n,r;try{let o=F(e,U.__wbindgen_malloc,U.__wbindgen_realloc),s=H,c=F(t,U.__wbindgen_malloc,U.__wbindgen_realloc),l=H,u=U.hash_application_runtime(o,s,c,l);var i=u[0],a=u[1];if(u[3])throw i=0,a=0,I(u[2]);return n=i,r=a,j(i,a)}finally{U.__wbindgen_free(n,r,1)}}function m(e){let t,n;try{let a=F(e,U.__wbindgen_malloc,U.__wbindgen_realloc),o=H,s=U.hash_state_schema(a,o);var r=s[0],i=s[1];if(s[3])throw r=0,i=0,I(s[2]);return t=r,n=i,j(r,i)}finally{U.__wbindgen_free(t,n,1)}}function h(t){let n=F(t,U.__wbindgen_malloc,U.__wbindgen_realloc),r=H,i=U.open(n,r);if(i[2])throw I(i[1]);return e.__wrap(i[0])}function g(e,t){let n,r;try{let o=F(e,U.__wbindgen_malloc,U.__wbindgen_realloc),s=H,c=F(t,U.__wbindgen_malloc,U.__wbindgen_realloc),l=H,u=U.resolve_application_runtime(o,s,c,l);var i=u[0],a=u[1];if(u[3])throw i=0,a=0,I(u[2]);return n=i,r=a,j(i,a)}finally{U.__wbindgen_free(n,r,1)}}function _(e,t,n,r){let i=F(e,U.__wbindgen_malloc,U.__wbindgen_realloc),a=H,o=F(t,U.__wbindgen_malloc,U.__wbindgen_realloc),s=H,c=F(n,U.__wbindgen_malloc,U.__wbindgen_realloc),l=H,u=U.validate_mesh_claim(i,a,o,s,c,l,r);if(u[1])throw I(u[0])}function v(e){let t,n;try{let a=F(e,U.__wbindgen_malloc,U.__wbindgen_realloc),o=H,s=U.validate_state_schema(a,o);var r=s[0],i=s[1];if(s[3])throw r=0,i=0,I(s[2]);return t=r,n=i,j(r,i)}finally{U.__wbindgen_free(t,n,1)}}function y(e){let t,n;try{let a=F(e,U.__wbindgen_malloc,U.__wbindgen_realloc),o=H,s=U.validate_sync_operation(a,o);var r=s[0],i=s[1];if(s[3])throw r=0,i=0,I(s[2]);return t=r,n=i,j(r,i)}finally{U.__wbindgen_free(t,n,1)}}function b(e,t){let n=F(e,U.__wbindgen_malloc,U.__wbindgen_realloc),r=H,i=F(t,U.__wbindgen_malloc,U.__wbindgen_realloc),a=H,o=U.validate_worker_transition(n,r,i,a);if(o[2])throw I(o[1]);return o[0]!==0}function x(e,t){let n=F(e,U.__wbindgen_malloc,U.__wbindgen_realloc),r=H,i=F(t,U.__wbindgen_malloc,U.__wbindgen_realloc),a=H,o=U.validate_workload_transition(n,r,i,a);if(o[2])throw I(o[1]);return o[0]!==0}function S(e){let t=F(e,U.__wbindgen_malloc,U.__wbindgen_realloc),n=H,r=U.verify_bundle_integrity(t,n);if(r[2])throw I(r[1]);return r[0]!==0}function C(e,t,n,r,i,a){let o,s;try{let u=F(e,U.__wbindgen_malloc,U.__wbindgen_realloc),d=H,f=F(t,U.__wbindgen_malloc,U.__wbindgen_realloc),p=H,m=F(n,U.__wbindgen_malloc,U.__wbindgen_realloc),h=H,g=F(r,U.__wbindgen_malloc,U.__wbindgen_realloc),_=H,v=F(i,U.__wbindgen_malloc,U.__wbindgen_realloc),y=H,b=F(a,U.__wbindgen_malloc,U.__wbindgen_realloc),x=H,S=U.verify_signed_grant(u,d,f,p,m,h,g,_,v,y,b,x);var c=S[0],l=S[1];if(S[3])throw c=0,l=0,I(S[2]);return o=c,s=l,j(c,l)}finally{U.__wbindgen_free(o,s,1)}}function w(){return{__proto__:null,"./feltdb_wasm_bg.js":{__proto__:null,__wbg___wbindgen_throw_bb96b2010945f0bc:function(e,t){throw Error(j(e,t))},__wbindgen_cast_0000000000000001:function(e,t){return j(e,t)},__wbindgen_init_externref_table:function(){let e=U.__wbindgen_externrefs,t=e.grow(4);e.set(0,void 0),e.set(t+0,void 0),e.set(t+1,null),e.set(t+2,!0),e.set(t+3,!1)}}}}var T=typeof FinalizationRegistry>`u`?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>U.__wbg_jsdb_free(e,1)),E=typeof FinalizationRegistry>`u`?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>U.__wbg_jsresult_free(e,1)),D=typeof FinalizationRegistry>`u`?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>U.__wbg_wasmanalytics_free(e,1)),O=typeof FinalizationRegistry>`u`?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>U.__wbg_wasmdistributedindexmanager_free(e,1)),k=typeof FinalizationRegistry>`u`?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>U.__wbg_wasmindexmanager_free(e,1)),A=typeof FinalizationRegistry>`u`?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>U.__wbg_wasmshardmanager_free(e,1));function j(e,t){return B(e>>>0,t)}var M=null;function N(){return(M===null||M.byteLength===0)&&(M=new Uint8Array(U.memory.buffer)),M}function P(e){return e==null}function F(e,t,n){if(n===void 0){let n=V.encode(e),r=t(n.length,1)>>>0;return N().subarray(r,r+n.length).set(n),H=n.length,r}let r=e.length,i=t(r,1)>>>0,a=N(),o=0;for(;o<r;o++){let t=e.charCodeAt(o);if(t>127)break;a[i+o]=t}if(o!==r){o!==0&&(e=e.slice(o)),i=n(i,r,r=o+e.length*3,1)>>>0;let t=N().subarray(i+o,i+r),a=V.encodeInto(e,t);o+=a.written,i=n(i,r,o,1)>>>0}return H=o,i}function I(e){let t=U.__wbindgen_externrefs.get(e);return U.__externref_table_dealloc(e),t}var L=new TextDecoder(`utf-8`,{ignoreBOM:!0,fatal:!0});L.decode();var R=2146435072,z=0;function B(e,t){return z+=t,z>=R&&(L=new TextDecoder(`utf-8`,{ignoreBOM:!0,fatal:!0}),L.decode(),z=t),L.decode(N().subarray(e,e+t))}var V=new TextEncoder;`encodeInto`in V||(V.encodeInto=function(e,t){let n=V.encode(e);return t.set(n),{read:e.length,written:n.length}});var H=0,U;function W(e,t){return U=e.exports,M=null,U.__wbindgen_start(),U}async function G(e,t){if(typeof Response==`function`&&e instanceof Response){if(!e.ok)throw Error(`failed to fetch Wasm: ${e.status} ${e.statusText} fetching '${e.url}'`);if(typeof WebAssembly.instantiateStreaming==`function`)try{return await WebAssembly.instantiateStreaming(e,t)}catch(t){if(n(e.type)&&e.headers.get(`Content-Type`)!==`application/wasm`)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",t);else throw t}let r=await e.arrayBuffer();return await WebAssembly.instantiate(r,t)}{let n=await WebAssembly.instantiate(e,t);return n instanceof WebAssembly.Instance?{instance:n,module:e}:n}function n(e){switch(e){case`basic`:case`cors`:case`default`:return!0}return!1}}function K(e){if(U!==void 0)return U;e!==void 0&&(Object.getPrototypeOf(e)===Object.prototype?{module:e}=e:console.warn("using deprecated parameters for `initSync()`; pass a single object instead"));let t=w();return e instanceof WebAssembly.Module||(e=new WebAssembly.Module(e)),W(new WebAssembly.Instance(e,t),e)}async function q(e){if(U!==void 0)return U;e!==void 0&&(Object.getPrototypeOf(e)===Object.prototype?{module_or_path:e}=e:console.warn(`using deprecated parameters for the initialization function; pass a single object instead`)),e===void 0&&(e=new URL(`/assets/feltdb_wasm_bg-CkozAQKb.wasm`,``+import.meta.url));let t=w();(typeof e==`string`||typeof Request==`function`&&e instanceof Request||typeof URL==`function`&&e instanceof URL)&&(e=fetch(e));let{instance:n,module:r}=await G(await e,t);return W(n,r)}export{e as JsDb,t as JsResult,n as WasmAnalytics,r as WasmDistributedIndexManager,i as WasmIndexManager,a as WasmShardManager,o as apply_sync_result,s as authorize_offline,c as canonical_bundle_hash,l as canonicalize_application_manifest,u as compare_state_schemas,q as default,d as diff_application_revisions,f as hash_application_manifest,p as hash_application_runtime,m as hash_state_schema,K as initSync,h as open,g as resolve_application_runtime,_ as validate_mesh_claim,v as validate_state_schema,y as validate_sync_operation,b as validate_worker_transition,x as validate_workload_transition,S as verify_bundle_integrity,C as verify_signed_grant};
|
|
Binary file
|