@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.
- package/VERSION +1 -1
- package/bitwarden_wasm_internal.d.ts +40 -40
- package/bitwarden_wasm_internal_bg.js +196 -196
- package/bitwarden_wasm_internal_bg.wasm +0 -0
- package/bitwarden_wasm_internal_bg.wasm.d.ts +12 -12
- package/bitwarden_wasm_internal_bg.wasm.js +1 -1
- package/node/bitwarden_wasm_internal.d.ts +40 -40
- package/node/bitwarden_wasm_internal.js +200 -200
- package/node/bitwarden_wasm_internal_bg.wasm +0 -0
- package/node/bitwarden_wasm_internal_bg.wasm.d.ts +12 -12
- package/package.json +1 -1
package/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
8014451f6b9d8a3701be63b37eecc8f8ac79277e
|
|
@@ -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
|
|
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():
|
|
1192
|
-
ciphers():
|
|
1193
|
-
folders():
|
|
1194
|
-
totp():
|
|
1191
|
+
attachments(): AttachmentsClient;
|
|
1192
|
+
ciphers(): CiphersClient;
|
|
1193
|
+
folders(): FoldersClient;
|
|
1194
|
+
totp(): TotpClient;
|
|
1195
1195
|
}
|
|
@@ -739,6 +739,67 @@ const __wbindgen_enum_RequestCredentials = ["omit", "same-origin", "include"];
|
|
|
739
739
|
|
|
740
740
|
const __wbindgen_enum_RequestMode = ["same-origin", "no-cors", "cors", "navigate"];
|
|
741
741
|
|
|
742
|
+
const AttachmentsClientFinalization =
|
|
743
|
+
typeof FinalizationRegistry === "undefined"
|
|
744
|
+
? { register: () => {}, unregister: () => {} }
|
|
745
|
+
: new FinalizationRegistry((ptr) => wasm.__wbg_attachmentsclient_free(ptr >>> 0, 1));
|
|
746
|
+
|
|
747
|
+
export class AttachmentsClient {
|
|
748
|
+
static __wrap(ptr) {
|
|
749
|
+
ptr = ptr >>> 0;
|
|
750
|
+
const obj = Object.create(AttachmentsClient.prototype);
|
|
751
|
+
obj.__wbg_ptr = ptr;
|
|
752
|
+
AttachmentsClientFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
753
|
+
return obj;
|
|
754
|
+
}
|
|
755
|
+
|
|
756
|
+
__destroy_into_raw() {
|
|
757
|
+
const ptr = this.__wbg_ptr;
|
|
758
|
+
this.__wbg_ptr = 0;
|
|
759
|
+
AttachmentsClientFinalization.unregister(this);
|
|
760
|
+
return ptr;
|
|
761
|
+
}
|
|
762
|
+
|
|
763
|
+
free() {
|
|
764
|
+
const ptr = this.__destroy_into_raw();
|
|
765
|
+
wasm.__wbg_attachmentsclient_free(ptr, 0);
|
|
766
|
+
}
|
|
767
|
+
/**
|
|
768
|
+
* Decrypts an attachment's encrypted content
|
|
769
|
+
* @param {Cipher} cipher
|
|
770
|
+
* @param {Attachment} attachment
|
|
771
|
+
* @param {Uint8Array} encrypted_buffer
|
|
772
|
+
* @returns {Uint8Array}
|
|
773
|
+
*/
|
|
774
|
+
decrypt_buffer(cipher, attachment, encrypted_buffer) {
|
|
775
|
+
try {
|
|
776
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
777
|
+
const ptr0 = passArray8ToWasm0(encrypted_buffer, wasm.__wbindgen_malloc);
|
|
778
|
+
const len0 = WASM_VECTOR_LEN;
|
|
779
|
+
wasm.attachmentsclient_decrypt_buffer(
|
|
780
|
+
retptr,
|
|
781
|
+
this.__wbg_ptr,
|
|
782
|
+
addHeapObject(cipher),
|
|
783
|
+
addHeapObject(attachment),
|
|
784
|
+
ptr0,
|
|
785
|
+
len0,
|
|
786
|
+
);
|
|
787
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
788
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
789
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
790
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
791
|
+
if (r3) {
|
|
792
|
+
throw takeObject(r2);
|
|
793
|
+
}
|
|
794
|
+
var v2 = getArrayU8FromWasm0(r0, r1).slice();
|
|
795
|
+
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
796
|
+
return v2;
|
|
797
|
+
} finally {
|
|
798
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
799
|
+
}
|
|
800
|
+
}
|
|
801
|
+
}
|
|
802
|
+
|
|
742
803
|
const BitwardenClientFinalization =
|
|
743
804
|
typeof FinalizationRegistry === "undefined"
|
|
744
805
|
? { register: () => {}, unregister: () => {} }
|
|
@@ -867,91 +928,30 @@ export class BitwardenClient {
|
|
|
867
928
|
}
|
|
868
929
|
}
|
|
869
930
|
|
|
870
|
-
const
|
|
871
|
-
typeof FinalizationRegistry === "undefined"
|
|
872
|
-
? { register: () => {}, unregister: () => {} }
|
|
873
|
-
: new FinalizationRegistry((ptr) => wasm.__wbg_clientattachments_free(ptr >>> 0, 1));
|
|
874
|
-
|
|
875
|
-
export class ClientAttachments {
|
|
876
|
-
static __wrap(ptr) {
|
|
877
|
-
ptr = ptr >>> 0;
|
|
878
|
-
const obj = Object.create(ClientAttachments.prototype);
|
|
879
|
-
obj.__wbg_ptr = ptr;
|
|
880
|
-
ClientAttachmentsFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
881
|
-
return obj;
|
|
882
|
-
}
|
|
883
|
-
|
|
884
|
-
__destroy_into_raw() {
|
|
885
|
-
const ptr = this.__wbg_ptr;
|
|
886
|
-
this.__wbg_ptr = 0;
|
|
887
|
-
ClientAttachmentsFinalization.unregister(this);
|
|
888
|
-
return ptr;
|
|
889
|
-
}
|
|
890
|
-
|
|
891
|
-
free() {
|
|
892
|
-
const ptr = this.__destroy_into_raw();
|
|
893
|
-
wasm.__wbg_clientattachments_free(ptr, 0);
|
|
894
|
-
}
|
|
895
|
-
/**
|
|
896
|
-
* Decrypts an attachment's encrypted content
|
|
897
|
-
* @param {Cipher} cipher
|
|
898
|
-
* @param {Attachment} attachment
|
|
899
|
-
* @param {Uint8Array} encrypted_buffer
|
|
900
|
-
* @returns {Uint8Array}
|
|
901
|
-
*/
|
|
902
|
-
decrypt_buffer(cipher, attachment, encrypted_buffer) {
|
|
903
|
-
try {
|
|
904
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
905
|
-
const ptr0 = passArray8ToWasm0(encrypted_buffer, wasm.__wbindgen_malloc);
|
|
906
|
-
const len0 = WASM_VECTOR_LEN;
|
|
907
|
-
wasm.clientattachments_decrypt_buffer(
|
|
908
|
-
retptr,
|
|
909
|
-
this.__wbg_ptr,
|
|
910
|
-
addHeapObject(cipher),
|
|
911
|
-
addHeapObject(attachment),
|
|
912
|
-
ptr0,
|
|
913
|
-
len0,
|
|
914
|
-
);
|
|
915
|
-
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
916
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
917
|
-
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
918
|
-
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
919
|
-
if (r3) {
|
|
920
|
-
throw takeObject(r2);
|
|
921
|
-
}
|
|
922
|
-
var v2 = getArrayU8FromWasm0(r0, r1).slice();
|
|
923
|
-
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
924
|
-
return v2;
|
|
925
|
-
} finally {
|
|
926
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
927
|
-
}
|
|
928
|
-
}
|
|
929
|
-
}
|
|
930
|
-
|
|
931
|
-
const ClientCiphersFinalization =
|
|
931
|
+
const CiphersClientFinalization =
|
|
932
932
|
typeof FinalizationRegistry === "undefined"
|
|
933
933
|
? { register: () => {}, unregister: () => {} }
|
|
934
|
-
: new FinalizationRegistry((ptr) => wasm.
|
|
934
|
+
: new FinalizationRegistry((ptr) => wasm.__wbg_ciphersclient_free(ptr >>> 0, 1));
|
|
935
935
|
|
|
936
|
-
export class
|
|
936
|
+
export class CiphersClient {
|
|
937
937
|
static __wrap(ptr) {
|
|
938
938
|
ptr = ptr >>> 0;
|
|
939
|
-
const obj = Object.create(
|
|
939
|
+
const obj = Object.create(CiphersClient.prototype);
|
|
940
940
|
obj.__wbg_ptr = ptr;
|
|
941
|
-
|
|
941
|
+
CiphersClientFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
942
942
|
return obj;
|
|
943
943
|
}
|
|
944
944
|
|
|
945
945
|
__destroy_into_raw() {
|
|
946
946
|
const ptr = this.__wbg_ptr;
|
|
947
947
|
this.__wbg_ptr = 0;
|
|
948
|
-
|
|
948
|
+
CiphersClientFinalization.unregister(this);
|
|
949
949
|
return ptr;
|
|
950
950
|
}
|
|
951
951
|
|
|
952
952
|
free() {
|
|
953
953
|
const ptr = this.__destroy_into_raw();
|
|
954
|
-
wasm.
|
|
954
|
+
wasm.__wbg_ciphersclient_free(ptr, 0);
|
|
955
955
|
}
|
|
956
956
|
/**
|
|
957
957
|
* Encrypt cipher
|
|
@@ -968,7 +968,7 @@ export class ClientCiphers {
|
|
|
968
968
|
encrypt(cipher_view) {
|
|
969
969
|
try {
|
|
970
970
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
971
|
-
wasm.
|
|
971
|
+
wasm.ciphersclient_encrypt(retptr, this.__wbg_ptr, addHeapObject(cipher_view));
|
|
972
972
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
973
973
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
974
974
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
@@ -995,7 +995,7 @@ export class ClientCiphers {
|
|
|
995
995
|
decrypt(cipher) {
|
|
996
996
|
try {
|
|
997
997
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
998
|
-
wasm.
|
|
998
|
+
wasm.ciphersclient_decrypt(retptr, this.__wbg_ptr, addHeapObject(cipher));
|
|
999
999
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1000
1000
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1001
1001
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
@@ -1024,7 +1024,7 @@ export class ClientCiphers {
|
|
|
1024
1024
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1025
1025
|
const ptr0 = passArrayJsValueToWasm0(ciphers, wasm.__wbindgen_malloc);
|
|
1026
1026
|
const len0 = WASM_VECTOR_LEN;
|
|
1027
|
-
wasm.
|
|
1027
|
+
wasm.ciphersclient_decrypt_list(retptr, this.__wbg_ptr, ptr0, len0);
|
|
1028
1028
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1029
1029
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1030
1030
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
@@ -1054,7 +1054,7 @@ export class ClientCiphers {
|
|
|
1054
1054
|
decrypt_fido2_credentials(cipher_view) {
|
|
1055
1055
|
try {
|
|
1056
1056
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1057
|
-
wasm.
|
|
1057
|
+
wasm.ciphersclient_decrypt_fido2_credentials(
|
|
1058
1058
|
retptr,
|
|
1059
1059
|
this.__wbg_ptr,
|
|
1060
1060
|
addHeapObject(cipher_view),
|
|
@@ -1093,7 +1093,7 @@ export class ClientCiphers {
|
|
|
1093
1093
|
let deferred2_1;
|
|
1094
1094
|
try {
|
|
1095
1095
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1096
|
-
wasm.
|
|
1096
|
+
wasm.ciphersclient_decrypt_fido2_private_key(
|
|
1097
1097
|
retptr,
|
|
1098
1098
|
this.__wbg_ptr,
|
|
1099
1099
|
addHeapObject(cipher_view),
|
|
@@ -1119,121 +1119,6 @@ export class ClientCiphers {
|
|
|
1119
1119
|
}
|
|
1120
1120
|
}
|
|
1121
1121
|
|
|
1122
|
-
const ClientFoldersFinalization =
|
|
1123
|
-
typeof FinalizationRegistry === "undefined"
|
|
1124
|
-
? { register: () => {}, unregister: () => {} }
|
|
1125
|
-
: new FinalizationRegistry((ptr) => wasm.__wbg_clientfolders_free(ptr >>> 0, 1));
|
|
1126
|
-
|
|
1127
|
-
export class ClientFolders {
|
|
1128
|
-
static __wrap(ptr) {
|
|
1129
|
-
ptr = ptr >>> 0;
|
|
1130
|
-
const obj = Object.create(ClientFolders.prototype);
|
|
1131
|
-
obj.__wbg_ptr = ptr;
|
|
1132
|
-
ClientFoldersFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
1133
|
-
return obj;
|
|
1134
|
-
}
|
|
1135
|
-
|
|
1136
|
-
__destroy_into_raw() {
|
|
1137
|
-
const ptr = this.__wbg_ptr;
|
|
1138
|
-
this.__wbg_ptr = 0;
|
|
1139
|
-
ClientFoldersFinalization.unregister(this);
|
|
1140
|
-
return ptr;
|
|
1141
|
-
}
|
|
1142
|
-
|
|
1143
|
-
free() {
|
|
1144
|
-
const ptr = this.__destroy_into_raw();
|
|
1145
|
-
wasm.__wbg_clientfolders_free(ptr, 0);
|
|
1146
|
-
}
|
|
1147
|
-
/**
|
|
1148
|
-
* Decrypt folder
|
|
1149
|
-
* @param {Folder} folder
|
|
1150
|
-
* @returns {FolderView}
|
|
1151
|
-
*/
|
|
1152
|
-
decrypt(folder) {
|
|
1153
|
-
try {
|
|
1154
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1155
|
-
wasm.clientfolders_decrypt(retptr, this.__wbg_ptr, addHeapObject(folder));
|
|
1156
|
-
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1157
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1158
|
-
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1159
|
-
if (r2) {
|
|
1160
|
-
throw takeObject(r1);
|
|
1161
|
-
}
|
|
1162
|
-
return takeObject(r0);
|
|
1163
|
-
} finally {
|
|
1164
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1165
|
-
}
|
|
1166
|
-
}
|
|
1167
|
-
}
|
|
1168
|
-
|
|
1169
|
-
const ClientTotpFinalization =
|
|
1170
|
-
typeof FinalizationRegistry === "undefined"
|
|
1171
|
-
? { register: () => {}, unregister: () => {} }
|
|
1172
|
-
: new FinalizationRegistry((ptr) => wasm.__wbg_clienttotp_free(ptr >>> 0, 1));
|
|
1173
|
-
|
|
1174
|
-
export class ClientTotp {
|
|
1175
|
-
static __wrap(ptr) {
|
|
1176
|
-
ptr = ptr >>> 0;
|
|
1177
|
-
const obj = Object.create(ClientTotp.prototype);
|
|
1178
|
-
obj.__wbg_ptr = ptr;
|
|
1179
|
-
ClientTotpFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
1180
|
-
return obj;
|
|
1181
|
-
}
|
|
1182
|
-
|
|
1183
|
-
__destroy_into_raw() {
|
|
1184
|
-
const ptr = this.__wbg_ptr;
|
|
1185
|
-
this.__wbg_ptr = 0;
|
|
1186
|
-
ClientTotpFinalization.unregister(this);
|
|
1187
|
-
return ptr;
|
|
1188
|
-
}
|
|
1189
|
-
|
|
1190
|
-
free() {
|
|
1191
|
-
const ptr = this.__destroy_into_raw();
|
|
1192
|
-
wasm.__wbg_clienttotp_free(ptr, 0);
|
|
1193
|
-
}
|
|
1194
|
-
/**
|
|
1195
|
-
* Generates a TOTP code from a provided key
|
|
1196
|
-
*
|
|
1197
|
-
* # Arguments
|
|
1198
|
-
* - `key` - Can be:
|
|
1199
|
-
* - A base32 encoded string
|
|
1200
|
-
* - OTP Auth URI
|
|
1201
|
-
* - Steam URI
|
|
1202
|
-
* - `time_ms` - Optional timestamp in milliseconds
|
|
1203
|
-
*
|
|
1204
|
-
* # Returns
|
|
1205
|
-
* - `Ok(TotpResponse)` containing the generated code and period
|
|
1206
|
-
* - `Err(TotpError)` if code generation fails
|
|
1207
|
-
* @param {string} key
|
|
1208
|
-
* @param {number | null} [time_ms]
|
|
1209
|
-
* @returns {TotpResponse}
|
|
1210
|
-
*/
|
|
1211
|
-
generate_totp(key, time_ms) {
|
|
1212
|
-
try {
|
|
1213
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1214
|
-
const ptr0 = passStringToWasm0(key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1215
|
-
const len0 = WASM_VECTOR_LEN;
|
|
1216
|
-
wasm.clienttotp_generate_totp(
|
|
1217
|
-
retptr,
|
|
1218
|
-
this.__wbg_ptr,
|
|
1219
|
-
ptr0,
|
|
1220
|
-
len0,
|
|
1221
|
-
!isLikeNone(time_ms),
|
|
1222
|
-
isLikeNone(time_ms) ? 0 : time_ms,
|
|
1223
|
-
);
|
|
1224
|
-
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1225
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1226
|
-
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1227
|
-
if (r2) {
|
|
1228
|
-
throw takeObject(r1);
|
|
1229
|
-
}
|
|
1230
|
-
return takeObject(r0);
|
|
1231
|
-
} finally {
|
|
1232
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1233
|
-
}
|
|
1234
|
-
}
|
|
1235
|
-
}
|
|
1236
|
-
|
|
1237
1122
|
const CryptoClientFinalization =
|
|
1238
1123
|
typeof FinalizationRegistry === "undefined"
|
|
1239
1124
|
? { register: () => {}, unregister: () => {} }
|
|
@@ -1507,6 +1392,53 @@ export class ExporterClient {
|
|
|
1507
1392
|
}
|
|
1508
1393
|
}
|
|
1509
1394
|
|
|
1395
|
+
const FoldersClientFinalization =
|
|
1396
|
+
typeof FinalizationRegistry === "undefined"
|
|
1397
|
+
? { register: () => {}, unregister: () => {} }
|
|
1398
|
+
: new FinalizationRegistry((ptr) => wasm.__wbg_foldersclient_free(ptr >>> 0, 1));
|
|
1399
|
+
|
|
1400
|
+
export class FoldersClient {
|
|
1401
|
+
static __wrap(ptr) {
|
|
1402
|
+
ptr = ptr >>> 0;
|
|
1403
|
+
const obj = Object.create(FoldersClient.prototype);
|
|
1404
|
+
obj.__wbg_ptr = ptr;
|
|
1405
|
+
FoldersClientFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
1406
|
+
return obj;
|
|
1407
|
+
}
|
|
1408
|
+
|
|
1409
|
+
__destroy_into_raw() {
|
|
1410
|
+
const ptr = this.__wbg_ptr;
|
|
1411
|
+
this.__wbg_ptr = 0;
|
|
1412
|
+
FoldersClientFinalization.unregister(this);
|
|
1413
|
+
return ptr;
|
|
1414
|
+
}
|
|
1415
|
+
|
|
1416
|
+
free() {
|
|
1417
|
+
const ptr = this.__destroy_into_raw();
|
|
1418
|
+
wasm.__wbg_foldersclient_free(ptr, 0);
|
|
1419
|
+
}
|
|
1420
|
+
/**
|
|
1421
|
+
* Decrypt folder
|
|
1422
|
+
* @param {Folder} folder
|
|
1423
|
+
* @returns {FolderView}
|
|
1424
|
+
*/
|
|
1425
|
+
decrypt(folder) {
|
|
1426
|
+
try {
|
|
1427
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1428
|
+
wasm.foldersclient_decrypt(retptr, this.__wbg_ptr, addHeapObject(folder));
|
|
1429
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1430
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1431
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1432
|
+
if (r2) {
|
|
1433
|
+
throw takeObject(r1);
|
|
1434
|
+
}
|
|
1435
|
+
return takeObject(r0);
|
|
1436
|
+
} finally {
|
|
1437
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1438
|
+
}
|
|
1439
|
+
}
|
|
1440
|
+
}
|
|
1441
|
+
|
|
1510
1442
|
const GeneratorClientFinalization =
|
|
1511
1443
|
typeof FinalizationRegistry === "undefined"
|
|
1512
1444
|
? { register: () => {}, unregister: () => {} }
|
|
@@ -2226,6 +2158,74 @@ export class SendError {
|
|
|
2226
2158
|
}
|
|
2227
2159
|
}
|
|
2228
2160
|
|
|
2161
|
+
const TotpClientFinalization =
|
|
2162
|
+
typeof FinalizationRegistry === "undefined"
|
|
2163
|
+
? { register: () => {}, unregister: () => {} }
|
|
2164
|
+
: new FinalizationRegistry((ptr) => wasm.__wbg_totpclient_free(ptr >>> 0, 1));
|
|
2165
|
+
|
|
2166
|
+
export class TotpClient {
|
|
2167
|
+
static __wrap(ptr) {
|
|
2168
|
+
ptr = ptr >>> 0;
|
|
2169
|
+
const obj = Object.create(TotpClient.prototype);
|
|
2170
|
+
obj.__wbg_ptr = ptr;
|
|
2171
|
+
TotpClientFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
2172
|
+
return obj;
|
|
2173
|
+
}
|
|
2174
|
+
|
|
2175
|
+
__destroy_into_raw() {
|
|
2176
|
+
const ptr = this.__wbg_ptr;
|
|
2177
|
+
this.__wbg_ptr = 0;
|
|
2178
|
+
TotpClientFinalization.unregister(this);
|
|
2179
|
+
return ptr;
|
|
2180
|
+
}
|
|
2181
|
+
|
|
2182
|
+
free() {
|
|
2183
|
+
const ptr = this.__destroy_into_raw();
|
|
2184
|
+
wasm.__wbg_totpclient_free(ptr, 0);
|
|
2185
|
+
}
|
|
2186
|
+
/**
|
|
2187
|
+
* Generates a TOTP code from a provided key
|
|
2188
|
+
*
|
|
2189
|
+
* # Arguments
|
|
2190
|
+
* - `key` - Can be:
|
|
2191
|
+
* - A base32 encoded string
|
|
2192
|
+
* - OTP Auth URI
|
|
2193
|
+
* - Steam URI
|
|
2194
|
+
* - `time_ms` - Optional timestamp in milliseconds
|
|
2195
|
+
*
|
|
2196
|
+
* # Returns
|
|
2197
|
+
* - `Ok(TotpResponse)` containing the generated code and period
|
|
2198
|
+
* - `Err(TotpError)` if code generation fails
|
|
2199
|
+
* @param {string} key
|
|
2200
|
+
* @param {number | null} [time_ms]
|
|
2201
|
+
* @returns {TotpResponse}
|
|
2202
|
+
*/
|
|
2203
|
+
generate_totp(key, time_ms) {
|
|
2204
|
+
try {
|
|
2205
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
2206
|
+
const ptr0 = passStringToWasm0(key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2207
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2208
|
+
wasm.totpclient_generate_totp(
|
|
2209
|
+
retptr,
|
|
2210
|
+
this.__wbg_ptr,
|
|
2211
|
+
ptr0,
|
|
2212
|
+
len0,
|
|
2213
|
+
!isLikeNone(time_ms),
|
|
2214
|
+
isLikeNone(time_ms) ? 0 : time_ms,
|
|
2215
|
+
);
|
|
2216
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
2217
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
2218
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
2219
|
+
if (r2) {
|
|
2220
|
+
throw takeObject(r1);
|
|
2221
|
+
}
|
|
2222
|
+
return takeObject(r0);
|
|
2223
|
+
} finally {
|
|
2224
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
2225
|
+
}
|
|
2226
|
+
}
|
|
2227
|
+
}
|
|
2228
|
+
|
|
2229
2229
|
const VaultClientFinalization =
|
|
2230
2230
|
typeof FinalizationRegistry === "undefined"
|
|
2231
2231
|
? { register: () => {}, unregister: () => {} }
|
|
@@ -2252,32 +2252,32 @@ export class VaultClient {
|
|
|
2252
2252
|
wasm.__wbg_vaultclient_free(ptr, 0);
|
|
2253
2253
|
}
|
|
2254
2254
|
/**
|
|
2255
|
-
* @returns {
|
|
2255
|
+
* @returns {AttachmentsClient}
|
|
2256
2256
|
*/
|
|
2257
2257
|
attachments() {
|
|
2258
2258
|
const ret = wasm.vaultclient_attachments(this.__wbg_ptr);
|
|
2259
|
-
return
|
|
2259
|
+
return AttachmentsClient.__wrap(ret);
|
|
2260
2260
|
}
|
|
2261
2261
|
/**
|
|
2262
|
-
* @returns {
|
|
2262
|
+
* @returns {CiphersClient}
|
|
2263
2263
|
*/
|
|
2264
2264
|
ciphers() {
|
|
2265
2265
|
const ret = wasm.vaultclient_attachments(this.__wbg_ptr);
|
|
2266
|
-
return
|
|
2266
|
+
return CiphersClient.__wrap(ret);
|
|
2267
2267
|
}
|
|
2268
2268
|
/**
|
|
2269
|
-
* @returns {
|
|
2269
|
+
* @returns {FoldersClient}
|
|
2270
2270
|
*/
|
|
2271
2271
|
folders() {
|
|
2272
2272
|
const ret = wasm.vaultclient_attachments(this.__wbg_ptr);
|
|
2273
|
-
return
|
|
2273
|
+
return FoldersClient.__wrap(ret);
|
|
2274
2274
|
}
|
|
2275
2275
|
/**
|
|
2276
|
-
* @returns {
|
|
2276
|
+
* @returns {TotpClient}
|
|
2277
2277
|
*/
|
|
2278
2278
|
totp() {
|
|
2279
2279
|
const ret = wasm.vaultclient_totp(this.__wbg_ptr);
|
|
2280
|
-
return
|
|
2280
|
+
return TotpClient.__wrap(ret);
|
|
2281
2281
|
}
|
|
2282
2282
|
}
|
|
2283
2283
|
|
|
Binary file
|
|
@@ -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
|
|
150
|
-
export const
|
|
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
|
|
159
|
-
export const
|
|
160
|
-
export const
|
|
161
|
-
export const
|
|
162
|
-
export const
|
|
163
|
-
export const
|
|
164
|
-
export const
|
|
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
|
|
182
|
-
export const
|
|
183
|
-
export const
|
|
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;
|