@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/README.md +423 -21
- package/cedarling_wasm.d.ts +484 -197
- package/cedarling_wasm.js +1980 -1177
- package/cedarling_wasm_bg.wasm +0 -0
- package/package.json +2 -6
package/cedarling_wasm.js
CHANGED
|
@@ -1,275 +1,10 @@
|
|
|
1
|
-
|
|
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
|
-
|
|
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
|
-
*
|
|
294
|
-
* @returns {
|
|
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
|
-
|
|
325
|
-
let
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
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
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
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.
|
|
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
|
-
*
|
|
377
|
-
* @
|
|
70
|
+
* Cedar authorization response for the request.
|
|
71
|
+
* @returns {AuthorizeResultResponse}
|
|
378
72
|
*/
|
|
379
|
-
|
|
380
|
-
const
|
|
381
|
-
|
|
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
|
-
*
|
|
386
|
-
*
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
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
|
-
*
|
|
406
|
-
* @
|
|
89
|
+
* Request ID of the authorization request
|
|
90
|
+
* @param {string} arg0
|
|
407
91
|
*/
|
|
408
|
-
|
|
409
|
-
const ptr0 = passStringToWasm0(
|
|
92
|
+
set request_id(arg0) {
|
|
93
|
+
const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
410
94
|
const len0 = WASM_VECTOR_LEN;
|
|
411
|
-
|
|
412
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
*
|
|
491
|
-
*
|
|
492
|
-
* @param {
|
|
493
|
-
* @returns {Promise<
|
|
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
|
-
|
|
506
|
-
const ret = wasm.
|
|
507
|
-
return
|
|
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
|
-
*
|
|
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
|
-
|
|
516
|
-
const ret = wasm.
|
|
517
|
-
return
|
|
194
|
+
authorize_unsigned(request) {
|
|
195
|
+
const ret = wasm.cedarling_authorize_unsigned(this.__wbg_ptr, request);
|
|
196
|
+
return ret;
|
|
518
197
|
}
|
|
519
198
|
/**
|
|
520
|
-
*
|
|
521
|
-
*
|
|
522
|
-
*
|
|
523
|
-
*
|
|
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
|
-
|
|
526
|
-
const ret = wasm.
|
|
527
|
-
|
|
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
|
|
531
|
-
*
|
|
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
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
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
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
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
|
|
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
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
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
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
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
|
-
*
|
|
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
|
-
|
|
675
|
-
|
|
597
|
+
class DataEntry {
|
|
676
598
|
static __wrap(ptr) {
|
|
677
599
|
ptr = ptr >>> 0;
|
|
678
|
-
const obj = Object.create(
|
|
600
|
+
const obj = Object.create(DataEntry.prototype);
|
|
679
601
|
obj.__wbg_ptr = ptr;
|
|
680
|
-
|
|
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
|
-
|
|
608
|
+
DataEntryFinalization.unregister(this);
|
|
688
609
|
return ptr;
|
|
689
610
|
}
|
|
690
|
-
|
|
691
611
|
free() {
|
|
692
612
|
const ptr = this.__destroy_into_raw();
|
|
693
|
-
wasm.
|
|
613
|
+
wasm.__wbg_dataentry_free(ptr, 0);
|
|
694
614
|
}
|
|
695
615
|
/**
|
|
696
|
-
* `
|
|
697
|
-
*
|
|
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
|
-
|
|
619
|
+
json_string() {
|
|
620
|
+
let deferred1_0;
|
|
621
|
+
let deferred1_1;
|
|
703
622
|
try {
|
|
704
|
-
const
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
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.
|
|
628
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
713
629
|
}
|
|
714
630
|
}
|
|
715
631
|
/**
|
|
716
|
-
*
|
|
717
|
-
*
|
|
718
|
-
* @returns {PolicyEvaluationError[]}
|
|
632
|
+
* Get the value stored in this entry as a JavaScript object
|
|
633
|
+
* @returns {any}
|
|
719
634
|
*/
|
|
720
|
-
|
|
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
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
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.
|
|
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
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
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
|
-
|
|
773
|
+
DataStoreStatsFinalization.unregister(this);
|
|
745
774
|
return ptr;
|
|
746
775
|
}
|
|
747
|
-
|
|
748
776
|
free() {
|
|
749
777
|
const ptr = this.__destroy_into_raw();
|
|
750
|
-
wasm.
|
|
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
|
-
*
|
|
760
|
-
* @
|
|
761
|
-
* @returns {any}
|
|
781
|
+
* Convert `DataStoreStats` to json string value
|
|
782
|
+
* @returns {string}
|
|
762
783
|
*/
|
|
763
|
-
|
|
784
|
+
json_string() {
|
|
785
|
+
let deferred1_0;
|
|
786
|
+
let deferred1_1;
|
|
764
787
|
try {
|
|
765
|
-
const
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
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.
|
|
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
|
-
*
|
|
785
|
-
*
|
|
936
|
+
* Diagnostics
|
|
937
|
+
* ===========
|
|
786
938
|
*
|
|
787
|
-
*
|
|
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
|
-
|
|
790
|
-
|
|
941
|
+
class Diagnostics {
|
|
791
942
|
static __wrap(ptr) {
|
|
792
943
|
ptr = ptr >>> 0;
|
|
793
|
-
const obj = Object.create(
|
|
944
|
+
const obj = Object.create(Diagnostics.prototype);
|
|
794
945
|
obj.__wbg_ptr = ptr;
|
|
795
|
-
|
|
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
|
-
|
|
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.
|
|
1043
|
+
wasm.__wbg_intounderlyingsink_free(ptr, 0);
|
|
809
1044
|
}
|
|
810
1045
|
/**
|
|
811
|
-
*
|
|
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
|
|
1137
|
+
get request_id() {
|
|
815
1138
|
let deferred1_0;
|
|
816
1139
|
let deferred1_1;
|
|
817
1140
|
try {
|
|
818
|
-
const
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
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.
|
|
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
|
-
*
|
|
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
|
-
|
|
1161
|
+
json_string() {
|
|
835
1162
|
let deferred1_0;
|
|
836
1163
|
let deferred1_1;
|
|
837
1164
|
try {
|
|
838
|
-
const
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
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.
|
|
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
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
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
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
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
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
return
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
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
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
return
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
return
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
return
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
return
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
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
|
-
|
|
1405
|
-
|
|
1972
|
+
return {
|
|
1973
|
+
__proto__: null,
|
|
1974
|
+
"./cedarling_wasm_bg.js": import0,
|
|
1406
1975
|
};
|
|
1976
|
+
}
|
|
1407
1977
|
|
|
1408
|
-
|
|
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
|
|
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
|
|
1416
|
-
wasm
|
|
1417
|
-
|
|
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
|
-
|
|
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
|
|
1427
|
-
if (
|
|
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
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
2148
|
+
function getArrayU8FromWasm0(ptr, len) {
|
|
2149
|
+
ptr = ptr >>> 0;
|
|
2150
|
+
return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
|
|
2151
|
+
}
|
|
1441
2152
|
|
|
1442
|
-
|
|
1443
|
-
|
|
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
|
-
|
|
2161
|
+
function getStringFromWasm0(ptr, len) {
|
|
2162
|
+
ptr = ptr >>> 0;
|
|
2163
|
+
return decodeText(ptr, len);
|
|
2164
|
+
}
|
|
1447
2165
|
|
|
1448
|
-
|
|
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
|
-
|
|
1452
|
-
|
|
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
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
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
|
-
|
|
1464
|
-
|
|
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
|
-
|
|
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
|
-
|
|
1469
|
-
|
|
2244
|
+
offset += ret.written;
|
|
2245
|
+
ptr = realloc(ptr, len, offset, 1) >>> 0;
|
|
1470
2246
|
}
|
|
1471
2247
|
|
|
1472
|
-
|
|
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
|
-
|
|
2264
|
+
const cachedTextEncoder = new TextEncoder();
|
|
1475
2265
|
|
|
1476
|
-
|
|
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
|
-
|
|
1480
|
-
|
|
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();
|