@janssenproject/cedarling_wasm 0.0.377 → 0.0.378-nodejs
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 +0 -150
- package/cedarling_wasm.js +31 -113
- package/cedarling_wasm_bg.wasm +0 -0
- package/package.json +2 -6
package/cedarling_wasm.d.ts
CHANGED
|
@@ -524,153 +524,3 @@ 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_response: (a: number) => number;
|
|
611
|
-
readonly __wbg_get_multiissuerauthorizeresult_decision: (a: number) => number;
|
|
612
|
-
readonly __wbg_set_multiissuerauthorizeresult_response: (a: number, b: number) => void;
|
|
613
|
-
readonly __wbg_set_multiissuerauthorizeresult_request_id: (a: number, b: number, c: number) => void;
|
|
614
|
-
readonly __wbg_set_multiissuerauthorizeresult_decision: (a: number, b: number) => void;
|
|
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__h80274e53af2c4a90: (a: number, b: number, c: any) => [number, number];
|
|
639
|
-
readonly wasm_bindgen__convert__closures_____invoke__h66f11f9242c621fe: (a: number, b: number, c: any, d: any) => void;
|
|
640
|
-
readonly wasm_bindgen__convert__closures_____invoke__h170c6019ccfd853a: (a: number, b: number, c: any) => void;
|
|
641
|
-
readonly wasm_bindgen__convert__closures_____invoke__ha272cf34a0c89527: (a: number, b: number) => void;
|
|
642
|
-
readonly wasm_bindgen__convert__closures_____invoke__h1f68ebdd661f92ac: (a: number, b: number) => void;
|
|
643
|
-
readonly wasm_bindgen__convert__closures_____invoke__hc6d79abdb072c199: (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
|
-
|
|
7
|
+
class AuthorizeResult {
|
|
8
8
|
static __wrap(ptr) {
|
|
9
9
|
ptr = ptr >>> 0;
|
|
10
10
|
const obj = Object.create(AuthorizeResult.prototype);
|
|
@@ -105,12 +105,13 @@ export class AuthorizeResult {
|
|
|
105
105
|
}
|
|
106
106
|
}
|
|
107
107
|
if (Symbol.dispose) AuthorizeResult.prototype[Symbol.dispose] = AuthorizeResult.prototype.free;
|
|
108
|
+
exports.AuthorizeResult = AuthorizeResult;
|
|
108
109
|
|
|
109
110
|
/**
|
|
110
111
|
* A WASM wrapper for the Rust `cedar_policy::Response` struct.
|
|
111
112
|
* Represents the result of an authorization request.
|
|
112
113
|
*/
|
|
113
|
-
|
|
114
|
+
class AuthorizeResultResponse {
|
|
114
115
|
static __wrap(ptr) {
|
|
115
116
|
ptr = ptr >>> 0;
|
|
116
117
|
const obj = Object.create(AuthorizeResultResponse.prototype);
|
|
@@ -146,11 +147,12 @@ export class AuthorizeResultResponse {
|
|
|
146
147
|
}
|
|
147
148
|
}
|
|
148
149
|
if (Symbol.dispose) AuthorizeResultResponse.prototype[Symbol.dispose] = AuthorizeResultResponse.prototype.free;
|
|
150
|
+
exports.AuthorizeResultResponse = AuthorizeResultResponse;
|
|
149
151
|
|
|
150
152
|
/**
|
|
151
153
|
* The instance of the Cedarling application.
|
|
152
154
|
*/
|
|
153
|
-
|
|
155
|
+
class Cedarling {
|
|
154
156
|
static __wrap(ptr) {
|
|
155
157
|
ptr = ptr >>> 0;
|
|
156
158
|
const obj = Object.create(Cedarling.prototype);
|
|
@@ -586,12 +588,13 @@ export class Cedarling {
|
|
|
586
588
|
}
|
|
587
589
|
}
|
|
588
590
|
if (Symbol.dispose) Cedarling.prototype[Symbol.dispose] = Cedarling.prototype.free;
|
|
591
|
+
exports.Cedarling = Cedarling;
|
|
589
592
|
|
|
590
593
|
/**
|
|
591
594
|
* A WASM wrapper for the Rust `cedarling::DataEntry` struct.
|
|
592
595
|
* Represents a data entry in the DataStore with value and metadata.
|
|
593
596
|
*/
|
|
594
|
-
|
|
597
|
+
class DataEntry {
|
|
595
598
|
static __wrap(ptr) {
|
|
596
599
|
ptr = ptr >>> 0;
|
|
597
600
|
const obj = Object.create(DataEntry.prototype);
|
|
@@ -750,12 +753,13 @@ export class DataEntry {
|
|
|
750
753
|
}
|
|
751
754
|
}
|
|
752
755
|
if (Symbol.dispose) DataEntry.prototype[Symbol.dispose] = DataEntry.prototype.free;
|
|
756
|
+
exports.DataEntry = DataEntry;
|
|
753
757
|
|
|
754
758
|
/**
|
|
755
759
|
* A WASM wrapper for the Rust `cedarling::DataStoreStats` struct.
|
|
756
760
|
* Statistics about the DataStore.
|
|
757
761
|
*/
|
|
758
|
-
|
|
762
|
+
class DataStoreStats {
|
|
759
763
|
static __wrap(ptr) {
|
|
760
764
|
ptr = ptr >>> 0;
|
|
761
765
|
const obj = Object.create(DataStoreStats.prototype);
|
|
@@ -926,6 +930,7 @@ export class DataStoreStats {
|
|
|
926
930
|
}
|
|
927
931
|
}
|
|
928
932
|
if (Symbol.dispose) DataStoreStats.prototype[Symbol.dispose] = DataStoreStats.prototype.free;
|
|
933
|
+
exports.DataStoreStats = DataStoreStats;
|
|
929
934
|
|
|
930
935
|
/**
|
|
931
936
|
* Diagnostics
|
|
@@ -933,7 +938,7 @@ if (Symbol.dispose) DataStoreStats.prototype[Symbol.dispose] = DataStoreStats.pr
|
|
|
933
938
|
*
|
|
934
939
|
* Provides detailed information about how a policy decision was made, including policies that contributed to the decision and any errors encountered during evaluation.
|
|
935
940
|
*/
|
|
936
|
-
|
|
941
|
+
class Diagnostics {
|
|
937
942
|
static __wrap(ptr) {
|
|
938
943
|
ptr = ptr >>> 0;
|
|
939
944
|
const obj = Object.create(Diagnostics.prototype);
|
|
@@ -977,8 +982,9 @@ export class Diagnostics {
|
|
|
977
982
|
}
|
|
978
983
|
}
|
|
979
984
|
if (Symbol.dispose) Diagnostics.prototype[Symbol.dispose] = Diagnostics.prototype.free;
|
|
985
|
+
exports.Diagnostics = Diagnostics;
|
|
980
986
|
|
|
981
|
-
|
|
987
|
+
class IntoUnderlyingByteSource {
|
|
982
988
|
__destroy_into_raw() {
|
|
983
989
|
const ptr = this.__wbg_ptr;
|
|
984
990
|
this.__wbg_ptr = 0;
|
|
@@ -1023,8 +1029,9 @@ export class IntoUnderlyingByteSource {
|
|
|
1023
1029
|
}
|
|
1024
1030
|
}
|
|
1025
1031
|
if (Symbol.dispose) IntoUnderlyingByteSource.prototype[Symbol.dispose] = IntoUnderlyingByteSource.prototype.free;
|
|
1032
|
+
exports.IntoUnderlyingByteSource = IntoUnderlyingByteSource;
|
|
1026
1033
|
|
|
1027
|
-
|
|
1034
|
+
class IntoUnderlyingSink {
|
|
1028
1035
|
__destroy_into_raw() {
|
|
1029
1036
|
const ptr = this.__wbg_ptr;
|
|
1030
1037
|
this.__wbg_ptr = 0;
|
|
@@ -1062,8 +1069,9 @@ export class IntoUnderlyingSink {
|
|
|
1062
1069
|
}
|
|
1063
1070
|
}
|
|
1064
1071
|
if (Symbol.dispose) IntoUnderlyingSink.prototype[Symbol.dispose] = IntoUnderlyingSink.prototype.free;
|
|
1072
|
+
exports.IntoUnderlyingSink = IntoUnderlyingSink;
|
|
1065
1073
|
|
|
1066
|
-
|
|
1074
|
+
class IntoUnderlyingSource {
|
|
1067
1075
|
__destroy_into_raw() {
|
|
1068
1076
|
const ptr = this.__wbg_ptr;
|
|
1069
1077
|
this.__wbg_ptr = 0;
|
|
@@ -1088,12 +1096,13 @@ export class IntoUnderlyingSource {
|
|
|
1088
1096
|
}
|
|
1089
1097
|
}
|
|
1090
1098
|
if (Symbol.dispose) IntoUnderlyingSource.prototype[Symbol.dispose] = IntoUnderlyingSource.prototype.free;
|
|
1099
|
+
exports.IntoUnderlyingSource = IntoUnderlyingSource;
|
|
1091
1100
|
|
|
1092
1101
|
/**
|
|
1093
1102
|
* A WASM wrapper for the Rust `cedarling::MultiIssuerAuthorizeResult` struct.
|
|
1094
1103
|
* Represents the result of a multi-issuer authorization request.
|
|
1095
1104
|
*/
|
|
1096
|
-
|
|
1105
|
+
class MultiIssuerAuthorizeResult {
|
|
1097
1106
|
static __wrap(ptr) {
|
|
1098
1107
|
ptr = ptr >>> 0;
|
|
1099
1108
|
const obj = Object.create(MultiIssuerAuthorizeResult.prototype);
|
|
@@ -1190,6 +1199,7 @@ export class MultiIssuerAuthorizeResult {
|
|
|
1190
1199
|
}
|
|
1191
1200
|
}
|
|
1192
1201
|
if (Symbol.dispose) MultiIssuerAuthorizeResult.prototype[Symbol.dispose] = MultiIssuerAuthorizeResult.prototype.free;
|
|
1202
|
+
exports.MultiIssuerAuthorizeResult = MultiIssuerAuthorizeResult;
|
|
1193
1203
|
|
|
1194
1204
|
/**
|
|
1195
1205
|
* PolicyEvaluationError
|
|
@@ -1197,7 +1207,7 @@ if (Symbol.dispose) MultiIssuerAuthorizeResult.prototype[Symbol.dispose] = Multi
|
|
|
1197
1207
|
*
|
|
1198
1208
|
* Represents an error that occurred when evaluating a Cedar policy.
|
|
1199
1209
|
*/
|
|
1200
|
-
|
|
1210
|
+
class PolicyEvaluationError {
|
|
1201
1211
|
static __wrap(ptr) {
|
|
1202
1212
|
ptr = ptr >>> 0;
|
|
1203
1213
|
const obj = Object.create(PolicyEvaluationError.prototype);
|
|
@@ -1249,6 +1259,7 @@ export class PolicyEvaluationError {
|
|
|
1249
1259
|
}
|
|
1250
1260
|
}
|
|
1251
1261
|
if (Symbol.dispose) PolicyEvaluationError.prototype[Symbol.dispose] = PolicyEvaluationError.prototype.free;
|
|
1262
|
+
exports.PolicyEvaluationError = PolicyEvaluationError;
|
|
1252
1263
|
|
|
1253
1264
|
/**
|
|
1254
1265
|
* Create a new instance of the Cedarling application.
|
|
@@ -1256,10 +1267,11 @@ if (Symbol.dispose) PolicyEvaluationError.prototype[Symbol.dispose] = PolicyEval
|
|
|
1256
1267
|
* @param {any} config
|
|
1257
1268
|
* @returns {Promise<Cedarling>}
|
|
1258
1269
|
*/
|
|
1259
|
-
|
|
1270
|
+
function init(config) {
|
|
1260
1271
|
const ret = wasm.init(config);
|
|
1261
1272
|
return ret;
|
|
1262
1273
|
}
|
|
1274
|
+
exports.init = init;
|
|
1263
1275
|
|
|
1264
1276
|
/**
|
|
1265
1277
|
* Create a new instance of the Cedarling application from archive bytes.
|
|
@@ -1281,10 +1293,11 @@ export function init(config) {
|
|
|
1281
1293
|
* @param {Uint8Array} archive_bytes
|
|
1282
1294
|
* @returns {Promise<Cedarling>}
|
|
1283
1295
|
*/
|
|
1284
|
-
|
|
1296
|
+
function init_from_archive_bytes(config, archive_bytes) {
|
|
1285
1297
|
const ret = wasm.init_from_archive_bytes(config, archive_bytes);
|
|
1286
1298
|
return ret;
|
|
1287
1299
|
}
|
|
1300
|
+
exports.init_from_archive_bytes = init_from_archive_bytes;
|
|
1288
1301
|
function __wbg_get_imports() {
|
|
1289
1302
|
const import0 = {
|
|
1290
1303
|
__proto__: null,
|
|
@@ -2244,15 +2257,7 @@ function takeFromExternrefTable0(idx) {
|
|
|
2244
2257
|
|
|
2245
2258
|
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
2246
2259
|
cachedTextDecoder.decode();
|
|
2247
|
-
const MAX_SAFARI_DECODE_BYTES = 2146435072;
|
|
2248
|
-
let numBytesDecoded = 0;
|
|
2249
2260
|
function decodeText(ptr, len) {
|
|
2250
|
-
numBytesDecoded += len;
|
|
2251
|
-
if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
|
|
2252
|
-
cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
2253
|
-
cachedTextDecoder.decode();
|
|
2254
|
-
numBytesDecoded = len;
|
|
2255
|
-
}
|
|
2256
2261
|
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
2257
2262
|
}
|
|
2258
2263
|
|
|
@@ -2271,95 +2276,8 @@ if (!('encodeInto' in cachedTextEncoder)) {
|
|
|
2271
2276
|
|
|
2272
2277
|
let WASM_VECTOR_LEN = 0;
|
|
2273
2278
|
|
|
2274
|
-
|
|
2275
|
-
|
|
2276
|
-
|
|
2277
|
-
|
|
2278
|
-
|
|
2279
|
-
cachedUint8ArrayMemory0 = null;
|
|
2280
|
-
wasm.__wbindgen_start();
|
|
2281
|
-
return wasm;
|
|
2282
|
-
}
|
|
2283
|
-
|
|
2284
|
-
async function __wbg_load(module, imports) {
|
|
2285
|
-
if (typeof Response === 'function' && module instanceof Response) {
|
|
2286
|
-
if (typeof WebAssembly.instantiateStreaming === 'function') {
|
|
2287
|
-
try {
|
|
2288
|
-
return await WebAssembly.instantiateStreaming(module, imports);
|
|
2289
|
-
} catch (e) {
|
|
2290
|
-
const validResponse = module.ok && expectedResponseType(module.type);
|
|
2291
|
-
|
|
2292
|
-
if (validResponse && module.headers.get('Content-Type') !== 'application/wasm') {
|
|
2293
|
-
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);
|
|
2294
|
-
|
|
2295
|
-
} else { throw e; }
|
|
2296
|
-
}
|
|
2297
|
-
}
|
|
2298
|
-
|
|
2299
|
-
const bytes = await module.arrayBuffer();
|
|
2300
|
-
return await WebAssembly.instantiate(bytes, imports);
|
|
2301
|
-
} else {
|
|
2302
|
-
const instance = await WebAssembly.instantiate(module, imports);
|
|
2303
|
-
|
|
2304
|
-
if (instance instanceof WebAssembly.Instance) {
|
|
2305
|
-
return { instance, module };
|
|
2306
|
-
} else {
|
|
2307
|
-
return instance;
|
|
2308
|
-
}
|
|
2309
|
-
}
|
|
2310
|
-
|
|
2311
|
-
function expectedResponseType(type) {
|
|
2312
|
-
switch (type) {
|
|
2313
|
-
case 'basic': case 'cors': case 'default': return true;
|
|
2314
|
-
}
|
|
2315
|
-
return false;
|
|
2316
|
-
}
|
|
2317
|
-
}
|
|
2318
|
-
|
|
2319
|
-
function initSync(module) {
|
|
2320
|
-
if (wasm !== undefined) return wasm;
|
|
2321
|
-
|
|
2322
|
-
|
|
2323
|
-
if (module !== undefined) {
|
|
2324
|
-
if (Object.getPrototypeOf(module) === Object.prototype) {
|
|
2325
|
-
({module} = module)
|
|
2326
|
-
} else {
|
|
2327
|
-
console.warn('using deprecated parameters for `initSync()`; pass a single object instead')
|
|
2328
|
-
}
|
|
2329
|
-
}
|
|
2330
|
-
|
|
2331
|
-
const imports = __wbg_get_imports();
|
|
2332
|
-
if (!(module instanceof WebAssembly.Module)) {
|
|
2333
|
-
module = new WebAssembly.Module(module);
|
|
2334
|
-
}
|
|
2335
|
-
const instance = new WebAssembly.Instance(module, imports);
|
|
2336
|
-
return __wbg_finalize_init(instance, module);
|
|
2337
|
-
}
|
|
2338
|
-
|
|
2339
|
-
async function __wbg_init(module_or_path) {
|
|
2340
|
-
if (wasm !== undefined) return wasm;
|
|
2341
|
-
|
|
2342
|
-
|
|
2343
|
-
if (module_or_path !== undefined) {
|
|
2344
|
-
if (Object.getPrototypeOf(module_or_path) === Object.prototype) {
|
|
2345
|
-
({module_or_path} = module_or_path)
|
|
2346
|
-
} else {
|
|
2347
|
-
console.warn('using deprecated parameters for the initialization function; pass a single object instead')
|
|
2348
|
-
}
|
|
2349
|
-
}
|
|
2350
|
-
|
|
2351
|
-
if (module_or_path === undefined) {
|
|
2352
|
-
module_or_path = new URL('cedarling_wasm_bg.wasm', import.meta.url);
|
|
2353
|
-
}
|
|
2354
|
-
const imports = __wbg_get_imports();
|
|
2355
|
-
|
|
2356
|
-
if (typeof module_or_path === 'string' || (typeof Request === 'function' && module_or_path instanceof Request) || (typeof URL === 'function' && module_or_path instanceof URL)) {
|
|
2357
|
-
module_or_path = fetch(module_or_path);
|
|
2358
|
-
}
|
|
2359
|
-
|
|
2360
|
-
const { instance, module } = await __wbg_load(await module_or_path, imports);
|
|
2361
|
-
|
|
2362
|
-
return __wbg_finalize_init(instance, module);
|
|
2363
|
-
}
|
|
2364
|
-
|
|
2365
|
-
export { initSync, __wbg_init as default };
|
|
2279
|
+
const wasmPath = `${__dirname}/cedarling_wasm_bg.wasm`;
|
|
2280
|
+
const wasmBytes = require('fs').readFileSync(wasmPath);
|
|
2281
|
+
const wasmModule = new WebAssembly.Module(wasmBytes);
|
|
2282
|
+
let wasm = new WebAssembly.Instance(wasmModule, __wbg_get_imports()).exports;
|
|
2283
|
+
wasm.__wbindgen_start();
|
package/cedarling_wasm_bg.wasm
CHANGED
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@janssenproject/cedarling_wasm",
|
|
3
|
-
"type": "module",
|
|
4
3
|
"description": "The Cedarling is a performant local authorization service that runs the Rust Cedar Engine",
|
|
5
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.378-nodejs",
|
|
6
5
|
"license": "Apache-2.0",
|
|
7
6
|
"repository": {
|
|
8
7
|
"type": "git",
|
|
@@ -14,8 +13,5 @@
|
|
|
14
13
|
"cedarling_wasm.d.ts"
|
|
15
14
|
],
|
|
16
15
|
"main": "cedarling_wasm.js",
|
|
17
|
-
"types": "cedarling_wasm.d.ts"
|
|
18
|
-
"sideEffects": [
|
|
19
|
-
"./snippets/*"
|
|
20
|
-
]
|
|
16
|
+
"types": "cedarling_wasm.d.ts"
|
|
21
17
|
}
|