@janssenproject/cedarling_wasm 0.0.417 → 0.0.418-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 -147
- package/cedarling_wasm.js +40 -122
- package/cedarling_wasm_bg.wasm +0 -0
- package/package.json +2 -6
package/cedarling_wasm.d.ts
CHANGED
|
@@ -605,150 +605,3 @@ export function init(config: any): Promise<Cedarling>;
|
|
|
605
605
|
* ```
|
|
606
606
|
*/
|
|
607
607
|
export function init_from_archive_bytes(config: any, archive_bytes: Uint8Array): Promise<Cedarling>;
|
|
608
|
-
|
|
609
|
-
export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
|
|
610
|
-
|
|
611
|
-
export interface InitOutput {
|
|
612
|
-
readonly memory: WebAssembly.Memory;
|
|
613
|
-
readonly __wbg_authorizeresult_free: (a: number, b: number) => void;
|
|
614
|
-
readonly __wbg_authorizeresultresponse_free: (a: number, b: number) => void;
|
|
615
|
-
readonly __wbg_cedarling_free: (a: number, b: number) => void;
|
|
616
|
-
readonly __wbg_dataentry_free: (a: number, b: number) => void;
|
|
617
|
-
readonly __wbg_datastorestats_free: (a: number, b: number) => void;
|
|
618
|
-
readonly __wbg_diagnostics_free: (a: number, b: number) => void;
|
|
619
|
-
readonly __wbg_get_authorizeresult_decision: (a: number) => number;
|
|
620
|
-
readonly __wbg_get_authorizeresult_request_id: (a: number, b: number) => void;
|
|
621
|
-
readonly __wbg_get_authorizeresult_response: (a: number) => number;
|
|
622
|
-
readonly __wbg_get_dataentry_access_count: (a: number) => bigint;
|
|
623
|
-
readonly __wbg_get_dataentry_created_at: (a: number, b: number) => void;
|
|
624
|
-
readonly __wbg_get_dataentry_data_type: (a: number, b: number) => void;
|
|
625
|
-
readonly __wbg_get_dataentry_expires_at: (a: number, b: number) => void;
|
|
626
|
-
readonly __wbg_get_dataentry_key: (a: number, b: number) => void;
|
|
627
|
-
readonly __wbg_get_datastorestats_avg_entry_size_bytes: (a: number) => number;
|
|
628
|
-
readonly __wbg_get_datastorestats_capacity_usage_percent: (a: number) => number;
|
|
629
|
-
readonly __wbg_get_datastorestats_entry_count: (a: number) => number;
|
|
630
|
-
readonly __wbg_get_datastorestats_max_entries: (a: number) => number;
|
|
631
|
-
readonly __wbg_get_datastorestats_max_entry_size: (a: number) => number;
|
|
632
|
-
readonly __wbg_get_datastorestats_memory_alert_threshold: (a: number) => number;
|
|
633
|
-
readonly __wbg_get_datastorestats_memory_alert_triggered: (a: number) => number;
|
|
634
|
-
readonly __wbg_get_datastorestats_metrics_enabled: (a: number) => number;
|
|
635
|
-
readonly __wbg_get_datastorestats_total_size_bytes: (a: number) => number;
|
|
636
|
-
readonly __wbg_policyevaluationerror_free: (a: number, b: number) => void;
|
|
637
|
-
readonly __wbg_set_authorizeresult_decision: (a: number, b: number) => void;
|
|
638
|
-
readonly __wbg_set_authorizeresult_request_id: (a: number, b: number, c: number) => void;
|
|
639
|
-
readonly __wbg_set_authorizeresult_response: (a: number, b: number) => void;
|
|
640
|
-
readonly __wbg_set_dataentry_access_count: (a: number, b: bigint) => void;
|
|
641
|
-
readonly __wbg_set_dataentry_created_at: (a: number, b: number, c: number) => void;
|
|
642
|
-
readonly __wbg_set_dataentry_data_type: (a: number, b: number, c: number) => void;
|
|
643
|
-
readonly __wbg_set_dataentry_expires_at: (a: number, b: number, c: number) => void;
|
|
644
|
-
readonly __wbg_set_dataentry_key: (a: number, b: number, c: number) => void;
|
|
645
|
-
readonly __wbg_set_datastorestats_avg_entry_size_bytes: (a: number, b: number) => void;
|
|
646
|
-
readonly __wbg_set_datastorestats_capacity_usage_percent: (a: number, b: number) => void;
|
|
647
|
-
readonly __wbg_set_datastorestats_entry_count: (a: number, b: number) => void;
|
|
648
|
-
readonly __wbg_set_datastorestats_max_entries: (a: number, b: number) => void;
|
|
649
|
-
readonly __wbg_set_datastorestats_max_entry_size: (a: number, b: number) => void;
|
|
650
|
-
readonly __wbg_set_datastorestats_memory_alert_threshold: (a: number, b: number) => void;
|
|
651
|
-
readonly __wbg_set_datastorestats_memory_alert_triggered: (a: number, b: number) => void;
|
|
652
|
-
readonly __wbg_set_datastorestats_metrics_enabled: (a: number, b: number) => void;
|
|
653
|
-
readonly __wbg_set_datastorestats_total_size_bytes: (a: number, b: number) => void;
|
|
654
|
-
readonly authorizeresult_json_string: (a: number, b: number) => void;
|
|
655
|
-
readonly authorizeresultresponse_decision: (a: number) => number;
|
|
656
|
-
readonly authorizeresultresponse_diagnostics: (a: number) => number;
|
|
657
|
-
readonly cedarling_annotation_values: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
658
|
-
readonly cedarling_annotations_by_policy: (a: number, b: number, c: number, d: number) => void;
|
|
659
|
-
readonly cedarling_annotations_map: (a: number, b: number, c: number, d: number) => void;
|
|
660
|
-
readonly cedarling_authorize_multi_issuer: (a: number, b: number, c: number) => number;
|
|
661
|
-
readonly cedarling_authorize_unsigned: (a: number, b: number, c: number) => number;
|
|
662
|
-
readonly cedarling_clear_data_ctx: (a: number, b: number) => void;
|
|
663
|
-
readonly cedarling_failed_trusted_issuer_ids: (a: number) => number;
|
|
664
|
-
readonly cedarling_get_data_ctx: (a: number, b: number, c: number, d: number) => void;
|
|
665
|
-
readonly cedarling_get_data_entry_ctx: (a: number, b: number, c: number, d: number) => void;
|
|
666
|
-
readonly cedarling_get_log_by_id: (a: number, b: number, c: number, d: number) => void;
|
|
667
|
-
readonly cedarling_get_log_ids: (a: number) => number;
|
|
668
|
-
readonly cedarling_get_logs_by_request_id: (a: number, b: number, c: number, d: number) => void;
|
|
669
|
-
readonly cedarling_get_logs_by_request_id_and_tag: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
670
|
-
readonly cedarling_get_stats_ctx: (a: number, b: number) => void;
|
|
671
|
-
readonly cedarling_is_trusted_issuer_loaded_by_iss: (a: number, b: number, c: number) => number;
|
|
672
|
-
readonly cedarling_is_trusted_issuer_loaded_by_name: (a: number, b: number, c: number) => number;
|
|
673
|
-
readonly cedarling_list_data_ctx: (a: number, b: number) => void;
|
|
674
|
-
readonly cedarling_loaded_trusted_issuer_ids: (a: number) => number;
|
|
675
|
-
readonly cedarling_loaded_trusted_issuers_count: (a: number) => number;
|
|
676
|
-
readonly cedarling_new: (a: number) => number;
|
|
677
|
-
readonly cedarling_new_from_map: (a: number) => number;
|
|
678
|
-
readonly cedarling_pop_logs: (a: number, b: number) => void;
|
|
679
|
-
readonly cedarling_push_data_ctx: (a: number, b: number, c: number, d: number, e: number, f: number, g: bigint) => void;
|
|
680
|
-
readonly cedarling_remove_data_ctx: (a: number, b: number, c: number, d: number) => void;
|
|
681
|
-
readonly cedarling_shut_down: (a: number) => number;
|
|
682
|
-
readonly cedarling_total_issuers: (a: number) => number;
|
|
683
|
-
readonly dataentry_json_string: (a: number, b: number) => void;
|
|
684
|
-
readonly dataentry_value: (a: number, b: number) => void;
|
|
685
|
-
readonly datastorestats_json_string: (a: number, b: number) => void;
|
|
686
|
-
readonly diagnostics_errors: (a: number, b: number) => void;
|
|
687
|
-
readonly diagnostics_reason: (a: number, b: number) => void;
|
|
688
|
-
readonly init: (a: number) => number;
|
|
689
|
-
readonly init_from_archive_bytes: (a: number, b: number) => number;
|
|
690
|
-
readonly multiissuerauthorizeresult_json_string: (a: number, b: number) => void;
|
|
691
|
-
readonly policyevaluationerror_error: (a: number, b: number) => void;
|
|
692
|
-
readonly policyevaluationerror_id: (a: number, b: number) => void;
|
|
693
|
-
readonly __wbg_intounderlyingbytesource_free: (a: number, b: number) => void;
|
|
694
|
-
readonly __wbg_intounderlyingsink_free: (a: number, b: number) => void;
|
|
695
|
-
readonly __wbg_intounderlyingsource_free: (a: number, b: number) => void;
|
|
696
|
-
readonly intounderlyingbytesource_autoAllocateChunkSize: (a: number) => number;
|
|
697
|
-
readonly intounderlyingbytesource_cancel: (a: number) => void;
|
|
698
|
-
readonly intounderlyingbytesource_pull: (a: number, b: number) => number;
|
|
699
|
-
readonly intounderlyingbytesource_start: (a: number, b: number) => void;
|
|
700
|
-
readonly intounderlyingbytesource_type: (a: number) => number;
|
|
701
|
-
readonly intounderlyingsink_abort: (a: number, b: number) => number;
|
|
702
|
-
readonly intounderlyingsink_close: (a: number) => number;
|
|
703
|
-
readonly intounderlyingsink_write: (a: number, b: number) => number;
|
|
704
|
-
readonly intounderlyingsource_cancel: (a: number) => void;
|
|
705
|
-
readonly intounderlyingsource_pull: (a: number, b: number) => number;
|
|
706
|
-
readonly rust_zstd_wasm_shim_calloc: (a: number, b: number) => number;
|
|
707
|
-
readonly rust_zstd_wasm_shim_free: (a: number) => void;
|
|
708
|
-
readonly rust_zstd_wasm_shim_malloc: (a: number) => number;
|
|
709
|
-
readonly rust_zstd_wasm_shim_memcmp: (a: number, b: number, c: number) => number;
|
|
710
|
-
readonly rust_zstd_wasm_shim_memcpy: (a: number, b: number, c: number) => number;
|
|
711
|
-
readonly rust_zstd_wasm_shim_memmove: (a: number, b: number, c: number) => number;
|
|
712
|
-
readonly rust_zstd_wasm_shim_memset: (a: number, b: number, c: number) => number;
|
|
713
|
-
readonly rust_zstd_wasm_shim_qsort: (a: number, b: number, c: number, d: number) => void;
|
|
714
|
-
readonly __wbg_get_multiissuerauthorizeresult_decision: (a: number) => number;
|
|
715
|
-
readonly __wbg_set_multiissuerauthorizeresult_response: (a: number, b: number) => void;
|
|
716
|
-
readonly __wbg_set_multiissuerauthorizeresult_request_id: (a: number, b: number, c: number) => void;
|
|
717
|
-
readonly __wbg_set_multiissuerauthorizeresult_decision: (a: number, b: number) => void;
|
|
718
|
-
readonly __wbg_get_multiissuerauthorizeresult_response: (a: number) => number;
|
|
719
|
-
readonly __wbg_get_multiissuerauthorizeresult_request_id: (a: number, b: number) => void;
|
|
720
|
-
readonly __wbg_multiissuerauthorizeresult_free: (a: number, b: number) => void;
|
|
721
|
-
readonly cedarling_get_logs_by_tag: (a: number, b: number, c: number, d: number) => void;
|
|
722
|
-
readonly __wasm_bindgen_func_elem_8691: (a: number, b: number, c: number, d: number) => void;
|
|
723
|
-
readonly __wasm_bindgen_func_elem_8746: (a: number, b: number, c: number, d: number) => void;
|
|
724
|
-
readonly __wasm_bindgen_func_elem_12170: (a: number, b: number, c: number) => void;
|
|
725
|
-
readonly __wasm_bindgen_func_elem_8526: (a: number, b: number) => void;
|
|
726
|
-
readonly __wbindgen_export: (a: number, b: number) => number;
|
|
727
|
-
readonly __wbindgen_export2: (a: number, b: number, c: number, d: number) => number;
|
|
728
|
-
readonly __wbindgen_export3: (a: number) => void;
|
|
729
|
-
readonly __wbindgen_export4: (a: number, b: number) => void;
|
|
730
|
-
readonly __wbindgen_add_to_stack_pointer: (a: number) => number;
|
|
731
|
-
readonly __wbindgen_export5: (a: number, b: number, c: number) => void;
|
|
732
|
-
}
|
|
733
|
-
|
|
734
|
-
export type SyncInitInput = BufferSource | WebAssembly.Module;
|
|
735
|
-
|
|
736
|
-
/**
|
|
737
|
-
* Instantiates the given `module`, which can either be bytes or
|
|
738
|
-
* a precompiled `WebAssembly.Module`.
|
|
739
|
-
*
|
|
740
|
-
* @param {{ module: SyncInitInput }} module - Passing `SyncInitInput` directly is deprecated.
|
|
741
|
-
*
|
|
742
|
-
* @returns {InitOutput}
|
|
743
|
-
*/
|
|
744
|
-
export function initSync(module: { module: SyncInitInput } | SyncInitInput): InitOutput;
|
|
745
|
-
|
|
746
|
-
/**
|
|
747
|
-
* If `module_or_path` is {RequestInfo} or {URL}, makes a request and
|
|
748
|
-
* for everything else, calls `WebAssembly.instantiate` directly.
|
|
749
|
-
*
|
|
750
|
-
* @param {{ module_or_path: InitInput | Promise<InitInput> }} module_or_path - Passing `InitInput` directly is deprecated.
|
|
751
|
-
*
|
|
752
|
-
* @returns {Promise<InitOutput>}
|
|
753
|
-
*/
|
|
754
|
-
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
|
const obj = Object.create(AuthorizeResult.prototype);
|
|
10
10
|
obj.__wbg_ptr = ptr;
|
|
@@ -112,12 +112,13 @@ export class AuthorizeResult {
|
|
|
112
112
|
}
|
|
113
113
|
}
|
|
114
114
|
if (Symbol.dispose) AuthorizeResult.prototype[Symbol.dispose] = AuthorizeResult.prototype.free;
|
|
115
|
+
exports.AuthorizeResult = AuthorizeResult;
|
|
115
116
|
|
|
116
117
|
/**
|
|
117
118
|
* A WASM wrapper for the Rust `cedar_policy::Response` struct.
|
|
118
119
|
* Represents the result of an authorization request.
|
|
119
120
|
*/
|
|
120
|
-
|
|
121
|
+
class AuthorizeResultResponse {
|
|
121
122
|
static __wrap(ptr) {
|
|
122
123
|
const obj = Object.create(AuthorizeResultResponse.prototype);
|
|
123
124
|
obj.__wbg_ptr = ptr;
|
|
@@ -152,11 +153,12 @@ export class AuthorizeResultResponse {
|
|
|
152
153
|
}
|
|
153
154
|
}
|
|
154
155
|
if (Symbol.dispose) AuthorizeResultResponse.prototype[Symbol.dispose] = AuthorizeResultResponse.prototype.free;
|
|
156
|
+
exports.AuthorizeResultResponse = AuthorizeResultResponse;
|
|
155
157
|
|
|
156
158
|
/**
|
|
157
159
|
* The instance of the Cedarling application.
|
|
158
160
|
*/
|
|
159
|
-
|
|
161
|
+
class Cedarling {
|
|
160
162
|
static __wrap(ptr) {
|
|
161
163
|
const obj = Object.create(Cedarling.prototype);
|
|
162
164
|
obj.__wbg_ptr = ptr;
|
|
@@ -828,12 +830,13 @@ export class Cedarling {
|
|
|
828
830
|
}
|
|
829
831
|
}
|
|
830
832
|
if (Symbol.dispose) Cedarling.prototype[Symbol.dispose] = Cedarling.prototype.free;
|
|
833
|
+
exports.Cedarling = Cedarling;
|
|
831
834
|
|
|
832
835
|
/**
|
|
833
836
|
* A WASM wrapper for the Rust `cedarling::DataEntry` struct.
|
|
834
837
|
* Represents a data entry in the DataStore with value and metadata.
|
|
835
838
|
*/
|
|
836
|
-
|
|
839
|
+
class DataEntry {
|
|
837
840
|
static __wrap(ptr) {
|
|
838
841
|
const obj = Object.create(DataEntry.prototype);
|
|
839
842
|
obj.__wbg_ptr = ptr;
|
|
@@ -1022,12 +1025,13 @@ export class DataEntry {
|
|
|
1022
1025
|
}
|
|
1023
1026
|
}
|
|
1024
1027
|
if (Symbol.dispose) DataEntry.prototype[Symbol.dispose] = DataEntry.prototype.free;
|
|
1028
|
+
exports.DataEntry = DataEntry;
|
|
1025
1029
|
|
|
1026
1030
|
/**
|
|
1027
1031
|
* A WASM wrapper for the Rust `cedarling::DataStoreStats` struct.
|
|
1028
1032
|
* Statistics about the DataStore.
|
|
1029
1033
|
*/
|
|
1030
|
-
|
|
1034
|
+
class DataStoreStats {
|
|
1031
1035
|
static __wrap(ptr) {
|
|
1032
1036
|
const obj = Object.create(DataStoreStats.prototype);
|
|
1033
1037
|
obj.__wbg_ptr = ptr;
|
|
@@ -1201,6 +1205,7 @@ export class DataStoreStats {
|
|
|
1201
1205
|
}
|
|
1202
1206
|
}
|
|
1203
1207
|
if (Symbol.dispose) DataStoreStats.prototype[Symbol.dispose] = DataStoreStats.prototype.free;
|
|
1208
|
+
exports.DataStoreStats = DataStoreStats;
|
|
1204
1209
|
|
|
1205
1210
|
/**
|
|
1206
1211
|
* Diagnostics
|
|
@@ -1208,7 +1213,7 @@ if (Symbol.dispose) DataStoreStats.prototype[Symbol.dispose] = DataStoreStats.pr
|
|
|
1208
1213
|
*
|
|
1209
1214
|
* Provides detailed information about how a policy decision was made, including policies that contributed to the decision and any errors encountered during evaluation.
|
|
1210
1215
|
*/
|
|
1211
|
-
|
|
1216
|
+
class Diagnostics {
|
|
1212
1217
|
static __wrap(ptr) {
|
|
1213
1218
|
const obj = Object.create(Diagnostics.prototype);
|
|
1214
1219
|
obj.__wbg_ptr = ptr;
|
|
@@ -1265,8 +1270,9 @@ export class Diagnostics {
|
|
|
1265
1270
|
}
|
|
1266
1271
|
}
|
|
1267
1272
|
if (Symbol.dispose) Diagnostics.prototype[Symbol.dispose] = Diagnostics.prototype.free;
|
|
1273
|
+
exports.Diagnostics = Diagnostics;
|
|
1268
1274
|
|
|
1269
|
-
|
|
1275
|
+
class IntoUnderlyingByteSource {
|
|
1270
1276
|
__destroy_into_raw() {
|
|
1271
1277
|
const ptr = this.__wbg_ptr;
|
|
1272
1278
|
this.__wbg_ptr = 0;
|
|
@@ -1311,8 +1317,9 @@ export class IntoUnderlyingByteSource {
|
|
|
1311
1317
|
}
|
|
1312
1318
|
}
|
|
1313
1319
|
if (Symbol.dispose) IntoUnderlyingByteSource.prototype[Symbol.dispose] = IntoUnderlyingByteSource.prototype.free;
|
|
1320
|
+
exports.IntoUnderlyingByteSource = IntoUnderlyingByteSource;
|
|
1314
1321
|
|
|
1315
|
-
|
|
1322
|
+
class IntoUnderlyingSink {
|
|
1316
1323
|
__destroy_into_raw() {
|
|
1317
1324
|
const ptr = this.__wbg_ptr;
|
|
1318
1325
|
this.__wbg_ptr = 0;
|
|
@@ -1350,8 +1357,9 @@ export class IntoUnderlyingSink {
|
|
|
1350
1357
|
}
|
|
1351
1358
|
}
|
|
1352
1359
|
if (Symbol.dispose) IntoUnderlyingSink.prototype[Symbol.dispose] = IntoUnderlyingSink.prototype.free;
|
|
1360
|
+
exports.IntoUnderlyingSink = IntoUnderlyingSink;
|
|
1353
1361
|
|
|
1354
|
-
|
|
1362
|
+
class IntoUnderlyingSource {
|
|
1355
1363
|
__destroy_into_raw() {
|
|
1356
1364
|
const ptr = this.__wbg_ptr;
|
|
1357
1365
|
this.__wbg_ptr = 0;
|
|
@@ -1376,12 +1384,13 @@ export class IntoUnderlyingSource {
|
|
|
1376
1384
|
}
|
|
1377
1385
|
}
|
|
1378
1386
|
if (Symbol.dispose) IntoUnderlyingSource.prototype[Symbol.dispose] = IntoUnderlyingSource.prototype.free;
|
|
1387
|
+
exports.IntoUnderlyingSource = IntoUnderlyingSource;
|
|
1379
1388
|
|
|
1380
1389
|
/**
|
|
1381
1390
|
* A WASM wrapper for the Rust `cedarling::MultiIssuerAuthorizeResult` struct.
|
|
1382
1391
|
* Represents the result of a multi-issuer authorization request.
|
|
1383
1392
|
*/
|
|
1384
|
-
|
|
1393
|
+
class MultiIssuerAuthorizeResult {
|
|
1385
1394
|
static __wrap(ptr) {
|
|
1386
1395
|
const obj = Object.create(MultiIssuerAuthorizeResult.prototype);
|
|
1387
1396
|
obj.__wbg_ptr = ptr;
|
|
@@ -1485,6 +1494,7 @@ export class MultiIssuerAuthorizeResult {
|
|
|
1485
1494
|
}
|
|
1486
1495
|
}
|
|
1487
1496
|
if (Symbol.dispose) MultiIssuerAuthorizeResult.prototype[Symbol.dispose] = MultiIssuerAuthorizeResult.prototype.free;
|
|
1497
|
+
exports.MultiIssuerAuthorizeResult = MultiIssuerAuthorizeResult;
|
|
1488
1498
|
|
|
1489
1499
|
/**
|
|
1490
1500
|
* PolicyEvaluationError
|
|
@@ -1492,7 +1502,7 @@ if (Symbol.dispose) MultiIssuerAuthorizeResult.prototype[Symbol.dispose] = Multi
|
|
|
1492
1502
|
*
|
|
1493
1503
|
* Represents an error that occurred when evaluating a Cedar policy.
|
|
1494
1504
|
*/
|
|
1495
|
-
|
|
1505
|
+
class PolicyEvaluationError {
|
|
1496
1506
|
static __wrap(ptr) {
|
|
1497
1507
|
const obj = Object.create(PolicyEvaluationError.prototype);
|
|
1498
1508
|
obj.__wbg_ptr = ptr;
|
|
@@ -1551,6 +1561,7 @@ export class PolicyEvaluationError {
|
|
|
1551
1561
|
}
|
|
1552
1562
|
}
|
|
1553
1563
|
if (Symbol.dispose) PolicyEvaluationError.prototype[Symbol.dispose] = PolicyEvaluationError.prototype.free;
|
|
1564
|
+
exports.PolicyEvaluationError = PolicyEvaluationError;
|
|
1554
1565
|
|
|
1555
1566
|
/**
|
|
1556
1567
|
* Create a new instance of the Cedarling application.
|
|
@@ -1558,10 +1569,11 @@ if (Symbol.dispose) PolicyEvaluationError.prototype[Symbol.dispose] = PolicyEval
|
|
|
1558
1569
|
* @param {any} config
|
|
1559
1570
|
* @returns {Promise<Cedarling>}
|
|
1560
1571
|
*/
|
|
1561
|
-
|
|
1572
|
+
function init(config) {
|
|
1562
1573
|
const ret = wasm.init(addHeapObject(config));
|
|
1563
1574
|
return takeObject(ret);
|
|
1564
1575
|
}
|
|
1576
|
+
exports.init = init;
|
|
1565
1577
|
|
|
1566
1578
|
/**
|
|
1567
1579
|
* Create a new instance of the Cedarling application from archive bytes.
|
|
@@ -1583,10 +1595,11 @@ export function init(config) {
|
|
|
1583
1595
|
* @param {Uint8Array} archive_bytes
|
|
1584
1596
|
* @returns {Promise<Cedarling>}
|
|
1585
1597
|
*/
|
|
1586
|
-
|
|
1598
|
+
function init_from_archive_bytes(config, archive_bytes) {
|
|
1587
1599
|
const ret = wasm.init_from_archive_bytes(addHeapObject(config), addHeapObject(archive_bytes));
|
|
1588
1600
|
return takeObject(ret);
|
|
1589
1601
|
}
|
|
1602
|
+
exports.init_from_archive_bytes = init_from_archive_bytes;
|
|
1590
1603
|
function __wbg_get_imports() {
|
|
1591
1604
|
const import0 = {
|
|
1592
1605
|
__proto__: null,
|
|
@@ -1986,7 +1999,7 @@ function __wbg_get_imports() {
|
|
|
1986
1999
|
const a = state0.a;
|
|
1987
2000
|
state0.a = 0;
|
|
1988
2001
|
try {
|
|
1989
|
-
return
|
|
2002
|
+
return __wasm_bindgen_func_elem_8749(a, state0.b, arg0, arg1);
|
|
1990
2003
|
} finally {
|
|
1991
2004
|
state0.a = a;
|
|
1992
2005
|
}
|
|
@@ -2201,12 +2214,12 @@ function __wbg_get_imports() {
|
|
|
2201
2214
|
},
|
|
2202
2215
|
__wbindgen_cast_0000000000000002: function(arg0, arg1) {
|
|
2203
2216
|
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 995, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
|
|
2204
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
2217
|
+
const ret = makeMutClosure(arg0, arg1, __wasm_bindgen_func_elem_8694);
|
|
2205
2218
|
return addHeapObject(ret);
|
|
2206
2219
|
},
|
|
2207
2220
|
__wbindgen_cast_0000000000000003: function(arg0, arg1) {
|
|
2208
2221
|
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [], shim_idx: 883, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
2209
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
2222
|
+
const ret = makeMutClosure(arg0, arg1, __wasm_bindgen_func_elem_8529);
|
|
2210
2223
|
return addHeapObject(ret);
|
|
2211
2224
|
},
|
|
2212
2225
|
__wbindgen_cast_0000000000000004: function(arg0) {
|
|
@@ -2248,18 +2261,18 @@ function __wbg_get_imports() {
|
|
|
2248
2261
|
};
|
|
2249
2262
|
}
|
|
2250
2263
|
|
|
2251
|
-
function
|
|
2252
|
-
wasm.
|
|
2264
|
+
function __wasm_bindgen_func_elem_8529(arg0, arg1) {
|
|
2265
|
+
wasm.__wasm_bindgen_func_elem_8529(arg0, arg1);
|
|
2253
2266
|
}
|
|
2254
2267
|
|
|
2255
2268
|
function __wasm_bindgen_func_elem_12170(arg0, arg1, arg2) {
|
|
2256
2269
|
wasm.__wasm_bindgen_func_elem_12170(arg0, arg1, addHeapObject(arg2));
|
|
2257
2270
|
}
|
|
2258
2271
|
|
|
2259
|
-
function
|
|
2272
|
+
function __wasm_bindgen_func_elem_8694(arg0, arg1, arg2) {
|
|
2260
2273
|
try {
|
|
2261
2274
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
2262
|
-
wasm.
|
|
2275
|
+
wasm.__wasm_bindgen_func_elem_8694(retptr, arg0, arg1, addHeapObject(arg2));
|
|
2263
2276
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
2264
2277
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
2265
2278
|
if (r1) {
|
|
@@ -2270,8 +2283,8 @@ function __wasm_bindgen_func_elem_8691(arg0, arg1, arg2) {
|
|
|
2270
2283
|
}
|
|
2271
2284
|
}
|
|
2272
2285
|
|
|
2273
|
-
function
|
|
2274
|
-
wasm.
|
|
2286
|
+
function __wasm_bindgen_func_elem_8749(arg0, arg1, arg2, arg3) {
|
|
2287
|
+
wasm.__wasm_bindgen_func_elem_8749(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
|
|
2275
2288
|
}
|
|
2276
2289
|
|
|
2277
2290
|
|
|
@@ -2552,15 +2565,7 @@ function takeObject(idx) {
|
|
|
2552
2565
|
|
|
2553
2566
|
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
2554
2567
|
cachedTextDecoder.decode();
|
|
2555
|
-
const MAX_SAFARI_DECODE_BYTES = 2146435072;
|
|
2556
|
-
let numBytesDecoded = 0;
|
|
2557
2568
|
function decodeText(ptr, len) {
|
|
2558
|
-
numBytesDecoded += len;
|
|
2559
|
-
if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
|
|
2560
|
-
cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
2561
|
-
cachedTextDecoder.decode();
|
|
2562
|
-
numBytesDecoded = len;
|
|
2563
|
-
}
|
|
2564
2569
|
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
2565
2570
|
}
|
|
2566
2571
|
|
|
@@ -2579,95 +2584,8 @@ if (!('encodeInto' in cachedTextEncoder)) {
|
|
|
2579
2584
|
|
|
2580
2585
|
let WASM_VECTOR_LEN = 0;
|
|
2581
2586
|
|
|
2582
|
-
|
|
2583
|
-
|
|
2584
|
-
|
|
2585
|
-
|
|
2586
|
-
|
|
2587
|
-
cachedDataViewMemory0 = null;
|
|
2588
|
-
cachedUint8ArrayMemory0 = null;
|
|
2589
|
-
return wasm;
|
|
2590
|
-
}
|
|
2591
|
-
|
|
2592
|
-
async function __wbg_load(module, imports) {
|
|
2593
|
-
if (typeof Response === 'function' && module instanceof Response) {
|
|
2594
|
-
if (typeof WebAssembly.instantiateStreaming === 'function') {
|
|
2595
|
-
try {
|
|
2596
|
-
return await WebAssembly.instantiateStreaming(module, imports);
|
|
2597
|
-
} catch (e) {
|
|
2598
|
-
const validResponse = module.ok && expectedResponseType(module.type);
|
|
2599
|
-
|
|
2600
|
-
if (validResponse && module.headers.get('Content-Type') !== 'application/wasm') {
|
|
2601
|
-
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);
|
|
2602
|
-
|
|
2603
|
-
} else { throw e; }
|
|
2604
|
-
}
|
|
2605
|
-
}
|
|
2606
|
-
|
|
2607
|
-
const bytes = await module.arrayBuffer();
|
|
2608
|
-
return await WebAssembly.instantiate(bytes, imports);
|
|
2609
|
-
} else {
|
|
2610
|
-
const instance = await WebAssembly.instantiate(module, imports);
|
|
2611
|
-
|
|
2612
|
-
if (instance instanceof WebAssembly.Instance) {
|
|
2613
|
-
return { instance, module };
|
|
2614
|
-
} else {
|
|
2615
|
-
return instance;
|
|
2616
|
-
}
|
|
2617
|
-
}
|
|
2618
|
-
|
|
2619
|
-
function expectedResponseType(type) {
|
|
2620
|
-
switch (type) {
|
|
2621
|
-
case 'basic': case 'cors': case 'default': return true;
|
|
2622
|
-
}
|
|
2623
|
-
return false;
|
|
2624
|
-
}
|
|
2625
|
-
}
|
|
2626
|
-
|
|
2627
|
-
function initSync(module) {
|
|
2628
|
-
if (wasm !== undefined) return wasm;
|
|
2629
|
-
|
|
2630
|
-
|
|
2631
|
-
if (module !== undefined) {
|
|
2632
|
-
if (Object.getPrototypeOf(module) === Object.prototype) {
|
|
2633
|
-
({module} = module)
|
|
2634
|
-
} else {
|
|
2635
|
-
console.warn('using deprecated parameters for `initSync()`; pass a single object instead')
|
|
2636
|
-
}
|
|
2637
|
-
}
|
|
2638
|
-
|
|
2639
|
-
const imports = __wbg_get_imports();
|
|
2640
|
-
if (!(module instanceof WebAssembly.Module)) {
|
|
2641
|
-
module = new WebAssembly.Module(module);
|
|
2642
|
-
}
|
|
2643
|
-
const instance = new WebAssembly.Instance(module, imports);
|
|
2644
|
-
return __wbg_finalize_init(instance, module);
|
|
2645
|
-
}
|
|
2646
|
-
|
|
2647
|
-
async function __wbg_init(module_or_path) {
|
|
2648
|
-
if (wasm !== undefined) return wasm;
|
|
2649
|
-
|
|
2650
|
-
|
|
2651
|
-
if (module_or_path !== undefined) {
|
|
2652
|
-
if (Object.getPrototypeOf(module_or_path) === Object.prototype) {
|
|
2653
|
-
({module_or_path} = module_or_path)
|
|
2654
|
-
} else {
|
|
2655
|
-
console.warn('using deprecated parameters for the initialization function; pass a single object instead')
|
|
2656
|
-
}
|
|
2657
|
-
}
|
|
2658
|
-
|
|
2659
|
-
if (module_or_path === undefined) {
|
|
2660
|
-
module_or_path = new URL('cedarling_wasm_bg.wasm', import.meta.url);
|
|
2661
|
-
}
|
|
2662
|
-
const imports = __wbg_get_imports();
|
|
2663
|
-
|
|
2664
|
-
if (typeof module_or_path === 'string' || (typeof Request === 'function' && module_or_path instanceof Request) || (typeof URL === 'function' && module_or_path instanceof URL)) {
|
|
2665
|
-
module_or_path = fetch(module_or_path);
|
|
2666
|
-
}
|
|
2667
|
-
|
|
2668
|
-
const { instance, module } = await __wbg_load(await module_or_path, imports);
|
|
2669
|
-
|
|
2670
|
-
return __wbg_finalize_init(instance, module);
|
|
2671
|
-
}
|
|
2672
|
-
|
|
2673
|
-
export { initSync, __wbg_init as default };
|
|
2587
|
+
const wasmPath = `${__dirname}/cedarling_wasm_bg.wasm`;
|
|
2588
|
+
const wasmBytes = require('fs').readFileSync(wasmPath);
|
|
2589
|
+
const wasmModule = new WebAssembly.Module(wasmBytes);
|
|
2590
|
+
let wasmInstance = new WebAssembly.Instance(wasmModule, __wbg_get_imports());
|
|
2591
|
+
let wasm = wasmInstance.exports;
|
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.418-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
|
}
|