@janssenproject/cedarling_wasm 0.0.372 → 0.0.373-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 -149
- package/cedarling_wasm.js +72 -137
- package/cedarling_wasm_bg.wasm +0 -0
- package/package.json +2 -6
package/cedarling_wasm.d.ts
CHANGED
|
@@ -524,152 +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__hfcfcbd3c7ca0a8cd: (a: number, b: number, c: any) => [number, number];
|
|
639
|
-
readonly wasm_bindgen__convert__closures_____invoke__h3fccbd5fc7c99223: (a: number, b: number, c: any, d: any) => void;
|
|
640
|
-
readonly wasm_bindgen__convert__closures_____invoke__h7af717b30b28e8ae: (a: number, b: number, c: any) => void;
|
|
641
|
-
readonly wasm_bindgen__convert__closures_____invoke__h67964fb515305df3: (a: number, b: number) => void;
|
|
642
|
-
readonly wasm_bindgen__convert__closures_____invoke__hf5137e7a528f865f: (a: number, b: number) => void;
|
|
643
|
-
readonly __wbindgen_malloc: (a: number, b: number) => number;
|
|
644
|
-
readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|
|
645
|
-
readonly __wbindgen_exn_store: (a: number) => void;
|
|
646
|
-
readonly __externref_table_alloc: () => number;
|
|
647
|
-
readonly __wbindgen_externrefs: WebAssembly.Table;
|
|
648
|
-
readonly __wbindgen_destroy_closure: (a: number, b: number) => void;
|
|
649
|
-
readonly __wbindgen_free: (a: number, b: number, c: number) => void;
|
|
650
|
-
readonly __externref_table_dealloc: (a: number) => void;
|
|
651
|
-
readonly __externref_drop_slice: (a: number, b: number) => void;
|
|
652
|
-
readonly __wbindgen_start: () => void;
|
|
653
|
-
}
|
|
654
|
-
|
|
655
|
-
export type SyncInitInput = BufferSource | WebAssembly.Module;
|
|
656
|
-
|
|
657
|
-
/**
|
|
658
|
-
* Instantiates the given `module`, which can either be bytes or
|
|
659
|
-
* a precompiled `WebAssembly.Module`.
|
|
660
|
-
*
|
|
661
|
-
* @param {{ module: SyncInitInput }} module - Passing `SyncInitInput` directly is deprecated.
|
|
662
|
-
*
|
|
663
|
-
* @returns {InitOutput}
|
|
664
|
-
*/
|
|
665
|
-
export function initSync(module: { module: SyncInitInput } | SyncInitInput): InitOutput;
|
|
666
|
-
|
|
667
|
-
/**
|
|
668
|
-
* If `module_or_path` is {RequestInfo} or {URL}, makes a request and
|
|
669
|
-
* for everything else, calls `WebAssembly.instantiate` directly.
|
|
670
|
-
*
|
|
671
|
-
* @param {{ module_or_path: InitInput | Promise<InitInput> }} module_or_path - Passing `InitInput` directly is deprecated.
|
|
672
|
-
*
|
|
673
|
-
* @returns {Promise<InitOutput>}
|
|
674
|
-
*/
|
|
675
|
-
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,
|
|
@@ -1428,6 +1441,10 @@ function __wbg_get_imports() {
|
|
|
1428
1441
|
const ret = clearTimeout(arg0);
|
|
1429
1442
|
return ret;
|
|
1430
1443
|
},
|
|
1444
|
+
__wbg_clearTimeout_3629d6209dfcc46e: function(arg0) {
|
|
1445
|
+
const ret = clearTimeout(arg0);
|
|
1446
|
+
return ret;
|
|
1447
|
+
},
|
|
1431
1448
|
__wbg_clearTimeout_c122f92fd48cd749: function(arg0) {
|
|
1432
1449
|
const ret = clearTimeout(arg0);
|
|
1433
1450
|
return ret;
|
|
@@ -1680,7 +1697,7 @@ function __wbg_get_imports() {
|
|
|
1680
1697
|
const a = state0.a;
|
|
1681
1698
|
state0.a = 0;
|
|
1682
1699
|
try {
|
|
1683
|
-
return
|
|
1700
|
+
return wasm_bindgen__convert__closures_____invoke__h66f11f9242c621fe(a, state0.b, arg0, arg1);
|
|
1684
1701
|
} finally {
|
|
1685
1702
|
state0.a = a;
|
|
1686
1703
|
}
|
|
@@ -1758,6 +1775,10 @@ function __wbg_get_imports() {
|
|
|
1758
1775
|
__wbg_respond_008ca9525ae22847: function() { return handleError(function (arg0, arg1) {
|
|
1759
1776
|
arg0.respond(arg1 >>> 0);
|
|
1760
1777
|
}, arguments); },
|
|
1778
|
+
__wbg_setTimeout_56bcdccbad22fd44: function() { return handleError(function (arg0, arg1) {
|
|
1779
|
+
const ret = setTimeout(arg0, arg1);
|
|
1780
|
+
return ret;
|
|
1781
|
+
}, arguments); },
|
|
1761
1782
|
__wbg_setTimeout_9f4169770fc5a5c3: function(arg0, arg1) {
|
|
1762
1783
|
const ret = setTimeout(arg0, arg1);
|
|
1763
1784
|
return ret;
|
|
@@ -1889,46 +1910,51 @@ function __wbg_get_imports() {
|
|
|
1889
1910
|
console.warn(...arg0);
|
|
1890
1911
|
},
|
|
1891
1912
|
__wbindgen_cast_0000000000000001: function(arg0, arg1) {
|
|
1892
|
-
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx:
|
|
1893
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
1913
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 2179, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
|
|
1914
|
+
const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h80274e53af2c4a90);
|
|
1894
1915
|
return ret;
|
|
1895
1916
|
},
|
|
1896
1917
|
__wbindgen_cast_0000000000000002: function(arg0, arg1) {
|
|
1897
|
-
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx:
|
|
1898
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
1918
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 619, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
1919
|
+
const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h170c6019ccfd853a);
|
|
1899
1920
|
return ret;
|
|
1900
1921
|
},
|
|
1901
1922
|
__wbindgen_cast_0000000000000003: function(arg0, arg1) {
|
|
1902
|
-
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [], shim_idx:
|
|
1903
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
1923
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [], shim_idx: 526, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
1924
|
+
const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__ha272cf34a0c89527);
|
|
1904
1925
|
return ret;
|
|
1905
1926
|
},
|
|
1906
1927
|
__wbindgen_cast_0000000000000004: function(arg0, arg1) {
|
|
1907
|
-
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [], shim_idx:
|
|
1908
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
1928
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [], shim_idx: 575, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
1929
|
+
const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h1f68ebdd661f92ac);
|
|
1930
|
+
return ret;
|
|
1931
|
+
},
|
|
1932
|
+
__wbindgen_cast_0000000000000005: function(arg0, arg1) {
|
|
1933
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [], shim_idx: 733, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
1934
|
+
const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__hc6d79abdb072c199);
|
|
1909
1935
|
return ret;
|
|
1910
1936
|
},
|
|
1911
|
-
|
|
1937
|
+
__wbindgen_cast_0000000000000006: function(arg0) {
|
|
1912
1938
|
// Cast intrinsic for `F64 -> Externref`.
|
|
1913
1939
|
const ret = arg0;
|
|
1914
1940
|
return ret;
|
|
1915
1941
|
},
|
|
1916
|
-
|
|
1942
|
+
__wbindgen_cast_0000000000000007: function(arg0) {
|
|
1917
1943
|
// Cast intrinsic for `I64 -> Externref`.
|
|
1918
1944
|
const ret = arg0;
|
|
1919
1945
|
return ret;
|
|
1920
1946
|
},
|
|
1921
|
-
|
|
1947
|
+
__wbindgen_cast_0000000000000008: function(arg0, arg1) {
|
|
1922
1948
|
// Cast intrinsic for `Ref(Slice(U8)) -> NamedExternref("Uint8Array")`.
|
|
1923
1949
|
const ret = getArrayU8FromWasm0(arg0, arg1);
|
|
1924
1950
|
return ret;
|
|
1925
1951
|
},
|
|
1926
|
-
|
|
1952
|
+
__wbindgen_cast_0000000000000009: function(arg0, arg1) {
|
|
1927
1953
|
// Cast intrinsic for `Ref(String) -> Externref`.
|
|
1928
1954
|
const ret = getStringFromWasm0(arg0, arg1);
|
|
1929
1955
|
return ret;
|
|
1930
1956
|
},
|
|
1931
|
-
|
|
1957
|
+
__wbindgen_cast_000000000000000a: function(arg0) {
|
|
1932
1958
|
// Cast intrinsic for `U64 -> Externref`.
|
|
1933
1959
|
const ret = BigInt.asUintN(64, arg0);
|
|
1934
1960
|
return ret;
|
|
@@ -1949,27 +1975,31 @@ function __wbg_get_imports() {
|
|
|
1949
1975
|
};
|
|
1950
1976
|
}
|
|
1951
1977
|
|
|
1952
|
-
function
|
|
1953
|
-
wasm.
|
|
1978
|
+
function wasm_bindgen__convert__closures_____invoke__ha272cf34a0c89527(arg0, arg1) {
|
|
1979
|
+
wasm.wasm_bindgen__convert__closures_____invoke__ha272cf34a0c89527(arg0, arg1);
|
|
1980
|
+
}
|
|
1981
|
+
|
|
1982
|
+
function wasm_bindgen__convert__closures_____invoke__h1f68ebdd661f92ac(arg0, arg1) {
|
|
1983
|
+
wasm.wasm_bindgen__convert__closures_____invoke__h1f68ebdd661f92ac(arg0, arg1);
|
|
1954
1984
|
}
|
|
1955
1985
|
|
|
1956
|
-
function
|
|
1957
|
-
wasm.
|
|
1986
|
+
function wasm_bindgen__convert__closures_____invoke__hc6d79abdb072c199(arg0, arg1) {
|
|
1987
|
+
wasm.wasm_bindgen__convert__closures_____invoke__hc6d79abdb072c199(arg0, arg1);
|
|
1958
1988
|
}
|
|
1959
1989
|
|
|
1960
|
-
function
|
|
1961
|
-
wasm.
|
|
1990
|
+
function wasm_bindgen__convert__closures_____invoke__h170c6019ccfd853a(arg0, arg1, arg2) {
|
|
1991
|
+
wasm.wasm_bindgen__convert__closures_____invoke__h170c6019ccfd853a(arg0, arg1, arg2);
|
|
1962
1992
|
}
|
|
1963
1993
|
|
|
1964
|
-
function
|
|
1965
|
-
const ret = wasm.
|
|
1994
|
+
function wasm_bindgen__convert__closures_____invoke__h80274e53af2c4a90(arg0, arg1, arg2) {
|
|
1995
|
+
const ret = wasm.wasm_bindgen__convert__closures_____invoke__h80274e53af2c4a90(arg0, arg1, arg2);
|
|
1966
1996
|
if (ret[1]) {
|
|
1967
1997
|
throw takeFromExternrefTable0(ret[0]);
|
|
1968
1998
|
}
|
|
1969
1999
|
}
|
|
1970
2000
|
|
|
1971
|
-
function
|
|
1972
|
-
wasm.
|
|
2001
|
+
function wasm_bindgen__convert__closures_____invoke__h66f11f9242c621fe(arg0, arg1, arg2, arg3) {
|
|
2002
|
+
wasm.wasm_bindgen__convert__closures_____invoke__h66f11f9242c621fe(arg0, arg1, arg2, arg3);
|
|
1973
2003
|
}
|
|
1974
2004
|
|
|
1975
2005
|
|
|
@@ -2227,15 +2257,7 @@ function takeFromExternrefTable0(idx) {
|
|
|
2227
2257
|
|
|
2228
2258
|
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
2229
2259
|
cachedTextDecoder.decode();
|
|
2230
|
-
const MAX_SAFARI_DECODE_BYTES = 2146435072;
|
|
2231
|
-
let numBytesDecoded = 0;
|
|
2232
2260
|
function decodeText(ptr, len) {
|
|
2233
|
-
numBytesDecoded += len;
|
|
2234
|
-
if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
|
|
2235
|
-
cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
2236
|
-
cachedTextDecoder.decode();
|
|
2237
|
-
numBytesDecoded = len;
|
|
2238
|
-
}
|
|
2239
2261
|
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
2240
2262
|
}
|
|
2241
2263
|
|
|
@@ -2254,95 +2276,8 @@ if (!('encodeInto' in cachedTextEncoder)) {
|
|
|
2254
2276
|
|
|
2255
2277
|
let WASM_VECTOR_LEN = 0;
|
|
2256
2278
|
|
|
2257
|
-
|
|
2258
|
-
|
|
2259
|
-
|
|
2260
|
-
|
|
2261
|
-
|
|
2262
|
-
cachedUint8ArrayMemory0 = null;
|
|
2263
|
-
wasm.__wbindgen_start();
|
|
2264
|
-
return wasm;
|
|
2265
|
-
}
|
|
2266
|
-
|
|
2267
|
-
async function __wbg_load(module, imports) {
|
|
2268
|
-
if (typeof Response === 'function' && module instanceof Response) {
|
|
2269
|
-
if (typeof WebAssembly.instantiateStreaming === 'function') {
|
|
2270
|
-
try {
|
|
2271
|
-
return await WebAssembly.instantiateStreaming(module, imports);
|
|
2272
|
-
} catch (e) {
|
|
2273
|
-
const validResponse = module.ok && expectedResponseType(module.type);
|
|
2274
|
-
|
|
2275
|
-
if (validResponse && module.headers.get('Content-Type') !== 'application/wasm') {
|
|
2276
|
-
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);
|
|
2277
|
-
|
|
2278
|
-
} else { throw e; }
|
|
2279
|
-
}
|
|
2280
|
-
}
|
|
2281
|
-
|
|
2282
|
-
const bytes = await module.arrayBuffer();
|
|
2283
|
-
return await WebAssembly.instantiate(bytes, imports);
|
|
2284
|
-
} else {
|
|
2285
|
-
const instance = await WebAssembly.instantiate(module, imports);
|
|
2286
|
-
|
|
2287
|
-
if (instance instanceof WebAssembly.Instance) {
|
|
2288
|
-
return { instance, module };
|
|
2289
|
-
} else {
|
|
2290
|
-
return instance;
|
|
2291
|
-
}
|
|
2292
|
-
}
|
|
2293
|
-
|
|
2294
|
-
function expectedResponseType(type) {
|
|
2295
|
-
switch (type) {
|
|
2296
|
-
case 'basic': case 'cors': case 'default': return true;
|
|
2297
|
-
}
|
|
2298
|
-
return false;
|
|
2299
|
-
}
|
|
2300
|
-
}
|
|
2301
|
-
|
|
2302
|
-
function initSync(module) {
|
|
2303
|
-
if (wasm !== undefined) return wasm;
|
|
2304
|
-
|
|
2305
|
-
|
|
2306
|
-
if (module !== undefined) {
|
|
2307
|
-
if (Object.getPrototypeOf(module) === Object.prototype) {
|
|
2308
|
-
({module} = module)
|
|
2309
|
-
} else {
|
|
2310
|
-
console.warn('using deprecated parameters for `initSync()`; pass a single object instead')
|
|
2311
|
-
}
|
|
2312
|
-
}
|
|
2313
|
-
|
|
2314
|
-
const imports = __wbg_get_imports();
|
|
2315
|
-
if (!(module instanceof WebAssembly.Module)) {
|
|
2316
|
-
module = new WebAssembly.Module(module);
|
|
2317
|
-
}
|
|
2318
|
-
const instance = new WebAssembly.Instance(module, imports);
|
|
2319
|
-
return __wbg_finalize_init(instance, module);
|
|
2320
|
-
}
|
|
2321
|
-
|
|
2322
|
-
async function __wbg_init(module_or_path) {
|
|
2323
|
-
if (wasm !== undefined) return wasm;
|
|
2324
|
-
|
|
2325
|
-
|
|
2326
|
-
if (module_or_path !== undefined) {
|
|
2327
|
-
if (Object.getPrototypeOf(module_or_path) === Object.prototype) {
|
|
2328
|
-
({module_or_path} = module_or_path)
|
|
2329
|
-
} else {
|
|
2330
|
-
console.warn('using deprecated parameters for the initialization function; pass a single object instead')
|
|
2331
|
-
}
|
|
2332
|
-
}
|
|
2333
|
-
|
|
2334
|
-
if (module_or_path === undefined) {
|
|
2335
|
-
module_or_path = new URL('cedarling_wasm_bg.wasm', import.meta.url);
|
|
2336
|
-
}
|
|
2337
|
-
const imports = __wbg_get_imports();
|
|
2338
|
-
|
|
2339
|
-
if (typeof module_or_path === 'string' || (typeof Request === 'function' && module_or_path instanceof Request) || (typeof URL === 'function' && module_or_path instanceof URL)) {
|
|
2340
|
-
module_or_path = fetch(module_or_path);
|
|
2341
|
-
}
|
|
2342
|
-
|
|
2343
|
-
const { instance, module } = await __wbg_load(await module_or_path, imports);
|
|
2344
|
-
|
|
2345
|
-
return __wbg_finalize_init(instance, module);
|
|
2346
|
-
}
|
|
2347
|
-
|
|
2348
|
-
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.373-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
|
}
|