axiam-sdk-wasm 1.0.0-alpha31

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.
@@ -0,0 +1,988 @@
1
+ /**
2
+ * An AXIAM client, for the browser.
3
+ *
4
+ * Build one with [`AxiamWasmClient::new`], then call the same operations the
5
+ * native SDK exposes.
6
+ *
7
+ * ```js
8
+ * import init, { AxiamWasmClient } from "axiam-sdk-wasm";
9
+ *
10
+ * await init();
11
+ * const client = new AxiamWasmClient("https://axiam.example", "acme", "default");
12
+ * await client.loginSrp("alice", "correct horse battery staple");
13
+ * const decision = await client.can("documents:read", "doc-42");
14
+ * ```
15
+ */
16
+ export class AxiamWasmClient {
17
+ __destroy_into_raw() {
18
+ const ptr = this.__wbg_ptr;
19
+ this.__wbg_ptr = 0;
20
+ AxiamWasmClientFinalization.unregister(this);
21
+ return ptr;
22
+ }
23
+ free() {
24
+ const ptr = this.__destroy_into_raw();
25
+ wasm.__wbg_axiamwasmclient_free(ptr, 0);
26
+ }
27
+ /**
28
+ * `POST /api/v1/authz/check/batch` — many decisions in one round trip.
29
+ *
30
+ * `checks` is an array of `[action, resource]` or
31
+ * `[action, resource, scope]` tuples. Results come back in the same order,
32
+ * which is what makes a page-level permission sweep one request instead of
33
+ * N.
34
+ * @param {any} checks
35
+ * @returns {Promise<any>}
36
+ */
37
+ batchCheck(checks) {
38
+ const ret = wasm.axiamwasmclient_batchCheck(this.__wbg_ptr, checks);
39
+ return ret;
40
+ }
41
+ /**
42
+ * `can` — the browser-facing alias of [`Self::checkAccess`], returning a
43
+ * plain boolean for the common "should I render this button" case.
44
+ * @param {string} action
45
+ * @param {string} resource
46
+ * @param {string | null} [scope]
47
+ * @returns {Promise<boolean>}
48
+ */
49
+ can(action, resource, scope) {
50
+ const ptr0 = passStringToWasm0(action, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
51
+ const len0 = WASM_VECTOR_LEN;
52
+ const ptr1 = passStringToWasm0(resource, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
53
+ const len1 = WASM_VECTOR_LEN;
54
+ var ptr2 = isLikeNone(scope) ? 0 : passStringToWasm0(scope, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
55
+ var len2 = WASM_VECTOR_LEN;
56
+ const ret = wasm.axiamwasmclient_can(this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2);
57
+ return ret;
58
+ }
59
+ /**
60
+ * `POST /api/v1/authz/check` — one authorization decision.
61
+ *
62
+ * `resource` is a resource UUID. Parsed here rather than accepted as an
63
+ * opaque string so a typo fails with "not a UUID" at the call site
64
+ * instead of as a `no_grant` decision that looks like a permissions
65
+ * problem.
66
+ * @param {string} action
67
+ * @param {string} resource
68
+ * @param {string | null} [scope]
69
+ * @returns {Promise<any>}
70
+ */
71
+ checkAccess(action, resource, scope) {
72
+ const ptr0 = passStringToWasm0(action, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
73
+ const len0 = WASM_VECTOR_LEN;
74
+ const ptr1 = passStringToWasm0(resource, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
75
+ const len1 = WASM_VECTOR_LEN;
76
+ var ptr2 = isLikeNone(scope) ? 0 : passStringToWasm0(scope, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
77
+ var len2 = WASM_VECTOR_LEN;
78
+ const ret = wasm.axiamwasmclient_checkAccess(this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2);
79
+ return ret;
80
+ }
81
+ /**
82
+ * Shut the client down (§18.1). Further calls fail rather than silently
83
+ * reconnecting.
84
+ * @returns {Promise<void>}
85
+ */
86
+ close() {
87
+ const ret = wasm.axiamwasmclient_close(this.__wbg_ptr);
88
+ return ret;
89
+ }
90
+ /**
91
+ * `POST /api/v1/auth/login` — password login.
92
+ *
93
+ * Prefer [`Self::loginSrp`] where the tenant offers it: this method puts
94
+ * the password in the request body, where every TLS-terminating hop
95
+ * between the browser and AXIAM can read it.
96
+ * @param {string} username_or_email
97
+ * @param {string} password
98
+ * @returns {Promise<any>}
99
+ */
100
+ login(username_or_email, password) {
101
+ const ptr0 = passStringToWasm0(username_or_email, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
102
+ const len0 = WASM_VECTOR_LEN;
103
+ const ptr1 = passStringToWasm0(password, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
104
+ const len1 = WASM_VECTOR_LEN;
105
+ const ret = wasm.axiamwasmclient_login(this.__wbg_ptr, ptr0, len0, ptr1, len1);
106
+ return ret;
107
+ }
108
+ /**
109
+ * SRP-6a login (CONTRACT.md §23) — the password never leaves this module.
110
+ *
111
+ * Returns the same shape as [`Self::login`], including the MFA-challenge
112
+ * case, so one result handler serves both.
113
+ *
114
+ * Rejects with a message naming SRP when the tenant has it disabled, so a
115
+ * caller can fall back to [`Self::login`] rather than mistaking it for a
116
+ * bad password.
117
+ *
118
+ * **This blocks the thread it runs on** for the duration of the KDF —
119
+ * tens to hundreds of milliseconds at Argon2id's default parameters,
120
+ * which is the cost that makes a stolen verifier expensive to attack. In
121
+ * a page that must stay responsive, run this module in a Web Worker.
122
+ * @param {string} username_or_email
123
+ * @param {string} password
124
+ * @returns {Promise<any>}
125
+ */
126
+ loginSrp(username_or_email, password) {
127
+ const ptr0 = passStringToWasm0(username_or_email, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
128
+ const len0 = WASM_VECTOR_LEN;
129
+ const ptr1 = passStringToWasm0(password, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
130
+ const len1 = WASM_VECTOR_LEN;
131
+ const ret = wasm.axiamwasmclient_loginSrp(this.__wbg_ptr, ptr0, len0, ptr1, len1);
132
+ return ret;
133
+ }
134
+ /**
135
+ * `POST /api/v1/auth/logout`.
136
+ * @returns {Promise<void>}
137
+ */
138
+ logout() {
139
+ const ret = wasm.axiamwasmclient_logout(this.__wbg_ptr);
140
+ return ret;
141
+ }
142
+ /**
143
+ * Build a client against `base_url`, scoped to one organization and
144
+ * tenant by slug.
145
+ *
146
+ * Slugs rather than UUIDs because a browser application generally knows
147
+ * the workspace it is serving by name. A client built this way has no
148
+ * tenant UUID to compare against, so `axiam-sdk`'s JWKS verifier stays
149
+ * unconfigured and its §10 route-guard path fails closed — which is
150
+ * correct, and irrelevant in a browser, where there is no route to guard.
151
+ * @param {string} base_url
152
+ * @param {string} org_slug
153
+ * @param {string} tenant_slug
154
+ */
155
+ constructor(base_url, org_slug, tenant_slug) {
156
+ const ptr0 = passStringToWasm0(base_url, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
157
+ const len0 = WASM_VECTOR_LEN;
158
+ const ptr1 = passStringToWasm0(org_slug, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
159
+ const len1 = WASM_VECTOR_LEN;
160
+ const ptr2 = passStringToWasm0(tenant_slug, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
161
+ const len2 = WASM_VECTOR_LEN;
162
+ const ret = wasm.axiamwasmclient_new(ptr0, len0, ptr1, len1, ptr2, len2);
163
+ if (ret[2]) {
164
+ throw takeFromExternrefTable0(ret[1]);
165
+ }
166
+ this.__wbg_ptr = ret[0];
167
+ AxiamWasmClientFinalization.register(this, this.__wbg_ptr, this);
168
+ return this;
169
+ }
170
+ /**
171
+ * `POST /api/v1/auth/refresh` — rotate the session.
172
+ *
173
+ * Single-flight: concurrent callers coalesce onto one request, exactly as
174
+ * in the native SDK (§9 rule 6).
175
+ * @returns {Promise<void>}
176
+ */
177
+ refresh() {
178
+ const ret = wasm.axiamwasmclient_refresh(this.__wbg_ptr);
179
+ return ret;
180
+ }
181
+ /**
182
+ * Whether this build can perform SRP. Always `true` here — both KDFs and
183
+ * all three groups are compiled in.
184
+ * @returns {boolean}
185
+ */
186
+ srpAvailable() {
187
+ const ret = wasm.axiamwasmclient_srpAvailable(this.__wbg_ptr);
188
+ return ret !== 0;
189
+ }
190
+ /**
191
+ * Compute an SRP verifier for a password, to send with any request that
192
+ * sets one (user creation, change-password, reset completion).
193
+ *
194
+ * `identity` MUST be the account's **username** — the canonical identity
195
+ * the challenge endpoint hands back. Passing an email produces a verifier
196
+ * no login can ever satisfy.
197
+ *
198
+ * `group` and `kdf` come from the tenant's policy, which
199
+ * `GET /api/v1/auth/me` reports for an authenticated caller and
200
+ * `GET /api/v1/auth/reset/context` reports for a reset-token holder.
201
+ * @param {string} identity
202
+ * @param {string} password
203
+ * @param {string} group
204
+ * @param {string} kdf
205
+ * @param {number} iterations
206
+ * @param {number | null} [memory_kib]
207
+ * @param {number | null} [parallelism]
208
+ * @returns {any}
209
+ */
210
+ srpEnrollment(identity, password, group, kdf, iterations, memory_kib, parallelism) {
211
+ const ptr0 = passStringToWasm0(identity, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
212
+ const len0 = WASM_VECTOR_LEN;
213
+ const ptr1 = passStringToWasm0(password, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
214
+ const len1 = WASM_VECTOR_LEN;
215
+ const ptr2 = passStringToWasm0(group, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
216
+ const len2 = WASM_VECTOR_LEN;
217
+ const ptr3 = passStringToWasm0(kdf, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
218
+ const len3 = WASM_VECTOR_LEN;
219
+ const ret = wasm.axiamwasmclient_srpEnrollment(this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, iterations, isLikeNone(memory_kib) ? Number.MAX_SAFE_INTEGER : (memory_kib) >>> 0, isLikeNone(parallelism) ? Number.MAX_SAFE_INTEGER : (parallelism) >>> 0);
220
+ if (ret[2]) {
221
+ throw takeFromExternrefTable0(ret[1]);
222
+ }
223
+ return takeFromExternrefTable0(ret[0]);
224
+ }
225
+ /**
226
+ * `POST /api/v1/auth/mfa/verify` — complete a login that returned
227
+ * `mfaRequired`.
228
+ * @param {string} code
229
+ * @returns {Promise<any>}
230
+ */
231
+ verifyMfa(code) {
232
+ const ptr0 = passStringToWasm0(code, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
233
+ const len0 = WASM_VECTOR_LEN;
234
+ const ret = wasm.axiamwasmclient_verifyMfa(this.__wbg_ptr, ptr0, len0);
235
+ return ret;
236
+ }
237
+ }
238
+ if (Symbol.dispose) AxiamWasmClient.prototype[Symbol.dispose] = AxiamWasmClient.prototype.free;
239
+
240
+ /**
241
+ * Compute a verifier from a **fixed** `x`, for conformance testing.
242
+ *
243
+ * # This is for the shared vectors, and nothing else
244
+ *
245
+ * `srpEnrollment` generates a random salt, as it must — so it cannot be
246
+ * checked against `srp-test-vectors.json`, whose entries pin `x` directly.
247
+ * Without this export, the only thing a test could assert about the *shipped
248
+ * artifact* is that it loads and returns plausibly-shaped strings.
249
+ *
250
+ * That distinction is not academic: an old `binaryen` silently miscompiles
251
+ * this module (see `Cargo.toml`), and "it built" is not evidence that the
252
+ * arithmetic inside survived. This lets `scripts/wasm-smoke.mjs` reproduce the
253
+ * contract's verifiers exactly, from the artifact that is about to be
254
+ * published.
255
+ *
256
+ * **Never call this in application code.** `x` is the password's derivative;
257
+ * an application that has it has already done the work `srpEnrollment` exists
258
+ * to do, and should use that instead.
259
+ * @param {string} group
260
+ * @param {string} x_hex
261
+ * @returns {string}
262
+ */
263
+ export function __conformanceVerifier(group, x_hex) {
264
+ let deferred4_0;
265
+ let deferred4_1;
266
+ try {
267
+ const ptr0 = passStringToWasm0(group, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
268
+ const len0 = WASM_VECTOR_LEN;
269
+ const ptr1 = passStringToWasm0(x_hex, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
270
+ const len1 = WASM_VECTOR_LEN;
271
+ const ret = wasm.__conformanceVerifier(ptr0, len0, ptr1, len1);
272
+ var ptr3 = ret[0];
273
+ var len3 = ret[1];
274
+ if (ret[3]) {
275
+ ptr3 = 0; len3 = 0;
276
+ throw takeFromExternrefTable0(ret[2]);
277
+ }
278
+ deferred4_0 = ptr3;
279
+ deferred4_1 = len3;
280
+ return getStringFromWasm0(ptr3, len3);
281
+ } finally {
282
+ wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
283
+ }
284
+ }
285
+
286
+ /**
287
+ * The version of `axiam-sdk` this package wraps.
288
+ *
289
+ * Exported so a page can report which SDK it is running without a build-time
290
+ * constant that could drift from the artifact actually loaded.
291
+ * @returns {string}
292
+ */
293
+ export function sdkVersion() {
294
+ let deferred1_0;
295
+ let deferred1_1;
296
+ try {
297
+ const ret = wasm.sdkVersion();
298
+ deferred1_0 = ret[0];
299
+ deferred1_1 = ret[1];
300
+ return getStringFromWasm0(ret[0], ret[1]);
301
+ } finally {
302
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
303
+ }
304
+ }
305
+ export function __wbg_Error_408e67f47ca7b58b(arg0, arg1) {
306
+ const ret = Error(getStringFromWasm0(arg0, arg1));
307
+ return ret;
308
+ }
309
+ export function __wbg_String_8564e559799eccda(arg0, arg1) {
310
+ const ret = String(arg1);
311
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
312
+ const len1 = WASM_VECTOR_LEN;
313
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
314
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
315
+ }
316
+ export function __wbg___wbindgen_boolean_get_c9c83ebd41b34df3(arg0) {
317
+ const v = arg0;
318
+ const ret = typeof(v) === 'boolean' ? v : undefined;
319
+ return isLikeNone(ret) ? 0xFFFFFF : ret ? 1 : 0;
320
+ }
321
+ export function __wbg___wbindgen_debug_string_a57024b9c6e4a48b(arg0, arg1) {
322
+ const ret = debugString(arg1);
323
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
324
+ const len1 = WASM_VECTOR_LEN;
325
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
326
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
327
+ }
328
+ export function __wbg___wbindgen_is_function_5e4570eb24ffa122(arg0) {
329
+ const ret = typeof(arg0) === 'function';
330
+ return ret;
331
+ }
332
+ export function __wbg___wbindgen_is_object_a2790eb24c211ea0(arg0) {
333
+ const val = arg0;
334
+ const ret = typeof(val) === 'object' && val !== null;
335
+ return ret;
336
+ }
337
+ export function __wbg___wbindgen_is_string_e6f02f0ea5f20a32(arg0) {
338
+ const ret = typeof(arg0) === 'string';
339
+ return ret;
340
+ }
341
+ export function __wbg___wbindgen_is_undefined_6cff064c44e0d823(arg0) {
342
+ const ret = arg0 === undefined;
343
+ return ret;
344
+ }
345
+ export function __wbg___wbindgen_jsval_loose_eq_acf2776254a8d832(arg0, arg1) {
346
+ const ret = arg0 == arg1;
347
+ return ret;
348
+ }
349
+ export function __wbg___wbindgen_number_get_136b9679cab35cfb(arg0, arg1) {
350
+ const obj = arg1;
351
+ const ret = typeof(obj) === 'number' ? obj : undefined;
352
+ getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
353
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
354
+ }
355
+ export function __wbg___wbindgen_string_get_d154f1e671052120(arg0, arg1) {
356
+ const obj = arg1;
357
+ const ret = typeof(obj) === 'string' ? obj : undefined;
358
+ var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
359
+ var len1 = WASM_VECTOR_LEN;
360
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
361
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
362
+ }
363
+ export function __wbg___wbindgen_throw_bb96b2010945f0bc(arg0, arg1) {
364
+ throw new Error(getStringFromWasm0(arg0, arg1));
365
+ }
366
+ export function __wbg__wbg_cb_unref_be22cc64ae6946a0(arg0) {
367
+ arg0._wbg_cb_unref();
368
+ }
369
+ export function __wbg_abort_1254fe4ac5695dc0(arg0, arg1) {
370
+ arg0.abort(arg1);
371
+ }
372
+ export function __wbg_abort_d8615b5857e112b3(arg0) {
373
+ arg0.abort();
374
+ }
375
+ export function __wbg_append_acad6a3f39a3e778() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
376
+ arg0.append(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4));
377
+ }, arguments); }
378
+ export function __wbg_arrayBuffer_16433f17fbd74397() { return handleError(function (arg0) {
379
+ const ret = arg0.arrayBuffer();
380
+ return ret;
381
+ }, arguments); }
382
+ export function __wbg_call_1c5886ab9c57d1c7() { return handleError(function (arg0, arg1) {
383
+ const ret = arg0.call(arg1);
384
+ return ret;
385
+ }, arguments); }
386
+ export function __wbg_call_35dba3c747ad7521() { return handleError(function (arg0, arg1, arg2) {
387
+ const ret = arg0.call(arg1, arg2);
388
+ return ret;
389
+ }, arguments); }
390
+ export function __wbg_clearTimeout_333bba87532ab9d3(arg0) {
391
+ const ret = clearTimeout(arg0);
392
+ return ret;
393
+ }
394
+ export function __wbg_crypto_38df2bab126b63dc(arg0) {
395
+ const ret = arg0.crypto;
396
+ return ret;
397
+ }
398
+ export function __wbg_done_669171204c3dcae2(arg0) {
399
+ const ret = arg0.done;
400
+ return ret;
401
+ }
402
+ export function __wbg_entries_2c710161cbd65b89(arg0) {
403
+ const ret = arg0.entries();
404
+ return ret;
405
+ }
406
+ export function __wbg_error_757e9472f8410341(arg0, arg1) {
407
+ let deferred0_0;
408
+ let deferred0_1;
409
+ try {
410
+ deferred0_0 = arg0;
411
+ deferred0_1 = arg1;
412
+ console.error(getStringFromWasm0(arg0, arg1));
413
+ } finally {
414
+ wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
415
+ }
416
+ }
417
+ export function __wbg_fetch_074561c3e313c86f(arg0) {
418
+ const ret = fetch(arg0);
419
+ return ret;
420
+ }
421
+ export function __wbg_fetch_d752d93f5b259503(arg0, arg1) {
422
+ const ret = arg0.fetch(arg1);
423
+ return ret;
424
+ }
425
+ export function __wbg_getRandomValues_436a51d0629d84e1() { return handleError(function (arg0, arg1) {
426
+ globalThis.crypto.getRandomValues(getArrayU8FromWasm0(arg0, arg1));
427
+ }, arguments); }
428
+ export function __wbg_getRandomValues_c44a50d8cfdaebeb() { return handleError(function (arg0, arg1) {
429
+ arg0.getRandomValues(arg1);
430
+ }, arguments); }
431
+ export function __wbg_getTime_63fb0332e6c4ec17(arg0) {
432
+ const ret = arg0.getTime();
433
+ return ret;
434
+ }
435
+ export function __wbg_get_c0c8f8d7da0c03dd(arg0, arg1) {
436
+ const ret = arg0[arg1 >>> 0];
437
+ return ret;
438
+ }
439
+ export function __wbg_get_d173c0308df22d37() { return handleError(function (arg0, arg1) {
440
+ const ret = Reflect.get(arg0, arg1);
441
+ return ret;
442
+ }, arguments); }
443
+ export function __wbg_get_unchecked_e20b893aeafc3fca(arg0, arg1) {
444
+ const ret = arg0[arg1 >>> 0];
445
+ return ret;
446
+ }
447
+ export function __wbg_has_b3a6e6d0d28295fa() { return handleError(function (arg0, arg1) {
448
+ const ret = Reflect.has(arg0, arg1);
449
+ return ret;
450
+ }, arguments); }
451
+ export function __wbg_headers_92567b07014384b9(arg0) {
452
+ const ret = arg0.headers;
453
+ return ret;
454
+ }
455
+ export function __wbg_instanceof_ArrayBuffer_993d02d2d254cad1(arg0) {
456
+ let result;
457
+ try {
458
+ result = arg0 instanceof ArrayBuffer;
459
+ } catch (_) {
460
+ result = false;
461
+ }
462
+ const ret = result;
463
+ return ret;
464
+ }
465
+ export function __wbg_instanceof_Response_8f49efbd4bfd76d6(arg0) {
466
+ let result;
467
+ try {
468
+ result = arg0 instanceof Response;
469
+ } catch (_) {
470
+ result = false;
471
+ }
472
+ const ret = result;
473
+ return ret;
474
+ }
475
+ export function __wbg_instanceof_Uint8Array_f935dbb0aa7cdeed(arg0) {
476
+ let result;
477
+ try {
478
+ result = arg0 instanceof Uint8Array;
479
+ } catch (_) {
480
+ result = false;
481
+ }
482
+ const ret = result;
483
+ return ret;
484
+ }
485
+ export function __wbg_isArray_6339f732981044bf(arg0) {
486
+ const ret = Array.isArray(arg0);
487
+ return ret;
488
+ }
489
+ export function __wbg_iterator_5cebbb86e33c6dd6() {
490
+ const ret = Symbol.iterator;
491
+ return ret;
492
+ }
493
+ export function __wbg_length_36bd29c6848c2144(arg0) {
494
+ const ret = arg0.length;
495
+ return ret;
496
+ }
497
+ export function __wbg_length_ecfa2c63d3d0d82c(arg0) {
498
+ const ret = arg0.length;
499
+ return ret;
500
+ }
501
+ export function __wbg_msCrypto_bd5a034af96bcba6(arg0) {
502
+ const ret = arg0.msCrypto;
503
+ return ret;
504
+ }
505
+ export function __wbg_new_0_f117d868b403dc07() {
506
+ const ret = new Date();
507
+ return ret;
508
+ }
509
+ export function __wbg_new_116be93542d39019() {
510
+ const ret = new Array();
511
+ return ret;
512
+ }
513
+ export function __wbg_new_227d7c05414eb861() {
514
+ const ret = new Error();
515
+ return ret;
516
+ }
517
+ export function __wbg_new_358857d90afd5a2d(arg0, arg1) {
518
+ const ret = new Error(getStringFromWasm0(arg0, arg1));
519
+ return ret;
520
+ }
521
+ export function __wbg_new_77cc4f4f472aeb81(arg0) {
522
+ const ret = new Uint8Array(arg0);
523
+ return ret;
524
+ }
525
+ export function __wbg_new_95039e162b0c4466() { return handleError(function () {
526
+ const ret = new Headers();
527
+ return ret;
528
+ }, arguments); }
529
+ export function __wbg_new_ebe3e0f6837f0879() {
530
+ const ret = new Object();
531
+ return ret;
532
+ }
533
+ export function __wbg_new_f5712de39c931ddf() { return handleError(function () {
534
+ const ret = new AbortController();
535
+ return ret;
536
+ }, arguments); }
537
+ export function __wbg_new_from_slice_3eea173078478cfe(arg0, arg1) {
538
+ const ret = new Uint8Array(getArrayU8FromWasm0(arg0, arg1));
539
+ return ret;
540
+ }
541
+ export function __wbg_new_typed_cceaf62d8d95e9f2(arg0, arg1) {
542
+ try {
543
+ var state0 = {a: arg0, b: arg1};
544
+ var cb0 = (arg0, arg1) => {
545
+ const a = state0.a;
546
+ state0.a = 0;
547
+ try {
548
+ return wasm_bindgen_6971d5a3494a1047___convert__closures_____invoke___js_sys_e8852f8f4f778035___Function_fn_wasm_bindgen_6971d5a3494a1047___JsValue_____wasm_bindgen_6971d5a3494a1047___sys__Undefined___js_sys_e8852f8f4f778035___Function_fn_wasm_bindgen_6971d5a3494a1047___JsValue_____wasm_bindgen_6971d5a3494a1047___sys__Undefined_______true_(a, state0.b, arg0, arg1);
549
+ } finally {
550
+ state0.a = a;
551
+ }
552
+ };
553
+ const ret = new Promise(cb0);
554
+ return ret;
555
+ } finally {
556
+ state0.a = 0;
557
+ }
558
+ }
559
+ export function __wbg_new_with_length_3ffc1c56427c525c(arg0) {
560
+ const ret = new Uint8Array(arg0 >>> 0);
561
+ return ret;
562
+ }
563
+ export function __wbg_new_with_str_and_init_5a37d576dec75a86() { return handleError(function (arg0, arg1, arg2) {
564
+ const ret = new Request(getStringFromWasm0(arg0, arg1), arg2);
565
+ return ret;
566
+ }, arguments); }
567
+ export function __wbg_next_42cf16ee0dafc9e2() { return handleError(function (arg0) {
568
+ const ret = arg0.next();
569
+ return ret;
570
+ }, arguments); }
571
+ export function __wbg_next_8f26b64fa5e9f64b(arg0) {
572
+ const ret = arg0.next;
573
+ return ret;
574
+ }
575
+ export function __wbg_node_84ea875411254db1(arg0) {
576
+ const ret = arg0.node;
577
+ return ret;
578
+ }
579
+ export function __wbg_now_e7c6795a7f81e10f(arg0) {
580
+ const ret = arg0.now();
581
+ return ret;
582
+ }
583
+ export function __wbg_performance_3fcf6e32a7e1ed0a(arg0) {
584
+ const ret = arg0.performance;
585
+ return ret;
586
+ }
587
+ export function __wbg_process_44c7a14e11e9f69e(arg0) {
588
+ const ret = arg0.process;
589
+ return ret;
590
+ }
591
+ export function __wbg_prototypesetcall_de8e0d9553586985(arg0, arg1, arg2) {
592
+ Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), arg2);
593
+ }
594
+ export function __wbg_queueMicrotask_ac694eae12e92dfb(arg0) {
595
+ queueMicrotask(arg0);
596
+ }
597
+ export function __wbg_queueMicrotask_be5fe34a8f4cad4d(arg0) {
598
+ const ret = arg0.queueMicrotask;
599
+ return ret;
600
+ }
601
+ export function __wbg_randomFillSync_6c25eac9869eb53c() { return handleError(function (arg0, arg1) {
602
+ arg0.randomFillSync(arg1);
603
+ }, arguments); }
604
+ export function __wbg_require_b4edbdcf3e2a1ef0() { return handleError(function () {
605
+ const ret = module.require;
606
+ return ret;
607
+ }, arguments); }
608
+ export function __wbg_resolve_020f95d838c6ef25(arg0) {
609
+ const ret = Promise.resolve(arg0);
610
+ return ret;
611
+ }
612
+ export function __wbg_setTimeout_3a808dd861dd3c12(arg0, arg1) {
613
+ const ret = setTimeout(arg0, arg1);
614
+ return ret;
615
+ }
616
+ export function __wbg_set_6be42768c690e380(arg0, arg1, arg2) {
617
+ arg0[arg1] = arg2;
618
+ }
619
+ export function __wbg_set_a80955eb93b145c6(arg0, arg1, arg2) {
620
+ arg0[arg1 >>> 0] = arg2;
621
+ }
622
+ export function __wbg_set_body_f301b68bff45f419(arg0, arg1) {
623
+ arg0.body = arg1;
624
+ }
625
+ export function __wbg_set_cache_ab8f11813716fe29(arg0, arg1) {
626
+ arg0.cache = __wbindgen_enum_RequestCache[arg1];
627
+ }
628
+ export function __wbg_set_credentials_d7f3b810cbf191e1(arg0, arg1) {
629
+ arg0.credentials = __wbindgen_enum_RequestCredentials[arg1];
630
+ }
631
+ export function __wbg_set_headers_805555608daf7f2a(arg0, arg1) {
632
+ arg0.headers = arg1;
633
+ }
634
+ export function __wbg_set_method_cf2b992b9a610bc3(arg0, arg1, arg2) {
635
+ arg0.method = getStringFromWasm0(arg1, arg2);
636
+ }
637
+ export function __wbg_set_mode_d6479dfd6696c8d3(arg0, arg1) {
638
+ arg0.mode = __wbindgen_enum_RequestMode[arg1];
639
+ }
640
+ export function __wbg_set_signal_115b9e9423652e66(arg0, arg1) {
641
+ arg0.signal = arg1;
642
+ }
643
+ export function __wbg_signal_58449b7eb331d1be(arg0) {
644
+ const ret = arg0.signal;
645
+ return ret;
646
+ }
647
+ export function __wbg_stack_3b0d974bbf31e44f(arg0, arg1) {
648
+ const ret = arg1.stack;
649
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
650
+ const len1 = WASM_VECTOR_LEN;
651
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
652
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
653
+ }
654
+ export function __wbg_static_accessor_GLOBAL_THIS_466428f93b4eaa76() {
655
+ const ret = typeof globalThis === 'undefined' ? null : globalThis;
656
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
657
+ }
658
+ export function __wbg_static_accessor_GLOBAL_c7aea38d4de089bc() {
659
+ const ret = typeof global === 'undefined' ? null : global;
660
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
661
+ }
662
+ export function __wbg_static_accessor_SELF_42d4fae05e59267a() {
663
+ const ret = typeof self === 'undefined' ? null : self;
664
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
665
+ }
666
+ export function __wbg_static_accessor_WINDOW_e0db14a0eba6a812() {
667
+ const ret = typeof window === 'undefined' ? null : window;
668
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
669
+ }
670
+ export function __wbg_status_b0de02a07fd7d927(arg0) {
671
+ const ret = arg0.status;
672
+ return ret;
673
+ }
674
+ export function __wbg_subarray_a4cc58201c7359fd(arg0, arg1, arg2) {
675
+ const ret = arg0.subarray(arg1 >>> 0, arg2 >>> 0);
676
+ return ret;
677
+ }
678
+ export function __wbg_text_9302f33ea8cfce7b() { return handleError(function (arg0) {
679
+ const ret = arg0.text();
680
+ return ret;
681
+ }, arguments); }
682
+ export function __wbg_then_7026b513a94278a8(arg0, arg1) {
683
+ const ret = arg0.then(arg1);
684
+ return ret;
685
+ }
686
+ export function __wbg_then_72819b8d4e081fb5(arg0, arg1, arg2) {
687
+ const ret = arg0.then(arg1, arg2);
688
+ return ret;
689
+ }
690
+ export function __wbg_url_82c95d5d2e2ba977(arg0, arg1) {
691
+ const ret = arg1.url;
692
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
693
+ const len1 = WASM_VECTOR_LEN;
694
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
695
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
696
+ }
697
+ export function __wbg_value_1e2369fab29b420e(arg0) {
698
+ const ret = arg0.value;
699
+ return ret;
700
+ }
701
+ export function __wbg_versions_276b2795b1c6a219(arg0) {
702
+ const ret = arg0.versions;
703
+ return ret;
704
+ }
705
+ export function __wbindgen_cast_0000000000000001(arg0, arg1) {
706
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 504, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
707
+ const ret = makeMutClosure(arg0, arg1, wasm_bindgen_6971d5a3494a1047___convert__closures_____invoke___wasm_bindgen_6971d5a3494a1047___JsValue__core_9b3796e30d99ddb7___result__Result_____wasm_bindgen_6971d5a3494a1047___JsError___true_);
708
+ return ret;
709
+ }
710
+ export function __wbindgen_cast_0000000000000002(arg0, arg1) {
711
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [], shim_idx: 157, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
712
+ const ret = makeMutClosure(arg0, arg1, wasm_bindgen_6971d5a3494a1047___convert__closures_____invoke_______true_);
713
+ return ret;
714
+ }
715
+ export function __wbindgen_cast_0000000000000003(arg0) {
716
+ // Cast intrinsic for `F64 -> Externref`.
717
+ const ret = arg0;
718
+ return ret;
719
+ }
720
+ export function __wbindgen_cast_0000000000000004(arg0, arg1) {
721
+ // Cast intrinsic for `Ref(Slice(U8)) -> NamedExternref("Uint8Array")`.
722
+ const ret = getArrayU8FromWasm0(arg0, arg1);
723
+ return ret;
724
+ }
725
+ export function __wbindgen_cast_0000000000000005(arg0, arg1) {
726
+ // Cast intrinsic for `Ref(String) -> Externref`.
727
+ const ret = getStringFromWasm0(arg0, arg1);
728
+ return ret;
729
+ }
730
+ export function __wbindgen_cast_0000000000000006(arg0) {
731
+ // Cast intrinsic for `U64 -> Externref`.
732
+ const ret = BigInt.asUintN(64, arg0);
733
+ return ret;
734
+ }
735
+ export function __wbindgen_init_externref_table() {
736
+ const table = wasm.__wbindgen_externrefs;
737
+ const offset = table.grow(4);
738
+ table.set(0, undefined);
739
+ table.set(offset + 0, undefined);
740
+ table.set(offset + 1, null);
741
+ table.set(offset + 2, true);
742
+ table.set(offset + 3, false);
743
+ }
744
+ function wasm_bindgen_6971d5a3494a1047___convert__closures_____invoke_______true_(arg0, arg1) {
745
+ wasm.wasm_bindgen_6971d5a3494a1047___convert__closures_____invoke_______true_(arg0, arg1);
746
+ }
747
+
748
+ function wasm_bindgen_6971d5a3494a1047___convert__closures_____invoke___wasm_bindgen_6971d5a3494a1047___JsValue__core_9b3796e30d99ddb7___result__Result_____wasm_bindgen_6971d5a3494a1047___JsError___true_(arg0, arg1, arg2) {
749
+ const ret = wasm.wasm_bindgen_6971d5a3494a1047___convert__closures_____invoke___wasm_bindgen_6971d5a3494a1047___JsValue__core_9b3796e30d99ddb7___result__Result_____wasm_bindgen_6971d5a3494a1047___JsError___true_(arg0, arg1, arg2);
750
+ if (ret[1]) {
751
+ throw takeFromExternrefTable0(ret[0]);
752
+ }
753
+ }
754
+
755
+ function wasm_bindgen_6971d5a3494a1047___convert__closures_____invoke___js_sys_e8852f8f4f778035___Function_fn_wasm_bindgen_6971d5a3494a1047___JsValue_____wasm_bindgen_6971d5a3494a1047___sys__Undefined___js_sys_e8852f8f4f778035___Function_fn_wasm_bindgen_6971d5a3494a1047___JsValue_____wasm_bindgen_6971d5a3494a1047___sys__Undefined_______true_(arg0, arg1, arg2, arg3) {
756
+ wasm.wasm_bindgen_6971d5a3494a1047___convert__closures_____invoke___js_sys_e8852f8f4f778035___Function_fn_wasm_bindgen_6971d5a3494a1047___JsValue_____wasm_bindgen_6971d5a3494a1047___sys__Undefined___js_sys_e8852f8f4f778035___Function_fn_wasm_bindgen_6971d5a3494a1047___JsValue_____wasm_bindgen_6971d5a3494a1047___sys__Undefined_______true_(arg0, arg1, arg2, arg3);
757
+ }
758
+
759
+
760
+ const __wbindgen_enum_RequestCache = ["default", "no-store", "reload", "no-cache", "force-cache", "only-if-cached"];
761
+
762
+
763
+ const __wbindgen_enum_RequestCredentials = ["omit", "same-origin", "include"];
764
+
765
+
766
+ const __wbindgen_enum_RequestMode = ["same-origin", "no-cors", "cors", "navigate"];
767
+ const AxiamWasmClientFinalization = (typeof FinalizationRegistry === 'undefined')
768
+ ? { register: () => {}, unregister: () => {} }
769
+ : new FinalizationRegistry(ptr => wasm.__wbg_axiamwasmclient_free(ptr, 1));
770
+
771
+ function addToExternrefTable0(obj) {
772
+ const idx = wasm.__externref_table_alloc();
773
+ wasm.__wbindgen_externrefs.set(idx, obj);
774
+ return idx;
775
+ }
776
+
777
+ const CLOSURE_DTORS = (typeof FinalizationRegistry === 'undefined')
778
+ ? { register: () => {}, unregister: () => {} }
779
+ : new FinalizationRegistry(state => wasm.__wbindgen_destroy_closure(state.a, state.b));
780
+
781
+ function debugString(val) {
782
+ // primitive types
783
+ const type = typeof val;
784
+ if (type == 'number' || type == 'boolean' || val == null) {
785
+ return `${val}`;
786
+ }
787
+ if (type == 'string') {
788
+ return `"${val}"`;
789
+ }
790
+ if (type == 'symbol') {
791
+ const description = val.description;
792
+ if (description == null) {
793
+ return 'Symbol';
794
+ } else {
795
+ return `Symbol(${description})`;
796
+ }
797
+ }
798
+ if (type == 'function') {
799
+ const name = val.name;
800
+ if (typeof name == 'string' && name.length > 0) {
801
+ return `Function(${name})`;
802
+ } else {
803
+ return 'Function';
804
+ }
805
+ }
806
+ // objects
807
+ if (Array.isArray(val)) {
808
+ const length = val.length;
809
+ let debug = '[';
810
+ if (length > 0) {
811
+ debug += debugString(val[0]);
812
+ }
813
+ for(let i = 1; i < length; i++) {
814
+ debug += ', ' + debugString(val[i]);
815
+ }
816
+ debug += ']';
817
+ return debug;
818
+ }
819
+ // Test for built-in
820
+ const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
821
+ let className;
822
+ if (builtInMatches && builtInMatches.length > 1) {
823
+ className = builtInMatches[1];
824
+ } else {
825
+ // Failed to match the standard '[object ClassName]'
826
+ return toString.call(val);
827
+ }
828
+ if (className == 'Object') {
829
+ // we're a user defined class or Object
830
+ // JSON.stringify avoids problems with cycles, and is generally much
831
+ // easier than looping through ownProperties of `val`.
832
+ try {
833
+ return 'Object(' + JSON.stringify(val) + ')';
834
+ } catch (_) {
835
+ return 'Object';
836
+ }
837
+ }
838
+ // errors
839
+ if (val instanceof Error) {
840
+ return `${val.name}: ${val.message}\n${val.stack}`;
841
+ }
842
+ // TODO we could test for more things here, like `Set`s and `Map`s.
843
+ return className;
844
+ }
845
+
846
+ function getArrayU8FromWasm0(ptr, len) {
847
+ ptr = ptr >>> 0;
848
+ return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
849
+ }
850
+
851
+ let cachedDataViewMemory0 = null;
852
+ function getDataViewMemory0() {
853
+ if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
854
+ cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
855
+ }
856
+ return cachedDataViewMemory0;
857
+ }
858
+
859
+ function getStringFromWasm0(ptr, len) {
860
+ return decodeText(ptr >>> 0, len);
861
+ }
862
+
863
+ let cachedUint8ArrayMemory0 = null;
864
+ function getUint8ArrayMemory0() {
865
+ if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
866
+ cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
867
+ }
868
+ return cachedUint8ArrayMemory0;
869
+ }
870
+
871
+ function handleError(f, args) {
872
+ try {
873
+ return f.apply(this, args);
874
+ } catch (e) {
875
+ const idx = addToExternrefTable0(e);
876
+ wasm.__wbindgen_exn_store(idx);
877
+ }
878
+ }
879
+
880
+ function isLikeNone(x) {
881
+ return x === undefined || x === null;
882
+ }
883
+
884
+ function makeMutClosure(arg0, arg1, f) {
885
+ const state = { a: arg0, b: arg1, cnt: 1 };
886
+ const real = (...args) => {
887
+
888
+ // First up with a closure we increment the internal reference
889
+ // count. This ensures that the Rust closure environment won't
890
+ // be deallocated while we're invoking it.
891
+ state.cnt++;
892
+ const a = state.a;
893
+ state.a = 0;
894
+ try {
895
+ return f(a, state.b, ...args);
896
+ } finally {
897
+ state.a = a;
898
+ real._wbg_cb_unref();
899
+ }
900
+ };
901
+ real._wbg_cb_unref = () => {
902
+ if (--state.cnt === 0) {
903
+ wasm.__wbindgen_destroy_closure(state.a, state.b);
904
+ state.a = 0;
905
+ CLOSURE_DTORS.unregister(state);
906
+ }
907
+ };
908
+ CLOSURE_DTORS.register(real, state, state);
909
+ return real;
910
+ }
911
+
912
+ function passStringToWasm0(arg, malloc, realloc) {
913
+ if (realloc === undefined) {
914
+ const buf = cachedTextEncoder.encode(arg);
915
+ const ptr = malloc(buf.length, 1) >>> 0;
916
+ getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
917
+ WASM_VECTOR_LEN = buf.length;
918
+ return ptr;
919
+ }
920
+
921
+ let len = arg.length;
922
+ let ptr = malloc(len, 1) >>> 0;
923
+
924
+ const mem = getUint8ArrayMemory0();
925
+
926
+ let offset = 0;
927
+
928
+ for (; offset < len; offset++) {
929
+ const code = arg.charCodeAt(offset);
930
+ if (code > 0x7F) break;
931
+ mem[ptr + offset] = code;
932
+ }
933
+ if (offset !== len) {
934
+ if (offset !== 0) {
935
+ arg = arg.slice(offset);
936
+ }
937
+ ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
938
+ const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
939
+ const ret = cachedTextEncoder.encodeInto(arg, view);
940
+
941
+ offset += ret.written;
942
+ ptr = realloc(ptr, len, offset, 1) >>> 0;
943
+ }
944
+
945
+ WASM_VECTOR_LEN = offset;
946
+ return ptr;
947
+ }
948
+
949
+ function takeFromExternrefTable0(idx) {
950
+ const value = wasm.__wbindgen_externrefs.get(idx);
951
+ wasm.__externref_table_dealloc(idx);
952
+ return value;
953
+ }
954
+
955
+ let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
956
+ cachedTextDecoder.decode();
957
+ const MAX_SAFARI_DECODE_BYTES = 2146435072;
958
+ let numBytesDecoded = 0;
959
+ function decodeText(ptr, len) {
960
+ numBytesDecoded += len;
961
+ if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
962
+ cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
963
+ cachedTextDecoder.decode();
964
+ numBytesDecoded = len;
965
+ }
966
+ return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
967
+ }
968
+
969
+ const cachedTextEncoder = new TextEncoder();
970
+
971
+ if (!('encodeInto' in cachedTextEncoder)) {
972
+ cachedTextEncoder.encodeInto = function (arg, view) {
973
+ const buf = cachedTextEncoder.encode(arg);
974
+ view.set(buf);
975
+ return {
976
+ read: arg.length,
977
+ written: buf.length
978
+ };
979
+ };
980
+ }
981
+
982
+ let WASM_VECTOR_LEN = 0;
983
+
984
+
985
+ let wasm;
986
+ export function __wbg_set_wasm(val) {
987
+ wasm = val;
988
+ }