@janssenproject/cedarling_wasm 0.0.339-nodejs → 0.0.339
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 +145 -0
- package/cedarling_wasm.js +113 -31
- package/cedarling_wasm_bg.wasm +0 -0
- package/package.json +6 -2
package/cedarling_wasm.d.ts
CHANGED
|
@@ -448,3 +448,148 @@ export function init(config: any): Promise<Cedarling>;
|
|
|
448
448
|
* ```
|
|
449
449
|
*/
|
|
450
450
|
export function init_from_archive_bytes(config: any, archive_bytes: Uint8Array): Promise<Cedarling>;
|
|
451
|
+
|
|
452
|
+
export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
|
|
453
|
+
|
|
454
|
+
export interface InitOutput {
|
|
455
|
+
readonly memory: WebAssembly.Memory;
|
|
456
|
+
readonly __wbg_cedarling_free: (a: number, b: number) => void;
|
|
457
|
+
readonly __wbg_multiissuerauthorizeresult_free: (a: number, b: number) => void;
|
|
458
|
+
readonly __wbg_get_multiissuerauthorizeresult_response: (a: number) => number;
|
|
459
|
+
readonly __wbg_set_multiissuerauthorizeresult_response: (a: number, b: number) => void;
|
|
460
|
+
readonly __wbg_get_multiissuerauthorizeresult_decision: (a: number) => number;
|
|
461
|
+
readonly __wbg_set_multiissuerauthorizeresult_decision: (a: number, b: number) => void;
|
|
462
|
+
readonly __wbg_get_multiissuerauthorizeresult_request_id: (a: number) => [number, number];
|
|
463
|
+
readonly __wbg_set_multiissuerauthorizeresult_request_id: (a: number, b: number, c: number) => void;
|
|
464
|
+
readonly multiissuerauthorizeresult_json_string: (a: number) => [number, number];
|
|
465
|
+
readonly init: (a: any) => any;
|
|
466
|
+
readonly init_from_archive_bytes: (a: any, b: any) => any;
|
|
467
|
+
readonly cedarling_new: (a: any) => any;
|
|
468
|
+
readonly cedarling_new_from_map: (a: any) => any;
|
|
469
|
+
readonly cedarling_authorize_unsigned: (a: number, b: any) => any;
|
|
470
|
+
readonly cedarling_authorize_multi_issuer: (a: number, b: any) => any;
|
|
471
|
+
readonly cedarling_pop_logs: (a: number) => [number, number, number];
|
|
472
|
+
readonly cedarling_get_log_by_id: (a: number, b: number, c: number) => [number, number, number];
|
|
473
|
+
readonly cedarling_get_log_ids: (a: number) => any;
|
|
474
|
+
readonly cedarling_get_logs_by_tag: (a: number, b: number, c: number) => [number, number, number, number];
|
|
475
|
+
readonly cedarling_get_logs_by_request_id: (a: number, b: number, c: number) => [number, number, number, number];
|
|
476
|
+
readonly cedarling_get_logs_by_request_id_and_tag: (a: number, b: number, c: number, d: number, e: number) => [number, number, number, number];
|
|
477
|
+
readonly cedarling_shut_down: (a: number) => any;
|
|
478
|
+
readonly cedarling_push_data_ctx: (a: number, b: number, c: number, d: any, e: number, f: bigint) => [number, number];
|
|
479
|
+
readonly cedarling_get_data_ctx: (a: number, b: number, c: number) => [number, number, number];
|
|
480
|
+
readonly cedarling_get_data_entry_ctx: (a: number, b: number, c: number) => [number, number, number];
|
|
481
|
+
readonly cedarling_remove_data_ctx: (a: number, b: number, c: number) => [number, number, number];
|
|
482
|
+
readonly cedarling_clear_data_ctx: (a: number) => [number, number];
|
|
483
|
+
readonly cedarling_list_data_ctx: (a: number) => [number, number, number];
|
|
484
|
+
readonly cedarling_get_stats_ctx: (a: number) => [number, number, number];
|
|
485
|
+
readonly __wbg_authorizeresult_free: (a: number, b: number) => void;
|
|
486
|
+
readonly __wbg_get_authorizeresult_decision: (a: number) => number;
|
|
487
|
+
readonly __wbg_set_authorizeresult_decision: (a: number, b: number) => void;
|
|
488
|
+
readonly __wbg_get_authorizeresult_request_id: (a: number) => [number, number];
|
|
489
|
+
readonly __wbg_set_authorizeresult_request_id: (a: number, b: number, c: number) => void;
|
|
490
|
+
readonly authorizeresult_json_string: (a: number) => [number, number];
|
|
491
|
+
readonly authorizeresult_principal: (a: number, b: number, c: number) => number;
|
|
492
|
+
readonly __wbg_authorizeresultresponse_free: (a: number, b: number) => void;
|
|
493
|
+
readonly authorizeresultresponse_decision: (a: number) => number;
|
|
494
|
+
readonly authorizeresultresponse_diagnostics: (a: number) => number;
|
|
495
|
+
readonly __wbg_diagnostics_free: (a: number, b: number) => void;
|
|
496
|
+
readonly diagnostics_reason: (a: number) => [number, number];
|
|
497
|
+
readonly diagnostics_errors: (a: number) => [number, number];
|
|
498
|
+
readonly __wbg_policyevaluationerror_free: (a: number, b: number) => void;
|
|
499
|
+
readonly policyevaluationerror_id: (a: number) => [number, number];
|
|
500
|
+
readonly policyevaluationerror_error: (a: number) => [number, number];
|
|
501
|
+
readonly __wbg_dataentry_free: (a: number, b: number) => void;
|
|
502
|
+
readonly __wbg_get_dataentry_key: (a: number) => [number, number];
|
|
503
|
+
readonly __wbg_set_dataentry_key: (a: number, b: number, c: number) => void;
|
|
504
|
+
readonly __wbg_get_dataentry_data_type: (a: number) => [number, number];
|
|
505
|
+
readonly __wbg_set_dataentry_data_type: (a: number, b: number, c: number) => void;
|
|
506
|
+
readonly __wbg_get_dataentry_created_at: (a: number) => [number, number];
|
|
507
|
+
readonly __wbg_set_dataentry_created_at: (a: number, b: number, c: number) => void;
|
|
508
|
+
readonly __wbg_get_dataentry_expires_at: (a: number) => [number, number];
|
|
509
|
+
readonly __wbg_set_dataentry_expires_at: (a: number, b: number, c: number) => void;
|
|
510
|
+
readonly __wbg_get_dataentry_access_count: (a: number) => bigint;
|
|
511
|
+
readonly __wbg_set_dataentry_access_count: (a: number, b: bigint) => void;
|
|
512
|
+
readonly dataentry_value: (a: number) => [number, number, number];
|
|
513
|
+
readonly dataentry_json_string: (a: number) => [number, number];
|
|
514
|
+
readonly __wbg_datastorestats_free: (a: number, b: number) => void;
|
|
515
|
+
readonly __wbg_get_datastorestats_entry_count: (a: number) => number;
|
|
516
|
+
readonly __wbg_set_datastorestats_entry_count: (a: number, b: number) => void;
|
|
517
|
+
readonly __wbg_get_datastorestats_max_entries: (a: number) => number;
|
|
518
|
+
readonly __wbg_set_datastorestats_max_entries: (a: number, b: number) => void;
|
|
519
|
+
readonly __wbg_get_datastorestats_max_entry_size: (a: number) => number;
|
|
520
|
+
readonly __wbg_set_datastorestats_max_entry_size: (a: number, b: number) => void;
|
|
521
|
+
readonly __wbg_get_datastorestats_metrics_enabled: (a: number) => number;
|
|
522
|
+
readonly __wbg_set_datastorestats_metrics_enabled: (a: number, b: number) => void;
|
|
523
|
+
readonly __wbg_get_datastorestats_total_size_bytes: (a: number) => number;
|
|
524
|
+
readonly __wbg_set_datastorestats_total_size_bytes: (a: number, b: number) => void;
|
|
525
|
+
readonly __wbg_get_datastorestats_avg_entry_size_bytes: (a: number) => number;
|
|
526
|
+
readonly __wbg_set_datastorestats_avg_entry_size_bytes: (a: number, b: number) => void;
|
|
527
|
+
readonly __wbg_get_datastorestats_capacity_usage_percent: (a: number) => number;
|
|
528
|
+
readonly __wbg_set_datastorestats_capacity_usage_percent: (a: number, b: number) => void;
|
|
529
|
+
readonly __wbg_get_datastorestats_memory_alert_threshold: (a: number) => number;
|
|
530
|
+
readonly __wbg_set_datastorestats_memory_alert_threshold: (a: number, b: number) => void;
|
|
531
|
+
readonly __wbg_get_datastorestats_memory_alert_triggered: (a: number) => number;
|
|
532
|
+
readonly __wbg_set_datastorestats_memory_alert_triggered: (a: number, b: number) => void;
|
|
533
|
+
readonly datastorestats_json_string: (a: number) => [number, number];
|
|
534
|
+
readonly __wbg_intounderlyingbytesource_free: (a: number, b: number) => void;
|
|
535
|
+
readonly intounderlyingbytesource_type: (a: number) => number;
|
|
536
|
+
readonly intounderlyingbytesource_autoAllocateChunkSize: (a: number) => number;
|
|
537
|
+
readonly intounderlyingbytesource_start: (a: number, b: any) => void;
|
|
538
|
+
readonly intounderlyingbytesource_pull: (a: number, b: any) => any;
|
|
539
|
+
readonly intounderlyingbytesource_cancel: (a: number) => void;
|
|
540
|
+
readonly __wbg_intounderlyingsource_free: (a: number, b: number) => void;
|
|
541
|
+
readonly intounderlyingsource_pull: (a: number, b: any) => any;
|
|
542
|
+
readonly intounderlyingsource_cancel: (a: number) => void;
|
|
543
|
+
readonly __wbg_intounderlyingsink_free: (a: number, b: number) => void;
|
|
544
|
+
readonly intounderlyingsink_write: (a: number, b: any) => any;
|
|
545
|
+
readonly intounderlyingsink_close: (a: number) => any;
|
|
546
|
+
readonly intounderlyingsink_abort: (a: number, b: any) => any;
|
|
547
|
+
readonly rust_zstd_wasm_shim_qsort: (a: number, b: number, c: number, d: number) => void;
|
|
548
|
+
readonly rust_zstd_wasm_shim_malloc: (a: number) => number;
|
|
549
|
+
readonly rust_zstd_wasm_shim_memcmp: (a: number, b: number, c: number) => number;
|
|
550
|
+
readonly rust_zstd_wasm_shim_calloc: (a: number, b: number) => number;
|
|
551
|
+
readonly rust_zstd_wasm_shim_free: (a: number) => void;
|
|
552
|
+
readonly rust_zstd_wasm_shim_memcpy: (a: number, b: number, c: number) => number;
|
|
553
|
+
readonly rust_zstd_wasm_shim_memmove: (a: number, b: number, c: number) => number;
|
|
554
|
+
readonly rust_zstd_wasm_shim_memset: (a: number, b: number, c: number) => number;
|
|
555
|
+
readonly wasm_bindgen__closure__destroy__hcbf2ec2b115651da: (a: number, b: number) => void;
|
|
556
|
+
readonly wasm_bindgen__closure__destroy__hb94dbe4a47b9147c: (a: number, b: number) => void;
|
|
557
|
+
readonly wasm_bindgen__closure__destroy__hd11c5dfc6ff843b5: (a: number, b: number) => void;
|
|
558
|
+
readonly wasm_bindgen__closure__destroy__h14227e6b7ccdc7d9: (a: number, b: number) => void;
|
|
559
|
+
readonly wasm_bindgen__convert__closures_____invoke__hce0de7781e15b6ff: (a: number, b: number, c: any) => [number, number];
|
|
560
|
+
readonly wasm_bindgen__convert__closures_____invoke__h17a92308e79e69c0: (a: number, b: number, c: any, d: any) => void;
|
|
561
|
+
readonly wasm_bindgen__convert__closures_____invoke__hdb4e3955a815023f: (a: number, b: number, c: any) => void;
|
|
562
|
+
readonly wasm_bindgen__convert__closures_____invoke__h09da5be58b802521: (a: number, b: number) => void;
|
|
563
|
+
readonly wasm_bindgen__convert__closures_____invoke__h5ac545e984d2dde4: (a: number, b: number) => void;
|
|
564
|
+
readonly __wbindgen_malloc: (a: number, b: number) => number;
|
|
565
|
+
readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|
|
566
|
+
readonly __wbindgen_exn_store: (a: number) => void;
|
|
567
|
+
readonly __externref_table_alloc: () => number;
|
|
568
|
+
readonly __wbindgen_externrefs: WebAssembly.Table;
|
|
569
|
+
readonly __wbindgen_free: (a: number, b: number, c: number) => void;
|
|
570
|
+
readonly __externref_table_dealloc: (a: number) => void;
|
|
571
|
+
readonly __externref_drop_slice: (a: number, b: number) => void;
|
|
572
|
+
readonly __wbindgen_start: () => void;
|
|
573
|
+
}
|
|
574
|
+
|
|
575
|
+
export type SyncInitInput = BufferSource | WebAssembly.Module;
|
|
576
|
+
|
|
577
|
+
/**
|
|
578
|
+
* Instantiates the given `module`, which can either be bytes or
|
|
579
|
+
* a precompiled `WebAssembly.Module`.
|
|
580
|
+
*
|
|
581
|
+
* @param {{ module: SyncInitInput }} module - Passing `SyncInitInput` directly is deprecated.
|
|
582
|
+
*
|
|
583
|
+
* @returns {InitOutput}
|
|
584
|
+
*/
|
|
585
|
+
export function initSync(module: { module: SyncInitInput } | SyncInitInput): InitOutput;
|
|
586
|
+
|
|
587
|
+
/**
|
|
588
|
+
* If `module_or_path` is {RequestInfo} or {URL}, makes a request and
|
|
589
|
+
* for everything else, calls `WebAssembly.instantiate` directly.
|
|
590
|
+
*
|
|
591
|
+
* @param {{ module_or_path: InitInput | Promise<InitInput> }} module_or_path - Passing `InitInput` directly is deprecated.
|
|
592
|
+
*
|
|
593
|
+
* @returns {Promise<InitOutput>}
|
|
594
|
+
*/
|
|
595
|
+
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);
|
|
@@ -98,13 +98,12 @@ class AuthorizeResult {
|
|
|
98
98
|
}
|
|
99
99
|
}
|
|
100
100
|
if (Symbol.dispose) AuthorizeResult.prototype[Symbol.dispose] = AuthorizeResult.prototype.free;
|
|
101
|
-
exports.AuthorizeResult = AuthorizeResult;
|
|
102
101
|
|
|
103
102
|
/**
|
|
104
103
|
* A WASM wrapper for the Rust `cedar_policy::Response` struct.
|
|
105
104
|
* Represents the result of an authorization request.
|
|
106
105
|
*/
|
|
107
|
-
class AuthorizeResultResponse {
|
|
106
|
+
export class AuthorizeResultResponse {
|
|
108
107
|
static __wrap(ptr) {
|
|
109
108
|
ptr = ptr >>> 0;
|
|
110
109
|
const obj = Object.create(AuthorizeResultResponse.prototype);
|
|
@@ -140,12 +139,11 @@ class AuthorizeResultResponse {
|
|
|
140
139
|
}
|
|
141
140
|
}
|
|
142
141
|
if (Symbol.dispose) AuthorizeResultResponse.prototype[Symbol.dispose] = AuthorizeResultResponse.prototype.free;
|
|
143
|
-
exports.AuthorizeResultResponse = AuthorizeResultResponse;
|
|
144
142
|
|
|
145
143
|
/**
|
|
146
144
|
* The instance of the Cedarling application.
|
|
147
145
|
*/
|
|
148
|
-
class Cedarling {
|
|
146
|
+
export class Cedarling {
|
|
149
147
|
static __wrap(ptr) {
|
|
150
148
|
ptr = ptr >>> 0;
|
|
151
149
|
const obj = Object.create(Cedarling.prototype);
|
|
@@ -478,13 +476,12 @@ class Cedarling {
|
|
|
478
476
|
}
|
|
479
477
|
}
|
|
480
478
|
if (Symbol.dispose) Cedarling.prototype[Symbol.dispose] = Cedarling.prototype.free;
|
|
481
|
-
exports.Cedarling = Cedarling;
|
|
482
479
|
|
|
483
480
|
/**
|
|
484
481
|
* A WASM wrapper for the Rust `cedarling::DataEntry` struct.
|
|
485
482
|
* Represents a data entry in the DataStore with value and metadata.
|
|
486
483
|
*/
|
|
487
|
-
class DataEntry {
|
|
484
|
+
export class DataEntry {
|
|
488
485
|
static __wrap(ptr) {
|
|
489
486
|
ptr = ptr >>> 0;
|
|
490
487
|
const obj = Object.create(DataEntry.prototype);
|
|
@@ -643,13 +640,12 @@ class DataEntry {
|
|
|
643
640
|
}
|
|
644
641
|
}
|
|
645
642
|
if (Symbol.dispose) DataEntry.prototype[Symbol.dispose] = DataEntry.prototype.free;
|
|
646
|
-
exports.DataEntry = DataEntry;
|
|
647
643
|
|
|
648
644
|
/**
|
|
649
645
|
* A WASM wrapper for the Rust `cedarling::DataStoreStats` struct.
|
|
650
646
|
* Statistics about the DataStore.
|
|
651
647
|
*/
|
|
652
|
-
class DataStoreStats {
|
|
648
|
+
export class DataStoreStats {
|
|
653
649
|
static __wrap(ptr) {
|
|
654
650
|
ptr = ptr >>> 0;
|
|
655
651
|
const obj = Object.create(DataStoreStats.prototype);
|
|
@@ -820,7 +816,6 @@ class DataStoreStats {
|
|
|
820
816
|
}
|
|
821
817
|
}
|
|
822
818
|
if (Symbol.dispose) DataStoreStats.prototype[Symbol.dispose] = DataStoreStats.prototype.free;
|
|
823
|
-
exports.DataStoreStats = DataStoreStats;
|
|
824
819
|
|
|
825
820
|
/**
|
|
826
821
|
* Diagnostics
|
|
@@ -828,7 +823,7 @@ exports.DataStoreStats = DataStoreStats;
|
|
|
828
823
|
*
|
|
829
824
|
* Provides detailed information about how a policy decision was made, including policies that contributed to the decision and any errors encountered during evaluation.
|
|
830
825
|
*/
|
|
831
|
-
class Diagnostics {
|
|
826
|
+
export class Diagnostics {
|
|
832
827
|
static __wrap(ptr) {
|
|
833
828
|
ptr = ptr >>> 0;
|
|
834
829
|
const obj = Object.create(Diagnostics.prototype);
|
|
@@ -872,9 +867,8 @@ class Diagnostics {
|
|
|
872
867
|
}
|
|
873
868
|
}
|
|
874
869
|
if (Symbol.dispose) Diagnostics.prototype[Symbol.dispose] = Diagnostics.prototype.free;
|
|
875
|
-
exports.Diagnostics = Diagnostics;
|
|
876
870
|
|
|
877
|
-
class IntoUnderlyingByteSource {
|
|
871
|
+
export class IntoUnderlyingByteSource {
|
|
878
872
|
__destroy_into_raw() {
|
|
879
873
|
const ptr = this.__wbg_ptr;
|
|
880
874
|
this.__wbg_ptr = 0;
|
|
@@ -919,9 +913,8 @@ class IntoUnderlyingByteSource {
|
|
|
919
913
|
}
|
|
920
914
|
}
|
|
921
915
|
if (Symbol.dispose) IntoUnderlyingByteSource.prototype[Symbol.dispose] = IntoUnderlyingByteSource.prototype.free;
|
|
922
|
-
exports.IntoUnderlyingByteSource = IntoUnderlyingByteSource;
|
|
923
916
|
|
|
924
|
-
class IntoUnderlyingSink {
|
|
917
|
+
export class IntoUnderlyingSink {
|
|
925
918
|
__destroy_into_raw() {
|
|
926
919
|
const ptr = this.__wbg_ptr;
|
|
927
920
|
this.__wbg_ptr = 0;
|
|
@@ -959,9 +952,8 @@ class IntoUnderlyingSink {
|
|
|
959
952
|
}
|
|
960
953
|
}
|
|
961
954
|
if (Symbol.dispose) IntoUnderlyingSink.prototype[Symbol.dispose] = IntoUnderlyingSink.prototype.free;
|
|
962
|
-
exports.IntoUnderlyingSink = IntoUnderlyingSink;
|
|
963
955
|
|
|
964
|
-
class IntoUnderlyingSource {
|
|
956
|
+
export class IntoUnderlyingSource {
|
|
965
957
|
__destroy_into_raw() {
|
|
966
958
|
const ptr = this.__wbg_ptr;
|
|
967
959
|
this.__wbg_ptr = 0;
|
|
@@ -986,13 +978,12 @@ class IntoUnderlyingSource {
|
|
|
986
978
|
}
|
|
987
979
|
}
|
|
988
980
|
if (Symbol.dispose) IntoUnderlyingSource.prototype[Symbol.dispose] = IntoUnderlyingSource.prototype.free;
|
|
989
|
-
exports.IntoUnderlyingSource = IntoUnderlyingSource;
|
|
990
981
|
|
|
991
982
|
/**
|
|
992
983
|
* A WASM wrapper for the Rust `cedarling::MultiIssuerAuthorizeResult` struct.
|
|
993
984
|
* Represents the result of a multi-issuer authorization request.
|
|
994
985
|
*/
|
|
995
|
-
class MultiIssuerAuthorizeResult {
|
|
986
|
+
export class MultiIssuerAuthorizeResult {
|
|
996
987
|
static __wrap(ptr) {
|
|
997
988
|
ptr = ptr >>> 0;
|
|
998
989
|
const obj = Object.create(MultiIssuerAuthorizeResult.prototype);
|
|
@@ -1089,7 +1080,6 @@ class MultiIssuerAuthorizeResult {
|
|
|
1089
1080
|
}
|
|
1090
1081
|
}
|
|
1091
1082
|
if (Symbol.dispose) MultiIssuerAuthorizeResult.prototype[Symbol.dispose] = MultiIssuerAuthorizeResult.prototype.free;
|
|
1092
|
-
exports.MultiIssuerAuthorizeResult = MultiIssuerAuthorizeResult;
|
|
1093
1083
|
|
|
1094
1084
|
/**
|
|
1095
1085
|
* PolicyEvaluationError
|
|
@@ -1097,7 +1087,7 @@ exports.MultiIssuerAuthorizeResult = MultiIssuerAuthorizeResult;
|
|
|
1097
1087
|
*
|
|
1098
1088
|
* Represents an error that occurred when evaluating a Cedar policy.
|
|
1099
1089
|
*/
|
|
1100
|
-
class PolicyEvaluationError {
|
|
1090
|
+
export class PolicyEvaluationError {
|
|
1101
1091
|
static __wrap(ptr) {
|
|
1102
1092
|
ptr = ptr >>> 0;
|
|
1103
1093
|
const obj = Object.create(PolicyEvaluationError.prototype);
|
|
@@ -1149,7 +1139,6 @@ class PolicyEvaluationError {
|
|
|
1149
1139
|
}
|
|
1150
1140
|
}
|
|
1151
1141
|
if (Symbol.dispose) PolicyEvaluationError.prototype[Symbol.dispose] = PolicyEvaluationError.prototype.free;
|
|
1152
|
-
exports.PolicyEvaluationError = PolicyEvaluationError;
|
|
1153
1142
|
|
|
1154
1143
|
/**
|
|
1155
1144
|
* Create a new instance of the Cedarling application.
|
|
@@ -1157,11 +1146,10 @@ exports.PolicyEvaluationError = PolicyEvaluationError;
|
|
|
1157
1146
|
* @param {any} config
|
|
1158
1147
|
* @returns {Promise<Cedarling>}
|
|
1159
1148
|
*/
|
|
1160
|
-
function init(config) {
|
|
1149
|
+
export function init(config) {
|
|
1161
1150
|
const ret = wasm.init(config);
|
|
1162
1151
|
return ret;
|
|
1163
1152
|
}
|
|
1164
|
-
exports.init = init;
|
|
1165
1153
|
|
|
1166
1154
|
/**
|
|
1167
1155
|
* Create a new instance of the Cedarling application from archive bytes.
|
|
@@ -1183,11 +1171,10 @@ exports.init = init;
|
|
|
1183
1171
|
* @param {Uint8Array} archive_bytes
|
|
1184
1172
|
* @returns {Promise<Cedarling>}
|
|
1185
1173
|
*/
|
|
1186
|
-
function init_from_archive_bytes(config, archive_bytes) {
|
|
1174
|
+
export function init_from_archive_bytes(config, archive_bytes) {
|
|
1187
1175
|
const ret = wasm.init_from_archive_bytes(config, archive_bytes);
|
|
1188
1176
|
return ret;
|
|
1189
1177
|
}
|
|
1190
|
-
exports.init_from_archive_bytes = init_from_archive_bytes;
|
|
1191
1178
|
|
|
1192
1179
|
function __wbg_get_imports() {
|
|
1193
1180
|
const import0 = {
|
|
@@ -2131,7 +2118,15 @@ function takeFromExternrefTable0(idx) {
|
|
|
2131
2118
|
|
|
2132
2119
|
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
2133
2120
|
cachedTextDecoder.decode();
|
|
2121
|
+
const MAX_SAFARI_DECODE_BYTES = 2146435072;
|
|
2122
|
+
let numBytesDecoded = 0;
|
|
2134
2123
|
function decodeText(ptr, len) {
|
|
2124
|
+
numBytesDecoded += len;
|
|
2125
|
+
if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
|
|
2126
|
+
cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
2127
|
+
cachedTextDecoder.decode();
|
|
2128
|
+
numBytesDecoded = len;
|
|
2129
|
+
}
|
|
2135
2130
|
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
2136
2131
|
}
|
|
2137
2132
|
|
|
@@ -2150,8 +2145,95 @@ if (!('encodeInto' in cachedTextEncoder)) {
|
|
|
2150
2145
|
|
|
2151
2146
|
let WASM_VECTOR_LEN = 0;
|
|
2152
2147
|
|
|
2153
|
-
|
|
2154
|
-
|
|
2155
|
-
|
|
2156
|
-
|
|
2157
|
-
|
|
2148
|
+
let wasmModule, wasm;
|
|
2149
|
+
function __wbg_finalize_init(instance, module) {
|
|
2150
|
+
wasm = instance.exports;
|
|
2151
|
+
wasmModule = module;
|
|
2152
|
+
cachedDataViewMemory0 = null;
|
|
2153
|
+
cachedUint8ArrayMemory0 = null;
|
|
2154
|
+
wasm.__wbindgen_start();
|
|
2155
|
+
return wasm;
|
|
2156
|
+
}
|
|
2157
|
+
|
|
2158
|
+
async function __wbg_load(module, imports) {
|
|
2159
|
+
if (typeof Response === 'function' && module instanceof Response) {
|
|
2160
|
+
if (typeof WebAssembly.instantiateStreaming === 'function') {
|
|
2161
|
+
try {
|
|
2162
|
+
return await WebAssembly.instantiateStreaming(module, imports);
|
|
2163
|
+
} catch (e) {
|
|
2164
|
+
const validResponse = module.ok && expectedResponseType(module.type);
|
|
2165
|
+
|
|
2166
|
+
if (validResponse && module.headers.get('Content-Type') !== 'application/wasm') {
|
|
2167
|
+
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);
|
|
2168
|
+
|
|
2169
|
+
} else { throw e; }
|
|
2170
|
+
}
|
|
2171
|
+
}
|
|
2172
|
+
|
|
2173
|
+
const bytes = await module.arrayBuffer();
|
|
2174
|
+
return await WebAssembly.instantiate(bytes, imports);
|
|
2175
|
+
} else {
|
|
2176
|
+
const instance = await WebAssembly.instantiate(module, imports);
|
|
2177
|
+
|
|
2178
|
+
if (instance instanceof WebAssembly.Instance) {
|
|
2179
|
+
return { instance, module };
|
|
2180
|
+
} else {
|
|
2181
|
+
return instance;
|
|
2182
|
+
}
|
|
2183
|
+
}
|
|
2184
|
+
|
|
2185
|
+
function expectedResponseType(type) {
|
|
2186
|
+
switch (type) {
|
|
2187
|
+
case 'basic': case 'cors': case 'default': return true;
|
|
2188
|
+
}
|
|
2189
|
+
return false;
|
|
2190
|
+
}
|
|
2191
|
+
}
|
|
2192
|
+
|
|
2193
|
+
function initSync(module) {
|
|
2194
|
+
if (wasm !== undefined) return wasm;
|
|
2195
|
+
|
|
2196
|
+
|
|
2197
|
+
if (module !== undefined) {
|
|
2198
|
+
if (Object.getPrototypeOf(module) === Object.prototype) {
|
|
2199
|
+
({module} = module)
|
|
2200
|
+
} else {
|
|
2201
|
+
console.warn('using deprecated parameters for `initSync()`; pass a single object instead')
|
|
2202
|
+
}
|
|
2203
|
+
}
|
|
2204
|
+
|
|
2205
|
+
const imports = __wbg_get_imports();
|
|
2206
|
+
if (!(module instanceof WebAssembly.Module)) {
|
|
2207
|
+
module = new WebAssembly.Module(module);
|
|
2208
|
+
}
|
|
2209
|
+
const instance = new WebAssembly.Instance(module, imports);
|
|
2210
|
+
return __wbg_finalize_init(instance, module);
|
|
2211
|
+
}
|
|
2212
|
+
|
|
2213
|
+
async function __wbg_init(module_or_path) {
|
|
2214
|
+
if (wasm !== undefined) return wasm;
|
|
2215
|
+
|
|
2216
|
+
|
|
2217
|
+
if (module_or_path !== undefined) {
|
|
2218
|
+
if (Object.getPrototypeOf(module_or_path) === Object.prototype) {
|
|
2219
|
+
({module_or_path} = module_or_path)
|
|
2220
|
+
} else {
|
|
2221
|
+
console.warn('using deprecated parameters for the initialization function; pass a single object instead')
|
|
2222
|
+
}
|
|
2223
|
+
}
|
|
2224
|
+
|
|
2225
|
+
if (module_or_path === undefined) {
|
|
2226
|
+
module_or_path = new URL('cedarling_wasm_bg.wasm', import.meta.url);
|
|
2227
|
+
}
|
|
2228
|
+
const imports = __wbg_get_imports();
|
|
2229
|
+
|
|
2230
|
+
if (typeof module_or_path === 'string' || (typeof Request === 'function' && module_or_path instanceof Request) || (typeof URL === 'function' && module_or_path instanceof URL)) {
|
|
2231
|
+
module_or_path = fetch(module_or_path);
|
|
2232
|
+
}
|
|
2233
|
+
|
|
2234
|
+
const { instance, module } = await __wbg_load(await module_or_path, imports);
|
|
2235
|
+
|
|
2236
|
+
return __wbg_finalize_init(instance, module);
|
|
2237
|
+
}
|
|
2238
|
+
|
|
2239
|
+
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.339
|
|
5
|
+
"version": "0.0.339",
|
|
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
|
}
|