jazz-wasm 2.0.0-alpha.27 → 2.0.0-alpha.29
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 +1 -1
- package/pkg/jazz_wasm.d.ts +14 -8
- package/pkg/jazz_wasm.js +98 -9
- package/pkg/jazz_wasm_bg.wasm +0 -0
package/package.json
CHANGED
package/pkg/jazz_wasm.d.ts
CHANGED
|
@@ -145,6 +145,7 @@ export class WasmRuntime {
|
|
|
145
145
|
* Delete a row by ObjectId as an explicit session principal.
|
|
146
146
|
*/
|
|
147
147
|
deleteWithSession(object_id: string, write_context_json?: string | null): void;
|
|
148
|
+
static deriveUserId(seed_b64: string): string;
|
|
148
149
|
/**
|
|
149
150
|
* Phase 2 of 2-phase subscribe: compile graph, register subscription,
|
|
150
151
|
* sync to servers, attach callback, and deliver the first delta.
|
|
@@ -160,6 +161,7 @@ export class WasmRuntime {
|
|
|
160
161
|
* Flush only the WAL buffer to OPFS (not the snapshot).
|
|
161
162
|
*/
|
|
162
163
|
flushWal(): void;
|
|
164
|
+
static getPublicKeyBase64url(seed_b64: string): string;
|
|
163
165
|
/**
|
|
164
166
|
* Get the current schema as JSON.
|
|
165
167
|
*/
|
|
@@ -174,22 +176,23 @@ export class WasmRuntime {
|
|
|
174
176
|
* # Returns
|
|
175
177
|
* The inserted row as `{ id, values }`.
|
|
176
178
|
*/
|
|
177
|
-
insert(table: string, values: any): any;
|
|
179
|
+
insert(table: string, values: any, object_id?: string | null): any;
|
|
178
180
|
/**
|
|
179
181
|
* Insert a row and return a Promise that resolves when the tier acks.
|
|
180
182
|
*
|
|
181
183
|
* `tier` must be one of: "worker", "edge", "global".
|
|
182
184
|
*/
|
|
183
|
-
insertDurable(table: string, values: any, tier: string): Promise<any>;
|
|
185
|
+
insertDurable(table: string, values: any, tier: string, object_id?: string | null): Promise<any>;
|
|
184
186
|
/**
|
|
185
187
|
* Insert a row and return a Promise that resolves when the tier acks,
|
|
186
188
|
* scoped to an explicit session principal.
|
|
187
189
|
*/
|
|
188
|
-
insertDurableWithSession(table: string, values: any, write_context_json: string | null | undefined, tier: string): Promise<any>;
|
|
190
|
+
insertDurableWithSession(table: string, values: any, write_context_json: string | null | undefined, tier: string, object_id?: string | null): Promise<any>;
|
|
189
191
|
/**
|
|
190
192
|
* Insert a row into a table as an explicit session principal.
|
|
191
193
|
*/
|
|
192
|
-
insertWithSession(table: string, values: any, write_context_json?: string | null): any;
|
|
194
|
+
insertWithSession(table: string, values: any, write_context_json?: string | null, object_id?: string | null): any;
|
|
195
|
+
static mintLocalFirstToken(seed_b64: string, audience: string, ttl_seconds: bigint, now_seconds: bigint): string;
|
|
193
196
|
/**
|
|
194
197
|
* Create a new WasmRuntime.
|
|
195
198
|
*
|
|
@@ -404,15 +407,18 @@ export interface InitOutput {
|
|
|
404
407
|
readonly wasmruntime_deleteDurable: (a: number, b: number, c: number, d: number, e: number) => [number, number, number];
|
|
405
408
|
readonly wasmruntime_deleteDurableWithSession: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => [number, number, number];
|
|
406
409
|
readonly wasmruntime_deleteWithSession: (a: number, b: number, c: number, d: number, e: number) => [number, number];
|
|
410
|
+
readonly wasmruntime_deriveUserId: (a: number, b: number) => [number, number, number, number];
|
|
407
411
|
readonly wasmruntime_executeSubscription: (a: number, b: number, c: any) => [number, number];
|
|
408
412
|
readonly wasmruntime_flush: (a: number) => void;
|
|
409
413
|
readonly wasmruntime_flushWal: (a: number) => void;
|
|
414
|
+
readonly wasmruntime_getPublicKeyBase64url: (a: number, b: number) => [number, number, number, number];
|
|
410
415
|
readonly wasmruntime_getSchema: (a: number) => [number, number, number];
|
|
411
416
|
readonly wasmruntime_getSchemaHash: (a: number) => [number, number];
|
|
412
|
-
readonly wasmruntime_insert: (a: number, b: number, c: number, d: any) => [number, number, number];
|
|
413
|
-
readonly wasmruntime_insertDurable: (a: number, b: number, c: number, d: any, e: number, f: number) => [number, number, number];
|
|
414
|
-
readonly wasmruntime_insertDurableWithSession: (a: number, b: number, c: number, d: any, e: number, f: number, g: number, h: number) => [number, number, number];
|
|
415
|
-
readonly wasmruntime_insertWithSession: (a: number, b: number, c: number, d: any, e: number, f: number) => [number, number, number];
|
|
417
|
+
readonly wasmruntime_insert: (a: number, b: number, c: number, d: any, e: number, f: number) => [number, number, number];
|
|
418
|
+
readonly wasmruntime_insertDurable: (a: number, b: number, c: number, d: any, e: number, f: number, g: number, h: number) => [number, number, number];
|
|
419
|
+
readonly wasmruntime_insertDurableWithSession: (a: number, b: number, c: number, d: any, e: number, f: number, g: number, h: number, i: number, j: number) => [number, number, number];
|
|
420
|
+
readonly wasmruntime_insertWithSession: (a: number, b: number, c: number, d: any, e: number, f: number, g: number, h: number) => [number, number, number];
|
|
421
|
+
readonly wasmruntime_mintLocalFirstToken: (a: number, b: number, c: number, d: number, e: bigint, f: bigint) => [number, number, number, number];
|
|
416
422
|
readonly wasmruntime_new: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number) => [number, number, number];
|
|
417
423
|
readonly wasmruntime_onSyncMessageReceived: (a: number, b: any, c: number, d: number) => [number, number];
|
|
418
424
|
readonly wasmruntime_onSyncMessageReceivedFromClient: (a: number, b: number, c: number, d: any) => [number, number];
|
package/pkg/jazz_wasm.js
CHANGED
|
@@ -474,6 +474,30 @@ export class WasmRuntime {
|
|
|
474
474
|
throw takeFromExternrefTable0(ret[0]);
|
|
475
475
|
}
|
|
476
476
|
}
|
|
477
|
+
/**
|
|
478
|
+
* @param {string} seed_b64
|
|
479
|
+
* @returns {string}
|
|
480
|
+
*/
|
|
481
|
+
static deriveUserId(seed_b64) {
|
|
482
|
+
let deferred3_0;
|
|
483
|
+
let deferred3_1;
|
|
484
|
+
try {
|
|
485
|
+
const ptr0 = passStringToWasm0(seed_b64, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
486
|
+
const len0 = WASM_VECTOR_LEN;
|
|
487
|
+
const ret = wasm.wasmruntime_deriveUserId(ptr0, len0);
|
|
488
|
+
var ptr2 = ret[0];
|
|
489
|
+
var len2 = ret[1];
|
|
490
|
+
if (ret[3]) {
|
|
491
|
+
ptr2 = 0; len2 = 0;
|
|
492
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
493
|
+
}
|
|
494
|
+
deferred3_0 = ptr2;
|
|
495
|
+
deferred3_1 = len2;
|
|
496
|
+
return getStringFromWasm0(ptr2, len2);
|
|
497
|
+
} finally {
|
|
498
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
499
|
+
}
|
|
500
|
+
}
|
|
477
501
|
/**
|
|
478
502
|
* Phase 2 of 2-phase subscribe: compile graph, register subscription,
|
|
479
503
|
* sync to servers, attach callback, and deliver the first delta.
|
|
@@ -500,6 +524,30 @@ export class WasmRuntime {
|
|
|
500
524
|
flushWal() {
|
|
501
525
|
wasm.wasmruntime_flushWal(this.__wbg_ptr);
|
|
502
526
|
}
|
|
527
|
+
/**
|
|
528
|
+
* @param {string} seed_b64
|
|
529
|
+
* @returns {string}
|
|
530
|
+
*/
|
|
531
|
+
static getPublicKeyBase64url(seed_b64) {
|
|
532
|
+
let deferred3_0;
|
|
533
|
+
let deferred3_1;
|
|
534
|
+
try {
|
|
535
|
+
const ptr0 = passStringToWasm0(seed_b64, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
536
|
+
const len0 = WASM_VECTOR_LEN;
|
|
537
|
+
const ret = wasm.wasmruntime_getPublicKeyBase64url(ptr0, len0);
|
|
538
|
+
var ptr2 = ret[0];
|
|
539
|
+
var len2 = ret[1];
|
|
540
|
+
if (ret[3]) {
|
|
541
|
+
ptr2 = 0; len2 = 0;
|
|
542
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
543
|
+
}
|
|
544
|
+
deferred3_0 = ptr2;
|
|
545
|
+
deferred3_1 = len2;
|
|
546
|
+
return getStringFromWasm0(ptr2, len2);
|
|
547
|
+
} finally {
|
|
548
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
549
|
+
}
|
|
550
|
+
}
|
|
503
551
|
/**
|
|
504
552
|
* Get the current schema as JSON.
|
|
505
553
|
* @returns {any}
|
|
@@ -534,12 +582,15 @@ export class WasmRuntime {
|
|
|
534
582
|
* The inserted row as `{ id, values }`.
|
|
535
583
|
* @param {string} table
|
|
536
584
|
* @param {any} values
|
|
585
|
+
* @param {string | null} [object_id]
|
|
537
586
|
* @returns {any}
|
|
538
587
|
*/
|
|
539
|
-
insert(table, values) {
|
|
588
|
+
insert(table, values, object_id) {
|
|
540
589
|
const ptr0 = passStringToWasm0(table, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
541
590
|
const len0 = WASM_VECTOR_LEN;
|
|
542
|
-
|
|
591
|
+
var ptr1 = isLikeNone(object_id) ? 0 : passStringToWasm0(object_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
592
|
+
var len1 = WASM_VECTOR_LEN;
|
|
593
|
+
const ret = wasm.wasmruntime_insert(this.__wbg_ptr, ptr0, len0, values, ptr1, len1);
|
|
543
594
|
if (ret[2]) {
|
|
544
595
|
throw takeFromExternrefTable0(ret[1]);
|
|
545
596
|
}
|
|
@@ -552,14 +603,17 @@ export class WasmRuntime {
|
|
|
552
603
|
* @param {string} table
|
|
553
604
|
* @param {any} values
|
|
554
605
|
* @param {string} tier
|
|
606
|
+
* @param {string | null} [object_id]
|
|
555
607
|
* @returns {Promise<any>}
|
|
556
608
|
*/
|
|
557
|
-
insertDurable(table, values, tier) {
|
|
609
|
+
insertDurable(table, values, tier, object_id) {
|
|
558
610
|
const ptr0 = passStringToWasm0(table, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
559
611
|
const len0 = WASM_VECTOR_LEN;
|
|
560
612
|
const ptr1 = passStringToWasm0(tier, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
561
613
|
const len1 = WASM_VECTOR_LEN;
|
|
562
|
-
|
|
614
|
+
var ptr2 = isLikeNone(object_id) ? 0 : passStringToWasm0(object_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
615
|
+
var len2 = WASM_VECTOR_LEN;
|
|
616
|
+
const ret = wasm.wasmruntime_insertDurable(this.__wbg_ptr, ptr0, len0, values, ptr1, len1, ptr2, len2);
|
|
563
617
|
if (ret[2]) {
|
|
564
618
|
throw takeFromExternrefTable0(ret[1]);
|
|
565
619
|
}
|
|
@@ -572,16 +626,19 @@ export class WasmRuntime {
|
|
|
572
626
|
* @param {any} values
|
|
573
627
|
* @param {string | null | undefined} write_context_json
|
|
574
628
|
* @param {string} tier
|
|
629
|
+
* @param {string | null} [object_id]
|
|
575
630
|
* @returns {Promise<any>}
|
|
576
631
|
*/
|
|
577
|
-
insertDurableWithSession(table, values, write_context_json, tier) {
|
|
632
|
+
insertDurableWithSession(table, values, write_context_json, tier, object_id) {
|
|
578
633
|
const ptr0 = passStringToWasm0(table, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
579
634
|
const len0 = WASM_VECTOR_LEN;
|
|
580
635
|
var ptr1 = isLikeNone(write_context_json) ? 0 : passStringToWasm0(write_context_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
581
636
|
var len1 = WASM_VECTOR_LEN;
|
|
582
637
|
const ptr2 = passStringToWasm0(tier, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
583
638
|
const len2 = WASM_VECTOR_LEN;
|
|
584
|
-
|
|
639
|
+
var ptr3 = isLikeNone(object_id) ? 0 : passStringToWasm0(object_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
640
|
+
var len3 = WASM_VECTOR_LEN;
|
|
641
|
+
const ret = wasm.wasmruntime_insertDurableWithSession(this.__wbg_ptr, ptr0, len0, values, ptr1, len1, ptr2, len2, ptr3, len3);
|
|
585
642
|
if (ret[2]) {
|
|
586
643
|
throw takeFromExternrefTable0(ret[1]);
|
|
587
644
|
}
|
|
@@ -592,19 +649,51 @@ export class WasmRuntime {
|
|
|
592
649
|
* @param {string} table
|
|
593
650
|
* @param {any} values
|
|
594
651
|
* @param {string | null} [write_context_json]
|
|
652
|
+
* @param {string | null} [object_id]
|
|
595
653
|
* @returns {any}
|
|
596
654
|
*/
|
|
597
|
-
insertWithSession(table, values, write_context_json) {
|
|
655
|
+
insertWithSession(table, values, write_context_json, object_id) {
|
|
598
656
|
const ptr0 = passStringToWasm0(table, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
599
657
|
const len0 = WASM_VECTOR_LEN;
|
|
600
658
|
var ptr1 = isLikeNone(write_context_json) ? 0 : passStringToWasm0(write_context_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
601
659
|
var len1 = WASM_VECTOR_LEN;
|
|
602
|
-
|
|
660
|
+
var ptr2 = isLikeNone(object_id) ? 0 : passStringToWasm0(object_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
661
|
+
var len2 = WASM_VECTOR_LEN;
|
|
662
|
+
const ret = wasm.wasmruntime_insertWithSession(this.__wbg_ptr, ptr0, len0, values, ptr1, len1, ptr2, len2);
|
|
603
663
|
if (ret[2]) {
|
|
604
664
|
throw takeFromExternrefTable0(ret[1]);
|
|
605
665
|
}
|
|
606
666
|
return takeFromExternrefTable0(ret[0]);
|
|
607
667
|
}
|
|
668
|
+
/**
|
|
669
|
+
* @param {string} seed_b64
|
|
670
|
+
* @param {string} audience
|
|
671
|
+
* @param {bigint} ttl_seconds
|
|
672
|
+
* @param {bigint} now_seconds
|
|
673
|
+
* @returns {string}
|
|
674
|
+
*/
|
|
675
|
+
static mintLocalFirstToken(seed_b64, audience, ttl_seconds, now_seconds) {
|
|
676
|
+
let deferred4_0;
|
|
677
|
+
let deferred4_1;
|
|
678
|
+
try {
|
|
679
|
+
const ptr0 = passStringToWasm0(seed_b64, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
680
|
+
const len0 = WASM_VECTOR_LEN;
|
|
681
|
+
const ptr1 = passStringToWasm0(audience, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
682
|
+
const len1 = WASM_VECTOR_LEN;
|
|
683
|
+
const ret = wasm.wasmruntime_mintLocalFirstToken(ptr0, len0, ptr1, len1, ttl_seconds, now_seconds);
|
|
684
|
+
var ptr3 = ret[0];
|
|
685
|
+
var len3 = ret[1];
|
|
686
|
+
if (ret[3]) {
|
|
687
|
+
ptr3 = 0; len3 = 0;
|
|
688
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
689
|
+
}
|
|
690
|
+
deferred4_0 = ptr3;
|
|
691
|
+
deferred4_1 = len3;
|
|
692
|
+
return getStringFromWasm0(ptr3, len3);
|
|
693
|
+
} finally {
|
|
694
|
+
wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
|
|
695
|
+
}
|
|
696
|
+
}
|
|
608
697
|
/**
|
|
609
698
|
* Create a new WasmRuntime.
|
|
610
699
|
*
|
|
@@ -1698,7 +1787,7 @@ function __wbg_get_imports() {
|
|
|
1698
1787
|
return ret;
|
|
1699
1788
|
}, arguments); },
|
|
1700
1789
|
__wbindgen_cast_0000000000000001: function(arg0, arg1) {
|
|
1701
|
-
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx:
|
|
1790
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 2817, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
|
|
1702
1791
|
const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__hd7cc73106a1f17e7);
|
|
1703
1792
|
return ret;
|
|
1704
1793
|
},
|
package/pkg/jazz_wasm_bg.wasm
CHANGED
|
Binary file
|