@siafoundation/sia-storage 0.0.14 → 0.1.0

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.
@@ -114,6 +114,22 @@ export class Builder {
114
114
  const ptr = this.__destroy_into_raw();
115
115
  wasm.__wbg_builder_free(ptr, 0);
116
116
  }
117
+ /**
118
+ * Connects using a pre-authorized key, bypassing the interactive approval
119
+ * flow, and returns a Sdk. `preAuthorizedKeySeed` is the 32-byte
120
+ * pre-authorized private key (Uint8Array); `mnemonic` derives the app key.
121
+ * @param {Uint8Array} pre_authorized_key_seed
122
+ * @param {string} mnemonic
123
+ * @returns {Promise<Sdk>}
124
+ */
125
+ connectPreAuthorized(pre_authorized_key_seed, mnemonic) {
126
+ const ptr0 = passArray8ToWasm0(pre_authorized_key_seed, wasm.__wbindgen_malloc);
127
+ const len0 = WASM_VECTOR_LEN;
128
+ const ptr1 = passStringToWasm0(mnemonic, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
129
+ const len1 = WASM_VECTOR_LEN;
130
+ const ret = wasm.builder_connectPreAuthorized(this.__wbg_ptr, ptr0, len0, ptr1, len1);
131
+ return ret;
132
+ }
117
133
  /**
118
134
  * Attempts to connect using an existing AppKey.
119
135
  * Returns a Sdk if the key is valid, or undefined if not registered.
@@ -125,6 +141,19 @@ export class Builder {
125
141
  const ret = wasm.builder_connected(this.__wbg_ptr, app_key.__wbg_ptr);
126
142
  return ret;
127
143
  }
144
+ /**
145
+ * Returns whether `mnemonic` derives an application key that is already
146
+ * registered with the indexer. Unlike `register`, the builder remains
147
+ * usable. Only valid after `waitForApproval` has resolved.
148
+ * @param {string} mnemonic
149
+ * @returns {Promise<boolean>}
150
+ */
151
+ matchesExistingAppKey(mnemonic) {
152
+ const ptr0 = passStringToWasm0(mnemonic, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
153
+ const len0 = WASM_VECTOR_LEN;
154
+ const ret = wasm.builder_matchesExistingAppKey(this.__wbg_ptr, ptr0, len0);
155
+ return ret;
156
+ }
128
157
  /**
129
158
  * @param {string} indexer_url
130
159
  * @param {AppMetadata} app
@@ -140,8 +169,27 @@ export class Builder {
140
169
  BuilderFinalization.register(this, this.__wbg_ptr, this);
141
170
  return this;
142
171
  }
172
+ /**
173
+ * Returns whether the connect key the user approved with already has an
174
+ * account for this application. Only valid after `waitForApproval` has
175
+ * resolved.
176
+ *
177
+ * The connect key may have accounts under more than one recovery phrase.
178
+ * Use `matchesExistingAppKey` to check a particular phrase.
179
+ * @returns {boolean}
180
+ */
181
+ reconnecting() {
182
+ const ret = wasm.builder_reconnecting(this.__wbg_ptr);
183
+ if (ret[2]) {
184
+ throw takeFromExternrefTable0(ret[1]);
185
+ }
186
+ return ret[0] !== 0;
187
+ }
143
188
  /**
144
189
  * Completes registration and returns a Sdk instance.
190
+ *
191
+ * A different recovery phrase registers a new application key even when
192
+ * `reconnecting()` is true.
145
193
  * @param {string} mnemonic
146
194
  * @returns {Promise<Sdk>}
147
195
  */
@@ -309,6 +357,66 @@ export class IntoUnderlyingSource {
309
357
  }
310
358
  if (Symbol.dispose) IntoUnderlyingSource.prototype[Symbol.dispose] = IntoUnderlyingSource.prototype.free;
311
359
 
360
+ /**
361
+ * The indexer's record for a sharing key, including how many objects it grants
362
+ * access to and how much space they use. The counts are a snapshot, not a live
363
+ * view.
364
+ */
365
+ export class KeyRecord {
366
+ static __wrap(ptr) {
367
+ const obj = Object.create(KeyRecord.prototype);
368
+ obj.__wbg_ptr = ptr;
369
+ KeyRecordFinalization.register(obj, obj.__wbg_ptr, obj);
370
+ return obj;
371
+ }
372
+ __destroy_into_raw() {
373
+ const ptr = this.__wbg_ptr;
374
+ this.__wbg_ptr = 0;
375
+ KeyRecordFinalization.unregister(this);
376
+ return ptr;
377
+ }
378
+ free() {
379
+ const ptr = this.__destroy_into_raw();
380
+ wasm.__wbg_keyrecord_free(ptr, 0);
381
+ }
382
+ /**
383
+ * @returns {string}
384
+ */
385
+ get description() {
386
+ let deferred1_0;
387
+ let deferred1_1;
388
+ try {
389
+ const ret = wasm.keyrecord_description(this.__wbg_ptr);
390
+ deferred1_0 = ret[0];
391
+ deferred1_1 = ret[1];
392
+ return getStringFromWasm0(ret[0], ret[1]);
393
+ } finally {
394
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
395
+ }
396
+ }
397
+ /**
398
+ * The key this record describes.
399
+ * @returns {SharingKey}
400
+ */
401
+ get key() {
402
+ const ret = wasm.keyrecord_key(this.__wbg_ptr);
403
+ return SharingKey.__wrap(ret);
404
+ }
405
+ /**
406
+ * A snapshot of how many objects the key grants access to and how much
407
+ * space they use.
408
+ * @returns {KeyStats}
409
+ */
410
+ get stats() {
411
+ const ret = wasm.keyrecord_stats(this.__wbg_ptr);
412
+ if (ret[2]) {
413
+ throw takeFromExternrefTable0(ret[1]);
414
+ }
415
+ return takeFromExternrefTable0(ret[0]);
416
+ }
417
+ }
418
+ if (Symbol.dispose) KeyRecord.prototype[Symbol.dispose] = KeyRecord.prototype.free;
419
+
312
420
  /**
313
421
  * An object event from the indexer.
314
422
  */
@@ -573,7 +681,10 @@ export class PinnedObject {
573
681
  seal(app_key) {
574
682
  _assertClass(app_key, AppKey);
575
683
  const ret = wasm.pinnedobject_seal(this.__wbg_ptr, app_key.__wbg_ptr);
576
- return ret;
684
+ if (ret[2]) {
685
+ throw takeFromExternrefTable0(ret[1]);
686
+ }
687
+ return takeFromExternrefTable0(ret[0]);
577
688
  }
578
689
  /**
579
690
  * Returns the total size of the object in bytes.
@@ -594,6 +705,15 @@ export class PinnedObject {
594
705
  }
595
706
  return takeFromExternrefTable0(ret[0]);
596
707
  }
708
+ /**
709
+ * Returns a new object truncated to the requested length.
710
+ * @param {bigint} length
711
+ * @returns {PinnedObject}
712
+ */
713
+ truncate(length) {
714
+ const ret = wasm.pinnedobject_truncate(this.__wbg_ptr, length);
715
+ return PinnedObject.__wrap(ret);
716
+ }
597
717
  /**
598
718
  * Updates the object's metadata.
599
719
  * @param {Uint8Array} metadata
@@ -651,6 +771,18 @@ export class Sdk {
651
771
  const ret = wasm.sdk_appKey(this.__wbg_ptr);
652
772
  return AppKey.__wrap(ret);
653
773
  }
774
+ /**
775
+ * Creates a sharing key. Attach objects to it with `Sdk.shareObject`.
776
+ * @param {string} description
777
+ * @param {Date | null} [expires_at]
778
+ * @returns {Promise<SharingKey>}
779
+ */
780
+ createSharingKey(description, expires_at) {
781
+ const ptr0 = passStringToWasm0(description, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
782
+ const len0 = WASM_VECTOR_LEN;
783
+ const ret = wasm.sdk_createSharingKey(this.__wbg_ptr, ptr0, len0, isLikeNone(expires_at) ? 0 : addToExternrefTable0(expires_at));
784
+ return ret;
785
+ }
654
786
  /**
655
787
  * Deletes an object from the indexer by its hex ID.
656
788
  * @param {string} key_hex
@@ -719,21 +851,16 @@ export class Sdk {
719
851
  return ret;
720
852
  }
721
853
  /**
722
- * Pins an object to the indexer so it persists beyond temporary storage.
723
- * @param {PinnedObject} object
724
- * @returns {Promise<void>}
725
- */
726
- pinObject(object) {
727
- _assertClass(object, PinnedObject);
728
- const ret = wasm.sdk_pinObject(this.__wbg_ptr, object.__wbg_ptr);
729
- return ret;
730
- }
731
- /**
732
- * Prunes unused slabs from the indexer.
733
- * @returns {Promise<void>}
854
+ * Resolves a share URL (sia://...) and returns the shared object.
855
+ * The encryption key is extracted from the URL fragment (never sent
856
+ * to the indexer).
857
+ * @param {string} share_url
858
+ * @returns {Promise<PinnedObject>}
734
859
  */
735
- pruneSlabs() {
736
- const ret = wasm.sdk_pruneSlabs(this.__wbg_ptr);
860
+ objectFromShareUrl(share_url) {
861
+ const ptr0 = passStringToWasm0(share_url, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
862
+ const len0 = WASM_VECTOR_LEN;
863
+ const ret = wasm.sdk_objectFromShareUrl(this.__wbg_ptr, ptr0, len0);
737
864
  return ret;
738
865
  }
739
866
  /**
@@ -743,12 +870,12 @@ export class Sdk {
743
870
  * @param {Date} valid_until
744
871
  * @returns {string}
745
872
  */
746
- shareObject(object, valid_until) {
873
+ objectShareUrl(object, valid_until) {
747
874
  let deferred2_0;
748
875
  let deferred2_1;
749
876
  try {
750
877
  _assertClass(object, PinnedObject);
751
- const ret = wasm.sdk_shareObject(this.__wbg_ptr, object.__wbg_ptr, valid_until);
878
+ const ret = wasm.sdk_objectShareUrl(this.__wbg_ptr, object.__wbg_ptr, valid_until);
752
879
  var ptr1 = ret[0];
753
880
  var len1 = ret[1];
754
881
  if (ret[3]) {
@@ -763,16 +890,79 @@ export class Sdk {
763
890
  }
764
891
  }
765
892
  /**
766
- * Resolves a share URL (sia://...) and returns the shared object.
767
- * The encryption key is extracted from the URL fragment (never sent
768
- * to the indexer).
769
- * @param {string} share_url
770
- * @returns {Promise<PinnedObject>}
893
+ * Pins an object to the indexer so it persists beyond temporary storage.
894
+ * @param {PinnedObject} object
895
+ * @returns {Promise<void>}
771
896
  */
772
- sharedObject(share_url) {
773
- const ptr0 = passStringToWasm0(share_url, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
774
- const len0 = WASM_VECTOR_LEN;
775
- const ret = wasm.sdk_sharedObject(this.__wbg_ptr, ptr0, len0);
897
+ pinObject(object) {
898
+ _assertClass(object, PinnedObject);
899
+ const ret = wasm.sdk_pinObject(this.__wbg_ptr, object.__wbg_ptr);
900
+ return ret;
901
+ }
902
+ /**
903
+ * Prunes unused slabs from the indexer.
904
+ * @returns {Promise<void>}
905
+ */
906
+ pruneSlabs() {
907
+ const ret = wasm.sdk_pruneSlabs(this.__wbg_ptr);
908
+ return ret;
909
+ }
910
+ /**
911
+ * Deletes a sharing key along with all of its attachments, revoking
912
+ * recipients' access. Account tokens already issued stay valid until they
913
+ * expire, so a download in flight can keep reading for up to five minutes.
914
+ * @param {SharingKey} key
915
+ * @returns {Promise<void>}
916
+ */
917
+ revokeSharingKey(key) {
918
+ _assertClass(key, SharingKey);
919
+ const ret = wasm.sdk_revokeSharingKey(this.__wbg_ptr, key.__wbg_ptr);
920
+ return ret;
921
+ }
922
+ /**
923
+ * Attaches an object to a sharing key, re-sealing its encryption keys under
924
+ * the key so recipients can decrypt it. Attaching an already-attached
925
+ * object replaces its re-sealed keys, so a failed call can be retried.
926
+ * @param {SharingKey} key
927
+ * @param {PinnedObject} object
928
+ * @returns {Promise<void>}
929
+ */
930
+ shareObject(key, object) {
931
+ _assertClass(key, SharingKey);
932
+ _assertClass(object, PinnedObject);
933
+ const ret = wasm.sdk_shareObject(this.__wbg_ptr, key.__wbg_ptr, object.__wbg_ptr);
934
+ return ret;
935
+ }
936
+ /**
937
+ * Lists and decrypts a page of the objects a sharing key grants access to.
938
+ * @param {SharingKey} key
939
+ * @param {number} offset
940
+ * @param {number} limit
941
+ * @returns {Promise<PinnedObject[]>}
942
+ */
943
+ sharedObjects(key, offset, limit) {
944
+ _assertClass(key, SharingKey);
945
+ const ret = wasm.sdk_sharedObjects(this.__wbg_ptr, key.__wbg_ptr, offset, limit);
946
+ return ret;
947
+ }
948
+ /**
949
+ * Fetches the indexer's record for a key, including its counts.
950
+ * @param {SharingKey} key
951
+ * @returns {Promise<KeyRecord>}
952
+ */
953
+ sharingKey(key) {
954
+ _assertClass(key, SharingKey);
955
+ const ret = wasm.sdk_sharingKey(this.__wbg_ptr, key.__wbg_ptr);
956
+ return ret;
957
+ }
958
+ /**
959
+ * Lists the account's sharing keys, most recently created first.
960
+ * @param {number} offset
961
+ * @param {number} limit
962
+ * @returns {Promise<KeyRecord[]>}
963
+ */
964
+ sharingKeys(offset, limit) {
965
+ const ret = wasm.sdk_sharingKeys(this.__wbg_ptr, offset, limit);
776
966
  return ret;
777
967
  }
778
968
  /**
@@ -786,6 +976,19 @@ export class Sdk {
786
976
  const ret = wasm.sdk_slab(this.__wbg_ptr, ptr0, len0);
787
977
  return ret;
788
978
  }
979
+ /**
980
+ * Detaches an object from a sharing key, leaving the key and its other
981
+ * attachments in place.
982
+ * @param {SharingKey} key
983
+ * @param {PinnedObject} object
984
+ * @returns {Promise<void>}
985
+ */
986
+ unshareObject(key, object) {
987
+ _assertClass(key, SharingKey);
988
+ _assertClass(object, PinnedObject);
989
+ const ret = wasm.sdk_unshareObject(this.__wbg_ptr, key.__wbg_ptr, object.__wbg_ptr);
990
+ return ret;
991
+ }
789
992
  /**
790
993
  * Updates an object's metadata on the indexer.
791
994
  * @param {PinnedObject} object
@@ -836,6 +1039,177 @@ export class Sdk {
836
1039
  }
837
1040
  if (Symbol.dispose) Sdk.prototype[Symbol.dispose] = Sdk.prototype.free;
838
1041
 
1042
+ /**
1043
+ * A read-only SDK for the objects a sharing key grants access to.
1044
+ *
1045
+ * Unlike `Sdk`, it authenticates with a sharing key rather than an app key and
1046
+ * cannot upload, pin, or delete. Downloads are paid for by the key's owner.
1047
+ */
1048
+ export class SharedSdk {
1049
+ static __wrap(ptr) {
1050
+ const obj = Object.create(SharedSdk.prototype);
1051
+ obj.__wbg_ptr = ptr;
1052
+ SharedSdkFinalization.register(obj, obj.__wbg_ptr, obj);
1053
+ return obj;
1054
+ }
1055
+ __destroy_into_raw() {
1056
+ const ptr = this.__wbg_ptr;
1057
+ this.__wbg_ptr = 0;
1058
+ SharedSdkFinalization.unregister(this);
1059
+ return ptr;
1060
+ }
1061
+ free() {
1062
+ const ptr = this.__destroy_into_raw();
1063
+ wasm.__wbg_sharedsdk_free(ptr, 0);
1064
+ }
1065
+ /**
1066
+ * Connects to `indexerUrl` as the recipient of the sharing key derived
1067
+ * from `seed`, which is the hex string the key's owner handed out.
1068
+ * @param {string} indexer_url
1069
+ * @param {string} seed
1070
+ * @returns {Promise<SharedSdk>}
1071
+ */
1072
+ static connect(indexer_url, seed) {
1073
+ const ptr0 = passStringToWasm0(indexer_url, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1074
+ const len0 = WASM_VECTOR_LEN;
1075
+ const ptr1 = passStringToWasm0(seed, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1076
+ const len1 = WASM_VECTOR_LEN;
1077
+ const ret = wasm.sharedsdk_connect(ptr0, len0, ptr1, len1);
1078
+ return ret;
1079
+ }
1080
+ /**
1081
+ * Streams a shared object's data.
1082
+ * @param {PinnedObject} object
1083
+ * @param {any | null} [options]
1084
+ * @returns {ReadableStream}
1085
+ */
1086
+ download(object, options) {
1087
+ _assertClass(object, PinnedObject);
1088
+ const ret = wasm.sharedsdk_download(this.__wbg_ptr, object.__wbg_ptr, isLikeNone(options) ? 0 : addToExternrefTable0(options));
1089
+ if (ret[2]) {
1090
+ throw takeFromExternrefTable0(ret[1]);
1091
+ }
1092
+ return takeFromExternrefTable0(ret[0]);
1093
+ }
1094
+ /**
1095
+ * Returns the hosts serving this key's objects, optionally filtered by a
1096
+ * HostQuery. Mirrors `Sdk.hosts()` but is scoped to the sharing key, so the
1097
+ * set is already limited to hosts holding its objects.
1098
+ * @param {HostQuery | null} [query]
1099
+ * @returns {Host[]}
1100
+ */
1101
+ hosts(query) {
1102
+ const ret = wasm.sharedsdk_hosts(this.__wbg_ptr, isLikeNone(query) ? 0 : addToExternrefTable0(query));
1103
+ return ret;
1104
+ }
1105
+ /**
1106
+ * Fetches and decrypts one object the key grants access to.
1107
+ * @param {string} id
1108
+ * @returns {Promise<PinnedObject>}
1109
+ */
1110
+ object(id) {
1111
+ const ptr0 = passStringToWasm0(id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1112
+ const len0 = WASM_VECTOR_LEN;
1113
+ const ret = wasm.sharedsdk_object(this.__wbg_ptr, ptr0, len0);
1114
+ return ret;
1115
+ }
1116
+ /**
1117
+ * Lists and decrypts a page of the objects the key grants access to.
1118
+ * @param {number} offset
1119
+ * @param {number} limit
1120
+ * @returns {Promise<PinnedObject[]>}
1121
+ */
1122
+ objects(offset, limit) {
1123
+ const ret = wasm.sharedsdk_objects(this.__wbg_ptr, offset, limit);
1124
+ return ret;
1125
+ }
1126
+ /**
1127
+ * Fetches the sharing key's stats from the indexer.
1128
+ * @returns {Promise<KeyStats>}
1129
+ */
1130
+ stats() {
1131
+ const ret = wasm.sharedsdk_stats(this.__wbg_ptr);
1132
+ return ret;
1133
+ }
1134
+ }
1135
+ if (Symbol.dispose) SharedSdk.prototype[Symbol.dispose] = SharedSdk.prototype.free;
1136
+
1137
+ /**
1138
+ * A sharing key, granting read-only access to the objects attached to it.
1139
+ *
1140
+ * It is just the credential; the operations that use it live on `Sdk`.
1141
+ */
1142
+ export class SharingKey {
1143
+ static __wrap(ptr) {
1144
+ const obj = Object.create(SharingKey.prototype);
1145
+ obj.__wbg_ptr = ptr;
1146
+ SharingKeyFinalization.register(obj, obj.__wbg_ptr, obj);
1147
+ return obj;
1148
+ }
1149
+ __destroy_into_raw() {
1150
+ const ptr = this.__wbg_ptr;
1151
+ this.__wbg_ptr = 0;
1152
+ SharingKeyFinalization.unregister(this);
1153
+ return ptr;
1154
+ }
1155
+ free() {
1156
+ const ptr = this.__destroy_into_raw();
1157
+ wasm.__wbg_sharingkey_free(ptr, 0);
1158
+ }
1159
+ /**
1160
+ * Imports a sharing key from the hex seed its owner handed out.
1161
+ *
1162
+ * Pass the string returned by [seed](Self::seed).
1163
+ * @param {string} seed
1164
+ * @returns {SharingKey}
1165
+ */
1166
+ static fromSeed(seed) {
1167
+ const ptr0 = passStringToWasm0(seed, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1168
+ const len0 = WASM_VECTOR_LEN;
1169
+ const ret = wasm.sharingkey_fromSeed(ptr0, len0);
1170
+ if (ret[2]) {
1171
+ throw takeFromExternrefTable0(ret[1]);
1172
+ }
1173
+ return SharingKey.__wrap(ret[0]);
1174
+ }
1175
+ /**
1176
+ * The key's public half, which identifies it.
1177
+ * @returns {string}
1178
+ */
1179
+ get publicKey() {
1180
+ let deferred1_0;
1181
+ let deferred1_1;
1182
+ try {
1183
+ const ret = wasm.sharingkey_publicKey(this.__wbg_ptr);
1184
+ deferred1_0 = ret[0];
1185
+ deferred1_1 = ret[1];
1186
+ return getStringFromWasm0(ret[0], ret[1]);
1187
+ } finally {
1188
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
1189
+ }
1190
+ }
1191
+ /**
1192
+ * Returns the seed a recipient needs to read the key's objects, as hex.
1193
+ *
1194
+ * It is the whole credential. Pair it with the indexer's url in
1195
+ * `SharedSdk.connect`.
1196
+ * @returns {string}
1197
+ */
1198
+ seed() {
1199
+ let deferred1_0;
1200
+ let deferred1_1;
1201
+ try {
1202
+ const ret = wasm.sharingkey_seed(this.__wbg_ptr);
1203
+ deferred1_0 = ret[0];
1204
+ deferred1_1 = ret[1];
1205
+ return getStringFromWasm0(ret[0], ret[1]);
1206
+ } finally {
1207
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
1208
+ }
1209
+ }
1210
+ }
1211
+ if (Symbol.dispose) SharingKey.prototype[Symbol.dispose] = SharingKey.prototype.free;
1212
+
839
1213
  /**
840
1214
  * Calculates the encoded size of data after erasure coding.
841
1215
  * @param {number} data_size
@@ -1065,11 +1439,11 @@ function __wbg_get_imports() {
1065
1439
  const ret = arg0.createBidirectionalStream();
1066
1440
  return ret;
1067
1441
  },
1068
- __wbg_done_4ead556d01fd3011: function(arg0) {
1442
+ __wbg_done_89b2b13e91a60321: function(arg0) {
1069
1443
  const ret = arg0.done;
1070
1444
  return ret;
1071
1445
  },
1072
- __wbg_done_89b2b13e91a60321: function(arg0) {
1446
+ __wbg_done_c68bf4f8d2d475af: function(arg0) {
1073
1447
  const ret = arg0.done;
1074
1448
  return ret;
1075
1449
  },
@@ -1212,6 +1586,10 @@ function __wbg_get_imports() {
1212
1586
  const ret = Symbol.iterator;
1213
1587
  return ret;
1214
1588
  },
1589
+ __wbg_keyrecord_new: function(arg0) {
1590
+ const ret = KeyRecord.__wrap(arg0);
1591
+ return ret;
1592
+ },
1215
1593
  __wbg_length_1f0964f4a5e2c6d8: function(arg0) {
1216
1594
  const ret = arg0.length;
1217
1595
  return ret;
@@ -1251,7 +1629,7 @@ function __wbg_get_imports() {
1251
1629
  const a = state0.a;
1252
1630
  state0.a = 0;
1253
1631
  try {
1254
- return wasm_bindgen_94d9ab53edc6bea3___convert__closures_____invoke___js_sys_2b0a4a9337300fde___Function_fn_wasm_bindgen_94d9ab53edc6bea3___JsValue_____wasm_bindgen_94d9ab53edc6bea3___sys__Undefined___js_sys_2b0a4a9337300fde___Function_fn_wasm_bindgen_94d9ab53edc6bea3___JsValue_____wasm_bindgen_94d9ab53edc6bea3___sys__Undefined_______true_(a, state0.b, arg0, arg1);
1632
+ return wasm_bindgen_baa1b51bcdcd1a91___convert__closures_____invoke___js_sys_bdd470c3fe1f6d69___Function_fn_wasm_bindgen_baa1b51bcdcd1a91___JsValue_____wasm_bindgen_baa1b51bcdcd1a91___sys__Undefined___js_sys_bdd470c3fe1f6d69___Function_fn_wasm_bindgen_baa1b51bcdcd1a91___JsValue_____wasm_bindgen_baa1b51bcdcd1a91___sys__Undefined_______true_(a, state0.b, arg0, arg1);
1255
1633
  } finally {
1256
1634
  state0.a = a;
1257
1635
  }
@@ -1289,7 +1667,7 @@ function __wbg_get_imports() {
1289
1667
  const a = state0.a;
1290
1668
  state0.a = 0;
1291
1669
  try {
1292
- return wasm_bindgen_94d9ab53edc6bea3___convert__closures_____invoke___js_sys_2b0a4a9337300fde___Function_fn_wasm_bindgen_94d9ab53edc6bea3___JsValue_____wasm_bindgen_94d9ab53edc6bea3___sys__Undefined___js_sys_2b0a4a9337300fde___Function_fn_wasm_bindgen_94d9ab53edc6bea3___JsValue_____wasm_bindgen_94d9ab53edc6bea3___sys__Undefined_______true_(a, state0.b, arg0, arg1);
1670
+ return wasm_bindgen_baa1b51bcdcd1a91___convert__closures_____invoke___js_sys_bdd470c3fe1f6d69___Function_fn_wasm_bindgen_baa1b51bcdcd1a91___JsValue_____wasm_bindgen_baa1b51bcdcd1a91___sys__Undefined___js_sys_bdd470c3fe1f6d69___Function_fn_wasm_bindgen_baa1b51bcdcd1a91___JsValue_____wasm_bindgen_baa1b51bcdcd1a91___sys__Undefined_______true_(a, state0.b, arg0, arg1);
1293
1671
  } finally {
1294
1672
  state0.a = a;
1295
1673
  }
@@ -1424,6 +1802,14 @@ function __wbg_get_imports() {
1424
1802
  __wbg_set_signal_c4ef8faddb4c1446: function(arg0, arg1) {
1425
1803
  arg0.signal = arg1;
1426
1804
  },
1805
+ __wbg_sharedsdk_new: function(arg0) {
1806
+ const ret = SharedSdk.__wrap(arg0);
1807
+ return ret;
1808
+ },
1809
+ __wbg_sharingkey_new: function(arg0) {
1810
+ const ret = SharingKey.__wrap(arg0);
1811
+ return ret;
1812
+ },
1427
1813
  __wbg_signal_dad7cb35193abd31: function(arg0) {
1428
1814
  const ret = arg0.signal;
1429
1815
  return ret;
@@ -1486,11 +1872,11 @@ function __wbg_get_imports() {
1486
1872
  getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1487
1873
  getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1488
1874
  },
1489
- __wbg_value_a5d5488a9589444a: function(arg0) {
1875
+ __wbg_value_707a9727a4e0b640: function(arg0) {
1490
1876
  const ret = arg0.value;
1491
1877
  return ret;
1492
1878
  },
1493
- __wbg_value_da5243f0032ab973: function(arg0) {
1879
+ __wbg_value_a5d5488a9589444a: function(arg0) {
1494
1880
  const ret = arg0.value;
1495
1881
  return ret;
1496
1882
  },
@@ -1507,33 +1893,33 @@ function __wbg_get_imports() {
1507
1893
  return ret;
1508
1894
  },
1509
1895
  __wbindgen_cast_0000000000000001: function(arg0, arg1) {
1510
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 395, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1511
- const ret = makeMutClosure(arg0, arg1, wasm_bindgen_94d9ab53edc6bea3___convert__closures_____invoke___wasm_bindgen_94d9ab53edc6bea3___JsValue______true_);
1896
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 1057, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
1897
+ const ret = makeMutClosure(arg0, arg1, wasm_bindgen_baa1b51bcdcd1a91___convert__closures_____invoke___wasm_bindgen_baa1b51bcdcd1a91___JsValue__core_ed718c3d60ebd546___result__Result_____wasm_bindgen_baa1b51bcdcd1a91___JsError___true_);
1512
1898
  return ret;
1513
1899
  },
1514
1900
  __wbindgen_cast_0000000000000002: function(arg0, arg1) {
1515
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 446, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
1516
- const ret = makeMutClosure(arg0, arg1, wasm_bindgen_94d9ab53edc6bea3___convert__closures_____invoke___wasm_bindgen_94d9ab53edc6bea3___sys__Undefined__core_9b3796e30d99ddb7___result__Result_____wasm_bindgen_94d9ab53edc6bea3___JsError___true_);
1901
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 524, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1902
+ const ret = makeMutClosure(arg0, arg1, wasm_bindgen_baa1b51bcdcd1a91___convert__closures_____invoke___wasm_bindgen_baa1b51bcdcd1a91___JsValue______true_);
1517
1903
  return ret;
1518
1904
  },
1519
1905
  __wbindgen_cast_0000000000000003: function(arg0, arg1) {
1520
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 916, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
1521
- const ret = makeMutClosure(arg0, arg1, wasm_bindgen_94d9ab53edc6bea3___convert__closures_____invoke___wasm_bindgen_94d9ab53edc6bea3___JsValue__core_9b3796e30d99ddb7___result__Result_____wasm_bindgen_94d9ab53edc6bea3___JsError___true_);
1906
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 580, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
1907
+ const ret = makeMutClosure(arg0, arg1, wasm_bindgen_baa1b51bcdcd1a91___convert__closures_____invoke___wasm_bindgen_baa1b51bcdcd1a91___sys__Undefined__core_ed718c3d60ebd546___result__Result_____wasm_bindgen_baa1b51bcdcd1a91___JsError___true_);
1522
1908
  return ret;
1523
1909
  },
1524
1910
  __wbindgen_cast_0000000000000004: function(arg0, arg1) {
1525
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("WebTransportBidirectionalStream")], shim_idx: 446, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
1526
- const ret = makeMutClosure(arg0, arg1, wasm_bindgen_94d9ab53edc6bea3___convert__closures_____invoke___wasm_bindgen_94d9ab53edc6bea3___sys__Undefined__core_9b3796e30d99ddb7___result__Result_____wasm_bindgen_94d9ab53edc6bea3___JsError___true__3);
1911
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("WebTransportBidirectionalStream")], shim_idx: 580, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
1912
+ const ret = makeMutClosure(arg0, arg1, wasm_bindgen_baa1b51bcdcd1a91___convert__closures_____invoke___wasm_bindgen_baa1b51bcdcd1a91___sys__Undefined__core_ed718c3d60ebd546___result__Result_____wasm_bindgen_baa1b51bcdcd1a91___JsError___true__3);
1527
1913
  return ret;
1528
1914
  },
1529
1915
  __wbindgen_cast_0000000000000005: function(arg0, arg1) {
1530
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("undefined")], shim_idx: 446, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
1531
- const ret = makeMutClosure(arg0, arg1, wasm_bindgen_94d9ab53edc6bea3___convert__closures_____invoke___wasm_bindgen_94d9ab53edc6bea3___sys__Undefined__core_9b3796e30d99ddb7___result__Result_____wasm_bindgen_94d9ab53edc6bea3___JsError___true__4);
1916
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("undefined")], shim_idx: 580, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
1917
+ const ret = makeMutClosure(arg0, arg1, wasm_bindgen_baa1b51bcdcd1a91___convert__closures_____invoke___wasm_bindgen_baa1b51bcdcd1a91___sys__Undefined__core_ed718c3d60ebd546___result__Result_____wasm_bindgen_baa1b51bcdcd1a91___JsError___true__4);
1532
1918
  return ret;
1533
1919
  },
1534
1920
  __wbindgen_cast_0000000000000006: function(arg0, arg1) {
1535
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [], shim_idx: 729, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1536
- const ret = makeMutClosure(arg0, arg1, wasm_bindgen_94d9ab53edc6bea3___convert__closures_____invoke_______true_);
1921
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [], shim_idx: 869, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1922
+ const ret = makeMutClosure(arg0, arg1, wasm_bindgen_baa1b51bcdcd1a91___convert__closures_____invoke_______true_);
1537
1923
  return ret;
1538
1924
  },
1539
1925
  __wbindgen_cast_0000000000000007: function(arg0) {
@@ -1554,11 +1940,18 @@ function __wbg_get_imports() {
1554
1940
  __wbindgen_cast_000000000000000a: function(arg0, arg1) {
1555
1941
  var v0 = getArrayJsValueFromWasm0(arg0, arg1).slice();
1556
1942
  wasm.__wbindgen_free(arg0, arg1 * 4, 4);
1557
- // Cast intrinsic for `Vector(NamedExternref("ObjectEvent")) -> Externref`.
1943
+ // Cast intrinsic for `Vector(NamedExternref("KeyRecord")) -> Externref`.
1558
1944
  const ret = v0;
1559
1945
  return ret;
1560
1946
  },
1561
1947
  __wbindgen_cast_000000000000000b: function(arg0, arg1) {
1948
+ var v0 = getArrayJsValueFromWasm0(arg0, arg1).slice();
1949
+ wasm.__wbindgen_free(arg0, arg1 * 4, 4);
1950
+ // Cast intrinsic for `Vector(NamedExternref("ObjectEvent")) -> Externref`.
1951
+ const ret = v0;
1952
+ return ret;
1953
+ },
1954
+ __wbindgen_cast_000000000000000c: function(arg0, arg1) {
1562
1955
  var v0 = getArrayJsValueFromWasm0(arg0, arg1).slice();
1563
1956
  wasm.__wbindgen_free(arg0, arg1 * 4, 4);
1564
1957
  // Cast intrinsic for `Vector(NamedExternref("PinnedObject")) -> Externref`.
@@ -1581,44 +1974,44 @@ function __wbg_get_imports() {
1581
1974
  };
1582
1975
  }
1583
1976
 
1584
- function wasm_bindgen_94d9ab53edc6bea3___convert__closures_____invoke_______true_(arg0, arg1) {
1585
- wasm.wasm_bindgen_94d9ab53edc6bea3___convert__closures_____invoke_______true_(arg0, arg1);
1977
+ function wasm_bindgen_baa1b51bcdcd1a91___convert__closures_____invoke_______true_(arg0, arg1) {
1978
+ wasm.wasm_bindgen_baa1b51bcdcd1a91___convert__closures_____invoke_______true_(arg0, arg1);
1586
1979
  }
1587
1980
 
1588
- function wasm_bindgen_94d9ab53edc6bea3___convert__closures_____invoke___wasm_bindgen_94d9ab53edc6bea3___JsValue______true_(arg0, arg1, arg2) {
1589
- wasm.wasm_bindgen_94d9ab53edc6bea3___convert__closures_____invoke___wasm_bindgen_94d9ab53edc6bea3___JsValue______true_(arg0, arg1, arg2);
1981
+ function wasm_bindgen_baa1b51bcdcd1a91___convert__closures_____invoke___wasm_bindgen_baa1b51bcdcd1a91___JsValue______true_(arg0, arg1, arg2) {
1982
+ wasm.wasm_bindgen_baa1b51bcdcd1a91___convert__closures_____invoke___wasm_bindgen_baa1b51bcdcd1a91___JsValue______true_(arg0, arg1, arg2);
1590
1983
  }
1591
1984
 
1592
- function wasm_bindgen_94d9ab53edc6bea3___convert__closures_____invoke___wasm_bindgen_94d9ab53edc6bea3___sys__Undefined__core_9b3796e30d99ddb7___result__Result_____wasm_bindgen_94d9ab53edc6bea3___JsError___true_(arg0, arg1, arg2) {
1593
- const ret = wasm.wasm_bindgen_94d9ab53edc6bea3___convert__closures_____invoke___wasm_bindgen_94d9ab53edc6bea3___sys__Undefined__core_9b3796e30d99ddb7___result__Result_____wasm_bindgen_94d9ab53edc6bea3___JsError___true_(arg0, arg1, arg2);
1985
+ function wasm_bindgen_baa1b51bcdcd1a91___convert__closures_____invoke___wasm_bindgen_baa1b51bcdcd1a91___JsValue__core_ed718c3d60ebd546___result__Result_____wasm_bindgen_baa1b51bcdcd1a91___JsError___true_(arg0, arg1, arg2) {
1986
+ const ret = wasm.wasm_bindgen_baa1b51bcdcd1a91___convert__closures_____invoke___wasm_bindgen_baa1b51bcdcd1a91___JsValue__core_ed718c3d60ebd546___result__Result_____wasm_bindgen_baa1b51bcdcd1a91___JsError___true_(arg0, arg1, arg2);
1594
1987
  if (ret[1]) {
1595
1988
  throw takeFromExternrefTable0(ret[0]);
1596
1989
  }
1597
1990
  }
1598
1991
 
1599
- function wasm_bindgen_94d9ab53edc6bea3___convert__closures_____invoke___wasm_bindgen_94d9ab53edc6bea3___JsValue__core_9b3796e30d99ddb7___result__Result_____wasm_bindgen_94d9ab53edc6bea3___JsError___true_(arg0, arg1, arg2) {
1600
- const ret = wasm.wasm_bindgen_94d9ab53edc6bea3___convert__closures_____invoke___wasm_bindgen_94d9ab53edc6bea3___JsValue__core_9b3796e30d99ddb7___result__Result_____wasm_bindgen_94d9ab53edc6bea3___JsError___true_(arg0, arg1, arg2);
1992
+ function wasm_bindgen_baa1b51bcdcd1a91___convert__closures_____invoke___wasm_bindgen_baa1b51bcdcd1a91___sys__Undefined__core_ed718c3d60ebd546___result__Result_____wasm_bindgen_baa1b51bcdcd1a91___JsError___true_(arg0, arg1, arg2) {
1993
+ const ret = wasm.wasm_bindgen_baa1b51bcdcd1a91___convert__closures_____invoke___wasm_bindgen_baa1b51bcdcd1a91___sys__Undefined__core_ed718c3d60ebd546___result__Result_____wasm_bindgen_baa1b51bcdcd1a91___JsError___true_(arg0, arg1, arg2);
1601
1994
  if (ret[1]) {
1602
1995
  throw takeFromExternrefTable0(ret[0]);
1603
1996
  }
1604
1997
  }
1605
1998
 
1606
- function wasm_bindgen_94d9ab53edc6bea3___convert__closures_____invoke___wasm_bindgen_94d9ab53edc6bea3___sys__Undefined__core_9b3796e30d99ddb7___result__Result_____wasm_bindgen_94d9ab53edc6bea3___JsError___true__3(arg0, arg1, arg2) {
1607
- const ret = wasm.wasm_bindgen_94d9ab53edc6bea3___convert__closures_____invoke___wasm_bindgen_94d9ab53edc6bea3___sys__Undefined__core_9b3796e30d99ddb7___result__Result_____wasm_bindgen_94d9ab53edc6bea3___JsError___true__3(arg0, arg1, arg2);
1999
+ function wasm_bindgen_baa1b51bcdcd1a91___convert__closures_____invoke___wasm_bindgen_baa1b51bcdcd1a91___sys__Undefined__core_ed718c3d60ebd546___result__Result_____wasm_bindgen_baa1b51bcdcd1a91___JsError___true__3(arg0, arg1, arg2) {
2000
+ const ret = wasm.wasm_bindgen_baa1b51bcdcd1a91___convert__closures_____invoke___wasm_bindgen_baa1b51bcdcd1a91___sys__Undefined__core_ed718c3d60ebd546___result__Result_____wasm_bindgen_baa1b51bcdcd1a91___JsError___true__3(arg0, arg1, arg2);
1608
2001
  if (ret[1]) {
1609
2002
  throw takeFromExternrefTable0(ret[0]);
1610
2003
  }
1611
2004
  }
1612
2005
 
1613
- function wasm_bindgen_94d9ab53edc6bea3___convert__closures_____invoke___wasm_bindgen_94d9ab53edc6bea3___sys__Undefined__core_9b3796e30d99ddb7___result__Result_____wasm_bindgen_94d9ab53edc6bea3___JsError___true__4(arg0, arg1, arg2) {
1614
- const ret = wasm.wasm_bindgen_94d9ab53edc6bea3___convert__closures_____invoke___wasm_bindgen_94d9ab53edc6bea3___sys__Undefined__core_9b3796e30d99ddb7___result__Result_____wasm_bindgen_94d9ab53edc6bea3___JsError___true__4(arg0, arg1, arg2);
2006
+ function wasm_bindgen_baa1b51bcdcd1a91___convert__closures_____invoke___wasm_bindgen_baa1b51bcdcd1a91___sys__Undefined__core_ed718c3d60ebd546___result__Result_____wasm_bindgen_baa1b51bcdcd1a91___JsError___true__4(arg0, arg1, arg2) {
2007
+ const ret = wasm.wasm_bindgen_baa1b51bcdcd1a91___convert__closures_____invoke___wasm_bindgen_baa1b51bcdcd1a91___sys__Undefined__core_ed718c3d60ebd546___result__Result_____wasm_bindgen_baa1b51bcdcd1a91___JsError___true__4(arg0, arg1, arg2);
1615
2008
  if (ret[1]) {
1616
2009
  throw takeFromExternrefTable0(ret[0]);
1617
2010
  }
1618
2011
  }
1619
2012
 
1620
- function wasm_bindgen_94d9ab53edc6bea3___convert__closures_____invoke___js_sys_2b0a4a9337300fde___Function_fn_wasm_bindgen_94d9ab53edc6bea3___JsValue_____wasm_bindgen_94d9ab53edc6bea3___sys__Undefined___js_sys_2b0a4a9337300fde___Function_fn_wasm_bindgen_94d9ab53edc6bea3___JsValue_____wasm_bindgen_94d9ab53edc6bea3___sys__Undefined_______true_(arg0, arg1, arg2, arg3) {
1621
- wasm.wasm_bindgen_94d9ab53edc6bea3___convert__closures_____invoke___js_sys_2b0a4a9337300fde___Function_fn_wasm_bindgen_94d9ab53edc6bea3___JsValue_____wasm_bindgen_94d9ab53edc6bea3___sys__Undefined___js_sys_2b0a4a9337300fde___Function_fn_wasm_bindgen_94d9ab53edc6bea3___JsValue_____wasm_bindgen_94d9ab53edc6bea3___sys__Undefined_______true_(arg0, arg1, arg2, arg3);
2013
+ function wasm_bindgen_baa1b51bcdcd1a91___convert__closures_____invoke___js_sys_bdd470c3fe1f6d69___Function_fn_wasm_bindgen_baa1b51bcdcd1a91___JsValue_____wasm_bindgen_baa1b51bcdcd1a91___sys__Undefined___js_sys_bdd470c3fe1f6d69___Function_fn_wasm_bindgen_baa1b51bcdcd1a91___JsValue_____wasm_bindgen_baa1b51bcdcd1a91___sys__Undefined_______true_(arg0, arg1, arg2, arg3) {
2014
+ wasm.wasm_bindgen_baa1b51bcdcd1a91___convert__closures_____invoke___js_sys_bdd470c3fe1f6d69___Function_fn_wasm_bindgen_baa1b51bcdcd1a91___JsValue_____wasm_bindgen_baa1b51bcdcd1a91___sys__Undefined___js_sys_bdd470c3fe1f6d69___Function_fn_wasm_bindgen_baa1b51bcdcd1a91___JsValue_____wasm_bindgen_baa1b51bcdcd1a91___sys__Undefined_______true_(arg0, arg1, arg2, arg3);
1622
2015
  }
1623
2016
 
1624
2017
 
@@ -1650,6 +2043,9 @@ const IntoUnderlyingSinkFinalization = (typeof FinalizationRegistry === 'undefin
1650
2043
  const IntoUnderlyingSourceFinalization = (typeof FinalizationRegistry === 'undefined')
1651
2044
  ? { register: () => {}, unregister: () => {} }
1652
2045
  : new FinalizationRegistry(ptr => wasm.__wbg_intounderlyingsource_free(ptr, 1));
2046
+ const KeyRecordFinalization = (typeof FinalizationRegistry === 'undefined')
2047
+ ? { register: () => {}, unregister: () => {} }
2048
+ : new FinalizationRegistry(ptr => wasm.__wbg_keyrecord_free(ptr, 1));
1653
2049
  const ObjectEventFinalization = (typeof FinalizationRegistry === 'undefined')
1654
2050
  ? { register: () => {}, unregister: () => {} }
1655
2051
  : new FinalizationRegistry(ptr => wasm.__wbg_objectevent_free(ptr, 1));
@@ -1662,6 +2058,12 @@ const PinnedObjectFinalization = (typeof FinalizationRegistry === 'undefined')
1662
2058
  const SdkFinalization = (typeof FinalizationRegistry === 'undefined')
1663
2059
  ? { register: () => {}, unregister: () => {} }
1664
2060
  : new FinalizationRegistry(ptr => wasm.__wbg_sdk_free(ptr, 1));
2061
+ const SharedSdkFinalization = (typeof FinalizationRegistry === 'undefined')
2062
+ ? { register: () => {}, unregister: () => {} }
2063
+ : new FinalizationRegistry(ptr => wasm.__wbg_sharedsdk_free(ptr, 1));
2064
+ const SharingKeyFinalization = (typeof FinalizationRegistry === 'undefined')
2065
+ ? { register: () => {}, unregister: () => {} }
2066
+ : new FinalizationRegistry(ptr => wasm.__wbg_sharingkey_free(ptr, 1));
1665
2067
 
1666
2068
  function addToExternrefTable0(obj) {
1667
2069
  const idx = wasm.__externref_table_alloc();