@spikard/wasm 0.3.3 → 0.3.6

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.
@@ -5,7 +5,7 @@
5
5
  "Na'aman Hirschfeld <nhirschfeld@gmail.com>"
6
6
  ],
7
7
  "description": "WebAssembly bindings for Spikard HTTP framework via wasm-bindgen",
8
- "version": "0.3.3",
8
+ "version": "0.3.6",
9
9
  "license": "MIT",
10
10
  "repository": {
11
11
  "type": "git",
@@ -4,6 +4,10 @@
4
4
  export class TestClient {
5
5
  free(): void;
6
6
  [Symbol.dispose](): void;
7
+ /**
8
+ * Handle a generic HTTP request. Takes a JSON string with method, path, headers, and body.
9
+ */
10
+ handle_request(request_json: string): Promise<any>;
7
11
  get(path: string, headers: any): Promise<any>;
8
12
  /**
9
13
  * Build a [`TestClient`] from serialized route metadata, handler map, server config, and lifecycle hooks.
@@ -232,12 +232,12 @@ if (!('encodeInto' in cachedTextEncoder)) {
232
232
 
233
233
  let WASM_VECTOR_LEN = 0;
234
234
 
235
- function __wasm_bindgen_func_elem_562(arg0, arg1, arg2) {
236
- wasm.__wasm_bindgen_func_elem_562(arg0, arg1, addHeapObject(arg2));
235
+ function __wasm_bindgen_func_elem_580(arg0, arg1, arg2) {
236
+ wasm.__wasm_bindgen_func_elem_580(arg0, arg1, addHeapObject(arg2));
237
237
  }
238
238
 
239
- function __wasm_bindgen_func_elem_4092(arg0, arg1, arg2, arg3) {
240
- wasm.__wasm_bindgen_func_elem_4092(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
239
+ function __wasm_bindgen_func_elem_4110(arg0, arg1, arg2, arg3) {
240
+ wasm.__wasm_bindgen_func_elem_4110(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
241
241
  }
242
242
 
243
243
  const TestClientFinalization = (typeof FinalizationRegistry === 'undefined')
@@ -255,6 +255,17 @@ export class TestClient {
255
255
  const ptr = this.__destroy_into_raw();
256
256
  wasm.__wbg_testclient_free(ptr, 0);
257
257
  }
258
+ /**
259
+ * Handle a generic HTTP request. Takes a JSON string with method, path, headers, and body.
260
+ * @param {string} request_json
261
+ * @returns {Promise<any>}
262
+ */
263
+ handle_request(request_json) {
264
+ const ptr0 = passStringToWasm0(request_json, wasm.__wbindgen_export, wasm.__wbindgen_export2);
265
+ const len0 = WASM_VECTOR_LEN;
266
+ const ret = wasm.testclient_handle_request(this.__wbg_ptr, ptr0, len0);
267
+ return takeObject(ret);
268
+ }
258
269
  /**
259
270
  * @param {string} path
260
271
  * @param {any} headers
@@ -682,7 +693,7 @@ export function __wbg_new_ff12d2b041fb48f1(arg0, arg1) {
682
693
  const a = state0.a;
683
694
  state0.a = 0;
684
695
  try {
685
- return __wasm_bindgen_func_elem_4092(a, state0.b, arg0, arg1);
696
+ return __wasm_bindgen_func_elem_4110(a, state0.b, arg0, arg1);
686
697
  } finally {
687
698
  state0.a = a;
688
699
  }
@@ -804,15 +815,15 @@ export function __wbindgen_cast_2241b6af4c4b2941(arg0, arg1) {
804
815
  return addHeapObject(ret);
805
816
  };
806
817
 
807
- export function __wbindgen_cast_4625c577ab2ec9ee(arg0) {
808
- // Cast intrinsic for `U64 -> Externref`.
809
- const ret = BigInt.asUintN(64, arg0);
818
+ export function __wbindgen_cast_386725c5b2a3b665(arg0, arg1) {
819
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 126, function: Function { arguments: [Externref], shim_idx: 127, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
820
+ const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_579, __wasm_bindgen_func_elem_580);
810
821
  return addHeapObject(ret);
811
822
  };
812
823
 
813
- export function __wbindgen_cast_902a70736b89c8fd(arg0, arg1) {
814
- // Cast intrinsic for `Closure(Closure { dtor_idx: 119, function: Function { arguments: [Externref], shim_idx: 120, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
815
- const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_561, __wasm_bindgen_func_elem_562);
824
+ export function __wbindgen_cast_4625c577ab2ec9ee(arg0) {
825
+ // Cast intrinsic for `U64 -> Externref`.
826
+ const ret = BigInt.asUintN(64, arg0);
816
827
  return addHeapObject(ret);
817
828
  };
818
829
 
Binary file
@@ -4,6 +4,7 @@ export const memory: WebAssembly.Memory;
4
4
  export const __wbg_testclient_free: (a: number, b: number) => void;
5
5
  export const testclient_delete: (a: number, b: number, c: number, d: number) => number;
6
6
  export const testclient_get: (a: number, b: number, c: number, d: number) => number;
7
+ export const testclient_handle_request: (a: number, b: number, c: number) => number;
7
8
  export const testclient_head: (a: number, b: number, c: number, d: number) => number;
8
9
  export const testclient_new: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
9
10
  export const testclient_options: (a: number, b: number, c: number, d: number) => number;
@@ -12,9 +13,9 @@ export const testclient_post: (a: number, b: number, c: number, d: number) => nu
12
13
  export const testclient_put: (a: number, b: number, c: number, d: number) => number;
13
14
  export const testclient_trace: (a: number, b: number, c: number, d: number) => number;
14
15
  export const init: () => void;
15
- export const __wasm_bindgen_func_elem_562: (a: number, b: number, c: number) => void;
16
- export const __wasm_bindgen_func_elem_561: (a: number, b: number) => void;
17
- export const __wasm_bindgen_func_elem_4092: (a: number, b: number, c: number, d: number) => void;
16
+ export const __wasm_bindgen_func_elem_580: (a: number, b: number, c: number) => void;
17
+ export const __wasm_bindgen_func_elem_579: (a: number, b: number) => void;
18
+ export const __wasm_bindgen_func_elem_4110: (a: number, b: number, c: number, d: number) => void;
18
19
  export const __wbindgen_export: (a: number, b: number) => number;
19
20
  export const __wbindgen_export2: (a: number, b: number, c: number, d: number) => number;
20
21
  export const __wbindgen_export3: (a: number) => void;
@@ -4,7 +4,7 @@
4
4
  "Na'aman Hirschfeld <nhirschfeld@gmail.com>"
5
5
  ],
6
6
  "description": "WebAssembly bindings for Spikard HTTP framework via wasm-bindgen",
7
- "version": "0.3.3",
7
+ "version": "0.3.6",
8
8
  "license": "MIT",
9
9
  "repository": {
10
10
  "type": "git",
@@ -4,6 +4,10 @@
4
4
  export class TestClient {
5
5
  free(): void;
6
6
  [Symbol.dispose](): void;
7
+ /**
8
+ * Handle a generic HTTP request. Takes a JSON string with method, path, headers, and body.
9
+ */
10
+ handle_request(request_json: string): Promise<any>;
7
11
  get(path: string, headers: any): Promise<any>;
8
12
  /**
9
13
  * Build a [`TestClient`] from serialized route metadata, handler map, server config, and lifecycle hooks.
@@ -223,12 +223,12 @@ if (!('encodeInto' in cachedTextEncoder)) {
223
223
 
224
224
  let WASM_VECTOR_LEN = 0;
225
225
 
226
- function __wasm_bindgen_func_elem_562(arg0, arg1, arg2) {
227
- wasm.__wasm_bindgen_func_elem_562(arg0, arg1, addHeapObject(arg2));
226
+ function __wasm_bindgen_func_elem_580(arg0, arg1, arg2) {
227
+ wasm.__wasm_bindgen_func_elem_580(arg0, arg1, addHeapObject(arg2));
228
228
  }
229
229
 
230
- function __wasm_bindgen_func_elem_4092(arg0, arg1, arg2, arg3) {
231
- wasm.__wasm_bindgen_func_elem_4092(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
230
+ function __wasm_bindgen_func_elem_4110(arg0, arg1, arg2, arg3) {
231
+ wasm.__wasm_bindgen_func_elem_4110(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
232
232
  }
233
233
 
234
234
  const TestClientFinalization = (typeof FinalizationRegistry === 'undefined')
@@ -246,6 +246,17 @@ class TestClient {
246
246
  const ptr = this.__destroy_into_raw();
247
247
  wasm.__wbg_testclient_free(ptr, 0);
248
248
  }
249
+ /**
250
+ * Handle a generic HTTP request. Takes a JSON string with method, path, headers, and body.
251
+ * @param {string} request_json
252
+ * @returns {Promise<any>}
253
+ */
254
+ handle_request(request_json) {
255
+ const ptr0 = passStringToWasm0(request_json, wasm.__wbindgen_export, wasm.__wbindgen_export2);
256
+ const len0 = WASM_VECTOR_LEN;
257
+ const ret = wasm.testclient_handle_request(this.__wbg_ptr, ptr0, len0);
258
+ return takeObject(ret);
259
+ }
249
260
  /**
250
261
  * @param {string} path
251
262
  * @param {any} headers
@@ -675,7 +686,7 @@ exports.__wbg_new_ff12d2b041fb48f1 = function(arg0, arg1) {
675
686
  const a = state0.a;
676
687
  state0.a = 0;
677
688
  try {
678
- return __wasm_bindgen_func_elem_4092(a, state0.b, arg0, arg1);
689
+ return __wasm_bindgen_func_elem_4110(a, state0.b, arg0, arg1);
679
690
  } finally {
680
691
  state0.a = a;
681
692
  }
@@ -797,15 +808,15 @@ exports.__wbindgen_cast_2241b6af4c4b2941 = function(arg0, arg1) {
797
808
  return addHeapObject(ret);
798
809
  };
799
810
 
800
- exports.__wbindgen_cast_4625c577ab2ec9ee = function(arg0) {
801
- // Cast intrinsic for `U64 -> Externref`.
802
- const ret = BigInt.asUintN(64, arg0);
811
+ exports.__wbindgen_cast_386725c5b2a3b665 = function(arg0, arg1) {
812
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 126, function: Function { arguments: [Externref], shim_idx: 127, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
813
+ const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_579, __wasm_bindgen_func_elem_580);
803
814
  return addHeapObject(ret);
804
815
  };
805
816
 
806
- exports.__wbindgen_cast_902a70736b89c8fd = function(arg0, arg1) {
807
- // Cast intrinsic for `Closure(Closure { dtor_idx: 119, function: Function { arguments: [Externref], shim_idx: 120, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
808
- const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_561, __wasm_bindgen_func_elem_562);
817
+ exports.__wbindgen_cast_4625c577ab2ec9ee = function(arg0) {
818
+ // Cast intrinsic for `U64 -> Externref`.
819
+ const ret = BigInt.asUintN(64, arg0);
809
820
  return addHeapObject(ret);
810
821
  };
811
822
 
Binary file
@@ -4,6 +4,7 @@ export const memory: WebAssembly.Memory;
4
4
  export const __wbg_testclient_free: (a: number, b: number) => void;
5
5
  export const testclient_delete: (a: number, b: number, c: number, d: number) => number;
6
6
  export const testclient_get: (a: number, b: number, c: number, d: number) => number;
7
+ export const testclient_handle_request: (a: number, b: number, c: number) => number;
7
8
  export const testclient_head: (a: number, b: number, c: number, d: number) => number;
8
9
  export const testclient_new: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
9
10
  export const testclient_options: (a: number, b: number, c: number, d: number) => number;
@@ -12,9 +13,9 @@ export const testclient_post: (a: number, b: number, c: number, d: number) => nu
12
13
  export const testclient_put: (a: number, b: number, c: number, d: number) => number;
13
14
  export const testclient_trace: (a: number, b: number, c: number, d: number) => number;
14
15
  export const init: () => void;
15
- export const __wasm_bindgen_func_elem_562: (a: number, b: number, c: number) => void;
16
- export const __wasm_bindgen_func_elem_561: (a: number, b: number) => void;
17
- export const __wasm_bindgen_func_elem_4092: (a: number, b: number, c: number, d: number) => void;
16
+ export const __wasm_bindgen_func_elem_580: (a: number, b: number, c: number) => void;
17
+ export const __wasm_bindgen_func_elem_579: (a: number, b: number) => void;
18
+ export const __wasm_bindgen_func_elem_4110: (a: number, b: number, c: number, d: number) => void;
18
19
  export const __wbindgen_export: (a: number, b: number) => number;
19
20
  export const __wbindgen_export2: (a: number, b: number, c: number, d: number) => number;
20
21
  export const __wbindgen_export3: (a: number) => void;
@@ -5,7 +5,7 @@
5
5
  "Na'aman Hirschfeld <nhirschfeld@gmail.com>"
6
6
  ],
7
7
  "description": "WebAssembly bindings for Spikard HTTP framework via wasm-bindgen",
8
- "version": "0.3.3",
8
+ "version": "0.3.6",
9
9
  "license": "MIT",
10
10
  "repository": {
11
11
  "type": "git",
@@ -4,6 +4,10 @@
4
4
  export class TestClient {
5
5
  free(): void;
6
6
  [Symbol.dispose](): void;
7
+ /**
8
+ * Handle a generic HTTP request. Takes a JSON string with method, path, headers, and body.
9
+ */
10
+ handle_request(request_json: string): Promise<any>;
7
11
  get(path: string, headers: any): Promise<any>;
8
12
  /**
9
13
  * Build a [`TestClient`] from serialized route metadata, handler map, server config, and lifecycle hooks.
@@ -30,6 +34,7 @@ export interface InitOutput {
30
34
  readonly __wbg_testclient_free: (a: number, b: number) => void;
31
35
  readonly testclient_delete: (a: number, b: number, c: number, d: number) => number;
32
36
  readonly testclient_get: (a: number, b: number, c: number, d: number) => number;
37
+ readonly testclient_handle_request: (a: number, b: number, c: number) => number;
33
38
  readonly testclient_head: (a: number, b: number, c: number, d: number) => number;
34
39
  readonly testclient_new: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
35
40
  readonly testclient_options: (a: number, b: number, c: number, d: number) => number;
@@ -38,9 +43,9 @@ export interface InitOutput {
38
43
  readonly testclient_put: (a: number, b: number, c: number, d: number) => number;
39
44
  readonly testclient_trace: (a: number, b: number, c: number, d: number) => number;
40
45
  readonly init: () => void;
41
- readonly __wasm_bindgen_func_elem_562: (a: number, b: number, c: number) => void;
42
- readonly __wasm_bindgen_func_elem_561: (a: number, b: number) => void;
43
- readonly __wasm_bindgen_func_elem_4092: (a: number, b: number, c: number, d: number) => void;
46
+ readonly __wasm_bindgen_func_elem_580: (a: number, b: number, c: number) => void;
47
+ readonly __wasm_bindgen_func_elem_579: (a: number, b: number) => void;
48
+ readonly __wasm_bindgen_func_elem_4110: (a: number, b: number, c: number, d: number) => void;
44
49
  readonly __wbindgen_export: (a: number, b: number) => number;
45
50
  readonly __wbindgen_export2: (a: number, b: number, c: number, d: number) => number;
46
51
  readonly __wbindgen_export3: (a: number) => void;
@@ -229,12 +229,12 @@ if (!('encodeInto' in cachedTextEncoder)) {
229
229
 
230
230
  let WASM_VECTOR_LEN = 0;
231
231
 
232
- function __wasm_bindgen_func_elem_562(arg0, arg1, arg2) {
233
- wasm.__wasm_bindgen_func_elem_562(arg0, arg1, addHeapObject(arg2));
232
+ function __wasm_bindgen_func_elem_580(arg0, arg1, arg2) {
233
+ wasm.__wasm_bindgen_func_elem_580(arg0, arg1, addHeapObject(arg2));
234
234
  }
235
235
 
236
- function __wasm_bindgen_func_elem_4092(arg0, arg1, arg2, arg3) {
237
- wasm.__wasm_bindgen_func_elem_4092(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
236
+ function __wasm_bindgen_func_elem_4110(arg0, arg1, arg2, arg3) {
237
+ wasm.__wasm_bindgen_func_elem_4110(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
238
238
  }
239
239
 
240
240
  const TestClientFinalization = (typeof FinalizationRegistry === 'undefined')
@@ -252,6 +252,17 @@ export class TestClient {
252
252
  const ptr = this.__destroy_into_raw();
253
253
  wasm.__wbg_testclient_free(ptr, 0);
254
254
  }
255
+ /**
256
+ * Handle a generic HTTP request. Takes a JSON string with method, path, headers, and body.
257
+ * @param {string} request_json
258
+ * @returns {Promise<any>}
259
+ */
260
+ handle_request(request_json) {
261
+ const ptr0 = passStringToWasm0(request_json, wasm.__wbindgen_export, wasm.__wbindgen_export2);
262
+ const len0 = WASM_VECTOR_LEN;
263
+ const ret = wasm.testclient_handle_request(this.__wbg_ptr, ptr0, len0);
264
+ return takeObject(ret);
265
+ }
255
266
  /**
256
267
  * @param {string} path
257
268
  * @param {any} headers
@@ -666,7 +677,7 @@ function __wbg_get_imports() {
666
677
  const a = state0.a;
667
678
  state0.a = 0;
668
679
  try {
669
- return __wasm_bindgen_func_elem_4092(a, state0.b, arg0, arg1);
680
+ return __wasm_bindgen_func_elem_4110(a, state0.b, arg0, arg1);
670
681
  } finally {
671
682
  state0.a = a;
672
683
  }
@@ -765,16 +776,16 @@ function __wbg_get_imports() {
765
776
  const ret = getStringFromWasm0(arg0, arg1);
766
777
  return addHeapObject(ret);
767
778
  };
779
+ imports.wbg.__wbindgen_cast_386725c5b2a3b665 = function(arg0, arg1) {
780
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 126, function: Function { arguments: [Externref], shim_idx: 127, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
781
+ const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_579, __wasm_bindgen_func_elem_580);
782
+ return addHeapObject(ret);
783
+ };
768
784
  imports.wbg.__wbindgen_cast_4625c577ab2ec9ee = function(arg0) {
769
785
  // Cast intrinsic for `U64 -> Externref`.
770
786
  const ret = BigInt.asUintN(64, arg0);
771
787
  return addHeapObject(ret);
772
788
  };
773
- imports.wbg.__wbindgen_cast_902a70736b89c8fd = function(arg0, arg1) {
774
- // Cast intrinsic for `Closure(Closure { dtor_idx: 119, function: Function { arguments: [Externref], shim_idx: 120, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
775
- const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_561, __wasm_bindgen_func_elem_562);
776
- return addHeapObject(ret);
777
- };
778
789
  imports.wbg.__wbindgen_cast_9ae0607507abb057 = function(arg0) {
779
790
  // Cast intrinsic for `I64 -> Externref`.
780
791
  const ret = arg0;
Binary file
@@ -4,6 +4,7 @@ export const memory: WebAssembly.Memory;
4
4
  export const __wbg_testclient_free: (a: number, b: number) => void;
5
5
  export const testclient_delete: (a: number, b: number, c: number, d: number) => number;
6
6
  export const testclient_get: (a: number, b: number, c: number, d: number) => number;
7
+ export const testclient_handle_request: (a: number, b: number, c: number) => number;
7
8
  export const testclient_head: (a: number, b: number, c: number, d: number) => number;
8
9
  export const testclient_new: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
9
10
  export const testclient_options: (a: number, b: number, c: number, d: number) => number;
@@ -12,9 +13,9 @@ export const testclient_post: (a: number, b: number, c: number, d: number) => nu
12
13
  export const testclient_put: (a: number, b: number, c: number, d: number) => number;
13
14
  export const testclient_trace: (a: number, b: number, c: number, d: number) => number;
14
15
  export const init: () => void;
15
- export const __wasm_bindgen_func_elem_562: (a: number, b: number, c: number) => void;
16
- export const __wasm_bindgen_func_elem_561: (a: number, b: number) => void;
17
- export const __wasm_bindgen_func_elem_4092: (a: number, b: number, c: number, d: number) => void;
16
+ export const __wasm_bindgen_func_elem_580: (a: number, b: number, c: number) => void;
17
+ export const __wasm_bindgen_func_elem_579: (a: number, b: number) => void;
18
+ export const __wasm_bindgen_func_elem_4110: (a: number, b: number, c: number, d: number) => void;
18
19
  export const __wbindgen_export: (a: number, b: number) => number;
19
20
  export const __wbindgen_export2: (a: number, b: number, c: number, d: number) => number;
20
21
  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.3",
3
+ "version": "0.3.6",
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",