@janssenproject/cedarling_wasm 1.15.0-nodejs → 2.0.0-nodejs

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/cedarling_wasm.js CHANGED
@@ -1,370 +1,677 @@
1
+ /* @ts-self-types="./cedarling_wasm.d.ts" */
1
2
 
2
- let imports = {};
3
- imports['__wbindgen_placeholder__'] = module.exports;
4
-
5
- function addToExternrefTable0(obj) {
6
- const idx = wasm.__externref_table_alloc();
7
- wasm.__wbindgen_externrefs.set(idx, obj);
8
- return idx;
3
+ /**
4
+ * A WASM wrapper for the Rust `cedarling::AuthorizeResult` struct.
5
+ * Represents the result of an authorization request.
6
+ */
7
+ class AuthorizeResult {
8
+ static __wrap(ptr) {
9
+ ptr = ptr >>> 0;
10
+ const obj = Object.create(AuthorizeResult.prototype);
11
+ obj.__wbg_ptr = ptr;
12
+ AuthorizeResultFinalization.register(obj, obj.__wbg_ptr, obj);
13
+ return obj;
14
+ }
15
+ __destroy_into_raw() {
16
+ const ptr = this.__wbg_ptr;
17
+ this.__wbg_ptr = 0;
18
+ AuthorizeResultFinalization.unregister(this);
19
+ return ptr;
20
+ }
21
+ free() {
22
+ const ptr = this.__destroy_into_raw();
23
+ wasm.__wbg_authorizeresult_free(ptr, 0);
24
+ }
25
+ /**
26
+ * Convert `AuthorizeResult` to json string value
27
+ * @returns {string}
28
+ */
29
+ json_string() {
30
+ let deferred1_0;
31
+ let deferred1_1;
32
+ try {
33
+ const ret = wasm.authorizeresult_json_string(this.__wbg_ptr);
34
+ deferred1_0 = ret[0];
35
+ deferred1_1 = ret[1];
36
+ return getStringFromWasm0(ret[0], ret[1]);
37
+ } finally {
38
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
39
+ }
40
+ }
41
+ /**
42
+ * Result of authorization
43
+ * true means `ALLOW`
44
+ * false means `Deny`
45
+ *
46
+ * this field is [`bool`] type to be compatible with [authzen Access Evaluation Decision](https://openid.github.io/authzen/#section-6.2.1).
47
+ * @returns {boolean}
48
+ */
49
+ get decision() {
50
+ const ret = wasm.__wbg_get_authorizeresult_decision(this.__wbg_ptr);
51
+ return ret !== 0;
52
+ }
53
+ /**
54
+ * Request ID of the authorization request
55
+ * @returns {string}
56
+ */
57
+ get request_id() {
58
+ let deferred1_0;
59
+ let deferred1_1;
60
+ try {
61
+ const ret = wasm.__wbg_get_authorizeresult_request_id(this.__wbg_ptr);
62
+ deferred1_0 = ret[0];
63
+ deferred1_1 = ret[1];
64
+ return getStringFromWasm0(ret[0], ret[1]);
65
+ } finally {
66
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
67
+ }
68
+ }
69
+ /**
70
+ * Cedar authorization response for the request.
71
+ * @returns {AuthorizeResultResponse}
72
+ */
73
+ get response() {
74
+ const ret = wasm.__wbg_get_authorizeresult_response(this.__wbg_ptr);
75
+ return AuthorizeResultResponse.__wrap(ret);
76
+ }
77
+ /**
78
+ * Result of authorization
79
+ * true means `ALLOW`
80
+ * false means `Deny`
81
+ *
82
+ * this field is [`bool`] type to be compatible with [authzen Access Evaluation Decision](https://openid.github.io/authzen/#section-6.2.1).
83
+ * @param {boolean} arg0
84
+ */
85
+ set decision(arg0) {
86
+ wasm.__wbg_set_authorizeresult_decision(this.__wbg_ptr, arg0);
87
+ }
88
+ /**
89
+ * Request ID of the authorization request
90
+ * @param {string} arg0
91
+ */
92
+ set request_id(arg0) {
93
+ const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
94
+ const len0 = WASM_VECTOR_LEN;
95
+ wasm.__wbg_set_authorizeresult_request_id(this.__wbg_ptr, ptr0, len0);
96
+ }
97
+ /**
98
+ * Cedar authorization response for the request.
99
+ * @param {AuthorizeResultResponse} arg0
100
+ */
101
+ set response(arg0) {
102
+ _assertClass(arg0, AuthorizeResultResponse);
103
+ var ptr0 = arg0.__destroy_into_raw();
104
+ wasm.__wbg_set_authorizeresult_response(this.__wbg_ptr, ptr0);
105
+ }
9
106
  }
107
+ if (Symbol.dispose) AuthorizeResult.prototype[Symbol.dispose] = AuthorizeResult.prototype.free;
108
+ exports.AuthorizeResult = AuthorizeResult;
10
109
 
11
- function _assertClass(instance, klass) {
12
- if (!(instance instanceof klass)) {
13
- throw new Error(`expected instance of ${klass.name}`);
110
+ /**
111
+ * A WASM wrapper for the Rust `cedar_policy::Response` struct.
112
+ * Represents the result of an authorization request.
113
+ */
114
+ class AuthorizeResultResponse {
115
+ static __wrap(ptr) {
116
+ ptr = ptr >>> 0;
117
+ const obj = Object.create(AuthorizeResultResponse.prototype);
118
+ obj.__wbg_ptr = ptr;
119
+ AuthorizeResultResponseFinalization.register(obj, obj.__wbg_ptr, obj);
120
+ return obj;
121
+ }
122
+ __destroy_into_raw() {
123
+ const ptr = this.__wbg_ptr;
124
+ this.__wbg_ptr = 0;
125
+ AuthorizeResultResponseFinalization.unregister(this);
126
+ return ptr;
127
+ }
128
+ free() {
129
+ const ptr = this.__destroy_into_raw();
130
+ wasm.__wbg_authorizeresultresponse_free(ptr, 0);
131
+ }
132
+ /**
133
+ * Authorization decision
134
+ * @returns {boolean}
135
+ */
136
+ get decision() {
137
+ const ret = wasm.authorizeresultresponse_decision(this.__wbg_ptr);
138
+ return ret !== 0;
139
+ }
140
+ /**
141
+ * Diagnostics providing more information on how this decision was reached
142
+ * @returns {Diagnostics}
143
+ */
144
+ get diagnostics() {
145
+ const ret = wasm.authorizeresultresponse_diagnostics(this.__wbg_ptr);
146
+ return Diagnostics.__wrap(ret);
14
147
  }
15
148
  }
149
+ if (Symbol.dispose) AuthorizeResultResponse.prototype[Symbol.dispose] = AuthorizeResultResponse.prototype.free;
150
+ exports.AuthorizeResultResponse = AuthorizeResultResponse;
16
151
 
17
- const CLOSURE_DTORS = (typeof FinalizationRegistry === 'undefined')
18
- ? { register: () => {}, unregister: () => {} }
19
- : new FinalizationRegistry(state => state.dtor(state.a, state.b));
20
-
21
- function debugString(val) {
22
- // primitive types
23
- const type = typeof val;
24
- if (type == 'number' || type == 'boolean' || val == null) {
25
- return `${val}`;
152
+ /**
153
+ * The instance of the Cedarling application.
154
+ */
155
+ class Cedarling {
156
+ static __wrap(ptr) {
157
+ ptr = ptr >>> 0;
158
+ const obj = Object.create(Cedarling.prototype);
159
+ obj.__wbg_ptr = ptr;
160
+ CedarlingFinalization.register(obj, obj.__wbg_ptr, obj);
161
+ return obj;
26
162
  }
27
- if (type == 'string') {
28
- return `"${val}"`;
163
+ __destroy_into_raw() {
164
+ const ptr = this.__wbg_ptr;
165
+ this.__wbg_ptr = 0;
166
+ CedarlingFinalization.unregister(this);
167
+ return ptr;
29
168
  }
30
- if (type == 'symbol') {
31
- const description = val.description;
32
- if (description == null) {
33
- return 'Symbol';
34
- } else {
35
- return `Symbol(${description})`;
169
+ free() {
170
+ const ptr = this.__destroy_into_raw();
171
+ wasm.__wbg_cedarling_free(ptr, 0);
172
+ }
173
+ /**
174
+ * Authorize multi-issuer request.
175
+ * Makes authorization decision based on multiple JWT tokens from different issuers
176
+ * @param {any} request
177
+ * @returns {Promise<MultiIssuerAuthorizeResult>}
178
+ */
179
+ authorize_multi_issuer(request) {
180
+ const ret = wasm.cedarling_authorize_multi_issuer(this.__wbg_ptr, request);
181
+ return ret;
182
+ }
183
+ /**
184
+ * Authorize an unsigned request carrying an optional single principal.
185
+ * Makes an authorization decision based on the [`RequestUnsigned`].
186
+ *
187
+ * When `principal` is omitted / `null` on the JS side the core uses Cedar
188
+ * partial evaluation; residual-dependent requests fail closed with
189
+ * `Decision::Deny` and surface residual policy ids in
190
+ * `response.diagnostics.reason`.
191
+ * @param {any} request
192
+ * @returns {Promise<AuthorizeResult>}
193
+ */
194
+ authorize_unsigned(request) {
195
+ const ret = wasm.cedarling_authorize_unsigned(this.__wbg_ptr, request);
196
+ return ret;
197
+ }
198
+ /**
199
+ * Clear all entries from the data store.
200
+ *
201
+ * # Example
202
+ *
203
+ * ```javascript
204
+ * cedarling.clear_data_ctx();
205
+ * console.log("All data entries cleared");
206
+ * ```
207
+ */
208
+ clear_data_ctx() {
209
+ const ret = wasm.cedarling_clear_data_ctx(this.__wbg_ptr);
210
+ if (ret[1]) {
211
+ throw takeFromExternrefTable0(ret[0]);
36
212
  }
37
213
  }
38
- if (type == 'function') {
39
- const name = val.name;
40
- if (typeof name == 'string' && name.length > 0) {
41
- return `Function(${name})`;
42
- } else {
43
- return 'Function';
214
+ /**
215
+ * Get trusted issuer identifiers that failed to load.
216
+ *
217
+ * # Example
218
+ *
219
+ * ```javascript
220
+ * const ids = cedarling.failed_trusted_issuer_ids();
221
+ * ```
222
+ * @returns {Array<any>}
223
+ */
224
+ failed_trusted_issuer_ids() {
225
+ const ret = wasm.cedarling_failed_trusted_issuer_ids(this.__wbg_ptr);
226
+ return ret;
227
+ }
228
+ /**
229
+ * Get a value from the data store by key.
230
+ * Returns null if the key doesn't exist or the entry has expired.
231
+ *
232
+ * # Arguments
233
+ *
234
+ * * `key` - A string key for the data entry to retrieve
235
+ *
236
+ * # Example
237
+ *
238
+ * ```javascript
239
+ * const value = cedarling.get_data_ctx("user:123");
240
+ * if (value !== null) {
241
+ * console.log(value.name); // "John"
242
+ * }
243
+ * ```
244
+ * @param {string} key
245
+ * @returns {any}
246
+ */
247
+ get_data_ctx(key) {
248
+ const ptr0 = passStringToWasm0(key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
249
+ const len0 = WASM_VECTOR_LEN;
250
+ const ret = wasm.cedarling_get_data_ctx(this.__wbg_ptr, ptr0, len0);
251
+ if (ret[2]) {
252
+ throw takeFromExternrefTable0(ret[1]);
44
253
  }
254
+ return takeFromExternrefTable0(ret[0]);
45
255
  }
46
- // objects
47
- if (Array.isArray(val)) {
48
- const length = val.length;
49
- let debug = '[';
50
- if (length > 0) {
51
- debug += debugString(val[0]);
256
+ /**
257
+ * Get a data entry with full metadata by key.
258
+ * Returns null if the key doesn't exist or the entry has expired.
259
+ *
260
+ * # Arguments
261
+ *
262
+ * * `key` - A string key for the data entry to retrieve
263
+ *
264
+ * # Example
265
+ *
266
+ * ```javascript
267
+ * const entry = cedarling.get_data_entry_ctx("user:123");
268
+ * if (entry !== null) {
269
+ * console.log(entry.key); // "user:123"
270
+ * console.log(entry.value); // { name: "John", age: 30 }
271
+ * console.log(entry.data_type); // "Record"
272
+ * console.log(entry.created_at); // "2024-01-01T12:00:00Z"
273
+ * console.log(entry.access_count); // 5
274
+ * }
275
+ * ```
276
+ * @param {string} key
277
+ * @returns {DataEntry | undefined}
278
+ */
279
+ get_data_entry_ctx(key) {
280
+ const ptr0 = passStringToWasm0(key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
281
+ const len0 = WASM_VECTOR_LEN;
282
+ const ret = wasm.cedarling_get_data_entry_ctx(this.__wbg_ptr, ptr0, len0);
283
+ if (ret[2]) {
284
+ throw takeFromExternrefTable0(ret[1]);
52
285
  }
53
- for(let i = 1; i < length; i++) {
54
- debug += ', ' + debugString(val[i]);
286
+ return ret[0] === 0 ? undefined : DataEntry.__wrap(ret[0]);
287
+ }
288
+ /**
289
+ * Get specific log entry.
290
+ * Returns `Map` with values or `null`.
291
+ * @param {string} id
292
+ * @returns {any}
293
+ */
294
+ get_log_by_id(id) {
295
+ const ptr0 = passStringToWasm0(id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
296
+ const len0 = WASM_VECTOR_LEN;
297
+ const ret = wasm.cedarling_get_log_by_id(this.__wbg_ptr, ptr0, len0);
298
+ if (ret[2]) {
299
+ throw takeFromExternrefTable0(ret[1]);
55
300
  }
56
- debug += ']';
57
- return debug;
301
+ return takeFromExternrefTable0(ret[0]);
58
302
  }
59
- // Test for built-in
60
- const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
61
- let className;
62
- if (builtInMatches && builtInMatches.length > 1) {
63
- className = builtInMatches[1];
64
- } else {
65
- // Failed to match the standard '[object ClassName]'
66
- return toString.call(val);
303
+ /**
304
+ * Returns a list of all log ids.
305
+ * Returns `Array` of `String`
306
+ * @returns {Array<any>}
307
+ */
308
+ get_log_ids() {
309
+ const ret = wasm.cedarling_get_log_ids(this.__wbg_ptr);
310
+ return ret;
67
311
  }
68
- if (className == 'Object') {
69
- // we're a user defined class or Object
70
- // JSON.stringify avoids problems with cycles, and is generally much
71
- // easier than looping through ownProperties of `val`.
72
- try {
73
- return 'Object(' + JSON.stringify(val) + ')';
74
- } catch (_) {
75
- return 'Object';
312
+ /**
313
+ * Get logs by request_id.
314
+ * Return log entries that match the given request_id.
315
+ * @param {string} request_id
316
+ * @returns {any[]}
317
+ */
318
+ get_logs_by_request_id(request_id) {
319
+ const ptr0 = passStringToWasm0(request_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
320
+ const len0 = WASM_VECTOR_LEN;
321
+ const ret = wasm.cedarling_get_logs_by_request_id(this.__wbg_ptr, ptr0, len0);
322
+ if (ret[3]) {
323
+ throw takeFromExternrefTable0(ret[2]);
76
324
  }
325
+ var v2 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
326
+ wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
327
+ return v2;
77
328
  }
78
- // errors
79
- if (val instanceof Error) {
80
- return `${val.name}: ${val.message}\n${val.stack}`;
329
+ /**
330
+ * Get log by request_id and tag, like composite key `request_id` + `log_kind`.
331
+ * Tag can be `log_kind`, `log_level`.
332
+ * Return log entries that match the given request_id and tag.
333
+ * @param {string} request_id
334
+ * @param {string} tag
335
+ * @returns {any[]}
336
+ */
337
+ get_logs_by_request_id_and_tag(request_id, tag) {
338
+ const ptr0 = passStringToWasm0(request_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
339
+ const len0 = WASM_VECTOR_LEN;
340
+ const ptr1 = passStringToWasm0(tag, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
341
+ const len1 = WASM_VECTOR_LEN;
342
+ const ret = wasm.cedarling_get_logs_by_request_id_and_tag(this.__wbg_ptr, ptr0, len0, ptr1, len1);
343
+ if (ret[3]) {
344
+ throw takeFromExternrefTable0(ret[2]);
345
+ }
346
+ var v3 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
347
+ wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
348
+ return v3;
81
349
  }
82
- // TODO we could test for more things here, like `Set`s and `Map`s.
83
- return className;
84
- }
85
-
86
- function getArrayJsValueFromWasm0(ptr, len) {
87
- ptr = ptr >>> 0;
88
- const mem = getDataViewMemory0();
89
- const result = [];
90
- for (let i = ptr; i < ptr + 4 * len; i += 4) {
91
- result.push(wasm.__wbindgen_externrefs.get(mem.getUint32(i, true)));
350
+ /**
351
+ * Get logs by tag, like `log_kind` or `log level`.
352
+ * Tag can be `log_kind`, `log_level`.
353
+ * @param {string} tag
354
+ * @returns {any[]}
355
+ */
356
+ get_logs_by_tag(tag) {
357
+ const ptr0 = passStringToWasm0(tag, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
358
+ const len0 = WASM_VECTOR_LEN;
359
+ const ret = wasm.cedarling_get_logs_by_tag(this.__wbg_ptr, ptr0, len0);
360
+ if (ret[3]) {
361
+ throw takeFromExternrefTable0(ret[2]);
362
+ }
363
+ var v2 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
364
+ wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
365
+ return v2;
92
366
  }
93
- wasm.__externref_drop_slice(ptr, len);
94
- return result;
95
- }
96
-
97
- function getArrayU8FromWasm0(ptr, len) {
98
- ptr = ptr >>> 0;
99
- return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
100
- }
101
-
102
- let cachedDataViewMemory0 = null;
103
- function getDataViewMemory0() {
104
- if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
105
- cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
367
+ /**
368
+ * Get statistics about the data store.
369
+ *
370
+ * # Example
371
+ *
372
+ * ```javascript
373
+ * const stats = cedarling.get_stats_ctx();
374
+ * console.log(`Entries: ${stats.entry_count}/${stats.max_entries || 'unlimited'}`);
375
+ * console.log(`Capacity: ${stats.capacity_usage_percent.toFixed(2)}%`);
376
+ * console.log(`Total size: ${stats.total_size_bytes} bytes`);
377
+ * ```
378
+ * @returns {DataStoreStats}
379
+ */
380
+ get_stats_ctx() {
381
+ const ret = wasm.cedarling_get_stats_ctx(this.__wbg_ptr);
382
+ if (ret[2]) {
383
+ throw takeFromExternrefTable0(ret[1]);
384
+ }
385
+ return DataStoreStats.__wrap(ret[0]);
106
386
  }
107
- return cachedDataViewMemory0;
108
- }
109
-
110
- function getStringFromWasm0(ptr, len) {
111
- ptr = ptr >>> 0;
112
- return decodeText(ptr, len);
113
- }
114
-
115
- let cachedUint8ArrayMemory0 = null;
116
- function getUint8ArrayMemory0() {
117
- if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
118
- cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
387
+ /**
388
+ * Check whether a trusted issuer was loaded by `iss` claim.
389
+ *
390
+ * # Arguments
391
+ *
392
+ * * `iss_claim` - Issuer `iss` claim value to check.
393
+ *
394
+ * # Example
395
+ *
396
+ * ```javascript
397
+ * const ok = cedarling.is_trusted_issuer_loaded_by_iss("https://issuer.example.org");
398
+ * ```
399
+ * @param {string} iss_claim
400
+ * @returns {boolean}
401
+ */
402
+ is_trusted_issuer_loaded_by_iss(iss_claim) {
403
+ const ptr0 = passStringToWasm0(iss_claim, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
404
+ const len0 = WASM_VECTOR_LEN;
405
+ const ret = wasm.cedarling_is_trusted_issuer_loaded_by_iss(this.__wbg_ptr, ptr0, len0);
406
+ return ret !== 0;
119
407
  }
120
- return cachedUint8ArrayMemory0;
121
- }
122
-
123
- function handleError(f, args) {
124
- try {
125
- return f.apply(this, args);
126
- } catch (e) {
127
- const idx = addToExternrefTable0(e);
128
- wasm.__wbindgen_exn_store(idx);
408
+ /**
409
+ * Check whether a trusted issuer was loaded by issuer identifier.
410
+ *
411
+ * # Arguments
412
+ *
413
+ * * `issuer_id` - Trusted issuer identifier to check.
414
+ *
415
+ * # Example
416
+ *
417
+ * ```javascript
418
+ * const ok = cedarling.is_trusted_issuer_loaded_by_name("issuer_id");
419
+ * ```
420
+ * @param {string} issuer_id
421
+ * @returns {boolean}
422
+ */
423
+ is_trusted_issuer_loaded_by_name(issuer_id) {
424
+ const ptr0 = passStringToWasm0(issuer_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
425
+ const len0 = WASM_VECTOR_LEN;
426
+ const ret = wasm.cedarling_is_trusted_issuer_loaded_by_name(this.__wbg_ptr, ptr0, len0);
427
+ return ret !== 0;
428
+ }
429
+ /**
430
+ * List all entries with their metadata.
431
+ * Returns an array of DataEntry objects.
432
+ *
433
+ * # Example
434
+ *
435
+ * ```javascript
436
+ * const entries = cedarling.list_data_ctx();
437
+ * entries.forEach(entry => {
438
+ * console.log(`${entry.key}: ${entry.data_type} (accessed ${entry.access_count} times)`);
439
+ * });
440
+ * ```
441
+ * @returns {Array<any>}
442
+ */
443
+ list_data_ctx() {
444
+ const ret = wasm.cedarling_list_data_ctx(this.__wbg_ptr);
445
+ if (ret[2]) {
446
+ throw takeFromExternrefTable0(ret[1]);
447
+ }
448
+ return takeFromExternrefTable0(ret[0]);
449
+ }
450
+ /**
451
+ * Get trusted issuer identifiers loaded successfully.
452
+ *
453
+ * # Example
454
+ *
455
+ * ```javascript
456
+ * const ids = cedarling.loaded_trusted_issuer_ids();
457
+ * ```
458
+ * @returns {Array<any>}
459
+ */
460
+ loaded_trusted_issuer_ids() {
461
+ const ret = wasm.cedarling_loaded_trusted_issuer_ids(this.__wbg_ptr);
462
+ return ret;
463
+ }
464
+ /**
465
+ * Get the number of trusted issuers loaded successfully.
466
+ *
467
+ * # Example
468
+ *
469
+ * ```javascript
470
+ * const loadedCount = cedarling.loaded_trusted_issuers_count();
471
+ * ```
472
+ * @returns {number}
473
+ */
474
+ loaded_trusted_issuers_count() {
475
+ const ret = wasm.cedarling_loaded_trusted_issuers_count(this.__wbg_ptr);
476
+ return ret >>> 0;
477
+ }
478
+ /**
479
+ * Create a new instance of the Cedarling application.
480
+ * Assume that config is `Object`
481
+ * @param {object} config
482
+ * @returns {Promise<Cedarling>}
483
+ */
484
+ static new(config) {
485
+ const ret = wasm.cedarling_new(config);
486
+ return ret;
129
487
  }
130
- }
131
-
132
- function isLikeNone(x) {
133
- return x === undefined || x === null;
134
- }
135
-
136
- function makeMutClosure(arg0, arg1, dtor, f) {
137
- const state = { a: arg0, b: arg1, cnt: 1, dtor };
138
- const real = (...args) => {
139
-
140
- // First up with a closure we increment the internal reference
141
- // count. This ensures that the Rust closure environment won't
142
- // be deallocated while we're invoking it.
143
- state.cnt++;
144
- const a = state.a;
145
- state.a = 0;
146
- try {
147
- return f(a, state.b, ...args);
148
- } finally {
149
- state.a = a;
150
- real._wbg_cb_unref();
151
- }
152
- };
153
- real._wbg_cb_unref = () => {
154
- if (--state.cnt === 0) {
155
- state.dtor(state.a, state.b);
156
- state.a = 0;
157
- CLOSURE_DTORS.unregister(state);
488
+ /**
489
+ * Create a new instance of the Cedarling application.
490
+ * Assume that config is `Map`
491
+ * @param {Map<any, any>} config
492
+ * @returns {Promise<Cedarling>}
493
+ */
494
+ static new_from_map(config) {
495
+ const ret = wasm.cedarling_new_from_map(config);
496
+ return ret;
497
+ }
498
+ /**
499
+ * Get logs and remove them from the storage.
500
+ * Returns `Array` of `Map`
501
+ * @returns {Array<any>}
502
+ */
503
+ pop_logs() {
504
+ const ret = wasm.cedarling_pop_logs(this.__wbg_ptr);
505
+ if (ret[2]) {
506
+ throw takeFromExternrefTable0(ret[1]);
158
507
  }
159
- };
160
- CLOSURE_DTORS.register(real, state, state);
161
- return real;
162
- }
163
-
164
- function passStringToWasm0(arg, malloc, realloc) {
165
- if (realloc === undefined) {
166
- const buf = cachedTextEncoder.encode(arg);
167
- const ptr = malloc(buf.length, 1) >>> 0;
168
- getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
169
- WASM_VECTOR_LEN = buf.length;
170
- return ptr;
508
+ return takeFromExternrefTable0(ret[0]);
171
509
  }
172
-
173
- let len = arg.length;
174
- let ptr = malloc(len, 1) >>> 0;
175
-
176
- const mem = getUint8ArrayMemory0();
177
-
178
- let offset = 0;
179
-
180
- for (; offset < len; offset++) {
181
- const code = arg.charCodeAt(offset);
182
- if (code > 0x7F) break;
183
- mem[ptr + offset] = code;
510
+ /**
511
+ * Push a value into the data store with an optional TTL.
512
+ * If the key already exists, the value will be replaced.
513
+ * If TTL is not provided, the default TTL from configuration is used.
514
+ *
515
+ * # Arguments
516
+ *
517
+ * * `key` - A string key for the data entry (must not be empty)
518
+ * * `value` - The value to store (any JSON-serializable JavaScript value: object, array, string, number, boolean)
519
+ * * `ttl_secs` - Optional TTL in seconds (undefined/null uses default from config)
520
+ *
521
+ * # Example
522
+ *
523
+ * ```javascript
524
+ * cedarling.push_data_ctx("user:123", { name: "John", age: 30 }, 3600);
525
+ * cedarling.push_data_ctx("config", { setting: "value" }); // Uses default TTL
526
+ * ```
527
+ * @param {string} key
528
+ * @param {any} value
529
+ * @param {bigint | null} [ttl_secs]
530
+ */
531
+ push_data_ctx(key, value, ttl_secs) {
532
+ const ptr0 = passStringToWasm0(key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
533
+ const len0 = WASM_VECTOR_LEN;
534
+ const ret = wasm.cedarling_push_data_ctx(this.__wbg_ptr, ptr0, len0, value, !isLikeNone(ttl_secs), isLikeNone(ttl_secs) ? BigInt(0) : ttl_secs);
535
+ if (ret[1]) {
536
+ throw takeFromExternrefTable0(ret[0]);
537
+ }
184
538
  }
185
- if (offset !== len) {
186
- if (offset !== 0) {
187
- arg = arg.slice(offset);
539
+ /**
540
+ * Remove a value from the data store by key.
541
+ * Returns true if the key existed and was removed, false otherwise.
542
+ *
543
+ * # Arguments
544
+ *
545
+ * * `key` - A string key for the data entry to remove
546
+ *
547
+ * # Example
548
+ *
549
+ * ```javascript
550
+ * const removed = cedarling.remove_data_ctx("user:123");
551
+ * if (removed) {
552
+ * console.log("Entry was successfully removed");
553
+ * }
554
+ * ```
555
+ * @param {string} key
556
+ * @returns {boolean}
557
+ */
558
+ remove_data_ctx(key) {
559
+ const ptr0 = passStringToWasm0(key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
560
+ const len0 = WASM_VECTOR_LEN;
561
+ const ret = wasm.cedarling_remove_data_ctx(this.__wbg_ptr, ptr0, len0);
562
+ if (ret[2]) {
563
+ throw takeFromExternrefTable0(ret[1]);
188
564
  }
189
- ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
190
- const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
191
- const ret = cachedTextEncoder.encodeInto(arg, view);
192
-
193
- offset += ret.written;
194
- ptr = realloc(ptr, len, offset, 1) >>> 0;
565
+ return ret[0] !== 0;
195
566
  }
196
-
197
- WASM_VECTOR_LEN = offset;
198
- return ptr;
199
- }
200
-
201
- function takeFromExternrefTable0(idx) {
202
- const value = wasm.__wbindgen_externrefs.get(idx);
203
- wasm.__externref_table_dealloc(idx);
204
- return value;
205
- }
206
-
207
- let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
208
- cachedTextDecoder.decode();
209
- function decodeText(ptr, len) {
210
- return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
211
- }
212
-
213
- const cachedTextEncoder = new TextEncoder();
214
-
215
- if (!('encodeInto' in cachedTextEncoder)) {
216
- cachedTextEncoder.encodeInto = function (arg, view) {
217
- const buf = cachedTextEncoder.encode(arg);
218
- view.set(buf);
219
- return {
220
- read: arg.length,
221
- written: buf.length
222
- };
567
+ /**
568
+ * Closes the connections to the Lock Server and pushes all available logs.
569
+ * @returns {Promise<void>}
570
+ */
571
+ shut_down() {
572
+ const ret = wasm.cedarling_shut_down(this.__wbg_ptr);
573
+ return ret;
574
+ }
575
+ /**
576
+ * Get the total number of trusted issuer entries discovered.
577
+ *
578
+ * # Example
579
+ *
580
+ * ```javascript
581
+ * const total = cedarling.total_issuers();
582
+ * ```
583
+ * @returns {number}
584
+ */
585
+ total_issuers() {
586
+ const ret = wasm.cedarling_total_issuers(this.__wbg_ptr);
587
+ return ret >>> 0;
223
588
  }
224
589
  }
225
-
226
- let WASM_VECTOR_LEN = 0;
227
-
228
- function wasm_bindgen__convert__closures_____invoke__h7f8b71809a8d7577(arg0, arg1, arg2) {
229
- wasm.wasm_bindgen__convert__closures_____invoke__h7f8b71809a8d7577(arg0, arg1, arg2);
230
- }
231
-
232
- function wasm_bindgen__convert__closures_____invoke__h8a10b0fb25c32ce7(arg0, arg1) {
233
- wasm.wasm_bindgen__convert__closures_____invoke__h8a10b0fb25c32ce7(arg0, arg1);
234
- }
235
-
236
- function wasm_bindgen__convert__closures_____invoke__h3a7d0d99d266e2f8(arg0, arg1, arg2, arg3) {
237
- wasm.wasm_bindgen__convert__closures_____invoke__h3a7d0d99d266e2f8(arg0, arg1, arg2, arg3);
238
- }
239
-
240
- const __wbindgen_enum_RequestCache = ["default", "no-store", "reload", "no-cache", "force-cache", "only-if-cached"];
241
-
242
- const __wbindgen_enum_RequestCredentials = ["omit", "same-origin", "include"];
243
-
244
- const __wbindgen_enum_RequestMode = ["same-origin", "no-cors", "cors", "navigate"];
245
-
246
- const AuthorizeResultFinalization = (typeof FinalizationRegistry === 'undefined')
247
- ? { register: () => {}, unregister: () => {} }
248
- : new FinalizationRegistry(ptr => wasm.__wbg_authorizeresult_free(ptr >>> 0, 1));
249
-
250
- const AuthorizeResultResponseFinalization = (typeof FinalizationRegistry === 'undefined')
251
- ? { register: () => {}, unregister: () => {} }
252
- : new FinalizationRegistry(ptr => wasm.__wbg_authorizeresultresponse_free(ptr >>> 0, 1));
253
-
254
- const CedarlingFinalization = (typeof FinalizationRegistry === 'undefined')
255
- ? { register: () => {}, unregister: () => {} }
256
- : new FinalizationRegistry(ptr => wasm.__wbg_cedarling_free(ptr >>> 0, 1));
257
-
258
- const DiagnosticsFinalization = (typeof FinalizationRegistry === 'undefined')
259
- ? { register: () => {}, unregister: () => {} }
260
- : new FinalizationRegistry(ptr => wasm.__wbg_diagnostics_free(ptr >>> 0, 1));
261
-
262
- const JsJsonLogicFinalization = (typeof FinalizationRegistry === 'undefined')
263
- ? { register: () => {}, unregister: () => {} }
264
- : new FinalizationRegistry(ptr => wasm.__wbg_jsjsonlogic_free(ptr >>> 0, 1));
265
-
266
- const MultiIssuerAuthorizeResultFinalization = (typeof FinalizationRegistry === 'undefined')
267
- ? { register: () => {}, unregister: () => {} }
268
- : new FinalizationRegistry(ptr => wasm.__wbg_multiissuerauthorizeresult_free(ptr >>> 0, 1));
269
-
270
- const PolicyEvaluationErrorFinalization = (typeof FinalizationRegistry === 'undefined')
271
- ? { register: () => {}, unregister: () => {} }
272
- : new FinalizationRegistry(ptr => wasm.__wbg_policyevaluationerror_free(ptr >>> 0, 1));
590
+ if (Symbol.dispose) Cedarling.prototype[Symbol.dispose] = Cedarling.prototype.free;
591
+ exports.Cedarling = Cedarling;
273
592
 
274
593
  /**
275
- * A WASM wrapper for the Rust `cedarling::AuthorizeResult` struct.
276
- * Represents the result of an authorization request.
594
+ * A WASM wrapper for the Rust `cedarling::DataEntry` struct.
595
+ * Represents a data entry in the DataStore with value and metadata.
277
596
  */
278
- class AuthorizeResult {
597
+ class DataEntry {
279
598
  static __wrap(ptr) {
280
599
  ptr = ptr >>> 0;
281
- const obj = Object.create(AuthorizeResult.prototype);
600
+ const obj = Object.create(DataEntry.prototype);
282
601
  obj.__wbg_ptr = ptr;
283
- AuthorizeResultFinalization.register(obj, obj.__wbg_ptr, obj);
602
+ DataEntryFinalization.register(obj, obj.__wbg_ptr, obj);
284
603
  return obj;
285
604
  }
286
605
  __destroy_into_raw() {
287
606
  const ptr = this.__wbg_ptr;
288
607
  this.__wbg_ptr = 0;
289
- AuthorizeResultFinalization.unregister(this);
608
+ DataEntryFinalization.unregister(this);
290
609
  return ptr;
291
610
  }
292
611
  free() {
293
612
  const ptr = this.__destroy_into_raw();
294
- wasm.__wbg_authorizeresult_free(ptr, 0);
295
- }
296
- /**
297
- * Result of authorization where principal is `Jans::Workload`
298
- * @returns {AuthorizeResultResponse | undefined}
299
- */
300
- get workload() {
301
- const ret = wasm.__wbg_get_authorizeresult_workload(this.__wbg_ptr);
302
- return ret === 0 ? undefined : AuthorizeResultResponse.__wrap(ret);
613
+ wasm.__wbg_dataentry_free(ptr, 0);
303
614
  }
304
615
  /**
305
- * Result of authorization where principal is `Jans::Workload`
306
- * @param {AuthorizeResultResponse | null} [arg0]
616
+ * Convert `DataEntry` to json string value
617
+ * @returns {string}
307
618
  */
308
- set workload(arg0) {
309
- let ptr0 = 0;
310
- if (!isLikeNone(arg0)) {
311
- _assertClass(arg0, AuthorizeResultResponse);
312
- ptr0 = arg0.__destroy_into_raw();
619
+ json_string() {
620
+ let deferred1_0;
621
+ let deferred1_1;
622
+ try {
623
+ const ret = wasm.dataentry_json_string(this.__wbg_ptr);
624
+ deferred1_0 = ret[0];
625
+ deferred1_1 = ret[1];
626
+ return getStringFromWasm0(ret[0], ret[1]);
627
+ } finally {
628
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
313
629
  }
314
- wasm.__wbg_set_authorizeresult_workload(this.__wbg_ptr, ptr0);
315
- }
316
- /**
317
- * Result of authorization where principal is `Jans::User`
318
- * @returns {AuthorizeResultResponse | undefined}
319
- */
320
- get person() {
321
- const ret = wasm.__wbg_get_authorizeresult_person(this.__wbg_ptr);
322
- return ret === 0 ? undefined : AuthorizeResultResponse.__wrap(ret);
323
630
  }
324
631
  /**
325
- * Result of authorization where principal is `Jans::User`
326
- * @param {AuthorizeResultResponse | null} [arg0]
632
+ * Get the value stored in this entry as a JavaScript object
633
+ * @returns {any}
327
634
  */
328
- set person(arg0) {
329
- let ptr0 = 0;
330
- if (!isLikeNone(arg0)) {
331
- _assertClass(arg0, AuthorizeResultResponse);
332
- ptr0 = arg0.__destroy_into_raw();
635
+ value() {
636
+ const ret = wasm.dataentry_value(this.__wbg_ptr);
637
+ if (ret[2]) {
638
+ throw takeFromExternrefTable0(ret[1]);
333
639
  }
334
- wasm.__wbg_set_authorizeresult_person(this.__wbg_ptr, ptr0);
640
+ return takeFromExternrefTable0(ret[0]);
335
641
  }
336
642
  /**
337
- * Result of authorization
338
- * true means `ALLOW`
339
- * false means `Deny`
340
- *
341
- * this field is [`bool`] type to be compatible with [authzen Access Evaluation Decision](https://openid.github.io/authzen/#section-6.2.1).
342
- * @returns {boolean}
643
+ * Number of times this entry has been accessed
644
+ * @returns {bigint}
343
645
  */
344
- get decision() {
345
- const ret = wasm.__wbg_get_authorizeresult_decision(this.__wbg_ptr);
346
- return ret !== 0;
646
+ get access_count() {
647
+ const ret = wasm.__wbg_get_dataentry_access_count(this.__wbg_ptr);
648
+ return BigInt.asUintN(64, ret);
347
649
  }
348
650
  /**
349
- * Result of authorization
350
- * true means `ALLOW`
351
- * false means `Deny`
352
- *
353
- * this field is [`bool`] type to be compatible with [authzen Access Evaluation Decision](https://openid.github.io/authzen/#section-6.2.1).
354
- * @param {boolean} arg0
651
+ * Timestamp when this entry was created (RFC 3339 format)
652
+ * @returns {string}
355
653
  */
356
- set decision(arg0) {
357
- wasm.__wbg_set_authorizeresult_decision(this.__wbg_ptr, arg0);
654
+ get created_at() {
655
+ let deferred1_0;
656
+ let deferred1_1;
657
+ try {
658
+ const ret = wasm.__wbg_get_dataentry_created_at(this.__wbg_ptr);
659
+ deferred1_0 = ret[0];
660
+ deferred1_1 = ret[1];
661
+ return getStringFromWasm0(ret[0], ret[1]);
662
+ } finally {
663
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
664
+ }
358
665
  }
359
666
  /**
360
- * Request ID of the authorization request
667
+ * The inferred Cedar type of the value
361
668
  * @returns {string}
362
669
  */
363
- get request_id() {
670
+ get data_type() {
364
671
  let deferred1_0;
365
672
  let deferred1_1;
366
673
  try {
367
- const ret = wasm.__wbg_get_authorizeresult_request_id(this.__wbg_ptr);
674
+ const ret = wasm.__wbg_get_dataentry_data_type(this.__wbg_ptr);
368
675
  deferred1_0 = ret[0];
369
676
  deferred1_1 = ret[1];
370
677
  return getStringFromWasm0(ret[0], ret[1]);
@@ -373,23 +680,27 @@ class AuthorizeResult {
373
680
  }
374
681
  }
375
682
  /**
376
- * Request ID of the authorization request
377
- * @param {string} arg0
683
+ * Timestamp when this entry expires (RFC 3339 format), or null if no TTL
684
+ * @returns {string | undefined}
378
685
  */
379
- set request_id(arg0) {
380
- const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
381
- const len0 = WASM_VECTOR_LEN;
382
- wasm.__wbg_set_authorizeresult_request_id(this.__wbg_ptr, ptr0, len0);
686
+ get expires_at() {
687
+ const ret = wasm.__wbg_get_dataentry_expires_at(this.__wbg_ptr);
688
+ let v1;
689
+ if (ret[0] !== 0) {
690
+ v1 = getStringFromWasm0(ret[0], ret[1]).slice();
691
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
692
+ }
693
+ return v1;
383
694
  }
384
695
  /**
385
- * Convert `AuthorizeResult` to json string value
696
+ * The key for this entry
386
697
  * @returns {string}
387
698
  */
388
- json_string() {
699
+ get key() {
389
700
  let deferred1_0;
390
701
  let deferred1_1;
391
702
  try {
392
- const ret = wasm.authorizeresult_json_string(this.__wbg_ptr);
703
+ const ret = wasm.__wbg_get_dataentry_key(this.__wbg_ptr);
393
704
  deferred1_0 = ret[0];
394
705
  deferred1_1 = ret[1];
395
706
  return getStringFromWasm0(ret[0], ret[1]);
@@ -398,234 +709,228 @@ class AuthorizeResult {
398
709
  }
399
710
  }
400
711
  /**
401
- * @param {string} principal
402
- * @returns {AuthorizeResultResponse | undefined}
712
+ * Number of times this entry has been accessed
713
+ * @param {bigint} arg0
714
+ */
715
+ set access_count(arg0) {
716
+ wasm.__wbg_set_dataentry_access_count(this.__wbg_ptr, arg0);
717
+ }
718
+ /**
719
+ * Timestamp when this entry was created (RFC 3339 format)
720
+ * @param {string} arg0
721
+ */
722
+ set created_at(arg0) {
723
+ const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
724
+ const len0 = WASM_VECTOR_LEN;
725
+ wasm.__wbg_set_dataentry_created_at(this.__wbg_ptr, ptr0, len0);
726
+ }
727
+ /**
728
+ * The inferred Cedar type of the value
729
+ * @param {string} arg0
730
+ */
731
+ set data_type(arg0) {
732
+ const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
733
+ const len0 = WASM_VECTOR_LEN;
734
+ wasm.__wbg_set_dataentry_data_type(this.__wbg_ptr, ptr0, len0);
735
+ }
736
+ /**
737
+ * Timestamp when this entry expires (RFC 3339 format), or null if no TTL
738
+ * @param {string | null} [arg0]
739
+ */
740
+ set expires_at(arg0) {
741
+ var ptr0 = isLikeNone(arg0) ? 0 : passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
742
+ var len0 = WASM_VECTOR_LEN;
743
+ wasm.__wbg_set_dataentry_expires_at(this.__wbg_ptr, ptr0, len0);
744
+ }
745
+ /**
746
+ * The key for this entry
747
+ * @param {string} arg0
403
748
  */
404
- principal(principal) {
405
- const ptr0 = passStringToWasm0(principal, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
749
+ set key(arg0) {
750
+ const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
406
751
  const len0 = WASM_VECTOR_LEN;
407
- const ret = wasm.authorizeresult_principal(this.__wbg_ptr, ptr0, len0);
408
- return ret === 0 ? undefined : AuthorizeResultResponse.__wrap(ret);
752
+ wasm.__wbg_set_dataentry_key(this.__wbg_ptr, ptr0, len0);
409
753
  }
410
754
  }
411
- if (Symbol.dispose) AuthorizeResult.prototype[Symbol.dispose] = AuthorizeResult.prototype.free;
412
- exports.AuthorizeResult = AuthorizeResult;
755
+ if (Symbol.dispose) DataEntry.prototype[Symbol.dispose] = DataEntry.prototype.free;
756
+ exports.DataEntry = DataEntry;
413
757
 
414
758
  /**
415
- * A WASM wrapper for the Rust `cedar_policy::Response` struct.
416
- * Represents the result of an authorization request.
759
+ * A WASM wrapper for the Rust `cedarling::DataStoreStats` struct.
760
+ * Statistics about the DataStore.
417
761
  */
418
- class AuthorizeResultResponse {
762
+ class DataStoreStats {
419
763
  static __wrap(ptr) {
420
764
  ptr = ptr >>> 0;
421
- const obj = Object.create(AuthorizeResultResponse.prototype);
765
+ const obj = Object.create(DataStoreStats.prototype);
422
766
  obj.__wbg_ptr = ptr;
423
- AuthorizeResultResponseFinalization.register(obj, obj.__wbg_ptr, obj);
767
+ DataStoreStatsFinalization.register(obj, obj.__wbg_ptr, obj);
424
768
  return obj;
425
769
  }
426
770
  __destroy_into_raw() {
427
771
  const ptr = this.__wbg_ptr;
428
772
  this.__wbg_ptr = 0;
429
- AuthorizeResultResponseFinalization.unregister(this);
773
+ DataStoreStatsFinalization.unregister(this);
430
774
  return ptr;
431
775
  }
432
776
  free() {
433
777
  const ptr = this.__destroy_into_raw();
434
- wasm.__wbg_authorizeresultresponse_free(ptr, 0);
778
+ wasm.__wbg_datastorestats_free(ptr, 0);
435
779
  }
436
780
  /**
437
- * Authorization decision
438
- * @returns {boolean}
781
+ * Convert `DataStoreStats` to json string value
782
+ * @returns {string}
439
783
  */
440
- get decision() {
441
- const ret = wasm.authorizeresultresponse_decision(this.__wbg_ptr);
442
- return ret !== 0;
784
+ json_string() {
785
+ let deferred1_0;
786
+ let deferred1_1;
787
+ try {
788
+ const ret = wasm.datastorestats_json_string(this.__wbg_ptr);
789
+ deferred1_0 = ret[0];
790
+ deferred1_1 = ret[1];
791
+ return getStringFromWasm0(ret[0], ret[1]);
792
+ } finally {
793
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
794
+ }
443
795
  }
444
796
  /**
445
- * Diagnostics providing more information on how this decision was reached
446
- * @returns {Diagnostics}
797
+ * Average size per entry in bytes (0 if no entries)
798
+ * @returns {number}
447
799
  */
448
- get diagnostics() {
449
- const ret = wasm.authorizeresultresponse_diagnostics(this.__wbg_ptr);
450
- return Diagnostics.__wrap(ret);
800
+ get avg_entry_size_bytes() {
801
+ const ret = wasm.__wbg_get_datastorestats_avg_entry_size_bytes(this.__wbg_ptr);
802
+ return ret >>> 0;
451
803
  }
452
- }
453
- if (Symbol.dispose) AuthorizeResultResponse.prototype[Symbol.dispose] = AuthorizeResultResponse.prototype.free;
454
- exports.AuthorizeResultResponse = AuthorizeResultResponse;
455
-
456
- /**
457
- * The instance of the Cedarling application.
458
- */
459
- class Cedarling {
460
- static __wrap(ptr) {
461
- ptr = ptr >>> 0;
462
- const obj = Object.create(Cedarling.prototype);
463
- obj.__wbg_ptr = ptr;
464
- CedarlingFinalization.register(obj, obj.__wbg_ptr, obj);
465
- return obj;
804
+ /**
805
+ * Percentage of capacity used (0.0-100.0, based on entry count)
806
+ * @returns {number}
807
+ */
808
+ get capacity_usage_percent() {
809
+ const ret = wasm.__wbg_get_datastorestats_capacity_usage_percent(this.__wbg_ptr);
810
+ return ret;
466
811
  }
467
- __destroy_into_raw() {
468
- const ptr = this.__wbg_ptr;
469
- this.__wbg_ptr = 0;
470
- CedarlingFinalization.unregister(this);
471
- return ptr;
812
+ /**
813
+ * Number of entries currently stored
814
+ * @returns {number}
815
+ */
816
+ get entry_count() {
817
+ const ret = wasm.__wbg_get_datastorestats_entry_count(this.__wbg_ptr);
818
+ return ret >>> 0;
472
819
  }
473
- free() {
474
- const ptr = this.__destroy_into_raw();
475
- wasm.__wbg_cedarling_free(ptr, 0);
820
+ /**
821
+ * Maximum number of entries allowed (0 = unlimited)
822
+ * @returns {number}
823
+ */
824
+ get max_entries() {
825
+ const ret = wasm.__wbg_get_datastorestats_max_entries(this.__wbg_ptr);
826
+ return ret >>> 0;
476
827
  }
477
828
  /**
478
- * Create a new instance of the Cedarling application.
479
- * Assume that config is `Object`
480
- * @param {object} config
481
- * @returns {Promise<Cedarling>}
829
+ * Maximum size per entry in bytes (0 = unlimited)
830
+ * @returns {number}
482
831
  */
483
- static new(config) {
484
- const ret = wasm.cedarling_new(config);
485
- return ret;
832
+ get max_entry_size() {
833
+ const ret = wasm.__wbg_get_datastorestats_max_entry_size(this.__wbg_ptr);
834
+ return ret >>> 0;
486
835
  }
487
836
  /**
488
- * Create a new instance of the Cedarling application.
489
- * Assume that config is `Map`
490
- * @param {Map<any, any>} config
491
- * @returns {Promise<Cedarling>}
837
+ * Memory usage threshold percentage (from config)
838
+ * @returns {number}
492
839
  */
493
- static new_from_map(config) {
494
- const ret = wasm.cedarling_new_from_map(config);
840
+ get memory_alert_threshold() {
841
+ const ret = wasm.__wbg_get_datastorestats_memory_alert_threshold(this.__wbg_ptr);
495
842
  return ret;
496
843
  }
497
844
  /**
498
- * Authorize request
499
- * makes authorization decision based on the [`Request`]
500
- * @param {any} request
501
- * @returns {Promise<AuthorizeResult>}
845
+ * Whether memory usage exceeds the alert threshold
846
+ * @returns {boolean}
502
847
  */
503
- authorize(request) {
504
- const ret = wasm.cedarling_authorize(this.__wbg_ptr, request);
505
- return ret;
848
+ get memory_alert_triggered() {
849
+ const ret = wasm.__wbg_get_datastorestats_memory_alert_triggered(this.__wbg_ptr);
850
+ return ret !== 0;
506
851
  }
507
852
  /**
508
- * Authorize request for unsigned principals.
509
- * makes authorization decision based on the [`RequestUnsigned`]
510
- * @param {any} request
511
- * @returns {Promise<AuthorizeResult>}
853
+ * Whether metrics tracking is enabled
854
+ * @returns {boolean}
512
855
  */
513
- authorize_unsigned(request) {
514
- const ret = wasm.cedarling_authorize_unsigned(this.__wbg_ptr, request);
515
- return ret;
856
+ get metrics_enabled() {
857
+ const ret = wasm.__wbg_get_datastorestats_metrics_enabled(this.__wbg_ptr);
858
+ return ret !== 0;
516
859
  }
517
860
  /**
518
- * Authorize multi-issuer request.
519
- * Makes authorization decision based on multiple JWT tokens from different issuers
520
- * @param {any} request
521
- * @returns {Promise<MultiIssuerAuthorizeResult>}
861
+ * Total size of all entries in bytes (approximate, based on JSON serialization)
862
+ * @returns {number}
522
863
  */
523
- authorize_multi_issuer(request) {
524
- const ret = wasm.cedarling_authorize_multi_issuer(this.__wbg_ptr, request);
525
- return ret;
864
+ get total_size_bytes() {
865
+ const ret = wasm.__wbg_get_datastorestats_total_size_bytes(this.__wbg_ptr);
866
+ return ret >>> 0;
526
867
  }
527
868
  /**
528
- * Get logs and remove them from the storage.
529
- * Returns `Array` of `Map`
530
- * @returns {Array<any>}
869
+ * Average size per entry in bytes (0 if no entries)
870
+ * @param {number} arg0
531
871
  */
532
- pop_logs() {
533
- const ret = wasm.cedarling_pop_logs(this.__wbg_ptr);
534
- if (ret[2]) {
535
- throw takeFromExternrefTable0(ret[1]);
536
- }
537
- return takeFromExternrefTable0(ret[0]);
872
+ set avg_entry_size_bytes(arg0) {
873
+ wasm.__wbg_set_datastorestats_avg_entry_size_bytes(this.__wbg_ptr, arg0);
538
874
  }
539
875
  /**
540
- * Get specific log entry.
541
- * Returns `Map` with values or `null`.
542
- * @param {string} id
543
- * @returns {any}
876
+ * Percentage of capacity used (0.0-100.0, based on entry count)
877
+ * @param {number} arg0
544
878
  */
545
- get_log_by_id(id) {
546
- const ptr0 = passStringToWasm0(id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
547
- const len0 = WASM_VECTOR_LEN;
548
- const ret = wasm.cedarling_get_log_by_id(this.__wbg_ptr, ptr0, len0);
549
- if (ret[2]) {
550
- throw takeFromExternrefTable0(ret[1]);
551
- }
552
- return takeFromExternrefTable0(ret[0]);
879
+ set capacity_usage_percent(arg0) {
880
+ wasm.__wbg_set_datastorestats_capacity_usage_percent(this.__wbg_ptr, arg0);
553
881
  }
554
882
  /**
555
- * Returns a list of all log ids.
556
- * Returns `Array` of `String`
557
- * @returns {Array<any>}
883
+ * Number of entries currently stored
884
+ * @param {number} arg0
558
885
  */
559
- get_log_ids() {
560
- const ret = wasm.cedarling_get_log_ids(this.__wbg_ptr);
561
- return ret;
886
+ set entry_count(arg0) {
887
+ wasm.__wbg_set_datastorestats_entry_count(this.__wbg_ptr, arg0);
562
888
  }
563
889
  /**
564
- * Get logs by tag, like `log_kind` or `log level`.
565
- * Tag can be `log_kind`, `log_level`.
566
- * @param {string} tag
567
- * @returns {any[]}
890
+ * Maximum number of entries allowed (0 = unlimited)
891
+ * @param {number} arg0
568
892
  */
569
- get_logs_by_tag(tag) {
570
- const ptr0 = passStringToWasm0(tag, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
571
- const len0 = WASM_VECTOR_LEN;
572
- const ret = wasm.cedarling_get_logs_by_tag(this.__wbg_ptr, ptr0, len0);
573
- if (ret[3]) {
574
- throw takeFromExternrefTable0(ret[2]);
575
- }
576
- var v2 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
577
- wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
578
- return v2;
893
+ set max_entries(arg0) {
894
+ wasm.__wbg_set_datastorestats_max_entries(this.__wbg_ptr, arg0);
579
895
  }
580
896
  /**
581
- * Get logs by request_id.
582
- * Return log entries that match the given request_id.
583
- * @param {string} request_id
584
- * @returns {any[]}
897
+ * Maximum size per entry in bytes (0 = unlimited)
898
+ * @param {number} arg0
585
899
  */
586
- get_logs_by_request_id(request_id) {
587
- const ptr0 = passStringToWasm0(request_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
588
- const len0 = WASM_VECTOR_LEN;
589
- const ret = wasm.cedarling_get_logs_by_request_id(this.__wbg_ptr, ptr0, len0);
590
- if (ret[3]) {
591
- throw takeFromExternrefTable0(ret[2]);
592
- }
593
- var v2 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
594
- wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
595
- return v2;
900
+ set max_entry_size(arg0) {
901
+ wasm.__wbg_set_datastorestats_max_entry_size(this.__wbg_ptr, arg0);
596
902
  }
597
903
  /**
598
- * Get log by request_id and tag, like composite key `request_id` + `log_kind`.
599
- * Tag can be `log_kind`, `log_level`.
600
- * Return log entries that match the given request_id and tag.
601
- * @param {string} request_id
602
- * @param {string} tag
603
- * @returns {any[]}
904
+ * Memory usage threshold percentage (from config)
905
+ * @param {number} arg0
604
906
  */
605
- get_logs_by_request_id_and_tag(request_id, tag) {
606
- const ptr0 = passStringToWasm0(request_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
607
- const len0 = WASM_VECTOR_LEN;
608
- const ptr1 = passStringToWasm0(tag, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
609
- const len1 = WASM_VECTOR_LEN;
610
- const ret = wasm.cedarling_get_logs_by_request_id_and_tag(this.__wbg_ptr, ptr0, len0, ptr1, len1);
611
- if (ret[3]) {
612
- throw takeFromExternrefTable0(ret[2]);
613
- }
614
- var v3 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
615
- wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
616
- return v3;
907
+ set memory_alert_threshold(arg0) {
908
+ wasm.__wbg_set_datastorestats_memory_alert_threshold(this.__wbg_ptr, arg0);
617
909
  }
618
910
  /**
619
- * Closes the connections to the Lock Server and pushes all available logs.
620
- * @returns {Promise<void>}
911
+ * Whether memory usage exceeds the alert threshold
912
+ * @param {boolean} arg0
621
913
  */
622
- shut_down() {
623
- const ret = wasm.cedarling_shut_down(this.__wbg_ptr);
624
- return ret;
914
+ set memory_alert_triggered(arg0) {
915
+ wasm.__wbg_set_datastorestats_memory_alert_triggered(this.__wbg_ptr, arg0);
916
+ }
917
+ /**
918
+ * Whether metrics tracking is enabled
919
+ * @param {boolean} arg0
920
+ */
921
+ set metrics_enabled(arg0) {
922
+ wasm.__wbg_set_datastorestats_metrics_enabled(this.__wbg_ptr, arg0);
923
+ }
924
+ /**
925
+ * Total size of all entries in bytes (approximate, based on JSON serialization)
926
+ * @param {number} arg0
927
+ */
928
+ set total_size_bytes(arg0) {
929
+ wasm.__wbg_set_datastorestats_total_size_bytes(this.__wbg_ptr, arg0);
625
930
  }
626
931
  }
627
- if (Symbol.dispose) Cedarling.prototype[Symbol.dispose] = Cedarling.prototype.free;
628
- exports.Cedarling = Cedarling;
932
+ if (Symbol.dispose) DataStoreStats.prototype[Symbol.dispose] = DataStoreStats.prototype.free;
933
+ exports.DataStoreStats = DataStoreStats;
629
934
 
630
935
  /**
631
936
  * Diagnostics
@@ -651,6 +956,17 @@ class Diagnostics {
651
956
  const ptr = this.__destroy_into_raw();
652
957
  wasm.__wbg_diagnostics_free(ptr, 0);
653
958
  }
959
+ /**
960
+ * Errors that occurred during authorization. The errors should be
961
+ * treated as unordered, since policies may be evaluated in any order.
962
+ * @returns {PolicyEvaluationError[]}
963
+ */
964
+ get errors() {
965
+ const ret = wasm.diagnostics_errors(this.__wbg_ptr);
966
+ var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
967
+ wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
968
+ return v1;
969
+ }
654
970
  /**
655
971
  * `PolicyId`s of the policies that contributed to the decision.
656
972
  * If no policies applied to the request, this set will be empty.
@@ -664,53 +980,123 @@ class Diagnostics {
664
980
  wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
665
981
  return v1;
666
982
  }
983
+ }
984
+ if (Symbol.dispose) Diagnostics.prototype[Symbol.dispose] = Diagnostics.prototype.free;
985
+ exports.Diagnostics = Diagnostics;
986
+
987
+ class IntoUnderlyingByteSource {
988
+ __destroy_into_raw() {
989
+ const ptr = this.__wbg_ptr;
990
+ this.__wbg_ptr = 0;
991
+ IntoUnderlyingByteSourceFinalization.unregister(this);
992
+ return ptr;
993
+ }
994
+ free() {
995
+ const ptr = this.__destroy_into_raw();
996
+ wasm.__wbg_intounderlyingbytesource_free(ptr, 0);
997
+ }
667
998
  /**
668
- * Errors that occurred during authorization. The errors should be
669
- * treated as unordered, since policies may be evaluated in any order.
670
- * @returns {PolicyEvaluationError[]}
999
+ * @returns {number}
671
1000
  */
672
- get errors() {
673
- const ret = wasm.diagnostics_errors(this.__wbg_ptr);
674
- var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
675
- wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
676
- return v1;
1001
+ get autoAllocateChunkSize() {
1002
+ const ret = wasm.intounderlyingbytesource_autoAllocateChunkSize(this.__wbg_ptr);
1003
+ return ret >>> 0;
1004
+ }
1005
+ cancel() {
1006
+ const ptr = this.__destroy_into_raw();
1007
+ wasm.intounderlyingbytesource_cancel(ptr);
1008
+ }
1009
+ /**
1010
+ * @param {ReadableByteStreamController} controller
1011
+ * @returns {Promise<any>}
1012
+ */
1013
+ pull(controller) {
1014
+ const ret = wasm.intounderlyingbytesource_pull(this.__wbg_ptr, controller);
1015
+ return ret;
1016
+ }
1017
+ /**
1018
+ * @param {ReadableByteStreamController} controller
1019
+ */
1020
+ start(controller) {
1021
+ wasm.intounderlyingbytesource_start(this.__wbg_ptr, controller);
1022
+ }
1023
+ /**
1024
+ * @returns {ReadableStreamType}
1025
+ */
1026
+ get type() {
1027
+ const ret = wasm.intounderlyingbytesource_type(this.__wbg_ptr);
1028
+ return __wbindgen_enum_ReadableStreamType[ret];
1029
+ }
1030
+ }
1031
+ if (Symbol.dispose) IntoUnderlyingByteSource.prototype[Symbol.dispose] = IntoUnderlyingByteSource.prototype.free;
1032
+ exports.IntoUnderlyingByteSource = IntoUnderlyingByteSource;
1033
+
1034
+ class IntoUnderlyingSink {
1035
+ __destroy_into_raw() {
1036
+ const ptr = this.__wbg_ptr;
1037
+ this.__wbg_ptr = 0;
1038
+ IntoUnderlyingSinkFinalization.unregister(this);
1039
+ return ptr;
1040
+ }
1041
+ free() {
1042
+ const ptr = this.__destroy_into_raw();
1043
+ wasm.__wbg_intounderlyingsink_free(ptr, 0);
1044
+ }
1045
+ /**
1046
+ * @param {any} reason
1047
+ * @returns {Promise<any>}
1048
+ */
1049
+ abort(reason) {
1050
+ const ptr = this.__destroy_into_raw();
1051
+ const ret = wasm.intounderlyingsink_abort(ptr, reason);
1052
+ return ret;
1053
+ }
1054
+ /**
1055
+ * @returns {Promise<any>}
1056
+ */
1057
+ close() {
1058
+ const ptr = this.__destroy_into_raw();
1059
+ const ret = wasm.intounderlyingsink_close(ptr);
1060
+ return ret;
1061
+ }
1062
+ /**
1063
+ * @param {any} chunk
1064
+ * @returns {Promise<any>}
1065
+ */
1066
+ write(chunk) {
1067
+ const ret = wasm.intounderlyingsink_write(this.__wbg_ptr, chunk);
1068
+ return ret;
677
1069
  }
678
1070
  }
679
- if (Symbol.dispose) Diagnostics.prototype[Symbol.dispose] = Diagnostics.prototype.free;
680
- exports.Diagnostics = Diagnostics;
1071
+ if (Symbol.dispose) IntoUnderlyingSink.prototype[Symbol.dispose] = IntoUnderlyingSink.prototype.free;
1072
+ exports.IntoUnderlyingSink = IntoUnderlyingSink;
681
1073
 
682
- class JsJsonLogic {
1074
+ class IntoUnderlyingSource {
683
1075
  __destroy_into_raw() {
684
1076
  const ptr = this.__wbg_ptr;
685
1077
  this.__wbg_ptr = 0;
686
- JsJsonLogicFinalization.unregister(this);
1078
+ IntoUnderlyingSourceFinalization.unregister(this);
687
1079
  return ptr;
688
1080
  }
689
1081
  free() {
690
1082
  const ptr = this.__destroy_into_raw();
691
- wasm.__wbg_jsjsonlogic_free(ptr, 0);
1083
+ wasm.__wbg_intounderlyingsource_free(ptr, 0);
692
1084
  }
693
- constructor() {
694
- const ret = wasm.jsjsonlogic_new();
695
- this.__wbg_ptr = ret >>> 0;
696
- JsJsonLogicFinalization.register(this, this.__wbg_ptr, this);
697
- return this;
1085
+ cancel() {
1086
+ const ptr = this.__destroy_into_raw();
1087
+ wasm.intounderlyingsource_cancel(ptr);
698
1088
  }
699
1089
  /**
700
- * @param {any} logic
701
- * @param {any} data
702
- * @returns {any}
1090
+ * @param {ReadableStreamDefaultController} controller
1091
+ * @returns {Promise<any>}
703
1092
  */
704
- apply(logic, data) {
705
- const ret = wasm.jsjsonlogic_apply(this.__wbg_ptr, logic, data);
706
- if (ret[2]) {
707
- throw takeFromExternrefTable0(ret[1]);
708
- }
709
- return takeFromExternrefTable0(ret[0]);
1093
+ pull(controller) {
1094
+ const ret = wasm.intounderlyingsource_pull(this.__wbg_ptr, controller);
1095
+ return ret;
710
1096
  }
711
1097
  }
712
- if (Symbol.dispose) JsJsonLogic.prototype[Symbol.dispose] = JsJsonLogic.prototype.free;
713
- exports.JsJsonLogic = JsJsonLogic;
1098
+ if (Symbol.dispose) IntoUnderlyingSource.prototype[Symbol.dispose] = IntoUnderlyingSource.prototype.free;
1099
+ exports.IntoUnderlyingSource = IntoUnderlyingSource;
714
1100
 
715
1101
  /**
716
1102
  * A WASM wrapper for the Rust `cedarling::MultiIssuerAuthorizeResult` struct.
@@ -734,23 +1120,6 @@ class MultiIssuerAuthorizeResult {
734
1120
  const ptr = this.__destroy_into_raw();
735
1121
  wasm.__wbg_multiissuerauthorizeresult_free(ptr, 0);
736
1122
  }
737
- /**
738
- * Result of Cedar policy authorization
739
- * @returns {AuthorizeResultResponse}
740
- */
741
- get response() {
742
- const ret = wasm.__wbg_get_multiissuerauthorizeresult_response(this.__wbg_ptr);
743
- return AuthorizeResultResponse.__wrap(ret);
744
- }
745
- /**
746
- * Result of Cedar policy authorization
747
- * @param {AuthorizeResultResponse} arg0
748
- */
749
- set response(arg0) {
750
- _assertClass(arg0, AuthorizeResultResponse);
751
- var ptr0 = arg0.__destroy_into_raw();
752
- wasm.__wbg_set_multiissuerauthorizeresult_response(this.__wbg_ptr, ptr0);
753
- }
754
1123
  /**
755
1124
  * Result of authorization
756
1125
  * true means `ALLOW`
@@ -761,15 +1130,6 @@ class MultiIssuerAuthorizeResult {
761
1130
  const ret = wasm.__wbg_get_multiissuerauthorizeresult_decision(this.__wbg_ptr);
762
1131
  return ret !== 0;
763
1132
  }
764
- /**
765
- * Result of authorization
766
- * true means `ALLOW`
767
- * false means `Deny`
768
- * @param {boolean} arg0
769
- */
770
- set decision(arg0) {
771
- wasm.__wbg_set_multiissuerauthorizeresult_decision(this.__wbg_ptr, arg0);
772
- }
773
1133
  /**
774
1134
  * Request ID of the authorization request
775
1135
  * @returns {string}
@@ -787,13 +1147,12 @@ class MultiIssuerAuthorizeResult {
787
1147
  }
788
1148
  }
789
1149
  /**
790
- * Request ID of the authorization request
791
- * @param {string} arg0
1150
+ * Result of Cedar policy authorization
1151
+ * @returns {AuthorizeResultResponse}
792
1152
  */
793
- set request_id(arg0) {
794
- const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
795
- const len0 = WASM_VECTOR_LEN;
796
- wasm.__wbg_set_multiissuerauthorizeresult_request_id(this.__wbg_ptr, ptr0, len0);
1153
+ get response() {
1154
+ const ret = wasm.__wbg_get_multiissuerauthorizeresult_response(this.__wbg_ptr);
1155
+ return AuthorizeResultResponse.__wrap(ret);
797
1156
  }
798
1157
  /**
799
1158
  * Convert `MultiIssuerAuthorizeResult` to json string value
@@ -811,6 +1170,33 @@ class MultiIssuerAuthorizeResult {
811
1170
  wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
812
1171
  }
813
1172
  }
1173
+ /**
1174
+ * Result of authorization
1175
+ * true means `ALLOW`
1176
+ * false means `Deny`
1177
+ * @param {boolean} arg0
1178
+ */
1179
+ set decision(arg0) {
1180
+ wasm.__wbg_set_multiissuerauthorizeresult_decision(this.__wbg_ptr, arg0);
1181
+ }
1182
+ /**
1183
+ * Request ID of the authorization request
1184
+ * @param {string} arg0
1185
+ */
1186
+ set request_id(arg0) {
1187
+ const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1188
+ const len0 = WASM_VECTOR_LEN;
1189
+ wasm.__wbg_set_multiissuerauthorizeresult_request_id(this.__wbg_ptr, ptr0, len0);
1190
+ }
1191
+ /**
1192
+ * Result of Cedar policy authorization
1193
+ * @param {AuthorizeResultResponse} arg0
1194
+ */
1195
+ set response(arg0) {
1196
+ _assertClass(arg0, AuthorizeResultResponse);
1197
+ var ptr0 = arg0.__destroy_into_raw();
1198
+ wasm.__wbg_set_multiissuerauthorizeresult_response(this.__wbg_ptr, ptr0);
1199
+ }
814
1200
  }
815
1201
  if (Symbol.dispose) MultiIssuerAuthorizeResult.prototype[Symbol.dispose] = MultiIssuerAuthorizeResult.prototype.free;
816
1202
  exports.MultiIssuerAuthorizeResult = MultiIssuerAuthorizeResult;
@@ -840,14 +1226,14 @@ class PolicyEvaluationError {
840
1226
  wasm.__wbg_policyevaluationerror_free(ptr, 0);
841
1227
  }
842
1228
  /**
843
- * Id of the policy with an error
1229
+ * Underlying evaluation error string representation
844
1230
  * @returns {string}
845
1231
  */
846
- get id() {
1232
+ get error() {
847
1233
  let deferred1_0;
848
1234
  let deferred1_1;
849
1235
  try {
850
- const ret = wasm.policyevaluationerror_id(this.__wbg_ptr);
1236
+ const ret = wasm.policyevaluationerror_error(this.__wbg_ptr);
851
1237
  deferred1_0 = ret[0];
852
1238
  deferred1_1 = ret[1];
853
1239
  return getStringFromWasm0(ret[0], ret[1]);
@@ -856,14 +1242,14 @@ class PolicyEvaluationError {
856
1242
  }
857
1243
  }
858
1244
  /**
859
- * Underlying evaluation error string representation
1245
+ * Id of the policy with an error
860
1246
  * @returns {string}
861
1247
  */
862
- get error() {
1248
+ get id() {
863
1249
  let deferred1_0;
864
1250
  let deferred1_1;
865
1251
  try {
866
- const ret = wasm.policyevaluationerror_error(this.__wbg_ptr);
1252
+ const ret = wasm.policyevaluationerror_id(this.__wbg_ptr);
867
1253
  deferred1_0 = ret[0];
868
1254
  deferred1_1 = ret[1];
869
1255
  return getStringFromWasm0(ret[0], ret[1]);
@@ -887,669 +1273,1011 @@ function init(config) {
887
1273
  }
888
1274
  exports.init = init;
889
1275
 
890
- exports.__wbg_Error_52673b7de5a0ca89 = function(arg0, arg1) {
891
- const ret = Error(getStringFromWasm0(arg0, arg1));
892
- return ret;
893
- };
894
-
895
- exports.__wbg_Number_2d1dcfcf4ec51736 = function(arg0) {
896
- const ret = Number(arg0);
897
- return ret;
898
- };
899
-
900
- exports.__wbg_String_8f0eb39a4a4c2f66 = function(arg0, arg1) {
901
- const ret = String(arg1);
902
- const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
903
- const len1 = WASM_VECTOR_LEN;
904
- getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
905
- getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
906
- };
907
-
908
- exports.__wbg___wbindgen_bigint_get_as_i64_6e32f5e6aff02e1d = function(arg0, arg1) {
909
- const v = arg1;
910
- const ret = typeof(v) === 'bigint' ? v : undefined;
911
- getDataViewMemory0().setBigInt64(arg0 + 8 * 1, isLikeNone(ret) ? BigInt(0) : ret, true);
912
- getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
913
- };
914
-
915
- exports.__wbg___wbindgen_boolean_get_dea25b33882b895b = function(arg0) {
916
- const v = arg0;
917
- const ret = typeof(v) === 'boolean' ? v : undefined;
918
- return isLikeNone(ret) ? 0xFFFFFF : ret ? 1 : 0;
919
- };
920
-
921
- exports.__wbg___wbindgen_debug_string_adfb662ae34724b6 = function(arg0, arg1) {
922
- const ret = debugString(arg1);
923
- const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
924
- const len1 = WASM_VECTOR_LEN;
925
- getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
926
- getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
927
- };
928
-
929
- exports.__wbg___wbindgen_in_0d3e1e8f0c669317 = function(arg0, arg1) {
930
- const ret = arg0 in arg1;
931
- return ret;
932
- };
933
-
934
- exports.__wbg___wbindgen_is_bigint_0e1a2e3f55cfae27 = function(arg0) {
935
- const ret = typeof(arg0) === 'bigint';
936
- return ret;
937
- };
938
-
939
- exports.__wbg___wbindgen_is_function_8d400b8b1af978cd = function(arg0) {
940
- const ret = typeof(arg0) === 'function';
941
- return ret;
942
- };
943
-
944
- exports.__wbg___wbindgen_is_object_ce774f3490692386 = function(arg0) {
945
- const val = arg0;
946
- const ret = typeof(val) === 'object' && val !== null;
947
- return ret;
948
- };
949
-
950
- exports.__wbg___wbindgen_is_string_704ef9c8fc131030 = function(arg0) {
951
- const ret = typeof(arg0) === 'string';
952
- return ret;
953
- };
954
-
955
- exports.__wbg___wbindgen_is_undefined_f6b95eab589e0269 = function(arg0) {
956
- const ret = arg0 === undefined;
957
- return ret;
958
- };
959
-
960
- exports.__wbg___wbindgen_jsval_eq_b6101cc9cef1fe36 = function(arg0, arg1) {
961
- const ret = arg0 === arg1;
962
- return ret;
963
- };
964
-
965
- exports.__wbg___wbindgen_jsval_loose_eq_766057600fdd1b0d = function(arg0, arg1) {
966
- const ret = arg0 == arg1;
967
- return ret;
968
- };
969
-
970
- exports.__wbg___wbindgen_number_get_9619185a74197f95 = function(arg0, arg1) {
971
- const obj = arg1;
972
- const ret = typeof(obj) === 'number' ? obj : undefined;
973
- getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
974
- getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
975
- };
976
-
977
- exports.__wbg___wbindgen_string_get_a2a31e16edf96e42 = function(arg0, arg1) {
978
- const obj = arg1;
979
- const ret = typeof(obj) === 'string' ? obj : undefined;
980
- var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
981
- var len1 = WASM_VECTOR_LEN;
982
- getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
983
- getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
984
- };
985
-
986
- exports.__wbg___wbindgen_throw_dd24417ed36fc46e = function(arg0, arg1) {
987
- throw new Error(getStringFromWasm0(arg0, arg1));
988
- };
989
-
990
- exports.__wbg__wbg_cb_unref_87dfb5aaa0cbcea7 = function(arg0) {
991
- arg0._wbg_cb_unref();
992
- };
993
-
994
- exports.__wbg_abort_07646c894ebbf2bd = function(arg0) {
995
- arg0.abort();
996
- };
997
-
998
- exports.__wbg_abort_399ecbcfd6ef3c8e = function(arg0, arg1) {
999
- arg0.abort(arg1);
1000
- };
1001
-
1002
- exports.__wbg_append_c5cbdf46455cc776 = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
1003
- arg0.append(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4));
1004
- }, arguments) };
1005
-
1006
- exports.__wbg_arrayBuffer_c04af4fce566092d = function() { return handleError(function (arg0) {
1007
- const ret = arg0.arrayBuffer();
1008
- return ret;
1009
- }, arguments) };
1010
-
1011
- exports.__wbg_authorizeresult_new = function(arg0) {
1012
- const ret = AuthorizeResult.__wrap(arg0);
1013
- return ret;
1014
- };
1015
-
1016
- exports.__wbg_call_3020136f7a2d6e44 = function() { return handleError(function (arg0, arg1, arg2) {
1017
- const ret = arg0.call(arg1, arg2);
1018
- return ret;
1019
- }, arguments) };
1020
-
1021
- exports.__wbg_call_abb4ff46ce38be40 = function() { return handleError(function (arg0, arg1) {
1022
- const ret = arg0.call(arg1);
1023
- return ret;
1024
- }, arguments) };
1025
-
1026
- exports.__wbg_cedarling_new = function(arg0) {
1027
- const ret = Cedarling.__wrap(arg0);
1028
- return ret;
1029
- };
1030
-
1031
- exports.__wbg_clearTimeout_b716ecb44bea14ed = function(arg0) {
1032
- const ret = clearTimeout(arg0);
1033
- return ret;
1034
- };
1035
-
1036
- exports.__wbg_crypto_574e78ad8b13b65f = function(arg0) {
1037
- const ret = arg0.crypto;
1038
- return ret;
1039
- };
1040
-
1041
- exports.__wbg_debug_24d884048190fccc = function(arg0) {
1042
- console.debug(...arg0);
1043
- };
1044
-
1045
- exports.__wbg_done_62ea16af4ce34b24 = function(arg0) {
1046
- const ret = arg0.done;
1047
- return ret;
1048
- };
1049
-
1050
- exports.__wbg_entries_83c79938054e065f = function(arg0) {
1051
- const ret = Object.entries(arg0);
1052
- return ret;
1053
- };
1054
-
1055
- exports.__wbg_entries_9af46b7eaf7dfefa = function(arg0) {
1056
- const ret = arg0.entries();
1057
- return ret;
1058
- };
1059
-
1060
- exports.__wbg_error_98d791de55bc7c97 = function(arg0) {
1061
- console.error(...arg0);
1062
- };
1063
-
1064
- exports.__wbg_fetch_7fb7602a1bf647ec = function(arg0) {
1065
- const ret = fetch(arg0);
1066
- return ret;
1067
- };
1068
-
1069
- exports.__wbg_fetch_90447c28cc0b095e = function(arg0, arg1) {
1070
- const ret = arg0.fetch(arg1);
1071
- return ret;
1072
- };
1073
-
1074
- exports.__wbg_fromEntries_743eaaa008e6db37 = function() { return handleError(function (arg0) {
1075
- const ret = Object.fromEntries(arg0);
1076
- return ret;
1077
- }, arguments) };
1078
-
1079
- exports.__wbg_getRandomValues_1c61fac11405ffdc = function() { return handleError(function (arg0, arg1) {
1080
- globalThis.crypto.getRandomValues(getArrayU8FromWasm0(arg0, arg1));
1081
- }, arguments) };
1082
-
1083
- exports.__wbg_getRandomValues_b8f5dbd5f3995a9e = function() { return handleError(function (arg0, arg1) {
1084
- arg0.getRandomValues(arg1);
1085
- }, arguments) };
1086
-
1087
- exports.__wbg_getTime_ad1e9878a735af08 = function(arg0) {
1088
- const ret = arg0.getTime();
1089
- return ret;
1090
- };
1091
-
1092
- exports.__wbg_getTimezoneOffset_45389e26d6f46823 = function(arg0) {
1093
- const ret = arg0.getTimezoneOffset();
1094
- return ret;
1095
- };
1096
-
1097
- exports.__wbg_get_6b7bd52aca3f9671 = function(arg0, arg1) {
1098
- const ret = arg0[arg1 >>> 0];
1099
- return ret;
1100
- };
1101
-
1102
- exports.__wbg_get_af9dab7e9603ea93 = function() { return handleError(function (arg0, arg1) {
1103
- const ret = Reflect.get(arg0, arg1);
1104
- return ret;
1105
- }, arguments) };
1106
-
1107
- exports.__wbg_get_with_ref_key_1dc361bd10053bfe = function(arg0, arg1) {
1108
- const ret = arg0[arg1];
1109
- return ret;
1110
- };
1111
-
1112
- exports.__wbg_has_0e670569d65d3a45 = function() { return handleError(function (arg0, arg1) {
1113
- const ret = Reflect.has(arg0, arg1);
1114
- return ret;
1115
- }, arguments) };
1116
-
1117
- exports.__wbg_headers_654c30e1bcccc552 = function(arg0) {
1118
- const ret = arg0.headers;
1119
- return ret;
1120
- };
1121
-
1122
- exports.__wbg_info_e951478d580c1573 = function(arg0) {
1123
- console.info(...arg0);
1124
- };
1125
-
1126
- exports.__wbg_instanceof_ArrayBuffer_f3320d2419cd0355 = function(arg0) {
1127
- let result;
1128
- try {
1129
- result = arg0 instanceof ArrayBuffer;
1130
- } catch (_) {
1131
- result = false;
1132
- }
1133
- const ret = result;
1134
- return ret;
1135
- };
1136
-
1137
- exports.__wbg_instanceof_Array_bc64f5da83077362 = function(arg0) {
1138
- let result;
1139
- try {
1140
- result = arg0 instanceof Array;
1141
- } catch (_) {
1142
- result = false;
1143
- }
1144
- const ret = result;
1145
- return ret;
1146
- };
1147
-
1148
- exports.__wbg_instanceof_Map_084be8da74364158 = function(arg0) {
1149
- let result;
1150
- try {
1151
- result = arg0 instanceof Map;
1152
- } catch (_) {
1153
- result = false;
1154
- }
1155
- const ret = result;
1156
- return ret;
1157
- };
1158
-
1159
- exports.__wbg_instanceof_Response_cd74d1c2ac92cb0b = function(arg0) {
1160
- let result;
1161
- try {
1162
- result = arg0 instanceof Response;
1163
- } catch (_) {
1164
- result = false;
1165
- }
1166
- const ret = result;
1167
- return ret;
1168
- };
1169
-
1170
- exports.__wbg_instanceof_Uint8Array_da54ccc9d3e09434 = function(arg0) {
1171
- let result;
1172
- try {
1173
- result = arg0 instanceof Uint8Array;
1174
- } catch (_) {
1175
- result = false;
1176
- }
1177
- const ret = result;
1178
- return ret;
1179
- };
1180
-
1181
- exports.__wbg_isArray_51fd9e6422c0a395 = function(arg0) {
1182
- const ret = Array.isArray(arg0);
1183
- return ret;
1184
- };
1185
-
1186
- exports.__wbg_isSafeInteger_ae7d3f054d55fa16 = function(arg0) {
1187
- const ret = Number.isSafeInteger(arg0);
1188
- return ret;
1189
- };
1190
-
1191
- exports.__wbg_iterator_27b7c8b35ab3e86b = function() {
1192
- const ret = Symbol.iterator;
1193
- return ret;
1194
- };
1195
-
1196
- exports.__wbg_keys_f5c6002ff150fc6c = function(arg0) {
1197
- const ret = Object.keys(arg0);
1198
- return ret;
1199
- };
1200
-
1201
- exports.__wbg_length_22ac23eaec9d8053 = function(arg0) {
1202
- const ret = arg0.length;
1203
- return ret;
1204
- };
1205
-
1206
- exports.__wbg_length_d45040a40c570362 = function(arg0) {
1207
- const ret = arg0.length;
1208
- return ret;
1209
- };
1210
-
1211
- exports.__wbg_log_3f650af133a6de58 = function(arg0) {
1212
- console.log(...arg0);
1213
- };
1214
-
1215
- exports.__wbg_msCrypto_a61aeb35a24c1329 = function(arg0) {
1216
- const ret = arg0.msCrypto;
1217
- return ret;
1218
- };
1219
-
1220
- exports.__wbg_multiissuerauthorizeresult_new = function(arg0) {
1221
- const ret = MultiIssuerAuthorizeResult.__wrap(arg0);
1222
- return ret;
1223
- };
1224
-
1225
- exports.__wbg_new_0_23cedd11d9b40c9d = function() {
1226
- const ret = new Date();
1227
- return ret;
1228
- };
1229
-
1230
- exports.__wbg_new_1ba21ce319a06297 = function() {
1231
- const ret = new Object();
1232
- return ret;
1233
- };
1234
-
1235
- exports.__wbg_new_25f239778d6112b9 = function() {
1236
- const ret = new Array();
1237
- return ret;
1238
- };
1239
-
1240
- exports.__wbg_new_3c79b3bb1b32b7d3 = function() { return handleError(function () {
1241
- const ret = new Headers();
1242
- return ret;
1243
- }, arguments) };
1244
-
1245
- exports.__wbg_new_6421f6084cc5bc5a = function(arg0) {
1246
- const ret = new Uint8Array(arg0);
1247
- return ret;
1248
- };
1249
-
1250
- exports.__wbg_new_881a222c65f168fc = function() { return handleError(function () {
1251
- const ret = new AbortController();
1252
- return ret;
1253
- }, arguments) };
1254
-
1255
- exports.__wbg_new_b2db8aa2650f793a = function(arg0) {
1256
- const ret = new Date(arg0);
1257
- return ret;
1258
- };
1259
-
1260
- exports.__wbg_new_b546ae120718850e = function() {
1261
- const ret = new Map();
1276
+ /**
1277
+ * Create a new instance of the Cedarling application from archive bytes.
1278
+ *
1279
+ * This function allows loading a policy store from a Cedar Archive (.cjar)
1280
+ * that was fetched with custom logic (e.g., with authentication headers).
1281
+ *
1282
+ * # Arguments
1283
+ * * `config` - Bootstrap configuration (Map or Object). Policy store config is ignored.
1284
+ * * `archive_bytes` - The .cjar archive bytes (Uint8Array)
1285
+ *
1286
+ * # Example
1287
+ * ```javascript
1288
+ * const response = await fetch(url, { headers: { Authorization: 'Bearer ...' } });
1289
+ * const bytes = new Uint8Array(await response.arrayBuffer());
1290
+ * const cedarling = await init_from_archive_bytes(config, bytes);
1291
+ * ```
1292
+ * @param {any} config
1293
+ * @param {Uint8Array} archive_bytes
1294
+ * @returns {Promise<Cedarling>}
1295
+ */
1296
+ function init_from_archive_bytes(config, archive_bytes) {
1297
+ const ret = wasm.init_from_archive_bytes(config, archive_bytes);
1262
1298
  return ret;
1263
- };
1264
-
1265
- exports.__wbg_new_ff12d2b041fb48f1 = function(arg0, arg1) {
1266
- try {
1267
- var state0 = {a: arg0, b: arg1};
1268
- var cb0 = (arg0, arg1) => {
1269
- const a = state0.a;
1270
- state0.a = 0;
1299
+ }
1300
+ exports.init_from_archive_bytes = init_from_archive_bytes;
1301
+ function __wbg_get_imports() {
1302
+ const import0 = {
1303
+ __proto__: null,
1304
+ __wbg_Error_960c155d3d49e4c2: function(arg0, arg1) {
1305
+ const ret = Error(getStringFromWasm0(arg0, arg1));
1306
+ return ret;
1307
+ },
1308
+ __wbg_Number_32bf70a599af1d4b: function(arg0) {
1309
+ const ret = Number(arg0);
1310
+ return ret;
1311
+ },
1312
+ __wbg___wbindgen_bigint_get_as_i64_3d3aba5d616c6a51: function(arg0, arg1) {
1313
+ const v = arg1;
1314
+ const ret = typeof(v) === 'bigint' ? v : undefined;
1315
+ getDataViewMemory0().setBigInt64(arg0 + 8 * 1, isLikeNone(ret) ? BigInt(0) : ret, true);
1316
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
1317
+ },
1318
+ __wbg___wbindgen_boolean_get_6ea149f0a8dcc5ff: function(arg0) {
1319
+ const v = arg0;
1320
+ const ret = typeof(v) === 'boolean' ? v : undefined;
1321
+ return isLikeNone(ret) ? 0xFFFFFF : ret ? 1 : 0;
1322
+ },
1323
+ __wbg___wbindgen_debug_string_ab4b34d23d6778bd: function(arg0, arg1) {
1324
+ const ret = debugString(arg1);
1325
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1326
+ const len1 = WASM_VECTOR_LEN;
1327
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1328
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1329
+ },
1330
+ __wbg___wbindgen_in_a5d8b22e52b24dd1: function(arg0, arg1) {
1331
+ const ret = arg0 in arg1;
1332
+ return ret;
1333
+ },
1334
+ __wbg___wbindgen_is_bigint_ec25c7f91b4d9e93: function(arg0) {
1335
+ const ret = typeof(arg0) === 'bigint';
1336
+ return ret;
1337
+ },
1338
+ __wbg___wbindgen_is_function_3baa9db1a987f47d: function(arg0) {
1339
+ const ret = typeof(arg0) === 'function';
1340
+ return ret;
1341
+ },
1342
+ __wbg___wbindgen_is_object_63322ec0cd6ea4ef: function(arg0) {
1343
+ const val = arg0;
1344
+ const ret = typeof(val) === 'object' && val !== null;
1345
+ return ret;
1346
+ },
1347
+ __wbg___wbindgen_is_string_6df3bf7ef1164ed3: function(arg0) {
1348
+ const ret = typeof(arg0) === 'string';
1349
+ return ret;
1350
+ },
1351
+ __wbg___wbindgen_is_undefined_29a43b4d42920abd: function(arg0) {
1352
+ const ret = arg0 === undefined;
1353
+ return ret;
1354
+ },
1355
+ __wbg___wbindgen_jsval_eq_d3465d8a07697228: function(arg0, arg1) {
1356
+ const ret = arg0 === arg1;
1357
+ return ret;
1358
+ },
1359
+ __wbg___wbindgen_jsval_loose_eq_cac3565e89b4134c: function(arg0, arg1) {
1360
+ const ret = arg0 == arg1;
1361
+ return ret;
1362
+ },
1363
+ __wbg___wbindgen_number_get_c7f42aed0525c451: function(arg0, arg1) {
1364
+ const obj = arg1;
1365
+ const ret = typeof(obj) === 'number' ? obj : undefined;
1366
+ getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
1367
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
1368
+ },
1369
+ __wbg___wbindgen_string_get_7ed5322991caaec5: function(arg0, arg1) {
1370
+ const obj = arg1;
1371
+ const ret = typeof(obj) === 'string' ? obj : undefined;
1372
+ var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1373
+ var len1 = WASM_VECTOR_LEN;
1374
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1375
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1376
+ },
1377
+ __wbg___wbindgen_throw_6b64449b9b9ed33c: function(arg0, arg1) {
1378
+ throw new Error(getStringFromWasm0(arg0, arg1));
1379
+ },
1380
+ __wbg__wbg_cb_unref_b46c9b5a9f08ec37: function(arg0) {
1381
+ arg0._wbg_cb_unref();
1382
+ },
1383
+ __wbg_abort_4ce5b484434ef6fd: function(arg0) {
1384
+ arg0.abort();
1385
+ },
1386
+ __wbg_abort_d53712380a54cc81: function(arg0, arg1) {
1387
+ arg0.abort(arg1);
1388
+ },
1389
+ __wbg_append_e8fc56ce7c00e874: function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
1390
+ arg0.append(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4));
1391
+ }, arguments); },
1392
+ __wbg_arrayBuffer_848c392b70c67d3d: function() { return handleError(function (arg0) {
1393
+ const ret = arg0.arrayBuffer();
1394
+ return ret;
1395
+ }, arguments); },
1396
+ __wbg_authorizeresult_new: function(arg0) {
1397
+ const ret = AuthorizeResult.__wrap(arg0);
1398
+ return ret;
1399
+ },
1400
+ __wbg_body_0c3a51aec038a31a: function(arg0) {
1401
+ const ret = arg0.body;
1402
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
1403
+ },
1404
+ __wbg_buffer_d0f5ea0926a691fd: function(arg0) {
1405
+ const ret = arg0.buffer;
1406
+ return ret;
1407
+ },
1408
+ __wbg_byobRequest_dc6aed9db01b12c6: function(arg0) {
1409
+ const ret = arg0.byobRequest;
1410
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
1411
+ },
1412
+ __wbg_byteLength_3e660e5661f3327e: function(arg0) {
1413
+ const ret = arg0.byteLength;
1414
+ return ret;
1415
+ },
1416
+ __wbg_byteOffset_ecd62abe44dd28d4: function(arg0) {
1417
+ const ret = arg0.byteOffset;
1418
+ return ret;
1419
+ },
1420
+ __wbg_call_14b169f759b26747: function() { return handleError(function (arg0, arg1) {
1421
+ const ret = arg0.call(arg1);
1422
+ return ret;
1423
+ }, arguments); },
1424
+ __wbg_call_a24592a6f349a97e: function() { return handleError(function (arg0, arg1, arg2) {
1425
+ const ret = arg0.call(arg1, arg2);
1426
+ return ret;
1427
+ }, arguments); },
1428
+ __wbg_cancel_ceb1bda02e29f0a9: function(arg0) {
1429
+ const ret = arg0.cancel();
1430
+ return ret;
1431
+ },
1432
+ __wbg_catch_e9362815fd0b24cf: function(arg0, arg1) {
1433
+ const ret = arg0.catch(arg1);
1434
+ return ret;
1435
+ },
1436
+ __wbg_cedarling_new: function(arg0) {
1437
+ const ret = Cedarling.__wrap(arg0);
1438
+ return ret;
1439
+ },
1440
+ __wbg_clearTimeout_2256f1e7b94ef517: function(arg0) {
1441
+ const ret = clearTimeout(arg0);
1442
+ return ret;
1443
+ },
1444
+ __wbg_clearTimeout_3629d6209dfcc46e: function(arg0) {
1445
+ const ret = clearTimeout(arg0);
1446
+ return ret;
1447
+ },
1448
+ __wbg_clearTimeout_c122f92fd48cd749: function(arg0) {
1449
+ const ret = clearTimeout(arg0);
1450
+ return ret;
1451
+ },
1452
+ __wbg_close_e6c8977a002e9e13: function() { return handleError(function (arg0) {
1453
+ arg0.close();
1454
+ }, arguments); },
1455
+ __wbg_close_fb954dfaf67b5732: function() { return handleError(function (arg0) {
1456
+ arg0.close();
1457
+ }, arguments); },
1458
+ __wbg_crypto_38df2bab126b63dc: function(arg0) {
1459
+ const ret = arg0.crypto;
1460
+ return ret;
1461
+ },
1462
+ __wbg_dataentry_new: function(arg0) {
1463
+ const ret = DataEntry.__wrap(arg0);
1464
+ return ret;
1465
+ },
1466
+ __wbg_debug_e679aee1a146ce33: function(arg0) {
1467
+ console.debug(...arg0);
1468
+ },
1469
+ __wbg_done_9158f7cc8751ba32: function(arg0) {
1470
+ const ret = arg0.done;
1471
+ return ret;
1472
+ },
1473
+ __wbg_enqueue_4767ce322820c94d: function() { return handleError(function (arg0, arg1) {
1474
+ arg0.enqueue(arg1);
1475
+ }, arguments); },
1476
+ __wbg_entries_2bf997cf82353e47: function(arg0) {
1477
+ const ret = arg0.entries();
1478
+ return ret;
1479
+ },
1480
+ __wbg_entries_bf727fcd7bf35a41: function(arg0) {
1481
+ const ret = arg0.entries();
1482
+ return ret;
1483
+ },
1484
+ __wbg_entries_e0b73aa8571ddb56: function(arg0) {
1485
+ const ret = Object.entries(arg0);
1486
+ return ret;
1487
+ },
1488
+ __wbg_error_290de5487bca6d05: function(arg0) {
1489
+ console.error(...arg0);
1490
+ },
1491
+ __wbg_fetch_0d322c0aed196b8b: function(arg0, arg1) {
1492
+ const ret = arg0.fetch(arg1);
1493
+ return ret;
1494
+ },
1495
+ __wbg_fetch_28a97b69c20078bb: function(arg0, arg1, arg2) {
1496
+ const ret = arg0.fetch(arg1, arg2);
1497
+ return ret;
1498
+ },
1499
+ __wbg_fetch_43b2f110608a59ff: function(arg0) {
1500
+ const ret = fetch(arg0);
1501
+ return ret;
1502
+ },
1503
+ __wbg_fetch_5e2e4a3d60c8d1d3: function(arg0, arg1) {
1504
+ const ret = fetch(arg0, arg1);
1505
+ return ret;
1506
+ },
1507
+ __wbg_fromEntries_ce99d7540610a555: function() { return handleError(function (arg0) {
1508
+ const ret = Object.fromEntries(arg0);
1509
+ return ret;
1510
+ }, arguments); },
1511
+ __wbg_getRandomValues_76dfc69825c9c552: function() { return handleError(function (arg0, arg1) {
1512
+ globalThis.crypto.getRandomValues(getArrayU8FromWasm0(arg0, arg1));
1513
+ }, arguments); },
1514
+ __wbg_getRandomValues_c44a50d8cfdaebeb: function() { return handleError(function (arg0, arg1) {
1515
+ arg0.getRandomValues(arg1);
1516
+ }, arguments); },
1517
+ __wbg_getReader_9facd4f899beac89: function() { return handleError(function (arg0) {
1518
+ const ret = arg0.getReader();
1519
+ return ret;
1520
+ }, arguments); },
1521
+ __wbg_getTime_da7c55f52b71e8c6: function(arg0) {
1522
+ const ret = arg0.getTime();
1523
+ return ret;
1524
+ },
1525
+ __wbg_getTimezoneOffset_31f57a5389d0d57c: function(arg0) {
1526
+ const ret = arg0.getTimezoneOffset();
1527
+ return ret;
1528
+ },
1529
+ __wbg_get_1affdbdd5573b16a: function() { return handleError(function (arg0, arg1) {
1530
+ const ret = Reflect.get(arg0, arg1);
1531
+ return ret;
1532
+ }, arguments); },
1533
+ __wbg_get_6011fa3a58f61074: function() { return handleError(function (arg0, arg1) {
1534
+ const ret = Reflect.get(arg0, arg1);
1535
+ return ret;
1536
+ }, arguments); },
1537
+ __wbg_get_8360291721e2339f: function(arg0, arg1) {
1538
+ const ret = arg0[arg1 >>> 0];
1539
+ return ret;
1540
+ },
1541
+ __wbg_get_done_282bca5d3f90e0a8: function(arg0) {
1542
+ const ret = arg0.done;
1543
+ return isLikeNone(ret) ? 0xFFFFFF : ret ? 1 : 0;
1544
+ },
1545
+ __wbg_get_unchecked_17f53dad852b9588: function(arg0, arg1) {
1546
+ const ret = arg0[arg1 >>> 0];
1547
+ return ret;
1548
+ },
1549
+ __wbg_get_value_65a7a2c60b42fd75: function(arg0) {
1550
+ const ret = arg0.value;
1551
+ return ret;
1552
+ },
1553
+ __wbg_get_with_ref_key_6412cf3094599694: function(arg0, arg1) {
1554
+ const ret = arg0[arg1];
1555
+ return ret;
1556
+ },
1557
+ __wbg_has_880f1d472f7cecba: function() { return handleError(function (arg0, arg1) {
1558
+ const ret = Reflect.has(arg0, arg1);
1559
+ return ret;
1560
+ }, arguments); },
1561
+ __wbg_headers_6022deb4e576fb8e: function(arg0) {
1562
+ const ret = arg0.headers;
1563
+ return ret;
1564
+ },
1565
+ __wbg_info_cd965dfbcb78a57d: function(arg0) {
1566
+ console.info(...arg0);
1567
+ },
1568
+ __wbg_instanceof_ArrayBuffer_7c8433c6ed14ffe3: function(arg0) {
1569
+ let result;
1271
1570
  try {
1272
- return wasm_bindgen__convert__closures_____invoke__h3a7d0d99d266e2f8(a, state0.b, arg0, arg1);
1273
- } finally {
1274
- state0.a = a;
1571
+ result = arg0 instanceof ArrayBuffer;
1572
+ } catch (_) {
1573
+ result = false;
1275
1574
  }
1276
- };
1277
- const ret = new Promise(cb0);
1278
- return ret;
1279
- } finally {
1280
- state0.a = state0.b = 0;
1281
- }
1282
- };
1283
-
1284
- exports.__wbg_new_from_slice_f9c22b9153b26992 = function(arg0, arg1) {
1285
- const ret = new Uint8Array(getArrayU8FromWasm0(arg0, arg1));
1286
- return ret;
1287
- };
1288
-
1289
- exports.__wbg_new_no_args_cb138f77cf6151ee = function(arg0, arg1) {
1290
- const ret = new Function(getStringFromWasm0(arg0, arg1));
1291
- return ret;
1292
- };
1293
-
1294
- exports.__wbg_new_with_args_df9e7125ffe55248 = function(arg0, arg1, arg2, arg3) {
1295
- const ret = new Function(getStringFromWasm0(arg0, arg1), getStringFromWasm0(arg2, arg3));
1296
- return ret;
1297
- };
1298
-
1299
- exports.__wbg_new_with_length_aa5eaf41d35235e5 = function(arg0) {
1300
- const ret = new Uint8Array(arg0 >>> 0);
1301
- return ret;
1302
- };
1303
-
1304
- exports.__wbg_new_with_str_and_init_c5748f76f5108934 = function() { return handleError(function (arg0, arg1, arg2) {
1305
- const ret = new Request(getStringFromWasm0(arg0, arg1), arg2);
1306
- return ret;
1307
- }, arguments) };
1308
-
1309
- exports.__wbg_next_138a17bbf04e926c = function(arg0) {
1310
- const ret = arg0.next;
1311
- return ret;
1312
- };
1313
-
1314
- exports.__wbg_next_3cfe5c0fe2a4cc53 = function() { return handleError(function (arg0) {
1315
- const ret = arg0.next();
1316
- return ret;
1317
- }, arguments) };
1318
-
1319
- exports.__wbg_node_905d3e251edff8a2 = function(arg0) {
1320
- const ret = arg0.node;
1321
- return ret;
1322
- };
1323
-
1324
- exports.__wbg_policyevaluationerror_new = function(arg0) {
1325
- const ret = PolicyEvaluationError.__wrap(arg0);
1326
- return ret;
1327
- };
1328
-
1329
- exports.__wbg_process_dc0fbacc7c1c06f7 = function(arg0) {
1330
- const ret = arg0.process;
1331
- return ret;
1332
- };
1575
+ const ret = result;
1576
+ return ret;
1577
+ },
1578
+ __wbg_instanceof_Array_d0200cccb1297a10: function(arg0) {
1579
+ let result;
1580
+ try {
1581
+ result = arg0 instanceof Array;
1582
+ } catch (_) {
1583
+ result = false;
1584
+ }
1585
+ const ret = result;
1586
+ return ret;
1587
+ },
1588
+ __wbg_instanceof_Map_1b76fd4635be43eb: function(arg0) {
1589
+ let result;
1590
+ try {
1591
+ result = arg0 instanceof Map;
1592
+ } catch (_) {
1593
+ result = false;
1594
+ }
1595
+ const ret = result;
1596
+ return ret;
1597
+ },
1598
+ __wbg_instanceof_Response_9b2d111407865ff2: function(arg0) {
1599
+ let result;
1600
+ try {
1601
+ result = arg0 instanceof Response;
1602
+ } catch (_) {
1603
+ result = false;
1604
+ }
1605
+ const ret = result;
1606
+ return ret;
1607
+ },
1608
+ __wbg_instanceof_Uint8Array_152ba1f289edcf3f: function(arg0) {
1609
+ let result;
1610
+ try {
1611
+ result = arg0 instanceof Uint8Array;
1612
+ } catch (_) {
1613
+ result = false;
1614
+ }
1615
+ const ret = result;
1616
+ return ret;
1617
+ },
1618
+ __wbg_isArray_c3109d14ffc06469: function(arg0) {
1619
+ const ret = Array.isArray(arg0);
1620
+ return ret;
1621
+ },
1622
+ __wbg_isSafeInteger_4fc213d1989d6d2a: function(arg0) {
1623
+ const ret = Number.isSafeInteger(arg0);
1624
+ return ret;
1625
+ },
1626
+ __wbg_iterator_013bc09ec998c2a7: function() {
1627
+ const ret = Symbol.iterator;
1628
+ return ret;
1629
+ },
1630
+ __wbg_keys_2fd1bfdda7e278ca: function(arg0) {
1631
+ const ret = Object.keys(arg0);
1632
+ return ret;
1633
+ },
1634
+ __wbg_length_3d4ecd04bd8d22f1: function(arg0) {
1635
+ const ret = arg0.length;
1636
+ return ret;
1637
+ },
1638
+ __wbg_length_9f1775224cf1d815: function(arg0) {
1639
+ const ret = arg0.length;
1640
+ return ret;
1641
+ },
1642
+ __wbg_log_3e08aa4d12dba7f3: function(arg0) {
1643
+ console.log(...arg0);
1644
+ },
1645
+ __wbg_msCrypto_bd5a034af96bcba6: function(arg0) {
1646
+ const ret = arg0.msCrypto;
1647
+ return ret;
1648
+ },
1649
+ __wbg_multiissuerauthorizeresult_new: function(arg0) {
1650
+ const ret = MultiIssuerAuthorizeResult.__wrap(arg0);
1651
+ return ret;
1652
+ },
1653
+ __wbg_new_0_4d657201ced14de3: function() {
1654
+ const ret = new Date();
1655
+ return ret;
1656
+ },
1657
+ __wbg_new_0c7403db6e782f19: function(arg0) {
1658
+ const ret = new Uint8Array(arg0);
1659
+ return ret;
1660
+ },
1661
+ __wbg_new_15a4889b4b90734d: function() { return handleError(function () {
1662
+ const ret = new Headers();
1663
+ return ret;
1664
+ }, arguments); },
1665
+ __wbg_new_34d45cc8e36aaead: function() {
1666
+ const ret = new Map();
1667
+ return ret;
1668
+ },
1669
+ __wbg_new_5e360d2ff7b9e1c3: function(arg0, arg1) {
1670
+ const ret = new Error(getStringFromWasm0(arg0, arg1));
1671
+ return ret;
1672
+ },
1673
+ __wbg_new_682678e2f47e32bc: function() {
1674
+ const ret = new Array();
1675
+ return ret;
1676
+ },
1677
+ __wbg_new_7913666fe5070684: function(arg0) {
1678
+ const ret = new Date(arg0);
1679
+ return ret;
1680
+ },
1681
+ __wbg_new_98c22165a42231aa: function() { return handleError(function () {
1682
+ const ret = new AbortController();
1683
+ return ret;
1684
+ }, arguments); },
1685
+ __wbg_new_aa8d0fa9762c29bd: function() {
1686
+ const ret = new Object();
1687
+ return ret;
1688
+ },
1689
+ __wbg_new_from_slice_b5ea43e23f6008c0: function(arg0, arg1) {
1690
+ const ret = new Uint8Array(getArrayU8FromWasm0(arg0, arg1));
1691
+ return ret;
1692
+ },
1693
+ __wbg_new_typed_323f37fd55ab048d: function(arg0, arg1) {
1694
+ try {
1695
+ var state0 = {a: arg0, b: arg1};
1696
+ var cb0 = (arg0, arg1) => {
1697
+ const a = state0.a;
1698
+ state0.a = 0;
1699
+ try {
1700
+ return wasm_bindgen__convert__closures_____invoke__h66f11f9242c621fe(a, state0.b, arg0, arg1);
1701
+ } finally {
1702
+ state0.a = a;
1703
+ }
1704
+ };
1705
+ const ret = new Promise(cb0);
1706
+ return ret;
1707
+ } finally {
1708
+ state0.a = 0;
1709
+ }
1710
+ },
1711
+ __wbg_new_with_byte_offset_and_length_01848e8d6a3d49ad: function(arg0, arg1, arg2) {
1712
+ const ret = new Uint8Array(arg0, arg1 >>> 0, arg2 >>> 0);
1713
+ return ret;
1714
+ },
1715
+ __wbg_new_with_length_8c854e41ea4dae9b: function(arg0) {
1716
+ const ret = new Uint8Array(arg0 >>> 0);
1717
+ return ret;
1718
+ },
1719
+ __wbg_new_with_str_and_init_897be1708e42f39d: function() { return handleError(function (arg0, arg1, arg2) {
1720
+ const ret = new Request(getStringFromWasm0(arg0, arg1), arg2);
1721
+ return ret;
1722
+ }, arguments); },
1723
+ __wbg_next_0340c4ae324393c3: function() { return handleError(function (arg0) {
1724
+ const ret = arg0.next();
1725
+ return ret;
1726
+ }, arguments); },
1727
+ __wbg_next_7646edaa39458ef7: function(arg0) {
1728
+ const ret = arg0.next;
1729
+ return ret;
1730
+ },
1731
+ __wbg_node_84ea875411254db1: function(arg0) {
1732
+ const ret = arg0.node;
1733
+ return ret;
1734
+ },
1735
+ __wbg_policyevaluationerror_new: function(arg0) {
1736
+ const ret = PolicyEvaluationError.__wrap(arg0);
1737
+ return ret;
1738
+ },
1739
+ __wbg_process_44c7a14e11e9f69e: function(arg0) {
1740
+ const ret = arg0.process;
1741
+ return ret;
1742
+ },
1743
+ __wbg_prototypesetcall_a6b02eb00b0f4ce2: function(arg0, arg1, arg2) {
1744
+ Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), arg2);
1745
+ },
1746
+ __wbg_push_471a5b068a5295f6: function(arg0, arg1) {
1747
+ const ret = arg0.push(arg1);
1748
+ return ret;
1749
+ },
1750
+ __wbg_queueMicrotask_5d15a957e6aa920e: function(arg0) {
1751
+ queueMicrotask(arg0);
1752
+ },
1753
+ __wbg_queueMicrotask_f8819e5ffc402f36: function(arg0) {
1754
+ const ret = arg0.queueMicrotask;
1755
+ return ret;
1756
+ },
1757
+ __wbg_randomFillSync_6c25eac9869eb53c: function() { return handleError(function (arg0, arg1) {
1758
+ arg0.randomFillSync(arg1);
1759
+ }, arguments); },
1760
+ __wbg_read_ddc2d178d2e57272: function(arg0) {
1761
+ const ret = arg0.read();
1762
+ return ret;
1763
+ },
1764
+ __wbg_releaseLock_9baaf3ccc5cfad69: function(arg0) {
1765
+ arg0.releaseLock();
1766
+ },
1767
+ __wbg_require_b4edbdcf3e2a1ef0: function() { return handleError(function () {
1768
+ const ret = module.require;
1769
+ return ret;
1770
+ }, arguments); },
1771
+ __wbg_resolve_e6c466bc1052f16c: function(arg0) {
1772
+ const ret = Promise.resolve(arg0);
1773
+ return ret;
1774
+ },
1775
+ __wbg_respond_008ca9525ae22847: function() { return handleError(function (arg0, arg1) {
1776
+ arg0.respond(arg1 >>> 0);
1777
+ }, arguments); },
1778
+ __wbg_setTimeout_56bcdccbad22fd44: function() { return handleError(function (arg0, arg1) {
1779
+ const ret = setTimeout(arg0, arg1);
1780
+ return ret;
1781
+ }, arguments); },
1782
+ __wbg_setTimeout_9f4169770fc5a5c3: function(arg0, arg1) {
1783
+ const ret = setTimeout(arg0, arg1);
1784
+ return ret;
1785
+ },
1786
+ __wbg_setTimeout_b188b3bcc8977c7d: function(arg0, arg1) {
1787
+ const ret = setTimeout(arg0, arg1);
1788
+ return ret;
1789
+ },
1790
+ __wbg_set_022bee52d0b05b19: function() { return handleError(function (arg0, arg1, arg2) {
1791
+ const ret = Reflect.set(arg0, arg1, arg2);
1792
+ return ret;
1793
+ }, arguments); },
1794
+ __wbg_set_1ffc463d4c541483: function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
1795
+ arg0.set(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4));
1796
+ }, arguments); },
1797
+ __wbg_set_3bf1de9fab0cd644: function(arg0, arg1, arg2) {
1798
+ arg0[arg1 >>> 0] = arg2;
1799
+ },
1800
+ __wbg_set_3d484eb794afec82: function(arg0, arg1, arg2) {
1801
+ arg0.set(getArrayU8FromWasm0(arg1, arg2));
1802
+ },
1803
+ __wbg_set_6be42768c690e380: function(arg0, arg1, arg2) {
1804
+ arg0[arg1] = arg2;
1805
+ },
1806
+ __wbg_set_body_be11680f34217f75: function(arg0, arg1) {
1807
+ arg0.body = arg1;
1808
+ },
1809
+ __wbg_set_cache_968edea422613d1b: function(arg0, arg1) {
1810
+ arg0.cache = __wbindgen_enum_RequestCache[arg1];
1811
+ },
1812
+ __wbg_set_credentials_6577be90e0e85eb6: function(arg0, arg1) {
1813
+ arg0.credentials = __wbindgen_enum_RequestCredentials[arg1];
1814
+ },
1815
+ __wbg_set_fde2cec06c23692b: function(arg0, arg1, arg2) {
1816
+ const ret = arg0.set(arg1, arg2);
1817
+ return ret;
1818
+ },
1819
+ __wbg_set_headers_50fc01786240a440: function(arg0, arg1) {
1820
+ arg0.headers = arg1;
1821
+ },
1822
+ __wbg_set_integrity_5c3b8dfca7ecca82: function(arg0, arg1, arg2) {
1823
+ arg0.integrity = getStringFromWasm0(arg1, arg2);
1824
+ },
1825
+ __wbg_set_method_c9f1f985f6b6c427: function(arg0, arg1, arg2) {
1826
+ arg0.method = getStringFromWasm0(arg1, arg2);
1827
+ },
1828
+ __wbg_set_mode_5e08d503428c06b9: function(arg0, arg1) {
1829
+ arg0.mode = __wbindgen_enum_RequestMode[arg1];
1830
+ },
1831
+ __wbg_set_redirect_af80b8bace117f0e: function(arg0, arg1) {
1832
+ arg0.redirect = __wbindgen_enum_RequestRedirect[arg1];
1833
+ },
1834
+ __wbg_set_referrer_478d9a69d0d97a98: function(arg0, arg1, arg2) {
1835
+ arg0.referrer = getStringFromWasm0(arg1, arg2);
1836
+ },
1837
+ __wbg_set_referrer_policy_84fedaa88bc9d667: function(arg0, arg1) {
1838
+ arg0.referrerPolicy = __wbindgen_enum_ReferrerPolicy[arg1];
1839
+ },
1840
+ __wbg_set_signal_1d4e73c2305a0e7c: function(arg0, arg1) {
1841
+ arg0.signal = arg1;
1842
+ },
1843
+ __wbg_signal_fdc54643b47bf85b: function(arg0) {
1844
+ const ret = arg0.signal;
1845
+ return ret;
1846
+ },
1847
+ __wbg_static_accessor_GLOBAL_8cfadc87a297ca02: function() {
1848
+ const ret = typeof global === 'undefined' ? null : global;
1849
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
1850
+ },
1851
+ __wbg_static_accessor_GLOBAL_THIS_602256ae5c8f42cf: function() {
1852
+ const ret = typeof globalThis === 'undefined' ? null : globalThis;
1853
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
1854
+ },
1855
+ __wbg_static_accessor_SELF_e445c1c7484aecc3: function() {
1856
+ const ret = typeof self === 'undefined' ? null : self;
1857
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
1858
+ },
1859
+ __wbg_static_accessor_WINDOW_f20e8576ef1e0f17: function() {
1860
+ const ret = typeof window === 'undefined' ? null : window;
1861
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
1862
+ },
1863
+ __wbg_status_43e0d2f15b22d69f: function(arg0) {
1864
+ const ret = arg0.status;
1865
+ return ret;
1866
+ },
1867
+ __wbg_subarray_f8ca46a25b1f5e0d: function(arg0, arg1, arg2) {
1868
+ const ret = arg0.subarray(arg1 >>> 0, arg2 >>> 0);
1869
+ return ret;
1870
+ },
1871
+ __wbg_text_595ef75535aa25c1: function() { return handleError(function (arg0) {
1872
+ const ret = arg0.text();
1873
+ return ret;
1874
+ }, arguments); },
1875
+ __wbg_then_792e0c862b060889: function(arg0, arg1, arg2) {
1876
+ const ret = arg0.then(arg1, arg2);
1877
+ return ret;
1878
+ },
1879
+ __wbg_then_8e16ee11f05e4827: function(arg0, arg1) {
1880
+ const ret = arg0.then(arg1);
1881
+ return ret;
1882
+ },
1883
+ __wbg_toString_306ed0b9f320c1ca: function(arg0) {
1884
+ const ret = arg0.toString();
1885
+ return ret;
1886
+ },
1887
+ __wbg_trace_6a5731c8f9d2bfdf: function(arg0) {
1888
+ console.trace(...arg0);
1889
+ },
1890
+ __wbg_url_2bf741820e6563a0: function(arg0, arg1) {
1891
+ const ret = arg1.url;
1892
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1893
+ const len1 = WASM_VECTOR_LEN;
1894
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1895
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1896
+ },
1897
+ __wbg_value_ee3a06f4579184fa: function(arg0) {
1898
+ const ret = arg0.value;
1899
+ return ret;
1900
+ },
1901
+ __wbg_versions_276b2795b1c6a219: function(arg0) {
1902
+ const ret = arg0.versions;
1903
+ return ret;
1904
+ },
1905
+ __wbg_view_701664ffb3b1ce67: function(arg0) {
1906
+ const ret = arg0.view;
1907
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
1908
+ },
1909
+ __wbg_warn_2dcbaf81b6d99110: function(arg0) {
1910
+ console.warn(...arg0);
1911
+ },
1912
+ __wbindgen_cast_0000000000000001: function(arg0, arg1) {
1913
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 2179, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
1914
+ const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h80274e53af2c4a90);
1915
+ return ret;
1916
+ },
1917
+ __wbindgen_cast_0000000000000002: function(arg0, arg1) {
1918
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 619, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1919
+ const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h170c6019ccfd853a);
1920
+ return ret;
1921
+ },
1922
+ __wbindgen_cast_0000000000000003: function(arg0, arg1) {
1923
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [], shim_idx: 526, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1924
+ const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__ha272cf34a0c89527);
1925
+ return ret;
1926
+ },
1927
+ __wbindgen_cast_0000000000000004: function(arg0, arg1) {
1928
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [], shim_idx: 575, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1929
+ const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h1f68ebdd661f92ac);
1930
+ return ret;
1931
+ },
1932
+ __wbindgen_cast_0000000000000005: function(arg0, arg1) {
1933
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [], shim_idx: 733, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1934
+ const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__hc6d79abdb072c199);
1935
+ return ret;
1936
+ },
1937
+ __wbindgen_cast_0000000000000006: function(arg0) {
1938
+ // Cast intrinsic for `F64 -> Externref`.
1939
+ const ret = arg0;
1940
+ return ret;
1941
+ },
1942
+ __wbindgen_cast_0000000000000007: function(arg0) {
1943
+ // Cast intrinsic for `I64 -> Externref`.
1944
+ const ret = arg0;
1945
+ return ret;
1946
+ },
1947
+ __wbindgen_cast_0000000000000008: function(arg0, arg1) {
1948
+ // Cast intrinsic for `Ref(Slice(U8)) -> NamedExternref("Uint8Array")`.
1949
+ const ret = getArrayU8FromWasm0(arg0, arg1);
1950
+ return ret;
1951
+ },
1952
+ __wbindgen_cast_0000000000000009: function(arg0, arg1) {
1953
+ // Cast intrinsic for `Ref(String) -> Externref`.
1954
+ const ret = getStringFromWasm0(arg0, arg1);
1955
+ return ret;
1956
+ },
1957
+ __wbindgen_cast_000000000000000a: function(arg0) {
1958
+ // Cast intrinsic for `U64 -> Externref`.
1959
+ const ret = BigInt.asUintN(64, arg0);
1960
+ return ret;
1961
+ },
1962
+ __wbindgen_init_externref_table: function() {
1963
+ const table = wasm.__wbindgen_externrefs;
1964
+ const offset = table.grow(4);
1965
+ table.set(0, undefined);
1966
+ table.set(offset + 0, undefined);
1967
+ table.set(offset + 1, null);
1968
+ table.set(offset + 2, true);
1969
+ table.set(offset + 3, false);
1970
+ },
1971
+ };
1972
+ return {
1973
+ __proto__: null,
1974
+ "./cedarling_wasm_bg.js": import0,
1975
+ };
1976
+ }
1333
1977
 
1334
- exports.__wbg_prototypesetcall_dfe9b766cdc1f1fd = function(arg0, arg1, arg2) {
1335
- Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), arg2);
1336
- };
1978
+ function wasm_bindgen__convert__closures_____invoke__ha272cf34a0c89527(arg0, arg1) {
1979
+ wasm.wasm_bindgen__convert__closures_____invoke__ha272cf34a0c89527(arg0, arg1);
1980
+ }
1337
1981
 
1338
- exports.__wbg_push_7d9be8f38fc13975 = function(arg0, arg1) {
1339
- const ret = arg0.push(arg1);
1340
- return ret;
1341
- };
1982
+ function wasm_bindgen__convert__closures_____invoke__h1f68ebdd661f92ac(arg0, arg1) {
1983
+ wasm.wasm_bindgen__convert__closures_____invoke__h1f68ebdd661f92ac(arg0, arg1);
1984
+ }
1342
1985
 
1343
- exports.__wbg_queueMicrotask_9b549dfce8865860 = function(arg0) {
1344
- const ret = arg0.queueMicrotask;
1345
- return ret;
1346
- };
1986
+ function wasm_bindgen__convert__closures_____invoke__hc6d79abdb072c199(arg0, arg1) {
1987
+ wasm.wasm_bindgen__convert__closures_____invoke__hc6d79abdb072c199(arg0, arg1);
1988
+ }
1347
1989
 
1348
- exports.__wbg_queueMicrotask_fca69f5bfad613a5 = function(arg0) {
1349
- queueMicrotask(arg0);
1350
- };
1990
+ function wasm_bindgen__convert__closures_____invoke__h170c6019ccfd853a(arg0, arg1, arg2) {
1991
+ wasm.wasm_bindgen__convert__closures_____invoke__h170c6019ccfd853a(arg0, arg1, arg2);
1992
+ }
1351
1993
 
1352
- exports.__wbg_randomFillSync_ac0988aba3254290 = function() { return handleError(function (arg0, arg1) {
1353
- arg0.randomFillSync(arg1);
1354
- }, arguments) };
1994
+ function wasm_bindgen__convert__closures_____invoke__h80274e53af2c4a90(arg0, arg1, arg2) {
1995
+ const ret = wasm.wasm_bindgen__convert__closures_____invoke__h80274e53af2c4a90(arg0, arg1, arg2);
1996
+ if (ret[1]) {
1997
+ throw takeFromExternrefTable0(ret[0]);
1998
+ }
1999
+ }
1355
2000
 
1356
- exports.__wbg_require_60cc747a6bc5215a = function() { return handleError(function () {
1357
- const ret = module.require;
1358
- return ret;
1359
- }, arguments) };
2001
+ function wasm_bindgen__convert__closures_____invoke__h66f11f9242c621fe(arg0, arg1, arg2, arg3) {
2002
+ wasm.wasm_bindgen__convert__closures_____invoke__h66f11f9242c621fe(arg0, arg1, arg2, arg3);
2003
+ }
1360
2004
 
1361
- exports.__wbg_resolve_fd5bfbaa4ce36e1e = function(arg0) {
1362
- const ret = Promise.resolve(arg0);
1363
- return ret;
1364
- };
1365
2005
 
1366
- exports.__wbg_setTimeout_4302406184dcc5be = function(arg0, arg1) {
1367
- const ret = setTimeout(arg0, arg1);
1368
- return ret;
1369
- };
2006
+ const __wbindgen_enum_ReadableStreamType = ["bytes"];
1370
2007
 
1371
- exports.__wbg_set_3f1d0b984ed272ed = function(arg0, arg1, arg2) {
1372
- arg0[arg1] = arg2;
1373
- };
1374
2008
 
1375
- exports.__wbg_set_781438a03c0c3c81 = function() { return handleError(function (arg0, arg1, arg2) {
1376
- const ret = Reflect.set(arg0, arg1, arg2);
1377
- return ret;
1378
- }, arguments) };
2009
+ const __wbindgen_enum_ReferrerPolicy = ["", "no-referrer", "no-referrer-when-downgrade", "origin", "origin-when-cross-origin", "unsafe-url", "same-origin", "strict-origin", "strict-origin-when-cross-origin"];
1379
2010
 
1380
- exports.__wbg_set_7df433eea03a5c14 = function(arg0, arg1, arg2) {
1381
- arg0[arg1 >>> 0] = arg2;
1382
- };
1383
2011
 
1384
- exports.__wbg_set_body_8e743242d6076a4f = function(arg0, arg1) {
1385
- arg0.body = arg1;
1386
- };
2012
+ const __wbindgen_enum_RequestCache = ["default", "no-store", "reload", "no-cache", "force-cache", "only-if-cached"];
1387
2013
 
1388
- exports.__wbg_set_cache_0e437c7c8e838b9b = function(arg0, arg1) {
1389
- arg0.cache = __wbindgen_enum_RequestCache[arg1];
1390
- };
1391
2014
 
1392
- exports.__wbg_set_credentials_55ae7c3c106fd5be = function(arg0, arg1) {
1393
- arg0.credentials = __wbindgen_enum_RequestCredentials[arg1];
1394
- };
2015
+ const __wbindgen_enum_RequestCredentials = ["omit", "same-origin", "include"];
1395
2016
 
1396
- exports.__wbg_set_efaaf145b9377369 = function(arg0, arg1, arg2) {
1397
- const ret = arg0.set(arg1, arg2);
1398
- return ret;
1399
- };
1400
2017
 
1401
- exports.__wbg_set_headers_5671cf088e114d2b = function(arg0, arg1) {
1402
- arg0.headers = arg1;
1403
- };
2018
+ const __wbindgen_enum_RequestMode = ["same-origin", "no-cors", "cors", "navigate"];
1404
2019
 
1405
- exports.__wbg_set_method_76c69e41b3570627 = function(arg0, arg1, arg2) {
1406
- arg0.method = getStringFromWasm0(arg1, arg2);
1407
- };
1408
2020
 
1409
- exports.__wbg_set_mode_611016a6818fc690 = function(arg0, arg1) {
1410
- arg0.mode = __wbindgen_enum_RequestMode[arg1];
1411
- };
2021
+ const __wbindgen_enum_RequestRedirect = ["follow", "error", "manual"];
2022
+ const AuthorizeResultFinalization = (typeof FinalizationRegistry === 'undefined')
2023
+ ? { register: () => {}, unregister: () => {} }
2024
+ : new FinalizationRegistry(ptr => wasm.__wbg_authorizeresult_free(ptr >>> 0, 1));
2025
+ const AuthorizeResultResponseFinalization = (typeof FinalizationRegistry === 'undefined')
2026
+ ? { register: () => {}, unregister: () => {} }
2027
+ : new FinalizationRegistry(ptr => wasm.__wbg_authorizeresultresponse_free(ptr >>> 0, 1));
2028
+ const CedarlingFinalization = (typeof FinalizationRegistry === 'undefined')
2029
+ ? { register: () => {}, unregister: () => {} }
2030
+ : new FinalizationRegistry(ptr => wasm.__wbg_cedarling_free(ptr >>> 0, 1));
2031
+ const DataEntryFinalization = (typeof FinalizationRegistry === 'undefined')
2032
+ ? { register: () => {}, unregister: () => {} }
2033
+ : new FinalizationRegistry(ptr => wasm.__wbg_dataentry_free(ptr >>> 0, 1));
2034
+ const DataStoreStatsFinalization = (typeof FinalizationRegistry === 'undefined')
2035
+ ? { register: () => {}, unregister: () => {} }
2036
+ : new FinalizationRegistry(ptr => wasm.__wbg_datastorestats_free(ptr >>> 0, 1));
2037
+ const DiagnosticsFinalization = (typeof FinalizationRegistry === 'undefined')
2038
+ ? { register: () => {}, unregister: () => {} }
2039
+ : new FinalizationRegistry(ptr => wasm.__wbg_diagnostics_free(ptr >>> 0, 1));
2040
+ const IntoUnderlyingByteSourceFinalization = (typeof FinalizationRegistry === 'undefined')
2041
+ ? { register: () => {}, unregister: () => {} }
2042
+ : new FinalizationRegistry(ptr => wasm.__wbg_intounderlyingbytesource_free(ptr >>> 0, 1));
2043
+ const IntoUnderlyingSinkFinalization = (typeof FinalizationRegistry === 'undefined')
2044
+ ? { register: () => {}, unregister: () => {} }
2045
+ : new FinalizationRegistry(ptr => wasm.__wbg_intounderlyingsink_free(ptr >>> 0, 1));
2046
+ const IntoUnderlyingSourceFinalization = (typeof FinalizationRegistry === 'undefined')
2047
+ ? { register: () => {}, unregister: () => {} }
2048
+ : new FinalizationRegistry(ptr => wasm.__wbg_intounderlyingsource_free(ptr >>> 0, 1));
2049
+ const MultiIssuerAuthorizeResultFinalization = (typeof FinalizationRegistry === 'undefined')
2050
+ ? { register: () => {}, unregister: () => {} }
2051
+ : new FinalizationRegistry(ptr => wasm.__wbg_multiissuerauthorizeresult_free(ptr >>> 0, 1));
2052
+ const PolicyEvaluationErrorFinalization = (typeof FinalizationRegistry === 'undefined')
2053
+ ? { register: () => {}, unregister: () => {} }
2054
+ : new FinalizationRegistry(ptr => wasm.__wbg_policyevaluationerror_free(ptr >>> 0, 1));
1412
2055
 
1413
- exports.__wbg_set_signal_e89be862d0091009 = function(arg0, arg1) {
1414
- arg0.signal = arg1;
1415
- };
2056
+ function addToExternrefTable0(obj) {
2057
+ const idx = wasm.__externref_table_alloc();
2058
+ wasm.__wbindgen_externrefs.set(idx, obj);
2059
+ return idx;
2060
+ }
1416
2061
 
1417
- exports.__wbg_signal_3c14fbdc89694b39 = function(arg0) {
1418
- const ret = arg0.signal;
1419
- return ret;
1420
- };
2062
+ function _assertClass(instance, klass) {
2063
+ if (!(instance instanceof klass)) {
2064
+ throw new Error(`expected instance of ${klass.name}`);
2065
+ }
2066
+ }
1421
2067
 
1422
- exports.__wbg_static_accessor_GLOBAL_769e6b65d6557335 = function() {
1423
- const ret = typeof global === 'undefined' ? null : global;
1424
- return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
1425
- };
2068
+ const CLOSURE_DTORS = (typeof FinalizationRegistry === 'undefined')
2069
+ ? { register: () => {}, unregister: () => {} }
2070
+ : new FinalizationRegistry(state => wasm.__wbindgen_destroy_closure(state.a, state.b));
1426
2071
 
1427
- exports.__wbg_static_accessor_GLOBAL_THIS_60cf02db4de8e1c1 = function() {
1428
- const ret = typeof globalThis === 'undefined' ? null : globalThis;
1429
- return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
1430
- };
2072
+ function debugString(val) {
2073
+ // primitive types
2074
+ const type = typeof val;
2075
+ if (type == 'number' || type == 'boolean' || val == null) {
2076
+ return `${val}`;
2077
+ }
2078
+ if (type == 'string') {
2079
+ return `"${val}"`;
2080
+ }
2081
+ if (type == 'symbol') {
2082
+ const description = val.description;
2083
+ if (description == null) {
2084
+ return 'Symbol';
2085
+ } else {
2086
+ return `Symbol(${description})`;
2087
+ }
2088
+ }
2089
+ if (type == 'function') {
2090
+ const name = val.name;
2091
+ if (typeof name == 'string' && name.length > 0) {
2092
+ return `Function(${name})`;
2093
+ } else {
2094
+ return 'Function';
2095
+ }
2096
+ }
2097
+ // objects
2098
+ if (Array.isArray(val)) {
2099
+ const length = val.length;
2100
+ let debug = '[';
2101
+ if (length > 0) {
2102
+ debug += debugString(val[0]);
2103
+ }
2104
+ for(let i = 1; i < length; i++) {
2105
+ debug += ', ' + debugString(val[i]);
2106
+ }
2107
+ debug += ']';
2108
+ return debug;
2109
+ }
2110
+ // Test for built-in
2111
+ const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
2112
+ let className;
2113
+ if (builtInMatches && builtInMatches.length > 1) {
2114
+ className = builtInMatches[1];
2115
+ } else {
2116
+ // Failed to match the standard '[object ClassName]'
2117
+ return toString.call(val);
2118
+ }
2119
+ if (className == 'Object') {
2120
+ // we're a user defined class or Object
2121
+ // JSON.stringify avoids problems with cycles, and is generally much
2122
+ // easier than looping through ownProperties of `val`.
2123
+ try {
2124
+ return 'Object(' + JSON.stringify(val) + ')';
2125
+ } catch (_) {
2126
+ return 'Object';
2127
+ }
2128
+ }
2129
+ // errors
2130
+ if (val instanceof Error) {
2131
+ return `${val.name}: ${val.message}\n${val.stack}`;
2132
+ }
2133
+ // TODO we could test for more things here, like `Set`s and `Map`s.
2134
+ return className;
2135
+ }
1431
2136
 
1432
- exports.__wbg_static_accessor_SELF_08f5a74c69739274 = function() {
1433
- const ret = typeof self === 'undefined' ? null : self;
1434
- return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
1435
- };
2137
+ function getArrayJsValueFromWasm0(ptr, len) {
2138
+ ptr = ptr >>> 0;
2139
+ const mem = getDataViewMemory0();
2140
+ const result = [];
2141
+ for (let i = ptr; i < ptr + 4 * len; i += 4) {
2142
+ result.push(wasm.__wbindgen_externrefs.get(mem.getUint32(i, true)));
2143
+ }
2144
+ wasm.__externref_drop_slice(ptr, len);
2145
+ return result;
2146
+ }
1436
2147
 
1437
- exports.__wbg_static_accessor_WINDOW_a8924b26aa92d024 = function() {
1438
- const ret = typeof window === 'undefined' ? null : window;
1439
- return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
1440
- };
2148
+ function getArrayU8FromWasm0(ptr, len) {
2149
+ ptr = ptr >>> 0;
2150
+ return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
2151
+ }
1441
2152
 
1442
- exports.__wbg_status_9bfc680efca4bdfd = function(arg0) {
1443
- const ret = arg0.status;
1444
- return ret;
1445
- };
2153
+ let cachedDataViewMemory0 = null;
2154
+ function getDataViewMemory0() {
2155
+ if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
2156
+ cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
2157
+ }
2158
+ return cachedDataViewMemory0;
2159
+ }
1446
2160
 
1447
- exports.__wbg_stringify_655a6390e1f5eb6b = function() { return handleError(function (arg0) {
1448
- const ret = JSON.stringify(arg0);
1449
- return ret;
1450
- }, arguments) };
2161
+ function getStringFromWasm0(ptr, len) {
2162
+ ptr = ptr >>> 0;
2163
+ return decodeText(ptr, len);
2164
+ }
1451
2165
 
1452
- exports.__wbg_subarray_845f2f5bce7d061a = function(arg0, arg1, arg2) {
1453
- const ret = arg0.subarray(arg1 >>> 0, arg2 >>> 0);
1454
- return ret;
1455
- };
2166
+ let cachedUint8ArrayMemory0 = null;
2167
+ function getUint8ArrayMemory0() {
2168
+ if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
2169
+ cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
2170
+ }
2171
+ return cachedUint8ArrayMemory0;
2172
+ }
1456
2173
 
1457
- exports.__wbg_text_51046bb33d257f63 = function() { return handleError(function (arg0) {
1458
- const ret = arg0.text();
1459
- return ret;
1460
- }, arguments) };
2174
+ function handleError(f, args) {
2175
+ try {
2176
+ return f.apply(this, args);
2177
+ } catch (e) {
2178
+ const idx = addToExternrefTable0(e);
2179
+ wasm.__wbindgen_exn_store(idx);
2180
+ }
2181
+ }
1461
2182
 
1462
- exports.__wbg_then_429f7caf1026411d = function(arg0, arg1, arg2) {
1463
- const ret = arg0.then(arg1, arg2);
1464
- return ret;
1465
- };
2183
+ function isLikeNone(x) {
2184
+ return x === undefined || x === null;
2185
+ }
1466
2186
 
1467
- exports.__wbg_then_4f95312d68691235 = function(arg0, arg1) {
1468
- const ret = arg0.then(arg1);
1469
- return ret;
1470
- };
2187
+ function makeMutClosure(arg0, arg1, f) {
2188
+ const state = { a: arg0, b: arg1, cnt: 1 };
2189
+ const real = (...args) => {
1471
2190
 
1472
- exports.__wbg_trace_b213249bfc587469 = function(arg0) {
1473
- console.trace(...arg0);
1474
- };
2191
+ // First up with a closure we increment the internal reference
2192
+ // count. This ensures that the Rust closure environment won't
2193
+ // be deallocated while we're invoking it.
2194
+ state.cnt++;
2195
+ const a = state.a;
2196
+ state.a = 0;
2197
+ try {
2198
+ return f(a, state.b, ...args);
2199
+ } finally {
2200
+ state.a = a;
2201
+ real._wbg_cb_unref();
2202
+ }
2203
+ };
2204
+ real._wbg_cb_unref = () => {
2205
+ if (--state.cnt === 0) {
2206
+ wasm.__wbindgen_destroy_closure(state.a, state.b);
2207
+ state.a = 0;
2208
+ CLOSURE_DTORS.unregister(state);
2209
+ }
2210
+ };
2211
+ CLOSURE_DTORS.register(real, state, state);
2212
+ return real;
2213
+ }
1475
2214
 
1476
- exports.__wbg_url_b6d11838a4f95198 = function(arg0, arg1) {
1477
- const ret = arg1.url;
1478
- const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1479
- const len1 = WASM_VECTOR_LEN;
1480
- getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1481
- getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1482
- };
2215
+ function passStringToWasm0(arg, malloc, realloc) {
2216
+ if (realloc === undefined) {
2217
+ const buf = cachedTextEncoder.encode(arg);
2218
+ const ptr = malloc(buf.length, 1) >>> 0;
2219
+ getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
2220
+ WASM_VECTOR_LEN = buf.length;
2221
+ return ptr;
2222
+ }
1483
2223
 
1484
- exports.__wbg_value_57b7b035e117f7ee = function(arg0) {
1485
- const ret = arg0.value;
1486
- return ret;
1487
- };
2224
+ let len = arg.length;
2225
+ let ptr = malloc(len, 1) >>> 0;
1488
2226
 
1489
- exports.__wbg_versions_c01dfd4722a88165 = function(arg0) {
1490
- const ret = arg0.versions;
1491
- return ret;
1492
- };
2227
+ const mem = getUint8ArrayMemory0();
1493
2228
 
1494
- exports.__wbg_warn_14a9fd75d0abe5d7 = function(arg0) {
1495
- console.warn(...arg0);
1496
- };
2229
+ let offset = 0;
1497
2230
 
1498
- exports.__wbindgen_cast_0e8a9f348831646f = function(arg0, arg1) {
1499
- // Cast intrinsic for `Closure(Closure { dtor_idx: 510, function: Function { arguments: [], shim_idx: 511, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1500
- const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__h3edd0da2e16650db, wasm_bindgen__convert__closures_____invoke__h8a10b0fb25c32ce7);
1501
- return ret;
1502
- };
2231
+ for (; offset < len; offset++) {
2232
+ const code = arg.charCodeAt(offset);
2233
+ if (code > 0x7F) break;
2234
+ mem[ptr + offset] = code;
2235
+ }
2236
+ if (offset !== len) {
2237
+ if (offset !== 0) {
2238
+ arg = arg.slice(offset);
2239
+ }
2240
+ ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
2241
+ const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
2242
+ const ret = cachedTextEncoder.encodeInto(arg, view);
1503
2243
 
1504
- exports.__wbindgen_cast_2241b6af4c4b2941 = function(arg0, arg1) {
1505
- // Cast intrinsic for `Ref(String) -> Externref`.
1506
- const ret = getStringFromWasm0(arg0, arg1);
1507
- return ret;
1508
- };
2244
+ offset += ret.written;
2245
+ ptr = realloc(ptr, len, offset, 1) >>> 0;
2246
+ }
1509
2247
 
1510
- exports.__wbindgen_cast_317cf9338e91f114 = function(arg0, arg1) {
1511
- // Cast intrinsic for `Closure(Closure { dtor_idx: 555, function: Function { arguments: [Externref], shim_idx: 556, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1512
- const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__h8554173f80599467, wasm_bindgen__convert__closures_____invoke__h7f8b71809a8d7577);
1513
- return ret;
1514
- };
2248
+ WASM_VECTOR_LEN = offset;
2249
+ return ptr;
2250
+ }
1515
2251
 
1516
- exports.__wbindgen_cast_4625c577ab2ec9ee = function(arg0) {
1517
- // Cast intrinsic for `U64 -> Externref`.
1518
- const ret = BigInt.asUintN(64, arg0);
1519
- return ret;
1520
- };
2252
+ function takeFromExternrefTable0(idx) {
2253
+ const value = wasm.__wbindgen_externrefs.get(idx);
2254
+ wasm.__externref_table_dealloc(idx);
2255
+ return value;
2256
+ }
1521
2257
 
1522
- exports.__wbindgen_cast_9ae0607507abb057 = function(arg0) {
1523
- // Cast intrinsic for `I64 -> Externref`.
1524
- const ret = arg0;
1525
- return ret;
1526
- };
2258
+ let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
2259
+ cachedTextDecoder.decode();
2260
+ function decodeText(ptr, len) {
2261
+ return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
2262
+ }
1527
2263
 
1528
- exports.__wbindgen_cast_cb9088102bce6b30 = function(arg0, arg1) {
1529
- // Cast intrinsic for `Ref(Slice(U8)) -> NamedExternref("Uint8Array")`.
1530
- const ret = getArrayU8FromWasm0(arg0, arg1);
1531
- return ret;
1532
- };
2264
+ const cachedTextEncoder = new TextEncoder();
1533
2265
 
1534
- exports.__wbindgen_cast_d6cd19b81560fd6e = function(arg0) {
1535
- // Cast intrinsic for `F64 -> Externref`.
1536
- const ret = arg0;
1537
- return ret;
1538
- };
2266
+ if (!('encodeInto' in cachedTextEncoder)) {
2267
+ cachedTextEncoder.encodeInto = function (arg, view) {
2268
+ const buf = cachedTextEncoder.encode(arg);
2269
+ view.set(buf);
2270
+ return {
2271
+ read: arg.length,
2272
+ written: buf.length
2273
+ };
2274
+ };
2275
+ }
1539
2276
 
1540
- exports.__wbindgen_init_externref_table = function() {
1541
- const table = wasm.__wbindgen_externrefs;
1542
- const offset = table.grow(4);
1543
- table.set(0, undefined);
1544
- table.set(offset + 0, undefined);
1545
- table.set(offset + 1, null);
1546
- table.set(offset + 2, true);
1547
- table.set(offset + 3, false);
1548
- };
2277
+ let WASM_VECTOR_LEN = 0;
1549
2278
 
1550
2279
  const wasmPath = `${__dirname}/cedarling_wasm_bg.wasm`;
1551
2280
  const wasmBytes = require('fs').readFileSync(wasmPath);
1552
2281
  const wasmModule = new WebAssembly.Module(wasmBytes);
1553
- const wasm = exports.__wasm = new WebAssembly.Instance(wasmModule, imports).exports;
1554
-
2282
+ let wasm = new WebAssembly.Instance(wasmModule, __wbg_get_imports()).exports;
1555
2283
  wasm.__wbindgen_start();