@ferscloud/fers-calculation-web 0.2.22 → 0.2.25

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.
@@ -1,6 +1,17 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
3
 
4
+ /**
5
+ * Free-tier solver (100-member limit). Used when no valid solve token is present.
6
+ */
4
7
  export function calculate_from_json(json_data: string): string;
5
8
 
9
+ /**
10
+ * Tier-aware solver. Verifies the Ed25519-signed solve token issued by the
11
+ * FERS Cloud server; grants Premium limits (10 000 members) when the token
12
+ * is valid and contains `"tier":"premium"`. Falls back to Free on any
13
+ * failure — expired, malformed, or wrong signature.
14
+ */
15
+ export function calculate_from_json_with_token(json_data: string, solve_token: string): string;
16
+
6
17
  export function load_fers_from_file(path: string): string;
@@ -5,5 +5,5 @@ import { __wbg_set_wasm } from "./fers_calculations_bg.js";
5
5
  __wbg_set_wasm(wasm);
6
6
  wasm.__wbindgen_start();
7
7
  export {
8
- calculate_from_json, load_fers_from_file
8
+ calculate_from_json, calculate_from_json_with_token, load_fers_from_file
9
9
  } from "./fers_calculations_bg.js";
@@ -1,4 +1,5 @@
1
1
  /**
2
+ * Free-tier solver (100-member limit). Used when no valid solve token is present.
2
3
  * @param {string} json_data
3
4
  * @returns {string}
4
5
  */
@@ -17,6 +18,32 @@ export function calculate_from_json(json_data) {
17
18
  }
18
19
  }
19
20
 
21
+ /**
22
+ * Tier-aware solver. Verifies the Ed25519-signed solve token issued by the
23
+ * FERS Cloud server; grants Premium limits (10 000 members) when the token
24
+ * is valid and contains `"tier":"premium"`. Falls back to Free on any
25
+ * failure — expired, malformed, or wrong signature.
26
+ * @param {string} json_data
27
+ * @param {string} solve_token
28
+ * @returns {string}
29
+ */
30
+ export function calculate_from_json_with_token(json_data, solve_token) {
31
+ let deferred3_0;
32
+ let deferred3_1;
33
+ try {
34
+ const ptr0 = passStringToWasm0(json_data, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
35
+ const len0 = WASM_VECTOR_LEN;
36
+ const ptr1 = passStringToWasm0(solve_token, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
37
+ const len1 = WASM_VECTOR_LEN;
38
+ const ret = wasm.calculate_from_json_with_token(ptr0, len0, ptr1, len1);
39
+ deferred3_0 = ret[0];
40
+ deferred3_1 = ret[1];
41
+ return getStringFromWasm0(ret[0], ret[1]);
42
+ } finally {
43
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
44
+ }
45
+ }
46
+
20
47
  /**
21
48
  * @param {string} path
22
49
  * @returns {string}
@@ -35,6 +62,13 @@ export function load_fers_from_file(path) {
35
62
  wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
36
63
  }
37
64
  }
65
+ export function __wbg___wbindgen_throw_9c31b086c2b26051(arg0, arg1) {
66
+ throw new Error(getStringFromWasm0(arg0, arg1));
67
+ }
68
+ export function __wbg_now_81363d44c96dd239() {
69
+ const ret = Date.now();
70
+ return ret;
71
+ }
38
72
  export function __wbindgen_init_externref_table() {
39
73
  const table = wasm.__wbindgen_externrefs;
40
74
  const offset = table.grow(4);
Binary file
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ferscloud/fers-calculation-web",
3
3
  "type": "module",
4
- "version": "0.2.22",
4
+ "version": "0.2.25",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "git+https://github.com/Jeroen124/FERS_calculations.git"