@bitwarden/sdk-internal 0.2.0-main.145 → 0.2.0-main.147
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 +73 -5
- package/bitwarden_wasm_internal_bg.js +237 -30
- package/bitwarden_wasm_internal_bg.wasm +0 -0
- package/bitwarden_wasm_internal_bg.wasm.d.ts +33 -4
- package/bitwarden_wasm_internal_bg.wasm.js +1 -1
- package/node/bitwarden_wasm_internal.d.ts +73 -5
- package/node/bitwarden_wasm_internal.js +238 -30
- package/node/bitwarden_wasm_internal_bg.wasm +0 -0
- package/node/bitwarden_wasm_internal_bg.wasm.d.ts +33 -4
- package/package.json +1 -1
package/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
0b97bdd5c5ea7be61625c0ed8cfbfc2283f6076f
|
|
@@ -131,7 +131,7 @@ export type InitUserCryptoMethod =
|
|
|
131
131
|
deviceKey: {
|
|
132
132
|
device_key: string;
|
|
133
133
|
protected_device_private_key: EncString;
|
|
134
|
-
device_protected_user_key:
|
|
134
|
+
device_protected_user_key: UnsignedSharedKey;
|
|
135
135
|
};
|
|
136
136
|
}
|
|
137
137
|
| { keyConnector: { master_key: string; user_key: string } };
|
|
@@ -140,8 +140,8 @@ export type InitUserCryptoMethod =
|
|
|
140
140
|
* Auth requests supports multiple initialization methods.
|
|
141
141
|
*/
|
|
142
142
|
export type AuthRequestMethod =
|
|
143
|
-
| { userKey: { protected_user_key:
|
|
144
|
-
| { masterKey: { protected_master_key:
|
|
143
|
+
| { userKey: { protected_user_key: UnsignedSharedKey } }
|
|
144
|
+
| { masterKey: { protected_master_key: UnsignedSharedKey; auth_request_key: EncString } };
|
|
145
145
|
|
|
146
146
|
/**
|
|
147
147
|
* Represents the request to initialize the user\'s organizational cryptographic state.
|
|
@@ -150,7 +150,7 @@ export interface InitOrgCryptoRequest {
|
|
|
150
150
|
/**
|
|
151
151
|
* The encryption keys for all the organizations the user is a part of
|
|
152
152
|
*/
|
|
153
|
-
organizationKeys: Map<Uuid,
|
|
153
|
+
organizationKeys: Map<Uuid, UnsignedSharedKey>;
|
|
154
154
|
}
|
|
155
155
|
|
|
156
156
|
/**
|
|
@@ -270,7 +270,7 @@ export interface ClientSettings {
|
|
|
270
270
|
deviceType?: DeviceType;
|
|
271
271
|
}
|
|
272
272
|
|
|
273
|
-
export type
|
|
273
|
+
export type UnsignedSharedKey = string;
|
|
274
274
|
|
|
275
275
|
export type EncString = string;
|
|
276
276
|
|
|
@@ -309,6 +309,35 @@ export interface CryptoError extends Error {
|
|
|
309
309
|
|
|
310
310
|
export function isCryptoError(error: any): error is CryptoError;
|
|
311
311
|
|
|
312
|
+
/**
|
|
313
|
+
* Temporary struct to hold metadata related to current account
|
|
314
|
+
*
|
|
315
|
+
* Eventually the SDK itself should have this state and we get rid of this struct.
|
|
316
|
+
*/
|
|
317
|
+
export interface Account {
|
|
318
|
+
id: Uuid;
|
|
319
|
+
email: string;
|
|
320
|
+
name: string | undefined;
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
export type ExportFormat = "Csv" | "Json" | { EncryptedJson: { password: string } };
|
|
324
|
+
|
|
325
|
+
export interface ExportError extends Error {
|
|
326
|
+
name: "ExportError";
|
|
327
|
+
variant:
|
|
328
|
+
| "MissingField"
|
|
329
|
+
| "NotAuthenticated"
|
|
330
|
+
| "VaultLocked"
|
|
331
|
+
| "Csv"
|
|
332
|
+
| "CxfError"
|
|
333
|
+
| "Json"
|
|
334
|
+
| "EncryptedJsonError"
|
|
335
|
+
| "BitwardenCryptoError"
|
|
336
|
+
| "CipherError";
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
export function isExportError(error: any): error is ExportError;
|
|
340
|
+
|
|
312
341
|
/**
|
|
313
342
|
* Password generator request options.
|
|
314
343
|
*/
|
|
@@ -714,6 +743,16 @@ export interface PasswordHistory {
|
|
|
714
743
|
lastUsedDate: DateTime<Utc>;
|
|
715
744
|
}
|
|
716
745
|
|
|
746
|
+
export interface Collection {
|
|
747
|
+
id: Uuid | undefined;
|
|
748
|
+
organizationId: Uuid;
|
|
749
|
+
name: EncString;
|
|
750
|
+
externalId: string | undefined;
|
|
751
|
+
hidePasswords: boolean;
|
|
752
|
+
readOnly: boolean;
|
|
753
|
+
manage: boolean;
|
|
754
|
+
}
|
|
755
|
+
|
|
717
756
|
export interface SshKeyView {
|
|
718
757
|
/**
|
|
719
758
|
* SSH private key (ed25519/rsa) in unencrypted openssh private key format [OpenSSH private key](https://github.com/openssh/openssh-portable/blob/master/PROTOCOL.key)
|
|
@@ -904,6 +943,7 @@ export class BitwardenClient {
|
|
|
904
943
|
* Constructs a specific client for generating passwords and passphrases
|
|
905
944
|
*/
|
|
906
945
|
generator(): GeneratorClient;
|
|
946
|
+
exporters(): ExporterClient;
|
|
907
947
|
}
|
|
908
948
|
export class ClientAttachments {
|
|
909
949
|
private constructor();
|
|
@@ -1027,6 +1067,34 @@ export class CryptoClient {
|
|
|
1027
1067
|
*/
|
|
1028
1068
|
verify_asymmetric_keys(request: VerifyAsymmetricKeysRequest): VerifyAsymmetricKeysResponse;
|
|
1029
1069
|
}
|
|
1070
|
+
export class ExporterClient {
|
|
1071
|
+
private constructor();
|
|
1072
|
+
free(): void;
|
|
1073
|
+
export_vault(folders: Folder[], ciphers: Cipher[], format: ExportFormat): string;
|
|
1074
|
+
export_organization_vault(
|
|
1075
|
+
collections: Collection[],
|
|
1076
|
+
ciphers: Cipher[],
|
|
1077
|
+
format: ExportFormat,
|
|
1078
|
+
): string;
|
|
1079
|
+
/**
|
|
1080
|
+
* Credential Exchange Format (CXF)
|
|
1081
|
+
*
|
|
1082
|
+
* *Warning:* Expect this API to be unstable, and it will change in the future.
|
|
1083
|
+
*
|
|
1084
|
+
* For use with Apple using [ASCredentialExportManager](https://developer.apple.com/documentation/authenticationservices/ascredentialexportmanager).
|
|
1085
|
+
* Ideally the input should be immediately serialized from [ASImportableAccount](https://developer.apple.com/documentation/authenticationservices/asimportableaccount).
|
|
1086
|
+
*/
|
|
1087
|
+
export_cxf(account: Account, ciphers: Cipher[]): string;
|
|
1088
|
+
/**
|
|
1089
|
+
* Credential Exchange Format (CXF)
|
|
1090
|
+
*
|
|
1091
|
+
* *Warning:* Expect this API to be unstable, and it will change in the future.
|
|
1092
|
+
*
|
|
1093
|
+
* For use with Apple using [ASCredentialExportManager](https://developer.apple.com/documentation/authenticationservices/ascredentialexportmanager).
|
|
1094
|
+
* Ideally the input should be immediately serialized from [ASImportableAccount](https://developer.apple.com/documentation/authenticationservices/asimportableaccount).
|
|
1095
|
+
*/
|
|
1096
|
+
import_cxf(payload: string): Cipher[];
|
|
1097
|
+
}
|
|
1030
1098
|
export class GeneratorClient {
|
|
1031
1099
|
private constructor();
|
|
1032
1100
|
free(): void;
|
|
@@ -126,6 +126,11 @@ function handleError(f, args) {
|
|
|
126
126
|
}
|
|
127
127
|
}
|
|
128
128
|
|
|
129
|
+
function getArrayU8FromWasm0(ptr, len) {
|
|
130
|
+
ptr = ptr >>> 0;
|
|
131
|
+
return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
|
|
132
|
+
}
|
|
133
|
+
|
|
129
134
|
function dropObject(idx) {
|
|
130
135
|
if (idx < 132) return;
|
|
131
136
|
heap[idx] = heap_next;
|
|
@@ -272,6 +277,38 @@ export function isCryptoError(error) {
|
|
|
272
277
|
}
|
|
273
278
|
}
|
|
274
279
|
|
|
280
|
+
function passArrayJsValueToWasm0(array, malloc) {
|
|
281
|
+
const ptr = malloc(array.length * 4, 4) >>> 0;
|
|
282
|
+
const mem = getDataViewMemory0();
|
|
283
|
+
for (let i = 0; i < array.length; i++) {
|
|
284
|
+
mem.setUint32(ptr + 4 * i, addHeapObject(array[i]), true);
|
|
285
|
+
}
|
|
286
|
+
WASM_VECTOR_LEN = array.length;
|
|
287
|
+
return ptr;
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
function getArrayJsValueFromWasm0(ptr, len) {
|
|
291
|
+
ptr = ptr >>> 0;
|
|
292
|
+
const mem = getDataViewMemory0();
|
|
293
|
+
const result = [];
|
|
294
|
+
for (let i = ptr; i < ptr + 4 * len; i += 4) {
|
|
295
|
+
result.push(takeObject(mem.getUint32(i, true)));
|
|
296
|
+
}
|
|
297
|
+
return result;
|
|
298
|
+
}
|
|
299
|
+
/**
|
|
300
|
+
* @param {any} error
|
|
301
|
+
* @returns {boolean}
|
|
302
|
+
*/
|
|
303
|
+
export function isExportError(error) {
|
|
304
|
+
try {
|
|
305
|
+
const ret = wasm.isExportError(addBorrowedObject(error));
|
|
306
|
+
return ret !== 0;
|
|
307
|
+
} finally {
|
|
308
|
+
heap[stack_pointer++] = undefined;
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
|
|
275
312
|
/**
|
|
276
313
|
* @param {any} error
|
|
277
314
|
* @returns {boolean}
|
|
@@ -298,11 +335,6 @@ export function isPassphraseError(error) {
|
|
|
298
335
|
}
|
|
299
336
|
}
|
|
300
337
|
|
|
301
|
-
function getArrayU8FromWasm0(ptr, len) {
|
|
302
|
-
ptr = ptr >>> 0;
|
|
303
|
-
return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
|
|
304
|
-
}
|
|
305
|
-
|
|
306
338
|
function passArray8ToWasm0(arg, malloc) {
|
|
307
339
|
const ptr = malloc(arg.length * 1, 1) >>> 0;
|
|
308
340
|
getUint8ArrayMemory0().set(arg, ptr / 1);
|
|
@@ -527,25 +559,6 @@ export function import_ssh_key(imported_key, password) {
|
|
|
527
559
|
}
|
|
528
560
|
}
|
|
529
561
|
|
|
530
|
-
function passArrayJsValueToWasm0(array, malloc) {
|
|
531
|
-
const ptr = malloc(array.length * 4, 4) >>> 0;
|
|
532
|
-
const mem = getDataViewMemory0();
|
|
533
|
-
for (let i = 0; i < array.length; i++) {
|
|
534
|
-
mem.setUint32(ptr + 4 * i, addHeapObject(array[i]), true);
|
|
535
|
-
}
|
|
536
|
-
WASM_VECTOR_LEN = array.length;
|
|
537
|
-
return ptr;
|
|
538
|
-
}
|
|
539
|
-
|
|
540
|
-
function getArrayJsValueFromWasm0(ptr, len) {
|
|
541
|
-
ptr = ptr >>> 0;
|
|
542
|
-
const mem = getDataViewMemory0();
|
|
543
|
-
const result = [];
|
|
544
|
-
for (let i = ptr; i < ptr + 4 * len; i += 4) {
|
|
545
|
-
result.push(takeObject(mem.getUint32(i, true)));
|
|
546
|
-
}
|
|
547
|
-
return result;
|
|
548
|
-
}
|
|
549
562
|
/**
|
|
550
563
|
* @param {any} error
|
|
551
564
|
* @returns {boolean}
|
|
@@ -560,15 +573,15 @@ export function isTestError(error) {
|
|
|
560
573
|
}
|
|
561
574
|
|
|
562
575
|
function __wbg_adapter_50(arg0, arg1, arg2) {
|
|
563
|
-
wasm.
|
|
576
|
+
wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h365c00e76c805d42(
|
|
564
577
|
arg0,
|
|
565
578
|
arg1,
|
|
566
579
|
addHeapObject(arg2),
|
|
567
580
|
);
|
|
568
581
|
}
|
|
569
582
|
|
|
570
|
-
function
|
|
571
|
-
wasm.
|
|
583
|
+
function __wbg_adapter_230(arg0, arg1, arg2, arg3) {
|
|
584
|
+
wasm.wasm_bindgen__convert__closures__invoke2_mut__h7df9ebaef0b1c102(
|
|
572
585
|
arg0,
|
|
573
586
|
arg1,
|
|
574
587
|
addHeapObject(arg2),
|
|
@@ -845,6 +858,13 @@ export class BitwardenClient {
|
|
|
845
858
|
const ret = wasm.bitwardenclient_generator(this.__wbg_ptr);
|
|
846
859
|
return GeneratorClient.__wrap(ret);
|
|
847
860
|
}
|
|
861
|
+
/**
|
|
862
|
+
* @returns {ExporterClient}
|
|
863
|
+
*/
|
|
864
|
+
exporters() {
|
|
865
|
+
const ret = wasm.bitwardenclient_crypto(this.__wbg_ptr);
|
|
866
|
+
return ExporterClient.__wrap(ret);
|
|
867
|
+
}
|
|
848
868
|
}
|
|
849
869
|
|
|
850
870
|
const ClientAttachmentsFinalization =
|
|
@@ -1306,6 +1326,187 @@ export class CryptoClient {
|
|
|
1306
1326
|
}
|
|
1307
1327
|
}
|
|
1308
1328
|
|
|
1329
|
+
const ExporterClientFinalization =
|
|
1330
|
+
typeof FinalizationRegistry === "undefined"
|
|
1331
|
+
? { register: () => {}, unregister: () => {} }
|
|
1332
|
+
: new FinalizationRegistry((ptr) => wasm.__wbg_exporterclient_free(ptr >>> 0, 1));
|
|
1333
|
+
|
|
1334
|
+
export class ExporterClient {
|
|
1335
|
+
static __wrap(ptr) {
|
|
1336
|
+
ptr = ptr >>> 0;
|
|
1337
|
+
const obj = Object.create(ExporterClient.prototype);
|
|
1338
|
+
obj.__wbg_ptr = ptr;
|
|
1339
|
+
ExporterClientFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
1340
|
+
return obj;
|
|
1341
|
+
}
|
|
1342
|
+
|
|
1343
|
+
__destroy_into_raw() {
|
|
1344
|
+
const ptr = this.__wbg_ptr;
|
|
1345
|
+
this.__wbg_ptr = 0;
|
|
1346
|
+
ExporterClientFinalization.unregister(this);
|
|
1347
|
+
return ptr;
|
|
1348
|
+
}
|
|
1349
|
+
|
|
1350
|
+
free() {
|
|
1351
|
+
const ptr = this.__destroy_into_raw();
|
|
1352
|
+
wasm.__wbg_exporterclient_free(ptr, 0);
|
|
1353
|
+
}
|
|
1354
|
+
/**
|
|
1355
|
+
* @param {Folder[]} folders
|
|
1356
|
+
* @param {Cipher[]} ciphers
|
|
1357
|
+
* @param {ExportFormat} format
|
|
1358
|
+
* @returns {string}
|
|
1359
|
+
*/
|
|
1360
|
+
export_vault(folders, ciphers, format) {
|
|
1361
|
+
let deferred4_0;
|
|
1362
|
+
let deferred4_1;
|
|
1363
|
+
try {
|
|
1364
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1365
|
+
const ptr0 = passArrayJsValueToWasm0(folders, wasm.__wbindgen_malloc);
|
|
1366
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1367
|
+
const ptr1 = passArrayJsValueToWasm0(ciphers, wasm.__wbindgen_malloc);
|
|
1368
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1369
|
+
wasm.exporterclient_export_vault(
|
|
1370
|
+
retptr,
|
|
1371
|
+
this.__wbg_ptr,
|
|
1372
|
+
ptr0,
|
|
1373
|
+
len0,
|
|
1374
|
+
ptr1,
|
|
1375
|
+
len1,
|
|
1376
|
+
addHeapObject(format),
|
|
1377
|
+
);
|
|
1378
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1379
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1380
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1381
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
1382
|
+
var ptr3 = r0;
|
|
1383
|
+
var len3 = r1;
|
|
1384
|
+
if (r3) {
|
|
1385
|
+
ptr3 = 0;
|
|
1386
|
+
len3 = 0;
|
|
1387
|
+
throw takeObject(r2);
|
|
1388
|
+
}
|
|
1389
|
+
deferred4_0 = ptr3;
|
|
1390
|
+
deferred4_1 = len3;
|
|
1391
|
+
return getStringFromWasm0(ptr3, len3);
|
|
1392
|
+
} finally {
|
|
1393
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1394
|
+
wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
|
|
1395
|
+
}
|
|
1396
|
+
}
|
|
1397
|
+
/**
|
|
1398
|
+
* @param {Collection[]} collections
|
|
1399
|
+
* @param {Cipher[]} ciphers
|
|
1400
|
+
* @param {ExportFormat} format
|
|
1401
|
+
* @returns {string}
|
|
1402
|
+
*/
|
|
1403
|
+
export_organization_vault(collections, ciphers, format) {
|
|
1404
|
+
let deferred4_0;
|
|
1405
|
+
let deferred4_1;
|
|
1406
|
+
try {
|
|
1407
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1408
|
+
const ptr0 = passArrayJsValueToWasm0(collections, wasm.__wbindgen_malloc);
|
|
1409
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1410
|
+
const ptr1 = passArrayJsValueToWasm0(ciphers, wasm.__wbindgen_malloc);
|
|
1411
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1412
|
+
wasm.exporterclient_export_organization_vault(
|
|
1413
|
+
retptr,
|
|
1414
|
+
this.__wbg_ptr,
|
|
1415
|
+
ptr0,
|
|
1416
|
+
len0,
|
|
1417
|
+
ptr1,
|
|
1418
|
+
len1,
|
|
1419
|
+
addHeapObject(format),
|
|
1420
|
+
);
|
|
1421
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1422
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1423
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1424
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
1425
|
+
var ptr3 = r0;
|
|
1426
|
+
var len3 = r1;
|
|
1427
|
+
if (r3) {
|
|
1428
|
+
ptr3 = 0;
|
|
1429
|
+
len3 = 0;
|
|
1430
|
+
throw takeObject(r2);
|
|
1431
|
+
}
|
|
1432
|
+
deferred4_0 = ptr3;
|
|
1433
|
+
deferred4_1 = len3;
|
|
1434
|
+
return getStringFromWasm0(ptr3, len3);
|
|
1435
|
+
} finally {
|
|
1436
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1437
|
+
wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
|
|
1438
|
+
}
|
|
1439
|
+
}
|
|
1440
|
+
/**
|
|
1441
|
+
* Credential Exchange Format (CXF)
|
|
1442
|
+
*
|
|
1443
|
+
* *Warning:* Expect this API to be unstable, and it will change in the future.
|
|
1444
|
+
*
|
|
1445
|
+
* For use with Apple using [ASCredentialExportManager](https://developer.apple.com/documentation/authenticationservices/ascredentialexportmanager).
|
|
1446
|
+
* Ideally the input should be immediately serialized from [ASImportableAccount](https://developer.apple.com/documentation/authenticationservices/asimportableaccount).
|
|
1447
|
+
* @param {Account} account
|
|
1448
|
+
* @param {Cipher[]} ciphers
|
|
1449
|
+
* @returns {string}
|
|
1450
|
+
*/
|
|
1451
|
+
export_cxf(account, ciphers) {
|
|
1452
|
+
let deferred3_0;
|
|
1453
|
+
let deferred3_1;
|
|
1454
|
+
try {
|
|
1455
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1456
|
+
const ptr0 = passArrayJsValueToWasm0(ciphers, wasm.__wbindgen_malloc);
|
|
1457
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1458
|
+
wasm.exporterclient_export_cxf(retptr, this.__wbg_ptr, addHeapObject(account), ptr0, len0);
|
|
1459
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1460
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1461
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1462
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
1463
|
+
var ptr2 = r0;
|
|
1464
|
+
var len2 = r1;
|
|
1465
|
+
if (r3) {
|
|
1466
|
+
ptr2 = 0;
|
|
1467
|
+
len2 = 0;
|
|
1468
|
+
throw takeObject(r2);
|
|
1469
|
+
}
|
|
1470
|
+
deferred3_0 = ptr2;
|
|
1471
|
+
deferred3_1 = len2;
|
|
1472
|
+
return getStringFromWasm0(ptr2, len2);
|
|
1473
|
+
} finally {
|
|
1474
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1475
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
1476
|
+
}
|
|
1477
|
+
}
|
|
1478
|
+
/**
|
|
1479
|
+
* Credential Exchange Format (CXF)
|
|
1480
|
+
*
|
|
1481
|
+
* *Warning:* Expect this API to be unstable, and it will change in the future.
|
|
1482
|
+
*
|
|
1483
|
+
* For use with Apple using [ASCredentialExportManager](https://developer.apple.com/documentation/authenticationservices/ascredentialexportmanager).
|
|
1484
|
+
* Ideally the input should be immediately serialized from [ASImportableAccount](https://developer.apple.com/documentation/authenticationservices/asimportableaccount).
|
|
1485
|
+
* @param {string} payload
|
|
1486
|
+
* @returns {Cipher[]}
|
|
1487
|
+
*/
|
|
1488
|
+
import_cxf(payload) {
|
|
1489
|
+
try {
|
|
1490
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1491
|
+
const ptr0 = passStringToWasm0(payload, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1492
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1493
|
+
wasm.exporterclient_import_cxf(retptr, this.__wbg_ptr, ptr0, len0);
|
|
1494
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1495
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1496
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1497
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
1498
|
+
if (r3) {
|
|
1499
|
+
throw takeObject(r2);
|
|
1500
|
+
}
|
|
1501
|
+
var v2 = getArrayJsValueFromWasm0(r0, r1).slice();
|
|
1502
|
+
wasm.__wbindgen_free(r0, r1 * 4, 4);
|
|
1503
|
+
return v2;
|
|
1504
|
+
} finally {
|
|
1505
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1506
|
+
}
|
|
1507
|
+
}
|
|
1508
|
+
}
|
|
1509
|
+
|
|
1309
1510
|
const GeneratorClientFinalization =
|
|
1310
1511
|
typeof FinalizationRegistry === "undefined"
|
|
1311
1512
|
? { register: () => {}, unregister: () => {} }
|
|
@@ -2184,6 +2385,12 @@ export function __wbg_fetch_509096533071c657(arg0, arg1) {
|
|
|
2184
2385
|
return addHeapObject(ret);
|
|
2185
2386
|
}
|
|
2186
2387
|
|
|
2388
|
+
export function __wbg_getRandomValues_7dd14472e5bb087d() {
|
|
2389
|
+
return handleError(function (arg0, arg1) {
|
|
2390
|
+
globalThis.crypto.getRandomValues(getArrayU8FromWasm0(arg0, arg1));
|
|
2391
|
+
}, arguments);
|
|
2392
|
+
}
|
|
2393
|
+
|
|
2187
2394
|
export function __wbg_getRandomValues_bcb4912f16000dc4() {
|
|
2188
2395
|
return handleError(function (arg0, arg1) {
|
|
2189
2396
|
getObject(arg0).getRandomValues(getObject(arg1));
|
|
@@ -2330,7 +2537,7 @@ export function __wbg_new_23a2665fac83c611(arg0, arg1) {
|
|
|
2330
2537
|
const a = state0.a;
|
|
2331
2538
|
state0.a = 0;
|
|
2332
2539
|
try {
|
|
2333
|
-
return
|
|
2540
|
+
return __wbg_adapter_230(a, state0.b, arg0, arg1);
|
|
2334
2541
|
} finally {
|
|
2335
2542
|
state0.a = a;
|
|
2336
2543
|
}
|
|
@@ -2699,8 +2906,8 @@ export function __wbindgen_cb_drop(arg0) {
|
|
|
2699
2906
|
return ret;
|
|
2700
2907
|
}
|
|
2701
2908
|
|
|
2702
|
-
export function
|
|
2703
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
2909
|
+
export function __wbindgen_closure_wrapper3216(arg0, arg1, arg2) {
|
|
2910
|
+
const ret = makeMutClosure(arg0, arg1, 772, __wbg_adapter_50);
|
|
2704
2911
|
return addHeapObject(ret);
|
|
2705
2912
|
}
|
|
2706
2913
|
|
|
Binary file
|
|
@@ -3,6 +3,34 @@
|
|
|
3
3
|
export const memory: WebAssembly.Memory;
|
|
4
4
|
export const isEncryptionSettingsError: (a: number) => number;
|
|
5
5
|
export const isCryptoError: (a: number) => number;
|
|
6
|
+
export const __wbg_exporterclient_free: (a: number, b: number) => void;
|
|
7
|
+
export const exporterclient_export_vault: (
|
|
8
|
+
a: number,
|
|
9
|
+
b: number,
|
|
10
|
+
c: number,
|
|
11
|
+
d: number,
|
|
12
|
+
e: number,
|
|
13
|
+
f: number,
|
|
14
|
+
g: number,
|
|
15
|
+
) => void;
|
|
16
|
+
export const exporterclient_export_organization_vault: (
|
|
17
|
+
a: number,
|
|
18
|
+
b: number,
|
|
19
|
+
c: number,
|
|
20
|
+
d: number,
|
|
21
|
+
e: number,
|
|
22
|
+
f: number,
|
|
23
|
+
g: number,
|
|
24
|
+
) => void;
|
|
25
|
+
export const exporterclient_export_cxf: (
|
|
26
|
+
a: number,
|
|
27
|
+
b: number,
|
|
28
|
+
c: number,
|
|
29
|
+
d: number,
|
|
30
|
+
e: number,
|
|
31
|
+
) => void;
|
|
32
|
+
export const exporterclient_import_cxf: (a: number, b: number, c: number, d: number) => void;
|
|
33
|
+
export const isExportError: (a: number) => number;
|
|
6
34
|
export const isPasswordError: (a: number) => number;
|
|
7
35
|
export const isPassphraseError: (a: number) => number;
|
|
8
36
|
export const __wbg_outgoingmessage_free: (a: number, b: number) => void;
|
|
@@ -145,26 +173,27 @@ export const vaultclient_attachments: (a: number) => number;
|
|
|
145
173
|
export const vaultclient_totp: (a: number) => number;
|
|
146
174
|
export const isTestError: (a: number) => number;
|
|
147
175
|
export const bitwardenclient_vault: (a: number) => number;
|
|
176
|
+
export const bitwardenclient_exporters: (a: number) => number;
|
|
148
177
|
export const vaultclient_ciphers: (a: number) => number;
|
|
149
178
|
export const vaultclient_folders: (a: number) => number;
|
|
150
179
|
export const __wbg_generatorclient_free: (a: number, b: number) => void;
|
|
151
180
|
export const __wbg_vaultclient_free: (a: number, b: number) => void;
|
|
152
181
|
export const __wbg_clienttotp_free: (a: number, b: number) => void;
|
|
153
|
-
export const __wbg_cryptoclient_free: (a: number, b: number) => void;
|
|
154
|
-
export const __wbg_clientciphers_free: (a: number, b: number) => void;
|
|
155
182
|
export const __wbg_clientfolders_free: (a: number, b: number) => void;
|
|
183
|
+
export const __wbg_clientciphers_free: (a: number, b: number) => void;
|
|
184
|
+
export const __wbg_cryptoclient_free: (a: number, b: number) => void;
|
|
156
185
|
export const __wbindgen_malloc: (a: number, b: number) => number;
|
|
157
186
|
export const __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|
|
158
187
|
export const __wbindgen_exn_store: (a: number) => void;
|
|
159
188
|
export const __wbindgen_free: (a: number, b: number, c: number) => void;
|
|
160
189
|
export const __wbindgen_export_4: WebAssembly.Table;
|
|
161
190
|
export const __wbindgen_add_to_stack_pointer: (a: number) => number;
|
|
162
|
-
export const
|
|
191
|
+
export const _dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h365c00e76c805d42: (
|
|
163
192
|
a: number,
|
|
164
193
|
b: number,
|
|
165
194
|
c: number,
|
|
166
195
|
) => void;
|
|
167
|
-
export const
|
|
196
|
+
export const wasm_bindgen__convert__closures__invoke2_mut__h7df9ebaef0b1c102: (
|
|
168
197
|
a: number,
|
|
169
198
|
b: number,
|
|
170
199
|
c: number,
|