@janssenproject/cedarling_wasm 2.4.0-nodejs → 2.5.0
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/LICENSE +201 -0
- package/README.md +411 -517
- package/dist/browser/index.js +3346 -0
- package/dist/browser/index.js.map +7 -0
- package/dist/cjs/index.cjs +3327 -0
- package/dist/cjs/index.cjs.map +7 -0
- package/dist/edge/index.js +3276 -0
- package/dist/edge/index.js.map +7 -0
- package/dist/esm/index.js +3341 -0
- package/dist/esm/index.js.map +7 -0
- package/dist/manual/index.js +3292 -0
- package/dist/manual/index.js.map +7 -0
- package/dist/types/cjs/generated.d.ts +1166 -0
- package/dist/types/cjs/index.d.ts +6 -0
- package/dist/types/cjs/package.json +1 -0
- package/dist/types/esm/edge.d.ts +7 -0
- package/dist/types/esm/generated.d.ts +1166 -0
- package/dist/types/esm/index.d.ts +6 -0
- package/dist/types/esm/manual.d.ts +2 -0
- package/dist/types/esm/wasm.d.ts +2 -0
- package/{cedarling_wasm_bg.wasm → dist/wasm/cedarling_wasm_bg.wasm} +0 -0
- package/package.json +81 -8
- package/cedarling_wasm.d.ts +0 -759
- package/cedarling_wasm.js +0 -3003
|
@@ -0,0 +1,3341 @@
|
|
|
1
|
+
// cedarling-generated-glue:/home/runner/work/jans/jans/jans-cedarling/bindings/cedarling_wasm/pkg/cedarling_wasm.js
|
|
2
|
+
var AuthorizeResult = class _AuthorizeResult {
|
|
3
|
+
static __wrap(ptr) {
|
|
4
|
+
const obj = Object.create(_AuthorizeResult.prototype);
|
|
5
|
+
obj.__wbg_ptr = ptr;
|
|
6
|
+
AuthorizeResultFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
7
|
+
return obj;
|
|
8
|
+
}
|
|
9
|
+
__destroy_into_raw() {
|
|
10
|
+
const ptr = this.__wbg_ptr;
|
|
11
|
+
this.__wbg_ptr = 0;
|
|
12
|
+
AuthorizeResultFinalization.unregister(this);
|
|
13
|
+
return ptr;
|
|
14
|
+
}
|
|
15
|
+
free() {
|
|
16
|
+
const ptr = this.__destroy_into_raw();
|
|
17
|
+
wasm.__wbg_authorizeresult_free(ptr, 0);
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Convert `AuthorizeResult` to json string value
|
|
21
|
+
* @returns {string}
|
|
22
|
+
*/
|
|
23
|
+
jsonString() {
|
|
24
|
+
let deferred1_0;
|
|
25
|
+
let deferred1_1;
|
|
26
|
+
try {
|
|
27
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
28
|
+
wasm.authorizeresult_jsonString(retptr, this.__wbg_ptr);
|
|
29
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
30
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
31
|
+
deferred1_0 = r0;
|
|
32
|
+
deferred1_1 = r1;
|
|
33
|
+
return getStringFromWasm0(r0, r1);
|
|
34
|
+
} finally {
|
|
35
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
36
|
+
wasm.__wbindgen_export5(deferred1_0, deferred1_1, 1);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Result of authorization
|
|
41
|
+
* true means `ALLOW`
|
|
42
|
+
* false means `Deny`
|
|
43
|
+
*
|
|
44
|
+
* this field is [`bool`] type to be compatible with [authzen Access Evaluation Decision](https://openid.github.io/authzen/#section-6.2.1).
|
|
45
|
+
* @returns {boolean}
|
|
46
|
+
*/
|
|
47
|
+
get decision() {
|
|
48
|
+
const ret = wasm.__wbg_get_authorizeresult_decision(this.__wbg_ptr);
|
|
49
|
+
return ret !== 0;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Request ID of the authorization request
|
|
53
|
+
* @returns {string}
|
|
54
|
+
*/
|
|
55
|
+
get request_id() {
|
|
56
|
+
let deferred1_0;
|
|
57
|
+
let deferred1_1;
|
|
58
|
+
try {
|
|
59
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
60
|
+
wasm.__wbg_get_authorizeresult_request_id(retptr, this.__wbg_ptr);
|
|
61
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
62
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
63
|
+
deferred1_0 = r0;
|
|
64
|
+
deferred1_1 = r1;
|
|
65
|
+
return getStringFromWasm0(r0, r1);
|
|
66
|
+
} finally {
|
|
67
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
68
|
+
wasm.__wbindgen_export5(deferred1_0, deferred1_1, 1);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Cedar authorization response for the request.
|
|
73
|
+
* @returns {AuthorizeResultResponse}
|
|
74
|
+
*/
|
|
75
|
+
get response() {
|
|
76
|
+
const ret = wasm.__wbg_get_authorizeresult_response(this.__wbg_ptr);
|
|
77
|
+
return AuthorizeResultResponse.__wrap(ret);
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Result of authorization
|
|
81
|
+
* true means `ALLOW`
|
|
82
|
+
* false means `Deny`
|
|
83
|
+
*
|
|
84
|
+
* this field is [`bool`] type to be compatible with [authzen Access Evaluation Decision](https://openid.github.io/authzen/#section-6.2.1).
|
|
85
|
+
* @param {boolean} arg0
|
|
86
|
+
*/
|
|
87
|
+
set decision(arg0) {
|
|
88
|
+
wasm.__wbg_set_authorizeresult_decision(this.__wbg_ptr, arg0);
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Request ID of the authorization request
|
|
92
|
+
* @param {string} arg0
|
|
93
|
+
*/
|
|
94
|
+
set request_id(arg0) {
|
|
95
|
+
const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
96
|
+
const len0 = WASM_VECTOR_LEN;
|
|
97
|
+
wasm.__wbg_set_authorizeresult_request_id(this.__wbg_ptr, ptr0, len0);
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Cedar authorization response for the request.
|
|
101
|
+
* @param {AuthorizeResultResponse} arg0
|
|
102
|
+
*/
|
|
103
|
+
set response(arg0) {
|
|
104
|
+
_assertClass(arg0, AuthorizeResultResponse);
|
|
105
|
+
var ptr0 = arg0.__destroy_into_raw();
|
|
106
|
+
wasm.__wbg_set_authorizeresult_response(this.__wbg_ptr, ptr0);
|
|
107
|
+
}
|
|
108
|
+
};
|
|
109
|
+
if (Symbol.dispose) AuthorizeResult.prototype[Symbol.dispose] = AuthorizeResult.prototype.free;
|
|
110
|
+
var AuthorizeResultResponse = class _AuthorizeResultResponse {
|
|
111
|
+
static __wrap(ptr) {
|
|
112
|
+
const obj = Object.create(_AuthorizeResultResponse.prototype);
|
|
113
|
+
obj.__wbg_ptr = ptr;
|
|
114
|
+
AuthorizeResultResponseFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
115
|
+
return obj;
|
|
116
|
+
}
|
|
117
|
+
__destroy_into_raw() {
|
|
118
|
+
const ptr = this.__wbg_ptr;
|
|
119
|
+
this.__wbg_ptr = 0;
|
|
120
|
+
AuthorizeResultResponseFinalization.unregister(this);
|
|
121
|
+
return ptr;
|
|
122
|
+
}
|
|
123
|
+
free() {
|
|
124
|
+
const ptr = this.__destroy_into_raw();
|
|
125
|
+
wasm.__wbg_authorizeresultresponse_free(ptr, 0);
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Authorization decision
|
|
129
|
+
* @returns {boolean}
|
|
130
|
+
*/
|
|
131
|
+
get decision() {
|
|
132
|
+
const ret = wasm.authorizeresultresponse_decision(this.__wbg_ptr);
|
|
133
|
+
return ret !== 0;
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* Diagnostics providing more information on how this decision was reached
|
|
137
|
+
* @returns {Diagnostics}
|
|
138
|
+
*/
|
|
139
|
+
get diagnostics() {
|
|
140
|
+
const ret = wasm.authorizeresultresponse_diagnostics(this.__wbg_ptr);
|
|
141
|
+
return Diagnostics.__wrap(ret);
|
|
142
|
+
}
|
|
143
|
+
};
|
|
144
|
+
if (Symbol.dispose) AuthorizeResultResponse.prototype[Symbol.dispose] = AuthorizeResultResponse.prototype.free;
|
|
145
|
+
var BatchAuthorizeMultiIssuerResponse = class _BatchAuthorizeMultiIssuerResponse {
|
|
146
|
+
static __wrap(ptr) {
|
|
147
|
+
const obj = Object.create(_BatchAuthorizeMultiIssuerResponse.prototype);
|
|
148
|
+
obj.__wbg_ptr = ptr;
|
|
149
|
+
BatchAuthorizeMultiIssuerResponseFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
150
|
+
return obj;
|
|
151
|
+
}
|
|
152
|
+
__destroy_into_raw() {
|
|
153
|
+
const ptr = this.__wbg_ptr;
|
|
154
|
+
this.__wbg_ptr = 0;
|
|
155
|
+
BatchAuthorizeMultiIssuerResponseFinalization.unregister(this);
|
|
156
|
+
return ptr;
|
|
157
|
+
}
|
|
158
|
+
free() {
|
|
159
|
+
const ptr = this.__destroy_into_raw();
|
|
160
|
+
wasm.__wbg_batchauthorizemultiissuerresponse_free(ptr, 0);
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* Shared correlation id stamped on every per-item decision log entry.
|
|
164
|
+
* @returns {string}
|
|
165
|
+
*/
|
|
166
|
+
get batch_id() {
|
|
167
|
+
let deferred1_0;
|
|
168
|
+
let deferred1_1;
|
|
169
|
+
try {
|
|
170
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
171
|
+
wasm.batchauthorizemultiissuerresponse_batch_id(retptr, this.__wbg_ptr);
|
|
172
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
173
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
174
|
+
deferred1_0 = r0;
|
|
175
|
+
deferred1_1 = r1;
|
|
176
|
+
return getStringFromWasm0(r0, r1);
|
|
177
|
+
} finally {
|
|
178
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
179
|
+
wasm.__wbindgen_export5(deferred1_0, deferred1_1, 1);
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
/**
|
|
183
|
+
* Per-item results in input order — each slot is a
|
|
184
|
+
* [`BatchItemMultiIssuerResult`].
|
|
185
|
+
* @returns {BatchItemMultiIssuerResult[]}
|
|
186
|
+
*/
|
|
187
|
+
get results() {
|
|
188
|
+
try {
|
|
189
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
190
|
+
wasm.batchauthorizemultiissuerresponse_results(retptr, this.__wbg_ptr);
|
|
191
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
192
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
193
|
+
var v1 = getArrayJsValueFromWasm0(r0, r1);
|
|
194
|
+
wasm.__wbindgen_export5(r0, r1 * 4, 4);
|
|
195
|
+
return v1;
|
|
196
|
+
} finally {
|
|
197
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
};
|
|
201
|
+
if (Symbol.dispose) BatchAuthorizeMultiIssuerResponse.prototype[Symbol.dispose] = BatchAuthorizeMultiIssuerResponse.prototype.free;
|
|
202
|
+
var BatchAuthorizeUnsignedResponse = class _BatchAuthorizeUnsignedResponse {
|
|
203
|
+
static __wrap(ptr) {
|
|
204
|
+
const obj = Object.create(_BatchAuthorizeUnsignedResponse.prototype);
|
|
205
|
+
obj.__wbg_ptr = ptr;
|
|
206
|
+
BatchAuthorizeUnsignedResponseFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
207
|
+
return obj;
|
|
208
|
+
}
|
|
209
|
+
__destroy_into_raw() {
|
|
210
|
+
const ptr = this.__wbg_ptr;
|
|
211
|
+
this.__wbg_ptr = 0;
|
|
212
|
+
BatchAuthorizeUnsignedResponseFinalization.unregister(this);
|
|
213
|
+
return ptr;
|
|
214
|
+
}
|
|
215
|
+
free() {
|
|
216
|
+
const ptr = this.__destroy_into_raw();
|
|
217
|
+
wasm.__wbg_batchauthorizeunsignedresponse_free(ptr, 0);
|
|
218
|
+
}
|
|
219
|
+
/**
|
|
220
|
+
* Shared correlation id stamped on every per-item decision log entry.
|
|
221
|
+
* @returns {string}
|
|
222
|
+
*/
|
|
223
|
+
get batch_id() {
|
|
224
|
+
let deferred1_0;
|
|
225
|
+
let deferred1_1;
|
|
226
|
+
try {
|
|
227
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
228
|
+
wasm.batchauthorizeunsignedresponse_batch_id(retptr, this.__wbg_ptr);
|
|
229
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
230
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
231
|
+
deferred1_0 = r0;
|
|
232
|
+
deferred1_1 = r1;
|
|
233
|
+
return getStringFromWasm0(r0, r1);
|
|
234
|
+
} finally {
|
|
235
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
236
|
+
wasm.__wbindgen_export5(deferred1_0, deferred1_1, 1);
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
/**
|
|
240
|
+
* Per-item results in input order — each slot is a
|
|
241
|
+
* [`BatchItemUnsignedResult`].
|
|
242
|
+
* @returns {BatchItemUnsignedResult[]}
|
|
243
|
+
*/
|
|
244
|
+
get results() {
|
|
245
|
+
try {
|
|
246
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
247
|
+
wasm.batchauthorizeunsignedresponse_results(retptr, this.__wbg_ptr);
|
|
248
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
249
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
250
|
+
var v1 = getArrayJsValueFromWasm0(r0, r1);
|
|
251
|
+
wasm.__wbindgen_export5(r0, r1 * 4, 4);
|
|
252
|
+
return v1;
|
|
253
|
+
} finally {
|
|
254
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
};
|
|
258
|
+
if (Symbol.dispose) BatchAuthorizeUnsignedResponse.prototype[Symbol.dispose] = BatchAuthorizeUnsignedResponse.prototype.free;
|
|
259
|
+
var BatchItemError = class _BatchItemError {
|
|
260
|
+
static __wrap(ptr) {
|
|
261
|
+
const obj = Object.create(_BatchItemError.prototype);
|
|
262
|
+
obj.__wbg_ptr = ptr;
|
|
263
|
+
BatchItemErrorFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
264
|
+
return obj;
|
|
265
|
+
}
|
|
266
|
+
__destroy_into_raw() {
|
|
267
|
+
const ptr = this.__wbg_ptr;
|
|
268
|
+
this.__wbg_ptr = 0;
|
|
269
|
+
BatchItemErrorFinalization.unregister(this);
|
|
270
|
+
return ptr;
|
|
271
|
+
}
|
|
272
|
+
free() {
|
|
273
|
+
const ptr = this.__destroy_into_raw();
|
|
274
|
+
wasm.__wbg_batchitemerror_free(ptr, 0);
|
|
275
|
+
}
|
|
276
|
+
/**
|
|
277
|
+
* Stable variant slug — `action_parse`, `resource_build`, `context_build`,
|
|
278
|
+
* `principal_build`, `schema_validation`, `multi_issuer_entity`,
|
|
279
|
+
* `request_validation`.
|
|
280
|
+
* @returns {string}
|
|
281
|
+
*/
|
|
282
|
+
get category() {
|
|
283
|
+
let deferred1_0;
|
|
284
|
+
let deferred1_1;
|
|
285
|
+
try {
|
|
286
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
287
|
+
wasm.batchitemerror_category(retptr, this.__wbg_ptr);
|
|
288
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
289
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
290
|
+
deferred1_0 = r0;
|
|
291
|
+
deferred1_1 = r1;
|
|
292
|
+
return getStringFromWasm0(r0, r1);
|
|
293
|
+
} finally {
|
|
294
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
295
|
+
wasm.__wbindgen_export5(deferred1_0, deferred1_1, 1);
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
/**
|
|
299
|
+
* Position of the failing item in the original `items` vector.
|
|
300
|
+
* @returns {number}
|
|
301
|
+
*/
|
|
302
|
+
get item_index() {
|
|
303
|
+
const ret = wasm.batchitemerror_item_index(this.__wbg_ptr);
|
|
304
|
+
return ret >>> 0;
|
|
305
|
+
}
|
|
306
|
+
/**
|
|
307
|
+
* Human-readable diagnostic. Safe to log.
|
|
308
|
+
* @returns {string}
|
|
309
|
+
*/
|
|
310
|
+
get message() {
|
|
311
|
+
let deferred1_0;
|
|
312
|
+
let deferred1_1;
|
|
313
|
+
try {
|
|
314
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
315
|
+
wasm.batchitemerror_message(retptr, this.__wbg_ptr);
|
|
316
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
317
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
318
|
+
deferred1_0 = r0;
|
|
319
|
+
deferred1_1 = r1;
|
|
320
|
+
return getStringFromWasm0(r0, r1);
|
|
321
|
+
} finally {
|
|
322
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
323
|
+
wasm.__wbindgen_export5(deferred1_0, deferred1_1, 1);
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
};
|
|
327
|
+
if (Symbol.dispose) BatchItemError.prototype[Symbol.dispose] = BatchItemError.prototype.free;
|
|
328
|
+
var BatchItemMultiIssuerResult = class _BatchItemMultiIssuerResult {
|
|
329
|
+
static __wrap(ptr) {
|
|
330
|
+
const obj = Object.create(_BatchItemMultiIssuerResult.prototype);
|
|
331
|
+
obj.__wbg_ptr = ptr;
|
|
332
|
+
BatchItemMultiIssuerResultFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
333
|
+
return obj;
|
|
334
|
+
}
|
|
335
|
+
__destroy_into_raw() {
|
|
336
|
+
const ptr = this.__wbg_ptr;
|
|
337
|
+
this.__wbg_ptr = 0;
|
|
338
|
+
BatchItemMultiIssuerResultFinalization.unregister(this);
|
|
339
|
+
return ptr;
|
|
340
|
+
}
|
|
341
|
+
free() {
|
|
342
|
+
const ptr = this.__destroy_into_raw();
|
|
343
|
+
wasm.__wbg_batchitemmultiissuerresult_free(ptr, 0);
|
|
344
|
+
}
|
|
345
|
+
/**
|
|
346
|
+
* The per-item error if `!is_ok()`; `undefined` otherwise.
|
|
347
|
+
* @returns {BatchItemError | undefined}
|
|
348
|
+
*/
|
|
349
|
+
get error() {
|
|
350
|
+
const ret = wasm.batchitemmultiissuerresult_error(this.__wbg_ptr);
|
|
351
|
+
return ret === 0 ? void 0 : BatchItemError.__wrap(ret);
|
|
352
|
+
}
|
|
353
|
+
/**
|
|
354
|
+
* `true` when Cedar evaluated this item.
|
|
355
|
+
* @returns {boolean}
|
|
356
|
+
*/
|
|
357
|
+
get is_ok() {
|
|
358
|
+
const ret = wasm.batchitemmultiissuerresult_is_ok(this.__wbg_ptr);
|
|
359
|
+
return ret !== 0;
|
|
360
|
+
}
|
|
361
|
+
/**
|
|
362
|
+
* The multi-issuer decision if `is_ok()`; throws otherwise.
|
|
363
|
+
* @returns {MultiIssuerAuthorizeResult}
|
|
364
|
+
*/
|
|
365
|
+
unwrap() {
|
|
366
|
+
try {
|
|
367
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
368
|
+
wasm.batchitemmultiissuerresult_unwrap(retptr, this.__wbg_ptr);
|
|
369
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
370
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
371
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
372
|
+
if (r2) {
|
|
373
|
+
throw takeObject(r1);
|
|
374
|
+
}
|
|
375
|
+
return MultiIssuerAuthorizeResult.__wrap(r0);
|
|
376
|
+
} finally {
|
|
377
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
};
|
|
381
|
+
if (Symbol.dispose) BatchItemMultiIssuerResult.prototype[Symbol.dispose] = BatchItemMultiIssuerResult.prototype.free;
|
|
382
|
+
var BatchItemUnsignedResult = class _BatchItemUnsignedResult {
|
|
383
|
+
static __wrap(ptr) {
|
|
384
|
+
const obj = Object.create(_BatchItemUnsignedResult.prototype);
|
|
385
|
+
obj.__wbg_ptr = ptr;
|
|
386
|
+
BatchItemUnsignedResultFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
387
|
+
return obj;
|
|
388
|
+
}
|
|
389
|
+
__destroy_into_raw() {
|
|
390
|
+
const ptr = this.__wbg_ptr;
|
|
391
|
+
this.__wbg_ptr = 0;
|
|
392
|
+
BatchItemUnsignedResultFinalization.unregister(this);
|
|
393
|
+
return ptr;
|
|
394
|
+
}
|
|
395
|
+
free() {
|
|
396
|
+
const ptr = this.__destroy_into_raw();
|
|
397
|
+
wasm.__wbg_batchitemunsignedresult_free(ptr, 0);
|
|
398
|
+
}
|
|
399
|
+
/**
|
|
400
|
+
* The per-item error if `!is_ok()`; `undefined` otherwise.
|
|
401
|
+
* @returns {BatchItemError | undefined}
|
|
402
|
+
*/
|
|
403
|
+
get error() {
|
|
404
|
+
const ret = wasm.batchitemunsignedresult_error(this.__wbg_ptr);
|
|
405
|
+
return ret === 0 ? void 0 : BatchItemError.__wrap(ret);
|
|
406
|
+
}
|
|
407
|
+
/**
|
|
408
|
+
* `true` when Cedar evaluated this item (Allow or Deny); `false` when it
|
|
409
|
+
* failed to build.
|
|
410
|
+
* @returns {boolean}
|
|
411
|
+
*/
|
|
412
|
+
get is_ok() {
|
|
413
|
+
const ret = wasm.batchitemunsignedresult_is_ok(this.__wbg_ptr);
|
|
414
|
+
return ret !== 0;
|
|
415
|
+
}
|
|
416
|
+
/**
|
|
417
|
+
* The Cedar decision if `is_ok()`; throws otherwise.
|
|
418
|
+
* @returns {AuthorizeResult}
|
|
419
|
+
*/
|
|
420
|
+
unwrap() {
|
|
421
|
+
try {
|
|
422
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
423
|
+
wasm.batchitemunsignedresult_unwrap(retptr, this.__wbg_ptr);
|
|
424
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
425
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
426
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
427
|
+
if (r2) {
|
|
428
|
+
throw takeObject(r1);
|
|
429
|
+
}
|
|
430
|
+
return AuthorizeResult.__wrap(r0);
|
|
431
|
+
} finally {
|
|
432
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
433
|
+
}
|
|
434
|
+
}
|
|
435
|
+
};
|
|
436
|
+
if (Symbol.dispose) BatchItemUnsignedResult.prototype[Symbol.dispose] = BatchItemUnsignedResult.prototype.free;
|
|
437
|
+
var Cedarling = class _Cedarling {
|
|
438
|
+
static __wrap(ptr) {
|
|
439
|
+
const obj = Object.create(_Cedarling.prototype);
|
|
440
|
+
obj.__wbg_ptr = ptr;
|
|
441
|
+
CedarlingFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
442
|
+
return obj;
|
|
443
|
+
}
|
|
444
|
+
__destroy_into_raw() {
|
|
445
|
+
const ptr = this.__wbg_ptr;
|
|
446
|
+
this.__wbg_ptr = 0;
|
|
447
|
+
CedarlingFinalization.unregister(this);
|
|
448
|
+
return ptr;
|
|
449
|
+
}
|
|
450
|
+
free() {
|
|
451
|
+
const ptr = this.__destroy_into_raw();
|
|
452
|
+
wasm.__wbg_cedarling_free(ptr, 0);
|
|
453
|
+
}
|
|
454
|
+
/**
|
|
455
|
+
* Collect every value of the annotation `key` across the given policies,
|
|
456
|
+
* preserving duplicates. Unknown policy IDs are silently skipped.
|
|
457
|
+
*
|
|
458
|
+
* # Arguments
|
|
459
|
+
*
|
|
460
|
+
* * `policy_ids` - List of policy IDs to search. Typically
|
|
461
|
+
* `result.response.diagnostics.reason` from an authorization result.
|
|
462
|
+
* * `key` - The annotation key to collect values for (e.g. `"redirect"`).
|
|
463
|
+
*
|
|
464
|
+
* # Example
|
|
465
|
+
*
|
|
466
|
+
* ```javascript
|
|
467
|
+
* const redirects = cedarling.annotationValues(
|
|
468
|
+
* result.response.diagnostics.reason,
|
|
469
|
+
* "redirect",
|
|
470
|
+
* );
|
|
471
|
+
* // ["/upgrade"]
|
|
472
|
+
* ```
|
|
473
|
+
* @param {string[]} policy_ids
|
|
474
|
+
* @param {string} key
|
|
475
|
+
* @returns {string[]}
|
|
476
|
+
*/
|
|
477
|
+
annotationValues(policy_ids, key) {
|
|
478
|
+
try {
|
|
479
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
480
|
+
const ptr0 = passArrayJsValueToWasm0(policy_ids, wasm.__wbindgen_export);
|
|
481
|
+
const len0 = WASM_VECTOR_LEN;
|
|
482
|
+
const ptr1 = passStringToWasm0(key, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
483
|
+
const len1 = WASM_VECTOR_LEN;
|
|
484
|
+
wasm.cedarling_annotationValues(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1);
|
|
485
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
486
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
487
|
+
var v3 = getArrayJsValueFromWasm0(r0, r1);
|
|
488
|
+
wasm.__wbindgen_export5(r0, r1 * 4, 4);
|
|
489
|
+
return v3;
|
|
490
|
+
} finally {
|
|
491
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
492
|
+
}
|
|
493
|
+
}
|
|
494
|
+
/**
|
|
495
|
+
* Return the annotations of each given policy, grouped by policy ID. It is
|
|
496
|
+
* the loss-free companion to `annotationsMap`. Unknown policy IDs are
|
|
497
|
+
* silently skipped.
|
|
498
|
+
*
|
|
499
|
+
* # Arguments
|
|
500
|
+
*
|
|
501
|
+
* * `policy_ids` - List of policy IDs whose annotations should be returned
|
|
502
|
+
* grouped by policy ID. Typically `result.response.diagnostics.reason` from
|
|
503
|
+
* an authorization result.
|
|
504
|
+
*
|
|
505
|
+
* # Example
|
|
506
|
+
*
|
|
507
|
+
* ```javascript
|
|
508
|
+
* const byPolicy = cedarling.annotationsByPolicy(result.response.diagnostics.reason);
|
|
509
|
+
* // { "5": { redirect: "/upgrade", tier: "premium" } }
|
|
510
|
+
* ```
|
|
511
|
+
* @param {string[]} policy_ids
|
|
512
|
+
* @returns {any}
|
|
513
|
+
*/
|
|
514
|
+
annotationsByPolicy(policy_ids) {
|
|
515
|
+
try {
|
|
516
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
517
|
+
const ptr0 = passArrayJsValueToWasm0(policy_ids, wasm.__wbindgen_export);
|
|
518
|
+
const len0 = WASM_VECTOR_LEN;
|
|
519
|
+
wasm.cedarling_annotationsByPolicy(retptr, this.__wbg_ptr, ptr0, len0);
|
|
520
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
521
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
522
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
523
|
+
if (r2) {
|
|
524
|
+
throw takeObject(r1);
|
|
525
|
+
}
|
|
526
|
+
return takeObject(r0);
|
|
527
|
+
} finally {
|
|
528
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
529
|
+
}
|
|
530
|
+
}
|
|
531
|
+
/**
|
|
532
|
+
* Merge the annotations (`@key("value")`) of the given policies into a single object.
|
|
533
|
+
*
|
|
534
|
+
* Intended for resolving the determining policies of an authorization decision:
|
|
535
|
+
* pass `result.response.diagnostics.reason`.
|
|
536
|
+
*
|
|
537
|
+
* Lossy: if the same annotation key appears on several policies, one value wins
|
|
538
|
+
* arbitrarily. Use `annotationValues` / `annotationsByPolicy` when duplicates
|
|
539
|
+
* matter. Unknown policy IDs are silently skipped.
|
|
540
|
+
*
|
|
541
|
+
* # Arguments
|
|
542
|
+
*
|
|
543
|
+
* * `policy_ids` - List of policy IDs whose annotations should be merged into
|
|
544
|
+
* a single object. Typically `result.response.diagnostics.reason` from an
|
|
545
|
+
* authorization result.
|
|
546
|
+
*
|
|
547
|
+
* # Example
|
|
548
|
+
*
|
|
549
|
+
* ```javascript
|
|
550
|
+
* const annotations = cedarling.annotationsMap(result.response.diagnostics.reason);
|
|
551
|
+
* // { redirect: "/upgrade", tier: "premium" }
|
|
552
|
+
* ```
|
|
553
|
+
* @param {string[]} policy_ids
|
|
554
|
+
* @returns {any}
|
|
555
|
+
*/
|
|
556
|
+
annotationsMap(policy_ids) {
|
|
557
|
+
try {
|
|
558
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
559
|
+
const ptr0 = passArrayJsValueToWasm0(policy_ids, wasm.__wbindgen_export);
|
|
560
|
+
const len0 = WASM_VECTOR_LEN;
|
|
561
|
+
wasm.cedarling_annotationsMap(retptr, this.__wbg_ptr, ptr0, len0);
|
|
562
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
563
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
564
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
565
|
+
if (r2) {
|
|
566
|
+
throw takeObject(r1);
|
|
567
|
+
}
|
|
568
|
+
return takeObject(r0);
|
|
569
|
+
} finally {
|
|
570
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
571
|
+
}
|
|
572
|
+
}
|
|
573
|
+
/**
|
|
574
|
+
* Authorize a batch of multi-issuer requests against one shared token set.
|
|
575
|
+
*
|
|
576
|
+
* Tokens are validated and token/issuer entities are built once, then
|
|
577
|
+
* each item is evaluated in input order. Batch-level failures (validation,
|
|
578
|
+
* JWT verification, status-list refresh) reject the whole call; per-item
|
|
579
|
+
* failures are returned as `BatchItemError` results and exposed by WASM
|
|
580
|
+
* with `is_ok=false` and `error`, while genuine Cedar denials remain
|
|
581
|
+
* `AuthorizeResult` values with `decision=false`.
|
|
582
|
+
*
|
|
583
|
+
* # Arguments
|
|
584
|
+
*
|
|
585
|
+
* * `request` - JSON string representation of [`BatchAuthorizeMultiIssuerRequest`].
|
|
586
|
+
*
|
|
587
|
+
* # Example
|
|
588
|
+
*
|
|
589
|
+
* ```javascript
|
|
590
|
+
* const result = await cedarling.authorizeMultiIssuerBatch(JSON.stringify(batchRequest));
|
|
591
|
+
* ```
|
|
592
|
+
* @param {string} request
|
|
593
|
+
* @returns {Promise<BatchAuthorizeMultiIssuerResponse>}
|
|
594
|
+
*/
|
|
595
|
+
authorizeMultiIssuerBatch(request) {
|
|
596
|
+
const ptr0 = passStringToWasm0(request, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
597
|
+
const len0 = WASM_VECTOR_LEN;
|
|
598
|
+
const ret = wasm.cedarling_authorizeMultiIssuerBatch(this.__wbg_ptr, ptr0, len0);
|
|
599
|
+
return takeObject(ret);
|
|
600
|
+
}
|
|
601
|
+
/**
|
|
602
|
+
* Authorize multi-issuer request.
|
|
603
|
+
* Makes authorization decision based on multiple JWT tokens from different issuers.
|
|
604
|
+
*
|
|
605
|
+
* # Arguments
|
|
606
|
+
*
|
|
607
|
+
* * `request` - JSON string representation of [`AuthorizeMultiIssuerRequest`].
|
|
608
|
+
*
|
|
609
|
+
* # Example
|
|
610
|
+
*
|
|
611
|
+
* ```javascript
|
|
612
|
+
* const result = await cedarling.authorizeMultiIssuer(JSON.stringify(request));
|
|
613
|
+
* ```
|
|
614
|
+
* @param {string} request
|
|
615
|
+
* @returns {Promise<MultiIssuerAuthorizeResult>}
|
|
616
|
+
*/
|
|
617
|
+
authorizeMultiIssuer(request) {
|
|
618
|
+
const ptr0 = passStringToWasm0(request, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
619
|
+
const len0 = WASM_VECTOR_LEN;
|
|
620
|
+
const ret = wasm.cedarling_authorizeMultiIssuer(this.__wbg_ptr, ptr0, len0);
|
|
621
|
+
return takeObject(ret);
|
|
622
|
+
}
|
|
623
|
+
/**
|
|
624
|
+
* Authorize a batch of unsigned requests against one shared principal.
|
|
625
|
+
*
|
|
626
|
+
* Setup work (principal build + pushed-data snapshot) runs once and each
|
|
627
|
+
* item is evaluated in input order. Results are returned inside a
|
|
628
|
+
* [`BatchAuthorizeUnsignedResponse`] carrying the shared `batch_id`.
|
|
629
|
+
* Batch-level failures (validation, principal parse) reject the whole
|
|
630
|
+
* call; per-item failures are returned as `BatchItemError` results and
|
|
631
|
+
* exposed by WASM with `is_ok=false` and `error`, while genuine Cedar
|
|
632
|
+
* denials remain `AuthorizeResult` values with `decision=false`.
|
|
633
|
+
* # Arguments
|
|
634
|
+
*
|
|
635
|
+
* * `request` - JSON string representation of [`BatchAuthorizeUnsignedRequest`].
|
|
636
|
+
*
|
|
637
|
+
* # Example
|
|
638
|
+
*
|
|
639
|
+
* ```javascript
|
|
640
|
+
* const result = await cedarling.authorizeUnsignedBatch(JSON.stringify(batchRequest));
|
|
641
|
+
* ```
|
|
642
|
+
* @param {string} request
|
|
643
|
+
* @returns {Promise<BatchAuthorizeUnsignedResponse>}
|
|
644
|
+
*/
|
|
645
|
+
authorizeUnsignedBatch(request) {
|
|
646
|
+
const ptr0 = passStringToWasm0(request, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
647
|
+
const len0 = WASM_VECTOR_LEN;
|
|
648
|
+
const ret = wasm.cedarling_authorizeUnsignedBatch(this.__wbg_ptr, ptr0, len0);
|
|
649
|
+
return takeObject(ret);
|
|
650
|
+
}
|
|
651
|
+
/**
|
|
652
|
+
* Authorize an unsigned request carrying an optional single principal.
|
|
653
|
+
* Makes an authorization decision based on the [`RequestUnsigned`].
|
|
654
|
+
*
|
|
655
|
+
* When `principal` is omitted / `null` on the JS side the core uses Cedar
|
|
656
|
+
* partial evaluation; residual-dependent requests fail closed with
|
|
657
|
+
* `Decision::Deny` and surface residual policy ids in
|
|
658
|
+
* `response.diagnostics.reason`.
|
|
659
|
+
*
|
|
660
|
+
* # Arguments
|
|
661
|
+
*
|
|
662
|
+
* * `request` - JSON string representation of [`RequestUnsigned`].
|
|
663
|
+
*
|
|
664
|
+
* # Example
|
|
665
|
+
*
|
|
666
|
+
* ```javascript
|
|
667
|
+
* const result = await cedarling.authorizeUnsigned(JSON.stringify(request));
|
|
668
|
+
* ```
|
|
669
|
+
* @param {string} request
|
|
670
|
+
* @returns {Promise<AuthorizeResult>}
|
|
671
|
+
*/
|
|
672
|
+
authorizeUnsigned(request) {
|
|
673
|
+
const ptr0 = passStringToWasm0(request, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
674
|
+
const len0 = WASM_VECTOR_LEN;
|
|
675
|
+
const ret = wasm.cedarling_authorizeUnsigned(this.__wbg_ptr, ptr0, len0);
|
|
676
|
+
return takeObject(ret);
|
|
677
|
+
}
|
|
678
|
+
/**
|
|
679
|
+
* Clear all entries from the data store.
|
|
680
|
+
*
|
|
681
|
+
* # Arguments
|
|
682
|
+
*
|
|
683
|
+
* None.
|
|
684
|
+
*
|
|
685
|
+
* # Example
|
|
686
|
+
*
|
|
687
|
+
* ```javascript
|
|
688
|
+
* cedarling.clearDataCtx();
|
|
689
|
+
* console.log("All data entries cleared");
|
|
690
|
+
* ```
|
|
691
|
+
*/
|
|
692
|
+
clearDataCtx() {
|
|
693
|
+
try {
|
|
694
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
695
|
+
wasm.cedarling_clearDataCtx(retptr, this.__wbg_ptr);
|
|
696
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
697
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
698
|
+
if (r1) {
|
|
699
|
+
throw takeObject(r0);
|
|
700
|
+
}
|
|
701
|
+
} finally {
|
|
702
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
703
|
+
}
|
|
704
|
+
}
|
|
705
|
+
/**
|
|
706
|
+
* Destructive read: returns the telemetry metrics snapshot and resets
|
|
707
|
+
* the counters for the next interval.
|
|
708
|
+
*
|
|
709
|
+
* Fails when `CEDARLING_METRICS_COLLECTION` is disabled or whenever
|
|
710
|
+
* `CEDARLING_LOCK_TELEMETRY_INTERVAL` is set (even if the Lock server
|
|
711
|
+
* has no telemetry endpoint). `interval_secs` is fractional seconds,
|
|
712
|
+
* so sub-second intervals are reported exactly.
|
|
713
|
+
*
|
|
714
|
+
* # Example
|
|
715
|
+
*
|
|
716
|
+
* ```javascript
|
|
717
|
+
* const snapshot = cedarling.drainMetrics();
|
|
718
|
+
* console.log(`Requests: ${snapshot.operational_stats.get("authz.requests_total")}`);
|
|
719
|
+
* ```
|
|
720
|
+
* @returns {MetricsSnapshot}
|
|
721
|
+
*/
|
|
722
|
+
drainMetrics() {
|
|
723
|
+
try {
|
|
724
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
725
|
+
wasm.cedarling_drainMetrics(retptr, this.__wbg_ptr);
|
|
726
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
727
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
728
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
729
|
+
if (r2) {
|
|
730
|
+
throw takeObject(r1);
|
|
731
|
+
}
|
|
732
|
+
return MetricsSnapshot.__wrap(r0);
|
|
733
|
+
} finally {
|
|
734
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
735
|
+
}
|
|
736
|
+
}
|
|
737
|
+
/**
|
|
738
|
+
* Get trusted issuer identifiers that failed to load.
|
|
739
|
+
*
|
|
740
|
+
* # Arguments
|
|
741
|
+
*
|
|
742
|
+
* None.
|
|
743
|
+
*
|
|
744
|
+
* # Example
|
|
745
|
+
*
|
|
746
|
+
* ```javascript
|
|
747
|
+
* const ids = cedarling.failedTrustedIssuerIds();
|
|
748
|
+
* ```
|
|
749
|
+
* @returns {Array<any>}
|
|
750
|
+
*/
|
|
751
|
+
failedTrustedIssuerIds() {
|
|
752
|
+
const ret = wasm.cedarling_failedTrustedIssuerIds(this.__wbg_ptr);
|
|
753
|
+
return takeObject(ret);
|
|
754
|
+
}
|
|
755
|
+
/**
|
|
756
|
+
* Get a value from the data store by key.
|
|
757
|
+
* Returns null if the key doesn't exist or the entry has expired.
|
|
758
|
+
*
|
|
759
|
+
* # Arguments
|
|
760
|
+
*
|
|
761
|
+
* * `key` - A string key for the data entry to retrieve
|
|
762
|
+
*
|
|
763
|
+
* # Example
|
|
764
|
+
*
|
|
765
|
+
* ```javascript
|
|
766
|
+
* const value = cedarling.getDataCtx("user:123");
|
|
767
|
+
* if (value !== null) {
|
|
768
|
+
* console.log(value.name); // "John"
|
|
769
|
+
* }
|
|
770
|
+
* ```
|
|
771
|
+
* @param {string} key
|
|
772
|
+
* @returns {any}
|
|
773
|
+
*/
|
|
774
|
+
getDataCtx(key) {
|
|
775
|
+
try {
|
|
776
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
777
|
+
const ptr0 = passStringToWasm0(key, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
778
|
+
const len0 = WASM_VECTOR_LEN;
|
|
779
|
+
wasm.cedarling_getDataCtx(retptr, this.__wbg_ptr, ptr0, len0);
|
|
780
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
781
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
782
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
783
|
+
if (r2) {
|
|
784
|
+
throw takeObject(r1);
|
|
785
|
+
}
|
|
786
|
+
return takeObject(r0);
|
|
787
|
+
} finally {
|
|
788
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
789
|
+
}
|
|
790
|
+
}
|
|
791
|
+
/**
|
|
792
|
+
* Get a data entry with full metadata by key.
|
|
793
|
+
* Returns undefined if the key doesn't exist or the entry has expired.
|
|
794
|
+
*
|
|
795
|
+
* # Arguments
|
|
796
|
+
*
|
|
797
|
+
* * `key` - A string key for the data entry to retrieve
|
|
798
|
+
*
|
|
799
|
+
* # Example
|
|
800
|
+
*
|
|
801
|
+
* ```javascript
|
|
802
|
+
* const entry = cedarling.getDataEntryCtx("user:123");
|
|
803
|
+
* if (entry !== undefined) {
|
|
804
|
+
* console.log(entry.key); // "user:123"
|
|
805
|
+
* console.log(entry.value()); // { name: "John", age: 30 }
|
|
806
|
+
* console.log(entry.data_type); // "Record"
|
|
807
|
+
* console.log(entry.created_at); // "2024-01-01T12:00:00Z"
|
|
808
|
+
* console.log(entry.access_count); // 5
|
|
809
|
+
* }
|
|
810
|
+
* ```
|
|
811
|
+
* @param {string} key
|
|
812
|
+
* @returns {DataEntry | undefined}
|
|
813
|
+
*/
|
|
814
|
+
getDataEntryCtx(key) {
|
|
815
|
+
try {
|
|
816
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
817
|
+
const ptr0 = passStringToWasm0(key, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
818
|
+
const len0 = WASM_VECTOR_LEN;
|
|
819
|
+
wasm.cedarling_getDataEntryCtx(retptr, this.__wbg_ptr, ptr0, len0);
|
|
820
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
821
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
822
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
823
|
+
if (r2) {
|
|
824
|
+
throw takeObject(r1);
|
|
825
|
+
}
|
|
826
|
+
return r0 === 0 ? void 0 : DataEntry.__wrap(r0);
|
|
827
|
+
} finally {
|
|
828
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
829
|
+
}
|
|
830
|
+
}
|
|
831
|
+
/**
|
|
832
|
+
* Returns one retained memory log by ID, or `null` when it is not retained.
|
|
833
|
+
*
|
|
834
|
+
* # Arguments
|
|
835
|
+
*
|
|
836
|
+
* * `id` - The retained log identifier.
|
|
837
|
+
*
|
|
838
|
+
* # Example
|
|
839
|
+
*
|
|
840
|
+
* ```javascript
|
|
841
|
+
* const log = cedarling.getLogById("request-id");
|
|
842
|
+
* ```
|
|
843
|
+
* @param {string} id
|
|
844
|
+
* @returns {any}
|
|
845
|
+
*/
|
|
846
|
+
getLogById(id) {
|
|
847
|
+
try {
|
|
848
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
849
|
+
const ptr0 = passStringToWasm0(id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
850
|
+
const len0 = WASM_VECTOR_LEN;
|
|
851
|
+
wasm.cedarling_getLogById(retptr, this.__wbg_ptr, ptr0, len0);
|
|
852
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
853
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
854
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
855
|
+
if (r2) {
|
|
856
|
+
throw takeObject(r1);
|
|
857
|
+
}
|
|
858
|
+
return takeObject(r0);
|
|
859
|
+
} finally {
|
|
860
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
861
|
+
}
|
|
862
|
+
}
|
|
863
|
+
/**
|
|
864
|
+
* Returns identifiers for all retained memory logs.
|
|
865
|
+
*
|
|
866
|
+
* # Arguments
|
|
867
|
+
*
|
|
868
|
+
* None.
|
|
869
|
+
*
|
|
870
|
+
* # Example
|
|
871
|
+
*
|
|
872
|
+
* ```javascript
|
|
873
|
+
* const ids = cedarling.getLogIds();
|
|
874
|
+
* ```
|
|
875
|
+
* @returns {Array<any>}
|
|
876
|
+
*/
|
|
877
|
+
getLogIds() {
|
|
878
|
+
const ret = wasm.cedarling_getLogIds(this.__wbg_ptr);
|
|
879
|
+
return takeObject(ret);
|
|
880
|
+
}
|
|
881
|
+
/**
|
|
882
|
+
* Returns retained memory logs matching one request ID and indexed value.
|
|
883
|
+
*
|
|
884
|
+
* # Arguments
|
|
885
|
+
*
|
|
886
|
+
* * `requestId` - The request identifier to match.
|
|
887
|
+
* * `tag` - A log kind (`"System"`, `"Decision"`, or `"Metric"`) or a
|
|
888
|
+
* system-log level such as `"DEBUG"`.
|
|
889
|
+
*
|
|
890
|
+
* # Example
|
|
891
|
+
*
|
|
892
|
+
* ```javascript
|
|
893
|
+
* const logs = cedarling.getLogsByRequestIdAndTag("request-id", "System");
|
|
894
|
+
* ```
|
|
895
|
+
* @param {string} request_id
|
|
896
|
+
* @param {string} tag
|
|
897
|
+
* @returns {any[]}
|
|
898
|
+
*/
|
|
899
|
+
getLogsByRequestIdAndTag(request_id, tag) {
|
|
900
|
+
try {
|
|
901
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
902
|
+
const ptr0 = passStringToWasm0(request_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
903
|
+
const len0 = WASM_VECTOR_LEN;
|
|
904
|
+
const ptr1 = passStringToWasm0(tag, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
905
|
+
const len1 = WASM_VECTOR_LEN;
|
|
906
|
+
wasm.cedarling_getLogsByRequestIdAndTag(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1);
|
|
907
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
908
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
909
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
910
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
911
|
+
if (r3) {
|
|
912
|
+
throw takeObject(r2);
|
|
913
|
+
}
|
|
914
|
+
var v3 = getArrayJsValueFromWasm0(r0, r1);
|
|
915
|
+
wasm.__wbindgen_export5(r0, r1 * 4, 4);
|
|
916
|
+
return v3;
|
|
917
|
+
} finally {
|
|
918
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
919
|
+
}
|
|
920
|
+
}
|
|
921
|
+
/**
|
|
922
|
+
* Returns retained memory logs for one request ID.
|
|
923
|
+
*
|
|
924
|
+
* # Arguments
|
|
925
|
+
*
|
|
926
|
+
* * `requestId` - The request identifier to match.
|
|
927
|
+
*
|
|
928
|
+
* # Example
|
|
929
|
+
*
|
|
930
|
+
* ```javascript
|
|
931
|
+
* const logs = cedarling.getLogsByRequestId("request-id");
|
|
932
|
+
* ```
|
|
933
|
+
* @param {string} request_id
|
|
934
|
+
* @returns {any[]}
|
|
935
|
+
*/
|
|
936
|
+
getLogsByRequestId(request_id) {
|
|
937
|
+
try {
|
|
938
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
939
|
+
const ptr0 = passStringToWasm0(request_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
940
|
+
const len0 = WASM_VECTOR_LEN;
|
|
941
|
+
wasm.cedarling_getLogsByRequestId(retptr, this.__wbg_ptr, ptr0, len0);
|
|
942
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
943
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
944
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
945
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
946
|
+
if (r3) {
|
|
947
|
+
throw takeObject(r2);
|
|
948
|
+
}
|
|
949
|
+
var v2 = getArrayJsValueFromWasm0(r0, r1);
|
|
950
|
+
wasm.__wbindgen_export5(r0, r1 * 4, 4);
|
|
951
|
+
return v2;
|
|
952
|
+
} finally {
|
|
953
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
954
|
+
}
|
|
955
|
+
}
|
|
956
|
+
/**
|
|
957
|
+
* Returns retained memory logs matching an indexed value.
|
|
958
|
+
*
|
|
959
|
+
* # Arguments
|
|
960
|
+
*
|
|
961
|
+
* * `tag` - A log kind (`"System"`, `"Decision"`, or `"Metric"`) or a
|
|
962
|
+
* system-log level such as `"DEBUG"`.
|
|
963
|
+
*
|
|
964
|
+
* # Example
|
|
965
|
+
*
|
|
966
|
+
* ```javascript
|
|
967
|
+
* const logs = cedarling.getLogsByTag("System");
|
|
968
|
+
* ```
|
|
969
|
+
* @param {string} tag
|
|
970
|
+
* @returns {any[]}
|
|
971
|
+
*/
|
|
972
|
+
getLogsByTag(tag) {
|
|
973
|
+
try {
|
|
974
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
975
|
+
const ptr0 = passStringToWasm0(tag, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
976
|
+
const len0 = WASM_VECTOR_LEN;
|
|
977
|
+
wasm.cedarling_getLogsByTag(retptr, this.__wbg_ptr, ptr0, len0);
|
|
978
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
979
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
980
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
981
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
982
|
+
if (r3) {
|
|
983
|
+
throw takeObject(r2);
|
|
984
|
+
}
|
|
985
|
+
var v2 = getArrayJsValueFromWasm0(r0, r1);
|
|
986
|
+
wasm.__wbindgen_export5(r0, r1 * 4, 4);
|
|
987
|
+
return v2;
|
|
988
|
+
} finally {
|
|
989
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
990
|
+
}
|
|
991
|
+
}
|
|
992
|
+
/**
|
|
993
|
+
* Get statistics about the data store.
|
|
994
|
+
*
|
|
995
|
+
* # Arguments
|
|
996
|
+
*
|
|
997
|
+
* None.
|
|
998
|
+
*
|
|
999
|
+
* # Example
|
|
1000
|
+
*
|
|
1001
|
+
* ```javascript
|
|
1002
|
+
* const stats = cedarling.getStatsCtx();
|
|
1003
|
+
* console.log(`Entries: ${stats.entry_count}/${stats.max_entries || 'unlimited'}`);
|
|
1004
|
+
* console.log(`Capacity: ${stats.capacity_usage_percent.toFixed(2)}%`);
|
|
1005
|
+
* console.log(`Total size: ${stats.total_size_bytes} bytes`);
|
|
1006
|
+
* ```
|
|
1007
|
+
* @returns {DataStoreStats}
|
|
1008
|
+
*/
|
|
1009
|
+
getStatsCtx() {
|
|
1010
|
+
try {
|
|
1011
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1012
|
+
wasm.cedarling_getStatsCtx(retptr, this.__wbg_ptr);
|
|
1013
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1014
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1015
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1016
|
+
if (r2) {
|
|
1017
|
+
throw takeObject(r1);
|
|
1018
|
+
}
|
|
1019
|
+
return DataStoreStats.__wrap(r0);
|
|
1020
|
+
} finally {
|
|
1021
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1022
|
+
}
|
|
1023
|
+
}
|
|
1024
|
+
/**
|
|
1025
|
+
* Check whether a trusted issuer was loaded by `iss` claim.
|
|
1026
|
+
*
|
|
1027
|
+
* # Arguments
|
|
1028
|
+
*
|
|
1029
|
+
* * `iss_claim` - Issuer `iss` claim value to check.
|
|
1030
|
+
*
|
|
1031
|
+
* # Example
|
|
1032
|
+
*
|
|
1033
|
+
* ```javascript
|
|
1034
|
+
* const ok = cedarling.isTrustedIssuerLoadedByIss("https://issuer.example.org");
|
|
1035
|
+
* ```
|
|
1036
|
+
* @param {string} iss_claim
|
|
1037
|
+
* @returns {boolean}
|
|
1038
|
+
*/
|
|
1039
|
+
isTrustedIssuerLoadedByIss(iss_claim) {
|
|
1040
|
+
const ptr0 = passStringToWasm0(iss_claim, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1041
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1042
|
+
const ret = wasm.cedarling_isTrustedIssuerLoadedByIss(this.__wbg_ptr, ptr0, len0);
|
|
1043
|
+
return ret !== 0;
|
|
1044
|
+
}
|
|
1045
|
+
/**
|
|
1046
|
+
* Check whether a trusted issuer was loaded by issuer identifier.
|
|
1047
|
+
*
|
|
1048
|
+
* # Arguments
|
|
1049
|
+
*
|
|
1050
|
+
* * `issuer_id` - Trusted issuer identifier to check.
|
|
1051
|
+
*
|
|
1052
|
+
* # Example
|
|
1053
|
+
*
|
|
1054
|
+
* ```javascript
|
|
1055
|
+
* const ok = cedarling.isTrustedIssuerLoadedByName("issuer_id");
|
|
1056
|
+
* ```
|
|
1057
|
+
* @param {string} issuer_id
|
|
1058
|
+
* @returns {boolean}
|
|
1059
|
+
*/
|
|
1060
|
+
isTrustedIssuerLoadedByName(issuer_id) {
|
|
1061
|
+
const ptr0 = passStringToWasm0(issuer_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1062
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1063
|
+
const ret = wasm.cedarling_isTrustedIssuerLoadedByName(this.__wbg_ptr, ptr0, len0);
|
|
1064
|
+
return ret !== 0;
|
|
1065
|
+
}
|
|
1066
|
+
/**
|
|
1067
|
+
* List all entries with their metadata.
|
|
1068
|
+
* Returns an array of DataEntry objects.
|
|
1069
|
+
*
|
|
1070
|
+
* # Arguments
|
|
1071
|
+
*
|
|
1072
|
+
* None.
|
|
1073
|
+
*
|
|
1074
|
+
* # Example
|
|
1075
|
+
*
|
|
1076
|
+
* ```javascript
|
|
1077
|
+
* const entries = cedarling.listDataCtx();
|
|
1078
|
+
* entries.forEach(entry => {
|
|
1079
|
+
* console.log(`${entry.key}: ${entry.data_type} (accessed ${entry.access_count} times)`);
|
|
1080
|
+
* });
|
|
1081
|
+
* ```
|
|
1082
|
+
* @returns {Array<any>}
|
|
1083
|
+
*/
|
|
1084
|
+
listDataCtx() {
|
|
1085
|
+
try {
|
|
1086
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1087
|
+
wasm.cedarling_listDataCtx(retptr, this.__wbg_ptr);
|
|
1088
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1089
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1090
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1091
|
+
if (r2) {
|
|
1092
|
+
throw takeObject(r1);
|
|
1093
|
+
}
|
|
1094
|
+
return takeObject(r0);
|
|
1095
|
+
} finally {
|
|
1096
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1097
|
+
}
|
|
1098
|
+
}
|
|
1099
|
+
/**
|
|
1100
|
+
* Get trusted issuer identifiers loaded successfully.
|
|
1101
|
+
*
|
|
1102
|
+
* # Arguments
|
|
1103
|
+
*
|
|
1104
|
+
* None.
|
|
1105
|
+
*
|
|
1106
|
+
* # Example
|
|
1107
|
+
*
|
|
1108
|
+
* ```javascript
|
|
1109
|
+
* const ids = cedarling.loadedTrustedIssuerIds();
|
|
1110
|
+
* ```
|
|
1111
|
+
* @returns {Array<any>}
|
|
1112
|
+
*/
|
|
1113
|
+
loadedTrustedIssuerIds() {
|
|
1114
|
+
const ret = wasm.cedarling_loadedTrustedIssuerIds(this.__wbg_ptr);
|
|
1115
|
+
return takeObject(ret);
|
|
1116
|
+
}
|
|
1117
|
+
/**
|
|
1118
|
+
* Get the number of trusted issuers loaded successfully.
|
|
1119
|
+
*
|
|
1120
|
+
* # Arguments
|
|
1121
|
+
*
|
|
1122
|
+
* None.
|
|
1123
|
+
*
|
|
1124
|
+
* # Example
|
|
1125
|
+
*
|
|
1126
|
+
* ```javascript
|
|
1127
|
+
* const loadedCount = cedarling.loadedTrustedIssuersCount();
|
|
1128
|
+
* ```
|
|
1129
|
+
* @returns {number}
|
|
1130
|
+
*/
|
|
1131
|
+
loadedTrustedIssuersCount() {
|
|
1132
|
+
const ret = wasm.cedarling_loadedTrustedIssuersCount(this.__wbg_ptr);
|
|
1133
|
+
return ret >>> 0;
|
|
1134
|
+
}
|
|
1135
|
+
/**
|
|
1136
|
+
* Creates a new Cedarling application from a JavaScript `Map`.
|
|
1137
|
+
*
|
|
1138
|
+
* # Arguments
|
|
1139
|
+
*
|
|
1140
|
+
* * `config` - A `Map` of Cedarling bootstrap-property names and values.
|
|
1141
|
+
*
|
|
1142
|
+
* # Example
|
|
1143
|
+
*
|
|
1144
|
+
* ```javascript
|
|
1145
|
+
* await initWasm();
|
|
1146
|
+
* const cedarling = await Cedarling.newFromMap(new Map([
|
|
1147
|
+
* ["CEDARLING_APPLICATION_NAME", "task-api"],
|
|
1148
|
+
* ["CEDARLING_POLICY_STORE_URI", "https://example.com/policy-store.cjar"],
|
|
1149
|
+
* ["CEDARLING_LOG_TYPE", "memory"],
|
|
1150
|
+
* ["CEDARLING_LOG_TTL", 120],
|
|
1151
|
+
* ]));
|
|
1152
|
+
* ```
|
|
1153
|
+
* @param {Map<any, any>} config
|
|
1154
|
+
* @returns {Promise<Cedarling>}
|
|
1155
|
+
*/
|
|
1156
|
+
static newFromMap(config) {
|
|
1157
|
+
const ret = wasm.cedarling_newFromMap(addHeapObject(config));
|
|
1158
|
+
return takeObject(ret);
|
|
1159
|
+
}
|
|
1160
|
+
/**
|
|
1161
|
+
* Creates a Cedarling application from bootstrap properties.
|
|
1162
|
+
*
|
|
1163
|
+
* # Arguments
|
|
1164
|
+
*
|
|
1165
|
+
* * `config` - A plain object of Cedarling bootstrap-property names and values.
|
|
1166
|
+
*
|
|
1167
|
+
* # Example
|
|
1168
|
+
*
|
|
1169
|
+
* ```javascript
|
|
1170
|
+
* await initWasm();
|
|
1171
|
+
* const cedarling = await Cedarling.new({
|
|
1172
|
+
* CEDARLING_APPLICATION_NAME: "task-api",
|
|
1173
|
+
* CEDARLING_POLICY_STORE_URI: "https://example.com/policy-store.cjar",
|
|
1174
|
+
* CEDARLING_LOG_TYPE: "memory",
|
|
1175
|
+
* CEDARLING_LOG_TTL: 120,
|
|
1176
|
+
* });
|
|
1177
|
+
* ```
|
|
1178
|
+
* @param {object} config
|
|
1179
|
+
* @returns {Promise<Cedarling>}
|
|
1180
|
+
*/
|
|
1181
|
+
static new(config) {
|
|
1182
|
+
const ret = wasm.cedarling_new(addHeapObject(config));
|
|
1183
|
+
return takeObject(ret);
|
|
1184
|
+
}
|
|
1185
|
+
/**
|
|
1186
|
+
* Get the ID of the currently published policy store, if it carries one.
|
|
1187
|
+
*
|
|
1188
|
+
* `undefined` means the store carries no ID. The value is an opaque,
|
|
1189
|
+
* source-dependent string; it may change after a background refresh.
|
|
1190
|
+
*
|
|
1191
|
+
* # Arguments
|
|
1192
|
+
*
|
|
1193
|
+
* None.
|
|
1194
|
+
*
|
|
1195
|
+
* # Example
|
|
1196
|
+
*
|
|
1197
|
+
* ```javascript
|
|
1198
|
+
* const id = cedarling.policyStoreId();
|
|
1199
|
+
* ```
|
|
1200
|
+
* @returns {string | undefined}
|
|
1201
|
+
*/
|
|
1202
|
+
policyStoreId() {
|
|
1203
|
+
try {
|
|
1204
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1205
|
+
wasm.cedarling_policyStoreId(retptr, this.__wbg_ptr);
|
|
1206
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1207
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1208
|
+
let v1;
|
|
1209
|
+
if (r0 !== 0) {
|
|
1210
|
+
v1 = getStringFromWasm0(r0, r1);
|
|
1211
|
+
wasm.__wbindgen_export5(r0, r1 * 1, 1);
|
|
1212
|
+
}
|
|
1213
|
+
return v1;
|
|
1214
|
+
} finally {
|
|
1215
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1216
|
+
}
|
|
1217
|
+
}
|
|
1218
|
+
/**
|
|
1219
|
+
* Returns all retained memory logs and removes them from storage.
|
|
1220
|
+
* Other log configurations return an empty array.
|
|
1221
|
+
*
|
|
1222
|
+
* # Arguments
|
|
1223
|
+
*
|
|
1224
|
+
* None.
|
|
1225
|
+
*
|
|
1226
|
+
* # Example
|
|
1227
|
+
*
|
|
1228
|
+
* ```javascript
|
|
1229
|
+
* const logs = cedarling.popLogs();
|
|
1230
|
+
* ```
|
|
1231
|
+
* @returns {Array<any>}
|
|
1232
|
+
*/
|
|
1233
|
+
popLogs() {
|
|
1234
|
+
try {
|
|
1235
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1236
|
+
wasm.cedarling_popLogs(retptr, this.__wbg_ptr);
|
|
1237
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1238
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1239
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1240
|
+
if (r2) {
|
|
1241
|
+
throw takeObject(r1);
|
|
1242
|
+
}
|
|
1243
|
+
return takeObject(r0);
|
|
1244
|
+
} finally {
|
|
1245
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1246
|
+
}
|
|
1247
|
+
}
|
|
1248
|
+
/**
|
|
1249
|
+
* Push a value into the data store with an optional TTL.
|
|
1250
|
+
* If the key already exists, the value will be replaced.
|
|
1251
|
+
* If TTL is not provided, the default TTL from configuration is used.
|
|
1252
|
+
*
|
|
1253
|
+
* # Arguments
|
|
1254
|
+
*
|
|
1255
|
+
* * `key` - A string key for the data entry (must not be empty)
|
|
1256
|
+
* * `value` - The value to store (any JSON-serializable JavaScript value: object, array, string, number, boolean)
|
|
1257
|
+
* * `ttl_secs` - Optional TTL in seconds (undefined/null uses default from config)
|
|
1258
|
+
*
|
|
1259
|
+
* # Example
|
|
1260
|
+
*
|
|
1261
|
+
* ```javascript
|
|
1262
|
+
* cedarling.pushDataCtx("user:123", { name: "John", age: 30 }, 3600);
|
|
1263
|
+
* cedarling.pushDataCtx("config", { setting: "value" }); // Uses default TTL
|
|
1264
|
+
* ```
|
|
1265
|
+
* @param {string} key
|
|
1266
|
+
* @param {any} value
|
|
1267
|
+
* @param {bigint | null} [ttl_secs]
|
|
1268
|
+
*/
|
|
1269
|
+
pushDataCtx(key, value, ttl_secs) {
|
|
1270
|
+
try {
|
|
1271
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1272
|
+
const ptr0 = passStringToWasm0(key, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1273
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1274
|
+
wasm.cedarling_pushDataCtx(retptr, this.__wbg_ptr, ptr0, len0, addHeapObject(value), !isLikeNone(ttl_secs), isLikeNone(ttl_secs) ? BigInt(0) : ttl_secs);
|
|
1275
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1276
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1277
|
+
if (r1) {
|
|
1278
|
+
throw takeObject(r0);
|
|
1279
|
+
}
|
|
1280
|
+
} finally {
|
|
1281
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1282
|
+
}
|
|
1283
|
+
}
|
|
1284
|
+
/**
|
|
1285
|
+
* Remove a value from the data store by key.
|
|
1286
|
+
* Returns true if the key existed and was removed, false otherwise.
|
|
1287
|
+
*
|
|
1288
|
+
* # Arguments
|
|
1289
|
+
*
|
|
1290
|
+
* * `key` - A string key for the data entry to remove
|
|
1291
|
+
*
|
|
1292
|
+
* # Example
|
|
1293
|
+
*
|
|
1294
|
+
* ```javascript
|
|
1295
|
+
* const removed = cedarling.removeDataCtx("user:123");
|
|
1296
|
+
* if (removed) {
|
|
1297
|
+
* console.log("Entry was successfully removed");
|
|
1298
|
+
* }
|
|
1299
|
+
* ```
|
|
1300
|
+
* @param {string} key
|
|
1301
|
+
* @returns {boolean}
|
|
1302
|
+
*/
|
|
1303
|
+
removeDataCtx(key) {
|
|
1304
|
+
try {
|
|
1305
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1306
|
+
const ptr0 = passStringToWasm0(key, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1307
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1308
|
+
wasm.cedarling_removeDataCtx(retptr, this.__wbg_ptr, ptr0, len0);
|
|
1309
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1310
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1311
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1312
|
+
if (r2) {
|
|
1313
|
+
throw takeObject(r1);
|
|
1314
|
+
}
|
|
1315
|
+
return r0 !== 0;
|
|
1316
|
+
} finally {
|
|
1317
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1318
|
+
}
|
|
1319
|
+
}
|
|
1320
|
+
/**
|
|
1321
|
+
* Closes Lock Server connections and pushes all available logs.
|
|
1322
|
+
*
|
|
1323
|
+
* # Arguments
|
|
1324
|
+
*
|
|
1325
|
+
* None.
|
|
1326
|
+
*
|
|
1327
|
+
* # Example
|
|
1328
|
+
*
|
|
1329
|
+
* ```javascript
|
|
1330
|
+
* await cedarling.shutDown();
|
|
1331
|
+
* ```
|
|
1332
|
+
* @returns {Promise<void>}
|
|
1333
|
+
*/
|
|
1334
|
+
shutDown() {
|
|
1335
|
+
const ret = wasm.cedarling_shutDown(this.__wbg_ptr);
|
|
1336
|
+
return takeObject(ret);
|
|
1337
|
+
}
|
|
1338
|
+
/**
|
|
1339
|
+
* Get the total number of trusted issuer entries discovered.
|
|
1340
|
+
*
|
|
1341
|
+
* # Arguments
|
|
1342
|
+
*
|
|
1343
|
+
* None.
|
|
1344
|
+
*
|
|
1345
|
+
* # Example
|
|
1346
|
+
*
|
|
1347
|
+
* ```javascript
|
|
1348
|
+
* const total = cedarling.totalIssuers();
|
|
1349
|
+
* ```
|
|
1350
|
+
* @returns {number}
|
|
1351
|
+
*/
|
|
1352
|
+
totalIssuers() {
|
|
1353
|
+
const ret = wasm.cedarling_totalIssuers(this.__wbg_ptr);
|
|
1354
|
+
return ret >>> 0;
|
|
1355
|
+
}
|
|
1356
|
+
};
|
|
1357
|
+
if (Symbol.dispose) Cedarling.prototype[Symbol.dispose] = Cedarling.prototype.free;
|
|
1358
|
+
var DataEntry = class _DataEntry {
|
|
1359
|
+
static __wrap(ptr) {
|
|
1360
|
+
const obj = Object.create(_DataEntry.prototype);
|
|
1361
|
+
obj.__wbg_ptr = ptr;
|
|
1362
|
+
DataEntryFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
1363
|
+
return obj;
|
|
1364
|
+
}
|
|
1365
|
+
__destroy_into_raw() {
|
|
1366
|
+
const ptr = this.__wbg_ptr;
|
|
1367
|
+
this.__wbg_ptr = 0;
|
|
1368
|
+
DataEntryFinalization.unregister(this);
|
|
1369
|
+
return ptr;
|
|
1370
|
+
}
|
|
1371
|
+
free() {
|
|
1372
|
+
const ptr = this.__destroy_into_raw();
|
|
1373
|
+
wasm.__wbg_dataentry_free(ptr, 0);
|
|
1374
|
+
}
|
|
1375
|
+
/**
|
|
1376
|
+
* Convert `DataEntry` to json string value
|
|
1377
|
+
* @returns {string}
|
|
1378
|
+
*/
|
|
1379
|
+
jsonString() {
|
|
1380
|
+
let deferred1_0;
|
|
1381
|
+
let deferred1_1;
|
|
1382
|
+
try {
|
|
1383
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1384
|
+
wasm.dataentry_jsonString(retptr, this.__wbg_ptr);
|
|
1385
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1386
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1387
|
+
deferred1_0 = r0;
|
|
1388
|
+
deferred1_1 = r1;
|
|
1389
|
+
return getStringFromWasm0(r0, r1);
|
|
1390
|
+
} finally {
|
|
1391
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1392
|
+
wasm.__wbindgen_export5(deferred1_0, deferred1_1, 1);
|
|
1393
|
+
}
|
|
1394
|
+
}
|
|
1395
|
+
/**
|
|
1396
|
+
* Get the value stored in this entry as a JavaScript object
|
|
1397
|
+
* @returns {any}
|
|
1398
|
+
*/
|
|
1399
|
+
value() {
|
|
1400
|
+
try {
|
|
1401
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1402
|
+
wasm.dataentry_value(retptr, this.__wbg_ptr);
|
|
1403
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1404
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1405
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1406
|
+
if (r2) {
|
|
1407
|
+
throw takeObject(r1);
|
|
1408
|
+
}
|
|
1409
|
+
return takeObject(r0);
|
|
1410
|
+
} finally {
|
|
1411
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1412
|
+
}
|
|
1413
|
+
}
|
|
1414
|
+
/**
|
|
1415
|
+
* Number of times this entry has been accessed
|
|
1416
|
+
* @returns {bigint}
|
|
1417
|
+
*/
|
|
1418
|
+
get access_count() {
|
|
1419
|
+
const ret = wasm.__wbg_get_dataentry_access_count(this.__wbg_ptr);
|
|
1420
|
+
return BigInt.asUintN(64, ret);
|
|
1421
|
+
}
|
|
1422
|
+
/**
|
|
1423
|
+
* Timestamp when this entry was created (RFC 3339 format)
|
|
1424
|
+
* @returns {string}
|
|
1425
|
+
*/
|
|
1426
|
+
get created_at() {
|
|
1427
|
+
let deferred1_0;
|
|
1428
|
+
let deferred1_1;
|
|
1429
|
+
try {
|
|
1430
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1431
|
+
wasm.__wbg_get_dataentry_created_at(retptr, this.__wbg_ptr);
|
|
1432
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1433
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1434
|
+
deferred1_0 = r0;
|
|
1435
|
+
deferred1_1 = r1;
|
|
1436
|
+
return getStringFromWasm0(r0, r1);
|
|
1437
|
+
} finally {
|
|
1438
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1439
|
+
wasm.__wbindgen_export5(deferred1_0, deferred1_1, 1);
|
|
1440
|
+
}
|
|
1441
|
+
}
|
|
1442
|
+
/**
|
|
1443
|
+
* The inferred Cedar type of the value
|
|
1444
|
+
* @returns {string}
|
|
1445
|
+
*/
|
|
1446
|
+
get data_type() {
|
|
1447
|
+
let deferred1_0;
|
|
1448
|
+
let deferred1_1;
|
|
1449
|
+
try {
|
|
1450
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1451
|
+
wasm.__wbg_get_dataentry_data_type(retptr, this.__wbg_ptr);
|
|
1452
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1453
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1454
|
+
deferred1_0 = r0;
|
|
1455
|
+
deferred1_1 = r1;
|
|
1456
|
+
return getStringFromWasm0(r0, r1);
|
|
1457
|
+
} finally {
|
|
1458
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1459
|
+
wasm.__wbindgen_export5(deferred1_0, deferred1_1, 1);
|
|
1460
|
+
}
|
|
1461
|
+
}
|
|
1462
|
+
/**
|
|
1463
|
+
* Timestamp when this entry expires (RFC 3339 format). The getter returns undefined if no TTL.
|
|
1464
|
+
* @returns {string | undefined}
|
|
1465
|
+
*/
|
|
1466
|
+
get expires_at() {
|
|
1467
|
+
try {
|
|
1468
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1469
|
+
wasm.__wbg_get_dataentry_expires_at(retptr, this.__wbg_ptr);
|
|
1470
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1471
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1472
|
+
let v1;
|
|
1473
|
+
if (r0 !== 0) {
|
|
1474
|
+
v1 = getStringFromWasm0(r0, r1);
|
|
1475
|
+
wasm.__wbindgen_export5(r0, r1 * 1, 1);
|
|
1476
|
+
}
|
|
1477
|
+
return v1;
|
|
1478
|
+
} finally {
|
|
1479
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1480
|
+
}
|
|
1481
|
+
}
|
|
1482
|
+
/**
|
|
1483
|
+
* The key for this entry
|
|
1484
|
+
* @returns {string}
|
|
1485
|
+
*/
|
|
1486
|
+
get key() {
|
|
1487
|
+
let deferred1_0;
|
|
1488
|
+
let deferred1_1;
|
|
1489
|
+
try {
|
|
1490
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1491
|
+
wasm.__wbg_get_dataentry_key(retptr, this.__wbg_ptr);
|
|
1492
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1493
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1494
|
+
deferred1_0 = r0;
|
|
1495
|
+
deferred1_1 = r1;
|
|
1496
|
+
return getStringFromWasm0(r0, r1);
|
|
1497
|
+
} finally {
|
|
1498
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1499
|
+
wasm.__wbindgen_export5(deferred1_0, deferred1_1, 1);
|
|
1500
|
+
}
|
|
1501
|
+
}
|
|
1502
|
+
/**
|
|
1503
|
+
* Number of times this entry has been accessed
|
|
1504
|
+
* @param {bigint} arg0
|
|
1505
|
+
*/
|
|
1506
|
+
set access_count(arg0) {
|
|
1507
|
+
wasm.__wbg_set_dataentry_access_count(this.__wbg_ptr, arg0);
|
|
1508
|
+
}
|
|
1509
|
+
/**
|
|
1510
|
+
* Timestamp when this entry was created (RFC 3339 format)
|
|
1511
|
+
* @param {string} arg0
|
|
1512
|
+
*/
|
|
1513
|
+
set created_at(arg0) {
|
|
1514
|
+
const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1515
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1516
|
+
wasm.__wbg_set_dataentry_created_at(this.__wbg_ptr, ptr0, len0);
|
|
1517
|
+
}
|
|
1518
|
+
/**
|
|
1519
|
+
* The inferred Cedar type of the value
|
|
1520
|
+
* @param {string} arg0
|
|
1521
|
+
*/
|
|
1522
|
+
set data_type(arg0) {
|
|
1523
|
+
const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1524
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1525
|
+
wasm.__wbg_set_dataentry_data_type(this.__wbg_ptr, ptr0, len0);
|
|
1526
|
+
}
|
|
1527
|
+
/**
|
|
1528
|
+
* Timestamp when this entry expires (RFC 3339 format). The getter returns undefined if no TTL.
|
|
1529
|
+
* @param {string | null} [arg0]
|
|
1530
|
+
*/
|
|
1531
|
+
set expires_at(arg0) {
|
|
1532
|
+
var ptr0 = isLikeNone(arg0) ? 0 : passStringToWasm0(arg0, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1533
|
+
var len0 = WASM_VECTOR_LEN;
|
|
1534
|
+
wasm.__wbg_set_dataentry_expires_at(this.__wbg_ptr, ptr0, len0);
|
|
1535
|
+
}
|
|
1536
|
+
/**
|
|
1537
|
+
* The key for this entry
|
|
1538
|
+
* @param {string} arg0
|
|
1539
|
+
*/
|
|
1540
|
+
set key(arg0) {
|
|
1541
|
+
const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1542
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1543
|
+
wasm.__wbg_set_dataentry_key(this.__wbg_ptr, ptr0, len0);
|
|
1544
|
+
}
|
|
1545
|
+
};
|
|
1546
|
+
if (Symbol.dispose) DataEntry.prototype[Symbol.dispose] = DataEntry.prototype.free;
|
|
1547
|
+
var DataStoreStats = class _DataStoreStats {
|
|
1548
|
+
static __wrap(ptr) {
|
|
1549
|
+
const obj = Object.create(_DataStoreStats.prototype);
|
|
1550
|
+
obj.__wbg_ptr = ptr;
|
|
1551
|
+
DataStoreStatsFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
1552
|
+
return obj;
|
|
1553
|
+
}
|
|
1554
|
+
__destroy_into_raw() {
|
|
1555
|
+
const ptr = this.__wbg_ptr;
|
|
1556
|
+
this.__wbg_ptr = 0;
|
|
1557
|
+
DataStoreStatsFinalization.unregister(this);
|
|
1558
|
+
return ptr;
|
|
1559
|
+
}
|
|
1560
|
+
free() {
|
|
1561
|
+
const ptr = this.__destroy_into_raw();
|
|
1562
|
+
wasm.__wbg_datastorestats_free(ptr, 0);
|
|
1563
|
+
}
|
|
1564
|
+
/**
|
|
1565
|
+
* Convert `DataStoreStats` to json string value
|
|
1566
|
+
* @returns {string}
|
|
1567
|
+
*/
|
|
1568
|
+
jsonString() {
|
|
1569
|
+
let deferred1_0;
|
|
1570
|
+
let deferred1_1;
|
|
1571
|
+
try {
|
|
1572
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1573
|
+
wasm.datastorestats_jsonString(retptr, this.__wbg_ptr);
|
|
1574
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1575
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1576
|
+
deferred1_0 = r0;
|
|
1577
|
+
deferred1_1 = r1;
|
|
1578
|
+
return getStringFromWasm0(r0, r1);
|
|
1579
|
+
} finally {
|
|
1580
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1581
|
+
wasm.__wbindgen_export5(deferred1_0, deferred1_1, 1);
|
|
1582
|
+
}
|
|
1583
|
+
}
|
|
1584
|
+
/**
|
|
1585
|
+
* Average size per entry in bytes (0 if no entries)
|
|
1586
|
+
* @returns {number}
|
|
1587
|
+
*/
|
|
1588
|
+
get avg_entry_size_bytes() {
|
|
1589
|
+
const ret = wasm.__wbg_get_datastorestats_avg_entry_size_bytes(this.__wbg_ptr);
|
|
1590
|
+
return ret >>> 0;
|
|
1591
|
+
}
|
|
1592
|
+
/**
|
|
1593
|
+
* Percentage of capacity used (0.0-100.0, based on entry count)
|
|
1594
|
+
* @returns {number}
|
|
1595
|
+
*/
|
|
1596
|
+
get capacity_usage_percent() {
|
|
1597
|
+
const ret = wasm.__wbg_get_datastorestats_capacity_usage_percent(this.__wbg_ptr);
|
|
1598
|
+
return ret;
|
|
1599
|
+
}
|
|
1600
|
+
/**
|
|
1601
|
+
* Number of entries currently stored
|
|
1602
|
+
* @returns {number}
|
|
1603
|
+
*/
|
|
1604
|
+
get entry_count() {
|
|
1605
|
+
const ret = wasm.__wbg_get_datastorestats_entry_count(this.__wbg_ptr);
|
|
1606
|
+
return ret >>> 0;
|
|
1607
|
+
}
|
|
1608
|
+
/**
|
|
1609
|
+
* Maximum number of entries allowed (0 = unlimited)
|
|
1610
|
+
* @returns {number}
|
|
1611
|
+
*/
|
|
1612
|
+
get max_entries() {
|
|
1613
|
+
const ret = wasm.__wbg_get_datastorestats_max_entries(this.__wbg_ptr);
|
|
1614
|
+
return ret >>> 0;
|
|
1615
|
+
}
|
|
1616
|
+
/**
|
|
1617
|
+
* Maximum size per entry in bytes (0 = unlimited)
|
|
1618
|
+
* @returns {number}
|
|
1619
|
+
*/
|
|
1620
|
+
get max_entry_size() {
|
|
1621
|
+
const ret = wasm.__wbg_get_datastorestats_max_entry_size(this.__wbg_ptr);
|
|
1622
|
+
return ret >>> 0;
|
|
1623
|
+
}
|
|
1624
|
+
/**
|
|
1625
|
+
* Memory usage threshold percentage (from config)
|
|
1626
|
+
* @returns {number}
|
|
1627
|
+
*/
|
|
1628
|
+
get memory_alert_threshold() {
|
|
1629
|
+
const ret = wasm.__wbg_get_datastorestats_memory_alert_threshold(this.__wbg_ptr);
|
|
1630
|
+
return ret;
|
|
1631
|
+
}
|
|
1632
|
+
/**
|
|
1633
|
+
* Whether memory usage exceeds the alert threshold
|
|
1634
|
+
* @returns {boolean}
|
|
1635
|
+
*/
|
|
1636
|
+
get memory_alert_triggered() {
|
|
1637
|
+
const ret = wasm.__wbg_get_datastorestats_memory_alert_triggered(this.__wbg_ptr);
|
|
1638
|
+
return ret !== 0;
|
|
1639
|
+
}
|
|
1640
|
+
/**
|
|
1641
|
+
* Whether metrics tracking is enabled
|
|
1642
|
+
* @returns {boolean}
|
|
1643
|
+
*/
|
|
1644
|
+
get metrics_enabled() {
|
|
1645
|
+
const ret = wasm.__wbg_get_datastorestats_metrics_enabled(this.__wbg_ptr);
|
|
1646
|
+
return ret !== 0;
|
|
1647
|
+
}
|
|
1648
|
+
/**
|
|
1649
|
+
* Total size of all entries in bytes (approximate, based on JSON serialization)
|
|
1650
|
+
* @returns {number}
|
|
1651
|
+
*/
|
|
1652
|
+
get total_size_bytes() {
|
|
1653
|
+
const ret = wasm.__wbg_get_datastorestats_total_size_bytes(this.__wbg_ptr);
|
|
1654
|
+
return ret >>> 0;
|
|
1655
|
+
}
|
|
1656
|
+
/**
|
|
1657
|
+
* Average size per entry in bytes (0 if no entries)
|
|
1658
|
+
* @param {number} arg0
|
|
1659
|
+
*/
|
|
1660
|
+
set avg_entry_size_bytes(arg0) {
|
|
1661
|
+
wasm.__wbg_set_datastorestats_avg_entry_size_bytes(this.__wbg_ptr, arg0);
|
|
1662
|
+
}
|
|
1663
|
+
/**
|
|
1664
|
+
* Percentage of capacity used (0.0-100.0, based on entry count)
|
|
1665
|
+
* @param {number} arg0
|
|
1666
|
+
*/
|
|
1667
|
+
set capacity_usage_percent(arg0) {
|
|
1668
|
+
wasm.__wbg_set_datastorestats_capacity_usage_percent(this.__wbg_ptr, arg0);
|
|
1669
|
+
}
|
|
1670
|
+
/**
|
|
1671
|
+
* Number of entries currently stored
|
|
1672
|
+
* @param {number} arg0
|
|
1673
|
+
*/
|
|
1674
|
+
set entry_count(arg0) {
|
|
1675
|
+
wasm.__wbg_set_datastorestats_entry_count(this.__wbg_ptr, arg0);
|
|
1676
|
+
}
|
|
1677
|
+
/**
|
|
1678
|
+
* Maximum number of entries allowed (0 = unlimited)
|
|
1679
|
+
* @param {number} arg0
|
|
1680
|
+
*/
|
|
1681
|
+
set max_entries(arg0) {
|
|
1682
|
+
wasm.__wbg_set_datastorestats_max_entries(this.__wbg_ptr, arg0);
|
|
1683
|
+
}
|
|
1684
|
+
/**
|
|
1685
|
+
* Maximum size per entry in bytes (0 = unlimited)
|
|
1686
|
+
* @param {number} arg0
|
|
1687
|
+
*/
|
|
1688
|
+
set max_entry_size(arg0) {
|
|
1689
|
+
wasm.__wbg_set_datastorestats_max_entry_size(this.__wbg_ptr, arg0);
|
|
1690
|
+
}
|
|
1691
|
+
/**
|
|
1692
|
+
* Memory usage threshold percentage (from config)
|
|
1693
|
+
* @param {number} arg0
|
|
1694
|
+
*/
|
|
1695
|
+
set memory_alert_threshold(arg0) {
|
|
1696
|
+
wasm.__wbg_set_datastorestats_memory_alert_threshold(this.__wbg_ptr, arg0);
|
|
1697
|
+
}
|
|
1698
|
+
/**
|
|
1699
|
+
* Whether memory usage exceeds the alert threshold
|
|
1700
|
+
* @param {boolean} arg0
|
|
1701
|
+
*/
|
|
1702
|
+
set memory_alert_triggered(arg0) {
|
|
1703
|
+
wasm.__wbg_set_datastorestats_memory_alert_triggered(this.__wbg_ptr, arg0);
|
|
1704
|
+
}
|
|
1705
|
+
/**
|
|
1706
|
+
* Whether metrics tracking is enabled
|
|
1707
|
+
* @param {boolean} arg0
|
|
1708
|
+
*/
|
|
1709
|
+
set metrics_enabled(arg0) {
|
|
1710
|
+
wasm.__wbg_set_datastorestats_metrics_enabled(this.__wbg_ptr, arg0);
|
|
1711
|
+
}
|
|
1712
|
+
/**
|
|
1713
|
+
* Total size of all entries in bytes (approximate, based on JSON serialization)
|
|
1714
|
+
* @param {number} arg0
|
|
1715
|
+
*/
|
|
1716
|
+
set total_size_bytes(arg0) {
|
|
1717
|
+
wasm.__wbg_set_datastorestats_total_size_bytes(this.__wbg_ptr, arg0);
|
|
1718
|
+
}
|
|
1719
|
+
};
|
|
1720
|
+
if (Symbol.dispose) DataStoreStats.prototype[Symbol.dispose] = DataStoreStats.prototype.free;
|
|
1721
|
+
var Diagnostics = class _Diagnostics {
|
|
1722
|
+
static __wrap(ptr) {
|
|
1723
|
+
const obj = Object.create(_Diagnostics.prototype);
|
|
1724
|
+
obj.__wbg_ptr = ptr;
|
|
1725
|
+
DiagnosticsFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
1726
|
+
return obj;
|
|
1727
|
+
}
|
|
1728
|
+
__destroy_into_raw() {
|
|
1729
|
+
const ptr = this.__wbg_ptr;
|
|
1730
|
+
this.__wbg_ptr = 0;
|
|
1731
|
+
DiagnosticsFinalization.unregister(this);
|
|
1732
|
+
return ptr;
|
|
1733
|
+
}
|
|
1734
|
+
free() {
|
|
1735
|
+
const ptr = this.__destroy_into_raw();
|
|
1736
|
+
wasm.__wbg_diagnostics_free(ptr, 0);
|
|
1737
|
+
}
|
|
1738
|
+
/**
|
|
1739
|
+
* Errors that occurred during authorization. The errors should be
|
|
1740
|
+
* treated as unordered, since policies may be evaluated in any order.
|
|
1741
|
+
* @returns {PolicyEvaluationError[]}
|
|
1742
|
+
*/
|
|
1743
|
+
get errors() {
|
|
1744
|
+
try {
|
|
1745
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1746
|
+
wasm.diagnostics_errors(retptr, this.__wbg_ptr);
|
|
1747
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1748
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1749
|
+
var v1 = getArrayJsValueFromWasm0(r0, r1);
|
|
1750
|
+
wasm.__wbindgen_export5(r0, r1 * 4, 4);
|
|
1751
|
+
return v1;
|
|
1752
|
+
} finally {
|
|
1753
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1754
|
+
}
|
|
1755
|
+
}
|
|
1756
|
+
/**
|
|
1757
|
+
* `PolicyId`s of the policies that contributed to the decision.
|
|
1758
|
+
* If no policies applied to the request, this set will be empty.
|
|
1759
|
+
*
|
|
1760
|
+
* The ids should be treated as unordered,
|
|
1761
|
+
* @returns {string[]}
|
|
1762
|
+
*/
|
|
1763
|
+
get reason() {
|
|
1764
|
+
try {
|
|
1765
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1766
|
+
wasm.diagnostics_reason(retptr, this.__wbg_ptr);
|
|
1767
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1768
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1769
|
+
var v1 = getArrayJsValueFromWasm0(r0, r1);
|
|
1770
|
+
wasm.__wbindgen_export5(r0, r1 * 4, 4);
|
|
1771
|
+
return v1;
|
|
1772
|
+
} finally {
|
|
1773
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1774
|
+
}
|
|
1775
|
+
}
|
|
1776
|
+
};
|
|
1777
|
+
if (Symbol.dispose) Diagnostics.prototype[Symbol.dispose] = Diagnostics.prototype.free;
|
|
1778
|
+
var IntoUnderlyingByteSource = class {
|
|
1779
|
+
__destroy_into_raw() {
|
|
1780
|
+
const ptr = this.__wbg_ptr;
|
|
1781
|
+
this.__wbg_ptr = 0;
|
|
1782
|
+
IntoUnderlyingByteSourceFinalization.unregister(this);
|
|
1783
|
+
return ptr;
|
|
1784
|
+
}
|
|
1785
|
+
free() {
|
|
1786
|
+
const ptr = this.__destroy_into_raw();
|
|
1787
|
+
wasm.__wbg_intounderlyingbytesource_free(ptr, 0);
|
|
1788
|
+
}
|
|
1789
|
+
/**
|
|
1790
|
+
* @returns {number}
|
|
1791
|
+
*/
|
|
1792
|
+
get autoAllocateChunkSize() {
|
|
1793
|
+
const ret = wasm.intounderlyingbytesource_autoAllocateChunkSize(this.__wbg_ptr);
|
|
1794
|
+
return ret >>> 0;
|
|
1795
|
+
}
|
|
1796
|
+
cancel() {
|
|
1797
|
+
const ptr = this.__destroy_into_raw();
|
|
1798
|
+
wasm.intounderlyingbytesource_cancel(ptr);
|
|
1799
|
+
}
|
|
1800
|
+
/**
|
|
1801
|
+
* @param {ReadableByteStreamController} controller
|
|
1802
|
+
* @returns {Promise<any>}
|
|
1803
|
+
*/
|
|
1804
|
+
pull(controller) {
|
|
1805
|
+
const ret = wasm.intounderlyingbytesource_pull(this.__wbg_ptr, addHeapObject(controller));
|
|
1806
|
+
return takeObject(ret);
|
|
1807
|
+
}
|
|
1808
|
+
/**
|
|
1809
|
+
* @param {ReadableByteStreamController} controller
|
|
1810
|
+
*/
|
|
1811
|
+
start(controller) {
|
|
1812
|
+
wasm.intounderlyingbytesource_start(this.__wbg_ptr, addHeapObject(controller));
|
|
1813
|
+
}
|
|
1814
|
+
/**
|
|
1815
|
+
* @returns {ReadableStreamType}
|
|
1816
|
+
*/
|
|
1817
|
+
get type() {
|
|
1818
|
+
const ret = wasm.intounderlyingbytesource_type(this.__wbg_ptr);
|
|
1819
|
+
return __wbindgen_enum_ReadableStreamType[ret];
|
|
1820
|
+
}
|
|
1821
|
+
};
|
|
1822
|
+
if (Symbol.dispose) IntoUnderlyingByteSource.prototype[Symbol.dispose] = IntoUnderlyingByteSource.prototype.free;
|
|
1823
|
+
var IntoUnderlyingSink = class {
|
|
1824
|
+
__destroy_into_raw() {
|
|
1825
|
+
const ptr = this.__wbg_ptr;
|
|
1826
|
+
this.__wbg_ptr = 0;
|
|
1827
|
+
IntoUnderlyingSinkFinalization.unregister(this);
|
|
1828
|
+
return ptr;
|
|
1829
|
+
}
|
|
1830
|
+
free() {
|
|
1831
|
+
const ptr = this.__destroy_into_raw();
|
|
1832
|
+
wasm.__wbg_intounderlyingsink_free(ptr, 0);
|
|
1833
|
+
}
|
|
1834
|
+
/**
|
|
1835
|
+
* @param {any} reason
|
|
1836
|
+
* @returns {Promise<any>}
|
|
1837
|
+
*/
|
|
1838
|
+
abort(reason) {
|
|
1839
|
+
const ptr = this.__destroy_into_raw();
|
|
1840
|
+
const ret = wasm.intounderlyingsink_abort(ptr, addHeapObject(reason));
|
|
1841
|
+
return takeObject(ret);
|
|
1842
|
+
}
|
|
1843
|
+
/**
|
|
1844
|
+
* @returns {Promise<any>}
|
|
1845
|
+
*/
|
|
1846
|
+
close() {
|
|
1847
|
+
const ptr = this.__destroy_into_raw();
|
|
1848
|
+
const ret = wasm.intounderlyingsink_close(ptr);
|
|
1849
|
+
return takeObject(ret);
|
|
1850
|
+
}
|
|
1851
|
+
/**
|
|
1852
|
+
* @param {any} chunk
|
|
1853
|
+
* @returns {Promise<any>}
|
|
1854
|
+
*/
|
|
1855
|
+
write(chunk) {
|
|
1856
|
+
const ret = wasm.intounderlyingsink_write(this.__wbg_ptr, addHeapObject(chunk));
|
|
1857
|
+
return takeObject(ret);
|
|
1858
|
+
}
|
|
1859
|
+
};
|
|
1860
|
+
if (Symbol.dispose) IntoUnderlyingSink.prototype[Symbol.dispose] = IntoUnderlyingSink.prototype.free;
|
|
1861
|
+
var IntoUnderlyingSource = class {
|
|
1862
|
+
__destroy_into_raw() {
|
|
1863
|
+
const ptr = this.__wbg_ptr;
|
|
1864
|
+
this.__wbg_ptr = 0;
|
|
1865
|
+
IntoUnderlyingSourceFinalization.unregister(this);
|
|
1866
|
+
return ptr;
|
|
1867
|
+
}
|
|
1868
|
+
free() {
|
|
1869
|
+
const ptr = this.__destroy_into_raw();
|
|
1870
|
+
wasm.__wbg_intounderlyingsource_free(ptr, 0);
|
|
1871
|
+
}
|
|
1872
|
+
cancel() {
|
|
1873
|
+
const ptr = this.__destroy_into_raw();
|
|
1874
|
+
wasm.intounderlyingsource_cancel(ptr);
|
|
1875
|
+
}
|
|
1876
|
+
/**
|
|
1877
|
+
* @param {ReadableStreamDefaultController} controller
|
|
1878
|
+
* @returns {Promise<any>}
|
|
1879
|
+
*/
|
|
1880
|
+
pull(controller) {
|
|
1881
|
+
const ret = wasm.intounderlyingsource_pull(this.__wbg_ptr, addHeapObject(controller));
|
|
1882
|
+
return takeObject(ret);
|
|
1883
|
+
}
|
|
1884
|
+
};
|
|
1885
|
+
if (Symbol.dispose) IntoUnderlyingSource.prototype[Symbol.dispose] = IntoUnderlyingSource.prototype.free;
|
|
1886
|
+
var MetricsSnapshot = class _MetricsSnapshot {
|
|
1887
|
+
static __wrap(ptr) {
|
|
1888
|
+
const obj = Object.create(_MetricsSnapshot.prototype);
|
|
1889
|
+
obj.__wbg_ptr = ptr;
|
|
1890
|
+
MetricsSnapshotFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
1891
|
+
return obj;
|
|
1892
|
+
}
|
|
1893
|
+
__destroy_into_raw() {
|
|
1894
|
+
const ptr = this.__wbg_ptr;
|
|
1895
|
+
this.__wbg_ptr = 0;
|
|
1896
|
+
MetricsSnapshotFinalization.unregister(this);
|
|
1897
|
+
return ptr;
|
|
1898
|
+
}
|
|
1899
|
+
free() {
|
|
1900
|
+
const ptr = this.__destroy_into_raw();
|
|
1901
|
+
wasm.__wbg_metricssnapshot_free(ptr, 0);
|
|
1902
|
+
}
|
|
1903
|
+
/**
|
|
1904
|
+
* Classified error counters keyed by error metric key.
|
|
1905
|
+
* @returns {Map<any, any>}
|
|
1906
|
+
*/
|
|
1907
|
+
get error_counters() {
|
|
1908
|
+
const ret = wasm.__wbg_get_metricssnapshot_error_counters(this.__wbg_ptr);
|
|
1909
|
+
return takeObject(ret);
|
|
1910
|
+
}
|
|
1911
|
+
/**
|
|
1912
|
+
* Duration of the snapshot interval in fractional seconds.
|
|
1913
|
+
* Exposed as `Number` (not `BigInt`) so plain JS arithmetic works.
|
|
1914
|
+
* @returns {number}
|
|
1915
|
+
*/
|
|
1916
|
+
get interval_secs() {
|
|
1917
|
+
const ret = wasm.__wbg_get_metricssnapshot_interval_secs(this.__wbg_ptr);
|
|
1918
|
+
return ret;
|
|
1919
|
+
}
|
|
1920
|
+
/**
|
|
1921
|
+
* Operational counters and gauges (authorization, cache, JWT, data, lock).
|
|
1922
|
+
* @returns {Map<any, any>}
|
|
1923
|
+
*/
|
|
1924
|
+
get operational_stats() {
|
|
1925
|
+
const ret = wasm.__wbg_get_metricssnapshot_operational_stats(this.__wbg_ptr);
|
|
1926
|
+
return takeObject(ret);
|
|
1927
|
+
}
|
|
1928
|
+
/**
|
|
1929
|
+
* Per-policy evaluation counts (`policy_id`, `policy_id.allow`, `policy_id.deny`).
|
|
1930
|
+
* @returns {Map<any, any>}
|
|
1931
|
+
*/
|
|
1932
|
+
get policy_stats() {
|
|
1933
|
+
const ret = wasm.__wbg_get_metricssnapshot_policy_stats(this.__wbg_ptr);
|
|
1934
|
+
return takeObject(ret);
|
|
1935
|
+
}
|
|
1936
|
+
/**
|
|
1937
|
+
* Convert `MetricsSnapshot` to json string value.
|
|
1938
|
+
*
|
|
1939
|
+
* `policy_stats`, `error_counters` and `operational_stats` are converted
|
|
1940
|
+
* from `Map` to plain objects so `JSON.stringify` emits their entries.
|
|
1941
|
+
* @returns {string}
|
|
1942
|
+
*/
|
|
1943
|
+
jsonString() {
|
|
1944
|
+
let deferred2_0;
|
|
1945
|
+
let deferred2_1;
|
|
1946
|
+
try {
|
|
1947
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1948
|
+
wasm.metricssnapshot_jsonString(retptr, this.__wbg_ptr);
|
|
1949
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1950
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1951
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1952
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
1953
|
+
var ptr1 = r0;
|
|
1954
|
+
var len1 = r1;
|
|
1955
|
+
if (r3) {
|
|
1956
|
+
ptr1 = 0;
|
|
1957
|
+
len1 = 0;
|
|
1958
|
+
throw takeObject(r2);
|
|
1959
|
+
}
|
|
1960
|
+
deferred2_0 = ptr1;
|
|
1961
|
+
deferred2_1 = len1;
|
|
1962
|
+
return getStringFromWasm0(ptr1, len1);
|
|
1963
|
+
} finally {
|
|
1964
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1965
|
+
wasm.__wbindgen_export5(deferred2_0, deferred2_1, 1);
|
|
1966
|
+
}
|
|
1967
|
+
}
|
|
1968
|
+
/**
|
|
1969
|
+
* Classified error counters keyed by error metric key.
|
|
1970
|
+
* @param {Map<any, any>} arg0
|
|
1971
|
+
*/
|
|
1972
|
+
set error_counters(arg0) {
|
|
1973
|
+
wasm.__wbg_set_metricssnapshot_error_counters(this.__wbg_ptr, addHeapObject(arg0));
|
|
1974
|
+
}
|
|
1975
|
+
/**
|
|
1976
|
+
* Duration of the snapshot interval in fractional seconds.
|
|
1977
|
+
* Exposed as `Number` (not `BigInt`) so plain JS arithmetic works.
|
|
1978
|
+
* @param {number} arg0
|
|
1979
|
+
*/
|
|
1980
|
+
set interval_secs(arg0) {
|
|
1981
|
+
wasm.__wbg_set_metricssnapshot_interval_secs(this.__wbg_ptr, arg0);
|
|
1982
|
+
}
|
|
1983
|
+
/**
|
|
1984
|
+
* Operational counters and gauges (authorization, cache, JWT, data, lock).
|
|
1985
|
+
* @param {Map<any, any>} arg0
|
|
1986
|
+
*/
|
|
1987
|
+
set operational_stats(arg0) {
|
|
1988
|
+
wasm.__wbg_set_metricssnapshot_operational_stats(this.__wbg_ptr, addHeapObject(arg0));
|
|
1989
|
+
}
|
|
1990
|
+
/**
|
|
1991
|
+
* Per-policy evaluation counts (`policy_id`, `policy_id.allow`, `policy_id.deny`).
|
|
1992
|
+
* @param {Map<any, any>} arg0
|
|
1993
|
+
*/
|
|
1994
|
+
set policy_stats(arg0) {
|
|
1995
|
+
wasm.__wbg_set_metricssnapshot_policy_stats(this.__wbg_ptr, addHeapObject(arg0));
|
|
1996
|
+
}
|
|
1997
|
+
};
|
|
1998
|
+
if (Symbol.dispose) MetricsSnapshot.prototype[Symbol.dispose] = MetricsSnapshot.prototype.free;
|
|
1999
|
+
var MultiIssuerAuthorizeResult = class _MultiIssuerAuthorizeResult {
|
|
2000
|
+
static __wrap(ptr) {
|
|
2001
|
+
const obj = Object.create(_MultiIssuerAuthorizeResult.prototype);
|
|
2002
|
+
obj.__wbg_ptr = ptr;
|
|
2003
|
+
MultiIssuerAuthorizeResultFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
2004
|
+
return obj;
|
|
2005
|
+
}
|
|
2006
|
+
__destroy_into_raw() {
|
|
2007
|
+
const ptr = this.__wbg_ptr;
|
|
2008
|
+
this.__wbg_ptr = 0;
|
|
2009
|
+
MultiIssuerAuthorizeResultFinalization.unregister(this);
|
|
2010
|
+
return ptr;
|
|
2011
|
+
}
|
|
2012
|
+
free() {
|
|
2013
|
+
const ptr = this.__destroy_into_raw();
|
|
2014
|
+
wasm.__wbg_multiissuerauthorizeresult_free(ptr, 0);
|
|
2015
|
+
}
|
|
2016
|
+
/**
|
|
2017
|
+
* Result of authorization
|
|
2018
|
+
* true means `ALLOW`
|
|
2019
|
+
* false means `Deny`
|
|
2020
|
+
* @returns {boolean}
|
|
2021
|
+
*/
|
|
2022
|
+
get decision() {
|
|
2023
|
+
const ret = wasm.__wbg_get_multiissuerauthorizeresult_decision(this.__wbg_ptr);
|
|
2024
|
+
return ret !== 0;
|
|
2025
|
+
}
|
|
2026
|
+
/**
|
|
2027
|
+
* Request ID of the authorization request
|
|
2028
|
+
* @returns {string}
|
|
2029
|
+
*/
|
|
2030
|
+
get request_id() {
|
|
2031
|
+
let deferred1_0;
|
|
2032
|
+
let deferred1_1;
|
|
2033
|
+
try {
|
|
2034
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
2035
|
+
wasm.__wbg_get_multiissuerauthorizeresult_request_id(retptr, this.__wbg_ptr);
|
|
2036
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
2037
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
2038
|
+
deferred1_0 = r0;
|
|
2039
|
+
deferred1_1 = r1;
|
|
2040
|
+
return getStringFromWasm0(r0, r1);
|
|
2041
|
+
} finally {
|
|
2042
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
2043
|
+
wasm.__wbindgen_export5(deferred1_0, deferred1_1, 1);
|
|
2044
|
+
}
|
|
2045
|
+
}
|
|
2046
|
+
/**
|
|
2047
|
+
* Result of Cedar policy authorization
|
|
2048
|
+
* @returns {AuthorizeResultResponse}
|
|
2049
|
+
*/
|
|
2050
|
+
get response() {
|
|
2051
|
+
const ret = wasm.__wbg_get_multiissuerauthorizeresult_response(this.__wbg_ptr);
|
|
2052
|
+
return AuthorizeResultResponse.__wrap(ret);
|
|
2053
|
+
}
|
|
2054
|
+
/**
|
|
2055
|
+
* Convert `MultiIssuerAuthorizeResult` to json string value
|
|
2056
|
+
* @returns {string}
|
|
2057
|
+
*/
|
|
2058
|
+
jsonString() {
|
|
2059
|
+
let deferred1_0;
|
|
2060
|
+
let deferred1_1;
|
|
2061
|
+
try {
|
|
2062
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
2063
|
+
wasm.multiissuerauthorizeresult_jsonString(retptr, this.__wbg_ptr);
|
|
2064
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
2065
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
2066
|
+
deferred1_0 = r0;
|
|
2067
|
+
deferred1_1 = r1;
|
|
2068
|
+
return getStringFromWasm0(r0, r1);
|
|
2069
|
+
} finally {
|
|
2070
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
2071
|
+
wasm.__wbindgen_export5(deferred1_0, deferred1_1, 1);
|
|
2072
|
+
}
|
|
2073
|
+
}
|
|
2074
|
+
/**
|
|
2075
|
+
* Result of authorization
|
|
2076
|
+
* true means `ALLOW`
|
|
2077
|
+
* false means `Deny`
|
|
2078
|
+
* @param {boolean} arg0
|
|
2079
|
+
*/
|
|
2080
|
+
set decision(arg0) {
|
|
2081
|
+
wasm.__wbg_set_multiissuerauthorizeresult_decision(this.__wbg_ptr, arg0);
|
|
2082
|
+
}
|
|
2083
|
+
/**
|
|
2084
|
+
* Request ID of the authorization request
|
|
2085
|
+
* @param {string} arg0
|
|
2086
|
+
*/
|
|
2087
|
+
set request_id(arg0) {
|
|
2088
|
+
const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
2089
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2090
|
+
wasm.__wbg_set_multiissuerauthorizeresult_request_id(this.__wbg_ptr, ptr0, len0);
|
|
2091
|
+
}
|
|
2092
|
+
/**
|
|
2093
|
+
* Result of Cedar policy authorization
|
|
2094
|
+
* @param {AuthorizeResultResponse} arg0
|
|
2095
|
+
*/
|
|
2096
|
+
set response(arg0) {
|
|
2097
|
+
_assertClass(arg0, AuthorizeResultResponse);
|
|
2098
|
+
var ptr0 = arg0.__destroy_into_raw();
|
|
2099
|
+
wasm.__wbg_set_multiissuerauthorizeresult_response(this.__wbg_ptr, ptr0);
|
|
2100
|
+
}
|
|
2101
|
+
};
|
|
2102
|
+
if (Symbol.dispose) MultiIssuerAuthorizeResult.prototype[Symbol.dispose] = MultiIssuerAuthorizeResult.prototype.free;
|
|
2103
|
+
var PolicyEvaluationError = class _PolicyEvaluationError {
|
|
2104
|
+
static __wrap(ptr) {
|
|
2105
|
+
const obj = Object.create(_PolicyEvaluationError.prototype);
|
|
2106
|
+
obj.__wbg_ptr = ptr;
|
|
2107
|
+
PolicyEvaluationErrorFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
2108
|
+
return obj;
|
|
2109
|
+
}
|
|
2110
|
+
__destroy_into_raw() {
|
|
2111
|
+
const ptr = this.__wbg_ptr;
|
|
2112
|
+
this.__wbg_ptr = 0;
|
|
2113
|
+
PolicyEvaluationErrorFinalization.unregister(this);
|
|
2114
|
+
return ptr;
|
|
2115
|
+
}
|
|
2116
|
+
free() {
|
|
2117
|
+
const ptr = this.__destroy_into_raw();
|
|
2118
|
+
wasm.__wbg_policyevaluationerror_free(ptr, 0);
|
|
2119
|
+
}
|
|
2120
|
+
/**
|
|
2121
|
+
* Underlying evaluation error string representation
|
|
2122
|
+
* @returns {string}
|
|
2123
|
+
*/
|
|
2124
|
+
get error() {
|
|
2125
|
+
let deferred1_0;
|
|
2126
|
+
let deferred1_1;
|
|
2127
|
+
try {
|
|
2128
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
2129
|
+
wasm.policyevaluationerror_error(retptr, this.__wbg_ptr);
|
|
2130
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
2131
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
2132
|
+
deferred1_0 = r0;
|
|
2133
|
+
deferred1_1 = r1;
|
|
2134
|
+
return getStringFromWasm0(r0, r1);
|
|
2135
|
+
} finally {
|
|
2136
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
2137
|
+
wasm.__wbindgen_export5(deferred1_0, deferred1_1, 1);
|
|
2138
|
+
}
|
|
2139
|
+
}
|
|
2140
|
+
/**
|
|
2141
|
+
* Id of the policy with an error
|
|
2142
|
+
* @returns {string}
|
|
2143
|
+
*/
|
|
2144
|
+
get id() {
|
|
2145
|
+
let deferred1_0;
|
|
2146
|
+
let deferred1_1;
|
|
2147
|
+
try {
|
|
2148
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
2149
|
+
wasm.policyevaluationerror_id(retptr, this.__wbg_ptr);
|
|
2150
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
2151
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
2152
|
+
deferred1_0 = r0;
|
|
2153
|
+
deferred1_1 = r1;
|
|
2154
|
+
return getStringFromWasm0(r0, r1);
|
|
2155
|
+
} finally {
|
|
2156
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
2157
|
+
wasm.__wbindgen_export5(deferred1_0, deferred1_1, 1);
|
|
2158
|
+
}
|
|
2159
|
+
}
|
|
2160
|
+
};
|
|
2161
|
+
if (Symbol.dispose) PolicyEvaluationError.prototype[Symbol.dispose] = PolicyEvaluationError.prototype.free;
|
|
2162
|
+
function init(config) {
|
|
2163
|
+
const ret = wasm.init(addHeapObject(config));
|
|
2164
|
+
return takeObject(ret);
|
|
2165
|
+
}
|
|
2166
|
+
function initFromArchiveBytes(config, archive_bytes) {
|
|
2167
|
+
const ret = wasm.initFromArchiveBytes(addHeapObject(config), addHeapObject(archive_bytes));
|
|
2168
|
+
return takeObject(ret);
|
|
2169
|
+
}
|
|
2170
|
+
function __wbg_get_imports() {
|
|
2171
|
+
const import0 = {
|
|
2172
|
+
__proto__: null,
|
|
2173
|
+
__wbg_Error_67e7344beaa85059: function(arg0, arg1) {
|
|
2174
|
+
const ret = Error(getStringFromWasm0(arg0, arg1));
|
|
2175
|
+
return addHeapObject(ret);
|
|
2176
|
+
},
|
|
2177
|
+
__wbg_Number_c54e7112a3fa7e3e: function(arg0) {
|
|
2178
|
+
const ret = Number(getObject(arg0));
|
|
2179
|
+
return ret;
|
|
2180
|
+
},
|
|
2181
|
+
__wbg___wbindgen_bigint_get_as_i64_b482365c149396c8: function(arg0, arg1) {
|
|
2182
|
+
const v = getObject(arg1);
|
|
2183
|
+
const ret = typeof v === "bigint" ? v : void 0;
|
|
2184
|
+
getDataViewMemory0().setBigInt64(arg0 + 8 * 1, isLikeNone(ret) ? BigInt(0) : ret, true);
|
|
2185
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
|
|
2186
|
+
},
|
|
2187
|
+
__wbg___wbindgen_boolean_get_7a12af2b3f899c5a: function(arg0) {
|
|
2188
|
+
const v = getObject(arg0);
|
|
2189
|
+
const ret = typeof v === "boolean" ? v : void 0;
|
|
2190
|
+
return isLikeNone(ret) ? 16777215 : ret ? 1 : 0;
|
|
2191
|
+
},
|
|
2192
|
+
__wbg___wbindgen_debug_string_0e68cf47c9cbd9b0: function(arg0, arg1) {
|
|
2193
|
+
const ret = debugString(getObject(arg1));
|
|
2194
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
2195
|
+
const len1 = WASM_VECTOR_LEN;
|
|
2196
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
2197
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
2198
|
+
},
|
|
2199
|
+
__wbg___wbindgen_in_50072d4d6e45c193: function(arg0, arg1) {
|
|
2200
|
+
const ret = getObject(arg0) in getObject(arg1);
|
|
2201
|
+
return ret;
|
|
2202
|
+
},
|
|
2203
|
+
__wbg___wbindgen_is_bigint_60fc0336cb14f5d7: function(arg0) {
|
|
2204
|
+
const ret = typeof getObject(arg0) === "bigint";
|
|
2205
|
+
return ret;
|
|
2206
|
+
},
|
|
2207
|
+
__wbg___wbindgen_is_function_fcda5e3902d732fe: function(arg0) {
|
|
2208
|
+
const ret = typeof getObject(arg0) === "function";
|
|
2209
|
+
return ret;
|
|
2210
|
+
},
|
|
2211
|
+
__wbg___wbindgen_is_object_edb6b15aa3afe12e: function(arg0) {
|
|
2212
|
+
const val = getObject(arg0);
|
|
2213
|
+
const ret = typeof val === "object" && val !== null;
|
|
2214
|
+
return ret;
|
|
2215
|
+
},
|
|
2216
|
+
__wbg___wbindgen_is_string_c4f7cb494a2a21f1: function(arg0) {
|
|
2217
|
+
const ret = typeof getObject(arg0) === "string";
|
|
2218
|
+
return ret;
|
|
2219
|
+
},
|
|
2220
|
+
__wbg___wbindgen_is_undefined_8c687d0b90d5b524: function(arg0) {
|
|
2221
|
+
const ret = getObject(arg0) === void 0;
|
|
2222
|
+
return ret;
|
|
2223
|
+
},
|
|
2224
|
+
__wbg___wbindgen_jsval_eq_9fdcd3c0a860dd3b: function(arg0, arg1) {
|
|
2225
|
+
const ret = getObject(arg0) === getObject(arg1);
|
|
2226
|
+
return ret;
|
|
2227
|
+
},
|
|
2228
|
+
__wbg___wbindgen_jsval_loose_eq_3c30021c243b64cd: function(arg0, arg1) {
|
|
2229
|
+
const ret = getObject(arg0) == getObject(arg1);
|
|
2230
|
+
return ret;
|
|
2231
|
+
},
|
|
2232
|
+
__wbg___wbindgen_number_get_1dc732b810cb937c: function(arg0, arg1) {
|
|
2233
|
+
const obj = getObject(arg1);
|
|
2234
|
+
const ret = typeof obj === "number" ? obj : void 0;
|
|
2235
|
+
getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
|
|
2236
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
|
|
2237
|
+
},
|
|
2238
|
+
__wbg___wbindgen_string_get_92ab86bb19cbc12f: function(arg0, arg1) {
|
|
2239
|
+
const obj = getObject(arg1);
|
|
2240
|
+
const ret = typeof obj === "string" ? obj : void 0;
|
|
2241
|
+
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
2242
|
+
var len1 = WASM_VECTOR_LEN;
|
|
2243
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
2244
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
2245
|
+
},
|
|
2246
|
+
__wbg___wbindgen_throw_5d9e815e6fdf150f: function(arg0, arg1) {
|
|
2247
|
+
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
2248
|
+
},
|
|
2249
|
+
__wbg__wbg_cb_unref_997e73d32238e655: function(arg0) {
|
|
2250
|
+
getObject(arg0)._wbg_cb_unref();
|
|
2251
|
+
},
|
|
2252
|
+
__wbg_abort_03f8c5804715cb9a: function(arg0, arg1) {
|
|
2253
|
+
getObject(arg0).abort(getObject(arg1));
|
|
2254
|
+
},
|
|
2255
|
+
__wbg_abort_76dea11221098ae5: function(arg0) {
|
|
2256
|
+
getObject(arg0).abort();
|
|
2257
|
+
},
|
|
2258
|
+
__wbg_append_8e87c13f0f08f8cd: function() {
|
|
2259
|
+
return handleError(function(arg0, arg1, arg2, arg3, arg4) {
|
|
2260
|
+
getObject(arg0).append(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4));
|
|
2261
|
+
}, arguments);
|
|
2262
|
+
},
|
|
2263
|
+
__wbg_arrayBuffer_06f3da76f071d37f: function() {
|
|
2264
|
+
return handleError(function(arg0) {
|
|
2265
|
+
const ret = getObject(arg0).arrayBuffer();
|
|
2266
|
+
return addHeapObject(ret);
|
|
2267
|
+
}, arguments);
|
|
2268
|
+
},
|
|
2269
|
+
__wbg_authorizeresult_new: function(arg0) {
|
|
2270
|
+
const ret = AuthorizeResult.__wrap(arg0);
|
|
2271
|
+
return addHeapObject(ret);
|
|
2272
|
+
},
|
|
2273
|
+
__wbg_batchauthorizemultiissuerresponse_new: function(arg0) {
|
|
2274
|
+
const ret = BatchAuthorizeMultiIssuerResponse.__wrap(arg0);
|
|
2275
|
+
return addHeapObject(ret);
|
|
2276
|
+
},
|
|
2277
|
+
__wbg_batchauthorizeunsignedresponse_new: function(arg0) {
|
|
2278
|
+
const ret = BatchAuthorizeUnsignedResponse.__wrap(arg0);
|
|
2279
|
+
return addHeapObject(ret);
|
|
2280
|
+
},
|
|
2281
|
+
__wbg_batchitemmultiissuerresult_new: function(arg0) {
|
|
2282
|
+
const ret = BatchItemMultiIssuerResult.__wrap(arg0);
|
|
2283
|
+
return addHeapObject(ret);
|
|
2284
|
+
},
|
|
2285
|
+
__wbg_batchitemunsignedresult_new: function(arg0) {
|
|
2286
|
+
const ret = BatchItemUnsignedResult.__wrap(arg0);
|
|
2287
|
+
return addHeapObject(ret);
|
|
2288
|
+
},
|
|
2289
|
+
__wbg_body_9ee03724e9ad0639: function(arg0) {
|
|
2290
|
+
const ret = getObject(arg0).body;
|
|
2291
|
+
return isLikeNone(ret) ? 0 : addHeapObject(ret);
|
|
2292
|
+
},
|
|
2293
|
+
__wbg_buffer_4a989bded7035f57: function(arg0) {
|
|
2294
|
+
const ret = getObject(arg0).buffer;
|
|
2295
|
+
return addHeapObject(ret);
|
|
2296
|
+
},
|
|
2297
|
+
__wbg_byobRequest_f161fc37241dd3d4: function(arg0) {
|
|
2298
|
+
const ret = getObject(arg0).byobRequest;
|
|
2299
|
+
return isLikeNone(ret) ? 0 : addHeapObject(ret);
|
|
2300
|
+
},
|
|
2301
|
+
__wbg_byteLength_0ddb1795e2c7e689: function(arg0) {
|
|
2302
|
+
const ret = getObject(arg0).byteLength;
|
|
2303
|
+
return ret;
|
|
2304
|
+
},
|
|
2305
|
+
__wbg_byteOffset_46eb015f52b6ad7d: function(arg0) {
|
|
2306
|
+
const ret = getObject(arg0).byteOffset;
|
|
2307
|
+
return ret;
|
|
2308
|
+
},
|
|
2309
|
+
__wbg_call_269c5566fbede3eb: function() {
|
|
2310
|
+
return handleError(function(arg0, arg1) {
|
|
2311
|
+
const ret = getObject(arg0).call(getObject(arg1));
|
|
2312
|
+
return addHeapObject(ret);
|
|
2313
|
+
}, arguments);
|
|
2314
|
+
},
|
|
2315
|
+
__wbg_call_6bcf8d3e20937e46: function() {
|
|
2316
|
+
return handleError(function(arg0, arg1, arg2) {
|
|
2317
|
+
const ret = getObject(arg0).call(getObject(arg1), getObject(arg2));
|
|
2318
|
+
return addHeapObject(ret);
|
|
2319
|
+
}, arguments);
|
|
2320
|
+
},
|
|
2321
|
+
__wbg_cancel_c076350a7e8954be: function(arg0) {
|
|
2322
|
+
const ret = getObject(arg0).cancel();
|
|
2323
|
+
return addHeapObject(ret);
|
|
2324
|
+
},
|
|
2325
|
+
__wbg_catch_e2134ef6dcdb69ed: function(arg0, arg1) {
|
|
2326
|
+
const ret = getObject(arg0).catch(getObject(arg1));
|
|
2327
|
+
return addHeapObject(ret);
|
|
2328
|
+
},
|
|
2329
|
+
__wbg_cedarling_new: function(arg0) {
|
|
2330
|
+
const ret = Cedarling.__wrap(arg0);
|
|
2331
|
+
return addHeapObject(ret);
|
|
2332
|
+
},
|
|
2333
|
+
__wbg_clearTimeout_1daad5c6ee4fcd3b: function(arg0) {
|
|
2334
|
+
const ret = clearTimeout(takeObject(arg0));
|
|
2335
|
+
return addHeapObject(ret);
|
|
2336
|
+
},
|
|
2337
|
+
__wbg_clearTimeout_3629d6209dfcc46e: function(arg0) {
|
|
2338
|
+
const ret = clearTimeout(takeObject(arg0));
|
|
2339
|
+
return addHeapObject(ret);
|
|
2340
|
+
},
|
|
2341
|
+
__wbg_clearTimeout_fa0abacb8606b0a7: function(arg0) {
|
|
2342
|
+
const ret = clearTimeout(takeObject(arg0));
|
|
2343
|
+
return addHeapObject(ret);
|
|
2344
|
+
},
|
|
2345
|
+
__wbg_close_22882088c136df25: function() {
|
|
2346
|
+
return handleError(function(arg0) {
|
|
2347
|
+
getObject(arg0).close();
|
|
2348
|
+
}, arguments);
|
|
2349
|
+
},
|
|
2350
|
+
__wbg_close_8b609460dd26e367: function() {
|
|
2351
|
+
return handleError(function(arg0) {
|
|
2352
|
+
getObject(arg0).close();
|
|
2353
|
+
}, arguments);
|
|
2354
|
+
},
|
|
2355
|
+
__wbg_crypto_38df2bab126b63dc: function(arg0) {
|
|
2356
|
+
const ret = getObject(arg0).crypto;
|
|
2357
|
+
return addHeapObject(ret);
|
|
2358
|
+
},
|
|
2359
|
+
__wbg_dataentry_new: function(arg0) {
|
|
2360
|
+
const ret = DataEntry.__wrap(arg0);
|
|
2361
|
+
return addHeapObject(ret);
|
|
2362
|
+
},
|
|
2363
|
+
__wbg_debug_05a311ddbfef3a8f: function(arg0) {
|
|
2364
|
+
console.debug(...getObject(arg0));
|
|
2365
|
+
},
|
|
2366
|
+
__wbg_done_cffed884d87aa22e: function(arg0) {
|
|
2367
|
+
const ret = getObject(arg0).done;
|
|
2368
|
+
return ret;
|
|
2369
|
+
},
|
|
2370
|
+
__wbg_enqueue_6cb545d22db14f33: function() {
|
|
2371
|
+
return handleError(function(arg0, arg1) {
|
|
2372
|
+
getObject(arg0).enqueue(getObject(arg1));
|
|
2373
|
+
}, arguments);
|
|
2374
|
+
},
|
|
2375
|
+
__wbg_entries_20b9608d57d8ddd6: function(arg0) {
|
|
2376
|
+
const ret = getObject(arg0).entries();
|
|
2377
|
+
return addHeapObject(ret);
|
|
2378
|
+
},
|
|
2379
|
+
__wbg_entries_972a87586902cf87: function(arg0) {
|
|
2380
|
+
const ret = Object.entries(getObject(arg0));
|
|
2381
|
+
return addHeapObject(ret);
|
|
2382
|
+
},
|
|
2383
|
+
__wbg_entries_f9de04c09a57314e: function(arg0) {
|
|
2384
|
+
const ret = getObject(arg0).entries();
|
|
2385
|
+
return addHeapObject(ret);
|
|
2386
|
+
},
|
|
2387
|
+
__wbg_error_b73a4f5824169740: function(arg0) {
|
|
2388
|
+
console.error(...getObject(arg0));
|
|
2389
|
+
},
|
|
2390
|
+
__wbg_fetch_37b5c90ecd638071: function(arg0, arg1) {
|
|
2391
|
+
const ret = fetch(getObject(arg0), getObject(arg1));
|
|
2392
|
+
return addHeapObject(ret);
|
|
2393
|
+
},
|
|
2394
|
+
__wbg_fetch_7a37768ab67c5bd8: function(arg0) {
|
|
2395
|
+
const ret = fetch(getObject(arg0));
|
|
2396
|
+
return addHeapObject(ret);
|
|
2397
|
+
},
|
|
2398
|
+
__wbg_fetch_920242d59bac2026: function(arg0, arg1) {
|
|
2399
|
+
const ret = getObject(arg0).fetch(getObject(arg1));
|
|
2400
|
+
return addHeapObject(ret);
|
|
2401
|
+
},
|
|
2402
|
+
__wbg_fetch_db3df7e2da5d3a3b: function(arg0, arg1, arg2) {
|
|
2403
|
+
const ret = getObject(arg0).fetch(getObject(arg1), getObject(arg2));
|
|
2404
|
+
return addHeapObject(ret);
|
|
2405
|
+
},
|
|
2406
|
+
__wbg_fromEntries_7b28aba4b67dea2a: function() {
|
|
2407
|
+
return handleError(function(arg0) {
|
|
2408
|
+
const ret = Object.fromEntries(getObject(arg0));
|
|
2409
|
+
return addHeapObject(ret);
|
|
2410
|
+
}, arguments);
|
|
2411
|
+
},
|
|
2412
|
+
__wbg_getRandomValues_436a51d0629d84e1: function() {
|
|
2413
|
+
return handleError(function(arg0, arg1) {
|
|
2414
|
+
globalThis.crypto.getRandomValues(getArrayU8FromWasm0(arg0, arg1));
|
|
2415
|
+
}, arguments);
|
|
2416
|
+
},
|
|
2417
|
+
__wbg_getRandomValues_c44a50d8cfdaebeb: function() {
|
|
2418
|
+
return handleError(function(arg0, arg1) {
|
|
2419
|
+
getObject(arg0).getRandomValues(getObject(arg1));
|
|
2420
|
+
}, arguments);
|
|
2421
|
+
},
|
|
2422
|
+
__wbg_getReader_bf34f92ee19c42b4: function() {
|
|
2423
|
+
return handleError(function(arg0) {
|
|
2424
|
+
const ret = getObject(arg0).getReader();
|
|
2425
|
+
return addHeapObject(ret);
|
|
2426
|
+
}, arguments);
|
|
2427
|
+
},
|
|
2428
|
+
__wbg_getTime_65922ba0b59d55a7: function(arg0) {
|
|
2429
|
+
const ret = getObject(arg0).getTime();
|
|
2430
|
+
return ret;
|
|
2431
|
+
},
|
|
2432
|
+
__wbg_getTimezoneOffset_6e4850ad528ac37d: function(arg0) {
|
|
2433
|
+
const ret = getObject(arg0).getTimezoneOffset();
|
|
2434
|
+
return ret;
|
|
2435
|
+
},
|
|
2436
|
+
__wbg_get_6cf5a4d4d8ad3c5a: function() {
|
|
2437
|
+
return handleError(function(arg0, arg1) {
|
|
2438
|
+
const ret = Reflect.get(getObject(arg0), getObject(arg1));
|
|
2439
|
+
return addHeapObject(ret);
|
|
2440
|
+
}, arguments);
|
|
2441
|
+
},
|
|
2442
|
+
__wbg_get_989d0a1309644f2b: function() {
|
|
2443
|
+
return handleError(function(arg0, arg1) {
|
|
2444
|
+
const ret = Reflect.get(getObject(arg0), getObject(arg1));
|
|
2445
|
+
return addHeapObject(ret);
|
|
2446
|
+
}, arguments);
|
|
2447
|
+
},
|
|
2448
|
+
__wbg_get_b1f0ab13c737f856: function(arg0, arg1) {
|
|
2449
|
+
const ret = getObject(arg0)[arg1 >>> 0];
|
|
2450
|
+
return addHeapObject(ret);
|
|
2451
|
+
},
|
|
2452
|
+
__wbg_get_done_a668aa62d81fad70: function(arg0) {
|
|
2453
|
+
const ret = getObject(arg0).done;
|
|
2454
|
+
return isLikeNone(ret) ? 16777215 : ret ? 1 : 0;
|
|
2455
|
+
},
|
|
2456
|
+
__wbg_get_unchecked_363572bdd397d473: function(arg0, arg1) {
|
|
2457
|
+
const ret = getObject(arg0)[arg1 >>> 0];
|
|
2458
|
+
return addHeapObject(ret);
|
|
2459
|
+
},
|
|
2460
|
+
__wbg_get_value_6c62a77c168d825a: function(arg0) {
|
|
2461
|
+
const ret = getObject(arg0).value;
|
|
2462
|
+
return addHeapObject(ret);
|
|
2463
|
+
},
|
|
2464
|
+
__wbg_get_with_ref_key_6412cf3094599694: function(arg0, arg1) {
|
|
2465
|
+
const ret = getObject(arg0)[getObject(arg1)];
|
|
2466
|
+
return addHeapObject(ret);
|
|
2467
|
+
},
|
|
2468
|
+
__wbg_has_464f8b9416279d65: function() {
|
|
2469
|
+
return handleError(function(arg0, arg1) {
|
|
2470
|
+
const ret = Reflect.has(getObject(arg0), getObject(arg1));
|
|
2471
|
+
return ret;
|
|
2472
|
+
}, arguments);
|
|
2473
|
+
},
|
|
2474
|
+
__wbg_headers_2594464ff62969f3: function(arg0) {
|
|
2475
|
+
const ret = getObject(arg0).headers;
|
|
2476
|
+
return addHeapObject(ret);
|
|
2477
|
+
},
|
|
2478
|
+
__wbg_info_e117f690cadd7085: function(arg0) {
|
|
2479
|
+
console.info(...getObject(arg0));
|
|
2480
|
+
},
|
|
2481
|
+
__wbg_instanceof_ArrayBuffer_d4ff01f8247925ae: function(arg0) {
|
|
2482
|
+
let result;
|
|
2483
|
+
try {
|
|
2484
|
+
result = getObject(arg0) instanceof ArrayBuffer;
|
|
2485
|
+
} catch (_) {
|
|
2486
|
+
result = false;
|
|
2487
|
+
}
|
|
2488
|
+
const ret = result;
|
|
2489
|
+
return ret;
|
|
2490
|
+
},
|
|
2491
|
+
__wbg_instanceof_Array_fb99baf356838802: function(arg0) {
|
|
2492
|
+
let result;
|
|
2493
|
+
try {
|
|
2494
|
+
result = getObject(arg0) instanceof Array;
|
|
2495
|
+
} catch (_) {
|
|
2496
|
+
result = false;
|
|
2497
|
+
}
|
|
2498
|
+
const ret = result;
|
|
2499
|
+
return ret;
|
|
2500
|
+
},
|
|
2501
|
+
__wbg_instanceof_Map_1ff6a2b54c899f0d: function(arg0) {
|
|
2502
|
+
let result;
|
|
2503
|
+
try {
|
|
2504
|
+
result = getObject(arg0) instanceof Map;
|
|
2505
|
+
} catch (_) {
|
|
2506
|
+
result = false;
|
|
2507
|
+
}
|
|
2508
|
+
const ret = result;
|
|
2509
|
+
return ret;
|
|
2510
|
+
},
|
|
2511
|
+
__wbg_instanceof_Response_6366a785e400039b: function(arg0) {
|
|
2512
|
+
let result;
|
|
2513
|
+
try {
|
|
2514
|
+
result = getObject(arg0) instanceof Response;
|
|
2515
|
+
} catch (_) {
|
|
2516
|
+
result = false;
|
|
2517
|
+
}
|
|
2518
|
+
const ret = result;
|
|
2519
|
+
return ret;
|
|
2520
|
+
},
|
|
2521
|
+
__wbg_instanceof_Uint8Array_598adc0fef426aa8: function(arg0) {
|
|
2522
|
+
let result;
|
|
2523
|
+
try {
|
|
2524
|
+
result = getObject(arg0) instanceof Uint8Array;
|
|
2525
|
+
} catch (_) {
|
|
2526
|
+
result = false;
|
|
2527
|
+
}
|
|
2528
|
+
const ret = result;
|
|
2529
|
+
return ret;
|
|
2530
|
+
},
|
|
2531
|
+
__wbg_isArray_5674713bb7b79043: function(arg0) {
|
|
2532
|
+
const ret = Array.isArray(getObject(arg0));
|
|
2533
|
+
return ret;
|
|
2534
|
+
},
|
|
2535
|
+
__wbg_isSafeInteger_8f51c743827d1ec5: function(arg0) {
|
|
2536
|
+
const ret = Number.isSafeInteger(getObject(arg0));
|
|
2537
|
+
return ret;
|
|
2538
|
+
},
|
|
2539
|
+
__wbg_iterator_22ddeb808cf55a6f: function() {
|
|
2540
|
+
const ret = Symbol.iterator;
|
|
2541
|
+
return addHeapObject(ret);
|
|
2542
|
+
},
|
|
2543
|
+
__wbg_keys_6efc298980178da1: function(arg0) {
|
|
2544
|
+
const ret = Object.keys(getObject(arg0));
|
|
2545
|
+
return addHeapObject(ret);
|
|
2546
|
+
},
|
|
2547
|
+
__wbg_length_31bdaf014f5fbde2: function(arg0) {
|
|
2548
|
+
const ret = getObject(arg0).length;
|
|
2549
|
+
return ret;
|
|
2550
|
+
},
|
|
2551
|
+
__wbg_length_4e1adc0d42e23620: function(arg0) {
|
|
2552
|
+
const ret = getObject(arg0).length;
|
|
2553
|
+
return ret;
|
|
2554
|
+
},
|
|
2555
|
+
__wbg_log_16ab6e7183963f7e: function(arg0) {
|
|
2556
|
+
console.log(...getObject(arg0));
|
|
2557
|
+
},
|
|
2558
|
+
__wbg_msCrypto_bd5a034af96bcba6: function(arg0) {
|
|
2559
|
+
const ret = getObject(arg0).msCrypto;
|
|
2560
|
+
return addHeapObject(ret);
|
|
2561
|
+
},
|
|
2562
|
+
__wbg_multiissuerauthorizeresult_new: function(arg0) {
|
|
2563
|
+
const ret = MultiIssuerAuthorizeResult.__wrap(arg0);
|
|
2564
|
+
return addHeapObject(ret);
|
|
2565
|
+
},
|
|
2566
|
+
__wbg_new_0_35540e542ba689d2: function() {
|
|
2567
|
+
const ret = /* @__PURE__ */ new Date();
|
|
2568
|
+
return addHeapObject(ret);
|
|
2569
|
+
},
|
|
2570
|
+
__wbg_new_0afe64b4dc16ab74: function() {
|
|
2571
|
+
return handleError(function() {
|
|
2572
|
+
const ret = new Headers();
|
|
2573
|
+
return addHeapObject(ret);
|
|
2574
|
+
}, arguments);
|
|
2575
|
+
},
|
|
2576
|
+
__wbg_new_180f1022bb6ee517: function(arg0) {
|
|
2577
|
+
const ret = new Date(getObject(arg0));
|
|
2578
|
+
return addHeapObject(ret);
|
|
2579
|
+
},
|
|
2580
|
+
__wbg_new_1da3429bc3c4541c: function(arg0) {
|
|
2581
|
+
const ret = new Uint8Array(getObject(arg0));
|
|
2582
|
+
return addHeapObject(ret);
|
|
2583
|
+
},
|
|
2584
|
+
__wbg_new_8d36e20aa758e411: function() {
|
|
2585
|
+
const ret = /* @__PURE__ */ new Map();
|
|
2586
|
+
return addHeapObject(ret);
|
|
2587
|
+
},
|
|
2588
|
+
__wbg_new_a32a1ab6c6655abe: function(arg0, arg1) {
|
|
2589
|
+
const ret = new Error(getStringFromWasm0(arg0, arg1));
|
|
2590
|
+
return addHeapObject(ret);
|
|
2591
|
+
},
|
|
2592
|
+
__wbg_new_baa0a0207935dd43: function() {
|
|
2593
|
+
return handleError(function() {
|
|
2594
|
+
const ret = new AbortController();
|
|
2595
|
+
return addHeapObject(ret);
|
|
2596
|
+
}, arguments);
|
|
2597
|
+
},
|
|
2598
|
+
__wbg_new_bebc3f4757acf305: function() {
|
|
2599
|
+
const ret = new Object();
|
|
2600
|
+
return addHeapObject(ret);
|
|
2601
|
+
},
|
|
2602
|
+
__wbg_new_ffa92086ea89f79c: function() {
|
|
2603
|
+
const ret = new Array();
|
|
2604
|
+
return addHeapObject(ret);
|
|
2605
|
+
},
|
|
2606
|
+
__wbg_new_from_slice_4ee02165f9de919e: function(arg0, arg1) {
|
|
2607
|
+
const ret = new Uint8Array(getArrayU8FromWasm0(arg0, arg1));
|
|
2608
|
+
return addHeapObject(ret);
|
|
2609
|
+
},
|
|
2610
|
+
__wbg_new_typed_6f8b0d724fe26c07: function(arg0, arg1) {
|
|
2611
|
+
try {
|
|
2612
|
+
var state0 = { a: arg0, b: arg1 };
|
|
2613
|
+
var cb0 = (arg02, arg12) => {
|
|
2614
|
+
const a = state0.a;
|
|
2615
|
+
state0.a = 0;
|
|
2616
|
+
try {
|
|
2617
|
+
return __wasm_bindgen_func_elem_8992(a, state0.b, arg02, arg12);
|
|
2618
|
+
} finally {
|
|
2619
|
+
state0.a = a;
|
|
2620
|
+
}
|
|
2621
|
+
};
|
|
2622
|
+
const ret = new Promise(cb0);
|
|
2623
|
+
return addHeapObject(ret);
|
|
2624
|
+
} finally {
|
|
2625
|
+
state0.a = 0;
|
|
2626
|
+
}
|
|
2627
|
+
},
|
|
2628
|
+
__wbg_new_with_byte_offset_and_length_492c969e8b5da8a4: function(arg0, arg1, arg2) {
|
|
2629
|
+
const ret = new Uint8Array(getObject(arg0), arg1 >>> 0, arg2 >>> 0);
|
|
2630
|
+
return addHeapObject(ret);
|
|
2631
|
+
},
|
|
2632
|
+
__wbg_new_with_length_5ffeddb9d9fbb96f: function(arg0) {
|
|
2633
|
+
const ret = new Uint8Array(arg0 >>> 0);
|
|
2634
|
+
return addHeapObject(ret);
|
|
2635
|
+
},
|
|
2636
|
+
__wbg_new_with_str_and_init_2f31a77deda127fd: function() {
|
|
2637
|
+
return handleError(function(arg0, arg1, arg2) {
|
|
2638
|
+
const ret = new Request(getStringFromWasm0(arg0, arg1), getObject(arg2));
|
|
2639
|
+
return addHeapObject(ret);
|
|
2640
|
+
}, arguments);
|
|
2641
|
+
},
|
|
2642
|
+
__wbg_next_95053e306b1c3aed: function(arg0) {
|
|
2643
|
+
const ret = getObject(arg0).next;
|
|
2644
|
+
return addHeapObject(ret);
|
|
2645
|
+
},
|
|
2646
|
+
__wbg_next_f31ecb8646d2c605: function() {
|
|
2647
|
+
return handleError(function(arg0) {
|
|
2648
|
+
const ret = getObject(arg0).next();
|
|
2649
|
+
return addHeapObject(ret);
|
|
2650
|
+
}, arguments);
|
|
2651
|
+
},
|
|
2652
|
+
__wbg_node_84ea875411254db1: function(arg0) {
|
|
2653
|
+
const ret = getObject(arg0).node;
|
|
2654
|
+
return addHeapObject(ret);
|
|
2655
|
+
},
|
|
2656
|
+
__wbg_policyevaluationerror_new: function(arg0) {
|
|
2657
|
+
const ret = PolicyEvaluationError.__wrap(arg0);
|
|
2658
|
+
return addHeapObject(ret);
|
|
2659
|
+
},
|
|
2660
|
+
__wbg_process_44c7a14e11e9f69e: function(arg0) {
|
|
2661
|
+
const ret = getObject(arg0).process;
|
|
2662
|
+
return addHeapObject(ret);
|
|
2663
|
+
},
|
|
2664
|
+
__wbg_prototypesetcall_ae9f5e7459250748: function(arg0, arg1, arg2) {
|
|
2665
|
+
Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), getObject(arg2));
|
|
2666
|
+
},
|
|
2667
|
+
__wbg_push_bfdf956ba476f65b: function(arg0, arg1) {
|
|
2668
|
+
const ret = getObject(arg0).push(getObject(arg1));
|
|
2669
|
+
return ret;
|
|
2670
|
+
},
|
|
2671
|
+
__wbg_queueMicrotask_85c90f6987555d65: function(arg0) {
|
|
2672
|
+
const ret = getObject(arg0).queueMicrotask;
|
|
2673
|
+
return addHeapObject(ret);
|
|
2674
|
+
},
|
|
2675
|
+
__wbg_queueMicrotask_f6a1fa10b81d1fc0: function(arg0) {
|
|
2676
|
+
queueMicrotask(getObject(arg0));
|
|
2677
|
+
},
|
|
2678
|
+
__wbg_randomFillSync_6c25eac9869eb53c: function() {
|
|
2679
|
+
return handleError(function(arg0, arg1) {
|
|
2680
|
+
getObject(arg0).randomFillSync(takeObject(arg1));
|
|
2681
|
+
}, arguments);
|
|
2682
|
+
},
|
|
2683
|
+
__wbg_read_31091533ffadf971: function(arg0) {
|
|
2684
|
+
const ret = getObject(arg0).read();
|
|
2685
|
+
return addHeapObject(ret);
|
|
2686
|
+
},
|
|
2687
|
+
__wbg_releaseLock_1538945f5f183d9f: function(arg0) {
|
|
2688
|
+
getObject(arg0).releaseLock();
|
|
2689
|
+
},
|
|
2690
|
+
__wbg_require_b4edbdcf3e2a1ef0: function() {
|
|
2691
|
+
return handleError(function() {
|
|
2692
|
+
const ret = module.require;
|
|
2693
|
+
return addHeapObject(ret);
|
|
2694
|
+
}, arguments);
|
|
2695
|
+
},
|
|
2696
|
+
__wbg_resolve_35ec7e0c6af4c82c: function(arg0) {
|
|
2697
|
+
const ret = Promise.resolve(getObject(arg0));
|
|
2698
|
+
return addHeapObject(ret);
|
|
2699
|
+
},
|
|
2700
|
+
__wbg_respond_83a71686e927ca32: function() {
|
|
2701
|
+
return handleError(function(arg0, arg1) {
|
|
2702
|
+
getObject(arg0).respond(arg1 >>> 0);
|
|
2703
|
+
}, arguments);
|
|
2704
|
+
},
|
|
2705
|
+
__wbg_setTimeout_56bcdccbad22fd44: function() {
|
|
2706
|
+
return handleError(function(arg0, arg1) {
|
|
2707
|
+
const ret = setTimeout(getObject(arg0), arg1);
|
|
2708
|
+
return addHeapObject(ret);
|
|
2709
|
+
}, arguments);
|
|
2710
|
+
},
|
|
2711
|
+
__wbg_setTimeout_9c23a5767d86152f: function(arg0, arg1) {
|
|
2712
|
+
const ret = setTimeout(getObject(arg0), arg1);
|
|
2713
|
+
return addHeapObject(ret);
|
|
2714
|
+
},
|
|
2715
|
+
__wbg_setTimeout_b4a9096784635514: function(arg0, arg1) {
|
|
2716
|
+
const ret = setTimeout(getObject(arg0), arg1);
|
|
2717
|
+
return addHeapObject(ret);
|
|
2718
|
+
},
|
|
2719
|
+
__wbg_set_13d25b81ab403f5e: function(arg0, arg1, arg2) {
|
|
2720
|
+
getObject(arg0)[arg1 >>> 0] = takeObject(arg2);
|
|
2721
|
+
},
|
|
2722
|
+
__wbg_set_5f2ad37e5e02dc7b: function(arg0, arg1, arg2) {
|
|
2723
|
+
getObject(arg0).set(getArrayU8FromWasm0(arg1, arg2));
|
|
2724
|
+
},
|
|
2725
|
+
__wbg_set_6be42768c690e380: function(arg0, arg1, arg2) {
|
|
2726
|
+
getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
|
|
2727
|
+
},
|
|
2728
|
+
__wbg_set_7923e5ea63b41e6b: function() {
|
|
2729
|
+
return handleError(function(arg0, arg1, arg2, arg3, arg4) {
|
|
2730
|
+
getObject(arg0).set(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4));
|
|
2731
|
+
}, arguments);
|
|
2732
|
+
},
|
|
2733
|
+
__wbg_set_a377297433dfea63: function() {
|
|
2734
|
+
return handleError(function(arg0, arg1, arg2) {
|
|
2735
|
+
const ret = Reflect.set(getObject(arg0), getObject(arg1), getObject(arg2));
|
|
2736
|
+
return ret;
|
|
2737
|
+
}, arguments);
|
|
2738
|
+
},
|
|
2739
|
+
__wbg_set_bf6dde4923b9b059: function(arg0, arg1, arg2) {
|
|
2740
|
+
const ret = getObject(arg0).set(getObject(arg1), getObject(arg2));
|
|
2741
|
+
return addHeapObject(ret);
|
|
2742
|
+
},
|
|
2743
|
+
__wbg_set_body_f39cee72c74a5b02: function(arg0, arg1) {
|
|
2744
|
+
getObject(arg0).body = getObject(arg1);
|
|
2745
|
+
},
|
|
2746
|
+
__wbg_set_cache_6e8c35a5ed76edb1: function(arg0, arg1) {
|
|
2747
|
+
getObject(arg0).cache = __wbindgen_enum_RequestCache[arg1];
|
|
2748
|
+
},
|
|
2749
|
+
__wbg_set_credentials_bf1d3e014213a571: function(arg0, arg1) {
|
|
2750
|
+
getObject(arg0).credentials = __wbindgen_enum_RequestCredentials[arg1];
|
|
2751
|
+
},
|
|
2752
|
+
__wbg_set_headers_31d373f68f28bf76: function(arg0, arg1) {
|
|
2753
|
+
getObject(arg0).headers = getObject(arg1);
|
|
2754
|
+
},
|
|
2755
|
+
__wbg_set_integrity_d3d0eab9ab838204: function(arg0, arg1, arg2) {
|
|
2756
|
+
getObject(arg0).integrity = getStringFromWasm0(arg1, arg2);
|
|
2757
|
+
},
|
|
2758
|
+
__wbg_set_method_82e6c3c083da0734: function(arg0, arg1, arg2) {
|
|
2759
|
+
getObject(arg0).method = getStringFromWasm0(arg1, arg2);
|
|
2760
|
+
},
|
|
2761
|
+
__wbg_set_mode_f7e56ed768d0ade0: function(arg0, arg1) {
|
|
2762
|
+
getObject(arg0).mode = __wbindgen_enum_RequestMode[arg1];
|
|
2763
|
+
},
|
|
2764
|
+
__wbg_set_redirect_96061705212f7800: function(arg0, arg1) {
|
|
2765
|
+
getObject(arg0).redirect = __wbindgen_enum_RequestRedirect[arg1];
|
|
2766
|
+
},
|
|
2767
|
+
__wbg_set_referrer_13cf56bbccbb2ceb: function(arg0, arg1, arg2) {
|
|
2768
|
+
getObject(arg0).referrer = getStringFromWasm0(arg1, arg2);
|
|
2769
|
+
},
|
|
2770
|
+
__wbg_set_referrer_policy_dac1caa6e937479a: function(arg0, arg1) {
|
|
2771
|
+
getObject(arg0).referrerPolicy = __wbindgen_enum_ReferrerPolicy[arg1];
|
|
2772
|
+
},
|
|
2773
|
+
__wbg_set_signal_f4b32f40f19786f4: function(arg0, arg1) {
|
|
2774
|
+
getObject(arg0).signal = getObject(arg1);
|
|
2775
|
+
},
|
|
2776
|
+
__wbg_signal_45367c6c2255877a: function(arg0) {
|
|
2777
|
+
const ret = getObject(arg0).signal;
|
|
2778
|
+
return addHeapObject(ret);
|
|
2779
|
+
},
|
|
2780
|
+
__wbg_static_accessor_GLOBAL_8eb4cd83130a11a0: function() {
|
|
2781
|
+
const ret = typeof global === "undefined" ? null : global;
|
|
2782
|
+
return isLikeNone(ret) ? 0 : addHeapObject(ret);
|
|
2783
|
+
},
|
|
2784
|
+
__wbg_static_accessor_GLOBAL_THIS_1e7044f654e934db: function() {
|
|
2785
|
+
const ret = typeof globalThis === "undefined" ? null : globalThis;
|
|
2786
|
+
return isLikeNone(ret) ? 0 : addHeapObject(ret);
|
|
2787
|
+
},
|
|
2788
|
+
__wbg_static_accessor_SELF_d8b50611246a6d92: function() {
|
|
2789
|
+
const ret = typeof self === "undefined" ? null : self;
|
|
2790
|
+
return isLikeNone(ret) ? 0 : addHeapObject(ret);
|
|
2791
|
+
},
|
|
2792
|
+
__wbg_static_accessor_WINDOW_fd0bc376bf0f8b42: function() {
|
|
2793
|
+
const ret = typeof window === "undefined" ? null : window;
|
|
2794
|
+
return isLikeNone(ret) ? 0 : addHeapObject(ret);
|
|
2795
|
+
},
|
|
2796
|
+
__wbg_status_88ccc72fe7bea621: function(arg0) {
|
|
2797
|
+
const ret = getObject(arg0).status;
|
|
2798
|
+
return ret;
|
|
2799
|
+
},
|
|
2800
|
+
__wbg_stringify_54b3d9b61602aee6: function() {
|
|
2801
|
+
return handleError(function(arg0) {
|
|
2802
|
+
const ret = JSON.stringify(getObject(arg0));
|
|
2803
|
+
return addHeapObject(ret);
|
|
2804
|
+
}, arguments);
|
|
2805
|
+
},
|
|
2806
|
+
__wbg_subarray_1daff70dde20c145: function(arg0, arg1, arg2) {
|
|
2807
|
+
const ret = getObject(arg0).subarray(arg1 >>> 0, arg2 >>> 0);
|
|
2808
|
+
return addHeapObject(ret);
|
|
2809
|
+
},
|
|
2810
|
+
__wbg_then_7a850dae4493f353: function(arg0, arg1, arg2) {
|
|
2811
|
+
const ret = getObject(arg0).then(getObject(arg1), getObject(arg2));
|
|
2812
|
+
return addHeapObject(ret);
|
|
2813
|
+
},
|
|
2814
|
+
__wbg_then_b830475380919203: function(arg0, arg1) {
|
|
2815
|
+
const ret = getObject(arg0).then(getObject(arg1));
|
|
2816
|
+
return addHeapObject(ret);
|
|
2817
|
+
},
|
|
2818
|
+
__wbg_toString_794a30e85c994f2a: function(arg0) {
|
|
2819
|
+
const ret = getObject(arg0).toString();
|
|
2820
|
+
return addHeapObject(ret);
|
|
2821
|
+
},
|
|
2822
|
+
__wbg_trace_584ab86b20e4c341: function(arg0) {
|
|
2823
|
+
console.trace(...getObject(arg0));
|
|
2824
|
+
},
|
|
2825
|
+
__wbg_url_f1948b0d7f881e02: function(arg0, arg1) {
|
|
2826
|
+
const ret = getObject(arg1).url;
|
|
2827
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
2828
|
+
const len1 = WASM_VECTOR_LEN;
|
|
2829
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
2830
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
2831
|
+
},
|
|
2832
|
+
__wbg_value_c227f843d21da141: function(arg0) {
|
|
2833
|
+
const ret = getObject(arg0).value;
|
|
2834
|
+
return addHeapObject(ret);
|
|
2835
|
+
},
|
|
2836
|
+
__wbg_versions_276b2795b1c6a219: function(arg0) {
|
|
2837
|
+
const ret = getObject(arg0).versions;
|
|
2838
|
+
return addHeapObject(ret);
|
|
2839
|
+
},
|
|
2840
|
+
__wbg_view_d8c7b26e4d4650f1: function(arg0) {
|
|
2841
|
+
const ret = getObject(arg0).view;
|
|
2842
|
+
return isLikeNone(ret) ? 0 : addHeapObject(ret);
|
|
2843
|
+
},
|
|
2844
|
+
__wbg_warn_0bd6e4ae163b14e2: function(arg0) {
|
|
2845
|
+
console.warn(...getObject(arg0));
|
|
2846
|
+
},
|
|
2847
|
+
__wbindgen_generic_0000000000000001: function(arg0, arg1) {
|
|
2848
|
+
const ret = makeMutClosure(arg0, arg1, __wasm_bindgen_func_elem_8937);
|
|
2849
|
+
return addHeapObject(ret);
|
|
2850
|
+
},
|
|
2851
|
+
__wbindgen_generic_0000000000000002: function(arg0, arg1) {
|
|
2852
|
+
const ret = makeMutClosure(arg0, arg1, __wasm_bindgen_func_elem_12497);
|
|
2853
|
+
return addHeapObject(ret);
|
|
2854
|
+
},
|
|
2855
|
+
__wbindgen_generic_0000000000000003: function(arg0, arg1) {
|
|
2856
|
+
const ret = makeMutClosure(arg0, arg1, __wasm_bindgen_func_elem_8771);
|
|
2857
|
+
return addHeapObject(ret);
|
|
2858
|
+
},
|
|
2859
|
+
__wbindgen_generic_0000000000000004: function(arg0) {
|
|
2860
|
+
const ret = arg0;
|
|
2861
|
+
return addHeapObject(ret);
|
|
2862
|
+
},
|
|
2863
|
+
__wbindgen_generic_0000000000000005: function(arg0) {
|
|
2864
|
+
const ret = arg0;
|
|
2865
|
+
return addHeapObject(ret);
|
|
2866
|
+
},
|
|
2867
|
+
__wbindgen_generic_0000000000000006: function(arg0, arg1) {
|
|
2868
|
+
const ret = getArrayU8FromWasm0(arg0, arg1);
|
|
2869
|
+
return addHeapObject(ret);
|
|
2870
|
+
},
|
|
2871
|
+
__wbindgen_generic_0000000000000007: function(arg0, arg1) {
|
|
2872
|
+
const ret = getStringFromWasm0(arg0, arg1);
|
|
2873
|
+
return addHeapObject(ret);
|
|
2874
|
+
},
|
|
2875
|
+
__wbindgen_generic_0000000000000008: function(arg0) {
|
|
2876
|
+
const ret = BigInt.asUintN(64, arg0);
|
|
2877
|
+
return addHeapObject(ret);
|
|
2878
|
+
},
|
|
2879
|
+
__wbindgen_object_clone_ref: function(arg0) {
|
|
2880
|
+
const ret = getObject(arg0);
|
|
2881
|
+
return addHeapObject(ret);
|
|
2882
|
+
},
|
|
2883
|
+
__wbindgen_object_drop_ref: function(arg0) {
|
|
2884
|
+
takeObject(arg0);
|
|
2885
|
+
}
|
|
2886
|
+
};
|
|
2887
|
+
return {
|
|
2888
|
+
__proto__: null,
|
|
2889
|
+
"./cedarling_wasm_bg.js": import0
|
|
2890
|
+
};
|
|
2891
|
+
}
|
|
2892
|
+
function __wasm_bindgen_func_elem_8771(arg0, arg1) {
|
|
2893
|
+
wasm.__wasm_bindgen_func_elem_8771(arg0, arg1);
|
|
2894
|
+
}
|
|
2895
|
+
function __wasm_bindgen_func_elem_12497(arg0, arg1, arg2) {
|
|
2896
|
+
wasm.__wasm_bindgen_func_elem_12497(arg0, arg1, addHeapObject(arg2));
|
|
2897
|
+
}
|
|
2898
|
+
function __wasm_bindgen_func_elem_8992(arg0, arg1, arg2, arg3) {
|
|
2899
|
+
wasm.__wasm_bindgen_func_elem_8992(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
|
|
2900
|
+
}
|
|
2901
|
+
function __wasm_bindgen_func_elem_8937(arg0, arg1, arg2) {
|
|
2902
|
+
try {
|
|
2903
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
2904
|
+
wasm.__wasm_bindgen_func_elem_8937(retptr, arg0, arg1, addHeapObject(arg2));
|
|
2905
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
2906
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
2907
|
+
if (r1) {
|
|
2908
|
+
throw takeObject(r0);
|
|
2909
|
+
}
|
|
2910
|
+
} finally {
|
|
2911
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
2912
|
+
}
|
|
2913
|
+
}
|
|
2914
|
+
var __wbindgen_enum_ReadableStreamType = ["bytes"];
|
|
2915
|
+
var __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"];
|
|
2916
|
+
var __wbindgen_enum_RequestCache = ["default", "no-store", "reload", "no-cache", "force-cache", "only-if-cached"];
|
|
2917
|
+
var __wbindgen_enum_RequestCredentials = ["omit", "same-origin", "include"];
|
|
2918
|
+
var __wbindgen_enum_RequestMode = ["same-origin", "no-cors", "cors", "navigate"];
|
|
2919
|
+
var __wbindgen_enum_RequestRedirect = ["follow", "error", "manual"];
|
|
2920
|
+
var AuthorizeResultFinalization = typeof FinalizationRegistry === "undefined" ? { register: () => {
|
|
2921
|
+
}, unregister: () => {
|
|
2922
|
+
} } : new FinalizationRegistry((ptr) => wasm.__wbg_authorizeresult_free(ptr, 1));
|
|
2923
|
+
var AuthorizeResultResponseFinalization = typeof FinalizationRegistry === "undefined" ? { register: () => {
|
|
2924
|
+
}, unregister: () => {
|
|
2925
|
+
} } : new FinalizationRegistry((ptr) => wasm.__wbg_authorizeresultresponse_free(ptr, 1));
|
|
2926
|
+
var BatchAuthorizeMultiIssuerResponseFinalization = typeof FinalizationRegistry === "undefined" ? { register: () => {
|
|
2927
|
+
}, unregister: () => {
|
|
2928
|
+
} } : new FinalizationRegistry((ptr) => wasm.__wbg_batchauthorizemultiissuerresponse_free(ptr, 1));
|
|
2929
|
+
var BatchAuthorizeUnsignedResponseFinalization = typeof FinalizationRegistry === "undefined" ? { register: () => {
|
|
2930
|
+
}, unregister: () => {
|
|
2931
|
+
} } : new FinalizationRegistry((ptr) => wasm.__wbg_batchauthorizeunsignedresponse_free(ptr, 1));
|
|
2932
|
+
var BatchItemErrorFinalization = typeof FinalizationRegistry === "undefined" ? { register: () => {
|
|
2933
|
+
}, unregister: () => {
|
|
2934
|
+
} } : new FinalizationRegistry((ptr) => wasm.__wbg_batchitemerror_free(ptr, 1));
|
|
2935
|
+
var BatchItemMultiIssuerResultFinalization = typeof FinalizationRegistry === "undefined" ? { register: () => {
|
|
2936
|
+
}, unregister: () => {
|
|
2937
|
+
} } : new FinalizationRegistry((ptr) => wasm.__wbg_batchitemmultiissuerresult_free(ptr, 1));
|
|
2938
|
+
var BatchItemUnsignedResultFinalization = typeof FinalizationRegistry === "undefined" ? { register: () => {
|
|
2939
|
+
}, unregister: () => {
|
|
2940
|
+
} } : new FinalizationRegistry((ptr) => wasm.__wbg_batchitemunsignedresult_free(ptr, 1));
|
|
2941
|
+
var CedarlingFinalization = typeof FinalizationRegistry === "undefined" ? { register: () => {
|
|
2942
|
+
}, unregister: () => {
|
|
2943
|
+
} } : new FinalizationRegistry((ptr) => wasm.__wbg_cedarling_free(ptr, 1));
|
|
2944
|
+
var DataEntryFinalization = typeof FinalizationRegistry === "undefined" ? { register: () => {
|
|
2945
|
+
}, unregister: () => {
|
|
2946
|
+
} } : new FinalizationRegistry((ptr) => wasm.__wbg_dataentry_free(ptr, 1));
|
|
2947
|
+
var DataStoreStatsFinalization = typeof FinalizationRegistry === "undefined" ? { register: () => {
|
|
2948
|
+
}, unregister: () => {
|
|
2949
|
+
} } : new FinalizationRegistry((ptr) => wasm.__wbg_datastorestats_free(ptr, 1));
|
|
2950
|
+
var DiagnosticsFinalization = typeof FinalizationRegistry === "undefined" ? { register: () => {
|
|
2951
|
+
}, unregister: () => {
|
|
2952
|
+
} } : new FinalizationRegistry((ptr) => wasm.__wbg_diagnostics_free(ptr, 1));
|
|
2953
|
+
var IntoUnderlyingByteSourceFinalization = typeof FinalizationRegistry === "undefined" ? { register: () => {
|
|
2954
|
+
}, unregister: () => {
|
|
2955
|
+
} } : new FinalizationRegistry((ptr) => wasm.__wbg_intounderlyingbytesource_free(ptr, 1));
|
|
2956
|
+
var IntoUnderlyingSinkFinalization = typeof FinalizationRegistry === "undefined" ? { register: () => {
|
|
2957
|
+
}, unregister: () => {
|
|
2958
|
+
} } : new FinalizationRegistry((ptr) => wasm.__wbg_intounderlyingsink_free(ptr, 1));
|
|
2959
|
+
var IntoUnderlyingSourceFinalization = typeof FinalizationRegistry === "undefined" ? { register: () => {
|
|
2960
|
+
}, unregister: () => {
|
|
2961
|
+
} } : new FinalizationRegistry((ptr) => wasm.__wbg_intounderlyingsource_free(ptr, 1));
|
|
2962
|
+
var MetricsSnapshotFinalization = typeof FinalizationRegistry === "undefined" ? { register: () => {
|
|
2963
|
+
}, unregister: () => {
|
|
2964
|
+
} } : new FinalizationRegistry((ptr) => wasm.__wbg_metricssnapshot_free(ptr, 1));
|
|
2965
|
+
var MultiIssuerAuthorizeResultFinalization = typeof FinalizationRegistry === "undefined" ? { register: () => {
|
|
2966
|
+
}, unregister: () => {
|
|
2967
|
+
} } : new FinalizationRegistry((ptr) => wasm.__wbg_multiissuerauthorizeresult_free(ptr, 1));
|
|
2968
|
+
var PolicyEvaluationErrorFinalization = typeof FinalizationRegistry === "undefined" ? { register: () => {
|
|
2969
|
+
}, unregister: () => {
|
|
2970
|
+
} } : new FinalizationRegistry((ptr) => wasm.__wbg_policyevaluationerror_free(ptr, 1));
|
|
2971
|
+
function addHeapObject(obj) {
|
|
2972
|
+
if (heap_next === heap.length) heap.push(heap.length + 1);
|
|
2973
|
+
const idx = heap_next;
|
|
2974
|
+
heap_next = heap[idx];
|
|
2975
|
+
heap[idx] = obj;
|
|
2976
|
+
return idx;
|
|
2977
|
+
}
|
|
2978
|
+
function _assertClass(instance, klass) {
|
|
2979
|
+
if (!(instance instanceof klass)) {
|
|
2980
|
+
throw new Error(`expected instance of ${klass.name}`);
|
|
2981
|
+
}
|
|
2982
|
+
}
|
|
2983
|
+
var CLOSURE_DTORS = typeof FinalizationRegistry === "undefined" ? { register: () => {
|
|
2984
|
+
}, unregister: () => {
|
|
2985
|
+
} } : new FinalizationRegistry((state) => wasm.__wbindgen_export4(state.a, state.b));
|
|
2986
|
+
function debugString(val) {
|
|
2987
|
+
const type = typeof val;
|
|
2988
|
+
if (type == "number" || type == "boolean" || val == null) {
|
|
2989
|
+
return `${val}`;
|
|
2990
|
+
}
|
|
2991
|
+
if (type == "string") {
|
|
2992
|
+
return `"${val}"`;
|
|
2993
|
+
}
|
|
2994
|
+
if (type == "symbol") {
|
|
2995
|
+
const description = val.description;
|
|
2996
|
+
if (description == null) {
|
|
2997
|
+
return "Symbol";
|
|
2998
|
+
} else {
|
|
2999
|
+
return `Symbol(${description})`;
|
|
3000
|
+
}
|
|
3001
|
+
}
|
|
3002
|
+
if (type == "function") {
|
|
3003
|
+
const name = val.name;
|
|
3004
|
+
if (typeof name == "string" && name.length > 0) {
|
|
3005
|
+
return `Function(${name})`;
|
|
3006
|
+
} else {
|
|
3007
|
+
return "Function";
|
|
3008
|
+
}
|
|
3009
|
+
}
|
|
3010
|
+
if (Array.isArray(val)) {
|
|
3011
|
+
const length = val.length;
|
|
3012
|
+
let debug = "[";
|
|
3013
|
+
if (length > 0) {
|
|
3014
|
+
debug += debugString(val[0]);
|
|
3015
|
+
}
|
|
3016
|
+
for (let i = 1; i < length; i++) {
|
|
3017
|
+
debug += ", " + debugString(val[i]);
|
|
3018
|
+
}
|
|
3019
|
+
debug += "]";
|
|
3020
|
+
return debug;
|
|
3021
|
+
}
|
|
3022
|
+
const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
|
|
3023
|
+
let className;
|
|
3024
|
+
if (builtInMatches && builtInMatches.length > 1) {
|
|
3025
|
+
className = builtInMatches[1];
|
|
3026
|
+
} else {
|
|
3027
|
+
return toString.call(val);
|
|
3028
|
+
}
|
|
3029
|
+
if (className == "Object") {
|
|
3030
|
+
try {
|
|
3031
|
+
return "Object(" + JSON.stringify(val) + ")";
|
|
3032
|
+
} catch (_) {
|
|
3033
|
+
return "Object";
|
|
3034
|
+
}
|
|
3035
|
+
}
|
|
3036
|
+
if (val instanceof Error) {
|
|
3037
|
+
return `${val.name}: ${val.message}
|
|
3038
|
+
${val.stack}`;
|
|
3039
|
+
}
|
|
3040
|
+
return className;
|
|
3041
|
+
}
|
|
3042
|
+
function dropObject(idx) {
|
|
3043
|
+
if (idx < 1028) return;
|
|
3044
|
+
heap[idx] = heap_next;
|
|
3045
|
+
heap_next = idx;
|
|
3046
|
+
}
|
|
3047
|
+
function getArrayJsValueFromWasm0(ptr, len) {
|
|
3048
|
+
ptr = ptr >>> 0;
|
|
3049
|
+
const mem = getDataViewMemory0();
|
|
3050
|
+
const result = [];
|
|
3051
|
+
for (let i = ptr; i < ptr + 4 * len; i += 4) {
|
|
3052
|
+
result.push(takeObject(mem.getUint32(i, true)));
|
|
3053
|
+
}
|
|
3054
|
+
return result;
|
|
3055
|
+
}
|
|
3056
|
+
function getArrayU8FromWasm0(ptr, len) {
|
|
3057
|
+
ptr = ptr >>> 0;
|
|
3058
|
+
return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
|
|
3059
|
+
}
|
|
3060
|
+
var cachedDataViewMemory0 = null;
|
|
3061
|
+
function getDataViewMemory0() {
|
|
3062
|
+
if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || cachedDataViewMemory0.buffer.detached === void 0 && cachedDataViewMemory0.buffer !== wasm.memory.buffer) {
|
|
3063
|
+
cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
|
|
3064
|
+
}
|
|
3065
|
+
return cachedDataViewMemory0;
|
|
3066
|
+
}
|
|
3067
|
+
function getStringFromWasm0(ptr, len) {
|
|
3068
|
+
return decodeText(ptr >>> 0, len);
|
|
3069
|
+
}
|
|
3070
|
+
var cachedUint8ArrayMemory0 = null;
|
|
3071
|
+
function getUint8ArrayMemory0() {
|
|
3072
|
+
if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
|
|
3073
|
+
cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
|
|
3074
|
+
}
|
|
3075
|
+
return cachedUint8ArrayMemory0;
|
|
3076
|
+
}
|
|
3077
|
+
function getObject(idx) {
|
|
3078
|
+
return heap[idx];
|
|
3079
|
+
}
|
|
3080
|
+
function handleError(f, args) {
|
|
3081
|
+
try {
|
|
3082
|
+
return f.apply(this, args);
|
|
3083
|
+
} catch (e) {
|
|
3084
|
+
wasm.__wbindgen_export3(addHeapObject(e));
|
|
3085
|
+
}
|
|
3086
|
+
}
|
|
3087
|
+
var heap = new Array(1024).fill(void 0);
|
|
3088
|
+
heap.push(void 0, null, true, false);
|
|
3089
|
+
var heap_next = heap.length;
|
|
3090
|
+
function isLikeNone(x) {
|
|
3091
|
+
return x === void 0 || x === null;
|
|
3092
|
+
}
|
|
3093
|
+
function makeMutClosure(arg0, arg1, f) {
|
|
3094
|
+
const state = { a: arg0, b: arg1, cnt: 1 };
|
|
3095
|
+
const real = (...args) => {
|
|
3096
|
+
state.cnt++;
|
|
3097
|
+
const a = state.a;
|
|
3098
|
+
state.a = 0;
|
|
3099
|
+
try {
|
|
3100
|
+
return f(a, state.b, ...args);
|
|
3101
|
+
} finally {
|
|
3102
|
+
state.a = a;
|
|
3103
|
+
real._wbg_cb_unref();
|
|
3104
|
+
}
|
|
3105
|
+
};
|
|
3106
|
+
real._wbg_cb_unref = () => {
|
|
3107
|
+
if (--state.cnt === 0) {
|
|
3108
|
+
wasm.__wbindgen_export4(state.a, state.b);
|
|
3109
|
+
state.a = 0;
|
|
3110
|
+
CLOSURE_DTORS.unregister(state);
|
|
3111
|
+
}
|
|
3112
|
+
};
|
|
3113
|
+
CLOSURE_DTORS.register(real, state, state);
|
|
3114
|
+
return real;
|
|
3115
|
+
}
|
|
3116
|
+
function passArrayJsValueToWasm0(array, malloc) {
|
|
3117
|
+
const ptr = malloc(array.length * 4, 4) >>> 0;
|
|
3118
|
+
const mem = getDataViewMemory0();
|
|
3119
|
+
for (let i = 0; i < array.length; i++) {
|
|
3120
|
+
mem.setUint32(ptr + 4 * i, addHeapObject(array[i]), true);
|
|
3121
|
+
}
|
|
3122
|
+
WASM_VECTOR_LEN = array.length;
|
|
3123
|
+
return ptr;
|
|
3124
|
+
}
|
|
3125
|
+
function passStringToWasm0(arg, malloc, realloc) {
|
|
3126
|
+
if (realloc === void 0) {
|
|
3127
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
3128
|
+
const ptr2 = malloc(buf.length, 1) >>> 0;
|
|
3129
|
+
getUint8ArrayMemory0().subarray(ptr2, ptr2 + buf.length).set(buf);
|
|
3130
|
+
WASM_VECTOR_LEN = buf.length;
|
|
3131
|
+
return ptr2;
|
|
3132
|
+
}
|
|
3133
|
+
let len = arg.length;
|
|
3134
|
+
let ptr = malloc(len, 1) >>> 0;
|
|
3135
|
+
const mem = getUint8ArrayMemory0();
|
|
3136
|
+
let offset = 0;
|
|
3137
|
+
for (; offset < len; offset++) {
|
|
3138
|
+
const code = arg.charCodeAt(offset);
|
|
3139
|
+
if (code > 127) break;
|
|
3140
|
+
mem[ptr + offset] = code;
|
|
3141
|
+
}
|
|
3142
|
+
if (offset !== len) {
|
|
3143
|
+
if (offset !== 0) {
|
|
3144
|
+
arg = arg.slice(offset);
|
|
3145
|
+
}
|
|
3146
|
+
ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
|
|
3147
|
+
const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
|
|
3148
|
+
const ret = cachedTextEncoder.encodeInto(arg, view);
|
|
3149
|
+
offset += ret.written;
|
|
3150
|
+
ptr = realloc(ptr, len, offset, 1) >>> 0;
|
|
3151
|
+
}
|
|
3152
|
+
WASM_VECTOR_LEN = offset;
|
|
3153
|
+
return ptr;
|
|
3154
|
+
}
|
|
3155
|
+
function takeObject(idx) {
|
|
3156
|
+
const ret = getObject(idx);
|
|
3157
|
+
dropObject(idx);
|
|
3158
|
+
return ret;
|
|
3159
|
+
}
|
|
3160
|
+
var cachedTextDecoder = new TextDecoder("utf-8", { ignoreBOM: true, fatal: true });
|
|
3161
|
+
cachedTextDecoder.decode();
|
|
3162
|
+
var MAX_SAFARI_DECODE_BYTES = 2146435072;
|
|
3163
|
+
var numBytesDecoded = 0;
|
|
3164
|
+
function decodeText(ptr, len) {
|
|
3165
|
+
numBytesDecoded += len;
|
|
3166
|
+
if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
|
|
3167
|
+
cachedTextDecoder = new TextDecoder("utf-8", { ignoreBOM: true, fatal: true });
|
|
3168
|
+
cachedTextDecoder.decode();
|
|
3169
|
+
numBytesDecoded = len;
|
|
3170
|
+
}
|
|
3171
|
+
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
3172
|
+
}
|
|
3173
|
+
var cachedTextEncoder = new TextEncoder();
|
|
3174
|
+
if (!("encodeInto" in cachedTextEncoder)) {
|
|
3175
|
+
cachedTextEncoder.encodeInto = function(arg, view) {
|
|
3176
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
3177
|
+
view.set(buf);
|
|
3178
|
+
return {
|
|
3179
|
+
read: arg.length,
|
|
3180
|
+
written: buf.length
|
|
3181
|
+
};
|
|
3182
|
+
};
|
|
3183
|
+
}
|
|
3184
|
+
var WASM_VECTOR_LEN = 0;
|
|
3185
|
+
var wasmModule;
|
|
3186
|
+
var wasmInstance;
|
|
3187
|
+
var wasm;
|
|
3188
|
+
function __wbg_finalize_init(instance, module2) {
|
|
3189
|
+
wasmInstance = instance;
|
|
3190
|
+
wasm = instance.exports;
|
|
3191
|
+
wasmModule = module2;
|
|
3192
|
+
cachedDataViewMemory0 = null;
|
|
3193
|
+
cachedUint8ArrayMemory0 = null;
|
|
3194
|
+
return wasm;
|
|
3195
|
+
}
|
|
3196
|
+
async function __wbg_load(module2, imports) {
|
|
3197
|
+
if (typeof Response === "function" && module2 instanceof Response) {
|
|
3198
|
+
if (!module2.ok) {
|
|
3199
|
+
throw new Error(`failed to fetch Wasm: ${module2.status} ${module2.statusText} fetching '${module2.url}'`);
|
|
3200
|
+
}
|
|
3201
|
+
if (typeof WebAssembly.instantiateStreaming === "function") {
|
|
3202
|
+
try {
|
|
3203
|
+
return await WebAssembly.instantiateStreaming(module2, imports);
|
|
3204
|
+
} catch (e) {
|
|
3205
|
+
const validResponse = expectedResponseType(module2.type);
|
|
3206
|
+
if (validResponse && module2.headers.get("Content-Type") !== "application/wasm") {
|
|
3207
|
+
console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n", e);
|
|
3208
|
+
} else {
|
|
3209
|
+
throw e;
|
|
3210
|
+
}
|
|
3211
|
+
}
|
|
3212
|
+
}
|
|
3213
|
+
const bytes = await module2.arrayBuffer();
|
|
3214
|
+
return await WebAssembly.instantiate(bytes, imports);
|
|
3215
|
+
} else {
|
|
3216
|
+
const instance = await WebAssembly.instantiate(module2, imports);
|
|
3217
|
+
if (instance instanceof WebAssembly.Instance) {
|
|
3218
|
+
return { instance, module: module2 };
|
|
3219
|
+
} else {
|
|
3220
|
+
return instance;
|
|
3221
|
+
}
|
|
3222
|
+
}
|
|
3223
|
+
function expectedResponseType(type) {
|
|
3224
|
+
switch (type) {
|
|
3225
|
+
case "basic":
|
|
3226
|
+
case "cors":
|
|
3227
|
+
case "default":
|
|
3228
|
+
return true;
|
|
3229
|
+
}
|
|
3230
|
+
return false;
|
|
3231
|
+
}
|
|
3232
|
+
}
|
|
3233
|
+
function initSync(module2) {
|
|
3234
|
+
if (wasm !== void 0) return wasm;
|
|
3235
|
+
if (module2 !== void 0) {
|
|
3236
|
+
if (Object.getPrototypeOf(module2) === Object.prototype) {
|
|
3237
|
+
({ module: module2 } = module2);
|
|
3238
|
+
} else {
|
|
3239
|
+
console.warn("using deprecated parameters for `initSync()`; pass a single object instead");
|
|
3240
|
+
}
|
|
3241
|
+
}
|
|
3242
|
+
const imports = __wbg_get_imports();
|
|
3243
|
+
if (!(module2 instanceof WebAssembly.Module)) {
|
|
3244
|
+
try {
|
|
3245
|
+
WebAssembly.Module.exports(module2);
|
|
3246
|
+
} catch {
|
|
3247
|
+
module2 = new WebAssembly.Module(module2);
|
|
3248
|
+
}
|
|
3249
|
+
}
|
|
3250
|
+
const instance = new WebAssembly.Instance(module2, imports);
|
|
3251
|
+
return __wbg_finalize_init(instance, module2);
|
|
3252
|
+
}
|
|
3253
|
+
async function __wbg_init(module_or_path) {
|
|
3254
|
+
if (wasm !== void 0) return wasm;
|
|
3255
|
+
if (module_or_path !== void 0) {
|
|
3256
|
+
if (Object.getPrototypeOf(module_or_path) === Object.prototype) {
|
|
3257
|
+
({ module_or_path } = module_or_path);
|
|
3258
|
+
} else {
|
|
3259
|
+
console.warn("using deprecated parameters for the initialization function; pass a single object instead");
|
|
3260
|
+
}
|
|
3261
|
+
}
|
|
3262
|
+
if (module_or_path === void 0) {
|
|
3263
|
+
module_or_path = new URL("cedarling_wasm_bg.wasm", import.meta.url);
|
|
3264
|
+
}
|
|
3265
|
+
const imports = __wbg_get_imports();
|
|
3266
|
+
if (typeof module_or_path === "string" || typeof Request === "function" && module_or_path instanceof Request || typeof URL === "function" && module_or_path instanceof URL) {
|
|
3267
|
+
module_or_path = fetch(module_or_path);
|
|
3268
|
+
}
|
|
3269
|
+
const { instance, module: module2 } = await __wbg_load(await module_or_path, imports);
|
|
3270
|
+
return __wbg_finalize_init(instance, module2);
|
|
3271
|
+
}
|
|
3272
|
+
|
|
3273
|
+
// cedarling:wasm-file
|
|
3274
|
+
import { readFile } from "node:fs/promises";
|
|
3275
|
+
var wasmUrl = new URL("../wasm/cedarling_wasm_bg.wasm", import.meta.url);
|
|
3276
|
+
var wasm_file_default = () => readFile(wasmUrl);
|
|
3277
|
+
|
|
3278
|
+
// .build/src/runtime.js
|
|
3279
|
+
function createRuntime(loadModule, initializeInput) {
|
|
3280
|
+
let initialized;
|
|
3281
|
+
function initialize(operation) {
|
|
3282
|
+
if (initialized === void 0) {
|
|
3283
|
+
const attempt = operation().catch((error) => {
|
|
3284
|
+
if (initialized === attempt)
|
|
3285
|
+
initialized = void 0;
|
|
3286
|
+
throw error;
|
|
3287
|
+
});
|
|
3288
|
+
initialized = attempt;
|
|
3289
|
+
}
|
|
3290
|
+
return initialized;
|
|
3291
|
+
}
|
|
3292
|
+
function initWasm2(input) {
|
|
3293
|
+
const moduleOrPath = input !== void 0 && typeof input === "object" && input !== null && "module_or_path" in input ? input.module_or_path : input;
|
|
3294
|
+
return initialize(() => {
|
|
3295
|
+
if (moduleOrPath === void 0) {
|
|
3296
|
+
return loadModule().then((module2) => initSync({ module: module2 }));
|
|
3297
|
+
}
|
|
3298
|
+
if (initializeInput === void 0) {
|
|
3299
|
+
throw new TypeError("Cedarling edge initialization accepts no input");
|
|
3300
|
+
}
|
|
3301
|
+
return initializeInput(moduleOrPath);
|
|
3302
|
+
});
|
|
3303
|
+
}
|
|
3304
|
+
function initSync3(input) {
|
|
3305
|
+
const output = initSync(input);
|
|
3306
|
+
initialized = Promise.resolve(output);
|
|
3307
|
+
return output;
|
|
3308
|
+
}
|
|
3309
|
+
return Object.freeze({
|
|
3310
|
+
initWasm: initWasm2,
|
|
3311
|
+
initSync: initSync3,
|
|
3312
|
+
async init(config) {
|
|
3313
|
+
await initWasm2();
|
|
3314
|
+
return init(config);
|
|
3315
|
+
},
|
|
3316
|
+
async initFromArchiveBytes(config, archiveBytes) {
|
|
3317
|
+
await initWasm2();
|
|
3318
|
+
return initFromArchiveBytes(config, archiveBytes);
|
|
3319
|
+
}
|
|
3320
|
+
});
|
|
3321
|
+
}
|
|
3322
|
+
|
|
3323
|
+
// .build/src/node.js
|
|
3324
|
+
var cedarling = createRuntime(async () => {
|
|
3325
|
+
const bytes = await wasm_file_default();
|
|
3326
|
+
const copy = new Uint8Array(bytes.byteLength);
|
|
3327
|
+
copy.set(bytes);
|
|
3328
|
+
return WebAssembly.compile(copy);
|
|
3329
|
+
}, __wbg_init);
|
|
3330
|
+
var init2 = cedarling.init;
|
|
3331
|
+
var initSync2 = cedarling.initSync;
|
|
3332
|
+
var initWasm = cedarling.initWasm;
|
|
3333
|
+
var initFromArchiveBytes2 = cedarling.initFromArchiveBytes;
|
|
3334
|
+
export {
|
|
3335
|
+
initWasm as default,
|
|
3336
|
+
init2 as init,
|
|
3337
|
+
initFromArchiveBytes2 as initFromArchiveBytes,
|
|
3338
|
+
initSync2 as initSync,
|
|
3339
|
+
initWasm
|
|
3340
|
+
};
|
|
3341
|
+
//# sourceMappingURL=index.js.map
|