@janssenproject/cedarling_wasm 0.0.310-nodejs → 0.0.311
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cedarling_wasm.d.ts +97 -0
- package/cedarling_wasm.js +118 -32
- package/cedarling_wasm_bg.wasm +0 -0
- package/package.json +6 -2
package/cedarling_wasm.d.ts
CHANGED
|
@@ -234,3 +234,100 @@ export function init(config: any): Promise<Cedarling>;
|
|
|
234
234
|
* ```
|
|
235
235
|
*/
|
|
236
236
|
export function init_from_archive_bytes(config: any, archive_bytes: Uint8Array): Promise<Cedarling>;
|
|
237
|
+
|
|
238
|
+
export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
|
|
239
|
+
|
|
240
|
+
export interface InitOutput {
|
|
241
|
+
readonly memory: WebAssembly.Memory;
|
|
242
|
+
readonly __wbg_cedarling_free: (a: number, b: number) => void;
|
|
243
|
+
readonly __wbg_multiissuerauthorizeresult_free: (a: number, b: number) => void;
|
|
244
|
+
readonly __wbg_get_multiissuerauthorizeresult_response: (a: number) => number;
|
|
245
|
+
readonly __wbg_set_multiissuerauthorizeresult_response: (a: number, b: number) => void;
|
|
246
|
+
readonly __wbg_get_multiissuerauthorizeresult_decision: (a: number) => number;
|
|
247
|
+
readonly __wbg_set_multiissuerauthorizeresult_decision: (a: number, b: number) => void;
|
|
248
|
+
readonly __wbg_get_multiissuerauthorizeresult_request_id: (a: number) => [number, number];
|
|
249
|
+
readonly __wbg_set_multiissuerauthorizeresult_request_id: (a: number, b: number, c: number) => void;
|
|
250
|
+
readonly multiissuerauthorizeresult_json_string: (a: number) => [number, number];
|
|
251
|
+
readonly init: (a: any) => any;
|
|
252
|
+
readonly init_from_archive_bytes: (a: any, b: any) => any;
|
|
253
|
+
readonly cedarling_new: (a: any) => any;
|
|
254
|
+
readonly cedarling_new_from_map: (a: any) => any;
|
|
255
|
+
readonly cedarling_authorize: (a: number, b: any) => any;
|
|
256
|
+
readonly cedarling_authorize_unsigned: (a: number, b: any) => any;
|
|
257
|
+
readonly cedarling_authorize_multi_issuer: (a: number, b: any) => any;
|
|
258
|
+
readonly cedarling_pop_logs: (a: number) => [number, number, number];
|
|
259
|
+
readonly cedarling_get_log_by_id: (a: number, b: number, c: number) => [number, number, number];
|
|
260
|
+
readonly cedarling_get_log_ids: (a: number) => any;
|
|
261
|
+
readonly cedarling_get_logs_by_tag: (a: number, b: number, c: number) => [number, number, number, number];
|
|
262
|
+
readonly cedarling_get_logs_by_request_id: (a: number, b: number, c: number) => [number, number, number, number];
|
|
263
|
+
readonly cedarling_get_logs_by_request_id_and_tag: (a: number, b: number, c: number, d: number, e: number) => [number, number, number, number];
|
|
264
|
+
readonly cedarling_shut_down: (a: number) => any;
|
|
265
|
+
readonly __wbg_authorizeresult_free: (a: number, b: number) => void;
|
|
266
|
+
readonly __wbg_get_authorizeresult_workload: (a: number) => number;
|
|
267
|
+
readonly __wbg_set_authorizeresult_workload: (a: number, b: number) => void;
|
|
268
|
+
readonly __wbg_get_authorizeresult_person: (a: number) => number;
|
|
269
|
+
readonly __wbg_set_authorizeresult_person: (a: number, b: number) => void;
|
|
270
|
+
readonly __wbg_get_authorizeresult_decision: (a: number) => number;
|
|
271
|
+
readonly __wbg_set_authorizeresult_decision: (a: number, b: number) => void;
|
|
272
|
+
readonly __wbg_get_authorizeresult_request_id: (a: number) => [number, number];
|
|
273
|
+
readonly __wbg_set_authorizeresult_request_id: (a: number, b: number, c: number) => void;
|
|
274
|
+
readonly authorizeresult_json_string: (a: number) => [number, number];
|
|
275
|
+
readonly authorizeresult_principal: (a: number, b: number, c: number) => number;
|
|
276
|
+
readonly __wbg_authorizeresultresponse_free: (a: number, b: number) => void;
|
|
277
|
+
readonly authorizeresultresponse_decision: (a: number) => number;
|
|
278
|
+
readonly authorizeresultresponse_diagnostics: (a: number) => number;
|
|
279
|
+
readonly __wbg_diagnostics_free: (a: number, b: number) => void;
|
|
280
|
+
readonly diagnostics_reason: (a: number) => [number, number];
|
|
281
|
+
readonly diagnostics_errors: (a: number) => [number, number];
|
|
282
|
+
readonly __wbg_policyevaluationerror_free: (a: number, b: number) => void;
|
|
283
|
+
readonly policyevaluationerror_id: (a: number) => [number, number];
|
|
284
|
+
readonly policyevaluationerror_error: (a: number) => [number, number];
|
|
285
|
+
readonly rust_zstd_wasm_shim_qsort: (a: number, b: number, c: number, d: number) => void;
|
|
286
|
+
readonly rust_zstd_wasm_shim_malloc: (a: number) => number;
|
|
287
|
+
readonly rust_zstd_wasm_shim_memcmp: (a: number, b: number, c: number) => number;
|
|
288
|
+
readonly rust_zstd_wasm_shim_calloc: (a: number, b: number) => number;
|
|
289
|
+
readonly rust_zstd_wasm_shim_free: (a: number) => void;
|
|
290
|
+
readonly rust_zstd_wasm_shim_memcpy: (a: number, b: number, c: number) => number;
|
|
291
|
+
readonly rust_zstd_wasm_shim_memmove: (a: number, b: number, c: number) => number;
|
|
292
|
+
readonly rust_zstd_wasm_shim_memset: (a: number, b: number, c: number) => number;
|
|
293
|
+
readonly __wbg_jsjsonlogic_free: (a: number, b: number) => void;
|
|
294
|
+
readonly jsjsonlogic_new: () => number;
|
|
295
|
+
readonly jsjsonlogic_apply: (a: number, b: any, c: any) => [number, number, number];
|
|
296
|
+
readonly ring_core_0_17_14__bn_mul_mont: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
297
|
+
readonly wasm_bindgen__closure__destroy__h81df99cf5fb23bb4: (a: number, b: number) => void;
|
|
298
|
+
readonly wasm_bindgen__closure__destroy__he589cbad438baf01: (a: number, b: number) => void;
|
|
299
|
+
readonly wasm_bindgen__convert__closures_____invoke__h5ea28dde88fe4fc5: (a: number, b: number, c: any, d: any) => void;
|
|
300
|
+
readonly wasm_bindgen__convert__closures_____invoke__h30e9622b2b4b0718: (a: number, b: number, c: any) => void;
|
|
301
|
+
readonly wasm_bindgen__convert__closures_____invoke__h06cf10571db3fb4b: (a: number, b: number) => void;
|
|
302
|
+
readonly __wbindgen_malloc: (a: number, b: number) => number;
|
|
303
|
+
readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|
|
304
|
+
readonly __wbindgen_exn_store: (a: number) => void;
|
|
305
|
+
readonly __externref_table_alloc: () => number;
|
|
306
|
+
readonly __wbindgen_externrefs: WebAssembly.Table;
|
|
307
|
+
readonly __wbindgen_free: (a: number, b: number, c: number) => void;
|
|
308
|
+
readonly __externref_table_dealloc: (a: number) => void;
|
|
309
|
+
readonly __externref_drop_slice: (a: number, b: number) => void;
|
|
310
|
+
readonly __wbindgen_start: () => void;
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
export type SyncInitInput = BufferSource | WebAssembly.Module;
|
|
314
|
+
|
|
315
|
+
/**
|
|
316
|
+
* Instantiates the given `module`, which can either be bytes or
|
|
317
|
+
* a precompiled `WebAssembly.Module`.
|
|
318
|
+
*
|
|
319
|
+
* @param {{ module: SyncInitInput }} module - Passing `SyncInitInput` directly is deprecated.
|
|
320
|
+
*
|
|
321
|
+
* @returns {InitOutput}
|
|
322
|
+
*/
|
|
323
|
+
export function initSync(module: { module: SyncInitInput } | SyncInitInput): InitOutput;
|
|
324
|
+
|
|
325
|
+
/**
|
|
326
|
+
* If `module_or_path` is {RequestInfo} or {URL}, makes a request and
|
|
327
|
+
* for everything else, calls `WebAssembly.instantiate` directly.
|
|
328
|
+
*
|
|
329
|
+
* @param {{ module_or_path: InitInput | Promise<InitInput> }} module_or_path - Passing `InitInput` directly is deprecated.
|
|
330
|
+
*
|
|
331
|
+
* @returns {Promise<InitOutput>}
|
|
332
|
+
*/
|
|
333
|
+
export default function __wbg_init (module_or_path?: { module_or_path: InitInput | Promise<InitInput> } | InitInput | Promise<InitInput>): Promise<InitOutput>;
|
package/cedarling_wasm.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* A WASM wrapper for the Rust `cedarling::AuthorizeResult` struct.
|
|
5
5
|
* Represents the result of an authorization request.
|
|
6
6
|
*/
|
|
7
|
-
class AuthorizeResult {
|
|
7
|
+
export class AuthorizeResult {
|
|
8
8
|
static __wrap(ptr) {
|
|
9
9
|
ptr = ptr >>> 0;
|
|
10
10
|
const obj = Object.create(AuthorizeResult.prototype);
|
|
@@ -138,13 +138,12 @@ class AuthorizeResult {
|
|
|
138
138
|
}
|
|
139
139
|
}
|
|
140
140
|
if (Symbol.dispose) AuthorizeResult.prototype[Symbol.dispose] = AuthorizeResult.prototype.free;
|
|
141
|
-
exports.AuthorizeResult = AuthorizeResult;
|
|
142
141
|
|
|
143
142
|
/**
|
|
144
143
|
* A WASM wrapper for the Rust `cedar_policy::Response` struct.
|
|
145
144
|
* Represents the result of an authorization request.
|
|
146
145
|
*/
|
|
147
|
-
class AuthorizeResultResponse {
|
|
146
|
+
export class AuthorizeResultResponse {
|
|
148
147
|
static __wrap(ptr) {
|
|
149
148
|
ptr = ptr >>> 0;
|
|
150
149
|
const obj = Object.create(AuthorizeResultResponse.prototype);
|
|
@@ -180,12 +179,11 @@ class AuthorizeResultResponse {
|
|
|
180
179
|
}
|
|
181
180
|
}
|
|
182
181
|
if (Symbol.dispose) AuthorizeResultResponse.prototype[Symbol.dispose] = AuthorizeResultResponse.prototype.free;
|
|
183
|
-
exports.AuthorizeResultResponse = AuthorizeResultResponse;
|
|
184
182
|
|
|
185
183
|
/**
|
|
186
184
|
* The instance of the Cedarling application.
|
|
187
185
|
*/
|
|
188
|
-
class Cedarling {
|
|
186
|
+
export class Cedarling {
|
|
189
187
|
static __wrap(ptr) {
|
|
190
188
|
ptr = ptr >>> 0;
|
|
191
189
|
const obj = Object.create(Cedarling.prototype);
|
|
@@ -354,7 +352,6 @@ class Cedarling {
|
|
|
354
352
|
}
|
|
355
353
|
}
|
|
356
354
|
if (Symbol.dispose) Cedarling.prototype[Symbol.dispose] = Cedarling.prototype.free;
|
|
357
|
-
exports.Cedarling = Cedarling;
|
|
358
355
|
|
|
359
356
|
/**
|
|
360
357
|
* Diagnostics
|
|
@@ -362,7 +359,7 @@ exports.Cedarling = Cedarling;
|
|
|
362
359
|
*
|
|
363
360
|
* Provides detailed information about how a policy decision was made, including policies that contributed to the decision and any errors encountered during evaluation.
|
|
364
361
|
*/
|
|
365
|
-
class Diagnostics {
|
|
362
|
+
export class Diagnostics {
|
|
366
363
|
static __wrap(ptr) {
|
|
367
364
|
ptr = ptr >>> 0;
|
|
368
365
|
const obj = Object.create(Diagnostics.prototype);
|
|
@@ -406,9 +403,8 @@ class Diagnostics {
|
|
|
406
403
|
}
|
|
407
404
|
}
|
|
408
405
|
if (Symbol.dispose) Diagnostics.prototype[Symbol.dispose] = Diagnostics.prototype.free;
|
|
409
|
-
exports.Diagnostics = Diagnostics;
|
|
410
406
|
|
|
411
|
-
class JsJsonLogic {
|
|
407
|
+
export class JsJsonLogic {
|
|
412
408
|
__destroy_into_raw() {
|
|
413
409
|
const ptr = this.__wbg_ptr;
|
|
414
410
|
this.__wbg_ptr = 0;
|
|
@@ -439,13 +435,12 @@ class JsJsonLogic {
|
|
|
439
435
|
}
|
|
440
436
|
}
|
|
441
437
|
if (Symbol.dispose) JsJsonLogic.prototype[Symbol.dispose] = JsJsonLogic.prototype.free;
|
|
442
|
-
exports.JsJsonLogic = JsJsonLogic;
|
|
443
438
|
|
|
444
439
|
/**
|
|
445
440
|
* A WASM wrapper for the Rust `cedarling::MultiIssuerAuthorizeResult` struct.
|
|
446
441
|
* Represents the result of a multi-issuer authorization request.
|
|
447
442
|
*/
|
|
448
|
-
class MultiIssuerAuthorizeResult {
|
|
443
|
+
export class MultiIssuerAuthorizeResult {
|
|
449
444
|
static __wrap(ptr) {
|
|
450
445
|
ptr = ptr >>> 0;
|
|
451
446
|
const obj = Object.create(MultiIssuerAuthorizeResult.prototype);
|
|
@@ -542,7 +537,6 @@ class MultiIssuerAuthorizeResult {
|
|
|
542
537
|
}
|
|
543
538
|
}
|
|
544
539
|
if (Symbol.dispose) MultiIssuerAuthorizeResult.prototype[Symbol.dispose] = MultiIssuerAuthorizeResult.prototype.free;
|
|
545
|
-
exports.MultiIssuerAuthorizeResult = MultiIssuerAuthorizeResult;
|
|
546
540
|
|
|
547
541
|
/**
|
|
548
542
|
* PolicyEvaluationError
|
|
@@ -550,7 +544,7 @@ exports.MultiIssuerAuthorizeResult = MultiIssuerAuthorizeResult;
|
|
|
550
544
|
*
|
|
551
545
|
* Represents an error that occurred when evaluating a Cedar policy.
|
|
552
546
|
*/
|
|
553
|
-
class PolicyEvaluationError {
|
|
547
|
+
export class PolicyEvaluationError {
|
|
554
548
|
static __wrap(ptr) {
|
|
555
549
|
ptr = ptr >>> 0;
|
|
556
550
|
const obj = Object.create(PolicyEvaluationError.prototype);
|
|
@@ -602,7 +596,6 @@ class PolicyEvaluationError {
|
|
|
602
596
|
}
|
|
603
597
|
}
|
|
604
598
|
if (Symbol.dispose) PolicyEvaluationError.prototype[Symbol.dispose] = PolicyEvaluationError.prototype.free;
|
|
605
|
-
exports.PolicyEvaluationError = PolicyEvaluationError;
|
|
606
599
|
|
|
607
600
|
/**
|
|
608
601
|
* Create a new instance of the Cedarling application.
|
|
@@ -610,11 +603,10 @@ exports.PolicyEvaluationError = PolicyEvaluationError;
|
|
|
610
603
|
* @param {any} config
|
|
611
604
|
* @returns {Promise<Cedarling>}
|
|
612
605
|
*/
|
|
613
|
-
function init(config) {
|
|
606
|
+
export function init(config) {
|
|
614
607
|
const ret = wasm.init(config);
|
|
615
608
|
return ret;
|
|
616
609
|
}
|
|
617
|
-
exports.init = init;
|
|
618
610
|
|
|
619
611
|
/**
|
|
620
612
|
* Create a new instance of the Cedarling application from archive bytes.
|
|
@@ -636,11 +628,10 @@ exports.init = init;
|
|
|
636
628
|
* @param {Uint8Array} archive_bytes
|
|
637
629
|
* @returns {Promise<Cedarling>}
|
|
638
630
|
*/
|
|
639
|
-
function init_from_archive_bytes(config, archive_bytes) {
|
|
631
|
+
export function init_from_archive_bytes(config, archive_bytes) {
|
|
640
632
|
const ret = wasm.init_from_archive_bytes(config, archive_bytes);
|
|
641
633
|
return ret;
|
|
642
634
|
}
|
|
643
|
-
exports.init_from_archive_bytes = init_from_archive_bytes;
|
|
644
635
|
|
|
645
636
|
function __wbg_get_imports() {
|
|
646
637
|
const import0 = {
|
|
@@ -947,7 +938,7 @@ function __wbg_get_imports() {
|
|
|
947
938
|
const a = state0.a;
|
|
948
939
|
state0.a = 0;
|
|
949
940
|
try {
|
|
950
|
-
return
|
|
941
|
+
return wasm_bindgen__convert__closures_____invoke__h5ea28dde88fe4fc5(a, state0.b, arg0, arg1);
|
|
951
942
|
} finally {
|
|
952
943
|
state0.a = a;
|
|
953
944
|
}
|
|
@@ -1141,12 +1132,12 @@ function __wbg_get_imports() {
|
|
|
1141
1132
|
},
|
|
1142
1133
|
__wbindgen_cast_0000000000000001: function(arg0, arg1) {
|
|
1143
1134
|
// Cast intrinsic for `Closure(Closure { dtor_idx: 553, function: Function { arguments: [], shim_idx: 554, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
1144
|
-
const ret = makeMutClosure(arg0, arg1, wasm.
|
|
1135
|
+
const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__h81df99cf5fb23bb4, wasm_bindgen__convert__closures_____invoke__h06cf10571db3fb4b);
|
|
1145
1136
|
return ret;
|
|
1146
1137
|
},
|
|
1147
1138
|
__wbindgen_cast_0000000000000002: function(arg0, arg1) {
|
|
1148
1139
|
// Cast intrinsic for `Closure(Closure { dtor_idx: 597, function: Function { arguments: [Externref], shim_idx: 598, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
1149
|
-
const ret = makeMutClosure(arg0, arg1, wasm.
|
|
1140
|
+
const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__he589cbad438baf01, wasm_bindgen__convert__closures_____invoke__h30e9622b2b4b0718);
|
|
1150
1141
|
return ret;
|
|
1151
1142
|
},
|
|
1152
1143
|
__wbindgen_cast_0000000000000003: function(arg0) {
|
|
@@ -1190,16 +1181,16 @@ function __wbg_get_imports() {
|
|
|
1190
1181
|
};
|
|
1191
1182
|
}
|
|
1192
1183
|
|
|
1193
|
-
function
|
|
1194
|
-
wasm.
|
|
1184
|
+
function wasm_bindgen__convert__closures_____invoke__h06cf10571db3fb4b(arg0, arg1) {
|
|
1185
|
+
wasm.wasm_bindgen__convert__closures_____invoke__h06cf10571db3fb4b(arg0, arg1);
|
|
1195
1186
|
}
|
|
1196
1187
|
|
|
1197
|
-
function
|
|
1198
|
-
wasm.
|
|
1188
|
+
function wasm_bindgen__convert__closures_____invoke__h30e9622b2b4b0718(arg0, arg1, arg2) {
|
|
1189
|
+
wasm.wasm_bindgen__convert__closures_____invoke__h30e9622b2b4b0718(arg0, arg1, arg2);
|
|
1199
1190
|
}
|
|
1200
1191
|
|
|
1201
|
-
function
|
|
1202
|
-
wasm.
|
|
1192
|
+
function wasm_bindgen__convert__closures_____invoke__h5ea28dde88fe4fc5(arg0, arg1, arg2, arg3) {
|
|
1193
|
+
wasm.wasm_bindgen__convert__closures_____invoke__h5ea28dde88fe4fc5(arg0, arg1, arg2, arg3);
|
|
1203
1194
|
}
|
|
1204
1195
|
|
|
1205
1196
|
|
|
@@ -1436,7 +1427,15 @@ function takeFromExternrefTable0(idx) {
|
|
|
1436
1427
|
|
|
1437
1428
|
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
1438
1429
|
cachedTextDecoder.decode();
|
|
1430
|
+
const MAX_SAFARI_DECODE_BYTES = 2146435072;
|
|
1431
|
+
let numBytesDecoded = 0;
|
|
1439
1432
|
function decodeText(ptr, len) {
|
|
1433
|
+
numBytesDecoded += len;
|
|
1434
|
+
if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
|
|
1435
|
+
cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
1436
|
+
cachedTextDecoder.decode();
|
|
1437
|
+
numBytesDecoded = len;
|
|
1438
|
+
}
|
|
1440
1439
|
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
1441
1440
|
}
|
|
1442
1441
|
|
|
@@ -1455,8 +1454,95 @@ if (!('encodeInto' in cachedTextEncoder)) {
|
|
|
1455
1454
|
|
|
1456
1455
|
let WASM_VECTOR_LEN = 0;
|
|
1457
1456
|
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1457
|
+
let wasmModule, wasm;
|
|
1458
|
+
function __wbg_finalize_init(instance, module) {
|
|
1459
|
+
wasm = instance.exports;
|
|
1460
|
+
wasmModule = module;
|
|
1461
|
+
cachedDataViewMemory0 = null;
|
|
1462
|
+
cachedUint8ArrayMemory0 = null;
|
|
1463
|
+
wasm.__wbindgen_start();
|
|
1464
|
+
return wasm;
|
|
1465
|
+
}
|
|
1466
|
+
|
|
1467
|
+
async function __wbg_load(module, imports) {
|
|
1468
|
+
if (typeof Response === 'function' && module instanceof Response) {
|
|
1469
|
+
if (typeof WebAssembly.instantiateStreaming === 'function') {
|
|
1470
|
+
try {
|
|
1471
|
+
return await WebAssembly.instantiateStreaming(module, imports);
|
|
1472
|
+
} catch (e) {
|
|
1473
|
+
const validResponse = module.ok && expectedResponseType(module.type);
|
|
1474
|
+
|
|
1475
|
+
if (validResponse && module.headers.get('Content-Type') !== 'application/wasm') {
|
|
1476
|
+
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);
|
|
1477
|
+
|
|
1478
|
+
} else { throw e; }
|
|
1479
|
+
}
|
|
1480
|
+
}
|
|
1481
|
+
|
|
1482
|
+
const bytes = await module.arrayBuffer();
|
|
1483
|
+
return await WebAssembly.instantiate(bytes, imports);
|
|
1484
|
+
} else {
|
|
1485
|
+
const instance = await WebAssembly.instantiate(module, imports);
|
|
1486
|
+
|
|
1487
|
+
if (instance instanceof WebAssembly.Instance) {
|
|
1488
|
+
return { instance, module };
|
|
1489
|
+
} else {
|
|
1490
|
+
return instance;
|
|
1491
|
+
}
|
|
1492
|
+
}
|
|
1493
|
+
|
|
1494
|
+
function expectedResponseType(type) {
|
|
1495
|
+
switch (type) {
|
|
1496
|
+
case 'basic': case 'cors': case 'default': return true;
|
|
1497
|
+
}
|
|
1498
|
+
return false;
|
|
1499
|
+
}
|
|
1500
|
+
}
|
|
1501
|
+
|
|
1502
|
+
function initSync(module) {
|
|
1503
|
+
if (wasm !== undefined) return wasm;
|
|
1504
|
+
|
|
1505
|
+
|
|
1506
|
+
if (module !== undefined) {
|
|
1507
|
+
if (Object.getPrototypeOf(module) === Object.prototype) {
|
|
1508
|
+
({module} = module)
|
|
1509
|
+
} else {
|
|
1510
|
+
console.warn('using deprecated parameters for `initSync()`; pass a single object instead')
|
|
1511
|
+
}
|
|
1512
|
+
}
|
|
1513
|
+
|
|
1514
|
+
const imports = __wbg_get_imports();
|
|
1515
|
+
if (!(module instanceof WebAssembly.Module)) {
|
|
1516
|
+
module = new WebAssembly.Module(module);
|
|
1517
|
+
}
|
|
1518
|
+
const instance = new WebAssembly.Instance(module, imports);
|
|
1519
|
+
return __wbg_finalize_init(instance, module);
|
|
1520
|
+
}
|
|
1521
|
+
|
|
1522
|
+
async function __wbg_init(module_or_path) {
|
|
1523
|
+
if (wasm !== undefined) return wasm;
|
|
1524
|
+
|
|
1525
|
+
|
|
1526
|
+
if (module_or_path !== undefined) {
|
|
1527
|
+
if (Object.getPrototypeOf(module_or_path) === Object.prototype) {
|
|
1528
|
+
({module_or_path} = module_or_path)
|
|
1529
|
+
} else {
|
|
1530
|
+
console.warn('using deprecated parameters for the initialization function; pass a single object instead')
|
|
1531
|
+
}
|
|
1532
|
+
}
|
|
1533
|
+
|
|
1534
|
+
if (module_or_path === undefined) {
|
|
1535
|
+
module_or_path = new URL('cedarling_wasm_bg.wasm', import.meta.url);
|
|
1536
|
+
}
|
|
1537
|
+
const imports = __wbg_get_imports();
|
|
1538
|
+
|
|
1539
|
+
if (typeof module_or_path === 'string' || (typeof Request === 'function' && module_or_path instanceof Request) || (typeof URL === 'function' && module_or_path instanceof URL)) {
|
|
1540
|
+
module_or_path = fetch(module_or_path);
|
|
1541
|
+
}
|
|
1542
|
+
|
|
1543
|
+
const { instance, module } = await __wbg_load(await module_or_path, imports);
|
|
1544
|
+
|
|
1545
|
+
return __wbg_finalize_init(instance, module);
|
|
1546
|
+
}
|
|
1547
|
+
|
|
1548
|
+
export { initSync, __wbg_init as default };
|
package/cedarling_wasm_bg.wasm
CHANGED
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@janssenproject/cedarling_wasm",
|
|
3
|
+
"type": "module",
|
|
3
4
|
"description": "The Cedarling is a performant local authorization service that runs the Rust Cedar Engine",
|
|
4
|
-
"version": "0.0.
|
|
5
|
+
"version": "0.0.311",
|
|
5
6
|
"license": "Apache-2.0",
|
|
6
7
|
"repository": {
|
|
7
8
|
"type": "git",
|
|
@@ -13,5 +14,8 @@
|
|
|
13
14
|
"cedarling_wasm.d.ts"
|
|
14
15
|
],
|
|
15
16
|
"main": "cedarling_wasm.js",
|
|
16
|
-
"types": "cedarling_wasm.d.ts"
|
|
17
|
+
"types": "cedarling_wasm.d.ts",
|
|
18
|
+
"sideEffects": [
|
|
19
|
+
"./snippets/*"
|
|
20
|
+
]
|
|
17
21
|
}
|