@janssenproject/cedarling_wasm 0.0.420 → 0.0.421-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.
@@ -56,6 +56,116 @@ export class AuthorizeResultResponse {
56
56
  readonly diagnostics: Diagnostics;
57
57
  }
58
58
 
59
+ /**
60
+ * WASM wrapper for
61
+ * `cedarling::BatchAuthorizeResponse<Result<MultiIssuerAuthorizeResult, BatchItemError>>`.
62
+ * Same shape as [`BatchAuthorizeUnsignedResponse`] with multi-issuer results.
63
+ */
64
+ export class BatchAuthorizeMultiIssuerResponse {
65
+ private constructor();
66
+ free(): void;
67
+ [Symbol.dispose](): void;
68
+ /**
69
+ * Shared correlation id stamped on every per-item decision log entry.
70
+ */
71
+ readonly batch_id: string;
72
+ /**
73
+ * Per-item results in input order — each slot is a
74
+ * [`BatchItemMultiIssuerResult`].
75
+ */
76
+ readonly results: BatchItemMultiIssuerResult[];
77
+ }
78
+
79
+ /**
80
+ * WASM wrapper for `cedarling::BatchAuthorizeResponse<Result<AuthorizeResult, BatchItemError>>`.
81
+ *
82
+ * Carries a shared `batch_id` (UUIDv7) alongside per-item results. Each result
83
+ * is a [`BatchItemUnsignedResult`] — Cedar decision on `is_ok()`, per-item
84
+ * build failure on `error`. `results[i]` corresponds to `items[i]`.
85
+ */
86
+ export class BatchAuthorizeUnsignedResponse {
87
+ private constructor();
88
+ free(): void;
89
+ [Symbol.dispose](): void;
90
+ /**
91
+ * Shared correlation id stamped on every per-item decision log entry.
92
+ */
93
+ readonly batch_id: string;
94
+ /**
95
+ * Per-item results in input order — each slot is a
96
+ * [`BatchItemUnsignedResult`].
97
+ */
98
+ readonly results: BatchItemUnsignedResult[];
99
+ }
100
+
101
+ /**
102
+ * Per-item build failure surfaced inside a batch response at `results[i]`
103
+ * when Cedar couldn't be reached for that item.
104
+ */
105
+ export class BatchItemError {
106
+ private constructor();
107
+ free(): void;
108
+ [Symbol.dispose](): void;
109
+ /**
110
+ * Stable variant slug — `action_parse`, `resource_build`, `context_build`,
111
+ * `principal_build`, `schema_validation`, `multi_issuer_entity`,
112
+ * `request_validation`.
113
+ */
114
+ readonly category: string;
115
+ /**
116
+ * Position of the failing item in the original `items` vector.
117
+ */
118
+ readonly item_index: number;
119
+ /**
120
+ * Human-readable diagnostic. Safe to log.
121
+ */
122
+ readonly message: string;
123
+ }
124
+
125
+ /**
126
+ * Multi-issuer analog of [`BatchItemUnsignedResult`].
127
+ */
128
+ export class BatchItemMultiIssuerResult {
129
+ private constructor();
130
+ free(): void;
131
+ [Symbol.dispose](): void;
132
+ /**
133
+ * The multi-issuer decision if `is_ok()`; throws otherwise.
134
+ */
135
+ unwrap(): MultiIssuerAuthorizeResult;
136
+ /**
137
+ * The per-item error if `!is_ok()`; `undefined` otherwise.
138
+ */
139
+ readonly error: BatchItemError | undefined;
140
+ /**
141
+ * `true` when Cedar evaluated this item.
142
+ */
143
+ readonly is_ok: boolean;
144
+ }
145
+
146
+ /**
147
+ * One slot in a batch response's `results` array. Callers switch on
148
+ * `is_ok()` — on `true`, read `unwrap()`; on `false`, read `error()`.
149
+ */
150
+ export class BatchItemUnsignedResult {
151
+ private constructor();
152
+ free(): void;
153
+ [Symbol.dispose](): void;
154
+ /**
155
+ * The Cedar decision if `is_ok()`; throws otherwise.
156
+ */
157
+ unwrap(): AuthorizeResult;
158
+ /**
159
+ * The per-item error if `!is_ok()`; `undefined` otherwise.
160
+ */
161
+ readonly error: BatchItemError | undefined;
162
+ /**
163
+ * `true` when Cedar evaluated this item (Allow or Deny); `false` when it
164
+ * failed to build.
165
+ */
166
+ readonly is_ok: boolean;
167
+ }
168
+
59
169
  /**
60
170
  * The instance of the Cedarling application.
61
171
  */
@@ -139,6 +249,27 @@ export class Cedarling {
139
249
  * ```
140
250
  */
141
251
  authorize_multi_issuer(request: string): Promise<MultiIssuerAuthorizeResult>;
252
+ /**
253
+ * Authorize a batch of multi-issuer requests against one shared token set.
254
+ *
255
+ * Tokens are validated and token/issuer entities are built once, then
256
+ * each item is evaluated in input order. Batch-level failures (validation,
257
+ * JWT verification, status-list refresh) reject the whole call; per-item
258
+ * failures are returned as `BatchItemError` results and exposed by WASM
259
+ * with `is_ok=false` and `error`, while genuine Cedar denials remain
260
+ * `AuthorizeResult` values with `decision=false`.
261
+ *
262
+ * # Arguments
263
+ *
264
+ * * `request` - JSON string representation of [`BatchAuthorizeMultiIssuerRequest`].
265
+ *
266
+ * # Example
267
+ *
268
+ * ```javascript
269
+ * const result = await cedarling.authorize_multi_issuer_batch(JSON.stringify(batchRequest));
270
+ * ```
271
+ */
272
+ authorize_multi_issuer_batch(request: string): Promise<BatchAuthorizeMultiIssuerResponse>;
142
273
  /**
143
274
  * Authorize an unsigned request carrying an optional single principal.
144
275
  * Makes an authorization decision based on the [`RequestUnsigned`].
@@ -159,6 +290,27 @@ export class Cedarling {
159
290
  * ```
160
291
  */
161
292
  authorize_unsigned(request: string): Promise<AuthorizeResult>;
293
+ /**
294
+ * Authorize a batch of unsigned requests against one shared principal.
295
+ *
296
+ * Setup work (principal build + pushed-data snapshot) runs once and each
297
+ * item is evaluated in input order. Results are returned inside a
298
+ * [`BatchAuthorizeUnsignedResponse`] carrying the shared `batch_id`.
299
+ * Batch-level failures (validation, principal parse) reject the whole
300
+ * call; per-item failures are returned as `BatchItemError` results and
301
+ * exposed by WASM with `is_ok=false` and `error`, while genuine Cedar
302
+ * denials remain `AuthorizeResult` values with `decision=false`.
303
+ * # Arguments
304
+ *
305
+ * * `request` - JSON string representation of [`BatchAuthorizeUnsignedRequest`].
306
+ *
307
+ * # Example
308
+ *
309
+ * ```javascript
310
+ * const result = await cedarling.authorize_unsigned_batch(JSON.stringify(batchRequest));
311
+ * ```
312
+ */
313
+ authorize_unsigned_batch(request: string): Promise<BatchAuthorizeUnsignedResponse>;
162
314
  /**
163
315
  * Clear all entries from the data store.
164
316
  *
@@ -605,150 +757,3 @@ export function init(config: any): Promise<Cedarling>;
605
757
  * ```
606
758
  */
607
759
  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_8692: (a: number, b: number, c: number, d: number) => void;
723
- readonly __wasm_bindgen_func_elem_8747: (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_8527: (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
- export class AuthorizeResult {
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
- export class AuthorizeResultResponse {
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,337 @@ export class AuthorizeResultResponse {
152
153
  }
153
154
  }
154
155
  if (Symbol.dispose) AuthorizeResultResponse.prototype[Symbol.dispose] = AuthorizeResultResponse.prototype.free;
156
+ exports.AuthorizeResultResponse = AuthorizeResultResponse;
157
+
158
+ /**
159
+ * WASM wrapper for
160
+ * `cedarling::BatchAuthorizeResponse<Result<MultiIssuerAuthorizeResult, BatchItemError>>`.
161
+ * Same shape as [`BatchAuthorizeUnsignedResponse`] with multi-issuer results.
162
+ */
163
+ class BatchAuthorizeMultiIssuerResponse {
164
+ static __wrap(ptr) {
165
+ const obj = Object.create(BatchAuthorizeMultiIssuerResponse.prototype);
166
+ obj.__wbg_ptr = ptr;
167
+ BatchAuthorizeMultiIssuerResponseFinalization.register(obj, obj.__wbg_ptr, obj);
168
+ return obj;
169
+ }
170
+ __destroy_into_raw() {
171
+ const ptr = this.__wbg_ptr;
172
+ this.__wbg_ptr = 0;
173
+ BatchAuthorizeMultiIssuerResponseFinalization.unregister(this);
174
+ return ptr;
175
+ }
176
+ free() {
177
+ const ptr = this.__destroy_into_raw();
178
+ wasm.__wbg_batchauthorizemultiissuerresponse_free(ptr, 0);
179
+ }
180
+ /**
181
+ * Shared correlation id stamped on every per-item decision log entry.
182
+ * @returns {string}
183
+ */
184
+ get batch_id() {
185
+ let deferred1_0;
186
+ let deferred1_1;
187
+ try {
188
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
189
+ wasm.batchauthorizemultiissuerresponse_batch_id(retptr, this.__wbg_ptr);
190
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
191
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
192
+ deferred1_0 = r0;
193
+ deferred1_1 = r1;
194
+ return getStringFromWasm0(r0, r1);
195
+ } finally {
196
+ wasm.__wbindgen_add_to_stack_pointer(16);
197
+ wasm.__wbindgen_export5(deferred1_0, deferred1_1, 1);
198
+ }
199
+ }
200
+ /**
201
+ * Per-item results in input order — each slot is a
202
+ * [`BatchItemMultiIssuerResult`].
203
+ * @returns {BatchItemMultiIssuerResult[]}
204
+ */
205
+ get results() {
206
+ try {
207
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
208
+ wasm.batchauthorizemultiissuerresponse_results(retptr, this.__wbg_ptr);
209
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
210
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
211
+ var v1 = getArrayJsValueFromWasm0(r0, r1).slice();
212
+ wasm.__wbindgen_export5(r0, r1 * 4, 4);
213
+ return v1;
214
+ } finally {
215
+ wasm.__wbindgen_add_to_stack_pointer(16);
216
+ }
217
+ }
218
+ }
219
+ if (Symbol.dispose) BatchAuthorizeMultiIssuerResponse.prototype[Symbol.dispose] = BatchAuthorizeMultiIssuerResponse.prototype.free;
220
+ exports.BatchAuthorizeMultiIssuerResponse = BatchAuthorizeMultiIssuerResponse;
221
+
222
+ /**
223
+ * WASM wrapper for `cedarling::BatchAuthorizeResponse<Result<AuthorizeResult, BatchItemError>>`.
224
+ *
225
+ * Carries a shared `batch_id` (UUIDv7) alongside per-item results. Each result
226
+ * is a [`BatchItemUnsignedResult`] — Cedar decision on `is_ok()`, per-item
227
+ * build failure on `error`. `results[i]` corresponds to `items[i]`.
228
+ */
229
+ class BatchAuthorizeUnsignedResponse {
230
+ static __wrap(ptr) {
231
+ const obj = Object.create(BatchAuthorizeUnsignedResponse.prototype);
232
+ obj.__wbg_ptr = ptr;
233
+ BatchAuthorizeUnsignedResponseFinalization.register(obj, obj.__wbg_ptr, obj);
234
+ return obj;
235
+ }
236
+ __destroy_into_raw() {
237
+ const ptr = this.__wbg_ptr;
238
+ this.__wbg_ptr = 0;
239
+ BatchAuthorizeUnsignedResponseFinalization.unregister(this);
240
+ return ptr;
241
+ }
242
+ free() {
243
+ const ptr = this.__destroy_into_raw();
244
+ wasm.__wbg_batchauthorizeunsignedresponse_free(ptr, 0);
245
+ }
246
+ /**
247
+ * Shared correlation id stamped on every per-item decision log entry.
248
+ * @returns {string}
249
+ */
250
+ get batch_id() {
251
+ let deferred1_0;
252
+ let deferred1_1;
253
+ try {
254
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
255
+ wasm.batchauthorizeunsignedresponse_batch_id(retptr, this.__wbg_ptr);
256
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
257
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
258
+ deferred1_0 = r0;
259
+ deferred1_1 = r1;
260
+ return getStringFromWasm0(r0, r1);
261
+ } finally {
262
+ wasm.__wbindgen_add_to_stack_pointer(16);
263
+ wasm.__wbindgen_export5(deferred1_0, deferred1_1, 1);
264
+ }
265
+ }
266
+ /**
267
+ * Per-item results in input order — each slot is a
268
+ * [`BatchItemUnsignedResult`].
269
+ * @returns {BatchItemUnsignedResult[]}
270
+ */
271
+ get results() {
272
+ try {
273
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
274
+ wasm.batchauthorizeunsignedresponse_results(retptr, this.__wbg_ptr);
275
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
276
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
277
+ var v1 = getArrayJsValueFromWasm0(r0, r1).slice();
278
+ wasm.__wbindgen_export5(r0, r1 * 4, 4);
279
+ return v1;
280
+ } finally {
281
+ wasm.__wbindgen_add_to_stack_pointer(16);
282
+ }
283
+ }
284
+ }
285
+ if (Symbol.dispose) BatchAuthorizeUnsignedResponse.prototype[Symbol.dispose] = BatchAuthorizeUnsignedResponse.prototype.free;
286
+ exports.BatchAuthorizeUnsignedResponse = BatchAuthorizeUnsignedResponse;
287
+
288
+ /**
289
+ * Per-item build failure surfaced inside a batch response at `results[i]`
290
+ * when Cedar couldn't be reached for that item.
291
+ */
292
+ class BatchItemError {
293
+ static __wrap(ptr) {
294
+ const obj = Object.create(BatchItemError.prototype);
295
+ obj.__wbg_ptr = ptr;
296
+ BatchItemErrorFinalization.register(obj, obj.__wbg_ptr, obj);
297
+ return obj;
298
+ }
299
+ __destroy_into_raw() {
300
+ const ptr = this.__wbg_ptr;
301
+ this.__wbg_ptr = 0;
302
+ BatchItemErrorFinalization.unregister(this);
303
+ return ptr;
304
+ }
305
+ free() {
306
+ const ptr = this.__destroy_into_raw();
307
+ wasm.__wbg_batchitemerror_free(ptr, 0);
308
+ }
309
+ /**
310
+ * Stable variant slug — `action_parse`, `resource_build`, `context_build`,
311
+ * `principal_build`, `schema_validation`, `multi_issuer_entity`,
312
+ * `request_validation`.
313
+ * @returns {string}
314
+ */
315
+ get category() {
316
+ let deferred1_0;
317
+ let deferred1_1;
318
+ try {
319
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
320
+ wasm.batchitemerror_category(retptr, this.__wbg_ptr);
321
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
322
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
323
+ deferred1_0 = r0;
324
+ deferred1_1 = r1;
325
+ return getStringFromWasm0(r0, r1);
326
+ } finally {
327
+ wasm.__wbindgen_add_to_stack_pointer(16);
328
+ wasm.__wbindgen_export5(deferred1_0, deferred1_1, 1);
329
+ }
330
+ }
331
+ /**
332
+ * Position of the failing item in the original `items` vector.
333
+ * @returns {number}
334
+ */
335
+ get item_index() {
336
+ const ret = wasm.batchitemerror_item_index(this.__wbg_ptr);
337
+ return ret >>> 0;
338
+ }
339
+ /**
340
+ * Human-readable diagnostic. Safe to log.
341
+ * @returns {string}
342
+ */
343
+ get message() {
344
+ let deferred1_0;
345
+ let deferred1_1;
346
+ try {
347
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
348
+ wasm.batchitemerror_message(retptr, this.__wbg_ptr);
349
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
350
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
351
+ deferred1_0 = r0;
352
+ deferred1_1 = r1;
353
+ return getStringFromWasm0(r0, r1);
354
+ } finally {
355
+ wasm.__wbindgen_add_to_stack_pointer(16);
356
+ wasm.__wbindgen_export5(deferred1_0, deferred1_1, 1);
357
+ }
358
+ }
359
+ }
360
+ if (Symbol.dispose) BatchItemError.prototype[Symbol.dispose] = BatchItemError.prototype.free;
361
+ exports.BatchItemError = BatchItemError;
362
+
363
+ /**
364
+ * Multi-issuer analog of [`BatchItemUnsignedResult`].
365
+ */
366
+ class BatchItemMultiIssuerResult {
367
+ static __wrap(ptr) {
368
+ const obj = Object.create(BatchItemMultiIssuerResult.prototype);
369
+ obj.__wbg_ptr = ptr;
370
+ BatchItemMultiIssuerResultFinalization.register(obj, obj.__wbg_ptr, obj);
371
+ return obj;
372
+ }
373
+ __destroy_into_raw() {
374
+ const ptr = this.__wbg_ptr;
375
+ this.__wbg_ptr = 0;
376
+ BatchItemMultiIssuerResultFinalization.unregister(this);
377
+ return ptr;
378
+ }
379
+ free() {
380
+ const ptr = this.__destroy_into_raw();
381
+ wasm.__wbg_batchitemmultiissuerresult_free(ptr, 0);
382
+ }
383
+ /**
384
+ * The per-item error if `!is_ok()`; `undefined` otherwise.
385
+ * @returns {BatchItemError | undefined}
386
+ */
387
+ get error() {
388
+ const ret = wasm.batchitemmultiissuerresult_error(this.__wbg_ptr);
389
+ return ret === 0 ? undefined : BatchItemError.__wrap(ret);
390
+ }
391
+ /**
392
+ * `true` when Cedar evaluated this item.
393
+ * @returns {boolean}
394
+ */
395
+ get is_ok() {
396
+ const ret = wasm.batchitemmultiissuerresult_is_ok(this.__wbg_ptr);
397
+ return ret !== 0;
398
+ }
399
+ /**
400
+ * The multi-issuer decision if `is_ok()`; throws otherwise.
401
+ * @returns {MultiIssuerAuthorizeResult}
402
+ */
403
+ unwrap() {
404
+ try {
405
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
406
+ wasm.batchitemmultiissuerresult_unwrap(retptr, this.__wbg_ptr);
407
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
408
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
409
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
410
+ if (r2) {
411
+ throw takeObject(r1);
412
+ }
413
+ return MultiIssuerAuthorizeResult.__wrap(r0);
414
+ } finally {
415
+ wasm.__wbindgen_add_to_stack_pointer(16);
416
+ }
417
+ }
418
+ }
419
+ if (Symbol.dispose) BatchItemMultiIssuerResult.prototype[Symbol.dispose] = BatchItemMultiIssuerResult.prototype.free;
420
+ exports.BatchItemMultiIssuerResult = BatchItemMultiIssuerResult;
421
+
422
+ /**
423
+ * One slot in a batch response's `results` array. Callers switch on
424
+ * `is_ok()` — on `true`, read `unwrap()`; on `false`, read `error()`.
425
+ */
426
+ class BatchItemUnsignedResult {
427
+ static __wrap(ptr) {
428
+ const obj = Object.create(BatchItemUnsignedResult.prototype);
429
+ obj.__wbg_ptr = ptr;
430
+ BatchItemUnsignedResultFinalization.register(obj, obj.__wbg_ptr, obj);
431
+ return obj;
432
+ }
433
+ __destroy_into_raw() {
434
+ const ptr = this.__wbg_ptr;
435
+ this.__wbg_ptr = 0;
436
+ BatchItemUnsignedResultFinalization.unregister(this);
437
+ return ptr;
438
+ }
439
+ free() {
440
+ const ptr = this.__destroy_into_raw();
441
+ wasm.__wbg_batchitemunsignedresult_free(ptr, 0);
442
+ }
443
+ /**
444
+ * The per-item error if `!is_ok()`; `undefined` otherwise.
445
+ * @returns {BatchItemError | undefined}
446
+ */
447
+ get error() {
448
+ const ret = wasm.batchitemunsignedresult_error(this.__wbg_ptr);
449
+ return ret === 0 ? undefined : BatchItemError.__wrap(ret);
450
+ }
451
+ /**
452
+ * `true` when Cedar evaluated this item (Allow or Deny); `false` when it
453
+ * failed to build.
454
+ * @returns {boolean}
455
+ */
456
+ get is_ok() {
457
+ const ret = wasm.batchitemunsignedresult_is_ok(this.__wbg_ptr);
458
+ return ret !== 0;
459
+ }
460
+ /**
461
+ * The Cedar decision if `is_ok()`; throws otherwise.
462
+ * @returns {AuthorizeResult}
463
+ */
464
+ unwrap() {
465
+ try {
466
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
467
+ wasm.batchitemunsignedresult_unwrap(retptr, this.__wbg_ptr);
468
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
469
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
470
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
471
+ if (r2) {
472
+ throw takeObject(r1);
473
+ }
474
+ return AuthorizeResult.__wrap(r0);
475
+ } finally {
476
+ wasm.__wbindgen_add_to_stack_pointer(16);
477
+ }
478
+ }
479
+ }
480
+ if (Symbol.dispose) BatchItemUnsignedResult.prototype[Symbol.dispose] = BatchItemUnsignedResult.prototype.free;
481
+ exports.BatchItemUnsignedResult = BatchItemUnsignedResult;
155
482
 
156
483
  /**
157
484
  * The instance of the Cedarling application.
158
485
  */
159
- export class Cedarling {
486
+ class Cedarling {
160
487
  static __wrap(ptr) {
161
488
  const obj = Object.create(Cedarling.prototype);
162
489
  obj.__wbg_ptr = ptr;
@@ -311,6 +638,34 @@ export class Cedarling {
311
638
  const ret = wasm.cedarling_authorize_multi_issuer(this.__wbg_ptr, ptr0, len0);
312
639
  return takeObject(ret);
313
640
  }
641
+ /**
642
+ * Authorize a batch of multi-issuer requests against one shared token set.
643
+ *
644
+ * Tokens are validated and token/issuer entities are built once, then
645
+ * each item is evaluated in input order. Batch-level failures (validation,
646
+ * JWT verification, status-list refresh) reject the whole call; per-item
647
+ * failures are returned as `BatchItemError` results and exposed by WASM
648
+ * with `is_ok=false` and `error`, while genuine Cedar denials remain
649
+ * `AuthorizeResult` values with `decision=false`.
650
+ *
651
+ * # Arguments
652
+ *
653
+ * * `request` - JSON string representation of [`BatchAuthorizeMultiIssuerRequest`].
654
+ *
655
+ * # Example
656
+ *
657
+ * ```javascript
658
+ * const result = await cedarling.authorize_multi_issuer_batch(JSON.stringify(batchRequest));
659
+ * ```
660
+ * @param {string} request
661
+ * @returns {Promise<BatchAuthorizeMultiIssuerResponse>}
662
+ */
663
+ authorize_multi_issuer_batch(request) {
664
+ const ptr0 = passStringToWasm0(request, wasm.__wbindgen_export, wasm.__wbindgen_export2);
665
+ const len0 = WASM_VECTOR_LEN;
666
+ const ret = wasm.cedarling_authorize_multi_issuer_batch(this.__wbg_ptr, ptr0, len0);
667
+ return takeObject(ret);
668
+ }
314
669
  /**
315
670
  * Authorize an unsigned request carrying an optional single principal.
316
671
  * Makes an authorization decision based on the [`RequestUnsigned`].
@@ -338,6 +693,34 @@ export class Cedarling {
338
693
  const ret = wasm.cedarling_authorize_unsigned(this.__wbg_ptr, ptr0, len0);
339
694
  return takeObject(ret);
340
695
  }
696
+ /**
697
+ * Authorize a batch of unsigned requests against one shared principal.
698
+ *
699
+ * Setup work (principal build + pushed-data snapshot) runs once and each
700
+ * item is evaluated in input order. Results are returned inside a
701
+ * [`BatchAuthorizeUnsignedResponse`] carrying the shared `batch_id`.
702
+ * Batch-level failures (validation, principal parse) reject the whole
703
+ * call; per-item failures are returned as `BatchItemError` results and
704
+ * exposed by WASM with `is_ok=false` and `error`, while genuine Cedar
705
+ * denials remain `AuthorizeResult` values with `decision=false`.
706
+ * # Arguments
707
+ *
708
+ * * `request` - JSON string representation of [`BatchAuthorizeUnsignedRequest`].
709
+ *
710
+ * # Example
711
+ *
712
+ * ```javascript
713
+ * const result = await cedarling.authorize_unsigned_batch(JSON.stringify(batchRequest));
714
+ * ```
715
+ * @param {string} request
716
+ * @returns {Promise<BatchAuthorizeUnsignedResponse>}
717
+ */
718
+ authorize_unsigned_batch(request) {
719
+ const ptr0 = passStringToWasm0(request, wasm.__wbindgen_export, wasm.__wbindgen_export2);
720
+ const len0 = WASM_VECTOR_LEN;
721
+ const ret = wasm.cedarling_authorize_unsigned_batch(this.__wbg_ptr, ptr0, len0);
722
+ return takeObject(ret);
723
+ }
341
724
  /**
342
725
  * Clear all entries from the data store.
343
726
  *
@@ -828,12 +1211,13 @@ export class Cedarling {
828
1211
  }
829
1212
  }
830
1213
  if (Symbol.dispose) Cedarling.prototype[Symbol.dispose] = Cedarling.prototype.free;
1214
+ exports.Cedarling = Cedarling;
831
1215
 
832
1216
  /**
833
1217
  * A WASM wrapper for the Rust `cedarling::DataEntry` struct.
834
1218
  * Represents a data entry in the DataStore with value and metadata.
835
1219
  */
836
- export class DataEntry {
1220
+ class DataEntry {
837
1221
  static __wrap(ptr) {
838
1222
  const obj = Object.create(DataEntry.prototype);
839
1223
  obj.__wbg_ptr = ptr;
@@ -1022,12 +1406,13 @@ export class DataEntry {
1022
1406
  }
1023
1407
  }
1024
1408
  if (Symbol.dispose) DataEntry.prototype[Symbol.dispose] = DataEntry.prototype.free;
1409
+ exports.DataEntry = DataEntry;
1025
1410
 
1026
1411
  /**
1027
1412
  * A WASM wrapper for the Rust `cedarling::DataStoreStats` struct.
1028
1413
  * Statistics about the DataStore.
1029
1414
  */
1030
- export class DataStoreStats {
1415
+ class DataStoreStats {
1031
1416
  static __wrap(ptr) {
1032
1417
  const obj = Object.create(DataStoreStats.prototype);
1033
1418
  obj.__wbg_ptr = ptr;
@@ -1201,6 +1586,7 @@ export class DataStoreStats {
1201
1586
  }
1202
1587
  }
1203
1588
  if (Symbol.dispose) DataStoreStats.prototype[Symbol.dispose] = DataStoreStats.prototype.free;
1589
+ exports.DataStoreStats = DataStoreStats;
1204
1590
 
1205
1591
  /**
1206
1592
  * Diagnostics
@@ -1208,7 +1594,7 @@ if (Symbol.dispose) DataStoreStats.prototype[Symbol.dispose] = DataStoreStats.pr
1208
1594
  *
1209
1595
  * Provides detailed information about how a policy decision was made, including policies that contributed to the decision and any errors encountered during evaluation.
1210
1596
  */
1211
- export class Diagnostics {
1597
+ class Diagnostics {
1212
1598
  static __wrap(ptr) {
1213
1599
  const obj = Object.create(Diagnostics.prototype);
1214
1600
  obj.__wbg_ptr = ptr;
@@ -1265,8 +1651,9 @@ export class Diagnostics {
1265
1651
  }
1266
1652
  }
1267
1653
  if (Symbol.dispose) Diagnostics.prototype[Symbol.dispose] = Diagnostics.prototype.free;
1654
+ exports.Diagnostics = Diagnostics;
1268
1655
 
1269
- export class IntoUnderlyingByteSource {
1656
+ class IntoUnderlyingByteSource {
1270
1657
  __destroy_into_raw() {
1271
1658
  const ptr = this.__wbg_ptr;
1272
1659
  this.__wbg_ptr = 0;
@@ -1311,8 +1698,9 @@ export class IntoUnderlyingByteSource {
1311
1698
  }
1312
1699
  }
1313
1700
  if (Symbol.dispose) IntoUnderlyingByteSource.prototype[Symbol.dispose] = IntoUnderlyingByteSource.prototype.free;
1701
+ exports.IntoUnderlyingByteSource = IntoUnderlyingByteSource;
1314
1702
 
1315
- export class IntoUnderlyingSink {
1703
+ class IntoUnderlyingSink {
1316
1704
  __destroy_into_raw() {
1317
1705
  const ptr = this.__wbg_ptr;
1318
1706
  this.__wbg_ptr = 0;
@@ -1350,8 +1738,9 @@ export class IntoUnderlyingSink {
1350
1738
  }
1351
1739
  }
1352
1740
  if (Symbol.dispose) IntoUnderlyingSink.prototype[Symbol.dispose] = IntoUnderlyingSink.prototype.free;
1741
+ exports.IntoUnderlyingSink = IntoUnderlyingSink;
1353
1742
 
1354
- export class IntoUnderlyingSource {
1743
+ class IntoUnderlyingSource {
1355
1744
  __destroy_into_raw() {
1356
1745
  const ptr = this.__wbg_ptr;
1357
1746
  this.__wbg_ptr = 0;
@@ -1376,12 +1765,13 @@ export class IntoUnderlyingSource {
1376
1765
  }
1377
1766
  }
1378
1767
  if (Symbol.dispose) IntoUnderlyingSource.prototype[Symbol.dispose] = IntoUnderlyingSource.prototype.free;
1768
+ exports.IntoUnderlyingSource = IntoUnderlyingSource;
1379
1769
 
1380
1770
  /**
1381
1771
  * A WASM wrapper for the Rust `cedarling::MultiIssuerAuthorizeResult` struct.
1382
1772
  * Represents the result of a multi-issuer authorization request.
1383
1773
  */
1384
- export class MultiIssuerAuthorizeResult {
1774
+ class MultiIssuerAuthorizeResult {
1385
1775
  static __wrap(ptr) {
1386
1776
  const obj = Object.create(MultiIssuerAuthorizeResult.prototype);
1387
1777
  obj.__wbg_ptr = ptr;
@@ -1485,6 +1875,7 @@ export class MultiIssuerAuthorizeResult {
1485
1875
  }
1486
1876
  }
1487
1877
  if (Symbol.dispose) MultiIssuerAuthorizeResult.prototype[Symbol.dispose] = MultiIssuerAuthorizeResult.prototype.free;
1878
+ exports.MultiIssuerAuthorizeResult = MultiIssuerAuthorizeResult;
1488
1879
 
1489
1880
  /**
1490
1881
  * PolicyEvaluationError
@@ -1492,7 +1883,7 @@ if (Symbol.dispose) MultiIssuerAuthorizeResult.prototype[Symbol.dispose] = Multi
1492
1883
  *
1493
1884
  * Represents an error that occurred when evaluating a Cedar policy.
1494
1885
  */
1495
- export class PolicyEvaluationError {
1886
+ class PolicyEvaluationError {
1496
1887
  static __wrap(ptr) {
1497
1888
  const obj = Object.create(PolicyEvaluationError.prototype);
1498
1889
  obj.__wbg_ptr = ptr;
@@ -1551,6 +1942,7 @@ export class PolicyEvaluationError {
1551
1942
  }
1552
1943
  }
1553
1944
  if (Symbol.dispose) PolicyEvaluationError.prototype[Symbol.dispose] = PolicyEvaluationError.prototype.free;
1945
+ exports.PolicyEvaluationError = PolicyEvaluationError;
1554
1946
 
1555
1947
  /**
1556
1948
  * Create a new instance of the Cedarling application.
@@ -1558,10 +1950,11 @@ if (Symbol.dispose) PolicyEvaluationError.prototype[Symbol.dispose] = PolicyEval
1558
1950
  * @param {any} config
1559
1951
  * @returns {Promise<Cedarling>}
1560
1952
  */
1561
- export function init(config) {
1953
+ function init(config) {
1562
1954
  const ret = wasm.init(addHeapObject(config));
1563
1955
  return takeObject(ret);
1564
1956
  }
1957
+ exports.init = init;
1565
1958
 
1566
1959
  /**
1567
1960
  * Create a new instance of the Cedarling application from archive bytes.
@@ -1583,10 +1976,11 @@ export function init(config) {
1583
1976
  * @param {Uint8Array} archive_bytes
1584
1977
  * @returns {Promise<Cedarling>}
1585
1978
  */
1586
- export function init_from_archive_bytes(config, archive_bytes) {
1979
+ function init_from_archive_bytes(config, archive_bytes) {
1587
1980
  const ret = wasm.init_from_archive_bytes(addHeapObject(config), addHeapObject(archive_bytes));
1588
1981
  return takeObject(ret);
1589
1982
  }
1983
+ exports.init_from_archive_bytes = init_from_archive_bytes;
1590
1984
  function __wbg_get_imports() {
1591
1985
  const import0 = {
1592
1986
  __proto__: null,
@@ -1686,6 +2080,22 @@ function __wbg_get_imports() {
1686
2080
  const ret = AuthorizeResult.__wrap(arg0);
1687
2081
  return addHeapObject(ret);
1688
2082
  },
2083
+ __wbg_batchauthorizemultiissuerresponse_new: function(arg0) {
2084
+ const ret = BatchAuthorizeMultiIssuerResponse.__wrap(arg0);
2085
+ return addHeapObject(ret);
2086
+ },
2087
+ __wbg_batchauthorizeunsignedresponse_new: function(arg0) {
2088
+ const ret = BatchAuthorizeUnsignedResponse.__wrap(arg0);
2089
+ return addHeapObject(ret);
2090
+ },
2091
+ __wbg_batchitemmultiissuerresult_new: function(arg0) {
2092
+ const ret = BatchItemMultiIssuerResult.__wrap(arg0);
2093
+ return addHeapObject(ret);
2094
+ },
2095
+ __wbg_batchitemunsignedresult_new: function(arg0) {
2096
+ const ret = BatchItemUnsignedResult.__wrap(arg0);
2097
+ return addHeapObject(ret);
2098
+ },
1689
2099
  __wbg_body_18c9f2ac15ead4b2: function(arg0) {
1690
2100
  const ret = getObject(arg0).body;
1691
2101
  return isLikeNone(ret) ? 0 : addHeapObject(ret);
@@ -1986,7 +2396,7 @@ function __wbg_get_imports() {
1986
2396
  const a = state0.a;
1987
2397
  state0.a = 0;
1988
2398
  try {
1989
- return __wasm_bindgen_func_elem_8747(a, state0.b, arg0, arg1);
2399
+ return __wasm_bindgen_func_elem_8836(a, state0.b, arg0, arg1);
1990
2400
  } finally {
1991
2401
  state0.a = a;
1992
2402
  }
@@ -2195,18 +2605,18 @@ function __wbg_get_imports() {
2195
2605
  console.warn(...getObject(arg0));
2196
2606
  },
2197
2607
  __wbindgen_cast_0000000000000001: function(arg0, arg1) {
2198
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 1196, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
2199
- const ret = makeMutClosure(arg0, arg1, __wasm_bindgen_func_elem_12170);
2608
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 1193, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
2609
+ const ret = makeMutClosure(arg0, arg1, __wasm_bindgen_func_elem_12258);
2200
2610
  return addHeapObject(ret);
2201
2611
  },
2202
2612
  __wbindgen_cast_0000000000000002: function(arg0, arg1) {
2203
- // 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, __wasm_bindgen_func_elem_8692);
2613
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 992, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
2614
+ const ret = makeMutClosure(arg0, arg1, __wasm_bindgen_func_elem_8781);
2205
2615
  return addHeapObject(ret);
2206
2616
  },
2207
2617
  __wbindgen_cast_0000000000000003: function(arg0, arg1) {
2208
- // 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, __wasm_bindgen_func_elem_8527);
2618
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [], shim_idx: 876, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
2619
+ const ret = makeMutClosure(arg0, arg1, __wasm_bindgen_func_elem_8616);
2210
2620
  return addHeapObject(ret);
2211
2621
  },
2212
2622
  __wbindgen_cast_0000000000000004: function(arg0) {
@@ -2248,18 +2658,18 @@ function __wbg_get_imports() {
2248
2658
  };
2249
2659
  }
2250
2660
 
2251
- function __wasm_bindgen_func_elem_8527(arg0, arg1) {
2252
- wasm.__wasm_bindgen_func_elem_8527(arg0, arg1);
2661
+ function __wasm_bindgen_func_elem_8616(arg0, arg1) {
2662
+ wasm.__wasm_bindgen_func_elem_8616(arg0, arg1);
2253
2663
  }
2254
2664
 
2255
- function __wasm_bindgen_func_elem_12170(arg0, arg1, arg2) {
2256
- wasm.__wasm_bindgen_func_elem_12170(arg0, arg1, addHeapObject(arg2));
2665
+ function __wasm_bindgen_func_elem_12258(arg0, arg1, arg2) {
2666
+ wasm.__wasm_bindgen_func_elem_12258(arg0, arg1, addHeapObject(arg2));
2257
2667
  }
2258
2668
 
2259
- function __wasm_bindgen_func_elem_8692(arg0, arg1, arg2) {
2669
+ function __wasm_bindgen_func_elem_8781(arg0, arg1, arg2) {
2260
2670
  try {
2261
2671
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2262
- wasm.__wasm_bindgen_func_elem_8692(retptr, arg0, arg1, addHeapObject(arg2));
2672
+ wasm.__wasm_bindgen_func_elem_8781(retptr, arg0, arg1, addHeapObject(arg2));
2263
2673
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2264
2674
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2265
2675
  if (r1) {
@@ -2270,8 +2680,8 @@ function __wasm_bindgen_func_elem_8692(arg0, arg1, arg2) {
2270
2680
  }
2271
2681
  }
2272
2682
 
2273
- function __wasm_bindgen_func_elem_8747(arg0, arg1, arg2, arg3) {
2274
- wasm.__wasm_bindgen_func_elem_8747(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
2683
+ function __wasm_bindgen_func_elem_8836(arg0, arg1, arg2, arg3) {
2684
+ wasm.__wasm_bindgen_func_elem_8836(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
2275
2685
  }
2276
2686
 
2277
2687
 
@@ -2297,6 +2707,21 @@ const AuthorizeResultFinalization = (typeof FinalizationRegistry === 'undefined'
2297
2707
  const AuthorizeResultResponseFinalization = (typeof FinalizationRegistry === 'undefined')
2298
2708
  ? { register: () => {}, unregister: () => {} }
2299
2709
  : new FinalizationRegistry(ptr => wasm.__wbg_authorizeresultresponse_free(ptr, 1));
2710
+ const BatchAuthorizeMultiIssuerResponseFinalization = (typeof FinalizationRegistry === 'undefined')
2711
+ ? { register: () => {}, unregister: () => {} }
2712
+ : new FinalizationRegistry(ptr => wasm.__wbg_batchauthorizemultiissuerresponse_free(ptr, 1));
2713
+ const BatchAuthorizeUnsignedResponseFinalization = (typeof FinalizationRegistry === 'undefined')
2714
+ ? { register: () => {}, unregister: () => {} }
2715
+ : new FinalizationRegistry(ptr => wasm.__wbg_batchauthorizeunsignedresponse_free(ptr, 1));
2716
+ const BatchItemErrorFinalization = (typeof FinalizationRegistry === 'undefined')
2717
+ ? { register: () => {}, unregister: () => {} }
2718
+ : new FinalizationRegistry(ptr => wasm.__wbg_batchitemerror_free(ptr, 1));
2719
+ const BatchItemMultiIssuerResultFinalization = (typeof FinalizationRegistry === 'undefined')
2720
+ ? { register: () => {}, unregister: () => {} }
2721
+ : new FinalizationRegistry(ptr => wasm.__wbg_batchitemmultiissuerresult_free(ptr, 1));
2722
+ const BatchItemUnsignedResultFinalization = (typeof FinalizationRegistry === 'undefined')
2723
+ ? { register: () => {}, unregister: () => {} }
2724
+ : new FinalizationRegistry(ptr => wasm.__wbg_batchitemunsignedresult_free(ptr, 1));
2300
2725
  const CedarlingFinalization = (typeof FinalizationRegistry === 'undefined')
2301
2726
  ? { register: () => {}, unregister: () => {} }
2302
2727
  : new FinalizationRegistry(ptr => wasm.__wbg_cedarling_free(ptr, 1));
@@ -2552,15 +2977,7 @@ function takeObject(idx) {
2552
2977
 
2553
2978
  let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
2554
2979
  cachedTextDecoder.decode();
2555
- const MAX_SAFARI_DECODE_BYTES = 2146435072;
2556
- let numBytesDecoded = 0;
2557
2980
  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
2981
  return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
2565
2982
  }
2566
2983
 
@@ -2579,95 +2996,8 @@ if (!('encodeInto' in cachedTextEncoder)) {
2579
2996
 
2580
2997
  let WASM_VECTOR_LEN = 0;
2581
2998
 
2582
- let wasmModule, wasmInstance, wasm;
2583
- function __wbg_finalize_init(instance, module) {
2584
- wasmInstance = instance;
2585
- wasm = instance.exports;
2586
- wasmModule = module;
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 };
2999
+ const wasmPath = `${__dirname}/cedarling_wasm_bg.wasm`;
3000
+ const wasmBytes = require('fs').readFileSync(wasmPath);
3001
+ const wasmModule = new WebAssembly.Module(wasmBytes);
3002
+ let wasmInstance = new WebAssembly.Instance(wasmModule, __wbg_get_imports());
3003
+ let wasm = wasmInstance.exports;
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.420",
4
+ "version": "0.0.421-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
  }