@janssenproject/cedarling_wasm 0.0.326-nodejs → 0.0.327
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 +133 -0
- package/cedarling_wasm.js +111 -26
- package/cedarling_wasm_bg.wasm +0 -0
- package/package.json +6 -2
package/cedarling_wasm.d.ts
CHANGED
|
@@ -434,3 +434,136 @@ export function init(config: any): Promise<Cedarling>;
|
|
|
434
434
|
* ```
|
|
435
435
|
*/
|
|
436
436
|
export function init_from_archive_bytes(config: any, archive_bytes: Uint8Array): Promise<Cedarling>;
|
|
437
|
+
|
|
438
|
+
export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
|
|
439
|
+
|
|
440
|
+
export interface InitOutput {
|
|
441
|
+
readonly memory: WebAssembly.Memory;
|
|
442
|
+
readonly __wbg_cedarling_free: (a: number, b: number) => void;
|
|
443
|
+
readonly __wbg_multiissuerauthorizeresult_free: (a: number, b: number) => void;
|
|
444
|
+
readonly __wbg_get_multiissuerauthorizeresult_response: (a: number) => number;
|
|
445
|
+
readonly __wbg_set_multiissuerauthorizeresult_response: (a: number, b: number) => void;
|
|
446
|
+
readonly __wbg_get_multiissuerauthorizeresult_decision: (a: number) => number;
|
|
447
|
+
readonly __wbg_set_multiissuerauthorizeresult_decision: (a: number, b: number) => void;
|
|
448
|
+
readonly __wbg_get_multiissuerauthorizeresult_request_id: (a: number) => [number, number];
|
|
449
|
+
readonly __wbg_set_multiissuerauthorizeresult_request_id: (a: number, b: number, c: number) => void;
|
|
450
|
+
readonly multiissuerauthorizeresult_json_string: (a: number) => [number, number];
|
|
451
|
+
readonly init: (a: any) => any;
|
|
452
|
+
readonly init_from_archive_bytes: (a: any, b: any) => any;
|
|
453
|
+
readonly cedarling_new: (a: any) => any;
|
|
454
|
+
readonly cedarling_new_from_map: (a: any) => any;
|
|
455
|
+
readonly cedarling_authorize: (a: number, b: any) => any;
|
|
456
|
+
readonly cedarling_authorize_unsigned: (a: number, b: any) => any;
|
|
457
|
+
readonly cedarling_authorize_multi_issuer: (a: number, b: any) => any;
|
|
458
|
+
readonly cedarling_pop_logs: (a: number) => [number, number, number];
|
|
459
|
+
readonly cedarling_get_log_by_id: (a: number, b: number, c: number) => [number, number, number];
|
|
460
|
+
readonly cedarling_get_log_ids: (a: number) => any;
|
|
461
|
+
readonly cedarling_get_logs_by_tag: (a: number, b: number, c: number) => [number, number, number, number];
|
|
462
|
+
readonly cedarling_get_logs_by_request_id: (a: number, b: number, c: number) => [number, number, number, number];
|
|
463
|
+
readonly cedarling_get_logs_by_request_id_and_tag: (a: number, b: number, c: number, d: number, e: number) => [number, number, number, number];
|
|
464
|
+
readonly cedarling_shut_down: (a: number) => any;
|
|
465
|
+
readonly cedarling_push_data_ctx: (a: number, b: number, c: number, d: any, e: number, f: bigint) => [number, number];
|
|
466
|
+
readonly cedarling_get_data_ctx: (a: number, b: number, c: number) => [number, number, number];
|
|
467
|
+
readonly cedarling_get_data_entry_ctx: (a: number, b: number, c: number) => [number, number, number];
|
|
468
|
+
readonly cedarling_remove_data_ctx: (a: number, b: number, c: number) => [number, number, number];
|
|
469
|
+
readonly cedarling_clear_data_ctx: (a: number) => [number, number];
|
|
470
|
+
readonly cedarling_list_data_ctx: (a: number) => [number, number, number];
|
|
471
|
+
readonly cedarling_get_stats_ctx: (a: number) => [number, number, number];
|
|
472
|
+
readonly __wbg_authorizeresult_free: (a: number, b: number) => void;
|
|
473
|
+
readonly __wbg_get_authorizeresult_workload: (a: number) => number;
|
|
474
|
+
readonly __wbg_set_authorizeresult_workload: (a: number, b: number) => void;
|
|
475
|
+
readonly __wbg_get_authorizeresult_person: (a: number) => number;
|
|
476
|
+
readonly __wbg_set_authorizeresult_person: (a: number, b: number) => void;
|
|
477
|
+
readonly __wbg_get_authorizeresult_decision: (a: number) => number;
|
|
478
|
+
readonly __wbg_set_authorizeresult_decision: (a: number, b: number) => void;
|
|
479
|
+
readonly __wbg_get_authorizeresult_request_id: (a: number) => [number, number];
|
|
480
|
+
readonly __wbg_set_authorizeresult_request_id: (a: number, b: number, c: number) => void;
|
|
481
|
+
readonly authorizeresult_json_string: (a: number) => [number, number];
|
|
482
|
+
readonly authorizeresult_principal: (a: number, b: number, c: number) => number;
|
|
483
|
+
readonly __wbg_authorizeresultresponse_free: (a: number, b: number) => void;
|
|
484
|
+
readonly authorizeresultresponse_decision: (a: number) => number;
|
|
485
|
+
readonly authorizeresultresponse_diagnostics: (a: number) => number;
|
|
486
|
+
readonly __wbg_diagnostics_free: (a: number, b: number) => void;
|
|
487
|
+
readonly diagnostics_reason: (a: number) => [number, number];
|
|
488
|
+
readonly diagnostics_errors: (a: number) => [number, number];
|
|
489
|
+
readonly __wbg_policyevaluationerror_free: (a: number, b: number) => void;
|
|
490
|
+
readonly policyevaluationerror_id: (a: number) => [number, number];
|
|
491
|
+
readonly policyevaluationerror_error: (a: number) => [number, number];
|
|
492
|
+
readonly __wbg_dataentry_free: (a: number, b: number) => void;
|
|
493
|
+
readonly __wbg_get_dataentry_key: (a: number) => [number, number];
|
|
494
|
+
readonly __wbg_set_dataentry_key: (a: number, b: number, c: number) => void;
|
|
495
|
+
readonly __wbg_get_dataentry_data_type: (a: number) => [number, number];
|
|
496
|
+
readonly __wbg_set_dataentry_data_type: (a: number, b: number, c: number) => void;
|
|
497
|
+
readonly __wbg_get_dataentry_created_at: (a: number) => [number, number];
|
|
498
|
+
readonly __wbg_set_dataentry_created_at: (a: number, b: number, c: number) => void;
|
|
499
|
+
readonly __wbg_get_dataentry_expires_at: (a: number) => [number, number];
|
|
500
|
+
readonly __wbg_set_dataentry_expires_at: (a: number, b: number, c: number) => void;
|
|
501
|
+
readonly __wbg_get_dataentry_access_count: (a: number) => bigint;
|
|
502
|
+
readonly __wbg_set_dataentry_access_count: (a: number, b: bigint) => void;
|
|
503
|
+
readonly dataentry_value: (a: number) => [number, number, number];
|
|
504
|
+
readonly dataentry_json_string: (a: number) => [number, number];
|
|
505
|
+
readonly __wbg_datastorestats_free: (a: number, b: number) => void;
|
|
506
|
+
readonly __wbg_get_datastorestats_entry_count: (a: number) => number;
|
|
507
|
+
readonly __wbg_set_datastorestats_entry_count: (a: number, b: number) => void;
|
|
508
|
+
readonly __wbg_get_datastorestats_max_entries: (a: number) => number;
|
|
509
|
+
readonly __wbg_set_datastorestats_max_entries: (a: number, b: number) => void;
|
|
510
|
+
readonly __wbg_get_datastorestats_max_entry_size: (a: number) => number;
|
|
511
|
+
readonly __wbg_set_datastorestats_max_entry_size: (a: number, b: number) => void;
|
|
512
|
+
readonly __wbg_get_datastorestats_metrics_enabled: (a: number) => number;
|
|
513
|
+
readonly __wbg_set_datastorestats_metrics_enabled: (a: number, b: number) => void;
|
|
514
|
+
readonly __wbg_get_datastorestats_total_size_bytes: (a: number) => number;
|
|
515
|
+
readonly __wbg_set_datastorestats_total_size_bytes: (a: number, b: number) => void;
|
|
516
|
+
readonly __wbg_get_datastorestats_avg_entry_size_bytes: (a: number) => number;
|
|
517
|
+
readonly __wbg_set_datastorestats_avg_entry_size_bytes: (a: number, b: number) => void;
|
|
518
|
+
readonly __wbg_get_datastorestats_capacity_usage_percent: (a: number) => number;
|
|
519
|
+
readonly __wbg_set_datastorestats_capacity_usage_percent: (a: number, b: number) => void;
|
|
520
|
+
readonly __wbg_get_datastorestats_memory_alert_threshold: (a: number) => number;
|
|
521
|
+
readonly __wbg_set_datastorestats_memory_alert_threshold: (a: number, b: number) => void;
|
|
522
|
+
readonly __wbg_get_datastorestats_memory_alert_triggered: (a: number) => number;
|
|
523
|
+
readonly __wbg_set_datastorestats_memory_alert_triggered: (a: number, b: number) => void;
|
|
524
|
+
readonly datastorestats_json_string: (a: number) => [number, number];
|
|
525
|
+
readonly rust_zstd_wasm_shim_qsort: (a: number, b: number, c: number, d: number) => void;
|
|
526
|
+
readonly rust_zstd_wasm_shim_malloc: (a: number) => number;
|
|
527
|
+
readonly rust_zstd_wasm_shim_memcmp: (a: number, b: number, c: number) => number;
|
|
528
|
+
readonly rust_zstd_wasm_shim_calloc: (a: number, b: number) => number;
|
|
529
|
+
readonly rust_zstd_wasm_shim_free: (a: number) => void;
|
|
530
|
+
readonly rust_zstd_wasm_shim_memcpy: (a: number, b: number, c: number) => number;
|
|
531
|
+
readonly rust_zstd_wasm_shim_memmove: (a: number, b: number, c: number) => number;
|
|
532
|
+
readonly rust_zstd_wasm_shim_memset: (a: number, b: number, c: number) => number;
|
|
533
|
+
readonly wasm_bindgen__closure__destroy__hd16846c4db5702f7: (a: number, b: number) => void;
|
|
534
|
+
readonly wasm_bindgen__closure__destroy__h05d83266f808ff3c: (a: number, b: number) => void;
|
|
535
|
+
readonly wasm_bindgen__convert__closures_____invoke__hef1652f203b86df2: (a: number, b: number, c: any) => [number, number];
|
|
536
|
+
readonly wasm_bindgen__convert__closures_____invoke__h24c31e14977a730e: (a: number, b: number, c: any, d: any) => void;
|
|
537
|
+
readonly wasm_bindgen__convert__closures_____invoke__h11599899629cf4d4: (a: number, b: number) => void;
|
|
538
|
+
readonly __wbindgen_malloc: (a: number, b: number) => number;
|
|
539
|
+
readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|
|
540
|
+
readonly __wbindgen_exn_store: (a: number) => void;
|
|
541
|
+
readonly __externref_table_alloc: () => number;
|
|
542
|
+
readonly __wbindgen_externrefs: WebAssembly.Table;
|
|
543
|
+
readonly __wbindgen_free: (a: number, b: number, c: number) => void;
|
|
544
|
+
readonly __externref_table_dealloc: (a: number) => void;
|
|
545
|
+
readonly __externref_drop_slice: (a: number, b: number) => void;
|
|
546
|
+
readonly __wbindgen_start: () => void;
|
|
547
|
+
}
|
|
548
|
+
|
|
549
|
+
export type SyncInitInput = BufferSource | WebAssembly.Module;
|
|
550
|
+
|
|
551
|
+
/**
|
|
552
|
+
* Instantiates the given `module`, which can either be bytes or
|
|
553
|
+
* a precompiled `WebAssembly.Module`.
|
|
554
|
+
*
|
|
555
|
+
* @param {{ module: SyncInitInput }} module - Passing `SyncInitInput` directly is deprecated.
|
|
556
|
+
*
|
|
557
|
+
* @returns {InitOutput}
|
|
558
|
+
*/
|
|
559
|
+
export function initSync(module: { module: SyncInitInput } | SyncInitInput): InitOutput;
|
|
560
|
+
|
|
561
|
+
/**
|
|
562
|
+
* If `module_or_path` is {RequestInfo} or {URL}, makes a request and
|
|
563
|
+
* for everything else, calls `WebAssembly.instantiate` directly.
|
|
564
|
+
*
|
|
565
|
+
* @param {{ module_or_path: InitInput | Promise<InitInput> }} module_or_path - Passing `InitInput` directly is deprecated.
|
|
566
|
+
*
|
|
567
|
+
* @returns {Promise<InitOutput>}
|
|
568
|
+
*/
|
|
569
|
+
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);
|
|
@@ -528,13 +526,12 @@ class Cedarling {
|
|
|
528
526
|
}
|
|
529
527
|
}
|
|
530
528
|
if (Symbol.dispose) Cedarling.prototype[Symbol.dispose] = Cedarling.prototype.free;
|
|
531
|
-
exports.Cedarling = Cedarling;
|
|
532
529
|
|
|
533
530
|
/**
|
|
534
531
|
* A WASM wrapper for the Rust `cedarling::DataEntry` struct.
|
|
535
532
|
* Represents a data entry in the DataStore with value and metadata.
|
|
536
533
|
*/
|
|
537
|
-
class DataEntry {
|
|
534
|
+
export class DataEntry {
|
|
538
535
|
static __wrap(ptr) {
|
|
539
536
|
ptr = ptr >>> 0;
|
|
540
537
|
const obj = Object.create(DataEntry.prototype);
|
|
@@ -693,13 +690,12 @@ class DataEntry {
|
|
|
693
690
|
}
|
|
694
691
|
}
|
|
695
692
|
if (Symbol.dispose) DataEntry.prototype[Symbol.dispose] = DataEntry.prototype.free;
|
|
696
|
-
exports.DataEntry = DataEntry;
|
|
697
693
|
|
|
698
694
|
/**
|
|
699
695
|
* A WASM wrapper for the Rust `cedarling::DataStoreStats` struct.
|
|
700
696
|
* Statistics about the DataStore.
|
|
701
697
|
*/
|
|
702
|
-
class DataStoreStats {
|
|
698
|
+
export class DataStoreStats {
|
|
703
699
|
static __wrap(ptr) {
|
|
704
700
|
ptr = ptr >>> 0;
|
|
705
701
|
const obj = Object.create(DataStoreStats.prototype);
|
|
@@ -870,7 +866,6 @@ class DataStoreStats {
|
|
|
870
866
|
}
|
|
871
867
|
}
|
|
872
868
|
if (Symbol.dispose) DataStoreStats.prototype[Symbol.dispose] = DataStoreStats.prototype.free;
|
|
873
|
-
exports.DataStoreStats = DataStoreStats;
|
|
874
869
|
|
|
875
870
|
/**
|
|
876
871
|
* Diagnostics
|
|
@@ -878,7 +873,7 @@ exports.DataStoreStats = DataStoreStats;
|
|
|
878
873
|
*
|
|
879
874
|
* Provides detailed information about how a policy decision was made, including policies that contributed to the decision and any errors encountered during evaluation.
|
|
880
875
|
*/
|
|
881
|
-
class Diagnostics {
|
|
876
|
+
export class Diagnostics {
|
|
882
877
|
static __wrap(ptr) {
|
|
883
878
|
ptr = ptr >>> 0;
|
|
884
879
|
const obj = Object.create(Diagnostics.prototype);
|
|
@@ -922,13 +917,12 @@ class Diagnostics {
|
|
|
922
917
|
}
|
|
923
918
|
}
|
|
924
919
|
if (Symbol.dispose) Diagnostics.prototype[Symbol.dispose] = Diagnostics.prototype.free;
|
|
925
|
-
exports.Diagnostics = Diagnostics;
|
|
926
920
|
|
|
927
921
|
/**
|
|
928
922
|
* A WASM wrapper for the Rust `cedarling::MultiIssuerAuthorizeResult` struct.
|
|
929
923
|
* Represents the result of a multi-issuer authorization request.
|
|
930
924
|
*/
|
|
931
|
-
class MultiIssuerAuthorizeResult {
|
|
925
|
+
export class MultiIssuerAuthorizeResult {
|
|
932
926
|
static __wrap(ptr) {
|
|
933
927
|
ptr = ptr >>> 0;
|
|
934
928
|
const obj = Object.create(MultiIssuerAuthorizeResult.prototype);
|
|
@@ -1025,7 +1019,6 @@ class MultiIssuerAuthorizeResult {
|
|
|
1025
1019
|
}
|
|
1026
1020
|
}
|
|
1027
1021
|
if (Symbol.dispose) MultiIssuerAuthorizeResult.prototype[Symbol.dispose] = MultiIssuerAuthorizeResult.prototype.free;
|
|
1028
|
-
exports.MultiIssuerAuthorizeResult = MultiIssuerAuthorizeResult;
|
|
1029
1022
|
|
|
1030
1023
|
/**
|
|
1031
1024
|
* PolicyEvaluationError
|
|
@@ -1033,7 +1026,7 @@ exports.MultiIssuerAuthorizeResult = MultiIssuerAuthorizeResult;
|
|
|
1033
1026
|
*
|
|
1034
1027
|
* Represents an error that occurred when evaluating a Cedar policy.
|
|
1035
1028
|
*/
|
|
1036
|
-
class PolicyEvaluationError {
|
|
1029
|
+
export class PolicyEvaluationError {
|
|
1037
1030
|
static __wrap(ptr) {
|
|
1038
1031
|
ptr = ptr >>> 0;
|
|
1039
1032
|
const obj = Object.create(PolicyEvaluationError.prototype);
|
|
@@ -1085,7 +1078,6 @@ class PolicyEvaluationError {
|
|
|
1085
1078
|
}
|
|
1086
1079
|
}
|
|
1087
1080
|
if (Symbol.dispose) PolicyEvaluationError.prototype[Symbol.dispose] = PolicyEvaluationError.prototype.free;
|
|
1088
|
-
exports.PolicyEvaluationError = PolicyEvaluationError;
|
|
1089
1081
|
|
|
1090
1082
|
/**
|
|
1091
1083
|
* Create a new instance of the Cedarling application.
|
|
@@ -1093,11 +1085,10 @@ exports.PolicyEvaluationError = PolicyEvaluationError;
|
|
|
1093
1085
|
* @param {any} config
|
|
1094
1086
|
* @returns {Promise<Cedarling>}
|
|
1095
1087
|
*/
|
|
1096
|
-
function init(config) {
|
|
1088
|
+
export function init(config) {
|
|
1097
1089
|
const ret = wasm.init(config);
|
|
1098
1090
|
return ret;
|
|
1099
1091
|
}
|
|
1100
|
-
exports.init = init;
|
|
1101
1092
|
|
|
1102
1093
|
/**
|
|
1103
1094
|
* Create a new instance of the Cedarling application from archive bytes.
|
|
@@ -1119,11 +1110,10 @@ exports.init = init;
|
|
|
1119
1110
|
* @param {Uint8Array} archive_bytes
|
|
1120
1111
|
* @returns {Promise<Cedarling>}
|
|
1121
1112
|
*/
|
|
1122
|
-
function init_from_archive_bytes(config, archive_bytes) {
|
|
1113
|
+
export function init_from_archive_bytes(config, archive_bytes) {
|
|
1123
1114
|
const ret = wasm.init_from_archive_bytes(config, archive_bytes);
|
|
1124
1115
|
return ret;
|
|
1125
1116
|
}
|
|
1126
|
-
exports.init_from_archive_bytes = init_from_archive_bytes;
|
|
1127
1117
|
|
|
1128
1118
|
function __wbg_get_imports() {
|
|
1129
1119
|
const import0 = {
|
|
@@ -1625,7 +1615,7 @@ function __wbg_get_imports() {
|
|
|
1625
1615
|
return ret;
|
|
1626
1616
|
},
|
|
1627
1617
|
__wbindgen_cast_0000000000000002: function(arg0, arg1) {
|
|
1628
|
-
// Cast intrinsic for `Closure(Closure { dtor_idx: 635, function: Function { arguments: [Externref], shim_idx:
|
|
1618
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 635, function: Function { arguments: [Externref], shim_idx: 2062, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
|
|
1629
1619
|
const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__h05d83266f808ff3c, wasm_bindgen__convert__closures_____invoke__hef1652f203b86df2);
|
|
1630
1620
|
return ret;
|
|
1631
1621
|
},
|
|
@@ -1922,7 +1912,15 @@ function takeFromExternrefTable0(idx) {
|
|
|
1922
1912
|
|
|
1923
1913
|
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
1924
1914
|
cachedTextDecoder.decode();
|
|
1915
|
+
const MAX_SAFARI_DECODE_BYTES = 2146435072;
|
|
1916
|
+
let numBytesDecoded = 0;
|
|
1925
1917
|
function decodeText(ptr, len) {
|
|
1918
|
+
numBytesDecoded += len;
|
|
1919
|
+
if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
|
|
1920
|
+
cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
1921
|
+
cachedTextDecoder.decode();
|
|
1922
|
+
numBytesDecoded = len;
|
|
1923
|
+
}
|
|
1926
1924
|
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
1927
1925
|
}
|
|
1928
1926
|
|
|
@@ -1941,8 +1939,95 @@ if (!('encodeInto' in cachedTextEncoder)) {
|
|
|
1941
1939
|
|
|
1942
1940
|
let WASM_VECTOR_LEN = 0;
|
|
1943
1941
|
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
|
|
1942
|
+
let wasmModule, wasm;
|
|
1943
|
+
function __wbg_finalize_init(instance, module) {
|
|
1944
|
+
wasm = instance.exports;
|
|
1945
|
+
wasmModule = module;
|
|
1946
|
+
cachedDataViewMemory0 = null;
|
|
1947
|
+
cachedUint8ArrayMemory0 = null;
|
|
1948
|
+
wasm.__wbindgen_start();
|
|
1949
|
+
return wasm;
|
|
1950
|
+
}
|
|
1951
|
+
|
|
1952
|
+
async function __wbg_load(module, imports) {
|
|
1953
|
+
if (typeof Response === 'function' && module instanceof Response) {
|
|
1954
|
+
if (typeof WebAssembly.instantiateStreaming === 'function') {
|
|
1955
|
+
try {
|
|
1956
|
+
return await WebAssembly.instantiateStreaming(module, imports);
|
|
1957
|
+
} catch (e) {
|
|
1958
|
+
const validResponse = module.ok && expectedResponseType(module.type);
|
|
1959
|
+
|
|
1960
|
+
if (validResponse && module.headers.get('Content-Type') !== 'application/wasm') {
|
|
1961
|
+
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);
|
|
1962
|
+
|
|
1963
|
+
} else { throw e; }
|
|
1964
|
+
}
|
|
1965
|
+
}
|
|
1966
|
+
|
|
1967
|
+
const bytes = await module.arrayBuffer();
|
|
1968
|
+
return await WebAssembly.instantiate(bytes, imports);
|
|
1969
|
+
} else {
|
|
1970
|
+
const instance = await WebAssembly.instantiate(module, imports);
|
|
1971
|
+
|
|
1972
|
+
if (instance instanceof WebAssembly.Instance) {
|
|
1973
|
+
return { instance, module };
|
|
1974
|
+
} else {
|
|
1975
|
+
return instance;
|
|
1976
|
+
}
|
|
1977
|
+
}
|
|
1978
|
+
|
|
1979
|
+
function expectedResponseType(type) {
|
|
1980
|
+
switch (type) {
|
|
1981
|
+
case 'basic': case 'cors': case 'default': return true;
|
|
1982
|
+
}
|
|
1983
|
+
return false;
|
|
1984
|
+
}
|
|
1985
|
+
}
|
|
1986
|
+
|
|
1987
|
+
function initSync(module) {
|
|
1988
|
+
if (wasm !== undefined) return wasm;
|
|
1989
|
+
|
|
1990
|
+
|
|
1991
|
+
if (module !== undefined) {
|
|
1992
|
+
if (Object.getPrototypeOf(module) === Object.prototype) {
|
|
1993
|
+
({module} = module)
|
|
1994
|
+
} else {
|
|
1995
|
+
console.warn('using deprecated parameters for `initSync()`; pass a single object instead')
|
|
1996
|
+
}
|
|
1997
|
+
}
|
|
1998
|
+
|
|
1999
|
+
const imports = __wbg_get_imports();
|
|
2000
|
+
if (!(module instanceof WebAssembly.Module)) {
|
|
2001
|
+
module = new WebAssembly.Module(module);
|
|
2002
|
+
}
|
|
2003
|
+
const instance = new WebAssembly.Instance(module, imports);
|
|
2004
|
+
return __wbg_finalize_init(instance, module);
|
|
2005
|
+
}
|
|
2006
|
+
|
|
2007
|
+
async function __wbg_init(module_or_path) {
|
|
2008
|
+
if (wasm !== undefined) return wasm;
|
|
2009
|
+
|
|
2010
|
+
|
|
2011
|
+
if (module_or_path !== undefined) {
|
|
2012
|
+
if (Object.getPrototypeOf(module_or_path) === Object.prototype) {
|
|
2013
|
+
({module_or_path} = module_or_path)
|
|
2014
|
+
} else {
|
|
2015
|
+
console.warn('using deprecated parameters for the initialization function; pass a single object instead')
|
|
2016
|
+
}
|
|
2017
|
+
}
|
|
2018
|
+
|
|
2019
|
+
if (module_or_path === undefined) {
|
|
2020
|
+
module_or_path = new URL('cedarling_wasm_bg.wasm', import.meta.url);
|
|
2021
|
+
}
|
|
2022
|
+
const imports = __wbg_get_imports();
|
|
2023
|
+
|
|
2024
|
+
if (typeof module_or_path === 'string' || (typeof Request === 'function' && module_or_path instanceof Request) || (typeof URL === 'function' && module_or_path instanceof URL)) {
|
|
2025
|
+
module_or_path = fetch(module_or_path);
|
|
2026
|
+
}
|
|
2027
|
+
|
|
2028
|
+
const { instance, module } = await __wbg_load(await module_or_path, imports);
|
|
2029
|
+
|
|
2030
|
+
return __wbg_finalize_init(instance, module);
|
|
2031
|
+
}
|
|
2032
|
+
|
|
2033
|
+
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.327",
|
|
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
|
}
|