@bitwarden/sdk-internal 0.2.0-main.355 → 0.2.0-main.357
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 +80 -0
- package/bitwarden_wasm_internal_bg.js +97 -40
- package/bitwarden_wasm_internal_bg.wasm +0 -0
- package/bitwarden_wasm_internal_bg.wasm.d.ts +5 -0
- package/bitwarden_wasm_internal_bg.wasm.js +1 -1
- package/node/bitwarden_wasm_internal.d.ts +80 -0
- package/node/bitwarden_wasm_internal.js +97 -40
- package/node/bitwarden_wasm_internal_bg.wasm +0 -0
- package/node/bitwarden_wasm_internal_bg.wasm.d.ts +5 -0
- package/package.json +1 -1
package/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
79eb8c45a7779431ab5f512fc4f43f57a591f85e
|
|
@@ -1216,6 +1216,39 @@ export interface DecryptCipherListResult {
|
|
|
1216
1216
|
failures: Cipher[];
|
|
1217
1217
|
}
|
|
1218
1218
|
|
|
1219
|
+
/**
|
|
1220
|
+
* Request to add a cipher.
|
|
1221
|
+
*/
|
|
1222
|
+
export interface CipherCreateRequest {
|
|
1223
|
+
organizationId: OrganizationId | undefined;
|
|
1224
|
+
folderId: FolderId | undefined;
|
|
1225
|
+
name: string;
|
|
1226
|
+
notes: string | undefined;
|
|
1227
|
+
favorite: boolean;
|
|
1228
|
+
reprompt: CipherRepromptType;
|
|
1229
|
+
type: CipherViewType;
|
|
1230
|
+
fields: FieldView[];
|
|
1231
|
+
}
|
|
1232
|
+
|
|
1233
|
+
/**
|
|
1234
|
+
* Request to edit a cipher.
|
|
1235
|
+
*/
|
|
1236
|
+
export interface CipherEditRequest {
|
|
1237
|
+
id: CipherId;
|
|
1238
|
+
organizationId: OrganizationId | undefined;
|
|
1239
|
+
folderId: FolderId | undefined;
|
|
1240
|
+
favorite: boolean;
|
|
1241
|
+
reprompt: CipherRepromptType;
|
|
1242
|
+
name: string;
|
|
1243
|
+
notes: string | undefined;
|
|
1244
|
+
fields: FieldView[];
|
|
1245
|
+
type: CipherViewType;
|
|
1246
|
+
revisionDate: DateTime<Utc>;
|
|
1247
|
+
archivedDate: DateTime<Utc> | undefined;
|
|
1248
|
+
attachments: AttachmentView[];
|
|
1249
|
+
key: EncString | undefined;
|
|
1250
|
+
}
|
|
1251
|
+
|
|
1219
1252
|
export interface Field {
|
|
1220
1253
|
name: EncString | undefined;
|
|
1221
1254
|
value: EncString | undefined;
|
|
@@ -1537,11 +1570,50 @@ export interface Identity {
|
|
|
1537
1570
|
licenseNumber: EncString | undefined;
|
|
1538
1571
|
}
|
|
1539
1572
|
|
|
1573
|
+
/**
|
|
1574
|
+
* Represents the inner data of a cipher view.
|
|
1575
|
+
*/
|
|
1576
|
+
export type CipherViewType =
|
|
1577
|
+
| { login: LoginView }
|
|
1578
|
+
| { card: CardView }
|
|
1579
|
+
| { identity: IdentityView }
|
|
1580
|
+
| { secureNote: SecureNoteView }
|
|
1581
|
+
| { sshKey: SshKeyView };
|
|
1582
|
+
|
|
1540
1583
|
export interface CipherPermissions {
|
|
1541
1584
|
delete: boolean;
|
|
1542
1585
|
restore: boolean;
|
|
1543
1586
|
}
|
|
1544
1587
|
|
|
1588
|
+
export interface GetCipherError extends Error {
|
|
1589
|
+
name: "GetCipherError";
|
|
1590
|
+
variant: "ItemNotFound" | "Crypto" | "RepositoryError";
|
|
1591
|
+
}
|
|
1592
|
+
|
|
1593
|
+
export function isGetCipherError(error: any): error is GetCipherError;
|
|
1594
|
+
|
|
1595
|
+
export interface EditCipherError extends Error {
|
|
1596
|
+
name: "EditCipherError";
|
|
1597
|
+
variant:
|
|
1598
|
+
| "ItemNotFound"
|
|
1599
|
+
| "Crypto"
|
|
1600
|
+
| "Api"
|
|
1601
|
+
| "VaultParse"
|
|
1602
|
+
| "MissingField"
|
|
1603
|
+
| "NotAuthenticated"
|
|
1604
|
+
| "Repository"
|
|
1605
|
+
| "Uuid";
|
|
1606
|
+
}
|
|
1607
|
+
|
|
1608
|
+
export function isEditCipherError(error: any): error is EditCipherError;
|
|
1609
|
+
|
|
1610
|
+
export interface CreateCipherError extends Error {
|
|
1611
|
+
name: "CreateCipherError";
|
|
1612
|
+
variant: "Crypto" | "Api" | "VaultParse" | "MissingField" | "NotAuthenticated" | "Repository";
|
|
1613
|
+
}
|
|
1614
|
+
|
|
1615
|
+
export function isCreateCipherError(error: any): error is CreateCipherError;
|
|
1616
|
+
|
|
1545
1617
|
export interface CipherError extends Error {
|
|
1546
1618
|
name: "CipherError";
|
|
1547
1619
|
variant: "MissingField" | "Crypto" | "Encrypt" | "AttachmentsWithoutKeys";
|
|
@@ -1698,6 +1770,14 @@ export class BitwardenClient {
|
|
|
1698
1770
|
export class CiphersClient {
|
|
1699
1771
|
private constructor();
|
|
1700
1772
|
free(): void;
|
|
1773
|
+
/**
|
|
1774
|
+
* Create a new [Cipher] and save it to the server.
|
|
1775
|
+
*/
|
|
1776
|
+
create(request: CipherCreateRequest): Promise<CipherView>;
|
|
1777
|
+
/**
|
|
1778
|
+
* Edit an existing [Cipher] and save it to the server.
|
|
1779
|
+
*/
|
|
1780
|
+
edit(request: CipherEditRequest): Promise<CipherView>;
|
|
1701
1781
|
encrypt(cipher_view: CipherView): EncryptionContext;
|
|
1702
1782
|
/**
|
|
1703
1783
|
* Encrypt a cipher with the provided key. This should only be used when rotating encryption
|
|
@@ -781,6 +781,45 @@ export function isCreateFolderError(error) {
|
|
|
781
781
|
}
|
|
782
782
|
}
|
|
783
783
|
|
|
784
|
+
/**
|
|
785
|
+
* @param {any} error
|
|
786
|
+
* @returns {boolean}
|
|
787
|
+
*/
|
|
788
|
+
export function isGetCipherError(error) {
|
|
789
|
+
try {
|
|
790
|
+
const ret = wasm.isGetCipherError(addBorrowedObject(error));
|
|
791
|
+
return ret !== 0;
|
|
792
|
+
} finally {
|
|
793
|
+
heap[stack_pointer++] = undefined;
|
|
794
|
+
}
|
|
795
|
+
}
|
|
796
|
+
|
|
797
|
+
/**
|
|
798
|
+
* @param {any} error
|
|
799
|
+
* @returns {boolean}
|
|
800
|
+
*/
|
|
801
|
+
export function isEditCipherError(error) {
|
|
802
|
+
try {
|
|
803
|
+
const ret = wasm.isEditCipherError(addBorrowedObject(error));
|
|
804
|
+
return ret !== 0;
|
|
805
|
+
} finally {
|
|
806
|
+
heap[stack_pointer++] = undefined;
|
|
807
|
+
}
|
|
808
|
+
}
|
|
809
|
+
|
|
810
|
+
/**
|
|
811
|
+
* @param {any} error
|
|
812
|
+
* @returns {boolean}
|
|
813
|
+
*/
|
|
814
|
+
export function isCreateCipherError(error) {
|
|
815
|
+
try {
|
|
816
|
+
const ret = wasm.isCreateCipherError(addBorrowedObject(error));
|
|
817
|
+
return ret !== 0;
|
|
818
|
+
} finally {
|
|
819
|
+
heap[stack_pointer++] = undefined;
|
|
820
|
+
}
|
|
821
|
+
}
|
|
822
|
+
|
|
784
823
|
/**
|
|
785
824
|
* @param {any} error
|
|
786
825
|
* @returns {boolean}
|
|
@@ -854,7 +893,7 @@ function __wbg_adapter_60(arg0, arg1) {
|
|
|
854
893
|
);
|
|
855
894
|
}
|
|
856
895
|
|
|
857
|
-
function
|
|
896
|
+
function __wbg_adapter_346(arg0, arg1, arg2, arg3) {
|
|
858
897
|
wasm.wasm_bindgen__convert__closures__invoke2_mut__h54a8613170fef18e(
|
|
859
898
|
arg0,
|
|
860
899
|
arg1,
|
|
@@ -1304,6 +1343,24 @@ export class CiphersClient {
|
|
|
1304
1343
|
const ptr = this.__destroy_into_raw();
|
|
1305
1344
|
wasm.__wbg_ciphersclient_free(ptr, 0);
|
|
1306
1345
|
}
|
|
1346
|
+
/**
|
|
1347
|
+
* Create a new [Cipher] and save it to the server.
|
|
1348
|
+
* @param {CipherCreateRequest} request
|
|
1349
|
+
* @returns {Promise<CipherView>}
|
|
1350
|
+
*/
|
|
1351
|
+
create(request) {
|
|
1352
|
+
const ret = wasm.ciphersclient_create(this.__wbg_ptr, addHeapObject(request));
|
|
1353
|
+
return takeObject(ret);
|
|
1354
|
+
}
|
|
1355
|
+
/**
|
|
1356
|
+
* Edit an existing [Cipher] and save it to the server.
|
|
1357
|
+
* @param {CipherEditRequest} request
|
|
1358
|
+
* @returns {Promise<CipherView>}
|
|
1359
|
+
*/
|
|
1360
|
+
edit(request) {
|
|
1361
|
+
const ret = wasm.ciphersclient_edit(this.__wbg_ptr, addHeapObject(request));
|
|
1362
|
+
return takeObject(ret);
|
|
1363
|
+
}
|
|
1307
1364
|
/**
|
|
1308
1365
|
* @param {CipherView} cipher_view
|
|
1309
1366
|
* @returns {EncryptionContext}
|
|
@@ -4045,7 +4102,7 @@ export function __wbg_call_7cccdd69e0791ae2() {
|
|
|
4045
4102
|
}, arguments);
|
|
4046
4103
|
}
|
|
4047
4104
|
|
|
4048
|
-
export function
|
|
4105
|
+
export function __wbg_cipher_ad5f3b6bb04610fa(arg0) {
|
|
4049
4106
|
const ret = getObject(arg0).cipher;
|
|
4050
4107
|
return isLikeNone(ret) ? 0 : addHeapObject(ret);
|
|
4051
4108
|
}
|
|
@@ -4125,7 +4182,7 @@ export function __wbg_fetch_509096533071c657(arg0, arg1) {
|
|
|
4125
4182
|
return addHeapObject(ret);
|
|
4126
4183
|
}
|
|
4127
4184
|
|
|
4128
|
-
export function
|
|
4185
|
+
export function __wbg_folder_fe45d0d5415a9f9e(arg0) {
|
|
4129
4186
|
const ret = getObject(arg0).folder;
|
|
4130
4187
|
return isLikeNone(ret) ? 0 : addHeapObject(ret);
|
|
4131
4188
|
}
|
|
@@ -4147,7 +4204,14 @@ export function __wbg_getTime_46267b1c24877e30(arg0) {
|
|
|
4147
4204
|
return ret;
|
|
4148
4205
|
}
|
|
4149
4206
|
|
|
4150
|
-
export function
|
|
4207
|
+
export function __wbg_get_67b2ba62fc30de12() {
|
|
4208
|
+
return handleError(function (arg0, arg1) {
|
|
4209
|
+
const ret = Reflect.get(getObject(arg0), getObject(arg1));
|
|
4210
|
+
return addHeapObject(ret);
|
|
4211
|
+
}, arguments);
|
|
4212
|
+
}
|
|
4213
|
+
|
|
4214
|
+
export function __wbg_get_79939cc8515f356e() {
|
|
4151
4215
|
return handleError(function (arg0, arg1, arg2) {
|
|
4152
4216
|
let deferred0_0;
|
|
4153
4217
|
let deferred0_1;
|
|
@@ -4162,14 +4226,7 @@ export function __wbg_get_1a32d7e5bce672db() {
|
|
|
4162
4226
|
}, arguments);
|
|
4163
4227
|
}
|
|
4164
4228
|
|
|
4165
|
-
export function
|
|
4166
|
-
return handleError(function (arg0, arg1) {
|
|
4167
|
-
const ret = Reflect.get(getObject(arg0), getObject(arg1));
|
|
4168
|
-
return addHeapObject(ret);
|
|
4169
|
-
}, arguments);
|
|
4170
|
-
}
|
|
4171
|
-
|
|
4172
|
-
export function __wbg_get_95966c0b8c5120fa() {
|
|
4229
|
+
export function __wbg_get_7a04f1d1796ff06d() {
|
|
4173
4230
|
return handleError(function (arg0, arg1, arg2) {
|
|
4174
4231
|
let deferred0_0;
|
|
4175
4232
|
let deferred0_1;
|
|
@@ -4189,7 +4246,7 @@ export function __wbg_get_b9b93047fe3cf45b(arg0, arg1) {
|
|
|
4189
4246
|
return addHeapObject(ret);
|
|
4190
4247
|
}
|
|
4191
4248
|
|
|
4192
|
-
export function
|
|
4249
|
+
export function __wbg_getaccesstoken_b794acc90dac6b60(arg0) {
|
|
4193
4250
|
const ret = getObject(arg0).get_access_token();
|
|
4194
4251
|
return addHeapObject(ret);
|
|
4195
4252
|
}
|
|
@@ -4374,14 +4431,14 @@ export function __wbg_length_e2d2a49132c1b256(arg0) {
|
|
|
4374
4431
|
return ret;
|
|
4375
4432
|
}
|
|
4376
4433
|
|
|
4377
|
-
export function
|
|
4434
|
+
export function __wbg_list_1f30dbc316c5c3c5() {
|
|
4378
4435
|
return handleError(function (arg0) {
|
|
4379
4436
|
const ret = getObject(arg0).list();
|
|
4380
4437
|
return addHeapObject(ret);
|
|
4381
4438
|
}, arguments);
|
|
4382
4439
|
}
|
|
4383
4440
|
|
|
4384
|
-
export function
|
|
4441
|
+
export function __wbg_list_889d3170fa6e400f() {
|
|
4385
4442
|
return handleError(function (arg0) {
|
|
4386
4443
|
const ret = getObject(arg0).list();
|
|
4387
4444
|
return addHeapObject(ret);
|
|
@@ -4424,7 +4481,7 @@ export function __wbg_new_23a2665fac83c611(arg0, arg1) {
|
|
|
4424
4481
|
const a = state0.a;
|
|
4425
4482
|
state0.a = 0;
|
|
4426
4483
|
try {
|
|
4427
|
-
return
|
|
4484
|
+
return __wbg_adapter_346(a, state0.b, arg0, arg1);
|
|
4428
4485
|
} finally {
|
|
4429
4486
|
state0.a = a;
|
|
4430
4487
|
}
|
|
@@ -4582,7 +4639,7 @@ export function __wbg_randomFillSync_ac0988aba3254290() {
|
|
|
4582
4639
|
}, arguments);
|
|
4583
4640
|
}
|
|
4584
4641
|
|
|
4585
|
-
export function
|
|
4642
|
+
export function __wbg_remove_90e28d8cbc432942() {
|
|
4586
4643
|
return handleError(function (arg0, arg1, arg2) {
|
|
4587
4644
|
let deferred0_0;
|
|
4588
4645
|
let deferred0_1;
|
|
@@ -4597,7 +4654,7 @@ export function __wbg_remove_57318891e6971364() {
|
|
|
4597
4654
|
}, arguments);
|
|
4598
4655
|
}
|
|
4599
4656
|
|
|
4600
|
-
export function
|
|
4657
|
+
export function __wbg_remove_9e8327ed96cfffc0() {
|
|
4601
4658
|
return handleError(function (arg0, arg1, arg2) {
|
|
4602
4659
|
let deferred0_0;
|
|
4603
4660
|
let deferred0_1;
|
|
@@ -4643,21 +4700,6 @@ export function __wbg_setTimeout_ca12ead8b48245e2(arg0, arg1) {
|
|
|
4643
4700
|
return addHeapObject(ret);
|
|
4644
4701
|
}
|
|
4645
4702
|
|
|
4646
|
-
export function __wbg_set_31d625172b354afb() {
|
|
4647
|
-
return handleError(function (arg0, arg1, arg2, arg3) {
|
|
4648
|
-
let deferred0_0;
|
|
4649
|
-
let deferred0_1;
|
|
4650
|
-
try {
|
|
4651
|
-
deferred0_0 = arg1;
|
|
4652
|
-
deferred0_1 = arg2;
|
|
4653
|
-
const ret = getObject(arg0).set(getStringFromWasm0(arg1, arg2), takeObject(arg3));
|
|
4654
|
-
return addHeapObject(ret);
|
|
4655
|
-
} finally {
|
|
4656
|
-
wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
|
|
4657
|
-
}
|
|
4658
|
-
}, arguments);
|
|
4659
|
-
}
|
|
4660
|
-
|
|
4661
4703
|
export function __wbg_set_37837023f3d740e8(arg0, arg1, arg2) {
|
|
4662
4704
|
getObject(arg0)[arg1 >>> 0] = takeObject(arg2);
|
|
4663
4705
|
}
|
|
@@ -4675,7 +4717,22 @@ export function __wbg_set_8fc6bf8a5b1071d1(arg0, arg1, arg2) {
|
|
|
4675
4717
|
return addHeapObject(ret);
|
|
4676
4718
|
}
|
|
4677
4719
|
|
|
4678
|
-
export function
|
|
4720
|
+
export function __wbg_set_99cc420d698f28b3() {
|
|
4721
|
+
return handleError(function (arg0, arg1, arg2, arg3) {
|
|
4722
|
+
let deferred0_0;
|
|
4723
|
+
let deferred0_1;
|
|
4724
|
+
try {
|
|
4725
|
+
deferred0_0 = arg1;
|
|
4726
|
+
deferred0_1 = arg2;
|
|
4727
|
+
const ret = getObject(arg0).set(getStringFromWasm0(arg1, arg2), takeObject(arg3));
|
|
4728
|
+
return addHeapObject(ret);
|
|
4729
|
+
} finally {
|
|
4730
|
+
wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
|
|
4731
|
+
}
|
|
4732
|
+
}, arguments);
|
|
4733
|
+
}
|
|
4734
|
+
|
|
4735
|
+
export function __wbg_set_bfff21c6495ef228() {
|
|
4679
4736
|
return handleError(function (arg0, arg1, arg2, arg3) {
|
|
4680
4737
|
let deferred0_0;
|
|
4681
4738
|
let deferred0_1;
|
|
@@ -4910,18 +4967,18 @@ export function __wbindgen_closure_wrapper195(arg0, arg1, arg2) {
|
|
|
4910
4967
|
return addHeapObject(ret);
|
|
4911
4968
|
}
|
|
4912
4969
|
|
|
4913
|
-
export function
|
|
4914
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
4970
|
+
export function __wbindgen_closure_wrapper3934(arg0, arg1, arg2) {
|
|
4971
|
+
const ret = makeMutClosure(arg0, arg1, 299, __wbg_adapter_60);
|
|
4915
4972
|
return addHeapObject(ret);
|
|
4916
4973
|
}
|
|
4917
4974
|
|
|
4918
|
-
export function
|
|
4919
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
4975
|
+
export function __wbindgen_closure_wrapper6408(arg0, arg1, arg2) {
|
|
4976
|
+
const ret = makeMutClosure(arg0, arg1, 325, __wbg_adapter_60);
|
|
4920
4977
|
return addHeapObject(ret);
|
|
4921
4978
|
}
|
|
4922
4979
|
|
|
4923
|
-
export function
|
|
4924
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
4980
|
+
export function __wbindgen_closure_wrapper6788(arg0, arg1, arg2) {
|
|
4981
|
+
const ret = makeMutClosure(arg0, arg1, 348, __wbg_adapter_54);
|
|
4925
4982
|
return addHeapObject(ret);
|
|
4926
4983
|
}
|
|
4927
4984
|
|
|
Binary file
|
|
@@ -317,6 +317,8 @@ export const attachmentsclient_decrypt_buffer: (
|
|
|
317
317
|
e: number,
|
|
318
318
|
f: number,
|
|
319
319
|
) => void;
|
|
320
|
+
export const ciphersclient_create: (a: number, b: number) => number;
|
|
321
|
+
export const ciphersclient_edit: (a: number, b: number) => number;
|
|
320
322
|
export const ciphersclient_encrypt: (a: number, b: number, c: number) => void;
|
|
321
323
|
export const ciphersclient_encrypt_cipher_for_rotation: (
|
|
322
324
|
a: number,
|
|
@@ -376,6 +378,9 @@ export const isTotpError: (a: number) => number;
|
|
|
376
378
|
export const isGetFolderError: (a: number) => number;
|
|
377
379
|
export const isEditFolderError: (a: number) => number;
|
|
378
380
|
export const isCreateFolderError: (a: number) => number;
|
|
381
|
+
export const isGetCipherError: (a: number) => number;
|
|
382
|
+
export const isEditCipherError: (a: number) => number;
|
|
383
|
+
export const isCreateCipherError: (a: number) => number;
|
|
379
384
|
export const isCipherError: (a: number) => number;
|
|
380
385
|
export const isDecryptFileError: (a: number) => number;
|
|
381
386
|
export const isEncryptFileError: (a: number) => number;
|