@janssenproject/cedarling_wasm 0.0.410 → 0.0.411-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 -144
- package/cedarling_wasm.js +40 -122
- package/cedarling_wasm_bg.wasm +0 -0
- package/package.json +2 -6
package/cedarling_wasm.d.ts
CHANGED
|
@@ -544,147 +544,3 @@ export function init(config: any): Promise<Cedarling>;
|
|
|
544
544
|
* ```
|
|
545
545
|
*/
|
|
546
546
|
export function init_from_archive_bytes(config: any, archive_bytes: Uint8Array): Promise<Cedarling>;
|
|
547
|
-
|
|
548
|
-
export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
|
|
549
|
-
|
|
550
|
-
export interface InitOutput {
|
|
551
|
-
readonly memory: WebAssembly.Memory;
|
|
552
|
-
readonly __wbg_authorizeresult_free: (a: number, b: number) => void;
|
|
553
|
-
readonly __wbg_authorizeresultresponse_free: (a: number, b: number) => void;
|
|
554
|
-
readonly __wbg_cedarling_free: (a: number, b: number) => void;
|
|
555
|
-
readonly __wbg_dataentry_free: (a: number, b: number) => void;
|
|
556
|
-
readonly __wbg_datastorestats_free: (a: number, b: number) => void;
|
|
557
|
-
readonly __wbg_diagnostics_free: (a: number, b: number) => void;
|
|
558
|
-
readonly __wbg_get_authorizeresult_decision: (a: number) => number;
|
|
559
|
-
readonly __wbg_get_authorizeresult_request_id: (a: number, b: number) => void;
|
|
560
|
-
readonly __wbg_get_authorizeresult_response: (a: number) => number;
|
|
561
|
-
readonly __wbg_get_dataentry_access_count: (a: number) => bigint;
|
|
562
|
-
readonly __wbg_get_dataentry_created_at: (a: number, b: number) => void;
|
|
563
|
-
readonly __wbg_get_dataentry_data_type: (a: number, b: number) => void;
|
|
564
|
-
readonly __wbg_get_dataentry_expires_at: (a: number, b: number) => void;
|
|
565
|
-
readonly __wbg_get_dataentry_key: (a: number, b: number) => void;
|
|
566
|
-
readonly __wbg_get_datastorestats_avg_entry_size_bytes: (a: number) => number;
|
|
567
|
-
readonly __wbg_get_datastorestats_capacity_usage_percent: (a: number) => number;
|
|
568
|
-
readonly __wbg_get_datastorestats_entry_count: (a: number) => number;
|
|
569
|
-
readonly __wbg_get_datastorestats_max_entries: (a: number) => number;
|
|
570
|
-
readonly __wbg_get_datastorestats_max_entry_size: (a: number) => number;
|
|
571
|
-
readonly __wbg_get_datastorestats_memory_alert_threshold: (a: number) => number;
|
|
572
|
-
readonly __wbg_get_datastorestats_memory_alert_triggered: (a: number) => number;
|
|
573
|
-
readonly __wbg_get_datastorestats_metrics_enabled: (a: number) => number;
|
|
574
|
-
readonly __wbg_get_datastorestats_total_size_bytes: (a: number) => number;
|
|
575
|
-
readonly __wbg_policyevaluationerror_free: (a: number, b: number) => void;
|
|
576
|
-
readonly __wbg_set_authorizeresult_decision: (a: number, b: number) => void;
|
|
577
|
-
readonly __wbg_set_authorizeresult_request_id: (a: number, b: number, c: number) => void;
|
|
578
|
-
readonly __wbg_set_authorizeresult_response: (a: number, b: number) => void;
|
|
579
|
-
readonly __wbg_set_dataentry_access_count: (a: number, b: bigint) => void;
|
|
580
|
-
readonly __wbg_set_dataentry_created_at: (a: number, b: number, c: number) => void;
|
|
581
|
-
readonly __wbg_set_dataentry_data_type: (a: number, b: number, c: number) => void;
|
|
582
|
-
readonly __wbg_set_dataentry_expires_at: (a: number, b: number, c: number) => void;
|
|
583
|
-
readonly __wbg_set_dataentry_key: (a: number, b: number, c: number) => void;
|
|
584
|
-
readonly __wbg_set_datastorestats_avg_entry_size_bytes: (a: number, b: number) => void;
|
|
585
|
-
readonly __wbg_set_datastorestats_capacity_usage_percent: (a: number, b: number) => void;
|
|
586
|
-
readonly __wbg_set_datastorestats_entry_count: (a: number, b: number) => void;
|
|
587
|
-
readonly __wbg_set_datastorestats_max_entries: (a: number, b: number) => void;
|
|
588
|
-
readonly __wbg_set_datastorestats_max_entry_size: (a: number, b: number) => void;
|
|
589
|
-
readonly __wbg_set_datastorestats_memory_alert_threshold: (a: number, b: number) => void;
|
|
590
|
-
readonly __wbg_set_datastorestats_memory_alert_triggered: (a: number, b: number) => void;
|
|
591
|
-
readonly __wbg_set_datastorestats_metrics_enabled: (a: number, b: number) => void;
|
|
592
|
-
readonly __wbg_set_datastorestats_total_size_bytes: (a: number, b: number) => void;
|
|
593
|
-
readonly authorizeresult_json_string: (a: number, b: number) => void;
|
|
594
|
-
readonly authorizeresultresponse_decision: (a: number) => number;
|
|
595
|
-
readonly authorizeresultresponse_diagnostics: (a: number) => number;
|
|
596
|
-
readonly cedarling_authorize_multi_issuer: (a: number, b: number, c: number) => number;
|
|
597
|
-
readonly cedarling_authorize_unsigned: (a: number, b: number, c: number) => number;
|
|
598
|
-
readonly cedarling_clear_data_ctx: (a: number, b: number) => void;
|
|
599
|
-
readonly cedarling_failed_trusted_issuer_ids: (a: number) => number;
|
|
600
|
-
readonly cedarling_get_data_ctx: (a: number, b: number, c: number, d: number) => void;
|
|
601
|
-
readonly cedarling_get_data_entry_ctx: (a: number, b: number, c: number, d: number) => void;
|
|
602
|
-
readonly cedarling_get_log_by_id: (a: number, b: number, c: number, d: number) => void;
|
|
603
|
-
readonly cedarling_get_log_ids: (a: number) => number;
|
|
604
|
-
readonly cedarling_get_logs_by_request_id: (a: number, b: number, c: number, d: number) => void;
|
|
605
|
-
readonly cedarling_get_logs_by_request_id_and_tag: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
606
|
-
readonly cedarling_get_stats_ctx: (a: number, b: number) => void;
|
|
607
|
-
readonly cedarling_is_trusted_issuer_loaded_by_iss: (a: number, b: number, c: number) => number;
|
|
608
|
-
readonly cedarling_is_trusted_issuer_loaded_by_name: (a: number, b: number, c: number) => number;
|
|
609
|
-
readonly cedarling_list_data_ctx: (a: number, b: number) => void;
|
|
610
|
-
readonly cedarling_loaded_trusted_issuer_ids: (a: number) => number;
|
|
611
|
-
readonly cedarling_loaded_trusted_issuers_count: (a: number) => number;
|
|
612
|
-
readonly cedarling_new: (a: number) => number;
|
|
613
|
-
readonly cedarling_new_from_map: (a: number) => number;
|
|
614
|
-
readonly cedarling_pop_logs: (a: number, b: number) => void;
|
|
615
|
-
readonly cedarling_push_data_ctx: (a: number, b: number, c: number, d: number, e: number, f: number, g: bigint) => void;
|
|
616
|
-
readonly cedarling_remove_data_ctx: (a: number, b: number, c: number, d: number) => void;
|
|
617
|
-
readonly cedarling_shut_down: (a: number) => number;
|
|
618
|
-
readonly cedarling_total_issuers: (a: number) => number;
|
|
619
|
-
readonly dataentry_json_string: (a: number, b: number) => void;
|
|
620
|
-
readonly dataentry_value: (a: number, b: number) => void;
|
|
621
|
-
readonly datastorestats_json_string: (a: number, b: number) => void;
|
|
622
|
-
readonly diagnostics_errors: (a: number, b: number) => void;
|
|
623
|
-
readonly diagnostics_reason: (a: number, b: number) => void;
|
|
624
|
-
readonly init: (a: number) => number;
|
|
625
|
-
readonly init_from_archive_bytes: (a: number, b: number) => number;
|
|
626
|
-
readonly multiissuerauthorizeresult_json_string: (a: number, b: number) => void;
|
|
627
|
-
readonly policyevaluationerror_error: (a: number, b: number) => void;
|
|
628
|
-
readonly policyevaluationerror_id: (a: number, b: number) => void;
|
|
629
|
-
readonly __wbg_intounderlyingbytesource_free: (a: number, b: number) => void;
|
|
630
|
-
readonly __wbg_intounderlyingsink_free: (a: number, b: number) => void;
|
|
631
|
-
readonly __wbg_intounderlyingsource_free: (a: number, b: number) => void;
|
|
632
|
-
readonly intounderlyingbytesource_autoAllocateChunkSize: (a: number) => number;
|
|
633
|
-
readonly intounderlyingbytesource_cancel: (a: number) => void;
|
|
634
|
-
readonly intounderlyingbytesource_pull: (a: number, b: number) => number;
|
|
635
|
-
readonly intounderlyingbytesource_start: (a: number, b: number) => void;
|
|
636
|
-
readonly intounderlyingbytesource_type: (a: number) => number;
|
|
637
|
-
readonly intounderlyingsink_abort: (a: number, b: number) => number;
|
|
638
|
-
readonly intounderlyingsink_close: (a: number) => number;
|
|
639
|
-
readonly intounderlyingsink_write: (a: number, b: number) => number;
|
|
640
|
-
readonly intounderlyingsource_cancel: (a: number) => void;
|
|
641
|
-
readonly intounderlyingsource_pull: (a: number, b: number) => number;
|
|
642
|
-
readonly rust_zstd_wasm_shim_calloc: (a: number, b: number) => number;
|
|
643
|
-
readonly rust_zstd_wasm_shim_free: (a: number) => void;
|
|
644
|
-
readonly rust_zstd_wasm_shim_malloc: (a: number) => number;
|
|
645
|
-
readonly rust_zstd_wasm_shim_memcmp: (a: number, b: number, c: number) => number;
|
|
646
|
-
readonly rust_zstd_wasm_shim_memcpy: (a: number, b: number, c: number) => number;
|
|
647
|
-
readonly rust_zstd_wasm_shim_memmove: (a: number, b: number, c: number) => number;
|
|
648
|
-
readonly rust_zstd_wasm_shim_memset: (a: number, b: number, c: number) => number;
|
|
649
|
-
readonly rust_zstd_wasm_shim_qsort: (a: number, b: number, c: number, d: number) => void;
|
|
650
|
-
readonly __wbg_get_multiissuerauthorizeresult_decision: (a: number) => number;
|
|
651
|
-
readonly __wbg_set_multiissuerauthorizeresult_response: (a: number, b: number) => void;
|
|
652
|
-
readonly __wbg_set_multiissuerauthorizeresult_request_id: (a: number, b: number, c: number) => void;
|
|
653
|
-
readonly __wbg_set_multiissuerauthorizeresult_decision: (a: number, b: number) => void;
|
|
654
|
-
readonly __wbg_get_multiissuerauthorizeresult_response: (a: number) => number;
|
|
655
|
-
readonly __wbg_get_multiissuerauthorizeresult_request_id: (a: number, b: number) => void;
|
|
656
|
-
readonly __wbg_multiissuerauthorizeresult_free: (a: number, b: number) => void;
|
|
657
|
-
readonly cedarling_get_logs_by_tag: (a: number, b: number, c: number, d: number) => void;
|
|
658
|
-
readonly __wasm_bindgen_func_elem_8668: (a: number, b: number, c: number, d: number) => void;
|
|
659
|
-
readonly __wasm_bindgen_func_elem_8722: (a: number, b: number, c: number, d: number) => void;
|
|
660
|
-
readonly __wasm_bindgen_func_elem_12144: (a: number, b: number, c: number) => void;
|
|
661
|
-
readonly __wasm_bindgen_func_elem_8503: (a: number, b: number) => void;
|
|
662
|
-
readonly __wbindgen_export: (a: number, b: number) => number;
|
|
663
|
-
readonly __wbindgen_export2: (a: number, b: number, c: number, d: number) => number;
|
|
664
|
-
readonly __wbindgen_export3: (a: number) => void;
|
|
665
|
-
readonly __wbindgen_export4: (a: number, b: number) => void;
|
|
666
|
-
readonly __wbindgen_add_to_stack_pointer: (a: number) => number;
|
|
667
|
-
readonly __wbindgen_export5: (a: number, b: number, c: number) => void;
|
|
668
|
-
}
|
|
669
|
-
|
|
670
|
-
export type SyncInitInput = BufferSource | WebAssembly.Module;
|
|
671
|
-
|
|
672
|
-
/**
|
|
673
|
-
* Instantiates the given `module`, which can either be bytes or
|
|
674
|
-
* a precompiled `WebAssembly.Module`.
|
|
675
|
-
*
|
|
676
|
-
* @param {{ module: SyncInitInput }} module - Passing `SyncInitInput` directly is deprecated.
|
|
677
|
-
*
|
|
678
|
-
* @returns {InitOutput}
|
|
679
|
-
*/
|
|
680
|
-
export function initSync(module: { module: SyncInitInput } | SyncInitInput): InitOutput;
|
|
681
|
-
|
|
682
|
-
/**
|
|
683
|
-
* If `module_or_path` is {RequestInfo} or {URL}, makes a request and
|
|
684
|
-
* for everything else, calls `WebAssembly.instantiate` directly.
|
|
685
|
-
*
|
|
686
|
-
* @param {{ module_or_path: InitInput | Promise<InitInput> }} module_or_path - Passing `InitInput` directly is deprecated.
|
|
687
|
-
*
|
|
688
|
-
* @returns {Promise<InitOutput>}
|
|
689
|
-
*/
|
|
690
|
-
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;
|
|
@@ -712,12 +714,13 @@ export class Cedarling {
|
|
|
712
714
|
}
|
|
713
715
|
}
|
|
714
716
|
if (Symbol.dispose) Cedarling.prototype[Symbol.dispose] = Cedarling.prototype.free;
|
|
717
|
+
exports.Cedarling = Cedarling;
|
|
715
718
|
|
|
716
719
|
/**
|
|
717
720
|
* A WASM wrapper for the Rust `cedarling::DataEntry` struct.
|
|
718
721
|
* Represents a data entry in the DataStore with value and metadata.
|
|
719
722
|
*/
|
|
720
|
-
|
|
723
|
+
class DataEntry {
|
|
721
724
|
static __wrap(ptr) {
|
|
722
725
|
const obj = Object.create(DataEntry.prototype);
|
|
723
726
|
obj.__wbg_ptr = ptr;
|
|
@@ -906,12 +909,13 @@ export class DataEntry {
|
|
|
906
909
|
}
|
|
907
910
|
}
|
|
908
911
|
if (Symbol.dispose) DataEntry.prototype[Symbol.dispose] = DataEntry.prototype.free;
|
|
912
|
+
exports.DataEntry = DataEntry;
|
|
909
913
|
|
|
910
914
|
/**
|
|
911
915
|
* A WASM wrapper for the Rust `cedarling::DataStoreStats` struct.
|
|
912
916
|
* Statistics about the DataStore.
|
|
913
917
|
*/
|
|
914
|
-
|
|
918
|
+
class DataStoreStats {
|
|
915
919
|
static __wrap(ptr) {
|
|
916
920
|
const obj = Object.create(DataStoreStats.prototype);
|
|
917
921
|
obj.__wbg_ptr = ptr;
|
|
@@ -1085,6 +1089,7 @@ export class DataStoreStats {
|
|
|
1085
1089
|
}
|
|
1086
1090
|
}
|
|
1087
1091
|
if (Symbol.dispose) DataStoreStats.prototype[Symbol.dispose] = DataStoreStats.prototype.free;
|
|
1092
|
+
exports.DataStoreStats = DataStoreStats;
|
|
1088
1093
|
|
|
1089
1094
|
/**
|
|
1090
1095
|
* Diagnostics
|
|
@@ -1092,7 +1097,7 @@ if (Symbol.dispose) DataStoreStats.prototype[Symbol.dispose] = DataStoreStats.pr
|
|
|
1092
1097
|
*
|
|
1093
1098
|
* Provides detailed information about how a policy decision was made, including policies that contributed to the decision and any errors encountered during evaluation.
|
|
1094
1099
|
*/
|
|
1095
|
-
|
|
1100
|
+
class Diagnostics {
|
|
1096
1101
|
static __wrap(ptr) {
|
|
1097
1102
|
const obj = Object.create(Diagnostics.prototype);
|
|
1098
1103
|
obj.__wbg_ptr = ptr;
|
|
@@ -1149,8 +1154,9 @@ export class Diagnostics {
|
|
|
1149
1154
|
}
|
|
1150
1155
|
}
|
|
1151
1156
|
if (Symbol.dispose) Diagnostics.prototype[Symbol.dispose] = Diagnostics.prototype.free;
|
|
1157
|
+
exports.Diagnostics = Diagnostics;
|
|
1152
1158
|
|
|
1153
|
-
|
|
1159
|
+
class IntoUnderlyingByteSource {
|
|
1154
1160
|
__destroy_into_raw() {
|
|
1155
1161
|
const ptr = this.__wbg_ptr;
|
|
1156
1162
|
this.__wbg_ptr = 0;
|
|
@@ -1195,8 +1201,9 @@ export class IntoUnderlyingByteSource {
|
|
|
1195
1201
|
}
|
|
1196
1202
|
}
|
|
1197
1203
|
if (Symbol.dispose) IntoUnderlyingByteSource.prototype[Symbol.dispose] = IntoUnderlyingByteSource.prototype.free;
|
|
1204
|
+
exports.IntoUnderlyingByteSource = IntoUnderlyingByteSource;
|
|
1198
1205
|
|
|
1199
|
-
|
|
1206
|
+
class IntoUnderlyingSink {
|
|
1200
1207
|
__destroy_into_raw() {
|
|
1201
1208
|
const ptr = this.__wbg_ptr;
|
|
1202
1209
|
this.__wbg_ptr = 0;
|
|
@@ -1234,8 +1241,9 @@ export class IntoUnderlyingSink {
|
|
|
1234
1241
|
}
|
|
1235
1242
|
}
|
|
1236
1243
|
if (Symbol.dispose) IntoUnderlyingSink.prototype[Symbol.dispose] = IntoUnderlyingSink.prototype.free;
|
|
1244
|
+
exports.IntoUnderlyingSink = IntoUnderlyingSink;
|
|
1237
1245
|
|
|
1238
|
-
|
|
1246
|
+
class IntoUnderlyingSource {
|
|
1239
1247
|
__destroy_into_raw() {
|
|
1240
1248
|
const ptr = this.__wbg_ptr;
|
|
1241
1249
|
this.__wbg_ptr = 0;
|
|
@@ -1260,12 +1268,13 @@ export class IntoUnderlyingSource {
|
|
|
1260
1268
|
}
|
|
1261
1269
|
}
|
|
1262
1270
|
if (Symbol.dispose) IntoUnderlyingSource.prototype[Symbol.dispose] = IntoUnderlyingSource.prototype.free;
|
|
1271
|
+
exports.IntoUnderlyingSource = IntoUnderlyingSource;
|
|
1263
1272
|
|
|
1264
1273
|
/**
|
|
1265
1274
|
* A WASM wrapper for the Rust `cedarling::MultiIssuerAuthorizeResult` struct.
|
|
1266
1275
|
* Represents the result of a multi-issuer authorization request.
|
|
1267
1276
|
*/
|
|
1268
|
-
|
|
1277
|
+
class MultiIssuerAuthorizeResult {
|
|
1269
1278
|
static __wrap(ptr) {
|
|
1270
1279
|
const obj = Object.create(MultiIssuerAuthorizeResult.prototype);
|
|
1271
1280
|
obj.__wbg_ptr = ptr;
|
|
@@ -1369,6 +1378,7 @@ export class MultiIssuerAuthorizeResult {
|
|
|
1369
1378
|
}
|
|
1370
1379
|
}
|
|
1371
1380
|
if (Symbol.dispose) MultiIssuerAuthorizeResult.prototype[Symbol.dispose] = MultiIssuerAuthorizeResult.prototype.free;
|
|
1381
|
+
exports.MultiIssuerAuthorizeResult = MultiIssuerAuthorizeResult;
|
|
1372
1382
|
|
|
1373
1383
|
/**
|
|
1374
1384
|
* PolicyEvaluationError
|
|
@@ -1376,7 +1386,7 @@ if (Symbol.dispose) MultiIssuerAuthorizeResult.prototype[Symbol.dispose] = Multi
|
|
|
1376
1386
|
*
|
|
1377
1387
|
* Represents an error that occurred when evaluating a Cedar policy.
|
|
1378
1388
|
*/
|
|
1379
|
-
|
|
1389
|
+
class PolicyEvaluationError {
|
|
1380
1390
|
static __wrap(ptr) {
|
|
1381
1391
|
const obj = Object.create(PolicyEvaluationError.prototype);
|
|
1382
1392
|
obj.__wbg_ptr = ptr;
|
|
@@ -1435,6 +1445,7 @@ export class PolicyEvaluationError {
|
|
|
1435
1445
|
}
|
|
1436
1446
|
}
|
|
1437
1447
|
if (Symbol.dispose) PolicyEvaluationError.prototype[Symbol.dispose] = PolicyEvaluationError.prototype.free;
|
|
1448
|
+
exports.PolicyEvaluationError = PolicyEvaluationError;
|
|
1438
1449
|
|
|
1439
1450
|
/**
|
|
1440
1451
|
* Create a new instance of the Cedarling application.
|
|
@@ -1442,10 +1453,11 @@ if (Symbol.dispose) PolicyEvaluationError.prototype[Symbol.dispose] = PolicyEval
|
|
|
1442
1453
|
* @param {any} config
|
|
1443
1454
|
* @returns {Promise<Cedarling>}
|
|
1444
1455
|
*/
|
|
1445
|
-
|
|
1456
|
+
function init(config) {
|
|
1446
1457
|
const ret = wasm.init(addHeapObject(config));
|
|
1447
1458
|
return takeObject(ret);
|
|
1448
1459
|
}
|
|
1460
|
+
exports.init = init;
|
|
1449
1461
|
|
|
1450
1462
|
/**
|
|
1451
1463
|
* Create a new instance of the Cedarling application from archive bytes.
|
|
@@ -1467,10 +1479,11 @@ export function init(config) {
|
|
|
1467
1479
|
* @param {Uint8Array} archive_bytes
|
|
1468
1480
|
* @returns {Promise<Cedarling>}
|
|
1469
1481
|
*/
|
|
1470
|
-
|
|
1482
|
+
function init_from_archive_bytes(config, archive_bytes) {
|
|
1471
1483
|
const ret = wasm.init_from_archive_bytes(addHeapObject(config), addHeapObject(archive_bytes));
|
|
1472
1484
|
return takeObject(ret);
|
|
1473
1485
|
}
|
|
1486
|
+
exports.init_from_archive_bytes = init_from_archive_bytes;
|
|
1474
1487
|
function __wbg_get_imports() {
|
|
1475
1488
|
const import0 = {
|
|
1476
1489
|
__proto__: null,
|
|
@@ -1870,7 +1883,7 @@ function __wbg_get_imports() {
|
|
|
1870
1883
|
const a = state0.a;
|
|
1871
1884
|
state0.a = 0;
|
|
1872
1885
|
try {
|
|
1873
|
-
return
|
|
1886
|
+
return __wasm_bindgen_func_elem_8724(a, state0.b, arg0, arg1);
|
|
1874
1887
|
} finally {
|
|
1875
1888
|
state0.a = a;
|
|
1876
1889
|
}
|
|
@@ -2085,12 +2098,12 @@ function __wbg_get_imports() {
|
|
|
2085
2098
|
},
|
|
2086
2099
|
__wbindgen_cast_0000000000000002: function(arg0, arg1) {
|
|
2087
2100
|
// 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`.
|
|
2088
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
2101
|
+
const ret = makeMutClosure(arg0, arg1, __wasm_bindgen_func_elem_8670);
|
|
2089
2102
|
return addHeapObject(ret);
|
|
2090
2103
|
},
|
|
2091
2104
|
__wbindgen_cast_0000000000000003: function(arg0, arg1) {
|
|
2092
2105
|
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [], shim_idx: 883, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
2093
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
2106
|
+
const ret = makeMutClosure(arg0, arg1, __wasm_bindgen_func_elem_8505);
|
|
2094
2107
|
return addHeapObject(ret);
|
|
2095
2108
|
},
|
|
2096
2109
|
__wbindgen_cast_0000000000000004: function(arg0) {
|
|
@@ -2132,18 +2145,18 @@ function __wbg_get_imports() {
|
|
|
2132
2145
|
};
|
|
2133
2146
|
}
|
|
2134
2147
|
|
|
2135
|
-
function
|
|
2136
|
-
wasm.
|
|
2148
|
+
function __wasm_bindgen_func_elem_8505(arg0, arg1) {
|
|
2149
|
+
wasm.__wasm_bindgen_func_elem_8505(arg0, arg1);
|
|
2137
2150
|
}
|
|
2138
2151
|
|
|
2139
2152
|
function __wasm_bindgen_func_elem_12144(arg0, arg1, arg2) {
|
|
2140
2153
|
wasm.__wasm_bindgen_func_elem_12144(arg0, arg1, addHeapObject(arg2));
|
|
2141
2154
|
}
|
|
2142
2155
|
|
|
2143
|
-
function
|
|
2156
|
+
function __wasm_bindgen_func_elem_8670(arg0, arg1, arg2) {
|
|
2144
2157
|
try {
|
|
2145
2158
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
2146
|
-
wasm.
|
|
2159
|
+
wasm.__wasm_bindgen_func_elem_8670(retptr, arg0, arg1, addHeapObject(arg2));
|
|
2147
2160
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
2148
2161
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
2149
2162
|
if (r1) {
|
|
@@ -2154,8 +2167,8 @@ function __wasm_bindgen_func_elem_8668(arg0, arg1, arg2) {
|
|
|
2154
2167
|
}
|
|
2155
2168
|
}
|
|
2156
2169
|
|
|
2157
|
-
function
|
|
2158
|
-
wasm.
|
|
2170
|
+
function __wasm_bindgen_func_elem_8724(arg0, arg1, arg2, arg3) {
|
|
2171
|
+
wasm.__wasm_bindgen_func_elem_8724(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
|
|
2159
2172
|
}
|
|
2160
2173
|
|
|
2161
2174
|
|
|
@@ -2426,15 +2439,7 @@ function takeObject(idx) {
|
|
|
2426
2439
|
|
|
2427
2440
|
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
2428
2441
|
cachedTextDecoder.decode();
|
|
2429
|
-
const MAX_SAFARI_DECODE_BYTES = 2146435072;
|
|
2430
|
-
let numBytesDecoded = 0;
|
|
2431
2442
|
function decodeText(ptr, len) {
|
|
2432
|
-
numBytesDecoded += len;
|
|
2433
|
-
if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
|
|
2434
|
-
cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
2435
|
-
cachedTextDecoder.decode();
|
|
2436
|
-
numBytesDecoded = len;
|
|
2437
|
-
}
|
|
2438
2443
|
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
2439
2444
|
}
|
|
2440
2445
|
|
|
@@ -2453,95 +2458,8 @@ if (!('encodeInto' in cachedTextEncoder)) {
|
|
|
2453
2458
|
|
|
2454
2459
|
let WASM_VECTOR_LEN = 0;
|
|
2455
2460
|
|
|
2456
|
-
|
|
2457
|
-
|
|
2458
|
-
|
|
2459
|
-
|
|
2460
|
-
|
|
2461
|
-
cachedDataViewMemory0 = null;
|
|
2462
|
-
cachedUint8ArrayMemory0 = null;
|
|
2463
|
-
return wasm;
|
|
2464
|
-
}
|
|
2465
|
-
|
|
2466
|
-
async function __wbg_load(module, imports) {
|
|
2467
|
-
if (typeof Response === 'function' && module instanceof Response) {
|
|
2468
|
-
if (typeof WebAssembly.instantiateStreaming === 'function') {
|
|
2469
|
-
try {
|
|
2470
|
-
return await WebAssembly.instantiateStreaming(module, imports);
|
|
2471
|
-
} catch (e) {
|
|
2472
|
-
const validResponse = module.ok && expectedResponseType(module.type);
|
|
2473
|
-
|
|
2474
|
-
if (validResponse && module.headers.get('Content-Type') !== 'application/wasm') {
|
|
2475
|
-
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);
|
|
2476
|
-
|
|
2477
|
-
} else { throw e; }
|
|
2478
|
-
}
|
|
2479
|
-
}
|
|
2480
|
-
|
|
2481
|
-
const bytes = await module.arrayBuffer();
|
|
2482
|
-
return await WebAssembly.instantiate(bytes, imports);
|
|
2483
|
-
} else {
|
|
2484
|
-
const instance = await WebAssembly.instantiate(module, imports);
|
|
2485
|
-
|
|
2486
|
-
if (instance instanceof WebAssembly.Instance) {
|
|
2487
|
-
return { instance, module };
|
|
2488
|
-
} else {
|
|
2489
|
-
return instance;
|
|
2490
|
-
}
|
|
2491
|
-
}
|
|
2492
|
-
|
|
2493
|
-
function expectedResponseType(type) {
|
|
2494
|
-
switch (type) {
|
|
2495
|
-
case 'basic': case 'cors': case 'default': return true;
|
|
2496
|
-
}
|
|
2497
|
-
return false;
|
|
2498
|
-
}
|
|
2499
|
-
}
|
|
2500
|
-
|
|
2501
|
-
function initSync(module) {
|
|
2502
|
-
if (wasm !== undefined) return wasm;
|
|
2503
|
-
|
|
2504
|
-
|
|
2505
|
-
if (module !== undefined) {
|
|
2506
|
-
if (Object.getPrototypeOf(module) === Object.prototype) {
|
|
2507
|
-
({module} = module)
|
|
2508
|
-
} else {
|
|
2509
|
-
console.warn('using deprecated parameters for `initSync()`; pass a single object instead')
|
|
2510
|
-
}
|
|
2511
|
-
}
|
|
2512
|
-
|
|
2513
|
-
const imports = __wbg_get_imports();
|
|
2514
|
-
if (!(module instanceof WebAssembly.Module)) {
|
|
2515
|
-
module = new WebAssembly.Module(module);
|
|
2516
|
-
}
|
|
2517
|
-
const instance = new WebAssembly.Instance(module, imports);
|
|
2518
|
-
return __wbg_finalize_init(instance, module);
|
|
2519
|
-
}
|
|
2520
|
-
|
|
2521
|
-
async function __wbg_init(module_or_path) {
|
|
2522
|
-
if (wasm !== undefined) return wasm;
|
|
2523
|
-
|
|
2524
|
-
|
|
2525
|
-
if (module_or_path !== undefined) {
|
|
2526
|
-
if (Object.getPrototypeOf(module_or_path) === Object.prototype) {
|
|
2527
|
-
({module_or_path} = module_or_path)
|
|
2528
|
-
} else {
|
|
2529
|
-
console.warn('using deprecated parameters for the initialization function; pass a single object instead')
|
|
2530
|
-
}
|
|
2531
|
-
}
|
|
2532
|
-
|
|
2533
|
-
if (module_or_path === undefined) {
|
|
2534
|
-
module_or_path = new URL('cedarling_wasm_bg.wasm', import.meta.url);
|
|
2535
|
-
}
|
|
2536
|
-
const imports = __wbg_get_imports();
|
|
2537
|
-
|
|
2538
|
-
if (typeof module_or_path === 'string' || (typeof Request === 'function' && module_or_path instanceof Request) || (typeof URL === 'function' && module_or_path instanceof URL)) {
|
|
2539
|
-
module_or_path = fetch(module_or_path);
|
|
2540
|
-
}
|
|
2541
|
-
|
|
2542
|
-
const { instance, module } = await __wbg_load(await module_or_path, imports);
|
|
2543
|
-
|
|
2544
|
-
return __wbg_finalize_init(instance, module);
|
|
2545
|
-
}
|
|
2546
|
-
|
|
2547
|
-
export { initSync, __wbg_init as default };
|
|
2461
|
+
const wasmPath = `${__dirname}/cedarling_wasm_bg.wasm`;
|
|
2462
|
+
const wasmBytes = require('fs').readFileSync(wasmPath);
|
|
2463
|
+
const wasmModule = new WebAssembly.Module(wasmBytes);
|
|
2464
|
+
let wasmInstance = new WebAssembly.Instance(wasmModule, __wbg_get_imports());
|
|
2465
|
+
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.411-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
|
}
|