@bitwarden/sdk-internal 0.2.0-main.265 → 0.2.0-main.266

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.
@@ -135,10 +135,7 @@ import { Tagged } from "type-fest";
135
135
  *
136
136
  * Never create or cast to this type directly, use the `uuid<T>()` function instead.
137
137
  */
138
- // TODO: Uncomment this when the `uuid` crate is used.
139
- // export type Uuid = unknown;
140
-
141
- export type Uuid = string;
138
+ export type Uuid = unknown;
142
139
 
143
140
  /**
144
141
  * RFC3339 compliant date-time string.
@@ -178,9 +175,14 @@ export interface TestError extends Error {
178
175
 
179
176
  export function isTestError(error: any): error is TestError;
180
177
 
178
+ /**
179
+ * NewType wrapper for `CollectionId`
180
+ */
181
+ export type CollectionId = Tagged<Uuid, "CollectionId">;
182
+
181
183
  export interface Collection {
182
- id: Uuid | undefined;
183
- organizationId: Uuid;
184
+ id: CollectionId | undefined;
185
+ organizationId: OrganizationId;
184
186
  name: EncString;
185
187
  externalId: string | undefined;
186
188
  hidePasswords: boolean;
@@ -191,8 +193,8 @@ export interface Collection {
191
193
  }
192
194
 
193
195
  export interface CollectionView {
194
- id: Uuid | undefined;
195
- organizationId: Uuid;
196
+ id: CollectionId | undefined;
197
+ organizationId: OrganizationId;
196
198
  name: string;
197
199
  externalId: string | undefined;
198
200
  hidePasswords: boolean;
@@ -220,7 +222,7 @@ export interface InitUserCryptoRequest {
220
222
  /**
221
223
  * The user\'s ID.
222
224
  */
223
- userId: Uuid | undefined;
225
+ userId: UserId | undefined;
224
226
  /**
225
227
  * The user\'s KDF parameters, as received from the prelogin request
226
228
  */
@@ -278,7 +280,7 @@ export interface InitOrgCryptoRequest {
278
280
  /**
279
281
  * The encryption keys for all the organizations the user is a part of
280
282
  */
281
- organizationKeys: Map<Uuid, UnsignedSharedKey>;
283
+ organizationKeys: Map<OrganizationId, UnsignedSharedKey>;
282
284
  }
283
285
 
284
286
  /**
@@ -417,6 +419,11 @@ export interface UserCryptoV2KeysResponse {
417
419
 
418
420
  export type SignedSecurityState = string;
419
421
 
422
+ /**
423
+ * NewType wrapper for `UserId`
424
+ */
425
+ export type UserId = Tagged<Uuid, "UserId">;
426
+
420
427
  /**
421
428
  * NewType wrapper for `OrganizationId`
422
429
  */
@@ -816,20 +823,25 @@ export interface CallError extends Error {
816
823
 
817
824
  export function isCallError(error: any): error is CallError;
818
825
 
826
+ /**
827
+ * NewType wrapper for `CipherId`
828
+ */
829
+ export type CipherId = Tagged<Uuid, "CipherId">;
830
+
819
831
  export interface EncryptionContext {
820
832
  /**
821
833
  * The Id of the user that encrypted the cipher. It should always represent a UserId, even for
822
834
  * Organization-owned ciphers
823
835
  */
824
- encryptedFor: Uuid;
836
+ encryptedFor: UserId;
825
837
  cipher: Cipher;
826
838
  }
827
839
 
828
840
  export interface Cipher {
829
- id: Uuid | undefined;
830
- organizationId: Uuid | undefined;
831
- folderId: Uuid | undefined;
832
- collectionIds: Uuid[];
841
+ id: CipherId | undefined;
842
+ organizationId: OrganizationId | undefined;
843
+ folderId: FolderId | undefined;
844
+ collectionIds: CollectionId[];
833
845
  /**
834
846
  * More recent ciphers uses individual encryption keys to encrypt the other fields of the
835
847
  * Cipher.
@@ -859,10 +871,10 @@ export interface Cipher {
859
871
  }
860
872
 
861
873
  export interface CipherView {
862
- id: Uuid | undefined;
863
- organizationId: Uuid | undefined;
864
- folderId: Uuid | undefined;
865
- collectionIds: Uuid[];
874
+ id: CipherId | undefined;
875
+ organizationId: OrganizationId | undefined;
876
+ folderId: FolderId | undefined;
877
+ collectionIds: CollectionId[];
866
878
  /**
867
879
  * Temporary, required to support re-encrypting existing items.
868
880
  */
@@ -914,10 +926,10 @@ export type CopyableCipherFields =
914
926
  | "SecureNotes";
915
927
 
916
928
  export interface CipherListView {
917
- id: Uuid | undefined;
918
- organizationId: Uuid | undefined;
919
- folderId: Uuid | undefined;
920
- collectionIds: Uuid[];
929
+ id: CipherId | undefined;
930
+ organizationId: OrganizationId | undefined;
931
+ folderId: FolderId | undefined;
932
+ collectionIds: CollectionId[];
921
933
  /**
922
934
  * Temporary, required to support calculating TOTP from CipherListView.
923
935
  */
@@ -1114,14 +1126,19 @@ export interface FolderAddEditRequest {
1114
1126
  name: string;
1115
1127
  }
1116
1128
 
1129
+ /**
1130
+ * NewType wrapper for `FolderId`
1131
+ */
1132
+ export type FolderId = Tagged<Uuid, "FolderId">;
1133
+
1117
1134
  export interface Folder {
1118
- id: Uuid | undefined;
1135
+ id: FolderId | undefined;
1119
1136
  name: EncString;
1120
1137
  revisionDate: DateTime<Utc>;
1121
1138
  }
1122
1139
 
1123
1140
  export interface FolderView {
1124
- id: Uuid | undefined;
1141
+ id: FolderId | undefined;
1125
1142
  name: string;
1126
1143
  revisionDate: DateTime<Utc>;
1127
1144
  }
@@ -3910,7 +3910,7 @@ module.exports.__wbg_getTime_46267b1c24877e30 = function (arg0) {
3910
3910
  return ret;
3911
3911
  };
3912
3912
 
3913
- module.exports.__wbg_get_58d17ab6ca776ae1 = function () {
3913
+ module.exports.__wbg_get_5b8e3d66d3028864 = function () {
3914
3914
  return handleError(function (arg0, arg1, arg2) {
3915
3915
  let deferred0_0;
3916
3916
  let deferred0_1;
@@ -3932,12 +3932,7 @@ module.exports.__wbg_get_67b2ba62fc30de12 = function () {
3932
3932
  }, arguments);
3933
3933
  };
3934
3934
 
3935
- module.exports.__wbg_get_b9b93047fe3cf45b = function (arg0, arg1) {
3936
- const ret = getObject(arg0)[arg1 >>> 0];
3937
- return addHeapObject(ret);
3938
- };
3939
-
3940
- module.exports.__wbg_get_e46c583ca0983f5f = function () {
3935
+ module.exports.__wbg_get_a216d449efda5b83 = function () {
3941
3936
  return handleError(function (arg0, arg1, arg2) {
3942
3937
  let deferred0_0;
3943
3938
  let deferred0_1;
@@ -3952,7 +3947,12 @@ module.exports.__wbg_get_e46c583ca0983f5f = function () {
3952
3947
  }, arguments);
3953
3948
  };
3954
3949
 
3955
- module.exports.__wbg_getaccesstoken_e6c98a5d05573cab = function (arg0) {
3950
+ module.exports.__wbg_get_b9b93047fe3cf45b = function (arg0, arg1) {
3951
+ const ret = getObject(arg0)[arg1 >>> 0];
3952
+ return addHeapObject(ret);
3953
+ };
3954
+
3955
+ module.exports.__wbg_getaccesstoken_f04940224cf7da60 = function (arg0) {
3956
3956
  const ret = getObject(arg0).get_access_token();
3957
3957
  return addHeapObject(ret);
3958
3958
  };
@@ -4057,14 +4057,14 @@ module.exports.__wbg_length_e2d2a49132c1b256 = function (arg0) {
4057
4057
  return ret;
4058
4058
  };
4059
4059
 
4060
- module.exports.__wbg_list_60cef561c707b9da = function () {
4060
+ module.exports.__wbg_list_249d074235c8a7bc = function () {
4061
4061
  return handleError(function (arg0) {
4062
4062
  const ret = getObject(arg0).list();
4063
4063
  return addHeapObject(ret);
4064
4064
  }, arguments);
4065
4065
  };
4066
4066
 
4067
- module.exports.__wbg_list_9f30afad94f9c530 = function () {
4067
+ module.exports.__wbg_list_df32641beacaaebd = function () {
4068
4068
  return handleError(function (arg0) {
4069
4069
  const ret = getObject(arg0).list();
4070
4070
  return addHeapObject(ret);
@@ -4246,7 +4246,7 @@ module.exports.__wbg_randomFillSync_ac0988aba3254290 = function () {
4246
4246
  }, arguments);
4247
4247
  };
4248
4248
 
4249
- module.exports.__wbg_remove_43463ec33b170a2e = function () {
4249
+ module.exports.__wbg_remove_79e92e6446a637d0 = function () {
4250
4250
  return handleError(function (arg0, arg1, arg2) {
4251
4251
  let deferred0_0;
4252
4252
  let deferred0_1;
@@ -4261,7 +4261,7 @@ module.exports.__wbg_remove_43463ec33b170a2e = function () {
4261
4261
  }, arguments);
4262
4262
  };
4263
4263
 
4264
- module.exports.__wbg_remove_aca01354844c46e0 = function () {
4264
+ module.exports.__wbg_remove_e7bec9398552d33f = function () {
4265
4265
  return handleError(function (arg0, arg1, arg2) {
4266
4266
  let deferred0_0;
4267
4267
  let deferred0_1;
@@ -4308,16 +4308,7 @@ module.exports.__wbg_set_3f1d0b984ed272ed = function (arg0, arg1, arg2) {
4308
4308
  getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
4309
4309
  };
4310
4310
 
4311
- module.exports.__wbg_set_65595bdd868b3009 = function (arg0, arg1, arg2) {
4312
- getObject(arg0).set(getObject(arg1), arg2 >>> 0);
4313
- };
4314
-
4315
- module.exports.__wbg_set_8fc6bf8a5b1071d1 = function (arg0, arg1, arg2) {
4316
- const ret = getObject(arg0).set(getObject(arg1), getObject(arg2));
4317
- return addHeapObject(ret);
4318
- };
4319
-
4320
- module.exports.__wbg_set_9bbf6767d07e8651 = function () {
4311
+ module.exports.__wbg_set_47094df6bd728b0f = function () {
4321
4312
  return handleError(function (arg0, arg1, arg2, arg3) {
4322
4313
  let deferred0_0;
4323
4314
  let deferred0_1;
@@ -4332,7 +4323,16 @@ module.exports.__wbg_set_9bbf6767d07e8651 = function () {
4332
4323
  }, arguments);
4333
4324
  };
4334
4325
 
4335
- module.exports.__wbg_set_c1f8132095b9b390 = function () {
4326
+ module.exports.__wbg_set_65595bdd868b3009 = function (arg0, arg1, arg2) {
4327
+ getObject(arg0).set(getObject(arg1), arg2 >>> 0);
4328
+ };
4329
+
4330
+ module.exports.__wbg_set_8fc6bf8a5b1071d1 = function (arg0, arg1, arg2) {
4331
+ const ret = getObject(arg0).set(getObject(arg1), getObject(arg2));
4332
+ return addHeapObject(ret);
4333
+ };
4334
+
4335
+ module.exports.__wbg_set_cbe909a733eef6b5 = function () {
4336
4336
  return handleError(function (arg0, arg1, arg2, arg3) {
4337
4337
  let deferred0_0;
4338
4338
  let deferred0_1;
@@ -4535,18 +4535,18 @@ module.exports.__wbindgen_cb_drop = function (arg0) {
4535
4535
  return ret;
4536
4536
  };
4537
4537
 
4538
- module.exports.__wbindgen_closure_wrapper3339 = function (arg0, arg1, arg2) {
4539
- const ret = makeMutClosure(arg0, arg1, 274, __wbg_adapter_54);
4538
+ module.exports.__wbindgen_closure_wrapper3340 = function (arg0, arg1, arg2) {
4539
+ const ret = makeMutClosure(arg0, arg1, 275, __wbg_adapter_54);
4540
4540
  return addHeapObject(ret);
4541
4541
  };
4542
4542
 
4543
- module.exports.__wbindgen_closure_wrapper5700 = function (arg0, arg1, arg2) {
4544
- const ret = makeMutClosure(arg0, arg1, 299, __wbg_adapter_54);
4543
+ module.exports.__wbindgen_closure_wrapper5705 = function (arg0, arg1, arg2) {
4544
+ const ret = makeMutClosure(arg0, arg1, 300, __wbg_adapter_54);
4545
4545
  return addHeapObject(ret);
4546
4546
  };
4547
4547
 
4548
- module.exports.__wbindgen_closure_wrapper6054 = function (arg0, arg1, arg2) {
4549
- const ret = makeMutClosure(arg0, arg1, 324, __wbg_adapter_59);
4548
+ module.exports.__wbindgen_closure_wrapper6060 = function (arg0, arg1, arg2) {
4549
+ const ret = makeMutClosure(arg0, arg1, 325, __wbg_adapter_59);
4550
4550
  return addHeapObject(ret);
4551
4551
  };
4552
4552
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bitwarden/sdk-internal",
3
- "version": "0.2.0-main.265",
3
+ "version": "0.2.0-main.266",
4
4
  "license": "GPL-3.0",
5
5
  "files": [
6
6
  "bitwarden_wasm_internal_bg.js",