@spikard/wasm 0.3.6 → 0.4.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-bundler/package.json +1 -1
- package/dist-bundler/spikard_wasm.d.ts +1 -1
- package/dist-bundler/spikard_wasm_bg.js +60 -10
- package/dist-bundler/spikard_wasm_bg.wasm +0 -0
- package/dist-bundler/spikard_wasm_bg.wasm.d.ts +6 -4
- package/dist-node/package.json +1 -1
- package/dist-node/spikard_wasm.d.ts +1 -1
- package/dist-node/spikard_wasm.js +60 -10
- package/dist-node/spikard_wasm_bg.wasm +0 -0
- package/dist-node/spikard_wasm_bg.wasm.d.ts +6 -4
- package/dist-web/package.json +1 -1
- package/dist-web/spikard_wasm.d.ts +7 -5
- package/dist-web/spikard_wasm.js +51 -10
- package/dist-web/spikard_wasm_bg.wasm +0 -0
- package/dist-web/spikard_wasm_bg.wasm.d.ts +6 -4
- package/package.json +5 -5
|
@@ -12,7 +12,7 @@ export class TestClient {
|
|
|
12
12
|
/**
|
|
13
13
|
* Build a [`TestClient`] from serialized route metadata, handler map, server config, and lifecycle hooks.
|
|
14
14
|
*/
|
|
15
|
-
constructor(routes_json: string, handlers: any, config: any, lifecycle_hooks?: any | null);
|
|
15
|
+
constructor(routes_json: string, handlers: any, config: any, lifecycle_hooks?: any | null, dependencies?: any | null);
|
|
16
16
|
put(path: string, options: any): Promise<any>;
|
|
17
17
|
head(path: string, headers: any): Promise<any>;
|
|
18
18
|
post(path: string, options: any): Promise<any>;
|
|
@@ -232,12 +232,16 @@ if (!('encodeInto' in cachedTextEncoder)) {
|
|
|
232
232
|
|
|
233
233
|
let WASM_VECTOR_LEN = 0;
|
|
234
234
|
|
|
235
|
-
function
|
|
236
|
-
wasm.
|
|
235
|
+
function __wasm_bindgen_func_elem_404(arg0, arg1) {
|
|
236
|
+
wasm.__wasm_bindgen_func_elem_404(arg0, arg1);
|
|
237
237
|
}
|
|
238
238
|
|
|
239
|
-
function
|
|
240
|
-
wasm.
|
|
239
|
+
function __wasm_bindgen_func_elem_637(arg0, arg1, arg2) {
|
|
240
|
+
wasm.__wasm_bindgen_func_elem_637(arg0, arg1, addHeapObject(arg2));
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
function __wasm_bindgen_func_elem_4179(arg0, arg1, arg2, arg3) {
|
|
244
|
+
wasm.__wasm_bindgen_func_elem_4179(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
|
|
241
245
|
}
|
|
242
246
|
|
|
243
247
|
const TestClientFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
@@ -283,13 +287,14 @@ export class TestClient {
|
|
|
283
287
|
* @param {any} handlers
|
|
284
288
|
* @param {any} config
|
|
285
289
|
* @param {any | null} [lifecycle_hooks]
|
|
290
|
+
* @param {any | null} [dependencies]
|
|
286
291
|
*/
|
|
287
|
-
constructor(routes_json, handlers, config, lifecycle_hooks) {
|
|
292
|
+
constructor(routes_json, handlers, config, lifecycle_hooks, dependencies) {
|
|
288
293
|
try {
|
|
289
294
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
290
295
|
const ptr0 = passStringToWasm0(routes_json, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
291
296
|
const len0 = WASM_VECTOR_LEN;
|
|
292
|
-
wasm.testclient_new(retptr, ptr0, len0, addHeapObject(handlers), addHeapObject(config), isLikeNone(lifecycle_hooks) ? 0 : addHeapObject(lifecycle_hooks));
|
|
297
|
+
wasm.testclient_new(retptr, ptr0, len0, addHeapObject(handlers), addHeapObject(config), isLikeNone(lifecycle_hooks) ? 0 : addHeapObject(lifecycle_hooks), isLikeNone(dependencies) ? 0 : addHeapObject(dependencies));
|
|
293
298
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
294
299
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
295
300
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
@@ -504,6 +509,16 @@ export function __wbg_call_abb4ff46ce38be40() { return handleError(function (arg
|
|
|
504
509
|
return addHeapObject(ret);
|
|
505
510
|
}, arguments) };
|
|
506
511
|
|
|
512
|
+
export function __wbg_call_c8baa5c5e72d274e() { return handleError(function (arg0, arg1, arg2, arg3) {
|
|
513
|
+
const ret = getObject(arg0).call(getObject(arg1), getObject(arg2), getObject(arg3));
|
|
514
|
+
return addHeapObject(ret);
|
|
515
|
+
}, arguments) };
|
|
516
|
+
|
|
517
|
+
export function __wbg_construct_8d61a09a064d7a0e() { return handleError(function (arg0, arg1) {
|
|
518
|
+
const ret = Reflect.construct(getObject(arg0), getObject(arg1));
|
|
519
|
+
return addHeapObject(ret);
|
|
520
|
+
}, arguments) };
|
|
521
|
+
|
|
507
522
|
export function __wbg_done_62ea16af4ce34b24(arg0) {
|
|
508
523
|
const ret = getObject(arg0).done;
|
|
509
524
|
return ret;
|
|
@@ -526,6 +541,11 @@ export function __wbg_error_7534b8e9a36f1ab4(arg0, arg1) {
|
|
|
526
541
|
}
|
|
527
542
|
};
|
|
528
543
|
|
|
544
|
+
export function __wbg_finally_9d2144c01c15bee7(arg0, arg1) {
|
|
545
|
+
const ret = getObject(arg0).finally(getObject(arg1));
|
|
546
|
+
return addHeapObject(ret);
|
|
547
|
+
};
|
|
548
|
+
|
|
529
549
|
export function __wbg_for_7246e2a062d6960c(arg0, arg1) {
|
|
530
550
|
const ret = Symbol.for(getStringFromWasm0(arg0, arg1));
|
|
531
551
|
return addHeapObject(ret);
|
|
@@ -540,6 +560,10 @@ export function __wbg_getRandomValues_1c61fac11405ffdc() { return handleError(fu
|
|
|
540
560
|
globalThis.crypto.getRandomValues(getArrayU8FromWasm0(arg0, arg1));
|
|
541
561
|
}, arguments) };
|
|
542
562
|
|
|
563
|
+
export function __wbg_getRandomValues_9b655bdd369112f2() { return handleError(function (arg0, arg1) {
|
|
564
|
+
globalThis.crypto.getRandomValues(getArrayU8FromWasm0(arg0, arg1));
|
|
565
|
+
}, arguments) };
|
|
566
|
+
|
|
543
567
|
export function __wbg_get_6b7bd52aca3f9671(arg0, arg1) {
|
|
544
568
|
const ret = getObject(arg0)[arg1 >>> 0];
|
|
545
569
|
return addHeapObject(ret);
|
|
@@ -693,7 +717,7 @@ export function __wbg_new_ff12d2b041fb48f1(arg0, arg1) {
|
|
|
693
717
|
const a = state0.a;
|
|
694
718
|
state0.a = 0;
|
|
695
719
|
try {
|
|
696
|
-
return
|
|
720
|
+
return __wasm_bindgen_func_elem_4179(a, state0.b, arg0, arg1);
|
|
697
721
|
} finally {
|
|
698
722
|
state0.a = a;
|
|
699
723
|
}
|
|
@@ -725,10 +749,20 @@ export function __wbg_now_69d776cd24f5215b() {
|
|
|
725
749
|
return ret;
|
|
726
750
|
};
|
|
727
751
|
|
|
752
|
+
export function __wbg_of_b8cd42ebb79fb759(arg0, arg1) {
|
|
753
|
+
const ret = Array.of(getObject(arg0), getObject(arg1));
|
|
754
|
+
return addHeapObject(ret);
|
|
755
|
+
};
|
|
756
|
+
|
|
728
757
|
export function __wbg_prototypesetcall_dfe9b766cdc1f1fd(arg0, arg1, arg2) {
|
|
729
758
|
Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), getObject(arg2));
|
|
730
759
|
};
|
|
731
760
|
|
|
761
|
+
export function __wbg_push_7d9be8f38fc13975(arg0, arg1) {
|
|
762
|
+
const ret = getObject(arg0).push(getObject(arg1));
|
|
763
|
+
return ret;
|
|
764
|
+
};
|
|
765
|
+
|
|
732
766
|
export function __wbg_queueMicrotask_9b549dfce8865860(arg0) {
|
|
733
767
|
const ret = getObject(arg0).queueMicrotask;
|
|
734
768
|
return addHeapObject(ret);
|
|
@@ -738,6 +772,11 @@ export function __wbg_queueMicrotask_fca69f5bfad613a5(arg0) {
|
|
|
738
772
|
queueMicrotask(getObject(arg0));
|
|
739
773
|
};
|
|
740
774
|
|
|
775
|
+
export function __wbg_race_cf804f784a97f8db(arg0) {
|
|
776
|
+
const ret = Promise.race(getObject(arg0));
|
|
777
|
+
return addHeapObject(ret);
|
|
778
|
+
};
|
|
779
|
+
|
|
741
780
|
export function __wbg_resolve_fd5bfbaa4ce36e1e(arg0) {
|
|
742
781
|
const ret = Promise.resolve(getObject(arg0));
|
|
743
782
|
return addHeapObject(ret);
|
|
@@ -804,6 +843,11 @@ export function __wbg_then_4f95312d68691235(arg0, arg1) {
|
|
|
804
843
|
return addHeapObject(ret);
|
|
805
844
|
};
|
|
806
845
|
|
|
846
|
+
export function __wbg_toString_49326ce0cb2d58c4() { return handleError(function (arg0, arg1) {
|
|
847
|
+
const ret = getObject(arg0).toString(arg1);
|
|
848
|
+
return addHeapObject(ret);
|
|
849
|
+
}, arguments) };
|
|
850
|
+
|
|
807
851
|
export function __wbg_value_57b7b035e117f7ee(arg0) {
|
|
808
852
|
const ret = getObject(arg0).value;
|
|
809
853
|
return addHeapObject(ret);
|
|
@@ -815,9 +859,9 @@ export function __wbindgen_cast_2241b6af4c4b2941(arg0, arg1) {
|
|
|
815
859
|
return addHeapObject(ret);
|
|
816
860
|
};
|
|
817
861
|
|
|
818
|
-
export function
|
|
819
|
-
// Cast intrinsic for `Closure(Closure { dtor_idx:
|
|
820
|
-
const ret = makeMutClosure(arg0, arg1, wasm.
|
|
862
|
+
export function __wbindgen_cast_35aab93a0b8c860f(arg0, arg1) {
|
|
863
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 14, function: Function { arguments: [], shim_idx: 15, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
864
|
+
const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_403, __wasm_bindgen_func_elem_404);
|
|
821
865
|
return addHeapObject(ret);
|
|
822
866
|
};
|
|
823
867
|
|
|
@@ -827,6 +871,12 @@ export function __wbindgen_cast_4625c577ab2ec9ee(arg0) {
|
|
|
827
871
|
return addHeapObject(ret);
|
|
828
872
|
};
|
|
829
873
|
|
|
874
|
+
export function __wbindgen_cast_75edd3f875320618(arg0, arg1) {
|
|
875
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 120, function: Function { arguments: [Externref], shim_idx: 121, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
876
|
+
const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_636, __wasm_bindgen_func_elem_637);
|
|
877
|
+
return addHeapObject(ret);
|
|
878
|
+
};
|
|
879
|
+
|
|
830
880
|
export function __wbindgen_cast_9ae0607507abb057(arg0) {
|
|
831
881
|
// Cast intrinsic for `I64 -> Externref`.
|
|
832
882
|
const ret = arg0;
|
|
Binary file
|
|
@@ -6,16 +6,18 @@ export const testclient_delete: (a: number, b: number, c: number, d: number) =>
|
|
|
6
6
|
export const testclient_get: (a: number, b: number, c: number, d: number) => number;
|
|
7
7
|
export const testclient_handle_request: (a: number, b: number, c: number) => number;
|
|
8
8
|
export const testclient_head: (a: number, b: number, c: number, d: number) => number;
|
|
9
|
-
export const testclient_new: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
9
|
+
export const testclient_new: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
|
|
10
10
|
export const testclient_options: (a: number, b: number, c: number, d: number) => number;
|
|
11
11
|
export const testclient_patch: (a: number, b: number, c: number, d: number) => number;
|
|
12
12
|
export const testclient_post: (a: number, b: number, c: number, d: number) => number;
|
|
13
13
|
export const testclient_put: (a: number, b: number, c: number, d: number) => number;
|
|
14
14
|
export const testclient_trace: (a: number, b: number, c: number, d: number) => number;
|
|
15
15
|
export const init: () => void;
|
|
16
|
-
export const
|
|
17
|
-
export const
|
|
18
|
-
export const
|
|
16
|
+
export const __wasm_bindgen_func_elem_404: (a: number, b: number) => void;
|
|
17
|
+
export const __wasm_bindgen_func_elem_403: (a: number, b: number) => void;
|
|
18
|
+
export const __wasm_bindgen_func_elem_637: (a: number, b: number, c: number) => void;
|
|
19
|
+
export const __wasm_bindgen_func_elem_636: (a: number, b: number) => void;
|
|
20
|
+
export const __wasm_bindgen_func_elem_4179: (a: number, b: number, c: number, d: number) => void;
|
|
19
21
|
export const __wbindgen_export: (a: number, b: number) => number;
|
|
20
22
|
export const __wbindgen_export2: (a: number, b: number, c: number, d: number) => number;
|
|
21
23
|
export const __wbindgen_export3: (a: number) => void;
|
package/dist-node/package.json
CHANGED
|
@@ -12,7 +12,7 @@ export class TestClient {
|
|
|
12
12
|
/**
|
|
13
13
|
* Build a [`TestClient`] from serialized route metadata, handler map, server config, and lifecycle hooks.
|
|
14
14
|
*/
|
|
15
|
-
constructor(routes_json: string, handlers: any, config: any, lifecycle_hooks?: any | null);
|
|
15
|
+
constructor(routes_json: string, handlers: any, config: any, lifecycle_hooks?: any | null, dependencies?: any | null);
|
|
16
16
|
put(path: string, options: any): Promise<any>;
|
|
17
17
|
head(path: string, headers: any): Promise<any>;
|
|
18
18
|
post(path: string, options: any): Promise<any>;
|
|
@@ -223,12 +223,16 @@ if (!('encodeInto' in cachedTextEncoder)) {
|
|
|
223
223
|
|
|
224
224
|
let WASM_VECTOR_LEN = 0;
|
|
225
225
|
|
|
226
|
-
function
|
|
227
|
-
wasm.
|
|
226
|
+
function __wasm_bindgen_func_elem_637(arg0, arg1, arg2) {
|
|
227
|
+
wasm.__wasm_bindgen_func_elem_637(arg0, arg1, addHeapObject(arg2));
|
|
228
228
|
}
|
|
229
229
|
|
|
230
|
-
function
|
|
231
|
-
wasm.
|
|
230
|
+
function __wasm_bindgen_func_elem_404(arg0, arg1) {
|
|
231
|
+
wasm.__wasm_bindgen_func_elem_404(arg0, arg1);
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
function __wasm_bindgen_func_elem_4179(arg0, arg1, arg2, arg3) {
|
|
235
|
+
wasm.__wasm_bindgen_func_elem_4179(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
|
|
232
236
|
}
|
|
233
237
|
|
|
234
238
|
const TestClientFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
@@ -274,13 +278,14 @@ class TestClient {
|
|
|
274
278
|
* @param {any} handlers
|
|
275
279
|
* @param {any} config
|
|
276
280
|
* @param {any | null} [lifecycle_hooks]
|
|
281
|
+
* @param {any | null} [dependencies]
|
|
277
282
|
*/
|
|
278
|
-
constructor(routes_json, handlers, config, lifecycle_hooks) {
|
|
283
|
+
constructor(routes_json, handlers, config, lifecycle_hooks, dependencies) {
|
|
279
284
|
try {
|
|
280
285
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
281
286
|
const ptr0 = passStringToWasm0(routes_json, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
282
287
|
const len0 = WASM_VECTOR_LEN;
|
|
283
|
-
wasm.testclient_new(retptr, ptr0, len0, addHeapObject(handlers), addHeapObject(config), isLikeNone(lifecycle_hooks) ? 0 : addHeapObject(lifecycle_hooks));
|
|
288
|
+
wasm.testclient_new(retptr, ptr0, len0, addHeapObject(handlers), addHeapObject(config), isLikeNone(lifecycle_hooks) ? 0 : addHeapObject(lifecycle_hooks), isLikeNone(dependencies) ? 0 : addHeapObject(dependencies));
|
|
284
289
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
285
290
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
286
291
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
@@ -497,6 +502,16 @@ exports.__wbg_call_abb4ff46ce38be40 = function() { return handleError(function (
|
|
|
497
502
|
return addHeapObject(ret);
|
|
498
503
|
}, arguments) };
|
|
499
504
|
|
|
505
|
+
exports.__wbg_call_c8baa5c5e72d274e = function() { return handleError(function (arg0, arg1, arg2, arg3) {
|
|
506
|
+
const ret = getObject(arg0).call(getObject(arg1), getObject(arg2), getObject(arg3));
|
|
507
|
+
return addHeapObject(ret);
|
|
508
|
+
}, arguments) };
|
|
509
|
+
|
|
510
|
+
exports.__wbg_construct_8d61a09a064d7a0e = function() { return handleError(function (arg0, arg1) {
|
|
511
|
+
const ret = Reflect.construct(getObject(arg0), getObject(arg1));
|
|
512
|
+
return addHeapObject(ret);
|
|
513
|
+
}, arguments) };
|
|
514
|
+
|
|
500
515
|
exports.__wbg_done_62ea16af4ce34b24 = function(arg0) {
|
|
501
516
|
const ret = getObject(arg0).done;
|
|
502
517
|
return ret;
|
|
@@ -519,6 +534,11 @@ exports.__wbg_error_7534b8e9a36f1ab4 = function(arg0, arg1) {
|
|
|
519
534
|
}
|
|
520
535
|
};
|
|
521
536
|
|
|
537
|
+
exports.__wbg_finally_9d2144c01c15bee7 = function(arg0, arg1) {
|
|
538
|
+
const ret = getObject(arg0).finally(getObject(arg1));
|
|
539
|
+
return addHeapObject(ret);
|
|
540
|
+
};
|
|
541
|
+
|
|
522
542
|
exports.__wbg_for_7246e2a062d6960c = function(arg0, arg1) {
|
|
523
543
|
const ret = Symbol.for(getStringFromWasm0(arg0, arg1));
|
|
524
544
|
return addHeapObject(ret);
|
|
@@ -533,6 +553,10 @@ exports.__wbg_getRandomValues_1c61fac11405ffdc = function() { return handleError
|
|
|
533
553
|
globalThis.crypto.getRandomValues(getArrayU8FromWasm0(arg0, arg1));
|
|
534
554
|
}, arguments) };
|
|
535
555
|
|
|
556
|
+
exports.__wbg_getRandomValues_9b655bdd369112f2 = function() { return handleError(function (arg0, arg1) {
|
|
557
|
+
globalThis.crypto.getRandomValues(getArrayU8FromWasm0(arg0, arg1));
|
|
558
|
+
}, arguments) };
|
|
559
|
+
|
|
536
560
|
exports.__wbg_get_6b7bd52aca3f9671 = function(arg0, arg1) {
|
|
537
561
|
const ret = getObject(arg0)[arg1 >>> 0];
|
|
538
562
|
return addHeapObject(ret);
|
|
@@ -686,7 +710,7 @@ exports.__wbg_new_ff12d2b041fb48f1 = function(arg0, arg1) {
|
|
|
686
710
|
const a = state0.a;
|
|
687
711
|
state0.a = 0;
|
|
688
712
|
try {
|
|
689
|
-
return
|
|
713
|
+
return __wasm_bindgen_func_elem_4179(a, state0.b, arg0, arg1);
|
|
690
714
|
} finally {
|
|
691
715
|
state0.a = a;
|
|
692
716
|
}
|
|
@@ -718,10 +742,20 @@ exports.__wbg_now_69d776cd24f5215b = function() {
|
|
|
718
742
|
return ret;
|
|
719
743
|
};
|
|
720
744
|
|
|
745
|
+
exports.__wbg_of_b8cd42ebb79fb759 = function(arg0, arg1) {
|
|
746
|
+
const ret = Array.of(getObject(arg0), getObject(arg1));
|
|
747
|
+
return addHeapObject(ret);
|
|
748
|
+
};
|
|
749
|
+
|
|
721
750
|
exports.__wbg_prototypesetcall_dfe9b766cdc1f1fd = function(arg0, arg1, arg2) {
|
|
722
751
|
Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), getObject(arg2));
|
|
723
752
|
};
|
|
724
753
|
|
|
754
|
+
exports.__wbg_push_7d9be8f38fc13975 = function(arg0, arg1) {
|
|
755
|
+
const ret = getObject(arg0).push(getObject(arg1));
|
|
756
|
+
return ret;
|
|
757
|
+
};
|
|
758
|
+
|
|
725
759
|
exports.__wbg_queueMicrotask_9b549dfce8865860 = function(arg0) {
|
|
726
760
|
const ret = getObject(arg0).queueMicrotask;
|
|
727
761
|
return addHeapObject(ret);
|
|
@@ -731,6 +765,11 @@ exports.__wbg_queueMicrotask_fca69f5bfad613a5 = function(arg0) {
|
|
|
731
765
|
queueMicrotask(getObject(arg0));
|
|
732
766
|
};
|
|
733
767
|
|
|
768
|
+
exports.__wbg_race_cf804f784a97f8db = function(arg0) {
|
|
769
|
+
const ret = Promise.race(getObject(arg0));
|
|
770
|
+
return addHeapObject(ret);
|
|
771
|
+
};
|
|
772
|
+
|
|
734
773
|
exports.__wbg_resolve_fd5bfbaa4ce36e1e = function(arg0) {
|
|
735
774
|
const ret = Promise.resolve(getObject(arg0));
|
|
736
775
|
return addHeapObject(ret);
|
|
@@ -797,6 +836,11 @@ exports.__wbg_then_4f95312d68691235 = function(arg0, arg1) {
|
|
|
797
836
|
return addHeapObject(ret);
|
|
798
837
|
};
|
|
799
838
|
|
|
839
|
+
exports.__wbg_toString_49326ce0cb2d58c4 = function() { return handleError(function (arg0, arg1) {
|
|
840
|
+
const ret = getObject(arg0).toString(arg1);
|
|
841
|
+
return addHeapObject(ret);
|
|
842
|
+
}, arguments) };
|
|
843
|
+
|
|
800
844
|
exports.__wbg_value_57b7b035e117f7ee = function(arg0) {
|
|
801
845
|
const ret = getObject(arg0).value;
|
|
802
846
|
return addHeapObject(ret);
|
|
@@ -808,9 +852,9 @@ exports.__wbindgen_cast_2241b6af4c4b2941 = function(arg0, arg1) {
|
|
|
808
852
|
return addHeapObject(ret);
|
|
809
853
|
};
|
|
810
854
|
|
|
811
|
-
exports.
|
|
812
|
-
// Cast intrinsic for `Closure(Closure { dtor_idx:
|
|
813
|
-
const ret = makeMutClosure(arg0, arg1, wasm.
|
|
855
|
+
exports.__wbindgen_cast_35aab93a0b8c860f = function(arg0, arg1) {
|
|
856
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 14, function: Function { arguments: [], shim_idx: 15, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
857
|
+
const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_403, __wasm_bindgen_func_elem_404);
|
|
814
858
|
return addHeapObject(ret);
|
|
815
859
|
};
|
|
816
860
|
|
|
@@ -820,6 +864,12 @@ exports.__wbindgen_cast_4625c577ab2ec9ee = function(arg0) {
|
|
|
820
864
|
return addHeapObject(ret);
|
|
821
865
|
};
|
|
822
866
|
|
|
867
|
+
exports.__wbindgen_cast_75edd3f875320618 = function(arg0, arg1) {
|
|
868
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 120, function: Function { arguments: [Externref], shim_idx: 121, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
869
|
+
const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_636, __wasm_bindgen_func_elem_637);
|
|
870
|
+
return addHeapObject(ret);
|
|
871
|
+
};
|
|
872
|
+
|
|
823
873
|
exports.__wbindgen_cast_9ae0607507abb057 = function(arg0) {
|
|
824
874
|
// Cast intrinsic for `I64 -> Externref`.
|
|
825
875
|
const ret = arg0;
|
|
Binary file
|
|
@@ -6,16 +6,18 @@ export const testclient_delete: (a: number, b: number, c: number, d: number) =>
|
|
|
6
6
|
export const testclient_get: (a: number, b: number, c: number, d: number) => number;
|
|
7
7
|
export const testclient_handle_request: (a: number, b: number, c: number) => number;
|
|
8
8
|
export const testclient_head: (a: number, b: number, c: number, d: number) => number;
|
|
9
|
-
export const testclient_new: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
9
|
+
export const testclient_new: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
|
|
10
10
|
export const testclient_options: (a: number, b: number, c: number, d: number) => number;
|
|
11
11
|
export const testclient_patch: (a: number, b: number, c: number, d: number) => number;
|
|
12
12
|
export const testclient_post: (a: number, b: number, c: number, d: number) => number;
|
|
13
13
|
export const testclient_put: (a: number, b: number, c: number, d: number) => number;
|
|
14
14
|
export const testclient_trace: (a: number, b: number, c: number, d: number) => number;
|
|
15
15
|
export const init: () => void;
|
|
16
|
-
export const
|
|
17
|
-
export const
|
|
18
|
-
export const
|
|
16
|
+
export const __wasm_bindgen_func_elem_637: (a: number, b: number, c: number) => void;
|
|
17
|
+
export const __wasm_bindgen_func_elem_636: (a: number, b: number) => void;
|
|
18
|
+
export const __wasm_bindgen_func_elem_404: (a: number, b: number) => void;
|
|
19
|
+
export const __wasm_bindgen_func_elem_403: (a: number, b: number) => void;
|
|
20
|
+
export const __wasm_bindgen_func_elem_4179: (a: number, b: number, c: number, d: number) => void;
|
|
19
21
|
export const __wbindgen_export: (a: number, b: number) => number;
|
|
20
22
|
export const __wbindgen_export2: (a: number, b: number, c: number, d: number) => number;
|
|
21
23
|
export const __wbindgen_export3: (a: number) => void;
|
package/dist-web/package.json
CHANGED
|
@@ -12,7 +12,7 @@ export class TestClient {
|
|
|
12
12
|
/**
|
|
13
13
|
* Build a [`TestClient`] from serialized route metadata, handler map, server config, and lifecycle hooks.
|
|
14
14
|
*/
|
|
15
|
-
constructor(routes_json: string, handlers: any, config: any, lifecycle_hooks?: any | null);
|
|
15
|
+
constructor(routes_json: string, handlers: any, config: any, lifecycle_hooks?: any | null, dependencies?: any | null);
|
|
16
16
|
put(path: string, options: any): Promise<any>;
|
|
17
17
|
head(path: string, headers: any): Promise<any>;
|
|
18
18
|
post(path: string, options: any): Promise<any>;
|
|
@@ -36,16 +36,18 @@ export interface InitOutput {
|
|
|
36
36
|
readonly testclient_get: (a: number, b: number, c: number, d: number) => number;
|
|
37
37
|
readonly testclient_handle_request: (a: number, b: number, c: number) => number;
|
|
38
38
|
readonly testclient_head: (a: number, b: number, c: number, d: number) => number;
|
|
39
|
-
readonly testclient_new: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
39
|
+
readonly testclient_new: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
|
|
40
40
|
readonly testclient_options: (a: number, b: number, c: number, d: number) => number;
|
|
41
41
|
readonly testclient_patch: (a: number, b: number, c: number, d: number) => number;
|
|
42
42
|
readonly testclient_post: (a: number, b: number, c: number, d: number) => number;
|
|
43
43
|
readonly testclient_put: (a: number, b: number, c: number, d: number) => number;
|
|
44
44
|
readonly testclient_trace: (a: number, b: number, c: number, d: number) => number;
|
|
45
45
|
readonly init: () => void;
|
|
46
|
-
readonly
|
|
47
|
-
readonly
|
|
48
|
-
readonly
|
|
46
|
+
readonly __wasm_bindgen_func_elem_404: (a: number, b: number) => void;
|
|
47
|
+
readonly __wasm_bindgen_func_elem_403: (a: number, b: number) => void;
|
|
48
|
+
readonly __wasm_bindgen_func_elem_637: (a: number, b: number, c: number) => void;
|
|
49
|
+
readonly __wasm_bindgen_func_elem_636: (a: number, b: number) => void;
|
|
50
|
+
readonly __wasm_bindgen_func_elem_4179: (a: number, b: number, c: number, d: number) => void;
|
|
49
51
|
readonly __wbindgen_export: (a: number, b: number) => number;
|
|
50
52
|
readonly __wbindgen_export2: (a: number, b: number, c: number, d: number) => number;
|
|
51
53
|
readonly __wbindgen_export3: (a: number) => void;
|
package/dist-web/spikard_wasm.js
CHANGED
|
@@ -229,12 +229,16 @@ if (!('encodeInto' in cachedTextEncoder)) {
|
|
|
229
229
|
|
|
230
230
|
let WASM_VECTOR_LEN = 0;
|
|
231
231
|
|
|
232
|
-
function
|
|
233
|
-
wasm.
|
|
232
|
+
function __wasm_bindgen_func_elem_404(arg0, arg1) {
|
|
233
|
+
wasm.__wasm_bindgen_func_elem_404(arg0, arg1);
|
|
234
234
|
}
|
|
235
235
|
|
|
236
|
-
function
|
|
237
|
-
wasm.
|
|
236
|
+
function __wasm_bindgen_func_elem_637(arg0, arg1, arg2) {
|
|
237
|
+
wasm.__wasm_bindgen_func_elem_637(arg0, arg1, addHeapObject(arg2));
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
function __wasm_bindgen_func_elem_4179(arg0, arg1, arg2, arg3) {
|
|
241
|
+
wasm.__wasm_bindgen_func_elem_4179(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
|
|
238
242
|
}
|
|
239
243
|
|
|
240
244
|
const TestClientFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
@@ -280,13 +284,14 @@ export class TestClient {
|
|
|
280
284
|
* @param {any} handlers
|
|
281
285
|
* @param {any} config
|
|
282
286
|
* @param {any | null} [lifecycle_hooks]
|
|
287
|
+
* @param {any | null} [dependencies]
|
|
283
288
|
*/
|
|
284
|
-
constructor(routes_json, handlers, config, lifecycle_hooks) {
|
|
289
|
+
constructor(routes_json, handlers, config, lifecycle_hooks, dependencies) {
|
|
285
290
|
try {
|
|
286
291
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
287
292
|
const ptr0 = passStringToWasm0(routes_json, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
288
293
|
const len0 = WASM_VECTOR_LEN;
|
|
289
|
-
wasm.testclient_new(retptr, ptr0, len0, addHeapObject(handlers), addHeapObject(config), isLikeNone(lifecycle_hooks) ? 0 : addHeapObject(lifecycle_hooks));
|
|
294
|
+
wasm.testclient_new(retptr, ptr0, len0, addHeapObject(handlers), addHeapObject(config), isLikeNone(lifecycle_hooks) ? 0 : addHeapObject(lifecycle_hooks), isLikeNone(dependencies) ? 0 : addHeapObject(dependencies));
|
|
290
295
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
291
296
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
292
297
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
@@ -516,6 +521,14 @@ function __wbg_get_imports() {
|
|
|
516
521
|
const ret = getObject(arg0).call(getObject(arg1));
|
|
517
522
|
return addHeapObject(ret);
|
|
518
523
|
}, arguments) };
|
|
524
|
+
imports.wbg.__wbg_call_c8baa5c5e72d274e = function() { return handleError(function (arg0, arg1, arg2, arg3) {
|
|
525
|
+
const ret = getObject(arg0).call(getObject(arg1), getObject(arg2), getObject(arg3));
|
|
526
|
+
return addHeapObject(ret);
|
|
527
|
+
}, arguments) };
|
|
528
|
+
imports.wbg.__wbg_construct_8d61a09a064d7a0e = function() { return handleError(function (arg0, arg1) {
|
|
529
|
+
const ret = Reflect.construct(getObject(arg0), getObject(arg1));
|
|
530
|
+
return addHeapObject(ret);
|
|
531
|
+
}, arguments) };
|
|
519
532
|
imports.wbg.__wbg_done_62ea16af4ce34b24 = function(arg0) {
|
|
520
533
|
const ret = getObject(arg0).done;
|
|
521
534
|
return ret;
|
|
@@ -535,6 +548,10 @@ function __wbg_get_imports() {
|
|
|
535
548
|
wasm.__wbindgen_export4(deferred0_0, deferred0_1, 1);
|
|
536
549
|
}
|
|
537
550
|
};
|
|
551
|
+
imports.wbg.__wbg_finally_9d2144c01c15bee7 = function(arg0, arg1) {
|
|
552
|
+
const ret = getObject(arg0).finally(getObject(arg1));
|
|
553
|
+
return addHeapObject(ret);
|
|
554
|
+
};
|
|
538
555
|
imports.wbg.__wbg_for_7246e2a062d6960c = function(arg0, arg1) {
|
|
539
556
|
const ret = Symbol.for(getStringFromWasm0(arg0, arg1));
|
|
540
557
|
return addHeapObject(ret);
|
|
@@ -546,6 +563,9 @@ function __wbg_get_imports() {
|
|
|
546
563
|
imports.wbg.__wbg_getRandomValues_1c61fac11405ffdc = function() { return handleError(function (arg0, arg1) {
|
|
547
564
|
globalThis.crypto.getRandomValues(getArrayU8FromWasm0(arg0, arg1));
|
|
548
565
|
}, arguments) };
|
|
566
|
+
imports.wbg.__wbg_getRandomValues_9b655bdd369112f2 = function() { return handleError(function (arg0, arg1) {
|
|
567
|
+
globalThis.crypto.getRandomValues(getArrayU8FromWasm0(arg0, arg1));
|
|
568
|
+
}, arguments) };
|
|
549
569
|
imports.wbg.__wbg_get_6b7bd52aca3f9671 = function(arg0, arg1) {
|
|
550
570
|
const ret = getObject(arg0)[arg1 >>> 0];
|
|
551
571
|
return addHeapObject(ret);
|
|
@@ -677,7 +697,7 @@ function __wbg_get_imports() {
|
|
|
677
697
|
const a = state0.a;
|
|
678
698
|
state0.a = 0;
|
|
679
699
|
try {
|
|
680
|
-
return
|
|
700
|
+
return __wasm_bindgen_func_elem_4179(a, state0.b, arg0, arg1);
|
|
681
701
|
} finally {
|
|
682
702
|
state0.a = a;
|
|
683
703
|
}
|
|
@@ -704,9 +724,17 @@ function __wbg_get_imports() {
|
|
|
704
724
|
const ret = Date.now();
|
|
705
725
|
return ret;
|
|
706
726
|
};
|
|
727
|
+
imports.wbg.__wbg_of_b8cd42ebb79fb759 = function(arg0, arg1) {
|
|
728
|
+
const ret = Array.of(getObject(arg0), getObject(arg1));
|
|
729
|
+
return addHeapObject(ret);
|
|
730
|
+
};
|
|
707
731
|
imports.wbg.__wbg_prototypesetcall_dfe9b766cdc1f1fd = function(arg0, arg1, arg2) {
|
|
708
732
|
Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), getObject(arg2));
|
|
709
733
|
};
|
|
734
|
+
imports.wbg.__wbg_push_7d9be8f38fc13975 = function(arg0, arg1) {
|
|
735
|
+
const ret = getObject(arg0).push(getObject(arg1));
|
|
736
|
+
return ret;
|
|
737
|
+
};
|
|
710
738
|
imports.wbg.__wbg_queueMicrotask_9b549dfce8865860 = function(arg0) {
|
|
711
739
|
const ret = getObject(arg0).queueMicrotask;
|
|
712
740
|
return addHeapObject(ret);
|
|
@@ -714,6 +742,10 @@ function __wbg_get_imports() {
|
|
|
714
742
|
imports.wbg.__wbg_queueMicrotask_fca69f5bfad613a5 = function(arg0) {
|
|
715
743
|
queueMicrotask(getObject(arg0));
|
|
716
744
|
};
|
|
745
|
+
imports.wbg.__wbg_race_cf804f784a97f8db = function(arg0) {
|
|
746
|
+
const ret = Promise.race(getObject(arg0));
|
|
747
|
+
return addHeapObject(ret);
|
|
748
|
+
};
|
|
717
749
|
imports.wbg.__wbg_resolve_fd5bfbaa4ce36e1e = function(arg0) {
|
|
718
750
|
const ret = Promise.resolve(getObject(arg0));
|
|
719
751
|
return addHeapObject(ret);
|
|
@@ -767,6 +799,10 @@ function __wbg_get_imports() {
|
|
|
767
799
|
const ret = getObject(arg0).then(getObject(arg1));
|
|
768
800
|
return addHeapObject(ret);
|
|
769
801
|
};
|
|
802
|
+
imports.wbg.__wbg_toString_49326ce0cb2d58c4 = function() { return handleError(function (arg0, arg1) {
|
|
803
|
+
const ret = getObject(arg0).toString(arg1);
|
|
804
|
+
return addHeapObject(ret);
|
|
805
|
+
}, arguments) };
|
|
770
806
|
imports.wbg.__wbg_value_57b7b035e117f7ee = function(arg0) {
|
|
771
807
|
const ret = getObject(arg0).value;
|
|
772
808
|
return addHeapObject(ret);
|
|
@@ -776,9 +812,9 @@ function __wbg_get_imports() {
|
|
|
776
812
|
const ret = getStringFromWasm0(arg0, arg1);
|
|
777
813
|
return addHeapObject(ret);
|
|
778
814
|
};
|
|
779
|
-
imports.wbg.
|
|
780
|
-
// Cast intrinsic for `Closure(Closure { dtor_idx:
|
|
781
|
-
const ret = makeMutClosure(arg0, arg1, wasm.
|
|
815
|
+
imports.wbg.__wbindgen_cast_35aab93a0b8c860f = function(arg0, arg1) {
|
|
816
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 14, function: Function { arguments: [], shim_idx: 15, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
817
|
+
const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_403, __wasm_bindgen_func_elem_404);
|
|
782
818
|
return addHeapObject(ret);
|
|
783
819
|
};
|
|
784
820
|
imports.wbg.__wbindgen_cast_4625c577ab2ec9ee = function(arg0) {
|
|
@@ -786,6 +822,11 @@ function __wbg_get_imports() {
|
|
|
786
822
|
const ret = BigInt.asUintN(64, arg0);
|
|
787
823
|
return addHeapObject(ret);
|
|
788
824
|
};
|
|
825
|
+
imports.wbg.__wbindgen_cast_75edd3f875320618 = function(arg0, arg1) {
|
|
826
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 120, function: Function { arguments: [Externref], shim_idx: 121, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
827
|
+
const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_636, __wasm_bindgen_func_elem_637);
|
|
828
|
+
return addHeapObject(ret);
|
|
829
|
+
};
|
|
789
830
|
imports.wbg.__wbindgen_cast_9ae0607507abb057 = function(arg0) {
|
|
790
831
|
// Cast intrinsic for `I64 -> Externref`.
|
|
791
832
|
const ret = arg0;
|
|
Binary file
|
|
@@ -6,16 +6,18 @@ export const testclient_delete: (a: number, b: number, c: number, d: number) =>
|
|
|
6
6
|
export const testclient_get: (a: number, b: number, c: number, d: number) => number;
|
|
7
7
|
export const testclient_handle_request: (a: number, b: number, c: number) => number;
|
|
8
8
|
export const testclient_head: (a: number, b: number, c: number, d: number) => number;
|
|
9
|
-
export const testclient_new: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
9
|
+
export const testclient_new: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
|
|
10
10
|
export const testclient_options: (a: number, b: number, c: number, d: number) => number;
|
|
11
11
|
export const testclient_patch: (a: number, b: number, c: number, d: number) => number;
|
|
12
12
|
export const testclient_post: (a: number, b: number, c: number, d: number) => number;
|
|
13
13
|
export const testclient_put: (a: number, b: number, c: number, d: number) => number;
|
|
14
14
|
export const testclient_trace: (a: number, b: number, c: number, d: number) => number;
|
|
15
15
|
export const init: () => void;
|
|
16
|
-
export const
|
|
17
|
-
export const
|
|
18
|
-
export const
|
|
16
|
+
export const __wasm_bindgen_func_elem_404: (a: number, b: number) => void;
|
|
17
|
+
export const __wasm_bindgen_func_elem_403: (a: number, b: number) => void;
|
|
18
|
+
export const __wasm_bindgen_func_elem_637: (a: number, b: number, c: number) => void;
|
|
19
|
+
export const __wasm_bindgen_func_elem_636: (a: number, b: number) => void;
|
|
20
|
+
export const __wasm_bindgen_func_elem_4179: (a: number, b: number, c: number, d: number) => void;
|
|
19
21
|
export const __wbindgen_export: (a: number, b: number) => number;
|
|
20
22
|
export const __wbindgen_export2: (a: number, b: number, c: number, d: number) => number;
|
|
21
23
|
export const __wbindgen_export3: (a: number) => void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@spikard/wasm",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "WebAssembly bindings for spikard - High-performance HTTP framework",
|
|
5
5
|
"main": "dist-bundler/spikard_wasm.js",
|
|
6
6
|
"types": "dist-bundler/spikard_wasm.d.ts",
|
|
@@ -53,11 +53,11 @@
|
|
|
53
53
|
],
|
|
54
54
|
"scripts": {
|
|
55
55
|
"build": "pnpm run build:bundler",
|
|
56
|
-
"build:bundler": "PATH=\"$HOME/.cargo/bin:$PATH\"
|
|
57
|
-
"build:web": "PATH=\"$HOME/.cargo/bin:$PATH\"
|
|
58
|
-
"build:node": "PATH=\"$HOME/.cargo/bin:$PATH\"
|
|
56
|
+
"build:bundler": "PATH=\"$HOME/.cargo/bin:$PATH\" pnpm exec wasm-pack build --target bundler --out-dir dist-bundler --release",
|
|
57
|
+
"build:web": "PATH=\"$HOME/.cargo/bin:$PATH\" pnpm exec wasm-pack build --target web --out-dir dist-web --release",
|
|
58
|
+
"build:node": "PATH=\"$HOME/.cargo/bin:$PATH\" pnpm exec wasm-pack build --target nodejs --out-dir dist-node --release",
|
|
59
59
|
"build:all": "pnpm run build:bundler && pnpm run build:node && pnpm run build:web",
|
|
60
|
-
"test": "PATH=\"$HOME/.cargo/bin:$PATH\"
|
|
60
|
+
"test": "PATH=\"$HOME/.cargo/bin:$PATH\" pnpm exec wasm-pack build --target web && PATH=\"$HOME/.cargo/bin:$PATH\" pnpm exec wasm-pack test --node",
|
|
61
61
|
"clean": "rm -rf dist-bundler dist-node dist-web node_modules"
|
|
62
62
|
},
|
|
63
63
|
"devDependencies": {
|