@janssenproject/cedarling_wasm 2.0.0 → 2.0.1-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,275 +1,10 @@
1
- let wasm;
1
+ /* @ts-self-types="./cedarling_wasm.d.ts" */
2
2
 
3
- const heap = new Array(128).fill(undefined);
4
-
5
- heap.push(undefined, null, true, false);
6
-
7
- function getObject(idx) { return heap[idx]; }
8
-
9
- let WASM_VECTOR_LEN = 0;
10
-
11
- let cachedUint8ArrayMemory0 = null;
12
-
13
- function getUint8ArrayMemory0() {
14
- if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
15
- cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
16
- }
17
- return cachedUint8ArrayMemory0;
18
- }
19
-
20
- const cachedTextEncoder = (typeof TextEncoder !== 'undefined' ? new TextEncoder('utf-8') : { encode: () => { throw Error('TextEncoder not available') } } );
21
-
22
- const encodeString = (typeof cachedTextEncoder.encodeInto === 'function'
23
- ? function (arg, view) {
24
- return cachedTextEncoder.encodeInto(arg, view);
25
- }
26
- : function (arg, view) {
27
- const buf = cachedTextEncoder.encode(arg);
28
- view.set(buf);
29
- return {
30
- read: arg.length,
31
- written: buf.length
32
- };
33
- });
34
-
35
- function passStringToWasm0(arg, malloc, realloc) {
36
-
37
- if (realloc === undefined) {
38
- const buf = cachedTextEncoder.encode(arg);
39
- const ptr = malloc(buf.length, 1) >>> 0;
40
- getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
41
- WASM_VECTOR_LEN = buf.length;
42
- return ptr;
43
- }
44
-
45
- let len = arg.length;
46
- let ptr = malloc(len, 1) >>> 0;
47
-
48
- const mem = getUint8ArrayMemory0();
49
-
50
- let offset = 0;
51
-
52
- for (; offset < len; offset++) {
53
- const code = arg.charCodeAt(offset);
54
- if (code > 0x7F) break;
55
- mem[ptr + offset] = code;
56
- }
57
-
58
- if (offset !== len) {
59
- if (offset !== 0) {
60
- arg = arg.slice(offset);
61
- }
62
- ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
63
- const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
64
- const ret = encodeString(arg, view);
65
-
66
- offset += ret.written;
67
- ptr = realloc(ptr, len, offset, 1) >>> 0;
68
- }
69
-
70
- WASM_VECTOR_LEN = offset;
71
- return ptr;
72
- }
73
-
74
- let cachedDataViewMemory0 = null;
75
-
76
- function getDataViewMemory0() {
77
- if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
78
- cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
79
- }
80
- return cachedDataViewMemory0;
81
- }
82
-
83
- const cachedTextDecoder = (typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }) : { decode: () => { throw Error('TextDecoder not available') } } );
84
-
85
- if (typeof TextDecoder !== 'undefined') { cachedTextDecoder.decode(); };
86
-
87
- function getStringFromWasm0(ptr, len) {
88
- ptr = ptr >>> 0;
89
- return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
90
- }
91
-
92
- let heap_next = heap.length;
93
-
94
- function addHeapObject(obj) {
95
- if (heap_next === heap.length) heap.push(heap.length + 1);
96
- const idx = heap_next;
97
- heap_next = heap[idx];
98
-
99
- heap[idx] = obj;
100
- return idx;
101
- }
102
-
103
- function handleError(f, args) {
104
- try {
105
- return f.apply(this, args);
106
- } catch (e) {
107
- wasm.__wbindgen_export_2(addHeapObject(e));
108
- }
109
- }
110
-
111
- function dropObject(idx) {
112
- if (idx < 132) return;
113
- heap[idx] = heap_next;
114
- heap_next = idx;
115
- }
116
-
117
- function takeObject(idx) {
118
- const ret = getObject(idx);
119
- dropObject(idx);
120
- return ret;
121
- }
122
-
123
- function isLikeNone(x) {
124
- return x === undefined || x === null;
125
- }
126
-
127
- const CLOSURE_DTORS = (typeof FinalizationRegistry === 'undefined')
128
- ? { register: () => {}, unregister: () => {} }
129
- : new FinalizationRegistry(state => {
130
- wasm.__wbindgen_export_3.get(state.dtor)(state.a, state.b)
131
- });
132
-
133
- function makeMutClosure(arg0, arg1, dtor, f) {
134
- const state = { a: arg0, b: arg1, cnt: 1, dtor };
135
- const real = (...args) => {
136
- // First up with a closure we increment the internal reference
137
- // count. This ensures that the Rust closure environment won't
138
- // be deallocated while we're invoking it.
139
- state.cnt++;
140
- const a = state.a;
141
- state.a = 0;
142
- try {
143
- return f(a, state.b, ...args);
144
- } finally {
145
- if (--state.cnt === 0) {
146
- wasm.__wbindgen_export_3.get(state.dtor)(a, state.b);
147
- CLOSURE_DTORS.unregister(state);
148
- } else {
149
- state.a = a;
150
- }
151
- }
152
- };
153
- real.original = state;
154
- CLOSURE_DTORS.register(real, state, state);
155
- return real;
156
- }
157
-
158
- function debugString(val) {
159
- // primitive types
160
- const type = typeof val;
161
- if (type == 'number' || type == 'boolean' || val == null) {
162
- return `${val}`;
163
- }
164
- if (type == 'string') {
165
- return `"${val}"`;
166
- }
167
- if (type == 'symbol') {
168
- const description = val.description;
169
- if (description == null) {
170
- return 'Symbol';
171
- } else {
172
- return `Symbol(${description})`;
173
- }
174
- }
175
- if (type == 'function') {
176
- const name = val.name;
177
- if (typeof name == 'string' && name.length > 0) {
178
- return `Function(${name})`;
179
- } else {
180
- return 'Function';
181
- }
182
- }
183
- // objects
184
- if (Array.isArray(val)) {
185
- const length = val.length;
186
- let debug = '[';
187
- if (length > 0) {
188
- debug += debugString(val[0]);
189
- }
190
- for(let i = 1; i < length; i++) {
191
- debug += ', ' + debugString(val[i]);
192
- }
193
- debug += ']';
194
- return debug;
195
- }
196
- // Test for built-in
197
- const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
198
- let className;
199
- if (builtInMatches && builtInMatches.length > 1) {
200
- className = builtInMatches[1];
201
- } else {
202
- // Failed to match the standard '[object ClassName]'
203
- return toString.call(val);
204
- }
205
- if (className == 'Object') {
206
- // we're a user defined class or Object
207
- // JSON.stringify avoids problems with cycles, and is generally much
208
- // easier than looping through ownProperties of `val`.
209
- try {
210
- return 'Object(' + JSON.stringify(val) + ')';
211
- } catch (_) {
212
- return 'Object';
213
- }
214
- }
215
- // errors
216
- if (val instanceof Error) {
217
- return `${val.name}: ${val.message}\n${val.stack}`;
218
- }
219
- // TODO we could test for more things here, like `Set`s and `Map`s.
220
- return className;
221
- }
222
- /**
223
- * Create a new instance of the Cedarling application.
224
- * This function can take as config parameter the eather `Map` other `Object`
225
- * @param {any} config
226
- * @returns {Promise<Cedarling>}
227
- */
228
- export function init(config) {
229
- const ret = wasm.init(addHeapObject(config));
230
- return takeObject(ret);
231
- }
232
-
233
- function getArrayJsValueFromWasm0(ptr, len) {
234
- ptr = ptr >>> 0;
235
- const mem = getDataViewMemory0();
236
- const result = [];
237
- for (let i = ptr; i < ptr + 4 * len; i += 4) {
238
- result.push(takeObject(mem.getUint32(i, true)));
239
- }
240
- return result;
241
- }
242
-
243
- function _assertClass(instance, klass) {
244
- if (!(instance instanceof klass)) {
245
- throw new Error(`expected instance of ${klass.name}`);
246
- }
247
- }
248
- function __wbg_adapter_48(arg0, arg1) {
249
- wasm.__wbindgen_export_5(arg0, arg1);
250
- }
251
-
252
- function __wbg_adapter_51(arg0, arg1, arg2) {
253
- wasm.__wbindgen_export_6(arg0, arg1, addHeapObject(arg2));
254
- }
255
-
256
- function __wbg_adapter_173(arg0, arg1, arg2, arg3) {
257
- wasm.__wbindgen_export_7(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
258
- }
259
-
260
- const __wbindgen_enum_RequestCredentials = ["omit", "same-origin", "include"];
261
-
262
- const __wbindgen_enum_RequestMode = ["same-origin", "no-cors", "cors", "navigate"];
263
-
264
- const AuthorizeResultFinalization = (typeof FinalizationRegistry === 'undefined')
265
- ? { register: () => {}, unregister: () => {} }
266
- : new FinalizationRegistry(ptr => wasm.__wbg_authorizeresult_free(ptr >>> 0, 1));
267
3
  /**
268
4
  * A WASM wrapper for the Rust `cedarling::AuthorizeResult` struct.
269
5
  * Represents the result of an authorization request.
270
6
  */
271
- export class AuthorizeResult {
272
-
7
+ class AuthorizeResult {
273
8
  static __wrap(ptr) {
274
9
  ptr = ptr >>> 0;
275
10
  const obj = Object.create(AuthorizeResult.prototype);
@@ -277,57 +12,31 @@ export class AuthorizeResult {
277
12
  AuthorizeResultFinalization.register(obj, obj.__wbg_ptr, obj);
278
13
  return obj;
279
14
  }
280
-
281
15
  __destroy_into_raw() {
282
16
  const ptr = this.__wbg_ptr;
283
17
  this.__wbg_ptr = 0;
284
18
  AuthorizeResultFinalization.unregister(this);
285
19
  return ptr;
286
20
  }
287
-
288
21
  free() {
289
22
  const ptr = this.__destroy_into_raw();
290
23
  wasm.__wbg_authorizeresult_free(ptr, 0);
291
24
  }
292
25
  /**
293
- * Result of authorization where principal is `Jans::Workload`
294
- * @returns {AuthorizeResultResponse | undefined}
295
- */
296
- get workload() {
297
- const ret = wasm.__wbg_get_authorizeresult_workload(this.__wbg_ptr);
298
- return ret === 0 ? undefined : AuthorizeResultResponse.__wrap(ret);
299
- }
300
- /**
301
- * Result of authorization where principal is `Jans::Workload`
302
- * @param {AuthorizeResultResponse | null} [arg0]
303
- */
304
- set workload(arg0) {
305
- let ptr0 = 0;
306
- if (!isLikeNone(arg0)) {
307
- _assertClass(arg0, AuthorizeResultResponse);
308
- ptr0 = arg0.__destroy_into_raw();
309
- }
310
- wasm.__wbg_set_authorizeresult_workload(this.__wbg_ptr, ptr0);
311
- }
312
- /**
313
- * Result of authorization where principal is `Jans::User`
314
- * @returns {AuthorizeResultResponse | undefined}
315
- */
316
- get person() {
317
- const ret = wasm.__wbg_get_authorizeresult_person(this.__wbg_ptr);
318
- return ret === 0 ? undefined : AuthorizeResultResponse.__wrap(ret);
319
- }
320
- /**
321
- * Result of authorization where principal is `Jans::User`
322
- * @param {AuthorizeResultResponse | null} [arg0]
26
+ * Convert `AuthorizeResult` to json string value
27
+ * @returns {string}
323
28
  */
324
- set person(arg0) {
325
- let ptr0 = 0;
326
- if (!isLikeNone(arg0)) {
327
- _assertClass(arg0, AuthorizeResultResponse);
328
- ptr0 = arg0.__destroy_into_raw();
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);
329
39
  }
330
- wasm.__wbg_set_authorizeresult_person(this.__wbg_ptr, ptr0);
331
40
  }
332
41
  /**
333
42
  * Result of authorization
@@ -341,17 +50,6 @@ export class AuthorizeResult {
341
50
  const ret = wasm.__wbg_get_authorizeresult_decision(this.__wbg_ptr);
342
51
  return ret !== 0;
343
52
  }
344
- /**
345
- * Result of authorization
346
- * true means `ALLOW`
347
- * false means `Deny`
348
- *
349
- * this field is [`bool`] type to be compatible with [authzen Access Evaluation Decision](https://openid.github.io/authzen/#section-6.2.1).
350
- * @param {boolean} arg0
351
- */
352
- set decision(arg0) {
353
- wasm.__wbg_set_authorizeresult_decision(this.__wbg_ptr, arg0);
354
- }
355
53
  /**
356
54
  * Request ID of the authorization request
357
55
  * @returns {string}
@@ -360,68 +58,60 @@ export class AuthorizeResult {
360
58
  let deferred1_0;
361
59
  let deferred1_1;
362
60
  try {
363
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
364
- wasm.__wbg_get_authorizeresult_request_id(retptr, this.__wbg_ptr);
365
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
366
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
367
- deferred1_0 = r0;
368
- deferred1_1 = r1;
369
- return getStringFromWasm0(r0, r1);
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]);
370
65
  } finally {
371
- wasm.__wbindgen_add_to_stack_pointer(16);
372
- wasm.__wbindgen_export_4(deferred1_0, deferred1_1, 1);
66
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
373
67
  }
374
68
  }
375
69
  /**
376
- * Request ID of the authorization request
377
- * @param {string} arg0
70
+ * Cedar authorization response for the request.
71
+ * @returns {AuthorizeResultResponse}
378
72
  */
379
- set request_id(arg0) {
380
- const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
381
- const len0 = WASM_VECTOR_LEN;
382
- wasm.__wbg_set_authorizeresult_request_id(this.__wbg_ptr, ptr0, len0);
73
+ get response() {
74
+ const ret = wasm.__wbg_get_authorizeresult_response(this.__wbg_ptr);
75
+ return AuthorizeResultResponse.__wrap(ret);
383
76
  }
384
77
  /**
385
- * Convert `AuthorizeResult` to json string value
386
- * @returns {string}
387
- */
388
- json_string() {
389
- let deferred1_0;
390
- let deferred1_1;
391
- try {
392
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
393
- wasm.authorizeresult_json_string(retptr, this.__wbg_ptr);
394
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
395
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
396
- deferred1_0 = r0;
397
- deferred1_1 = r1;
398
- return getStringFromWasm0(r0, r1);
399
- } finally {
400
- wasm.__wbindgen_add_to_stack_pointer(16);
401
- wasm.__wbindgen_export_4(deferred1_0, deferred1_1, 1);
402
- }
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);
403
87
  }
404
88
  /**
405
- * @param {string} principal
406
- * @returns {AuthorizeResultResponse | undefined}
89
+ * Request ID of the authorization request
90
+ * @param {string} arg0
407
91
  */
408
- principal(principal) {
409
- const ptr0 = passStringToWasm0(principal, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
92
+ set request_id(arg0) {
93
+ const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
410
94
  const len0 = WASM_VECTOR_LEN;
411
- const ret = wasm.authorizeresult_principal(this.__wbg_ptr, ptr0, len0);
412
- return ret === 0 ? undefined : AuthorizeResultResponse.__wrap(ret);
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);
413
105
  }
414
106
  }
107
+ if (Symbol.dispose) AuthorizeResult.prototype[Symbol.dispose] = AuthorizeResult.prototype.free;
108
+ exports.AuthorizeResult = AuthorizeResult;
415
109
 
416
- const AuthorizeResultResponseFinalization = (typeof FinalizationRegistry === 'undefined')
417
- ? { register: () => {}, unregister: () => {} }
418
- : new FinalizationRegistry(ptr => wasm.__wbg_authorizeresultresponse_free(ptr >>> 0, 1));
419
110
  /**
420
111
  * A WASM wrapper for the Rust `cedar_policy::Response` struct.
421
112
  * Represents the result of an authorization request.
422
113
  */
423
- export class AuthorizeResultResponse {
424
-
114
+ class AuthorizeResultResponse {
425
115
  static __wrap(ptr) {
426
116
  ptr = ptr >>> 0;
427
117
  const obj = Object.create(AuthorizeResultResponse.prototype);
@@ -429,14 +119,12 @@ export class AuthorizeResultResponse {
429
119
  AuthorizeResultResponseFinalization.register(obj, obj.__wbg_ptr, obj);
430
120
  return obj;
431
121
  }
432
-
433
122
  __destroy_into_raw() {
434
123
  const ptr = this.__wbg_ptr;
435
124
  this.__wbg_ptr = 0;
436
125
  AuthorizeResultResponseFinalization.unregister(this);
437
126
  return ptr;
438
127
  }
439
-
440
128
  free() {
441
129
  const ptr = this.__destroy_into_raw();
442
130
  wasm.__wbg_authorizeresultresponse_free(ptr, 0);
@@ -458,15 +146,13 @@ export class AuthorizeResultResponse {
458
146
  return Diagnostics.__wrap(ret);
459
147
  }
460
148
  }
149
+ if (Symbol.dispose) AuthorizeResultResponse.prototype[Symbol.dispose] = AuthorizeResultResponse.prototype.free;
150
+ exports.AuthorizeResultResponse = AuthorizeResultResponse;
461
151
 
462
- const CedarlingFinalization = (typeof FinalizationRegistry === 'undefined')
463
- ? { register: () => {}, unregister: () => {} }
464
- : new FinalizationRegistry(ptr => wasm.__wbg_cedarling_free(ptr >>> 0, 1));
465
152
  /**
466
153
  * The instance of the Cedarling application.
467
154
  */
468
- export class Cedarling {
469
-
155
+ class Cedarling {
470
156
  static __wrap(ptr) {
471
157
  ptr = ptr >>> 0;
472
158
  const obj = Object.create(Cedarling.prototype);
@@ -474,77 +160,130 @@ export class Cedarling {
474
160
  CedarlingFinalization.register(obj, obj.__wbg_ptr, obj);
475
161
  return obj;
476
162
  }
477
-
478
163
  __destroy_into_raw() {
479
164
  const ptr = this.__wbg_ptr;
480
165
  this.__wbg_ptr = 0;
481
166
  CedarlingFinalization.unregister(this);
482
167
  return ptr;
483
168
  }
484
-
485
169
  free() {
486
170
  const ptr = this.__destroy_into_raw();
487
171
  wasm.__wbg_cedarling_free(ptr, 0);
488
172
  }
489
173
  /**
490
- * Create a new instance of the Cedarling application.
491
- * Assume that config is `Object`
492
- * @param {object} config
493
- * @returns {Promise<Cedarling>}
494
- */
495
- static new(config) {
496
- const ret = wasm.cedarling_new(addHeapObject(config));
497
- return takeObject(ret);
498
- }
499
- /**
500
- * Create a new instance of the Cedarling application.
501
- * Assume that config is `Map`
502
- * @param {Map<any, any>} config
503
- * @returns {Promise<Cedarling>}
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>}
504
178
  */
505
- static new_from_map(config) {
506
- const ret = wasm.cedarling_new_from_map(addHeapObject(config));
507
- return takeObject(ret);
179
+ authorize_multi_issuer(request) {
180
+ const ret = wasm.cedarling_authorize_multi_issuer(this.__wbg_ptr, request);
181
+ return ret;
508
182
  }
509
183
  /**
510
- * Authorize request
511
- * makes authorization decision based on the [`Request`]
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`.
512
191
  * @param {any} request
513
192
  * @returns {Promise<AuthorizeResult>}
514
193
  */
515
- authorize(request) {
516
- const ret = wasm.cedarling_authorize(this.__wbg_ptr, addHeapObject(request));
517
- return takeObject(ret);
194
+ authorize_unsigned(request) {
195
+ const ret = wasm.cedarling_authorize_unsigned(this.__wbg_ptr, request);
196
+ return ret;
518
197
  }
519
198
  /**
520
- * Authorize request for unsigned principals.
521
- * makes authorization decision based on the [`RequestUnsigned`]
522
- * @param {any} request
523
- * @returns {Promise<AuthorizeResult>}
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
+ * ```
524
207
  */
525
- authorize_unsigned(request) {
526
- const ret = wasm.cedarling_authorize_unsigned(this.__wbg_ptr, addHeapObject(request));
527
- return takeObject(ret);
208
+ clear_data_ctx() {
209
+ const ret = wasm.cedarling_clear_data_ctx(this.__wbg_ptr);
210
+ if (ret[1]) {
211
+ throw takeFromExternrefTable0(ret[0]);
212
+ }
528
213
  }
529
214
  /**
530
- * Get logs and remove them from the storage.
531
- * Returns `Array` of `Map`
215
+ * Get trusted issuer identifiers that failed to load.
216
+ *
217
+ * # Example
218
+ *
219
+ * ```javascript
220
+ * const ids = cedarling.failed_trusted_issuer_ids();
221
+ * ```
532
222
  * @returns {Array<any>}
533
223
  */
534
- pop_logs() {
535
- try {
536
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
537
- wasm.cedarling_pop_logs(retptr, this.__wbg_ptr);
538
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
539
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
540
- var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
541
- if (r2) {
542
- throw takeObject(r1);
543
- }
544
- return takeObject(r0);
545
- } finally {
546
- wasm.__wbindgen_add_to_stack_pointer(16);
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]);
253
+ }
254
+ return takeFromExternrefTable0(ret[0]);
255
+ }
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]);
547
285
  }
286
+ return ret[0] === 0 ? undefined : DataEntry.__wrap(ret[0]);
548
287
  }
549
288
  /**
550
289
  * Get specific log entry.
@@ -553,21 +292,13 @@ export class Cedarling {
553
292
  * @returns {any}
554
293
  */
555
294
  get_log_by_id(id) {
556
- try {
557
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
558
- const ptr0 = passStringToWasm0(id, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
559
- const len0 = WASM_VECTOR_LEN;
560
- wasm.cedarling_get_log_by_id(retptr, this.__wbg_ptr, ptr0, len0);
561
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
562
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
563
- var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
564
- if (r2) {
565
- throw takeObject(r1);
566
- }
567
- return takeObject(r0);
568
- } finally {
569
- wasm.__wbindgen_add_to_stack_pointer(16);
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]);
570
300
  }
301
+ return takeFromExternrefTable0(ret[0]);
571
302
  }
572
303
  /**
573
304
  * Returns a list of all log ids.
@@ -576,33 +307,7 @@ export class Cedarling {
576
307
  */
577
308
  get_log_ids() {
578
309
  const ret = wasm.cedarling_get_log_ids(this.__wbg_ptr);
579
- return takeObject(ret);
580
- }
581
- /**
582
- * Get logs by tag, like `log_kind` or `log level`.
583
- * Tag can be `log_kind`, `log_level`.
584
- * @param {string} tag
585
- * @returns {any[]}
586
- */
587
- get_logs_by_tag(tag) {
588
- try {
589
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
590
- const ptr0 = passStringToWasm0(tag, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
591
- const len0 = WASM_VECTOR_LEN;
592
- wasm.cedarling_get_logs_by_tag(retptr, this.__wbg_ptr, ptr0, len0);
593
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
594
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
595
- var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
596
- var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
597
- if (r3) {
598
- throw takeObject(r2);
599
- }
600
- var v2 = getArrayJsValueFromWasm0(r0, r1).slice();
601
- wasm.__wbindgen_export_4(r0, r1 * 4, 4);
602
- return v2;
603
- } finally {
604
- wasm.__wbindgen_add_to_stack_pointer(16);
605
- }
310
+ return ret;
606
311
  }
607
312
  /**
608
313
  * Get logs by request_id.
@@ -611,24 +316,15 @@ export class Cedarling {
611
316
  * @returns {any[]}
612
317
  */
613
318
  get_logs_by_request_id(request_id) {
614
- try {
615
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
616
- const ptr0 = passStringToWasm0(request_id, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
617
- const len0 = WASM_VECTOR_LEN;
618
- wasm.cedarling_get_logs_by_request_id(retptr, this.__wbg_ptr, ptr0, len0);
619
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
620
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
621
- var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
622
- var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
623
- if (r3) {
624
- throw takeObject(r2);
625
- }
626
- var v2 = getArrayJsValueFromWasm0(r0, r1).slice();
627
- wasm.__wbindgen_export_4(r0, r1 * 4, 4);
628
- return v2;
629
- } finally {
630
- wasm.__wbindgen_add_to_stack_pointer(16);
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]);
631
324
  }
325
+ var v2 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
326
+ wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
327
+ return v2;
632
328
  }
633
329
  /**
634
330
  * Get log by request_id and tag, like composite key `request_id` + `log_kind`.
@@ -639,842 +335,1949 @@ export class Cedarling {
639
335
  * @returns {any[]}
640
336
  */
641
337
  get_logs_by_request_id_and_tag(request_id, tag) {
642
- try {
643
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
644
- const ptr0 = passStringToWasm0(request_id, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
645
- const len0 = WASM_VECTOR_LEN;
646
- const ptr1 = passStringToWasm0(tag, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
647
- const len1 = WASM_VECTOR_LEN;
648
- wasm.cedarling_get_logs_by_request_id_and_tag(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1);
649
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
650
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
651
- var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
652
- var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
653
- if (r3) {
654
- throw takeObject(r2);
655
- }
656
- var v3 = getArrayJsValueFromWasm0(r0, r1).slice();
657
- wasm.__wbindgen_export_4(r0, r1 * 4, 4);
658
- return v3;
659
- } finally {
660
- wasm.__wbindgen_add_to_stack_pointer(16);
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;
349
+ }
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;
366
+ }
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]);
386
+ }
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;
407
+ }
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;
487
+ }
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]);
507
+ }
508
+ return takeFromExternrefTable0(ret[0]);
509
+ }
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
+ }
538
+ }
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]);
661
564
  }
565
+ return ret[0] !== 0;
566
+ }
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;
662
588
  }
663
589
  }
590
+ if (Symbol.dispose) Cedarling.prototype[Symbol.dispose] = Cedarling.prototype.free;
591
+ exports.Cedarling = Cedarling;
664
592
 
665
- const DiagnosticsFinalization = (typeof FinalizationRegistry === 'undefined')
666
- ? { register: () => {}, unregister: () => {} }
667
- : new FinalizationRegistry(ptr => wasm.__wbg_diagnostics_free(ptr >>> 0, 1));
668
593
  /**
669
- * Diagnostics
670
- * ===========
671
- *
672
- * Provides detailed information about how a policy decision was made, including policies that contributed to the decision and any errors encountered during evaluation.
594
+ * A WASM wrapper for the Rust `cedarling::DataEntry` struct.
595
+ * Represents a data entry in the DataStore with value and metadata.
673
596
  */
674
- export class Diagnostics {
675
-
597
+ class DataEntry {
676
598
  static __wrap(ptr) {
677
599
  ptr = ptr >>> 0;
678
- const obj = Object.create(Diagnostics.prototype);
600
+ const obj = Object.create(DataEntry.prototype);
679
601
  obj.__wbg_ptr = ptr;
680
- DiagnosticsFinalization.register(obj, obj.__wbg_ptr, obj);
602
+ DataEntryFinalization.register(obj, obj.__wbg_ptr, obj);
681
603
  return obj;
682
604
  }
683
-
684
605
  __destroy_into_raw() {
685
606
  const ptr = this.__wbg_ptr;
686
607
  this.__wbg_ptr = 0;
687
- DiagnosticsFinalization.unregister(this);
608
+ DataEntryFinalization.unregister(this);
688
609
  return ptr;
689
610
  }
690
-
691
611
  free() {
692
612
  const ptr = this.__destroy_into_raw();
693
- wasm.__wbg_diagnostics_free(ptr, 0);
613
+ wasm.__wbg_dataentry_free(ptr, 0);
694
614
  }
695
615
  /**
696
- * `PolicyId`s of the policies that contributed to the decision.
697
- * If no policies applied to the request, this set will be empty.
698
- *
699
- * The ids should be treated as unordered,
700
- * @returns {string[]}
616
+ * Convert `DataEntry` to json string value
617
+ * @returns {string}
701
618
  */
702
- get reason() {
619
+ json_string() {
620
+ let deferred1_0;
621
+ let deferred1_1;
703
622
  try {
704
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
705
- wasm.diagnostics_reason(retptr, this.__wbg_ptr);
706
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
707
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
708
- var v1 = getArrayJsValueFromWasm0(r0, r1).slice();
709
- wasm.__wbindgen_export_4(r0, r1 * 4, 4);
710
- return v1;
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]);
711
627
  } finally {
712
- wasm.__wbindgen_add_to_stack_pointer(16);
628
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
713
629
  }
714
630
  }
715
631
  /**
716
- * Errors that occurred during authorization. The errors should be
717
- * treated as unordered, since policies may be evaluated in any order.
718
- * @returns {PolicyEvaluationError[]}
632
+ * Get the value stored in this entry as a JavaScript object
633
+ * @returns {any}
719
634
  */
720
- get errors() {
635
+ value() {
636
+ const ret = wasm.dataentry_value(this.__wbg_ptr);
637
+ if (ret[2]) {
638
+ throw takeFromExternrefTable0(ret[1]);
639
+ }
640
+ return takeFromExternrefTable0(ret[0]);
641
+ }
642
+ /**
643
+ * Number of times this entry has been accessed
644
+ * @returns {bigint}
645
+ */
646
+ get access_count() {
647
+ const ret = wasm.__wbg_get_dataentry_access_count(this.__wbg_ptr);
648
+ return BigInt.asUintN(64, ret);
649
+ }
650
+ /**
651
+ * Timestamp when this entry was created (RFC 3339 format)
652
+ * @returns {string}
653
+ */
654
+ get created_at() {
655
+ let deferred1_0;
656
+ let deferred1_1;
721
657
  try {
722
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
723
- wasm.diagnostics_errors(retptr, this.__wbg_ptr);
724
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
725
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
726
- var v1 = getArrayJsValueFromWasm0(r0, r1).slice();
727
- wasm.__wbindgen_export_4(r0, r1 * 4, 4);
728
- return v1;
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]);
729
662
  } finally {
730
- wasm.__wbindgen_add_to_stack_pointer(16);
663
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
731
664
  }
732
665
  }
666
+ /**
667
+ * The inferred Cedar type of the value
668
+ * @returns {string}
669
+ */
670
+ get data_type() {
671
+ let deferred1_0;
672
+ let deferred1_1;
673
+ try {
674
+ const ret = wasm.__wbg_get_dataentry_data_type(this.__wbg_ptr);
675
+ deferred1_0 = ret[0];
676
+ deferred1_1 = ret[1];
677
+ return getStringFromWasm0(ret[0], ret[1]);
678
+ } finally {
679
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
680
+ }
681
+ }
682
+ /**
683
+ * Timestamp when this entry expires (RFC 3339 format), or null if no TTL
684
+ * @returns {string | undefined}
685
+ */
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;
694
+ }
695
+ /**
696
+ * The key for this entry
697
+ * @returns {string}
698
+ */
699
+ get key() {
700
+ let deferred1_0;
701
+ let deferred1_1;
702
+ try {
703
+ const ret = wasm.__wbg_get_dataentry_key(this.__wbg_ptr);
704
+ deferred1_0 = ret[0];
705
+ deferred1_1 = ret[1];
706
+ return getStringFromWasm0(ret[0], ret[1]);
707
+ } finally {
708
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
709
+ }
710
+ }
711
+ /**
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
748
+ */
749
+ set key(arg0) {
750
+ const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
751
+ const len0 = WASM_VECTOR_LEN;
752
+ wasm.__wbg_set_dataentry_key(this.__wbg_ptr, ptr0, len0);
753
+ }
733
754
  }
755
+ if (Symbol.dispose) DataEntry.prototype[Symbol.dispose] = DataEntry.prototype.free;
756
+ exports.DataEntry = DataEntry;
734
757
 
735
- const JsJsonLogicFinalization = (typeof FinalizationRegistry === 'undefined')
736
- ? { register: () => {}, unregister: () => {} }
737
- : new FinalizationRegistry(ptr => wasm.__wbg_jsjsonlogic_free(ptr >>> 0, 1));
738
-
739
- export class JsJsonLogic {
740
-
758
+ /**
759
+ * A WASM wrapper for the Rust `cedarling::DataStoreStats` struct.
760
+ * Statistics about the DataStore.
761
+ */
762
+ class DataStoreStats {
763
+ static __wrap(ptr) {
764
+ ptr = ptr >>> 0;
765
+ const obj = Object.create(DataStoreStats.prototype);
766
+ obj.__wbg_ptr = ptr;
767
+ DataStoreStatsFinalization.register(obj, obj.__wbg_ptr, obj);
768
+ return obj;
769
+ }
741
770
  __destroy_into_raw() {
742
771
  const ptr = this.__wbg_ptr;
743
772
  this.__wbg_ptr = 0;
744
- JsJsonLogicFinalization.unregister(this);
773
+ DataStoreStatsFinalization.unregister(this);
745
774
  return ptr;
746
775
  }
747
-
748
776
  free() {
749
777
  const ptr = this.__destroy_into_raw();
750
- wasm.__wbg_jsjsonlogic_free(ptr, 0);
751
- }
752
- constructor() {
753
- const ret = wasm.jsjsonlogic_new();
754
- this.__wbg_ptr = ret >>> 0;
755
- JsJsonLogicFinalization.register(this, this.__wbg_ptr, this);
756
- return this;
778
+ wasm.__wbg_datastorestats_free(ptr, 0);
757
779
  }
758
780
  /**
759
- * @param {any} logic
760
- * @param {any} data
761
- * @returns {any}
781
+ * Convert `DataStoreStats` to json string value
782
+ * @returns {string}
762
783
  */
763
- apply(logic, data) {
784
+ json_string() {
785
+ let deferred1_0;
786
+ let deferred1_1;
764
787
  try {
765
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
766
- wasm.jsjsonlogic_apply(retptr, this.__wbg_ptr, addHeapObject(logic), addHeapObject(data));
767
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
768
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
769
- var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
770
- if (r2) {
771
- throw takeObject(r1);
772
- }
773
- return takeObject(r0);
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]);
774
792
  } finally {
775
- wasm.__wbindgen_add_to_stack_pointer(16);
793
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
776
794
  }
777
795
  }
796
+ /**
797
+ * Average size per entry in bytes (0 if no entries)
798
+ * @returns {number}
799
+ */
800
+ get avg_entry_size_bytes() {
801
+ const ret = wasm.__wbg_get_datastorestats_avg_entry_size_bytes(this.__wbg_ptr);
802
+ return ret >>> 0;
803
+ }
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;
811
+ }
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;
819
+ }
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;
827
+ }
828
+ /**
829
+ * Maximum size per entry in bytes (0 = unlimited)
830
+ * @returns {number}
831
+ */
832
+ get max_entry_size() {
833
+ const ret = wasm.__wbg_get_datastorestats_max_entry_size(this.__wbg_ptr);
834
+ return ret >>> 0;
835
+ }
836
+ /**
837
+ * Memory usage threshold percentage (from config)
838
+ * @returns {number}
839
+ */
840
+ get memory_alert_threshold() {
841
+ const ret = wasm.__wbg_get_datastorestats_memory_alert_threshold(this.__wbg_ptr);
842
+ return ret;
843
+ }
844
+ /**
845
+ * Whether memory usage exceeds the alert threshold
846
+ * @returns {boolean}
847
+ */
848
+ get memory_alert_triggered() {
849
+ const ret = wasm.__wbg_get_datastorestats_memory_alert_triggered(this.__wbg_ptr);
850
+ return ret !== 0;
851
+ }
852
+ /**
853
+ * Whether metrics tracking is enabled
854
+ * @returns {boolean}
855
+ */
856
+ get metrics_enabled() {
857
+ const ret = wasm.__wbg_get_datastorestats_metrics_enabled(this.__wbg_ptr);
858
+ return ret !== 0;
859
+ }
860
+ /**
861
+ * Total size of all entries in bytes (approximate, based on JSON serialization)
862
+ * @returns {number}
863
+ */
864
+ get total_size_bytes() {
865
+ const ret = wasm.__wbg_get_datastorestats_total_size_bytes(this.__wbg_ptr);
866
+ return ret >>> 0;
867
+ }
868
+ /**
869
+ * Average size per entry in bytes (0 if no entries)
870
+ * @param {number} arg0
871
+ */
872
+ set avg_entry_size_bytes(arg0) {
873
+ wasm.__wbg_set_datastorestats_avg_entry_size_bytes(this.__wbg_ptr, arg0);
874
+ }
875
+ /**
876
+ * Percentage of capacity used (0.0-100.0, based on entry count)
877
+ * @param {number} arg0
878
+ */
879
+ set capacity_usage_percent(arg0) {
880
+ wasm.__wbg_set_datastorestats_capacity_usage_percent(this.__wbg_ptr, arg0);
881
+ }
882
+ /**
883
+ * Number of entries currently stored
884
+ * @param {number} arg0
885
+ */
886
+ set entry_count(arg0) {
887
+ wasm.__wbg_set_datastorestats_entry_count(this.__wbg_ptr, arg0);
888
+ }
889
+ /**
890
+ * Maximum number of entries allowed (0 = unlimited)
891
+ * @param {number} arg0
892
+ */
893
+ set max_entries(arg0) {
894
+ wasm.__wbg_set_datastorestats_max_entries(this.__wbg_ptr, arg0);
895
+ }
896
+ /**
897
+ * Maximum size per entry in bytes (0 = unlimited)
898
+ * @param {number} arg0
899
+ */
900
+ set max_entry_size(arg0) {
901
+ wasm.__wbg_set_datastorestats_max_entry_size(this.__wbg_ptr, arg0);
902
+ }
903
+ /**
904
+ * Memory usage threshold percentage (from config)
905
+ * @param {number} arg0
906
+ */
907
+ set memory_alert_threshold(arg0) {
908
+ wasm.__wbg_set_datastorestats_memory_alert_threshold(this.__wbg_ptr, arg0);
909
+ }
910
+ /**
911
+ * Whether memory usage exceeds the alert threshold
912
+ * @param {boolean} arg0
913
+ */
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);
930
+ }
778
931
  }
932
+ if (Symbol.dispose) DataStoreStats.prototype[Symbol.dispose] = DataStoreStats.prototype.free;
933
+ exports.DataStoreStats = DataStoreStats;
779
934
 
780
- const PolicyEvaluationErrorFinalization = (typeof FinalizationRegistry === 'undefined')
781
- ? { register: () => {}, unregister: () => {} }
782
- : new FinalizationRegistry(ptr => wasm.__wbg_policyevaluationerror_free(ptr >>> 0, 1));
783
935
  /**
784
- * PolicyEvaluationError
785
- * =====================
936
+ * Diagnostics
937
+ * ===========
786
938
  *
787
- * Represents an error that occurred when evaluating a Cedar policy.
939
+ * Provides detailed information about how a policy decision was made, including policies that contributed to the decision and any errors encountered during evaluation.
788
940
  */
789
- export class PolicyEvaluationError {
790
-
941
+ class Diagnostics {
791
942
  static __wrap(ptr) {
792
943
  ptr = ptr >>> 0;
793
- const obj = Object.create(PolicyEvaluationError.prototype);
944
+ const obj = Object.create(Diagnostics.prototype);
794
945
  obj.__wbg_ptr = ptr;
795
- PolicyEvaluationErrorFinalization.register(obj, obj.__wbg_ptr, obj);
946
+ DiagnosticsFinalization.register(obj, obj.__wbg_ptr, obj);
796
947
  return obj;
797
948
  }
949
+ __destroy_into_raw() {
950
+ const ptr = this.__wbg_ptr;
951
+ this.__wbg_ptr = 0;
952
+ DiagnosticsFinalization.unregister(this);
953
+ return ptr;
954
+ }
955
+ free() {
956
+ const ptr = this.__destroy_into_raw();
957
+ wasm.__wbg_diagnostics_free(ptr, 0);
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
+ }
970
+ /**
971
+ * `PolicyId`s of the policies that contributed to the decision.
972
+ * If no policies applied to the request, this set will be empty.
973
+ *
974
+ * The ids should be treated as unordered,
975
+ * @returns {string[]}
976
+ */
977
+ get reason() {
978
+ const ret = wasm.diagnostics_reason(this.__wbg_ptr);
979
+ var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
980
+ wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
981
+ return v1;
982
+ }
983
+ }
984
+ if (Symbol.dispose) Diagnostics.prototype[Symbol.dispose] = Diagnostics.prototype.free;
985
+ exports.Diagnostics = Diagnostics;
798
986
 
987
+ class IntoUnderlyingByteSource {
799
988
  __destroy_into_raw() {
800
989
  const ptr = this.__wbg_ptr;
801
990
  this.__wbg_ptr = 0;
802
- PolicyEvaluationErrorFinalization.unregister(this);
991
+ IntoUnderlyingByteSourceFinalization.unregister(this);
803
992
  return ptr;
804
993
  }
994
+ free() {
995
+ const ptr = this.__destroy_into_raw();
996
+ wasm.__wbg_intounderlyingbytesource_free(ptr, 0);
997
+ }
998
+ /**
999
+ * @returns {number}
1000
+ */
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;
805
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
+ }
806
1041
  free() {
807
1042
  const ptr = this.__destroy_into_raw();
808
- wasm.__wbg_policyevaluationerror_free(ptr, 0);
1043
+ wasm.__wbg_intounderlyingsink_free(ptr, 0);
809
1044
  }
810
1045
  /**
811
- * Id of the policy with an error
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;
1069
+ }
1070
+ }
1071
+ if (Symbol.dispose) IntoUnderlyingSink.prototype[Symbol.dispose] = IntoUnderlyingSink.prototype.free;
1072
+ exports.IntoUnderlyingSink = IntoUnderlyingSink;
1073
+
1074
+ class IntoUnderlyingSource {
1075
+ __destroy_into_raw() {
1076
+ const ptr = this.__wbg_ptr;
1077
+ this.__wbg_ptr = 0;
1078
+ IntoUnderlyingSourceFinalization.unregister(this);
1079
+ return ptr;
1080
+ }
1081
+ free() {
1082
+ const ptr = this.__destroy_into_raw();
1083
+ wasm.__wbg_intounderlyingsource_free(ptr, 0);
1084
+ }
1085
+ cancel() {
1086
+ const ptr = this.__destroy_into_raw();
1087
+ wasm.intounderlyingsource_cancel(ptr);
1088
+ }
1089
+ /**
1090
+ * @param {ReadableStreamDefaultController} controller
1091
+ * @returns {Promise<any>}
1092
+ */
1093
+ pull(controller) {
1094
+ const ret = wasm.intounderlyingsource_pull(this.__wbg_ptr, controller);
1095
+ return ret;
1096
+ }
1097
+ }
1098
+ if (Symbol.dispose) IntoUnderlyingSource.prototype[Symbol.dispose] = IntoUnderlyingSource.prototype.free;
1099
+ exports.IntoUnderlyingSource = IntoUnderlyingSource;
1100
+
1101
+ /**
1102
+ * A WASM wrapper for the Rust `cedarling::MultiIssuerAuthorizeResult` struct.
1103
+ * Represents the result of a multi-issuer authorization request.
1104
+ */
1105
+ class MultiIssuerAuthorizeResult {
1106
+ static __wrap(ptr) {
1107
+ ptr = ptr >>> 0;
1108
+ const obj = Object.create(MultiIssuerAuthorizeResult.prototype);
1109
+ obj.__wbg_ptr = ptr;
1110
+ MultiIssuerAuthorizeResultFinalization.register(obj, obj.__wbg_ptr, obj);
1111
+ return obj;
1112
+ }
1113
+ __destroy_into_raw() {
1114
+ const ptr = this.__wbg_ptr;
1115
+ this.__wbg_ptr = 0;
1116
+ MultiIssuerAuthorizeResultFinalization.unregister(this);
1117
+ return ptr;
1118
+ }
1119
+ free() {
1120
+ const ptr = this.__destroy_into_raw();
1121
+ wasm.__wbg_multiissuerauthorizeresult_free(ptr, 0);
1122
+ }
1123
+ /**
1124
+ * Result of authorization
1125
+ * true means `ALLOW`
1126
+ * false means `Deny`
1127
+ * @returns {boolean}
1128
+ */
1129
+ get decision() {
1130
+ const ret = wasm.__wbg_get_multiissuerauthorizeresult_decision(this.__wbg_ptr);
1131
+ return ret !== 0;
1132
+ }
1133
+ /**
1134
+ * Request ID of the authorization request
812
1135
  * @returns {string}
813
1136
  */
814
- get id() {
1137
+ get request_id() {
815
1138
  let deferred1_0;
816
1139
  let deferred1_1;
817
1140
  try {
818
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
819
- wasm.policyevaluationerror_id(retptr, this.__wbg_ptr);
820
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
821
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
822
- deferred1_0 = r0;
823
- deferred1_1 = r1;
824
- return getStringFromWasm0(r0, r1);
1141
+ const ret = wasm.__wbg_get_multiissuerauthorizeresult_request_id(this.__wbg_ptr);
1142
+ deferred1_0 = ret[0];
1143
+ deferred1_1 = ret[1];
1144
+ return getStringFromWasm0(ret[0], ret[1]);
825
1145
  } finally {
826
- wasm.__wbindgen_add_to_stack_pointer(16);
827
- wasm.__wbindgen_export_4(deferred1_0, deferred1_1, 1);
1146
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
828
1147
  }
829
1148
  }
830
1149
  /**
831
- * Underlying evaluation error string representation
1150
+ * Result of Cedar policy authorization
1151
+ * @returns {AuthorizeResultResponse}
1152
+ */
1153
+ get response() {
1154
+ const ret = wasm.__wbg_get_multiissuerauthorizeresult_response(this.__wbg_ptr);
1155
+ return AuthorizeResultResponse.__wrap(ret);
1156
+ }
1157
+ /**
1158
+ * Convert `MultiIssuerAuthorizeResult` to json string value
832
1159
  * @returns {string}
833
1160
  */
834
- get error() {
1161
+ json_string() {
835
1162
  let deferred1_0;
836
1163
  let deferred1_1;
837
1164
  try {
838
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
839
- wasm.policyevaluationerror_error(retptr, this.__wbg_ptr);
840
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
841
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
842
- deferred1_0 = r0;
843
- deferred1_1 = r1;
844
- return getStringFromWasm0(r0, r1);
1165
+ const ret = wasm.multiissuerauthorizeresult_json_string(this.__wbg_ptr);
1166
+ deferred1_0 = ret[0];
1167
+ deferred1_1 = ret[1];
1168
+ return getStringFromWasm0(ret[0], ret[1]);
845
1169
  } finally {
846
- wasm.__wbindgen_add_to_stack_pointer(16);
847
- wasm.__wbindgen_export_4(deferred1_0, deferred1_1, 1);
1170
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
848
1171
  }
849
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
+ }
850
1200
  }
1201
+ if (Symbol.dispose) MultiIssuerAuthorizeResult.prototype[Symbol.dispose] = MultiIssuerAuthorizeResult.prototype.free;
1202
+ exports.MultiIssuerAuthorizeResult = MultiIssuerAuthorizeResult;
851
1203
 
852
- async function __wbg_load(module, imports) {
853
- if (typeof Response === 'function' && module instanceof Response) {
854
- if (typeof WebAssembly.instantiateStreaming === 'function') {
855
- try {
856
- return await WebAssembly.instantiateStreaming(module, imports);
857
-
858
- } catch (e) {
859
- if (module.headers.get('Content-Type') != 'application/wasm') {
860
- console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n", e);
861
-
862
- } else {
863
- throw e;
864
- }
865
- }
1204
+ /**
1205
+ * PolicyEvaluationError
1206
+ * =====================
1207
+ *
1208
+ * Represents an error that occurred when evaluating a Cedar policy.
1209
+ */
1210
+ class PolicyEvaluationError {
1211
+ static __wrap(ptr) {
1212
+ ptr = ptr >>> 0;
1213
+ const obj = Object.create(PolicyEvaluationError.prototype);
1214
+ obj.__wbg_ptr = ptr;
1215
+ PolicyEvaluationErrorFinalization.register(obj, obj.__wbg_ptr, obj);
1216
+ return obj;
1217
+ }
1218
+ __destroy_into_raw() {
1219
+ const ptr = this.__wbg_ptr;
1220
+ this.__wbg_ptr = 0;
1221
+ PolicyEvaluationErrorFinalization.unregister(this);
1222
+ return ptr;
1223
+ }
1224
+ free() {
1225
+ const ptr = this.__destroy_into_raw();
1226
+ wasm.__wbg_policyevaluationerror_free(ptr, 0);
1227
+ }
1228
+ /**
1229
+ * Underlying evaluation error string representation
1230
+ * @returns {string}
1231
+ */
1232
+ get error() {
1233
+ let deferred1_0;
1234
+ let deferred1_1;
1235
+ try {
1236
+ const ret = wasm.policyevaluationerror_error(this.__wbg_ptr);
1237
+ deferred1_0 = ret[0];
1238
+ deferred1_1 = ret[1];
1239
+ return getStringFromWasm0(ret[0], ret[1]);
1240
+ } finally {
1241
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
866
1242
  }
867
-
868
- const bytes = await module.arrayBuffer();
869
- return await WebAssembly.instantiate(bytes, imports);
870
-
871
- } else {
872
- const instance = await WebAssembly.instantiate(module, imports);
873
-
874
- if (instance instanceof WebAssembly.Instance) {
875
- return { instance, module };
876
-
877
- } else {
878
- return instance;
1243
+ }
1244
+ /**
1245
+ * Id of the policy with an error
1246
+ * @returns {string}
1247
+ */
1248
+ get id() {
1249
+ let deferred1_0;
1250
+ let deferred1_1;
1251
+ try {
1252
+ const ret = wasm.policyevaluationerror_id(this.__wbg_ptr);
1253
+ deferred1_0 = ret[0];
1254
+ deferred1_1 = ret[1];
1255
+ return getStringFromWasm0(ret[0], ret[1]);
1256
+ } finally {
1257
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
879
1258
  }
880
1259
  }
881
1260
  }
1261
+ if (Symbol.dispose) PolicyEvaluationError.prototype[Symbol.dispose] = PolicyEvaluationError.prototype.free;
1262
+ exports.PolicyEvaluationError = PolicyEvaluationError;
882
1263
 
1264
+ /**
1265
+ * Create a new instance of the Cedarling application.
1266
+ * This function can take as config parameter the eather `Map` other `Object`
1267
+ * @param {any} config
1268
+ * @returns {Promise<Cedarling>}
1269
+ */
1270
+ function init(config) {
1271
+ const ret = wasm.init(config);
1272
+ return ret;
1273
+ }
1274
+ exports.init = init;
1275
+
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);
1298
+ return ret;
1299
+ }
1300
+ exports.init_from_archive_bytes = init_from_archive_bytes;
883
1301
  function __wbg_get_imports() {
884
- const imports = {};
885
- imports.wbg = {};
886
- imports.wbg.__wbg_String_8f0eb39a4a4c2f66 = function(arg0, arg1) {
887
- const ret = String(getObject(arg1));
888
- const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
889
- const len1 = WASM_VECTOR_LEN;
890
- getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
891
- getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
892
- };
893
- imports.wbg.__wbg_abort_410ec47a64ac6117 = function(arg0, arg1) {
894
- getObject(arg0).abort(getObject(arg1));
895
- };
896
- imports.wbg.__wbg_abort_775ef1d17fc65868 = function(arg0) {
897
- getObject(arg0).abort();
898
- };
899
- imports.wbg.__wbg_append_8c7dd8d641a5f01b = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
900
- getObject(arg0).append(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4));
901
- }, arguments) };
902
- imports.wbg.__wbg_authorizeresult_new = function(arg0) {
903
- const ret = AuthorizeResult.__wrap(arg0);
904
- return addHeapObject(ret);
905
- };
906
- imports.wbg.__wbg_buffer_609cc3eee51ed158 = function(arg0) {
907
- const ret = getObject(arg0).buffer;
908
- return addHeapObject(ret);
909
- };
910
- imports.wbg.__wbg_call_672a4d21634d4a24 = function() { return handleError(function (arg0, arg1) {
911
- const ret = getObject(arg0).call(getObject(arg1));
912
- return addHeapObject(ret);
913
- }, arguments) };
914
- imports.wbg.__wbg_call_7cccdd69e0791ae2 = function() { return handleError(function (arg0, arg1, arg2) {
915
- const ret = getObject(arg0).call(getObject(arg1), getObject(arg2));
916
- return addHeapObject(ret);
917
- }, arguments) };
918
- imports.wbg.__wbg_cedarling_new = function(arg0) {
919
- const ret = Cedarling.__wrap(arg0);
920
- return addHeapObject(ret);
921
- };
922
- imports.wbg.__wbg_clearTimeout_86721db0036bea98 = function(arg0) {
923
- const ret = clearTimeout(takeObject(arg0));
924
- return addHeapObject(ret);
925
- };
926
- imports.wbg.__wbg_crypto_ed58b8e10a292839 = function(arg0) {
927
- const ret = getObject(arg0).crypto;
928
- return addHeapObject(ret);
929
- };
930
- imports.wbg.__wbg_debug_faaa2b98a2718860 = function(arg0) {
931
- console.debug(...getObject(arg0));
932
- };
933
- imports.wbg.__wbg_done_769e5ede4b31c67b = function(arg0) {
934
- const ret = getObject(arg0).done;
935
- return ret;
936
- };
937
- imports.wbg.__wbg_entries_3265d4158b33e5dc = function(arg0) {
938
- const ret = Object.entries(getObject(arg0));
939
- return addHeapObject(ret);
940
- };
941
- imports.wbg.__wbg_entries_c8a90a7ed73e84ce = function(arg0) {
942
- const ret = getObject(arg0).entries();
943
- return addHeapObject(ret);
944
- };
945
- imports.wbg.__wbg_error_dc53417fcef5463a = function(arg0) {
946
- console.error(...getObject(arg0));
947
- };
948
- imports.wbg.__wbg_fetch_509096533071c657 = function(arg0, arg1) {
949
- const ret = getObject(arg0).fetch(getObject(arg1));
950
- return addHeapObject(ret);
951
- };
952
- imports.wbg.__wbg_fetch_d36a73832f0a45e8 = function(arg0) {
953
- const ret = fetch(getObject(arg0));
954
- return addHeapObject(ret);
955
- };
956
- imports.wbg.__wbg_fromEntries_524679eecb0bdc2e = function() { return handleError(function (arg0) {
957
- const ret = Object.fromEntries(getObject(arg0));
958
- return addHeapObject(ret);
959
- }, arguments) };
960
- imports.wbg.__wbg_getRandomValues_bcb4912f16000dc4 = function() { return handleError(function (arg0, arg1) {
961
- getObject(arg0).getRandomValues(getObject(arg1));
962
- }, arguments) };
963
- imports.wbg.__wbg_getTime_46267b1c24877e30 = function(arg0) {
964
- const ret = getObject(arg0).getTime();
965
- return ret;
966
- };
967
- imports.wbg.__wbg_getTimezoneOffset_6b5752021c499c47 = function(arg0) {
968
- const ret = getObject(arg0).getTimezoneOffset();
969
- return ret;
970
- };
971
- imports.wbg.__wbg_get_67b2ba62fc30de12 = function() { return handleError(function (arg0, arg1) {
972
- const ret = Reflect.get(getObject(arg0), getObject(arg1));
973
- return addHeapObject(ret);
974
- }, arguments) };
975
- imports.wbg.__wbg_get_b9b93047fe3cf45b = function(arg0, arg1) {
976
- const ret = getObject(arg0)[arg1 >>> 0];
977
- return addHeapObject(ret);
978
- };
979
- imports.wbg.__wbg_getwithrefkey_1dc361bd10053bfe = function(arg0, arg1) {
980
- const ret = getObject(arg0)[getObject(arg1)];
981
- return addHeapObject(ret);
982
- };
983
- imports.wbg.__wbg_has_a5ea9117f258a0ec = function() { return handleError(function (arg0, arg1) {
984
- const ret = Reflect.has(getObject(arg0), getObject(arg1));
985
- return ret;
986
- }, arguments) };
987
- imports.wbg.__wbg_headers_9cb51cfd2ac780a4 = function(arg0) {
988
- const ret = getObject(arg0).headers;
989
- return addHeapObject(ret);
990
- };
991
- imports.wbg.__wbg_info_7fbe81f62c7b4dab = function(arg0) {
992
- console.info(...getObject(arg0));
993
- };
994
- imports.wbg.__wbg_instanceof_ArrayBuffer_e14585432e3737fc = function(arg0) {
995
- let result;
996
- try {
997
- result = getObject(arg0) instanceof ArrayBuffer;
998
- } catch (_) {
999
- result = false;
1000
- }
1001
- const ret = result;
1002
- return ret;
1003
- };
1004
- imports.wbg.__wbg_instanceof_Array_6ac07133d621675a = function(arg0) {
1005
- let result;
1006
- try {
1007
- result = getObject(arg0) instanceof Array;
1008
- } catch (_) {
1009
- result = false;
1010
- }
1011
- const ret = result;
1012
- return ret;
1013
- };
1014
- imports.wbg.__wbg_instanceof_Map_f3469ce2244d2430 = function(arg0) {
1015
- let result;
1016
- try {
1017
- result = getObject(arg0) instanceof Map;
1018
- } catch (_) {
1019
- result = false;
1020
- }
1021
- const ret = result;
1022
- return ret;
1023
- };
1024
- imports.wbg.__wbg_instanceof_Response_f2cc20d9f7dfd644 = function(arg0) {
1025
- let result;
1026
- try {
1027
- result = getObject(arg0) instanceof Response;
1028
- } catch (_) {
1029
- result = false;
1030
- }
1031
- const ret = result;
1032
- return ret;
1033
- };
1034
- imports.wbg.__wbg_instanceof_Uint8Array_17156bcf118086a9 = function(arg0) {
1035
- let result;
1036
- try {
1037
- result = getObject(arg0) instanceof Uint8Array;
1038
- } catch (_) {
1039
- result = false;
1040
- }
1041
- const ret = result;
1042
- return ret;
1043
- };
1044
- imports.wbg.__wbg_isArray_a1eab7e0d067391b = function(arg0) {
1045
- const ret = Array.isArray(getObject(arg0));
1046
- return ret;
1047
- };
1048
- imports.wbg.__wbg_isSafeInteger_343e2beeeece1bb0 = function(arg0) {
1049
- const ret = Number.isSafeInteger(getObject(arg0));
1050
- return ret;
1051
- };
1052
- imports.wbg.__wbg_iterator_9a24c88df860dc65 = function() {
1053
- const ret = Symbol.iterator;
1054
- return addHeapObject(ret);
1055
- };
1056
- imports.wbg.__wbg_keys_5c77a08ddc2fb8a6 = function(arg0) {
1057
- const ret = Object.keys(getObject(arg0));
1058
- return addHeapObject(ret);
1059
- };
1060
- imports.wbg.__wbg_length_a446193dc22c12f8 = function(arg0) {
1061
- const ret = getObject(arg0).length;
1062
- return ret;
1063
- };
1064
- imports.wbg.__wbg_length_e2d2a49132c1b256 = function(arg0) {
1065
- const ret = getObject(arg0).length;
1066
- return ret;
1067
- };
1068
- imports.wbg.__wbg_log_245868b4b99cdf20 = function(arg0) {
1069
- console.log(...getObject(arg0));
1070
- };
1071
- imports.wbg.__wbg_msCrypto_0a36e2ec3a343d26 = function(arg0) {
1072
- const ret = getObject(arg0).msCrypto;
1073
- return addHeapObject(ret);
1074
- };
1075
- imports.wbg.__wbg_new0_f788a2397c7ca929 = function() {
1076
- const ret = new Date();
1077
- return addHeapObject(ret);
1078
- };
1079
- imports.wbg.__wbg_new_018dcc2d6c8c2f6a = function() { return handleError(function () {
1080
- const ret = new Headers();
1081
- return addHeapObject(ret);
1082
- }, arguments) };
1083
- imports.wbg.__wbg_new_23a2665fac83c611 = function(arg0, arg1) {
1084
- try {
1085
- var state0 = {a: arg0, b: arg1};
1086
- var cb0 = (arg0, arg1) => {
1087
- const a = state0.a;
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;
1570
+ try {
1571
+ result = arg0 instanceof ArrayBuffer;
1572
+ } catch (_) {
1573
+ result = false;
1574
+ }
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 {
1088
1708
  state0.a = 0;
1089
- try {
1090
- return __wbg_adapter_173(a, state0.b, arg0, arg1);
1091
- } finally {
1092
- state0.a = a;
1093
- }
1094
- };
1095
- const ret = new Promise(cb0);
1096
- return addHeapObject(ret);
1097
- } finally {
1098
- state0.a = state0.b = 0;
1099
- }
1100
- };
1101
- imports.wbg.__wbg_new_31a97dac4f10fab7 = function(arg0) {
1102
- const ret = new Date(getObject(arg0));
1103
- return addHeapObject(ret);
1104
- };
1105
- imports.wbg.__wbg_new_405e22f390576ce2 = function() {
1106
- const ret = new Object();
1107
- return addHeapObject(ret);
1108
- };
1109
- imports.wbg.__wbg_new_5e0be73521bc8c17 = function() {
1110
- const ret = new Map();
1111
- return addHeapObject(ret);
1112
- };
1113
- imports.wbg.__wbg_new_78feb108b6472713 = function() {
1114
- const ret = new Array();
1115
- return addHeapObject(ret);
1116
- };
1117
- imports.wbg.__wbg_new_a12002a7f91c75be = function(arg0) {
1118
- const ret = new Uint8Array(getObject(arg0));
1119
- return addHeapObject(ret);
1120
- };
1121
- imports.wbg.__wbg_new_e25e5aab09ff45db = function() { return handleError(function () {
1122
- const ret = new AbortController();
1123
- return addHeapObject(ret);
1124
- }, arguments) };
1125
- imports.wbg.__wbg_newnoargs_105ed471475aaf50 = function(arg0, arg1) {
1126
- const ret = new Function(getStringFromWasm0(arg0, arg1));
1127
- return addHeapObject(ret);
1128
- };
1129
- imports.wbg.__wbg_newwithargs_ab6ffe8cd6c19c04 = function(arg0, arg1, arg2, arg3) {
1130
- const ret = new Function(getStringFromWasm0(arg0, arg1), getStringFromWasm0(arg2, arg3));
1131
- return addHeapObject(ret);
1132
- };
1133
- imports.wbg.__wbg_newwithbyteoffsetandlength_d97e637ebe145a9a = function(arg0, arg1, arg2) {
1134
- const ret = new Uint8Array(getObject(arg0), arg1 >>> 0, arg2 >>> 0);
1135
- return addHeapObject(ret);
1136
- };
1137
- imports.wbg.__wbg_newwithlength_a381634e90c276d4 = function(arg0) {
1138
- const ret = new Uint8Array(arg0 >>> 0);
1139
- return addHeapObject(ret);
1140
- };
1141
- imports.wbg.__wbg_newwithstrandinit_06c535e0a867c635 = function() { return handleError(function (arg0, arg1, arg2) {
1142
- const ret = new Request(getStringFromWasm0(arg0, arg1), getObject(arg2));
1143
- return addHeapObject(ret);
1144
- }, arguments) };
1145
- imports.wbg.__wbg_next_25feadfc0913fea9 = function(arg0) {
1146
- const ret = getObject(arg0).next;
1147
- return addHeapObject(ret);
1148
- };
1149
- imports.wbg.__wbg_next_6574e1a8a62d1055 = function() { return handleError(function (arg0) {
1150
- const ret = getObject(arg0).next();
1151
- return addHeapObject(ret);
1152
- }, arguments) };
1153
- imports.wbg.__wbg_node_02999533c4ea02e3 = function(arg0) {
1154
- const ret = getObject(arg0).node;
1155
- return addHeapObject(ret);
1156
- };
1157
- imports.wbg.__wbg_policyevaluationerror_new = function(arg0) {
1158
- const ret = PolicyEvaluationError.__wrap(arg0);
1159
- return addHeapObject(ret);
1160
- };
1161
- imports.wbg.__wbg_process_5c1d670bc53614b8 = function(arg0) {
1162
- const ret = getObject(arg0).process;
1163
- return addHeapObject(ret);
1164
- };
1165
- imports.wbg.__wbg_push_737cfc8c1432c2c6 = function(arg0, arg1) {
1166
- const ret = getObject(arg0).push(getObject(arg1));
1167
- return ret;
1168
- };
1169
- imports.wbg.__wbg_queueMicrotask_97d92b4fcc8a61c5 = function(arg0) {
1170
- queueMicrotask(getObject(arg0));
1171
- };
1172
- imports.wbg.__wbg_queueMicrotask_d3219def82552485 = function(arg0) {
1173
- const ret = getObject(arg0).queueMicrotask;
1174
- return addHeapObject(ret);
1175
- };
1176
- imports.wbg.__wbg_randomFillSync_ab2cfe79ebbf2740 = function() { return handleError(function (arg0, arg1) {
1177
- getObject(arg0).randomFillSync(takeObject(arg1));
1178
- }, arguments) };
1179
- imports.wbg.__wbg_require_79b1e9274cde3c87 = function() { return handleError(function () {
1180
- const ret = module.require;
1181
- return addHeapObject(ret);
1182
- }, arguments) };
1183
- imports.wbg.__wbg_resolve_4851785c9c5f573d = function(arg0) {
1184
- const ret = Promise.resolve(getObject(arg0));
1185
- return addHeapObject(ret);
1186
- };
1187
- imports.wbg.__wbg_setTimeout_2e707715f8cc9497 = function(arg0, arg1) {
1188
- const ret = setTimeout(getObject(arg0), arg1);
1189
- return addHeapObject(ret);
1190
- };
1191
- imports.wbg.__wbg_set_37837023f3d740e8 = function(arg0, arg1, arg2) {
1192
- getObject(arg0)[arg1 >>> 0] = takeObject(arg2);
1193
- };
1194
- imports.wbg.__wbg_set_3f1d0b984ed272ed = function(arg0, arg1, arg2) {
1195
- getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
1196
- };
1197
- imports.wbg.__wbg_set_65595bdd868b3009 = function(arg0, arg1, arg2) {
1198
- getObject(arg0).set(getObject(arg1), arg2 >>> 0);
1199
- };
1200
- imports.wbg.__wbg_set_8fc6bf8a5b1071d1 = function(arg0, arg1, arg2) {
1201
- const ret = getObject(arg0).set(getObject(arg1), getObject(arg2));
1202
- return addHeapObject(ret);
1203
- };
1204
- imports.wbg.__wbg_set_bb8cecf6a62b9f46 = function() { return handleError(function (arg0, arg1, arg2) {
1205
- const ret = Reflect.set(getObject(arg0), getObject(arg1), getObject(arg2));
1206
- return ret;
1207
- }, arguments) };
1208
- imports.wbg.__wbg_setbody_5923b78a95eedf29 = function(arg0, arg1) {
1209
- getObject(arg0).body = getObject(arg1);
1210
- };
1211
- imports.wbg.__wbg_setcredentials_c3a22f1cd105a2c6 = function(arg0, arg1) {
1212
- getObject(arg0).credentials = __wbindgen_enum_RequestCredentials[arg1];
1213
- };
1214
- imports.wbg.__wbg_setheaders_834c0bdb6a8949ad = function(arg0, arg1) {
1215
- getObject(arg0).headers = getObject(arg1);
1216
- };
1217
- imports.wbg.__wbg_setmethod_3c5280fe5d890842 = function(arg0, arg1, arg2) {
1218
- getObject(arg0).method = getStringFromWasm0(arg1, arg2);
1219
- };
1220
- imports.wbg.__wbg_setmode_5dc300b865044b65 = function(arg0, arg1) {
1221
- getObject(arg0).mode = __wbindgen_enum_RequestMode[arg1];
1222
- };
1223
- imports.wbg.__wbg_setsignal_75b21ef3a81de905 = function(arg0, arg1) {
1224
- getObject(arg0).signal = getObject(arg1);
1225
- };
1226
- imports.wbg.__wbg_signal_aaf9ad74119f20a4 = function(arg0) {
1227
- const ret = getObject(arg0).signal;
1228
- return addHeapObject(ret);
1229
- };
1230
- imports.wbg.__wbg_static_accessor_GLOBAL_88a902d13a557d07 = function() {
1231
- const ret = typeof global === 'undefined' ? null : global;
1232
- return isLikeNone(ret) ? 0 : addHeapObject(ret);
1233
- };
1234
- imports.wbg.__wbg_static_accessor_GLOBAL_THIS_56578be7e9f832b0 = function() {
1235
- const ret = typeof globalThis === 'undefined' ? null : globalThis;
1236
- return isLikeNone(ret) ? 0 : addHeapObject(ret);
1237
- };
1238
- imports.wbg.__wbg_static_accessor_SELF_37c5d418e4bf5819 = function() {
1239
- const ret = typeof self === 'undefined' ? null : self;
1240
- return isLikeNone(ret) ? 0 : addHeapObject(ret);
1241
- };
1242
- imports.wbg.__wbg_static_accessor_WINDOW_5de37043a91a9c40 = function() {
1243
- const ret = typeof window === 'undefined' ? null : window;
1244
- return isLikeNone(ret) ? 0 : addHeapObject(ret);
1245
- };
1246
- imports.wbg.__wbg_status_f6360336ca686bf0 = function(arg0) {
1247
- const ret = getObject(arg0).status;
1248
- return ret;
1249
- };
1250
- imports.wbg.__wbg_stringify_f7ed6987935b4a24 = function() { return handleError(function (arg0) {
1251
- const ret = JSON.stringify(getObject(arg0));
1252
- return addHeapObject(ret);
1253
- }, arguments) };
1254
- imports.wbg.__wbg_subarray_aa9065fa9dc5df96 = function(arg0, arg1, arg2) {
1255
- const ret = getObject(arg0).subarray(arg1 >>> 0, arg2 >>> 0);
1256
- return addHeapObject(ret);
1257
- };
1258
- imports.wbg.__wbg_text_7805bea50de2af49 = function() { return handleError(function (arg0) {
1259
- const ret = getObject(arg0).text();
1260
- return addHeapObject(ret);
1261
- }, arguments) };
1262
- imports.wbg.__wbg_then_44b73946d2fb3e7d = function(arg0, arg1) {
1263
- const ret = getObject(arg0).then(getObject(arg1));
1264
- return addHeapObject(ret);
1265
- };
1266
- imports.wbg.__wbg_then_48b406749878a531 = function(arg0, arg1, arg2) {
1267
- const ret = getObject(arg0).then(getObject(arg1), getObject(arg2));
1268
- return addHeapObject(ret);
1269
- };
1270
- imports.wbg.__wbg_trace_8fa9ac2274ea7420 = function(arg0) {
1271
- console.trace(...getObject(arg0));
1272
- };
1273
- imports.wbg.__wbg_url_ae10c34ca209681d = function(arg0, arg1) {
1274
- const ret = getObject(arg1).url;
1275
- const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
1276
- const len1 = WASM_VECTOR_LEN;
1277
- getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1278
- getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1279
- };
1280
- imports.wbg.__wbg_value_cd1ffa7b1ab794f1 = function(arg0) {
1281
- const ret = getObject(arg0).value;
1282
- return addHeapObject(ret);
1283
- };
1284
- imports.wbg.__wbg_versions_c71aa1626a93e0a1 = function(arg0) {
1285
- const ret = getObject(arg0).versions;
1286
- return addHeapObject(ret);
1287
- };
1288
- imports.wbg.__wbg_warn_ba4bf5118b457d45 = function(arg0) {
1289
- console.warn(...getObject(arg0));
1290
- };
1291
- imports.wbg.__wbindgen_bigint_from_i64 = function(arg0) {
1292
- const ret = arg0;
1293
- return addHeapObject(ret);
1294
- };
1295
- imports.wbg.__wbindgen_bigint_from_u64 = function(arg0) {
1296
- const ret = BigInt.asUintN(64, arg0);
1297
- return addHeapObject(ret);
1298
- };
1299
- imports.wbg.__wbindgen_bigint_get_as_i64 = function(arg0, arg1) {
1300
- const v = getObject(arg1);
1301
- const ret = typeof(v) === 'bigint' ? v : undefined;
1302
- getDataViewMemory0().setBigInt64(arg0 + 8 * 1, isLikeNone(ret) ? BigInt(0) : ret, true);
1303
- getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
1304
- };
1305
- imports.wbg.__wbindgen_boolean_get = function(arg0) {
1306
- const v = getObject(arg0);
1307
- const ret = typeof(v) === 'boolean' ? (v ? 1 : 0) : 2;
1308
- return ret;
1309
- };
1310
- imports.wbg.__wbindgen_cb_drop = function(arg0) {
1311
- const obj = takeObject(arg0).original;
1312
- if (obj.cnt-- == 1) {
1313
- obj.a = 0;
1314
- return true;
1315
- }
1316
- const ret = false;
1317
- return ret;
1318
- };
1319
- imports.wbg.__wbindgen_closure_wrapper10812 = function(arg0, arg1, arg2) {
1320
- const ret = makeMutClosure(arg0, arg1, 1939, __wbg_adapter_48);
1321
- return addHeapObject(ret);
1322
- };
1323
- imports.wbg.__wbindgen_closure_wrapper11699 = function(arg0, arg1, arg2) {
1324
- const ret = makeMutClosure(arg0, arg1, 2139, __wbg_adapter_51);
1325
- return addHeapObject(ret);
1326
- };
1327
- imports.wbg.__wbindgen_debug_string = function(arg0, arg1) {
1328
- const ret = debugString(getObject(arg1));
1329
- const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
1330
- const len1 = WASM_VECTOR_LEN;
1331
- getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1332
- getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1333
- };
1334
- imports.wbg.__wbindgen_error_new = function(arg0, arg1) {
1335
- const ret = new Error(getStringFromWasm0(arg0, arg1));
1336
- return addHeapObject(ret);
1337
- };
1338
- imports.wbg.__wbindgen_in = function(arg0, arg1) {
1339
- const ret = getObject(arg0) in getObject(arg1);
1340
- return ret;
1341
- };
1342
- imports.wbg.__wbindgen_is_bigint = function(arg0) {
1343
- const ret = typeof(getObject(arg0)) === 'bigint';
1344
- return ret;
1345
- };
1346
- imports.wbg.__wbindgen_is_function = function(arg0) {
1347
- const ret = typeof(getObject(arg0)) === 'function';
1348
- return ret;
1349
- };
1350
- imports.wbg.__wbindgen_is_object = function(arg0) {
1351
- const val = getObject(arg0);
1352
- const ret = typeof(val) === 'object' && val !== null;
1353
- return ret;
1354
- };
1355
- imports.wbg.__wbindgen_is_string = function(arg0) {
1356
- const ret = typeof(getObject(arg0)) === 'string';
1357
- return ret;
1358
- };
1359
- imports.wbg.__wbindgen_is_undefined = function(arg0) {
1360
- const ret = getObject(arg0) === undefined;
1361
- return ret;
1362
- };
1363
- imports.wbg.__wbindgen_jsval_eq = function(arg0, arg1) {
1364
- const ret = getObject(arg0) === getObject(arg1);
1365
- return ret;
1366
- };
1367
- imports.wbg.__wbindgen_jsval_loose_eq = function(arg0, arg1) {
1368
- const ret = getObject(arg0) == getObject(arg1);
1369
- return ret;
1370
- };
1371
- imports.wbg.__wbindgen_memory = function() {
1372
- const ret = wasm.memory;
1373
- return addHeapObject(ret);
1374
- };
1375
- imports.wbg.__wbindgen_number_get = function(arg0, arg1) {
1376
- const obj = getObject(arg1);
1377
- const ret = typeof(obj) === 'number' ? obj : undefined;
1378
- getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
1379
- getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
1380
- };
1381
- imports.wbg.__wbindgen_number_new = function(arg0) {
1382
- const ret = arg0;
1383
- return addHeapObject(ret);
1384
- };
1385
- imports.wbg.__wbindgen_object_clone_ref = function(arg0) {
1386
- const ret = getObject(arg0);
1387
- return addHeapObject(ret);
1388
- };
1389
- imports.wbg.__wbindgen_object_drop_ref = function(arg0) {
1390
- takeObject(arg0);
1391
- };
1392
- imports.wbg.__wbindgen_string_get = function(arg0, arg1) {
1393
- const obj = getObject(arg1);
1394
- const ret = typeof(obj) === 'string' ? obj : undefined;
1395
- var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
1396
- var len1 = WASM_VECTOR_LEN;
1397
- getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1398
- getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1399
- };
1400
- imports.wbg.__wbindgen_string_new = function(arg0, arg1) {
1401
- const ret = getStringFromWasm0(arg0, arg1);
1402
- return addHeapObject(ret);
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
+ },
1403
1971
  };
1404
- imports.wbg.__wbindgen_throw = function(arg0, arg1) {
1405
- throw new Error(getStringFromWasm0(arg0, arg1));
1972
+ return {
1973
+ __proto__: null,
1974
+ "./cedarling_wasm_bg.js": import0,
1406
1975
  };
1976
+ }
1407
1977
 
1408
- return imports;
1978
+ function wasm_bindgen__convert__closures_____invoke__ha272cf34a0c89527(arg0, arg1) {
1979
+ wasm.wasm_bindgen__convert__closures_____invoke__ha272cf34a0c89527(arg0, arg1);
1409
1980
  }
1410
1981
 
1411
- function __wbg_init_memory(imports, memory) {
1982
+ function wasm_bindgen__convert__closures_____invoke__h1f68ebdd661f92ac(arg0, arg1) {
1983
+ wasm.wasm_bindgen__convert__closures_____invoke__h1f68ebdd661f92ac(arg0, arg1);
1984
+ }
1412
1985
 
1986
+ function wasm_bindgen__convert__closures_____invoke__hc6d79abdb072c199(arg0, arg1) {
1987
+ wasm.wasm_bindgen__convert__closures_____invoke__hc6d79abdb072c199(arg0, arg1);
1413
1988
  }
1414
1989
 
1415
- function __wbg_finalize_init(instance, module) {
1416
- wasm = instance.exports;
1417
- __wbg_init.__wbindgen_wasm_module = module;
1418
- cachedDataViewMemory0 = null;
1419
- cachedUint8ArrayMemory0 = null;
1990
+ function wasm_bindgen__convert__closures_____invoke__h170c6019ccfd853a(arg0, arg1, arg2) {
1991
+ wasm.wasm_bindgen__convert__closures_____invoke__h170c6019ccfd853a(arg0, arg1, arg2);
1992
+ }
1420
1993
 
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
+ }
2000
+
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
+ }
2004
+
2005
+
2006
+ const __wbindgen_enum_ReadableStreamType = ["bytes"];
2007
+
2008
+
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"];
2010
+
2011
+
2012
+ const __wbindgen_enum_RequestCache = ["default", "no-store", "reload", "no-cache", "force-cache", "only-if-cached"];
2013
+
2014
+
2015
+ const __wbindgen_enum_RequestCredentials = ["omit", "same-origin", "include"];
2016
+
2017
+
2018
+ const __wbindgen_enum_RequestMode = ["same-origin", "no-cors", "cors", "navigate"];
1421
2019
 
1422
2020
 
1423
- return wasm;
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));
2055
+
2056
+ function addToExternrefTable0(obj) {
2057
+ const idx = wasm.__externref_table_alloc();
2058
+ wasm.__wbindgen_externrefs.set(idx, obj);
2059
+ return idx;
1424
2060
  }
1425
2061
 
1426
- function initSync(module) {
1427
- if (wasm !== undefined) return wasm;
2062
+ function _assertClass(instance, klass) {
2063
+ if (!(instance instanceof klass)) {
2064
+ throw new Error(`expected instance of ${klass.name}`);
2065
+ }
2066
+ }
1428
2067
 
2068
+ const CLOSURE_DTORS = (typeof FinalizationRegistry === 'undefined')
2069
+ ? { register: () => {}, unregister: () => {} }
2070
+ : new FinalizationRegistry(state => wasm.__wbindgen_destroy_closure(state.a, state.b));
1429
2071
 
1430
- if (typeof module !== 'undefined') {
1431
- if (Object.getPrototypeOf(module) === Object.prototype) {
1432
- ({module} = module)
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})`;
1433
2093
  } else {
1434
- console.warn('using deprecated parameters for `initSync()`; pass a single object instead')
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';
1435
2127
  }
1436
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
+ }
1437
2136
 
1438
- const imports = __wbg_get_imports();
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
+ }
1439
2147
 
1440
- __wbg_init_memory(imports);
2148
+ function getArrayU8FromWasm0(ptr, len) {
2149
+ ptr = ptr >>> 0;
2150
+ return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
2151
+ }
1441
2152
 
1442
- if (!(module instanceof WebAssembly.Module)) {
1443
- module = new WebAssembly.Module(module);
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);
1444
2157
  }
2158
+ return cachedDataViewMemory0;
2159
+ }
1445
2160
 
1446
- const instance = new WebAssembly.Instance(module, imports);
2161
+ function getStringFromWasm0(ptr, len) {
2162
+ ptr = ptr >>> 0;
2163
+ return decodeText(ptr, len);
2164
+ }
1447
2165
 
1448
- return __wbg_finalize_init(instance, module);
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;
1449
2172
  }
1450
2173
 
1451
- async function __wbg_init(module_or_path) {
1452
- if (wasm !== undefined) return wasm;
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
+ }
1453
2182
 
2183
+ function isLikeNone(x) {
2184
+ return x === undefined || x === null;
2185
+ }
1454
2186
 
1455
- if (typeof module_or_path !== 'undefined') {
1456
- if (Object.getPrototypeOf(module_or_path) === Object.prototype) {
1457
- ({module_or_path} = module_or_path)
1458
- } else {
1459
- console.warn('using deprecated parameters for the initialization function; pass a single object instead')
2187
+ function makeMutClosure(arg0, arg1, f) {
2188
+ const state = { a: arg0, b: arg1, cnt: 1 };
2189
+ const real = (...args) => {
2190
+
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();
1460
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
+ }
2214
+
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;
1461
2222
  }
1462
2223
 
1463
- if (typeof module_or_path === 'undefined') {
1464
- module_or_path = new URL('cedarling_wasm_bg.wasm', import.meta.url);
2224
+ let len = arg.length;
2225
+ let ptr = malloc(len, 1) >>> 0;
2226
+
2227
+ const mem = getUint8ArrayMemory0();
2228
+
2229
+ let offset = 0;
2230
+
2231
+ for (; offset < len; offset++) {
2232
+ const code = arg.charCodeAt(offset);
2233
+ if (code > 0x7F) break;
2234
+ mem[ptr + offset] = code;
1465
2235
  }
1466
- const imports = __wbg_get_imports();
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);
1467
2243
 
1468
- if (typeof module_or_path === 'string' || (typeof Request === 'function' && module_or_path instanceof Request) || (typeof URL === 'function' && module_or_path instanceof URL)) {
1469
- module_or_path = fetch(module_or_path);
2244
+ offset += ret.written;
2245
+ ptr = realloc(ptr, len, offset, 1) >>> 0;
1470
2246
  }
1471
2247
 
1472
- __wbg_init_memory(imports);
2248
+ WASM_VECTOR_LEN = offset;
2249
+ return ptr;
2250
+ }
2251
+
2252
+ function takeFromExternrefTable0(idx) {
2253
+ const value = wasm.__wbindgen_externrefs.get(idx);
2254
+ wasm.__externref_table_dealloc(idx);
2255
+ return value;
2256
+ }
2257
+
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
+ }
1473
2263
 
1474
- const { instance, module } = await __wbg_load(await module_or_path, imports);
2264
+ const cachedTextEncoder = new TextEncoder();
1475
2265
 
1476
- return __wbg_finalize_init(instance, module);
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
+ };
1477
2275
  }
1478
2276
 
1479
- export { initSync };
1480
- export default __wbg_init;
2277
+ let WASM_VECTOR_LEN = 0;
2278
+
2279
+ const wasmPath = `${__dirname}/cedarling_wasm_bg.wasm`;
2280
+ const wasmBytes = require('fs').readFileSync(wasmPath);
2281
+ const wasmModule = new WebAssembly.Module(wasmBytes);
2282
+ let wasm = new WebAssembly.Instance(wasmModule, __wbg_get_imports()).exports;
2283
+ wasm.__wbindgen_start();