@janssenproject/cedarling_wasm 0.0.391-nodejs → 0.0.392
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 +150 -0
- package/cedarling_wasm.js +119 -37
- package/cedarling_wasm_bg.wasm +0 -0
- package/package.json +6 -2
package/cedarling_wasm.d.ts
CHANGED
|
@@ -524,3 +524,153 @@ export function init(config: any): Promise<Cedarling>;
|
|
|
524
524
|
* ```
|
|
525
525
|
*/
|
|
526
526
|
export function init_from_archive_bytes(config: any, archive_bytes: Uint8Array): Promise<Cedarling>;
|
|
527
|
+
|
|
528
|
+
export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
|
|
529
|
+
|
|
530
|
+
export interface InitOutput {
|
|
531
|
+
readonly memory: WebAssembly.Memory;
|
|
532
|
+
readonly __wbg_authorizeresult_free: (a: number, b: number) => void;
|
|
533
|
+
readonly __wbg_authorizeresultresponse_free: (a: number, b: number) => void;
|
|
534
|
+
readonly __wbg_cedarling_free: (a: number, b: number) => void;
|
|
535
|
+
readonly __wbg_dataentry_free: (a: number, b: number) => void;
|
|
536
|
+
readonly __wbg_datastorestats_free: (a: number, b: number) => void;
|
|
537
|
+
readonly __wbg_diagnostics_free: (a: number, b: number) => void;
|
|
538
|
+
readonly __wbg_get_authorizeresult_decision: (a: number) => number;
|
|
539
|
+
readonly __wbg_get_authorizeresult_request_id: (a: number) => [number, number];
|
|
540
|
+
readonly __wbg_get_authorizeresult_response: (a: number) => number;
|
|
541
|
+
readonly __wbg_get_dataentry_access_count: (a: number) => bigint;
|
|
542
|
+
readonly __wbg_get_dataentry_created_at: (a: number) => [number, number];
|
|
543
|
+
readonly __wbg_get_dataentry_data_type: (a: number) => [number, number];
|
|
544
|
+
readonly __wbg_get_dataentry_expires_at: (a: number) => [number, number];
|
|
545
|
+
readonly __wbg_get_dataentry_key: (a: number) => [number, number];
|
|
546
|
+
readonly __wbg_get_datastorestats_avg_entry_size_bytes: (a: number) => number;
|
|
547
|
+
readonly __wbg_get_datastorestats_capacity_usage_percent: (a: number) => number;
|
|
548
|
+
readonly __wbg_get_datastorestats_entry_count: (a: number) => number;
|
|
549
|
+
readonly __wbg_get_datastorestats_max_entries: (a: number) => number;
|
|
550
|
+
readonly __wbg_get_datastorestats_max_entry_size: (a: number) => number;
|
|
551
|
+
readonly __wbg_get_datastorestats_memory_alert_threshold: (a: number) => number;
|
|
552
|
+
readonly __wbg_get_datastorestats_memory_alert_triggered: (a: number) => number;
|
|
553
|
+
readonly __wbg_get_datastorestats_metrics_enabled: (a: number) => number;
|
|
554
|
+
readonly __wbg_get_datastorestats_total_size_bytes: (a: number) => number;
|
|
555
|
+
readonly __wbg_policyevaluationerror_free: (a: number, b: number) => void;
|
|
556
|
+
readonly __wbg_set_authorizeresult_decision: (a: number, b: number) => void;
|
|
557
|
+
readonly __wbg_set_authorizeresult_request_id: (a: number, b: number, c: number) => void;
|
|
558
|
+
readonly __wbg_set_authorizeresult_response: (a: number, b: number) => void;
|
|
559
|
+
readonly __wbg_set_dataentry_access_count: (a: number, b: bigint) => void;
|
|
560
|
+
readonly __wbg_set_dataentry_created_at: (a: number, b: number, c: number) => void;
|
|
561
|
+
readonly __wbg_set_dataentry_data_type: (a: number, b: number, c: number) => void;
|
|
562
|
+
readonly __wbg_set_dataentry_expires_at: (a: number, b: number, c: number) => void;
|
|
563
|
+
readonly __wbg_set_dataentry_key: (a: number, b: number, c: number) => void;
|
|
564
|
+
readonly __wbg_set_datastorestats_avg_entry_size_bytes: (a: number, b: number) => void;
|
|
565
|
+
readonly __wbg_set_datastorestats_capacity_usage_percent: (a: number, b: number) => void;
|
|
566
|
+
readonly __wbg_set_datastorestats_entry_count: (a: number, b: number) => void;
|
|
567
|
+
readonly __wbg_set_datastorestats_max_entries: (a: number, b: number) => void;
|
|
568
|
+
readonly __wbg_set_datastorestats_max_entry_size: (a: number, b: number) => void;
|
|
569
|
+
readonly __wbg_set_datastorestats_memory_alert_threshold: (a: number, b: number) => void;
|
|
570
|
+
readonly __wbg_set_datastorestats_memory_alert_triggered: (a: number, b: number) => void;
|
|
571
|
+
readonly __wbg_set_datastorestats_metrics_enabled: (a: number, b: number) => void;
|
|
572
|
+
readonly __wbg_set_datastorestats_total_size_bytes: (a: number, b: number) => void;
|
|
573
|
+
readonly authorizeresult_json_string: (a: number) => [number, number];
|
|
574
|
+
readonly authorizeresultresponse_decision: (a: number) => number;
|
|
575
|
+
readonly authorizeresultresponse_diagnostics: (a: number) => number;
|
|
576
|
+
readonly cedarling_authorize_multi_issuer: (a: number, b: any) => any;
|
|
577
|
+
readonly cedarling_authorize_unsigned: (a: number, b: any) => any;
|
|
578
|
+
readonly cedarling_clear_data_ctx: (a: number) => [number, number];
|
|
579
|
+
readonly cedarling_failed_trusted_issuer_ids: (a: number) => any;
|
|
580
|
+
readonly cedarling_get_data_ctx: (a: number, b: number, c: number) => [number, number, number];
|
|
581
|
+
readonly cedarling_get_data_entry_ctx: (a: number, b: number, c: number) => [number, number, number];
|
|
582
|
+
readonly cedarling_get_log_by_id: (a: number, b: number, c: number) => [number, number, number];
|
|
583
|
+
readonly cedarling_get_log_ids: (a: number) => any;
|
|
584
|
+
readonly cedarling_get_logs_by_request_id: (a: number, b: number, c: number) => [number, number, number, number];
|
|
585
|
+
readonly cedarling_get_logs_by_request_id_and_tag: (a: number, b: number, c: number, d: number, e: number) => [number, number, number, number];
|
|
586
|
+
readonly cedarling_get_logs_by_tag: (a: number, b: number, c: number) => [number, number, number, number];
|
|
587
|
+
readonly cedarling_get_stats_ctx: (a: number) => [number, number, number];
|
|
588
|
+
readonly cedarling_is_trusted_issuer_loaded_by_iss: (a: number, b: number, c: number) => number;
|
|
589
|
+
readonly cedarling_is_trusted_issuer_loaded_by_name: (a: number, b: number, c: number) => number;
|
|
590
|
+
readonly cedarling_list_data_ctx: (a: number) => [number, number, number];
|
|
591
|
+
readonly cedarling_loaded_trusted_issuer_ids: (a: number) => any;
|
|
592
|
+
readonly cedarling_loaded_trusted_issuers_count: (a: number) => number;
|
|
593
|
+
readonly cedarling_new: (a: any) => any;
|
|
594
|
+
readonly cedarling_new_from_map: (a: any) => any;
|
|
595
|
+
readonly cedarling_pop_logs: (a: number) => [number, number, number];
|
|
596
|
+
readonly cedarling_push_data_ctx: (a: number, b: number, c: number, d: any, e: number, f: bigint) => [number, number];
|
|
597
|
+
readonly cedarling_remove_data_ctx: (a: number, b: number, c: number) => [number, number, number];
|
|
598
|
+
readonly cedarling_shut_down: (a: number) => any;
|
|
599
|
+
readonly cedarling_total_issuers: (a: number) => number;
|
|
600
|
+
readonly dataentry_json_string: (a: number) => [number, number];
|
|
601
|
+
readonly dataentry_value: (a: number) => [number, number, number];
|
|
602
|
+
readonly datastorestats_json_string: (a: number) => [number, number];
|
|
603
|
+
readonly diagnostics_errors: (a: number) => [number, number];
|
|
604
|
+
readonly diagnostics_reason: (a: number) => [number, number];
|
|
605
|
+
readonly init: (a: any) => any;
|
|
606
|
+
readonly init_from_archive_bytes: (a: any, b: any) => any;
|
|
607
|
+
readonly multiissuerauthorizeresult_json_string: (a: number) => [number, number];
|
|
608
|
+
readonly policyevaluationerror_error: (a: number) => [number, number];
|
|
609
|
+
readonly policyevaluationerror_id: (a: number) => [number, number];
|
|
610
|
+
readonly __wbg_get_multiissuerauthorizeresult_decision: (a: number) => number;
|
|
611
|
+
readonly __wbg_set_multiissuerauthorizeresult_response: (a: number, b: number) => void;
|
|
612
|
+
readonly __wbg_set_multiissuerauthorizeresult_request_id: (a: number, b: number, c: number) => void;
|
|
613
|
+
readonly __wbg_set_multiissuerauthorizeresult_decision: (a: number, b: number) => void;
|
|
614
|
+
readonly __wbg_get_multiissuerauthorizeresult_response: (a: number) => number;
|
|
615
|
+
readonly __wbg_get_multiissuerauthorizeresult_request_id: (a: number) => [number, number];
|
|
616
|
+
readonly __wbg_multiissuerauthorizeresult_free: (a: number, b: number) => void;
|
|
617
|
+
readonly __wbg_intounderlyingbytesource_free: (a: number, b: number) => void;
|
|
618
|
+
readonly __wbg_intounderlyingsink_free: (a: number, b: number) => void;
|
|
619
|
+
readonly __wbg_intounderlyingsource_free: (a: number, b: number) => void;
|
|
620
|
+
readonly intounderlyingbytesource_autoAllocateChunkSize: (a: number) => number;
|
|
621
|
+
readonly intounderlyingbytesource_cancel: (a: number) => void;
|
|
622
|
+
readonly intounderlyingbytesource_pull: (a: number, b: any) => any;
|
|
623
|
+
readonly intounderlyingbytesource_start: (a: number, b: any) => void;
|
|
624
|
+
readonly intounderlyingbytesource_type: (a: number) => number;
|
|
625
|
+
readonly intounderlyingsink_abort: (a: number, b: any) => any;
|
|
626
|
+
readonly intounderlyingsink_close: (a: number) => any;
|
|
627
|
+
readonly intounderlyingsink_write: (a: number, b: any) => any;
|
|
628
|
+
readonly intounderlyingsource_cancel: (a: number) => void;
|
|
629
|
+
readonly intounderlyingsource_pull: (a: number, b: any) => any;
|
|
630
|
+
readonly rust_zstd_wasm_shim_calloc: (a: number, b: number) => number;
|
|
631
|
+
readonly rust_zstd_wasm_shim_free: (a: number) => void;
|
|
632
|
+
readonly rust_zstd_wasm_shim_malloc: (a: number) => number;
|
|
633
|
+
readonly rust_zstd_wasm_shim_memcmp: (a: number, b: number, c: number) => number;
|
|
634
|
+
readonly rust_zstd_wasm_shim_memcpy: (a: number, b: number, c: number) => number;
|
|
635
|
+
readonly rust_zstd_wasm_shim_memmove: (a: number, b: number, c: number) => number;
|
|
636
|
+
readonly rust_zstd_wasm_shim_memset: (a: number, b: number, c: number) => number;
|
|
637
|
+
readonly rust_zstd_wasm_shim_qsort: (a: number, b: number, c: number, d: number) => void;
|
|
638
|
+
readonly wasm_bindgen__convert__closures_____invoke__h122aa852e025a273: (a: number, b: number, c: any) => [number, number];
|
|
639
|
+
readonly wasm_bindgen__convert__closures_____invoke__h1aa6bfccca23b638: (a: number, b: number, c: any, d: any) => void;
|
|
640
|
+
readonly wasm_bindgen__convert__closures_____invoke__hd100e35fa7d3225c: (a: number, b: number, c: any) => void;
|
|
641
|
+
readonly wasm_bindgen__convert__closures_____invoke__h461784cf6dfc2afa: (a: number, b: number) => void;
|
|
642
|
+
readonly wasm_bindgen__convert__closures_____invoke__h057874c537728a90: (a: number, b: number) => void;
|
|
643
|
+
readonly wasm_bindgen__convert__closures_____invoke__hc5f2b2e319a50b97: (a: number, b: number) => void;
|
|
644
|
+
readonly __wbindgen_malloc: (a: number, b: number) => number;
|
|
645
|
+
readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|
|
646
|
+
readonly __wbindgen_exn_store: (a: number) => void;
|
|
647
|
+
readonly __externref_table_alloc: () => number;
|
|
648
|
+
readonly __wbindgen_externrefs: WebAssembly.Table;
|
|
649
|
+
readonly __wbindgen_destroy_closure: (a: number, b: number) => void;
|
|
650
|
+
readonly __wbindgen_free: (a: number, b: number, c: number) => void;
|
|
651
|
+
readonly __externref_table_dealloc: (a: number) => void;
|
|
652
|
+
readonly __externref_drop_slice: (a: number, b: number) => void;
|
|
653
|
+
readonly __wbindgen_start: () => void;
|
|
654
|
+
}
|
|
655
|
+
|
|
656
|
+
export type SyncInitInput = BufferSource | WebAssembly.Module;
|
|
657
|
+
|
|
658
|
+
/**
|
|
659
|
+
* Instantiates the given `module`, which can either be bytes or
|
|
660
|
+
* a precompiled `WebAssembly.Module`.
|
|
661
|
+
*
|
|
662
|
+
* @param {{ module: SyncInitInput }} module - Passing `SyncInitInput` directly is deprecated.
|
|
663
|
+
*
|
|
664
|
+
* @returns {InitOutput}
|
|
665
|
+
*/
|
|
666
|
+
export function initSync(module: { module: SyncInitInput } | SyncInitInput): InitOutput;
|
|
667
|
+
|
|
668
|
+
/**
|
|
669
|
+
* If `module_or_path` is {RequestInfo} or {URL}, makes a request and
|
|
670
|
+
* for everything else, calls `WebAssembly.instantiate` directly.
|
|
671
|
+
*
|
|
672
|
+
* @param {{ module_or_path: InitInput | Promise<InitInput> }} module_or_path - Passing `InitInput` directly is deprecated.
|
|
673
|
+
*
|
|
674
|
+
* @returns {Promise<InitOutput>}
|
|
675
|
+
*/
|
|
676
|
+
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
|
const obj = Object.create(AuthorizeResult.prototype);
|
|
10
10
|
obj.__wbg_ptr = ptr;
|
|
@@ -104,13 +104,12 @@ class AuthorizeResult {
|
|
|
104
104
|
}
|
|
105
105
|
}
|
|
106
106
|
if (Symbol.dispose) AuthorizeResult.prototype[Symbol.dispose] = AuthorizeResult.prototype.free;
|
|
107
|
-
exports.AuthorizeResult = AuthorizeResult;
|
|
108
107
|
|
|
109
108
|
/**
|
|
110
109
|
* A WASM wrapper for the Rust `cedar_policy::Response` struct.
|
|
111
110
|
* Represents the result of an authorization request.
|
|
112
111
|
*/
|
|
113
|
-
class AuthorizeResultResponse {
|
|
112
|
+
export class AuthorizeResultResponse {
|
|
114
113
|
static __wrap(ptr) {
|
|
115
114
|
const obj = Object.create(AuthorizeResultResponse.prototype);
|
|
116
115
|
obj.__wbg_ptr = ptr;
|
|
@@ -145,12 +144,11 @@ class AuthorizeResultResponse {
|
|
|
145
144
|
}
|
|
146
145
|
}
|
|
147
146
|
if (Symbol.dispose) AuthorizeResultResponse.prototype[Symbol.dispose] = AuthorizeResultResponse.prototype.free;
|
|
148
|
-
exports.AuthorizeResultResponse = AuthorizeResultResponse;
|
|
149
147
|
|
|
150
148
|
/**
|
|
151
149
|
* The instance of the Cedarling application.
|
|
152
150
|
*/
|
|
153
|
-
class Cedarling {
|
|
151
|
+
export class Cedarling {
|
|
154
152
|
static __wrap(ptr) {
|
|
155
153
|
const obj = Object.create(Cedarling.prototype);
|
|
156
154
|
obj.__wbg_ptr = ptr;
|
|
@@ -585,13 +583,12 @@ class Cedarling {
|
|
|
585
583
|
}
|
|
586
584
|
}
|
|
587
585
|
if (Symbol.dispose) Cedarling.prototype[Symbol.dispose] = Cedarling.prototype.free;
|
|
588
|
-
exports.Cedarling = Cedarling;
|
|
589
586
|
|
|
590
587
|
/**
|
|
591
588
|
* A WASM wrapper for the Rust `cedarling::DataEntry` struct.
|
|
592
589
|
* Represents a data entry in the DataStore with value and metadata.
|
|
593
590
|
*/
|
|
594
|
-
class DataEntry {
|
|
591
|
+
export class DataEntry {
|
|
595
592
|
static __wrap(ptr) {
|
|
596
593
|
const obj = Object.create(DataEntry.prototype);
|
|
597
594
|
obj.__wbg_ptr = ptr;
|
|
@@ -749,13 +746,12 @@ class DataEntry {
|
|
|
749
746
|
}
|
|
750
747
|
}
|
|
751
748
|
if (Symbol.dispose) DataEntry.prototype[Symbol.dispose] = DataEntry.prototype.free;
|
|
752
|
-
exports.DataEntry = DataEntry;
|
|
753
749
|
|
|
754
750
|
/**
|
|
755
751
|
* A WASM wrapper for the Rust `cedarling::DataStoreStats` struct.
|
|
756
752
|
* Statistics about the DataStore.
|
|
757
753
|
*/
|
|
758
|
-
class DataStoreStats {
|
|
754
|
+
export class DataStoreStats {
|
|
759
755
|
static __wrap(ptr) {
|
|
760
756
|
const obj = Object.create(DataStoreStats.prototype);
|
|
761
757
|
obj.__wbg_ptr = ptr;
|
|
@@ -925,7 +921,6 @@ class DataStoreStats {
|
|
|
925
921
|
}
|
|
926
922
|
}
|
|
927
923
|
if (Symbol.dispose) DataStoreStats.prototype[Symbol.dispose] = DataStoreStats.prototype.free;
|
|
928
|
-
exports.DataStoreStats = DataStoreStats;
|
|
929
924
|
|
|
930
925
|
/**
|
|
931
926
|
* Diagnostics
|
|
@@ -933,7 +928,7 @@ exports.DataStoreStats = DataStoreStats;
|
|
|
933
928
|
*
|
|
934
929
|
* Provides detailed information about how a policy decision was made, including policies that contributed to the decision and any errors encountered during evaluation.
|
|
935
930
|
*/
|
|
936
|
-
class Diagnostics {
|
|
931
|
+
export class Diagnostics {
|
|
937
932
|
static __wrap(ptr) {
|
|
938
933
|
const obj = Object.create(Diagnostics.prototype);
|
|
939
934
|
obj.__wbg_ptr = ptr;
|
|
@@ -976,9 +971,8 @@ class Diagnostics {
|
|
|
976
971
|
}
|
|
977
972
|
}
|
|
978
973
|
if (Symbol.dispose) Diagnostics.prototype[Symbol.dispose] = Diagnostics.prototype.free;
|
|
979
|
-
exports.Diagnostics = Diagnostics;
|
|
980
974
|
|
|
981
|
-
class IntoUnderlyingByteSource {
|
|
975
|
+
export class IntoUnderlyingByteSource {
|
|
982
976
|
__destroy_into_raw() {
|
|
983
977
|
const ptr = this.__wbg_ptr;
|
|
984
978
|
this.__wbg_ptr = 0;
|
|
@@ -1023,9 +1017,8 @@ class IntoUnderlyingByteSource {
|
|
|
1023
1017
|
}
|
|
1024
1018
|
}
|
|
1025
1019
|
if (Symbol.dispose) IntoUnderlyingByteSource.prototype[Symbol.dispose] = IntoUnderlyingByteSource.prototype.free;
|
|
1026
|
-
exports.IntoUnderlyingByteSource = IntoUnderlyingByteSource;
|
|
1027
1020
|
|
|
1028
|
-
class IntoUnderlyingSink {
|
|
1021
|
+
export class IntoUnderlyingSink {
|
|
1029
1022
|
__destroy_into_raw() {
|
|
1030
1023
|
const ptr = this.__wbg_ptr;
|
|
1031
1024
|
this.__wbg_ptr = 0;
|
|
@@ -1063,9 +1056,8 @@ class IntoUnderlyingSink {
|
|
|
1063
1056
|
}
|
|
1064
1057
|
}
|
|
1065
1058
|
if (Symbol.dispose) IntoUnderlyingSink.prototype[Symbol.dispose] = IntoUnderlyingSink.prototype.free;
|
|
1066
|
-
exports.IntoUnderlyingSink = IntoUnderlyingSink;
|
|
1067
1059
|
|
|
1068
|
-
class IntoUnderlyingSource {
|
|
1060
|
+
export class IntoUnderlyingSource {
|
|
1069
1061
|
__destroy_into_raw() {
|
|
1070
1062
|
const ptr = this.__wbg_ptr;
|
|
1071
1063
|
this.__wbg_ptr = 0;
|
|
@@ -1090,13 +1082,12 @@ class IntoUnderlyingSource {
|
|
|
1090
1082
|
}
|
|
1091
1083
|
}
|
|
1092
1084
|
if (Symbol.dispose) IntoUnderlyingSource.prototype[Symbol.dispose] = IntoUnderlyingSource.prototype.free;
|
|
1093
|
-
exports.IntoUnderlyingSource = IntoUnderlyingSource;
|
|
1094
1085
|
|
|
1095
1086
|
/**
|
|
1096
1087
|
* A WASM wrapper for the Rust `cedarling::MultiIssuerAuthorizeResult` struct.
|
|
1097
1088
|
* Represents the result of a multi-issuer authorization request.
|
|
1098
1089
|
*/
|
|
1099
|
-
class MultiIssuerAuthorizeResult {
|
|
1090
|
+
export class MultiIssuerAuthorizeResult {
|
|
1100
1091
|
static __wrap(ptr) {
|
|
1101
1092
|
const obj = Object.create(MultiIssuerAuthorizeResult.prototype);
|
|
1102
1093
|
obj.__wbg_ptr = ptr;
|
|
@@ -1192,7 +1183,6 @@ class MultiIssuerAuthorizeResult {
|
|
|
1192
1183
|
}
|
|
1193
1184
|
}
|
|
1194
1185
|
if (Symbol.dispose) MultiIssuerAuthorizeResult.prototype[Symbol.dispose] = MultiIssuerAuthorizeResult.prototype.free;
|
|
1195
|
-
exports.MultiIssuerAuthorizeResult = MultiIssuerAuthorizeResult;
|
|
1196
1186
|
|
|
1197
1187
|
/**
|
|
1198
1188
|
* PolicyEvaluationError
|
|
@@ -1200,7 +1190,7 @@ exports.MultiIssuerAuthorizeResult = MultiIssuerAuthorizeResult;
|
|
|
1200
1190
|
*
|
|
1201
1191
|
* Represents an error that occurred when evaluating a Cedar policy.
|
|
1202
1192
|
*/
|
|
1203
|
-
class PolicyEvaluationError {
|
|
1193
|
+
export class PolicyEvaluationError {
|
|
1204
1194
|
static __wrap(ptr) {
|
|
1205
1195
|
const obj = Object.create(PolicyEvaluationError.prototype);
|
|
1206
1196
|
obj.__wbg_ptr = ptr;
|
|
@@ -1251,7 +1241,6 @@ class PolicyEvaluationError {
|
|
|
1251
1241
|
}
|
|
1252
1242
|
}
|
|
1253
1243
|
if (Symbol.dispose) PolicyEvaluationError.prototype[Symbol.dispose] = PolicyEvaluationError.prototype.free;
|
|
1254
|
-
exports.PolicyEvaluationError = PolicyEvaluationError;
|
|
1255
1244
|
|
|
1256
1245
|
/**
|
|
1257
1246
|
* Create a new instance of the Cedarling application.
|
|
@@ -1259,11 +1248,10 @@ exports.PolicyEvaluationError = PolicyEvaluationError;
|
|
|
1259
1248
|
* @param {any} config
|
|
1260
1249
|
* @returns {Promise<Cedarling>}
|
|
1261
1250
|
*/
|
|
1262
|
-
function init(config) {
|
|
1251
|
+
export function init(config) {
|
|
1263
1252
|
const ret = wasm.init(config);
|
|
1264
1253
|
return ret;
|
|
1265
1254
|
}
|
|
1266
|
-
exports.init = init;
|
|
1267
1255
|
|
|
1268
1256
|
/**
|
|
1269
1257
|
* Create a new instance of the Cedarling application from archive bytes.
|
|
@@ -1285,11 +1273,10 @@ exports.init = init;
|
|
|
1285
1273
|
* @param {Uint8Array} archive_bytes
|
|
1286
1274
|
* @returns {Promise<Cedarling>}
|
|
1287
1275
|
*/
|
|
1288
|
-
function init_from_archive_bytes(config, archive_bytes) {
|
|
1276
|
+
export function init_from_archive_bytes(config, archive_bytes) {
|
|
1289
1277
|
const ret = wasm.init_from_archive_bytes(config, archive_bytes);
|
|
1290
1278
|
return ret;
|
|
1291
1279
|
}
|
|
1292
|
-
exports.init_from_archive_bytes = init_from_archive_bytes;
|
|
1293
1280
|
function __wbg_get_imports() {
|
|
1294
1281
|
const import0 = {
|
|
1295
1282
|
__proto__: null,
|
|
@@ -1902,27 +1889,27 @@ function __wbg_get_imports() {
|
|
|
1902
1889
|
console.warn(...arg0);
|
|
1903
1890
|
},
|
|
1904
1891
|
__wbindgen_cast_0000000000000001: function(arg0, arg1) {
|
|
1905
|
-
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx:
|
|
1892
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 2217, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
|
|
1906
1893
|
const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h122aa852e025a273);
|
|
1907
1894
|
return ret;
|
|
1908
1895
|
},
|
|
1909
1896
|
__wbindgen_cast_0000000000000002: function(arg0, arg1) {
|
|
1910
|
-
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx:
|
|
1897
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 652, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
1911
1898
|
const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__hd100e35fa7d3225c);
|
|
1912
1899
|
return ret;
|
|
1913
1900
|
},
|
|
1914
1901
|
__wbindgen_cast_0000000000000003: function(arg0, arg1) {
|
|
1915
|
-
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [], shim_idx:
|
|
1902
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [], shim_idx: 563, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
1916
1903
|
const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h461784cf6dfc2afa);
|
|
1917
1904
|
return ret;
|
|
1918
1905
|
},
|
|
1919
1906
|
__wbindgen_cast_0000000000000004: function(arg0, arg1) {
|
|
1920
|
-
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [], shim_idx:
|
|
1907
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [], shim_idx: 608, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
1921
1908
|
const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h057874c537728a90);
|
|
1922
1909
|
return ret;
|
|
1923
1910
|
},
|
|
1924
1911
|
__wbindgen_cast_0000000000000005: function(arg0, arg1) {
|
|
1925
|
-
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [], shim_idx:
|
|
1912
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [], shim_idx: 770, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
1926
1913
|
const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__hc5f2b2e319a50b97);
|
|
1927
1914
|
return ret;
|
|
1928
1915
|
},
|
|
@@ -2248,7 +2235,15 @@ function takeFromExternrefTable0(idx) {
|
|
|
2248
2235
|
|
|
2249
2236
|
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
2250
2237
|
cachedTextDecoder.decode();
|
|
2238
|
+
const MAX_SAFARI_DECODE_BYTES = 2146435072;
|
|
2239
|
+
let numBytesDecoded = 0;
|
|
2251
2240
|
function decodeText(ptr, len) {
|
|
2241
|
+
numBytesDecoded += len;
|
|
2242
|
+
if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
|
|
2243
|
+
cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
2244
|
+
cachedTextDecoder.decode();
|
|
2245
|
+
numBytesDecoded = len;
|
|
2246
|
+
}
|
|
2252
2247
|
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
2253
2248
|
}
|
|
2254
2249
|
|
|
@@ -2267,9 +2262,96 @@ if (!('encodeInto' in cachedTextEncoder)) {
|
|
|
2267
2262
|
|
|
2268
2263
|
let WASM_VECTOR_LEN = 0;
|
|
2269
2264
|
|
|
2270
|
-
|
|
2271
|
-
|
|
2272
|
-
|
|
2273
|
-
|
|
2274
|
-
|
|
2275
|
-
|
|
2265
|
+
let wasmModule, wasmInstance, wasm;
|
|
2266
|
+
function __wbg_finalize_init(instance, module) {
|
|
2267
|
+
wasmInstance = instance;
|
|
2268
|
+
wasm = instance.exports;
|
|
2269
|
+
wasmModule = module;
|
|
2270
|
+
cachedDataViewMemory0 = null;
|
|
2271
|
+
cachedUint8ArrayMemory0 = null;
|
|
2272
|
+
wasm.__wbindgen_start();
|
|
2273
|
+
return wasm;
|
|
2274
|
+
}
|
|
2275
|
+
|
|
2276
|
+
async function __wbg_load(module, imports) {
|
|
2277
|
+
if (typeof Response === 'function' && module instanceof Response) {
|
|
2278
|
+
if (typeof WebAssembly.instantiateStreaming === 'function') {
|
|
2279
|
+
try {
|
|
2280
|
+
return await WebAssembly.instantiateStreaming(module, imports);
|
|
2281
|
+
} catch (e) {
|
|
2282
|
+
const validResponse = module.ok && expectedResponseType(module.type);
|
|
2283
|
+
|
|
2284
|
+
if (validResponse && module.headers.get('Content-Type') !== 'application/wasm') {
|
|
2285
|
+
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);
|
|
2286
|
+
|
|
2287
|
+
} else { throw e; }
|
|
2288
|
+
}
|
|
2289
|
+
}
|
|
2290
|
+
|
|
2291
|
+
const bytes = await module.arrayBuffer();
|
|
2292
|
+
return await WebAssembly.instantiate(bytes, imports);
|
|
2293
|
+
} else {
|
|
2294
|
+
const instance = await WebAssembly.instantiate(module, imports);
|
|
2295
|
+
|
|
2296
|
+
if (instance instanceof WebAssembly.Instance) {
|
|
2297
|
+
return { instance, module };
|
|
2298
|
+
} else {
|
|
2299
|
+
return instance;
|
|
2300
|
+
}
|
|
2301
|
+
}
|
|
2302
|
+
|
|
2303
|
+
function expectedResponseType(type) {
|
|
2304
|
+
switch (type) {
|
|
2305
|
+
case 'basic': case 'cors': case 'default': return true;
|
|
2306
|
+
}
|
|
2307
|
+
return false;
|
|
2308
|
+
}
|
|
2309
|
+
}
|
|
2310
|
+
|
|
2311
|
+
function initSync(module) {
|
|
2312
|
+
if (wasm !== undefined) return wasm;
|
|
2313
|
+
|
|
2314
|
+
|
|
2315
|
+
if (module !== undefined) {
|
|
2316
|
+
if (Object.getPrototypeOf(module) === Object.prototype) {
|
|
2317
|
+
({module} = module)
|
|
2318
|
+
} else {
|
|
2319
|
+
console.warn('using deprecated parameters for `initSync()`; pass a single object instead')
|
|
2320
|
+
}
|
|
2321
|
+
}
|
|
2322
|
+
|
|
2323
|
+
const imports = __wbg_get_imports();
|
|
2324
|
+
if (!(module instanceof WebAssembly.Module)) {
|
|
2325
|
+
module = new WebAssembly.Module(module);
|
|
2326
|
+
}
|
|
2327
|
+
const instance = new WebAssembly.Instance(module, imports);
|
|
2328
|
+
return __wbg_finalize_init(instance, module);
|
|
2329
|
+
}
|
|
2330
|
+
|
|
2331
|
+
async function __wbg_init(module_or_path) {
|
|
2332
|
+
if (wasm !== undefined) return wasm;
|
|
2333
|
+
|
|
2334
|
+
|
|
2335
|
+
if (module_or_path !== undefined) {
|
|
2336
|
+
if (Object.getPrototypeOf(module_or_path) === Object.prototype) {
|
|
2337
|
+
({module_or_path} = module_or_path)
|
|
2338
|
+
} else {
|
|
2339
|
+
console.warn('using deprecated parameters for the initialization function; pass a single object instead')
|
|
2340
|
+
}
|
|
2341
|
+
}
|
|
2342
|
+
|
|
2343
|
+
if (module_or_path === undefined) {
|
|
2344
|
+
module_or_path = new URL('cedarling_wasm_bg.wasm', import.meta.url);
|
|
2345
|
+
}
|
|
2346
|
+
const imports = __wbg_get_imports();
|
|
2347
|
+
|
|
2348
|
+
if (typeof module_or_path === 'string' || (typeof Request === 'function' && module_or_path instanceof Request) || (typeof URL === 'function' && module_or_path instanceof URL)) {
|
|
2349
|
+
module_or_path = fetch(module_or_path);
|
|
2350
|
+
}
|
|
2351
|
+
|
|
2352
|
+
const { instance, module } = await __wbg_load(await module_or_path, imports);
|
|
2353
|
+
|
|
2354
|
+
return __wbg_finalize_init(instance, module);
|
|
2355
|
+
}
|
|
2356
|
+
|
|
2357
|
+
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.392",
|
|
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
|
}
|