@janssenproject/cedarling_wasm 0.0.315 → 0.0.316-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.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
  ptr = ptr >>> 0;
10
10
  const obj = Object.create(AuthorizeResult.prototype);
@@ -138,12 +138,13 @@ export class AuthorizeResult {
138
138
  }
139
139
  }
140
140
  if (Symbol.dispose) AuthorizeResult.prototype[Symbol.dispose] = AuthorizeResult.prototype.free;
141
+ exports.AuthorizeResult = AuthorizeResult;
141
142
 
142
143
  /**
143
144
  * A WASM wrapper for the Rust `cedar_policy::Response` struct.
144
145
  * Represents the result of an authorization request.
145
146
  */
146
- export class AuthorizeResultResponse {
147
+ class AuthorizeResultResponse {
147
148
  static __wrap(ptr) {
148
149
  ptr = ptr >>> 0;
149
150
  const obj = Object.create(AuthorizeResultResponse.prototype);
@@ -179,11 +180,12 @@ export class AuthorizeResultResponse {
179
180
  }
180
181
  }
181
182
  if (Symbol.dispose) AuthorizeResultResponse.prototype[Symbol.dispose] = AuthorizeResultResponse.prototype.free;
183
+ exports.AuthorizeResultResponse = AuthorizeResultResponse;
182
184
 
183
185
  /**
184
186
  * The instance of the Cedarling application.
185
187
  */
186
- export class Cedarling {
188
+ class Cedarling {
187
189
  static __wrap(ptr) {
188
190
  ptr = ptr >>> 0;
189
191
  const obj = Object.create(Cedarling.prototype);
@@ -231,6 +233,82 @@ export class Cedarling {
231
233
  const ret = wasm.cedarling_authorize_unsigned(this.__wbg_ptr, request);
232
234
  return ret;
233
235
  }
236
+ /**
237
+ * Clear all entries from the data store.
238
+ *
239
+ * # Example
240
+ *
241
+ * ```javascript
242
+ * cedarling.clear_data_ctx();
243
+ * console.log("All data entries cleared");
244
+ * ```
245
+ */
246
+ clear_data_ctx() {
247
+ const ret = wasm.cedarling_clear_data_ctx(this.__wbg_ptr);
248
+ if (ret[1]) {
249
+ throw takeFromExternrefTable0(ret[0]);
250
+ }
251
+ }
252
+ /**
253
+ * Get a value from the data store by key.
254
+ * Returns null if the key doesn't exist or the entry has expired.
255
+ *
256
+ * # Arguments
257
+ *
258
+ * * `key` - A string key for the data entry to retrieve
259
+ *
260
+ * # Example
261
+ *
262
+ * ```javascript
263
+ * const value = cedarling.get_data_ctx("user:123");
264
+ * if (value !== null) {
265
+ * console.log(value.name); // "John"
266
+ * }
267
+ * ```
268
+ * @param {string} key
269
+ * @returns {any}
270
+ */
271
+ get_data_ctx(key) {
272
+ const ptr0 = passStringToWasm0(key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
273
+ const len0 = WASM_VECTOR_LEN;
274
+ const ret = wasm.cedarling_get_data_ctx(this.__wbg_ptr, ptr0, len0);
275
+ if (ret[2]) {
276
+ throw takeFromExternrefTable0(ret[1]);
277
+ }
278
+ return takeFromExternrefTable0(ret[0]);
279
+ }
280
+ /**
281
+ * Get a data entry with full metadata by key.
282
+ * Returns null if the key doesn't exist or the entry has expired.
283
+ *
284
+ * # Arguments
285
+ *
286
+ * * `key` - A string key for the data entry to retrieve
287
+ *
288
+ * # Example
289
+ *
290
+ * ```javascript
291
+ * const entry = cedarling.get_data_entry_ctx("user:123");
292
+ * if (entry !== null) {
293
+ * console.log(entry.key); // "user:123"
294
+ * console.log(entry.value); // { name: "John", age: 30 }
295
+ * console.log(entry.data_type); // "Record"
296
+ * console.log(entry.created_at); // "2024-01-01T12:00:00Z"
297
+ * console.log(entry.access_count); // 5
298
+ * }
299
+ * ```
300
+ * @param {string} key
301
+ * @returns {DataEntry | undefined}
302
+ */
303
+ get_data_entry_ctx(key) {
304
+ const ptr0 = passStringToWasm0(key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
305
+ const len0 = WASM_VECTOR_LEN;
306
+ const ret = wasm.cedarling_get_data_entry_ctx(this.__wbg_ptr, ptr0, len0);
307
+ if (ret[2]) {
308
+ throw takeFromExternrefTable0(ret[1]);
309
+ }
310
+ return ret[0] === 0 ? undefined : DataEntry.__wrap(ret[0]);
311
+ }
234
312
  /**
235
313
  * Get specific log entry.
236
314
  * Returns `Map` with values or `null`.
@@ -310,6 +388,47 @@ export class Cedarling {
310
388
  wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
311
389
  return v2;
312
390
  }
391
+ /**
392
+ * Get statistics about the data store.
393
+ *
394
+ * # Example
395
+ *
396
+ * ```javascript
397
+ * const stats = cedarling.get_stats_ctx();
398
+ * console.log(`Entries: ${stats.entry_count}/${stats.max_entries || 'unlimited'}`);
399
+ * console.log(`Capacity: ${stats.capacity_usage_percent.toFixed(2)}%`);
400
+ * console.log(`Total size: ${stats.total_size_bytes} bytes`);
401
+ * ```
402
+ * @returns {DataStoreStats}
403
+ */
404
+ get_stats_ctx() {
405
+ const ret = wasm.cedarling_get_stats_ctx(this.__wbg_ptr);
406
+ if (ret[2]) {
407
+ throw takeFromExternrefTable0(ret[1]);
408
+ }
409
+ return DataStoreStats.__wrap(ret[0]);
410
+ }
411
+ /**
412
+ * List all entries with their metadata.
413
+ * Returns an array of DataEntry objects.
414
+ *
415
+ * # Example
416
+ *
417
+ * ```javascript
418
+ * const entries = cedarling.list_data_ctx();
419
+ * entries.forEach(entry => {
420
+ * console.log(`${entry.key}: ${entry.data_type} (accessed ${entry.access_count} times)`);
421
+ * });
422
+ * ```
423
+ * @returns {Array<any>}
424
+ */
425
+ list_data_ctx() {
426
+ const ret = wasm.cedarling_list_data_ctx(this.__wbg_ptr);
427
+ if (ret[2]) {
428
+ throw takeFromExternrefTable0(ret[1]);
429
+ }
430
+ return takeFromExternrefTable0(ret[0]);
431
+ }
313
432
  /**
314
433
  * Create a new instance of the Cedarling application.
315
434
  * Assume that config is `Object`
@@ -342,6 +461,63 @@ export class Cedarling {
342
461
  }
343
462
  return takeFromExternrefTable0(ret[0]);
344
463
  }
464
+ /**
465
+ * Push a value into the data store with an optional TTL.
466
+ * If the key already exists, the value will be replaced.
467
+ * If TTL is not provided, the default TTL from configuration is used.
468
+ *
469
+ * # Arguments
470
+ *
471
+ * * `key` - A string key for the data entry (must not be empty)
472
+ * * `value` - The value to store (any JSON-serializable JavaScript value: object, array, string, number, boolean)
473
+ * * `ttl_secs` - Optional TTL in seconds (undefined/null uses default from config)
474
+ *
475
+ * # Example
476
+ *
477
+ * ```javascript
478
+ * cedarling.push_data_ctx("user:123", { name: "John", age: 30 }, 3600);
479
+ * cedarling.push_data_ctx("config", { setting: "value" }); // Uses default TTL
480
+ * ```
481
+ * @param {string} key
482
+ * @param {any} value
483
+ * @param {bigint | null} [ttl_secs]
484
+ */
485
+ push_data_ctx(key, value, ttl_secs) {
486
+ const ptr0 = passStringToWasm0(key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
487
+ const len0 = WASM_VECTOR_LEN;
488
+ const ret = wasm.cedarling_push_data_ctx(this.__wbg_ptr, ptr0, len0, value, !isLikeNone(ttl_secs), isLikeNone(ttl_secs) ? BigInt(0) : ttl_secs);
489
+ if (ret[1]) {
490
+ throw takeFromExternrefTable0(ret[0]);
491
+ }
492
+ }
493
+ /**
494
+ * Remove a value from the data store by key.
495
+ * Returns true if the key existed and was removed, false otherwise.
496
+ *
497
+ * # Arguments
498
+ *
499
+ * * `key` - A string key for the data entry to remove
500
+ *
501
+ * # Example
502
+ *
503
+ * ```javascript
504
+ * const removed = cedarling.remove_data_ctx("user:123");
505
+ * if (removed) {
506
+ * console.log("Entry was successfully removed");
507
+ * }
508
+ * ```
509
+ * @param {string} key
510
+ * @returns {boolean}
511
+ */
512
+ remove_data_ctx(key) {
513
+ const ptr0 = passStringToWasm0(key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
514
+ const len0 = WASM_VECTOR_LEN;
515
+ const ret = wasm.cedarling_remove_data_ctx(this.__wbg_ptr, ptr0, len0);
516
+ if (ret[2]) {
517
+ throw takeFromExternrefTable0(ret[1]);
518
+ }
519
+ return ret[0] !== 0;
520
+ }
345
521
  /**
346
522
  * Closes the connections to the Lock Server and pushes all available logs.
347
523
  * @returns {Promise<void>}
@@ -352,6 +528,349 @@ export class Cedarling {
352
528
  }
353
529
  }
354
530
  if (Symbol.dispose) Cedarling.prototype[Symbol.dispose] = Cedarling.prototype.free;
531
+ exports.Cedarling = Cedarling;
532
+
533
+ /**
534
+ * A WASM wrapper for the Rust `cedarling::DataEntry` struct.
535
+ * Represents a data entry in the DataStore with value and metadata.
536
+ */
537
+ class DataEntry {
538
+ static __wrap(ptr) {
539
+ ptr = ptr >>> 0;
540
+ const obj = Object.create(DataEntry.prototype);
541
+ obj.__wbg_ptr = ptr;
542
+ DataEntryFinalization.register(obj, obj.__wbg_ptr, obj);
543
+ return obj;
544
+ }
545
+ __destroy_into_raw() {
546
+ const ptr = this.__wbg_ptr;
547
+ this.__wbg_ptr = 0;
548
+ DataEntryFinalization.unregister(this);
549
+ return ptr;
550
+ }
551
+ free() {
552
+ const ptr = this.__destroy_into_raw();
553
+ wasm.__wbg_dataentry_free(ptr, 0);
554
+ }
555
+ /**
556
+ * Convert `DataEntry` to json string value
557
+ * @returns {string}
558
+ */
559
+ json_string() {
560
+ let deferred1_0;
561
+ let deferred1_1;
562
+ try {
563
+ const ret = wasm.dataentry_json_string(this.__wbg_ptr);
564
+ deferred1_0 = ret[0];
565
+ deferred1_1 = ret[1];
566
+ return getStringFromWasm0(ret[0], ret[1]);
567
+ } finally {
568
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
569
+ }
570
+ }
571
+ /**
572
+ * Get the value stored in this entry as a JavaScript object
573
+ * @returns {any}
574
+ */
575
+ value() {
576
+ const ret = wasm.dataentry_value(this.__wbg_ptr);
577
+ if (ret[2]) {
578
+ throw takeFromExternrefTable0(ret[1]);
579
+ }
580
+ return takeFromExternrefTable0(ret[0]);
581
+ }
582
+ /**
583
+ * Number of times this entry has been accessed
584
+ * @returns {bigint}
585
+ */
586
+ get access_count() {
587
+ const ret = wasm.__wbg_get_dataentry_access_count(this.__wbg_ptr);
588
+ return BigInt.asUintN(64, ret);
589
+ }
590
+ /**
591
+ * Timestamp when this entry was created (RFC 3339 format)
592
+ * @returns {string}
593
+ */
594
+ get created_at() {
595
+ let deferred1_0;
596
+ let deferred1_1;
597
+ try {
598
+ const ret = wasm.__wbg_get_dataentry_created_at(this.__wbg_ptr);
599
+ deferred1_0 = ret[0];
600
+ deferred1_1 = ret[1];
601
+ return getStringFromWasm0(ret[0], ret[1]);
602
+ } finally {
603
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
604
+ }
605
+ }
606
+ /**
607
+ * The inferred Cedar type of the value
608
+ * @returns {string}
609
+ */
610
+ get data_type() {
611
+ let deferred1_0;
612
+ let deferred1_1;
613
+ try {
614
+ const ret = wasm.__wbg_get_dataentry_data_type(this.__wbg_ptr);
615
+ deferred1_0 = ret[0];
616
+ deferred1_1 = ret[1];
617
+ return getStringFromWasm0(ret[0], ret[1]);
618
+ } finally {
619
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
620
+ }
621
+ }
622
+ /**
623
+ * Timestamp when this entry expires (RFC 3339 format), or null if no TTL
624
+ * @returns {string | undefined}
625
+ */
626
+ get expires_at() {
627
+ const ret = wasm.__wbg_get_dataentry_expires_at(this.__wbg_ptr);
628
+ let v1;
629
+ if (ret[0] !== 0) {
630
+ v1 = getStringFromWasm0(ret[0], ret[1]).slice();
631
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
632
+ }
633
+ return v1;
634
+ }
635
+ /**
636
+ * The key for this entry
637
+ * @returns {string}
638
+ */
639
+ get key() {
640
+ let deferred1_0;
641
+ let deferred1_1;
642
+ try {
643
+ const ret = wasm.__wbg_get_dataentry_key(this.__wbg_ptr);
644
+ deferred1_0 = ret[0];
645
+ deferred1_1 = ret[1];
646
+ return getStringFromWasm0(ret[0], ret[1]);
647
+ } finally {
648
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
649
+ }
650
+ }
651
+ /**
652
+ * Number of times this entry has been accessed
653
+ * @param {bigint} arg0
654
+ */
655
+ set access_count(arg0) {
656
+ wasm.__wbg_set_dataentry_access_count(this.__wbg_ptr, arg0);
657
+ }
658
+ /**
659
+ * Timestamp when this entry was created (RFC 3339 format)
660
+ * @param {string} arg0
661
+ */
662
+ set created_at(arg0) {
663
+ const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
664
+ const len0 = WASM_VECTOR_LEN;
665
+ wasm.__wbg_set_dataentry_created_at(this.__wbg_ptr, ptr0, len0);
666
+ }
667
+ /**
668
+ * The inferred Cedar type of the value
669
+ * @param {string} arg0
670
+ */
671
+ set data_type(arg0) {
672
+ const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
673
+ const len0 = WASM_VECTOR_LEN;
674
+ wasm.__wbg_set_dataentry_data_type(this.__wbg_ptr, ptr0, len0);
675
+ }
676
+ /**
677
+ * Timestamp when this entry expires (RFC 3339 format), or null if no TTL
678
+ * @param {string | null} [arg0]
679
+ */
680
+ set expires_at(arg0) {
681
+ var ptr0 = isLikeNone(arg0) ? 0 : passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
682
+ var len0 = WASM_VECTOR_LEN;
683
+ wasm.__wbg_set_dataentry_expires_at(this.__wbg_ptr, ptr0, len0);
684
+ }
685
+ /**
686
+ * The key for this entry
687
+ * @param {string} arg0
688
+ */
689
+ set key(arg0) {
690
+ const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
691
+ const len0 = WASM_VECTOR_LEN;
692
+ wasm.__wbg_set_dataentry_key(this.__wbg_ptr, ptr0, len0);
693
+ }
694
+ }
695
+ if (Symbol.dispose) DataEntry.prototype[Symbol.dispose] = DataEntry.prototype.free;
696
+ exports.DataEntry = DataEntry;
697
+
698
+ /**
699
+ * A WASM wrapper for the Rust `cedarling::DataStoreStats` struct.
700
+ * Statistics about the DataStore.
701
+ */
702
+ class DataStoreStats {
703
+ static __wrap(ptr) {
704
+ ptr = ptr >>> 0;
705
+ const obj = Object.create(DataStoreStats.prototype);
706
+ obj.__wbg_ptr = ptr;
707
+ DataStoreStatsFinalization.register(obj, obj.__wbg_ptr, obj);
708
+ return obj;
709
+ }
710
+ __destroy_into_raw() {
711
+ const ptr = this.__wbg_ptr;
712
+ this.__wbg_ptr = 0;
713
+ DataStoreStatsFinalization.unregister(this);
714
+ return ptr;
715
+ }
716
+ free() {
717
+ const ptr = this.__destroy_into_raw();
718
+ wasm.__wbg_datastorestats_free(ptr, 0);
719
+ }
720
+ /**
721
+ * Convert `DataStoreStats` to json string value
722
+ * @returns {string}
723
+ */
724
+ json_string() {
725
+ let deferred1_0;
726
+ let deferred1_1;
727
+ try {
728
+ const ret = wasm.datastorestats_json_string(this.__wbg_ptr);
729
+ deferred1_0 = ret[0];
730
+ deferred1_1 = ret[1];
731
+ return getStringFromWasm0(ret[0], ret[1]);
732
+ } finally {
733
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
734
+ }
735
+ }
736
+ /**
737
+ * Average size per entry in bytes (0 if no entries)
738
+ * @returns {number}
739
+ */
740
+ get avg_entry_size_bytes() {
741
+ const ret = wasm.__wbg_get_datastorestats_avg_entry_size_bytes(this.__wbg_ptr);
742
+ return ret >>> 0;
743
+ }
744
+ /**
745
+ * Percentage of capacity used (0.0-100.0, based on entry count)
746
+ * @returns {number}
747
+ */
748
+ get capacity_usage_percent() {
749
+ const ret = wasm.__wbg_get_datastorestats_capacity_usage_percent(this.__wbg_ptr);
750
+ return ret;
751
+ }
752
+ /**
753
+ * Number of entries currently stored
754
+ * @returns {number}
755
+ */
756
+ get entry_count() {
757
+ const ret = wasm.__wbg_get_datastorestats_entry_count(this.__wbg_ptr);
758
+ return ret >>> 0;
759
+ }
760
+ /**
761
+ * Maximum number of entries allowed (0 = unlimited)
762
+ * @returns {number}
763
+ */
764
+ get max_entries() {
765
+ const ret = wasm.__wbg_get_datastorestats_max_entries(this.__wbg_ptr);
766
+ return ret >>> 0;
767
+ }
768
+ /**
769
+ * Maximum size per entry in bytes (0 = unlimited)
770
+ * @returns {number}
771
+ */
772
+ get max_entry_size() {
773
+ const ret = wasm.__wbg_get_datastorestats_max_entry_size(this.__wbg_ptr);
774
+ return ret >>> 0;
775
+ }
776
+ /**
777
+ * Memory usage threshold percentage (from config)
778
+ * @returns {number}
779
+ */
780
+ get memory_alert_threshold() {
781
+ const ret = wasm.__wbg_get_datastorestats_memory_alert_threshold(this.__wbg_ptr);
782
+ return ret;
783
+ }
784
+ /**
785
+ * Whether memory usage exceeds the alert threshold
786
+ * @returns {boolean}
787
+ */
788
+ get memory_alert_triggered() {
789
+ const ret = wasm.__wbg_get_datastorestats_memory_alert_triggered(this.__wbg_ptr);
790
+ return ret !== 0;
791
+ }
792
+ /**
793
+ * Whether metrics tracking is enabled
794
+ * @returns {boolean}
795
+ */
796
+ get metrics_enabled() {
797
+ const ret = wasm.__wbg_get_datastorestats_metrics_enabled(this.__wbg_ptr);
798
+ return ret !== 0;
799
+ }
800
+ /**
801
+ * Total size of all entries in bytes (approximate, based on JSON serialization)
802
+ * @returns {number}
803
+ */
804
+ get total_size_bytes() {
805
+ const ret = wasm.__wbg_get_datastorestats_total_size_bytes(this.__wbg_ptr);
806
+ return ret >>> 0;
807
+ }
808
+ /**
809
+ * Average size per entry in bytes (0 if no entries)
810
+ * @param {number} arg0
811
+ */
812
+ set avg_entry_size_bytes(arg0) {
813
+ wasm.__wbg_set_datastorestats_avg_entry_size_bytes(this.__wbg_ptr, arg0);
814
+ }
815
+ /**
816
+ * Percentage of capacity used (0.0-100.0, based on entry count)
817
+ * @param {number} arg0
818
+ */
819
+ set capacity_usage_percent(arg0) {
820
+ wasm.__wbg_set_datastorestats_capacity_usage_percent(this.__wbg_ptr, arg0);
821
+ }
822
+ /**
823
+ * Number of entries currently stored
824
+ * @param {number} arg0
825
+ */
826
+ set entry_count(arg0) {
827
+ wasm.__wbg_set_datastorestats_entry_count(this.__wbg_ptr, arg0);
828
+ }
829
+ /**
830
+ * Maximum number of entries allowed (0 = unlimited)
831
+ * @param {number} arg0
832
+ */
833
+ set max_entries(arg0) {
834
+ wasm.__wbg_set_datastorestats_max_entries(this.__wbg_ptr, arg0);
835
+ }
836
+ /**
837
+ * Maximum size per entry in bytes (0 = unlimited)
838
+ * @param {number} arg0
839
+ */
840
+ set max_entry_size(arg0) {
841
+ wasm.__wbg_set_datastorestats_max_entry_size(this.__wbg_ptr, arg0);
842
+ }
843
+ /**
844
+ * Memory usage threshold percentage (from config)
845
+ * @param {number} arg0
846
+ */
847
+ set memory_alert_threshold(arg0) {
848
+ wasm.__wbg_set_datastorestats_memory_alert_threshold(this.__wbg_ptr, arg0);
849
+ }
850
+ /**
851
+ * Whether memory usage exceeds the alert threshold
852
+ * @param {boolean} arg0
853
+ */
854
+ set memory_alert_triggered(arg0) {
855
+ wasm.__wbg_set_datastorestats_memory_alert_triggered(this.__wbg_ptr, arg0);
856
+ }
857
+ /**
858
+ * Whether metrics tracking is enabled
859
+ * @param {boolean} arg0
860
+ */
861
+ set metrics_enabled(arg0) {
862
+ wasm.__wbg_set_datastorestats_metrics_enabled(this.__wbg_ptr, arg0);
863
+ }
864
+ /**
865
+ * Total size of all entries in bytes (approximate, based on JSON serialization)
866
+ * @param {number} arg0
867
+ */
868
+ set total_size_bytes(arg0) {
869
+ wasm.__wbg_set_datastorestats_total_size_bytes(this.__wbg_ptr, arg0);
870
+ }
871
+ }
872
+ if (Symbol.dispose) DataStoreStats.prototype[Symbol.dispose] = DataStoreStats.prototype.free;
873
+ exports.DataStoreStats = DataStoreStats;
355
874
 
356
875
  /**
357
876
  * Diagnostics
@@ -359,7 +878,7 @@ if (Symbol.dispose) Cedarling.prototype[Symbol.dispose] = Cedarling.prototype.fr
359
878
  *
360
879
  * Provides detailed information about how a policy decision was made, including policies that contributed to the decision and any errors encountered during evaluation.
361
880
  */
362
- export class Diagnostics {
881
+ class Diagnostics {
363
882
  static __wrap(ptr) {
364
883
  ptr = ptr >>> 0;
365
884
  const obj = Object.create(Diagnostics.prototype);
@@ -403,12 +922,13 @@ export class Diagnostics {
403
922
  }
404
923
  }
405
924
  if (Symbol.dispose) Diagnostics.prototype[Symbol.dispose] = Diagnostics.prototype.free;
925
+ exports.Diagnostics = Diagnostics;
406
926
 
407
927
  /**
408
928
  * A WASM wrapper for the Rust `cedarling::MultiIssuerAuthorizeResult` struct.
409
929
  * Represents the result of a multi-issuer authorization request.
410
930
  */
411
- export class MultiIssuerAuthorizeResult {
931
+ class MultiIssuerAuthorizeResult {
412
932
  static __wrap(ptr) {
413
933
  ptr = ptr >>> 0;
414
934
  const obj = Object.create(MultiIssuerAuthorizeResult.prototype);
@@ -505,6 +1025,7 @@ export class MultiIssuerAuthorizeResult {
505
1025
  }
506
1026
  }
507
1027
  if (Symbol.dispose) MultiIssuerAuthorizeResult.prototype[Symbol.dispose] = MultiIssuerAuthorizeResult.prototype.free;
1028
+ exports.MultiIssuerAuthorizeResult = MultiIssuerAuthorizeResult;
508
1029
 
509
1030
  /**
510
1031
  * PolicyEvaluationError
@@ -512,7 +1033,7 @@ if (Symbol.dispose) MultiIssuerAuthorizeResult.prototype[Symbol.dispose] = Multi
512
1033
  *
513
1034
  * Represents an error that occurred when evaluating a Cedar policy.
514
1035
  */
515
- export class PolicyEvaluationError {
1036
+ class PolicyEvaluationError {
516
1037
  static __wrap(ptr) {
517
1038
  ptr = ptr >>> 0;
518
1039
  const obj = Object.create(PolicyEvaluationError.prototype);
@@ -564,6 +1085,7 @@ export class PolicyEvaluationError {
564
1085
  }
565
1086
  }
566
1087
  if (Symbol.dispose) PolicyEvaluationError.prototype[Symbol.dispose] = PolicyEvaluationError.prototype.free;
1088
+ exports.PolicyEvaluationError = PolicyEvaluationError;
567
1089
 
568
1090
  /**
569
1091
  * Create a new instance of the Cedarling application.
@@ -571,10 +1093,11 @@ if (Symbol.dispose) PolicyEvaluationError.prototype[Symbol.dispose] = PolicyEval
571
1093
  * @param {any} config
572
1094
  * @returns {Promise<Cedarling>}
573
1095
  */
574
- export function init(config) {
1096
+ function init(config) {
575
1097
  const ret = wasm.init(config);
576
1098
  return ret;
577
1099
  }
1100
+ exports.init = init;
578
1101
 
579
1102
  /**
580
1103
  * Create a new instance of the Cedarling application from archive bytes.
@@ -596,80 +1119,81 @@ export function init(config) {
596
1119
  * @param {Uint8Array} archive_bytes
597
1120
  * @returns {Promise<Cedarling>}
598
1121
  */
599
- export function init_from_archive_bytes(config, archive_bytes) {
1122
+ function init_from_archive_bytes(config, archive_bytes) {
600
1123
  const ret = wasm.init_from_archive_bytes(config, archive_bytes);
601
1124
  return ret;
602
1125
  }
1126
+ exports.init_from_archive_bytes = init_from_archive_bytes;
603
1127
 
604
1128
  function __wbg_get_imports() {
605
1129
  const import0 = {
606
1130
  __proto__: null,
607
- __wbg_Error_4577686b3a6d9b3a: function(arg0, arg1) {
1131
+ __wbg_Error_83742b46f01ce22d: function(arg0, arg1) {
608
1132
  const ret = Error(getStringFromWasm0(arg0, arg1));
609
1133
  return ret;
610
1134
  },
611
- __wbg_Number_e89e48a2fe1a6355: function(arg0) {
1135
+ __wbg_Number_a5a435bd7bbec835: function(arg0) {
612
1136
  const ret = Number(arg0);
613
1137
  return ret;
614
1138
  },
615
- __wbg___wbindgen_bigint_get_as_i64_578010f8442e0319: function(arg0, arg1) {
1139
+ __wbg___wbindgen_bigint_get_as_i64_447a76b5c6ef7bda: function(arg0, arg1) {
616
1140
  const v = arg1;
617
1141
  const ret = typeof(v) === 'bigint' ? v : undefined;
618
1142
  getDataViewMemory0().setBigInt64(arg0 + 8 * 1, isLikeNone(ret) ? BigInt(0) : ret, true);
619
1143
  getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
620
1144
  },
621
- __wbg___wbindgen_boolean_get_18c4ed9422296fff: function(arg0) {
1145
+ __wbg___wbindgen_boolean_get_c0f3f60bac5a78d1: function(arg0) {
622
1146
  const v = arg0;
623
1147
  const ret = typeof(v) === 'boolean' ? v : undefined;
624
1148
  return isLikeNone(ret) ? 0xFFFFFF : ret ? 1 : 0;
625
1149
  },
626
- __wbg___wbindgen_debug_string_ddde1867f49c2442: function(arg0, arg1) {
1150
+ __wbg___wbindgen_debug_string_5398f5bb970e0daa: function(arg0, arg1) {
627
1151
  const ret = debugString(arg1);
628
1152
  const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
629
1153
  const len1 = WASM_VECTOR_LEN;
630
1154
  getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
631
1155
  getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
632
1156
  },
633
- __wbg___wbindgen_in_1064a108f4d18b9e: function(arg0, arg1) {
1157
+ __wbg___wbindgen_in_41dbb8413020e076: function(arg0, arg1) {
634
1158
  const ret = arg0 in arg1;
635
1159
  return ret;
636
1160
  },
637
- __wbg___wbindgen_is_bigint_a157f0734ca85901: function(arg0) {
1161
+ __wbg___wbindgen_is_bigint_e2141d4f045b7eda: function(arg0) {
638
1162
  const ret = typeof(arg0) === 'bigint';
639
1163
  return ret;
640
1164
  },
641
- __wbg___wbindgen_is_function_d633e708baf0d146: function(arg0) {
1165
+ __wbg___wbindgen_is_function_3c846841762788c1: function(arg0) {
642
1166
  const ret = typeof(arg0) === 'function';
643
1167
  return ret;
644
1168
  },
645
- __wbg___wbindgen_is_object_4b3de556756ee8a8: function(arg0) {
1169
+ __wbg___wbindgen_is_object_781bc9f159099513: function(arg0) {
646
1170
  const val = arg0;
647
1171
  const ret = typeof(val) === 'object' && val !== null;
648
1172
  return ret;
649
1173
  },
650
- __wbg___wbindgen_is_string_7debe47dc1e045c2: function(arg0) {
1174
+ __wbg___wbindgen_is_string_7ef6b97b02428fae: function(arg0) {
651
1175
  const ret = typeof(arg0) === 'string';
652
1176
  return ret;
653
1177
  },
654
- __wbg___wbindgen_is_undefined_c18285b9fc34cb7d: function(arg0) {
1178
+ __wbg___wbindgen_is_undefined_52709e72fb9f179c: function(arg0) {
655
1179
  const ret = arg0 === undefined;
656
1180
  return ret;
657
1181
  },
658
- __wbg___wbindgen_jsval_eq_a6afb59d8c5e78d6: function(arg0, arg1) {
1182
+ __wbg___wbindgen_jsval_eq_ee31bfad3e536463: function(arg0, arg1) {
659
1183
  const ret = arg0 === arg1;
660
1184
  return ret;
661
1185
  },
662
- __wbg___wbindgen_jsval_loose_eq_1562ceb9af84e990: function(arg0, arg1) {
1186
+ __wbg___wbindgen_jsval_loose_eq_5bcc3bed3c69e72b: function(arg0, arg1) {
663
1187
  const ret = arg0 == arg1;
664
1188
  return ret;
665
1189
  },
666
- __wbg___wbindgen_number_get_5854912275df1894: function(arg0, arg1) {
1190
+ __wbg___wbindgen_number_get_34bb9d9dcfa21373: function(arg0, arg1) {
667
1191
  const obj = arg1;
668
1192
  const ret = typeof(obj) === 'number' ? obj : undefined;
669
1193
  getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
670
1194
  getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
671
1195
  },
672
- __wbg___wbindgen_string_get_3e5751597f39a112: function(arg0, arg1) {
1196
+ __wbg___wbindgen_string_get_395e606bd0ee4427: function(arg0, arg1) {
673
1197
  const obj = arg1;
674
1198
  const ret = typeof(obj) === 'string' ? obj : undefined;
675
1199
  var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
@@ -677,22 +1201,22 @@ function __wbg_get_imports() {
677
1201
  getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
678
1202
  getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
679
1203
  },
680
- __wbg___wbindgen_throw_39bc967c0e5a9b58: function(arg0, arg1) {
1204
+ __wbg___wbindgen_throw_6ddd609b62940d55: function(arg0, arg1) {
681
1205
  throw new Error(getStringFromWasm0(arg0, arg1));
682
1206
  },
683
- __wbg__wbg_cb_unref_b6d832240a919168: function(arg0) {
1207
+ __wbg__wbg_cb_unref_6b5b6b8576d35cb1: function(arg0) {
684
1208
  arg0._wbg_cb_unref();
685
1209
  },
686
- __wbg_abort_695597a7a37354a1: function(arg0) {
1210
+ __wbg_abort_5ef96933660780b7: function(arg0) {
687
1211
  arg0.abort();
688
1212
  },
689
- __wbg_abort_e104a8a255db427b: function(arg0, arg1) {
1213
+ __wbg_abort_6479c2d794ebf2ee: function(arg0, arg1) {
690
1214
  arg0.abort(arg1);
691
1215
  },
692
- __wbg_append_83740b7c5805e38d: function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
1216
+ __wbg_append_608dfb635ee8998f: function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
693
1217
  arg0.append(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4));
694
1218
  }, arguments); },
695
- __wbg_arrayBuffer_8fd4b7df096647f9: function() { return handleError(function (arg0) {
1219
+ __wbg_arrayBuffer_eb8e9ca620af2a19: function() { return handleError(function (arg0) {
696
1220
  const ret = arg0.arrayBuffer();
697
1221
  return ret;
698
1222
  }, arguments); },
@@ -700,11 +1224,11 @@ function __wbg_get_imports() {
700
1224
  const ret = AuthorizeResult.__wrap(arg0);
701
1225
  return ret;
702
1226
  },
703
- __wbg_call_08ad0d89caa7cb79: function() { return handleError(function (arg0, arg1, arg2) {
1227
+ __wbg_call_2d781c1f4d5c0ef8: function() { return handleError(function (arg0, arg1, arg2) {
704
1228
  const ret = arg0.call(arg1, arg2);
705
1229
  return ret;
706
1230
  }, arguments); },
707
- __wbg_call_73af281463ec8b58: function() { return handleError(function (arg0, arg1) {
1231
+ __wbg_call_e133b57c9155d22c: function() { return handleError(function (arg0, arg1) {
708
1232
  const ret = arg0.call(arg1);
709
1233
  return ret;
710
1234
  }, arguments); },
@@ -720,37 +1244,41 @@ function __wbg_get_imports() {
720
1244
  const ret = arg0.crypto;
721
1245
  return ret;
722
1246
  },
723
- __wbg_debug_55a0d5307b3f43af: function(arg0) {
1247
+ __wbg_dataentry_new: function(arg0) {
1248
+ const ret = DataEntry.__wrap(arg0);
1249
+ return ret;
1250
+ },
1251
+ __wbg_debug_6fad7a26a693b696: function(arg0) {
724
1252
  console.debug(...arg0);
725
1253
  },
726
- __wbg_done_5aad55ec6b1954b1: function(arg0) {
1254
+ __wbg_done_08ce71ee07e3bd17: function(arg0) {
727
1255
  const ret = arg0.done;
728
1256
  return ret;
729
1257
  },
730
- __wbg_entries_28d32ba4cd93f5fc: function(arg0) {
731
- const ret = Object.entries(arg0);
1258
+ __wbg_entries_5b8fe91cea59610e: function(arg0) {
1259
+ const ret = arg0.entries();
732
1260
  return ret;
733
1261
  },
734
- __wbg_entries_728df8ae891bd59c: function(arg0) {
1262
+ __wbg_entries_850b70a4650cfe8b: function(arg0) {
735
1263
  const ret = arg0.entries();
736
1264
  return ret;
737
1265
  },
738
- __wbg_entries_a004d41a2064144e: function(arg0) {
739
- const ret = arg0.entries();
1266
+ __wbg_entries_e8a20ff8c9757101: function(arg0) {
1267
+ const ret = Object.entries(arg0);
740
1268
  return ret;
741
1269
  },
742
- __wbg_error_b21ccef52463b9ca: function(arg0) {
1270
+ __wbg_error_b282edc683808929: function(arg0) {
743
1271
  console.error(...arg0);
744
1272
  },
745
1273
  __wbg_fetch_43b2f110608a59ff: function(arg0) {
746
1274
  const ret = fetch(arg0);
747
1275
  return ret;
748
1276
  },
749
- __wbg_fetch_59df3bdc0a4c0e4b: function(arg0, arg1) {
1277
+ __wbg_fetch_5550a88cf343aaa9: function(arg0, arg1) {
750
1278
  const ret = arg0.fetch(arg1);
751
1279
  return ret;
752
1280
  },
753
- __wbg_fromEntries_2f51c4024e2a7aa3: function() { return handleError(function (arg0) {
1281
+ __wbg_fromEntries_8f078e02a548e8eb: function() { return handleError(function (arg0) {
754
1282
  const ret = Object.fromEntries(arg0);
755
1283
  return ret;
756
1284
  }, arguments); },
@@ -760,27 +1288,27 @@ function __wbg_get_imports() {
760
1288
  __wbg_getRandomValues_c44a50d8cfdaebeb: function() { return handleError(function (arg0, arg1) {
761
1289
  arg0.getRandomValues(arg1);
762
1290
  }, arguments); },
763
- __wbg_getTime_9429d05129287418: function(arg0) {
1291
+ __wbg_getTime_1dad7b5386ddd2d9: function(arg0) {
764
1292
  const ret = arg0.getTime();
765
1293
  return ret;
766
1294
  },
767
- __wbg_getTimezoneOffset_eeb05f23347950d1: function(arg0) {
1295
+ __wbg_getTimezoneOffset_639bcf2dde21158b: function(arg0) {
768
1296
  const ret = arg0.getTimezoneOffset();
769
1297
  return ret;
770
1298
  },
771
- __wbg_get_18349afdb36339a9: function() { return handleError(function (arg0, arg1) {
1299
+ __wbg_get_326e41e095fb2575: function() { return handleError(function (arg0, arg1) {
772
1300
  const ret = Reflect.get(arg0, arg1);
773
1301
  return ret;
774
1302
  }, arguments); },
775
- __wbg_get_4920fefd3451364b: function() { return handleError(function (arg0, arg1) {
1303
+ __wbg_get_3ef1eba1850ade27: function() { return handleError(function (arg0, arg1) {
776
1304
  const ret = Reflect.get(arg0, arg1);
777
1305
  return ret;
778
1306
  }, arguments); },
779
- __wbg_get_f09c3a16f8848381: function(arg0, arg1) {
1307
+ __wbg_get_a8ee5c45dabc1b3b: function(arg0, arg1) {
780
1308
  const ret = arg0[arg1 >>> 0];
781
1309
  return ret;
782
1310
  },
783
- __wbg_get_unchecked_3d0f4b91c8eca4f0: function(arg0, arg1) {
1311
+ __wbg_get_unchecked_329cfe50afab7352: function(arg0, arg1) {
784
1312
  const ret = arg0[arg1 >>> 0];
785
1313
  return ret;
786
1314
  },
@@ -788,18 +1316,18 @@ function __wbg_get_imports() {
788
1316
  const ret = arg0[arg1];
789
1317
  return ret;
790
1318
  },
791
- __wbg_has_14f08fae2dc367dc: function() { return handleError(function (arg0, arg1) {
1319
+ __wbg_has_926ef2ff40b308cf: function() { return handleError(function (arg0, arg1) {
792
1320
  const ret = Reflect.has(arg0, arg1);
793
1321
  return ret;
794
1322
  }, arguments); },
795
- __wbg_headers_028b9b1c907f9362: function(arg0) {
1323
+ __wbg_headers_eb2234545f9ff993: function(arg0) {
796
1324
  const ret = arg0.headers;
797
1325
  return ret;
798
1326
  },
799
- __wbg_info_53eab27aae9168ec: function(arg0) {
1327
+ __wbg_info_4284b8118a0cae1c: function(arg0) {
800
1328
  console.info(...arg0);
801
1329
  },
802
- __wbg_instanceof_ArrayBuffer_15859862b80b732d: function(arg0) {
1330
+ __wbg_instanceof_ArrayBuffer_101e2bf31071a9f6: function(arg0) {
803
1331
  let result;
804
1332
  try {
805
1333
  result = arg0 instanceof ArrayBuffer;
@@ -809,7 +1337,7 @@ function __wbg_get_imports() {
809
1337
  const ret = result;
810
1338
  return ret;
811
1339
  },
812
- __wbg_instanceof_Array_461ec6d7afd45fda: function(arg0) {
1340
+ __wbg_instanceof_Array_3247353192ed9130: function(arg0) {
813
1341
  let result;
814
1342
  try {
815
1343
  result = arg0 instanceof Array;
@@ -819,7 +1347,7 @@ function __wbg_get_imports() {
819
1347
  const ret = result;
820
1348
  return ret;
821
1349
  },
822
- __wbg_instanceof_Map_9df16bf25ceb4ecb: function(arg0) {
1350
+ __wbg_instanceof_Map_f194b366846aca0c: function(arg0) {
823
1351
  let result;
824
1352
  try {
825
1353
  result = arg0 instanceof Map;
@@ -829,7 +1357,7 @@ function __wbg_get_imports() {
829
1357
  const ret = result;
830
1358
  return ret;
831
1359
  },
832
- __wbg_instanceof_Response_8ec0057b1e5c71bf: function(arg0) {
1360
+ __wbg_instanceof_Response_9b4d9fd451e051b1: function(arg0) {
833
1361
  let result;
834
1362
  try {
835
1363
  result = arg0 instanceof Response;
@@ -839,7 +1367,7 @@ function __wbg_get_imports() {
839
1367
  const ret = result;
840
1368
  return ret;
841
1369
  },
842
- __wbg_instanceof_Uint8Array_2240b7046ac16f05: function(arg0) {
1370
+ __wbg_instanceof_Uint8Array_740438561a5b956d: function(arg0) {
843
1371
  let result;
844
1372
  try {
845
1373
  result = arg0 instanceof Uint8Array;
@@ -849,31 +1377,31 @@ function __wbg_get_imports() {
849
1377
  const ret = result;
850
1378
  return ret;
851
1379
  },
852
- __wbg_isArray_fad08a0d12828686: function(arg0) {
1380
+ __wbg_isArray_33b91feb269ff46e: function(arg0) {
853
1381
  const ret = Array.isArray(arg0);
854
1382
  return ret;
855
1383
  },
856
- __wbg_isSafeInteger_10e4151eb694e42a: function(arg0) {
1384
+ __wbg_isSafeInteger_ecd6a7f9c3e053cd: function(arg0) {
857
1385
  const ret = Number.isSafeInteger(arg0);
858
1386
  return ret;
859
1387
  },
860
- __wbg_iterator_fc7ad8d33bab9e26: function() {
1388
+ __wbg_iterator_d8f549ec8fb061b1: function() {
861
1389
  const ret = Symbol.iterator;
862
1390
  return ret;
863
1391
  },
864
- __wbg_keys_e20e1368162303e0: function(arg0) {
1392
+ __wbg_keys_ab0d051a1c55236d: function(arg0) {
865
1393
  const ret = Object.keys(arg0);
866
1394
  return ret;
867
1395
  },
868
- __wbg_length_5855c1f289dfffc1: function(arg0) {
1396
+ __wbg_length_b3416cf66a5452c8: function(arg0) {
869
1397
  const ret = arg0.length;
870
1398
  return ret;
871
1399
  },
872
- __wbg_length_a31e05262e09b7f8: function(arg0) {
1400
+ __wbg_length_ea16607d7b61445b: function(arg0) {
873
1401
  const ret = arg0.length;
874
1402
  return ret;
875
1403
  },
876
- __wbg_log_ecffbec35822c498: function(arg0) {
1404
+ __wbg_log_0c2d15a74310c102: function(arg0) {
877
1405
  console.log(...arg0);
878
1406
  },
879
1407
  __wbg_msCrypto_bd5a034af96bcba6: function(arg0) {
@@ -884,50 +1412,50 @@ function __wbg_get_imports() {
884
1412
  const ret = MultiIssuerAuthorizeResult.__wrap(arg0);
885
1413
  return ret;
886
1414
  },
887
- __wbg_new_0765f05b3e3b4625: function() { return handleError(function () {
1415
+ __wbg_new_0837727332ac86ba: function() { return handleError(function () {
888
1416
  const ret = new Headers();
889
1417
  return ret;
890
1418
  }, arguments); },
891
- __wbg_new_09959f7b4c92c246: function(arg0) {
892
- const ret = new Uint8Array(arg0);
893
- return ret;
894
- },
895
- __wbg_new_0_a719938e6f92ddf4: function() {
1419
+ __wbg_new_0_1dcafdf5e786e876: function() {
896
1420
  const ret = new Date();
897
1421
  return ret;
898
1422
  },
899
- __wbg_new_223944ca37c18764: function(arg0) {
900
- const ret = new Date(arg0);
1423
+ __wbg_new_49d5571bd3f0c4d4: function() {
1424
+ const ret = new Map();
901
1425
  return ret;
902
1426
  },
903
- __wbg_new_92df58a8ec3bfb6b: function() {
904
- const ret = new Map();
1427
+ __wbg_new_5f486cdf45a04d78: function(arg0) {
1428
+ const ret = new Uint8Array(arg0);
905
1429
  return ret;
906
1430
  },
907
- __wbg_new_cbee8c0d5c479eac: function() {
1431
+ __wbg_new_a70fbab9066b301f: function() {
908
1432
  const ret = new Array();
909
1433
  return ret;
910
1434
  },
911
- __wbg_new_ed69e637b553a997: function() {
1435
+ __wbg_new_ab79df5bd7c26067: function() {
912
1436
  const ret = new Object();
913
1437
  return ret;
914
1438
  },
915
- __wbg_new_fe53f8c71bd1e95b: function() { return handleError(function () {
1439
+ __wbg_new_c518c60af666645b: function() { return handleError(function () {
916
1440
  const ret = new AbortController();
917
1441
  return ret;
918
1442
  }, arguments); },
919
- __wbg_new_from_slice_d7e202fdbee3c396: function(arg0, arg1) {
1443
+ __wbg_new_fd94ca5c9639abd2: function(arg0) {
1444
+ const ret = new Date(arg0);
1445
+ return ret;
1446
+ },
1447
+ __wbg_new_from_slice_22da9388ac046e50: function(arg0, arg1) {
920
1448
  const ret = new Uint8Array(getArrayU8FromWasm0(arg0, arg1));
921
1449
  return ret;
922
1450
  },
923
- __wbg_new_typed_8258a0d8488ef2a2: function(arg0, arg1) {
1451
+ __wbg_new_typed_aaaeaf29cf802876: function(arg0, arg1) {
924
1452
  try {
925
1453
  var state0 = {a: arg0, b: arg1};
926
1454
  var cb0 = (arg0, arg1) => {
927
1455
  const a = state0.a;
928
1456
  state0.a = 0;
929
1457
  try {
930
- return wasm_bindgen__convert__closures_____invoke__h494d783032f4344f(a, state0.b, arg0, arg1);
1458
+ return wasm_bindgen__convert__closures_____invoke__h434e5a5fca11045c(a, state0.b, arg0, arg1);
931
1459
  } finally {
932
1460
  state0.a = a;
933
1461
  }
@@ -938,22 +1466,22 @@ function __wbg_get_imports() {
938
1466
  state0.a = state0.b = 0;
939
1467
  }
940
1468
  },
941
- __wbg_new_with_length_c8449d782396d344: function(arg0) {
1469
+ __wbg_new_with_length_825018a1616e9e55: function(arg0) {
942
1470
  const ret = new Uint8Array(arg0 >>> 0);
943
1471
  return ret;
944
1472
  },
945
- __wbg_new_with_str_and_init_5fdb105df3907de1: function() { return handleError(function (arg0, arg1, arg2) {
1473
+ __wbg_new_with_str_and_init_b4b54d1a819bc724: function() { return handleError(function (arg0, arg1, arg2) {
946
1474
  const ret = new Request(getStringFromWasm0(arg0, arg1), arg2);
947
1475
  return ret;
948
1476
  }, arguments); },
949
- __wbg_next_a5fe6f328f7affc2: function(arg0) {
950
- const ret = arg0.next;
951
- return ret;
952
- },
953
- __wbg_next_e592122bb4ed4c67: function() { return handleError(function (arg0) {
1477
+ __wbg_next_11b99ee6237339e3: function() { return handleError(function (arg0) {
954
1478
  const ret = arg0.next();
955
1479
  return ret;
956
1480
  }, arguments); },
1481
+ __wbg_next_e01a967809d1aa68: function(arg0) {
1482
+ const ret = arg0.next;
1483
+ return ret;
1484
+ },
957
1485
  __wbg_node_84ea875411254db1: function(arg0) {
958
1486
  const ret = arg0.node;
959
1487
  return ret;
@@ -966,18 +1494,18 @@ function __wbg_get_imports() {
966
1494
  const ret = arg0.process;
967
1495
  return ret;
968
1496
  },
969
- __wbg_prototypesetcall_f034d444741426c3: function(arg0, arg1, arg2) {
1497
+ __wbg_prototypesetcall_d62e5099504357e6: function(arg0, arg1, arg2) {
970
1498
  Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), arg2);
971
1499
  },
972
- __wbg_push_a6f9488ffd3fae3b: function(arg0, arg1) {
1500
+ __wbg_push_e87b0e732085a946: function(arg0, arg1) {
973
1501
  const ret = arg0.push(arg1);
974
1502
  return ret;
975
1503
  },
976
- __wbg_queueMicrotask_2c8dfd1056f24fdc: function(arg0) {
1504
+ __wbg_queueMicrotask_0c399741342fb10f: function(arg0) {
977
1505
  const ret = arg0.queueMicrotask;
978
1506
  return ret;
979
1507
  },
980
- __wbg_queueMicrotask_8985ad63815852e7: function(arg0) {
1508
+ __wbg_queueMicrotask_a082d78ce798393e: function(arg0) {
981
1509
  queueMicrotask(arg0);
982
1510
  },
983
1511
  __wbg_randomFillSync_6c25eac9869eb53c: function() { return handleError(function (arg0, arg1) {
@@ -987,7 +1515,7 @@ function __wbg_get_imports() {
987
1515
  const ret = module.require;
988
1516
  return ret;
989
1517
  }, arguments); },
990
- __wbg_resolve_5d61e0d10c14730a: function(arg0) {
1518
+ __wbg_resolve_ae8d83246e5bcc12: function(arg0) {
991
1519
  const ret = Promise.resolve(arg0);
992
1520
  return ret;
993
1521
  },
@@ -995,92 +1523,92 @@ function __wbg_get_imports() {
995
1523
  const ret = setTimeout(arg0, arg1);
996
1524
  return ret;
997
1525
  },
998
- __wbg_set_4c81cfb5dc3a333c: function(arg0, arg1, arg2) {
1526
+ __wbg_set_282384002438957f: function(arg0, arg1, arg2) {
999
1527
  arg0[arg1 >>> 0] = arg2;
1000
1528
  },
1001
1529
  __wbg_set_6be42768c690e380: function(arg0, arg1, arg2) {
1002
1530
  arg0[arg1] = arg2;
1003
1531
  },
1004
- __wbg_set_bad5c505cc70b5f8: function() { return handleError(function (arg0, arg1, arg2) {
1532
+ __wbg_set_7eaa4f96924fd6b3: function() { return handleError(function (arg0, arg1, arg2) {
1005
1533
  const ret = Reflect.set(arg0, arg1, arg2);
1006
1534
  return ret;
1007
1535
  }, arguments); },
1008
- __wbg_set_body_cced363f7703790d: function(arg0, arg1) {
1536
+ __wbg_set_bf7251625df30a02: function(arg0, arg1, arg2) {
1537
+ const ret = arg0.set(arg1, arg2);
1538
+ return ret;
1539
+ },
1540
+ __wbg_set_body_a3d856b097dfda04: function(arg0, arg1) {
1009
1541
  arg0.body = arg1;
1010
1542
  },
1011
- __wbg_set_cache_d1e60189f19e54cf: function(arg0, arg1) {
1543
+ __wbg_set_cache_ec7e430c6056ebda: function(arg0, arg1) {
1012
1544
  arg0.cache = __wbindgen_enum_RequestCache[arg1];
1013
1545
  },
1014
- __wbg_set_cfc6de03f990decf: function(arg0, arg1, arg2) {
1015
- const ret = arg0.set(arg1, arg2);
1016
- return ret;
1017
- },
1018
- __wbg_set_credentials_b80a80dfa15201af: function(arg0, arg1) {
1546
+ __wbg_set_credentials_ed63183445882c65: function(arg0, arg1) {
1019
1547
  arg0.credentials = __wbindgen_enum_RequestCredentials[arg1];
1020
1548
  },
1021
- __wbg_set_headers_9144e2163352af57: function(arg0, arg1) {
1549
+ __wbg_set_headers_3c8fecc693b75327: function(arg0, arg1) {
1022
1550
  arg0.headers = arg1;
1023
1551
  },
1024
- __wbg_set_method_c1be4686b152fe29: function(arg0, arg1, arg2) {
1552
+ __wbg_set_method_8c015e8bcafd7be1: function(arg0, arg1, arg2) {
1025
1553
  arg0.method = getStringFromWasm0(arg1, arg2);
1026
1554
  },
1027
- __wbg_set_mode_13fad253f291265c: function(arg0, arg1) {
1555
+ __wbg_set_mode_5a87f2c809cf37c2: function(arg0, arg1) {
1028
1556
  arg0.mode = __wbindgen_enum_RequestMode[arg1];
1029
1557
  },
1030
- __wbg_set_signal_0ad1579122fc44a7: function(arg0, arg1) {
1558
+ __wbg_set_signal_0cebecb698f25d21: function(arg0, arg1) {
1031
1559
  arg0.signal = arg1;
1032
1560
  },
1033
- __wbg_signal_147ce1e013d09714: function(arg0) {
1561
+ __wbg_signal_166e1da31adcac18: function(arg0) {
1034
1562
  const ret = arg0.signal;
1035
1563
  return ret;
1036
1564
  },
1037
- __wbg_static_accessor_GLOBAL_THIS_14325d8cca34bb77: function() {
1038
- const ret = typeof globalThis === 'undefined' ? null : globalThis;
1565
+ __wbg_static_accessor_GLOBAL_8adb955bd33fac2f: function() {
1566
+ const ret = typeof global === 'undefined' ? null : global;
1039
1567
  return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
1040
1568
  },
1041
- __wbg_static_accessor_GLOBAL_f3a1e69f9c5a7e8e: function() {
1042
- const ret = typeof global === 'undefined' ? null : global;
1569
+ __wbg_static_accessor_GLOBAL_THIS_ad356e0db91c7913: function() {
1570
+ const ret = typeof globalThis === 'undefined' ? null : globalThis;
1043
1571
  return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
1044
1572
  },
1045
- __wbg_static_accessor_SELF_50cdb5b517789aca: function() {
1573
+ __wbg_static_accessor_SELF_f207c857566db248: function() {
1046
1574
  const ret = typeof self === 'undefined' ? null : self;
1047
1575
  return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
1048
1576
  },
1049
- __wbg_static_accessor_WINDOW_d6c4126e4c244380: function() {
1577
+ __wbg_static_accessor_WINDOW_bb9f1ba69d61b386: function() {
1050
1578
  const ret = typeof window === 'undefined' ? null : window;
1051
1579
  return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
1052
1580
  },
1053
- __wbg_status_acf2080bc55aa324: function(arg0) {
1581
+ __wbg_status_318629ab93a22955: function(arg0) {
1054
1582
  const ret = arg0.status;
1055
1583
  return ret;
1056
1584
  },
1057
- __wbg_subarray_7ad5f01d4a9c1c4d: function(arg0, arg1, arg2) {
1585
+ __wbg_subarray_a068d24e39478a8a: function(arg0, arg1, arg2) {
1058
1586
  const ret = arg0.subarray(arg1 >>> 0, arg2 >>> 0);
1059
1587
  return ret;
1060
1588
  },
1061
- __wbg_text_b1b162595ee5251d: function() { return handleError(function (arg0) {
1589
+ __wbg_text_372f5b91442c50f9: function() { return handleError(function (arg0) {
1062
1590
  const ret = arg0.text();
1063
1591
  return ret;
1064
1592
  }, arguments); },
1065
- __wbg_then_d4163530723f56f4: function(arg0, arg1, arg2) {
1066
- const ret = arg0.then(arg1, arg2);
1593
+ __wbg_then_098abe61755d12f6: function(arg0, arg1) {
1594
+ const ret = arg0.then(arg1);
1067
1595
  return ret;
1068
1596
  },
1069
- __wbg_then_f1c954fe00733701: function(arg0, arg1) {
1070
- const ret = arg0.then(arg1);
1597
+ __wbg_then_9e335f6dd892bc11: function(arg0, arg1, arg2) {
1598
+ const ret = arg0.then(arg1, arg2);
1071
1599
  return ret;
1072
1600
  },
1073
- __wbg_trace_fe7b51ac14177e75: function(arg0) {
1601
+ __wbg_trace_e81c2d096c740f11: function(arg0) {
1074
1602
  console.trace(...arg0);
1075
1603
  },
1076
- __wbg_url_86ac63f11d20b46f: function(arg0, arg1) {
1604
+ __wbg_url_7fefc1820fba4e0c: function(arg0, arg1) {
1077
1605
  const ret = arg1.url;
1078
1606
  const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1079
1607
  const len1 = WASM_VECTOR_LEN;
1080
1608
  getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1081
1609
  getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1082
1610
  },
1083
- __wbg_value_667dcb90597486a6: function(arg0) {
1611
+ __wbg_value_21fc78aab0322612: function(arg0) {
1084
1612
  const ret = arg0.value;
1085
1613
  return ret;
1086
1614
  },
@@ -1088,17 +1616,17 @@ function __wbg_get_imports() {
1088
1616
  const ret = arg0.versions;
1089
1617
  return ret;
1090
1618
  },
1091
- __wbg_warn_7639dad0f12218d7: function(arg0) {
1619
+ __wbg_warn_ff4a30433095bbe4: function(arg0) {
1092
1620
  console.warn(...arg0);
1093
1621
  },
1094
1622
  __wbindgen_cast_0000000000000001: function(arg0, arg1) {
1095
- // Cast intrinsic for `Closure(Closure { dtor_idx: 581, function: Function { arguments: [], shim_idx: 582, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1096
- const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__hd529f22c34389d0f, wasm_bindgen__convert__closures_____invoke__hbf3e188fe995424e);
1623
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 575, function: Function { arguments: [], shim_idx: 576, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1624
+ const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__haa2c8eeec983adf2, wasm_bindgen__convert__closures_____invoke__h680f4b2480ae6141);
1097
1625
  return ret;
1098
1626
  },
1099
1627
  __wbindgen_cast_0000000000000002: function(arg0, arg1) {
1100
- // Cast intrinsic for `Closure(Closure { dtor_idx: 625, function: Function { arguments: [Externref], shim_idx: 2037, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
1101
- const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__h0bd98a3a1d60a5b1, wasm_bindgen__convert__closures_____invoke__h826419d66d164abb);
1628
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 619, function: Function { arguments: [Externref], shim_idx: 2038, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
1629
+ const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__haf4358594d12c874, wasm_bindgen__convert__closures_____invoke__h1f90382e3f7fa14a);
1102
1630
  return ret;
1103
1631
  },
1104
1632
  __wbindgen_cast_0000000000000003: function(arg0) {
@@ -1142,19 +1670,19 @@ function __wbg_get_imports() {
1142
1670
  };
1143
1671
  }
1144
1672
 
1145
- function wasm_bindgen__convert__closures_____invoke__hbf3e188fe995424e(arg0, arg1) {
1146
- wasm.wasm_bindgen__convert__closures_____invoke__hbf3e188fe995424e(arg0, arg1);
1673
+ function wasm_bindgen__convert__closures_____invoke__h680f4b2480ae6141(arg0, arg1) {
1674
+ wasm.wasm_bindgen__convert__closures_____invoke__h680f4b2480ae6141(arg0, arg1);
1147
1675
  }
1148
1676
 
1149
- function wasm_bindgen__convert__closures_____invoke__h826419d66d164abb(arg0, arg1, arg2) {
1150
- const ret = wasm.wasm_bindgen__convert__closures_____invoke__h826419d66d164abb(arg0, arg1, arg2);
1677
+ function wasm_bindgen__convert__closures_____invoke__h1f90382e3f7fa14a(arg0, arg1, arg2) {
1678
+ const ret = wasm.wasm_bindgen__convert__closures_____invoke__h1f90382e3f7fa14a(arg0, arg1, arg2);
1151
1679
  if (ret[1]) {
1152
1680
  throw takeFromExternrefTable0(ret[0]);
1153
1681
  }
1154
1682
  }
1155
1683
 
1156
- function wasm_bindgen__convert__closures_____invoke__h494d783032f4344f(arg0, arg1, arg2, arg3) {
1157
- wasm.wasm_bindgen__convert__closures_____invoke__h494d783032f4344f(arg0, arg1, arg2, arg3);
1684
+ function wasm_bindgen__convert__closures_____invoke__h434e5a5fca11045c(arg0, arg1, arg2, arg3) {
1685
+ wasm.wasm_bindgen__convert__closures_____invoke__h434e5a5fca11045c(arg0, arg1, arg2, arg3);
1158
1686
  }
1159
1687
 
1160
1688
 
@@ -1174,6 +1702,12 @@ const AuthorizeResultResponseFinalization = (typeof FinalizationRegistry === 'un
1174
1702
  const CedarlingFinalization = (typeof FinalizationRegistry === 'undefined')
1175
1703
  ? { register: () => {}, unregister: () => {} }
1176
1704
  : new FinalizationRegistry(ptr => wasm.__wbg_cedarling_free(ptr >>> 0, 1));
1705
+ const DataEntryFinalization = (typeof FinalizationRegistry === 'undefined')
1706
+ ? { register: () => {}, unregister: () => {} }
1707
+ : new FinalizationRegistry(ptr => wasm.__wbg_dataentry_free(ptr >>> 0, 1));
1708
+ const DataStoreStatsFinalization = (typeof FinalizationRegistry === 'undefined')
1709
+ ? { register: () => {}, unregister: () => {} }
1710
+ : new FinalizationRegistry(ptr => wasm.__wbg_datastorestats_free(ptr >>> 0, 1));
1177
1711
  const DiagnosticsFinalization = (typeof FinalizationRegistry === 'undefined')
1178
1712
  ? { register: () => {}, unregister: () => {} }
1179
1713
  : new FinalizationRegistry(ptr => wasm.__wbg_diagnostics_free(ptr >>> 0, 1));
@@ -1388,15 +1922,7 @@ function takeFromExternrefTable0(idx) {
1388
1922
 
1389
1923
  let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
1390
1924
  cachedTextDecoder.decode();
1391
- const MAX_SAFARI_DECODE_BYTES = 2146435072;
1392
- let numBytesDecoded = 0;
1393
1925
  function decodeText(ptr, len) {
1394
- numBytesDecoded += len;
1395
- if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
1396
- cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
1397
- cachedTextDecoder.decode();
1398
- numBytesDecoded = len;
1399
- }
1400
1926
  return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
1401
1927
  }
1402
1928
 
@@ -1415,95 +1941,8 @@ if (!('encodeInto' in cachedTextEncoder)) {
1415
1941
 
1416
1942
  let WASM_VECTOR_LEN = 0;
1417
1943
 
1418
- let wasmModule, wasm;
1419
- function __wbg_finalize_init(instance, module) {
1420
- wasm = instance.exports;
1421
- wasmModule = module;
1422
- cachedDataViewMemory0 = null;
1423
- cachedUint8ArrayMemory0 = null;
1424
- wasm.__wbindgen_start();
1425
- return wasm;
1426
- }
1427
-
1428
- async function __wbg_load(module, imports) {
1429
- if (typeof Response === 'function' && module instanceof Response) {
1430
- if (typeof WebAssembly.instantiateStreaming === 'function') {
1431
- try {
1432
- return await WebAssembly.instantiateStreaming(module, imports);
1433
- } catch (e) {
1434
- const validResponse = module.ok && expectedResponseType(module.type);
1435
-
1436
- if (validResponse && module.headers.get('Content-Type') !== 'application/wasm') {
1437
- 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);
1438
-
1439
- } else { throw e; }
1440
- }
1441
- }
1442
-
1443
- const bytes = await module.arrayBuffer();
1444
- return await WebAssembly.instantiate(bytes, imports);
1445
- } else {
1446
- const instance = await WebAssembly.instantiate(module, imports);
1447
-
1448
- if (instance instanceof WebAssembly.Instance) {
1449
- return { instance, module };
1450
- } else {
1451
- return instance;
1452
- }
1453
- }
1454
-
1455
- function expectedResponseType(type) {
1456
- switch (type) {
1457
- case 'basic': case 'cors': case 'default': return true;
1458
- }
1459
- return false;
1460
- }
1461
- }
1462
-
1463
- function initSync(module) {
1464
- if (wasm !== undefined) return wasm;
1465
-
1466
-
1467
- if (module !== undefined) {
1468
- if (Object.getPrototypeOf(module) === Object.prototype) {
1469
- ({module} = module)
1470
- } else {
1471
- console.warn('using deprecated parameters for `initSync()`; pass a single object instead')
1472
- }
1473
- }
1474
-
1475
- const imports = __wbg_get_imports();
1476
- if (!(module instanceof WebAssembly.Module)) {
1477
- module = new WebAssembly.Module(module);
1478
- }
1479
- const instance = new WebAssembly.Instance(module, imports);
1480
- return __wbg_finalize_init(instance, module);
1481
- }
1482
-
1483
- async function __wbg_init(module_or_path) {
1484
- if (wasm !== undefined) return wasm;
1485
-
1486
-
1487
- if (module_or_path !== undefined) {
1488
- if (Object.getPrototypeOf(module_or_path) === Object.prototype) {
1489
- ({module_or_path} = module_or_path)
1490
- } else {
1491
- console.warn('using deprecated parameters for the initialization function; pass a single object instead')
1492
- }
1493
- }
1494
-
1495
- if (module_or_path === undefined) {
1496
- module_or_path = new URL('cedarling_wasm_bg.wasm', import.meta.url);
1497
- }
1498
- const imports = __wbg_get_imports();
1499
-
1500
- if (typeof module_or_path === 'string' || (typeof Request === 'function' && module_or_path instanceof Request) || (typeof URL === 'function' && module_or_path instanceof URL)) {
1501
- module_or_path = fetch(module_or_path);
1502
- }
1503
-
1504
- const { instance, module } = await __wbg_load(await module_or_path, imports);
1505
-
1506
- return __wbg_finalize_init(instance, module);
1507
- }
1508
-
1509
- export { initSync, __wbg_init as default };
1944
+ const wasmPath = `${__dirname}/cedarling_wasm_bg.wasm`;
1945
+ const wasmBytes = require('fs').readFileSync(wasmPath);
1946
+ const wasmModule = new WebAssembly.Module(wasmBytes);
1947
+ let wasm = new WebAssembly.Instance(wasmModule, __wbg_get_imports()).exports;
1948
+ wasm.__wbindgen_start();