@bitwarden/sdk-internal 0.2.0-main.148 → 0.2.0-main.149

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.
@@ -924,6 +924,14 @@ export interface TestError extends Error {
924
924
 
925
925
  export function isTestError(error: any): error is TestError;
926
926
 
927
+ export class AttachmentsClient {
928
+ private constructor();
929
+ free(): void;
930
+ /**
931
+ * Decrypts an attachment's encrypted content
932
+ */
933
+ decrypt_buffer(cipher: Cipher, attachment: Attachment, encrypted_buffer: Uint8Array): Uint8Array;
934
+ }
927
935
  export class BitwardenClient {
928
936
  free(): void;
929
937
  constructor(settings?: ClientSettings | null);
@@ -945,15 +953,7 @@ export class BitwardenClient {
945
953
  generator(): GeneratorClient;
946
954
  exporters(): ExporterClient;
947
955
  }
948
- export class ClientAttachments {
949
- private constructor();
950
- free(): void;
951
- /**
952
- * Decrypts an attachment's encrypted content
953
- */
954
- decrypt_buffer(cipher: Cipher, attachment: Attachment, encrypted_buffer: Uint8Array): Uint8Array;
955
- }
956
- export class ClientCiphers {
956
+ export class CiphersClient {
957
957
  private constructor();
958
958
  free(): void;
959
959
  /**
@@ -1015,33 +1015,6 @@ export class ClientCiphers {
1015
1015
  */
1016
1016
  decrypt_fido2_private_key(cipher_view: CipherView): string;
1017
1017
  }
1018
- export class ClientFolders {
1019
- private constructor();
1020
- free(): void;
1021
- /**
1022
- * Decrypt folder
1023
- */
1024
- decrypt(folder: Folder): FolderView;
1025
- }
1026
- export class ClientTotp {
1027
- private constructor();
1028
- free(): void;
1029
- /**
1030
- * Generates a TOTP code from a provided key
1031
- *
1032
- * # Arguments
1033
- * - `key` - Can be:
1034
- * - A base32 encoded string
1035
- * - OTP Auth URI
1036
- * - Steam URI
1037
- * - `time_ms` - Optional timestamp in milliseconds
1038
- *
1039
- * # Returns
1040
- * - `Ok(TotpResponse)` containing the generated code and period
1041
- * - `Err(TotpError)` if code generation fails
1042
- */
1043
- generate_totp(key: string, time_ms?: number | null): TotpResponse;
1044
- }
1045
1018
  export class CryptoClient {
1046
1019
  private constructor();
1047
1020
  free(): void;
@@ -1095,6 +1068,14 @@ export class ExporterClient {
1095
1068
  */
1096
1069
  import_cxf(payload: string): Cipher[];
1097
1070
  }
1071
+ export class FoldersClient {
1072
+ private constructor();
1073
+ free(): void;
1074
+ /**
1075
+ * Decrypt folder
1076
+ */
1077
+ decrypt(folder: Folder): FolderView;
1078
+ }
1098
1079
  export class GeneratorClient {
1099
1080
  private constructor();
1100
1081
  free(): void;
@@ -1185,11 +1166,30 @@ export class SendError {
1185
1166
  crypto: any;
1186
1167
  communication: any;
1187
1168
  }
1169
+ export class TotpClient {
1170
+ private constructor();
1171
+ free(): void;
1172
+ /**
1173
+ * Generates a TOTP code from a provided key
1174
+ *
1175
+ * # Arguments
1176
+ * - `key` - Can be:
1177
+ * - A base32 encoded string
1178
+ * - OTP Auth URI
1179
+ * - Steam URI
1180
+ * - `time_ms` - Optional timestamp in milliseconds
1181
+ *
1182
+ * # Returns
1183
+ * - `Ok(TotpResponse)` containing the generated code and period
1184
+ * - `Err(TotpError)` if code generation fails
1185
+ */
1186
+ generate_totp(key: string, time_ms?: number | null): TotpResponse;
1187
+ }
1188
1188
  export class VaultClient {
1189
1189
  private constructor();
1190
1190
  free(): void;
1191
- attachments(): ClientAttachments;
1192
- ciphers(): ClientCiphers;
1193
- folders(): ClientFolders;
1194
- totp(): ClientTotp;
1191
+ attachments(): AttachmentsClient;
1192
+ ciphers(): CiphersClient;
1193
+ folders(): FoldersClient;
1194
+ totp(): TotpClient;
1195
1195
  }
@@ -733,6 +733,68 @@ const __wbindgen_enum_RequestCredentials = ["omit", "same-origin", "include"];
733
733
 
734
734
  const __wbindgen_enum_RequestMode = ["same-origin", "no-cors", "cors", "navigate"];
735
735
 
736
+ const AttachmentsClientFinalization =
737
+ typeof FinalizationRegistry === "undefined"
738
+ ? { register: () => {}, unregister: () => {} }
739
+ : new FinalizationRegistry((ptr) => wasm.__wbg_attachmentsclient_free(ptr >>> 0, 1));
740
+
741
+ class AttachmentsClient {
742
+ static __wrap(ptr) {
743
+ ptr = ptr >>> 0;
744
+ const obj = Object.create(AttachmentsClient.prototype);
745
+ obj.__wbg_ptr = ptr;
746
+ AttachmentsClientFinalization.register(obj, obj.__wbg_ptr, obj);
747
+ return obj;
748
+ }
749
+
750
+ __destroy_into_raw() {
751
+ const ptr = this.__wbg_ptr;
752
+ this.__wbg_ptr = 0;
753
+ AttachmentsClientFinalization.unregister(this);
754
+ return ptr;
755
+ }
756
+
757
+ free() {
758
+ const ptr = this.__destroy_into_raw();
759
+ wasm.__wbg_attachmentsclient_free(ptr, 0);
760
+ }
761
+ /**
762
+ * Decrypts an attachment's encrypted content
763
+ * @param {Cipher} cipher
764
+ * @param {Attachment} attachment
765
+ * @param {Uint8Array} encrypted_buffer
766
+ * @returns {Uint8Array}
767
+ */
768
+ decrypt_buffer(cipher, attachment, encrypted_buffer) {
769
+ try {
770
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
771
+ const ptr0 = passArray8ToWasm0(encrypted_buffer, wasm.__wbindgen_malloc);
772
+ const len0 = WASM_VECTOR_LEN;
773
+ wasm.attachmentsclient_decrypt_buffer(
774
+ retptr,
775
+ this.__wbg_ptr,
776
+ addHeapObject(cipher),
777
+ addHeapObject(attachment),
778
+ ptr0,
779
+ len0,
780
+ );
781
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
782
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
783
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
784
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
785
+ if (r3) {
786
+ throw takeObject(r2);
787
+ }
788
+ var v2 = getArrayU8FromWasm0(r0, r1).slice();
789
+ wasm.__wbindgen_free(r0, r1 * 1, 1);
790
+ return v2;
791
+ } finally {
792
+ wasm.__wbindgen_add_to_stack_pointer(16);
793
+ }
794
+ }
795
+ }
796
+ module.exports.AttachmentsClient = AttachmentsClient;
797
+
736
798
  const BitwardenClientFinalization =
737
799
  typeof FinalizationRegistry === "undefined"
738
800
  ? { register: () => {}, unregister: () => {} }
@@ -862,92 +924,30 @@ class BitwardenClient {
862
924
  }
863
925
  module.exports.BitwardenClient = BitwardenClient;
864
926
 
865
- const ClientAttachmentsFinalization =
866
- typeof FinalizationRegistry === "undefined"
867
- ? { register: () => {}, unregister: () => {} }
868
- : new FinalizationRegistry((ptr) => wasm.__wbg_clientattachments_free(ptr >>> 0, 1));
869
-
870
- class ClientAttachments {
871
- static __wrap(ptr) {
872
- ptr = ptr >>> 0;
873
- const obj = Object.create(ClientAttachments.prototype);
874
- obj.__wbg_ptr = ptr;
875
- ClientAttachmentsFinalization.register(obj, obj.__wbg_ptr, obj);
876
- return obj;
877
- }
878
-
879
- __destroy_into_raw() {
880
- const ptr = this.__wbg_ptr;
881
- this.__wbg_ptr = 0;
882
- ClientAttachmentsFinalization.unregister(this);
883
- return ptr;
884
- }
885
-
886
- free() {
887
- const ptr = this.__destroy_into_raw();
888
- wasm.__wbg_clientattachments_free(ptr, 0);
889
- }
890
- /**
891
- * Decrypts an attachment's encrypted content
892
- * @param {Cipher} cipher
893
- * @param {Attachment} attachment
894
- * @param {Uint8Array} encrypted_buffer
895
- * @returns {Uint8Array}
896
- */
897
- decrypt_buffer(cipher, attachment, encrypted_buffer) {
898
- try {
899
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
900
- const ptr0 = passArray8ToWasm0(encrypted_buffer, wasm.__wbindgen_malloc);
901
- const len0 = WASM_VECTOR_LEN;
902
- wasm.clientattachments_decrypt_buffer(
903
- retptr,
904
- this.__wbg_ptr,
905
- addHeapObject(cipher),
906
- addHeapObject(attachment),
907
- ptr0,
908
- len0,
909
- );
910
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
911
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
912
- var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
913
- var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
914
- if (r3) {
915
- throw takeObject(r2);
916
- }
917
- var v2 = getArrayU8FromWasm0(r0, r1).slice();
918
- wasm.__wbindgen_free(r0, r1 * 1, 1);
919
- return v2;
920
- } finally {
921
- wasm.__wbindgen_add_to_stack_pointer(16);
922
- }
923
- }
924
- }
925
- module.exports.ClientAttachments = ClientAttachments;
926
-
927
- const ClientCiphersFinalization =
927
+ const CiphersClientFinalization =
928
928
  typeof FinalizationRegistry === "undefined"
929
929
  ? { register: () => {}, unregister: () => {} }
930
- : new FinalizationRegistry((ptr) => wasm.__wbg_clientciphers_free(ptr >>> 0, 1));
930
+ : new FinalizationRegistry((ptr) => wasm.__wbg_ciphersclient_free(ptr >>> 0, 1));
931
931
 
932
- class ClientCiphers {
932
+ class CiphersClient {
933
933
  static __wrap(ptr) {
934
934
  ptr = ptr >>> 0;
935
- const obj = Object.create(ClientCiphers.prototype);
935
+ const obj = Object.create(CiphersClient.prototype);
936
936
  obj.__wbg_ptr = ptr;
937
- ClientCiphersFinalization.register(obj, obj.__wbg_ptr, obj);
937
+ CiphersClientFinalization.register(obj, obj.__wbg_ptr, obj);
938
938
  return obj;
939
939
  }
940
940
 
941
941
  __destroy_into_raw() {
942
942
  const ptr = this.__wbg_ptr;
943
943
  this.__wbg_ptr = 0;
944
- ClientCiphersFinalization.unregister(this);
944
+ CiphersClientFinalization.unregister(this);
945
945
  return ptr;
946
946
  }
947
947
 
948
948
  free() {
949
949
  const ptr = this.__destroy_into_raw();
950
- wasm.__wbg_clientciphers_free(ptr, 0);
950
+ wasm.__wbg_ciphersclient_free(ptr, 0);
951
951
  }
952
952
  /**
953
953
  * Encrypt cipher
@@ -964,7 +964,7 @@ class ClientCiphers {
964
964
  encrypt(cipher_view) {
965
965
  try {
966
966
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
967
- wasm.clientciphers_encrypt(retptr, this.__wbg_ptr, addHeapObject(cipher_view));
967
+ wasm.ciphersclient_encrypt(retptr, this.__wbg_ptr, addHeapObject(cipher_view));
968
968
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
969
969
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
970
970
  var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
@@ -991,7 +991,7 @@ class ClientCiphers {
991
991
  decrypt(cipher) {
992
992
  try {
993
993
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
994
- wasm.clientciphers_decrypt(retptr, this.__wbg_ptr, addHeapObject(cipher));
994
+ wasm.ciphersclient_decrypt(retptr, this.__wbg_ptr, addHeapObject(cipher));
995
995
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
996
996
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
997
997
  var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
@@ -1020,7 +1020,7 @@ class ClientCiphers {
1020
1020
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1021
1021
  const ptr0 = passArrayJsValueToWasm0(ciphers, wasm.__wbindgen_malloc);
1022
1022
  const len0 = WASM_VECTOR_LEN;
1023
- wasm.clientciphers_decrypt_list(retptr, this.__wbg_ptr, ptr0, len0);
1023
+ wasm.ciphersclient_decrypt_list(retptr, this.__wbg_ptr, ptr0, len0);
1024
1024
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1025
1025
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1026
1026
  var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
@@ -1050,7 +1050,7 @@ class ClientCiphers {
1050
1050
  decrypt_fido2_credentials(cipher_view) {
1051
1051
  try {
1052
1052
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1053
- wasm.clientciphers_decrypt_fido2_credentials(
1053
+ wasm.ciphersclient_decrypt_fido2_credentials(
1054
1054
  retptr,
1055
1055
  this.__wbg_ptr,
1056
1056
  addHeapObject(cipher_view),
@@ -1089,7 +1089,7 @@ class ClientCiphers {
1089
1089
  let deferred2_1;
1090
1090
  try {
1091
1091
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1092
- wasm.clientciphers_decrypt_fido2_private_key(
1092
+ wasm.ciphersclient_decrypt_fido2_private_key(
1093
1093
  retptr,
1094
1094
  this.__wbg_ptr,
1095
1095
  addHeapObject(cipher_view),
@@ -1114,124 +1114,7 @@ class ClientCiphers {
1114
1114
  }
1115
1115
  }
1116
1116
  }
1117
- module.exports.ClientCiphers = ClientCiphers;
1118
-
1119
- const ClientFoldersFinalization =
1120
- typeof FinalizationRegistry === "undefined"
1121
- ? { register: () => {}, unregister: () => {} }
1122
- : new FinalizationRegistry((ptr) => wasm.__wbg_clientfolders_free(ptr >>> 0, 1));
1123
-
1124
- class ClientFolders {
1125
- static __wrap(ptr) {
1126
- ptr = ptr >>> 0;
1127
- const obj = Object.create(ClientFolders.prototype);
1128
- obj.__wbg_ptr = ptr;
1129
- ClientFoldersFinalization.register(obj, obj.__wbg_ptr, obj);
1130
- return obj;
1131
- }
1132
-
1133
- __destroy_into_raw() {
1134
- const ptr = this.__wbg_ptr;
1135
- this.__wbg_ptr = 0;
1136
- ClientFoldersFinalization.unregister(this);
1137
- return ptr;
1138
- }
1139
-
1140
- free() {
1141
- const ptr = this.__destroy_into_raw();
1142
- wasm.__wbg_clientfolders_free(ptr, 0);
1143
- }
1144
- /**
1145
- * Decrypt folder
1146
- * @param {Folder} folder
1147
- * @returns {FolderView}
1148
- */
1149
- decrypt(folder) {
1150
- try {
1151
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1152
- wasm.clientfolders_decrypt(retptr, this.__wbg_ptr, addHeapObject(folder));
1153
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1154
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1155
- var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1156
- if (r2) {
1157
- throw takeObject(r1);
1158
- }
1159
- return takeObject(r0);
1160
- } finally {
1161
- wasm.__wbindgen_add_to_stack_pointer(16);
1162
- }
1163
- }
1164
- }
1165
- module.exports.ClientFolders = ClientFolders;
1166
-
1167
- const ClientTotpFinalization =
1168
- typeof FinalizationRegistry === "undefined"
1169
- ? { register: () => {}, unregister: () => {} }
1170
- : new FinalizationRegistry((ptr) => wasm.__wbg_clienttotp_free(ptr >>> 0, 1));
1171
-
1172
- class ClientTotp {
1173
- static __wrap(ptr) {
1174
- ptr = ptr >>> 0;
1175
- const obj = Object.create(ClientTotp.prototype);
1176
- obj.__wbg_ptr = ptr;
1177
- ClientTotpFinalization.register(obj, obj.__wbg_ptr, obj);
1178
- return obj;
1179
- }
1180
-
1181
- __destroy_into_raw() {
1182
- const ptr = this.__wbg_ptr;
1183
- this.__wbg_ptr = 0;
1184
- ClientTotpFinalization.unregister(this);
1185
- return ptr;
1186
- }
1187
-
1188
- free() {
1189
- const ptr = this.__destroy_into_raw();
1190
- wasm.__wbg_clienttotp_free(ptr, 0);
1191
- }
1192
- /**
1193
- * Generates a TOTP code from a provided key
1194
- *
1195
- * # Arguments
1196
- * - `key` - Can be:
1197
- * - A base32 encoded string
1198
- * - OTP Auth URI
1199
- * - Steam URI
1200
- * - `time_ms` - Optional timestamp in milliseconds
1201
- *
1202
- * # Returns
1203
- * - `Ok(TotpResponse)` containing the generated code and period
1204
- * - `Err(TotpError)` if code generation fails
1205
- * @param {string} key
1206
- * @param {number | null} [time_ms]
1207
- * @returns {TotpResponse}
1208
- */
1209
- generate_totp(key, time_ms) {
1210
- try {
1211
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1212
- const ptr0 = passStringToWasm0(key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1213
- const len0 = WASM_VECTOR_LEN;
1214
- wasm.clienttotp_generate_totp(
1215
- retptr,
1216
- this.__wbg_ptr,
1217
- ptr0,
1218
- len0,
1219
- !isLikeNone(time_ms),
1220
- isLikeNone(time_ms) ? 0 : time_ms,
1221
- );
1222
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1223
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1224
- var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1225
- if (r2) {
1226
- throw takeObject(r1);
1227
- }
1228
- return takeObject(r0);
1229
- } finally {
1230
- wasm.__wbindgen_add_to_stack_pointer(16);
1231
- }
1232
- }
1233
- }
1234
- module.exports.ClientTotp = ClientTotp;
1117
+ module.exports.CiphersClient = CiphersClient;
1235
1118
 
1236
1119
  const CryptoClientFinalization =
1237
1120
  typeof FinalizationRegistry === "undefined"
@@ -1508,6 +1391,54 @@ class ExporterClient {
1508
1391
  }
1509
1392
  module.exports.ExporterClient = ExporterClient;
1510
1393
 
1394
+ const FoldersClientFinalization =
1395
+ typeof FinalizationRegistry === "undefined"
1396
+ ? { register: () => {}, unregister: () => {} }
1397
+ : new FinalizationRegistry((ptr) => wasm.__wbg_foldersclient_free(ptr >>> 0, 1));
1398
+
1399
+ class FoldersClient {
1400
+ static __wrap(ptr) {
1401
+ ptr = ptr >>> 0;
1402
+ const obj = Object.create(FoldersClient.prototype);
1403
+ obj.__wbg_ptr = ptr;
1404
+ FoldersClientFinalization.register(obj, obj.__wbg_ptr, obj);
1405
+ return obj;
1406
+ }
1407
+
1408
+ __destroy_into_raw() {
1409
+ const ptr = this.__wbg_ptr;
1410
+ this.__wbg_ptr = 0;
1411
+ FoldersClientFinalization.unregister(this);
1412
+ return ptr;
1413
+ }
1414
+
1415
+ free() {
1416
+ const ptr = this.__destroy_into_raw();
1417
+ wasm.__wbg_foldersclient_free(ptr, 0);
1418
+ }
1419
+ /**
1420
+ * Decrypt folder
1421
+ * @param {Folder} folder
1422
+ * @returns {FolderView}
1423
+ */
1424
+ decrypt(folder) {
1425
+ try {
1426
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1427
+ wasm.foldersclient_decrypt(retptr, this.__wbg_ptr, addHeapObject(folder));
1428
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1429
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1430
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1431
+ if (r2) {
1432
+ throw takeObject(r1);
1433
+ }
1434
+ return takeObject(r0);
1435
+ } finally {
1436
+ wasm.__wbindgen_add_to_stack_pointer(16);
1437
+ }
1438
+ }
1439
+ }
1440
+ module.exports.FoldersClient = FoldersClient;
1441
+
1511
1442
  const GeneratorClientFinalization =
1512
1443
  typeof FinalizationRegistry === "undefined"
1513
1444
  ? { register: () => {}, unregister: () => {} }
@@ -2234,6 +2165,75 @@ class SendError {
2234
2165
  }
2235
2166
  module.exports.SendError = SendError;
2236
2167
 
2168
+ const TotpClientFinalization =
2169
+ typeof FinalizationRegistry === "undefined"
2170
+ ? { register: () => {}, unregister: () => {} }
2171
+ : new FinalizationRegistry((ptr) => wasm.__wbg_totpclient_free(ptr >>> 0, 1));
2172
+
2173
+ class TotpClient {
2174
+ static __wrap(ptr) {
2175
+ ptr = ptr >>> 0;
2176
+ const obj = Object.create(TotpClient.prototype);
2177
+ obj.__wbg_ptr = ptr;
2178
+ TotpClientFinalization.register(obj, obj.__wbg_ptr, obj);
2179
+ return obj;
2180
+ }
2181
+
2182
+ __destroy_into_raw() {
2183
+ const ptr = this.__wbg_ptr;
2184
+ this.__wbg_ptr = 0;
2185
+ TotpClientFinalization.unregister(this);
2186
+ return ptr;
2187
+ }
2188
+
2189
+ free() {
2190
+ const ptr = this.__destroy_into_raw();
2191
+ wasm.__wbg_totpclient_free(ptr, 0);
2192
+ }
2193
+ /**
2194
+ * Generates a TOTP code from a provided key
2195
+ *
2196
+ * # Arguments
2197
+ * - `key` - Can be:
2198
+ * - A base32 encoded string
2199
+ * - OTP Auth URI
2200
+ * - Steam URI
2201
+ * - `time_ms` - Optional timestamp in milliseconds
2202
+ *
2203
+ * # Returns
2204
+ * - `Ok(TotpResponse)` containing the generated code and period
2205
+ * - `Err(TotpError)` if code generation fails
2206
+ * @param {string} key
2207
+ * @param {number | null} [time_ms]
2208
+ * @returns {TotpResponse}
2209
+ */
2210
+ generate_totp(key, time_ms) {
2211
+ try {
2212
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2213
+ const ptr0 = passStringToWasm0(key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2214
+ const len0 = WASM_VECTOR_LEN;
2215
+ wasm.totpclient_generate_totp(
2216
+ retptr,
2217
+ this.__wbg_ptr,
2218
+ ptr0,
2219
+ len0,
2220
+ !isLikeNone(time_ms),
2221
+ isLikeNone(time_ms) ? 0 : time_ms,
2222
+ );
2223
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2224
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2225
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
2226
+ if (r2) {
2227
+ throw takeObject(r1);
2228
+ }
2229
+ return takeObject(r0);
2230
+ } finally {
2231
+ wasm.__wbindgen_add_to_stack_pointer(16);
2232
+ }
2233
+ }
2234
+ }
2235
+ module.exports.TotpClient = TotpClient;
2236
+
2237
2237
  const VaultClientFinalization =
2238
2238
  typeof FinalizationRegistry === "undefined"
2239
2239
  ? { register: () => {}, unregister: () => {} }
@@ -2260,32 +2260,32 @@ class VaultClient {
2260
2260
  wasm.__wbg_vaultclient_free(ptr, 0);
2261
2261
  }
2262
2262
  /**
2263
- * @returns {ClientAttachments}
2263
+ * @returns {AttachmentsClient}
2264
2264
  */
2265
2265
  attachments() {
2266
2266
  const ret = wasm.vaultclient_attachments(this.__wbg_ptr);
2267
- return ClientAttachments.__wrap(ret);
2267
+ return AttachmentsClient.__wrap(ret);
2268
2268
  }
2269
2269
  /**
2270
- * @returns {ClientCiphers}
2270
+ * @returns {CiphersClient}
2271
2271
  */
2272
2272
  ciphers() {
2273
2273
  const ret = wasm.vaultclient_attachments(this.__wbg_ptr);
2274
- return ClientCiphers.__wrap(ret);
2274
+ return CiphersClient.__wrap(ret);
2275
2275
  }
2276
2276
  /**
2277
- * @returns {ClientFolders}
2277
+ * @returns {FoldersClient}
2278
2278
  */
2279
2279
  folders() {
2280
2280
  const ret = wasm.vaultclient_attachments(this.__wbg_ptr);
2281
- return ClientFolders.__wrap(ret);
2281
+ return FoldersClient.__wrap(ret);
2282
2282
  }
2283
2283
  /**
2284
- * @returns {ClientTotp}
2284
+ * @returns {TotpClient}
2285
2285
  */
2286
2286
  totp() {
2287
2287
  const ret = wasm.vaultclient_totp(this.__wbg_ptr);
2288
- return ClientTotp.__wrap(ret);
2288
+ return TotpClient.__wrap(ret);
2289
2289
  }
2290
2290
  }
2291
2291
  module.exports.VaultClient = VaultClient;
@@ -146,8 +146,8 @@ export const purecrypto_symmetric_encrypt_to_array_buffer: (
146
146
  ) => void;
147
147
  export const generate_ssh_key: (a: number, b: number) => void;
148
148
  export const import_ssh_key: (a: number, b: number, c: number, d: number, e: number) => void;
149
- export const __wbg_clientattachments_free: (a: number, b: number) => void;
150
- export const clientattachments_decrypt_buffer: (
149
+ export const __wbg_attachmentsclient_free: (a: number, b: number) => void;
150
+ export const attachmentsclient_decrypt_buffer: (
151
151
  a: number,
152
152
  b: number,
153
153
  c: number,
@@ -155,13 +155,13 @@ export const clientattachments_decrypt_buffer: (
155
155
  e: number,
156
156
  f: number,
157
157
  ) => void;
158
- export const clientciphers_encrypt: (a: number, b: number, c: number) => void;
159
- export const clientciphers_decrypt: (a: number, b: number, c: number) => void;
160
- export const clientciphers_decrypt_list: (a: number, b: number, c: number, d: number) => void;
161
- export const clientciphers_decrypt_fido2_credentials: (a: number, b: number, c: number) => void;
162
- export const clientciphers_decrypt_fido2_private_key: (a: number, b: number, c: number) => void;
163
- export const clientfolders_decrypt: (a: number, b: number, c: number) => void;
164
- export const clienttotp_generate_totp: (
158
+ export const ciphersclient_encrypt: (a: number, b: number, c: number) => void;
159
+ export const ciphersclient_decrypt: (a: number, b: number, c: number) => void;
160
+ export const ciphersclient_decrypt_list: (a: number, b: number, c: number, d: number) => void;
161
+ export const ciphersclient_decrypt_fido2_credentials: (a: number, b: number, c: number) => void;
162
+ export const ciphersclient_decrypt_fido2_private_key: (a: number, b: number, c: number) => void;
163
+ export const foldersclient_decrypt: (a: number, b: number, c: number) => void;
164
+ export const totpclient_generate_totp: (
165
165
  a: number,
166
166
  b: number,
167
167
  c: number,
@@ -178,9 +178,9 @@ export const vaultclient_ciphers: (a: number) => number;
178
178
  export const vaultclient_folders: (a: number) => number;
179
179
  export const __wbg_generatorclient_free: (a: number, b: number) => void;
180
180
  export const __wbg_vaultclient_free: (a: number, b: number) => void;
181
- export const __wbg_clienttotp_free: (a: number, b: number) => void;
182
- export const __wbg_clientfolders_free: (a: number, b: number) => void;
183
- export const __wbg_clientciphers_free: (a: number, b: number) => void;
181
+ export const __wbg_foldersclient_free: (a: number, b: number) => void;
182
+ export const __wbg_ciphersclient_free: (a: number, b: number) => void;
183
+ export const __wbg_totpclient_free: (a: number, b: number) => void;
184
184
  export const __wbg_cryptoclient_free: (a: number, b: number) => void;
185
185
  export const __wbindgen_malloc: (a: number, b: number) => number;
186
186
  export const __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bitwarden/sdk-internal",
3
- "version": "0.2.0-main.148",
3
+ "version": "0.2.0-main.149",
4
4
  "license": "GPL-3.0",
5
5
  "files": [
6
6
  "bitwarden_wasm_internal_bg.js",