@lifeready/core 5.0.2 → 5.0.4

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.
@@ -4154,7 +4154,7 @@
4154
4154
  var GetRootDirectoryIdsQuery = gql__default['default'](templateObject_1$5 || (templateObject_1$5 = __makeTemplateObject(["\n query GetRootDirectoryIdsQuery($archived: Boolean) {\n rootDirectories(archived: $archived) {\n edges {\n node {\n id\n }\n }\n }\n }\n"], ["\n query GetRootDirectoryIdsQuery($archived: Boolean) {\n rootDirectories(archived: $archived) {\n edges {\n node {\n id\n }\n }\n }\n }\n"])));
4155
4155
  var GetCategoriesQuery = gql__default['default'](templateObject_2$3 || (templateObject_2$3 = __makeTemplateObject(["\nquery GetCategoriesQuery($vaultDirectoryId: LrRelayIdInput!, $categoryFilter: LrJSONFilter!, $recordFilter: LrJSONFilter!, $archived: Boolean)\n{\n directory(id: $vaultDirectoryId) {\n childDirectoryLinks(plainMeta: $categoryFilter, orderBy: \"created\", archived: $archived) {\n edges {\n node {\n childDirectory {\n ", "\n }\n }\n }\n }\n }\n keyGraph {\n ...KeyGraphFragment\n }\n}\n", "\n"], ["\nquery GetCategoriesQuery($vaultDirectoryId: LrRelayIdInput!, $categoryFilter: LrJSONFilter!, $recordFilter: LrJSONFilter!, $archived: Boolean)\n{\n directory(id: $vaultDirectoryId) {\n childDirectoryLinks(plainMeta: $categoryFilter, orderBy: \"created\", archived: $archived) {\n edges {\n node {\n childDirectory {\n ", "\n }\n }\n }\n }\n }\n keyGraph {\n ...KeyGraphFragment\n }\n}\n", "\n"])), CategoryFields, KeyGraphFragment);
4156
4156
  var GetVaultsQuery = gql__default['default'](templateObject_3$2 || (templateObject_3$2 = __makeTemplateObject(["\nquery GetVaults($plainMetaFilter: LrJSONFilter!, $cachedKeyIds: [LrRelayIdInput!])\n{\n list: rootDirectories(plainMeta: $plainMetaFilter, orderBy: \"created\") {\n edges {\n node {\n ", "\n }\n }\n }\n keyGraph(cachedKeyIds: $cachedKeyIds) {\n ...KeyGraphFragment\n }\n}\n", "\n"], ["\nquery GetVaults($plainMetaFilter: LrJSONFilter!, $cachedKeyIds: [LrRelayIdInput!])\n{\n list: rootDirectories(plainMeta: $plainMetaFilter, orderBy: \"created\") {\n edges {\n node {\n ", "\n }\n }\n }\n keyGraph(cachedKeyIds: $cachedKeyIds) {\n ...KeyGraphFragment\n }\n}\n", "\n"])), VaultFields, KeyGraphFragment);
4157
- var GetTrustedPartyCategoriesQuery = gql__default['default'](templateObject_4$2 || (templateObject_4$2 = __makeTemplateObject(["\nquery GetTrustedPartyCategoriesQuery($trustedPartyId: LrRelayIdInput!, $categoryFilter: LrJSONFilter!, $recordFilter: LrJSONFilter!, $contentFilter: LrJSONFilter, $cachedKeyIds: [LrRelayIdInput!])\n{\n tp(id: $trustedPartyId) {\n sharedItems {\n list: directories(plainMeta: $categoryFilter, orderBy: \"created\") {\n edges {\n node {\n ", "\n }\n }\n }\n records: directories(plainMeta: $recordFilter, orderBy: \"created\") {\n edges {\n node {\n id\n keyId\n archived\n plainMeta\n cipherMeta\n created\n modified\n content: childFileLinks(plainMeta: $contentFilter) {\n edges {\n node {\n childFile {\n id\n archived\n currentVersion {\n state {\n keyId\n plainMeta\n cipherMeta\n created\n modified\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n keyGraph(cachedKeyIds: $cachedKeyIds) {\n ...KeyGraphFragment\n }\n}\n", "\n"], ["\nquery GetTrustedPartyCategoriesQuery($trustedPartyId: LrRelayIdInput!, $categoryFilter: LrJSONFilter!, $recordFilter: LrJSONFilter!, $contentFilter: LrJSONFilter, $cachedKeyIds: [LrRelayIdInput!])\n{\n tp(id: $trustedPartyId) {\n sharedItems {\n list: directories(plainMeta: $categoryFilter, orderBy: \"created\") {\n edges {\n node {\n ", "\n }\n }\n }\n records: directories(plainMeta: $recordFilter, orderBy: \"created\") {\n edges {\n node {\n id\n keyId\n archived\n plainMeta\n cipherMeta\n created\n modified\n content: childFileLinks(plainMeta: $contentFilter) {\n edges {\n node {\n childFile {\n id\n archived\n currentVersion {\n state {\n keyId\n plainMeta\n cipherMeta\n created\n modified\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n keyGraph(cachedKeyIds: $cachedKeyIds) {\n ...KeyGraphFragment\n }\n}\n", "\n"])), CategoryFields, KeyGraphFragment);
4157
+ var GetTrustedPartyCategoriesQuery = gql__default['default'](templateObject_4$2 || (templateObject_4$2 = __makeTemplateObject(["\nquery GetTrustedPartyCategoriesQuery($trustedPartyId: LrRelayIdInput!, $categoryFilter: LrJSONFilter!, $recordFilter: LrJSONFilter!, $contentFilter: LrJSONFilter, $cachedKeyIds: [LrRelayIdInput!])\n{\n tp(id: $trustedPartyId) {\n theirItems {\n list: directories(plainMeta: $categoryFilter, orderBy: \"created\") {\n edges {\n node {\n ", "\n }\n }\n }\n records: directories(plainMeta: $recordFilter, orderBy: \"created\") {\n edges {\n node {\n id\n keyId\n archived\n plainMeta\n cipherMeta\n created\n modified\n content: childFileLinks(plainMeta: $contentFilter) {\n edges {\n node {\n childFile {\n id\n archived\n currentVersion {\n state {\n keyId\n plainMeta\n cipherMeta\n created\n modified\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n keyGraph(cachedKeyIds: $cachedKeyIds) {\n ...KeyGraphFragment\n }\n}\n", "\n"], ["\nquery GetTrustedPartyCategoriesQuery($trustedPartyId: LrRelayIdInput!, $categoryFilter: LrJSONFilter!, $recordFilter: LrJSONFilter!, $contentFilter: LrJSONFilter, $cachedKeyIds: [LrRelayIdInput!])\n{\n tp(id: $trustedPartyId) {\n theirItems {\n list: directories(plainMeta: $categoryFilter, orderBy: \"created\") {\n edges {\n node {\n ", "\n }\n }\n }\n records: directories(plainMeta: $recordFilter, orderBy: \"created\") {\n edges {\n node {\n id\n keyId\n archived\n plainMeta\n cipherMeta\n created\n modified\n content: childFileLinks(plainMeta: $contentFilter) {\n edges {\n node {\n childFile {\n id\n archived\n currentVersion {\n state {\n keyId\n plainMeta\n cipherMeta\n created\n modified\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n keyGraph(cachedKeyIds: $cachedKeyIds) {\n ...KeyGraphFragment\n }\n}\n", "\n"])), CategoryFields, KeyGraphFragment);
4158
4158
  var GetMySharedCategoriesQuery = gql__default['default'](templateObject_5$2 || (templateObject_5$2 = __makeTemplateObject(["\nquery GetMySharedCategoriesQuery($trustedPartyId: LrRelayIdInput!, $categoryFilter: LrJSONFilter!, $recordFilter: LrJSONFilter!, $contentFilter: LrJSONFilter, $cachedKeyIds: [LrRelayIdInput!])\n{\n tp(id: $trustedPartyId) {\n myItems {\n list: directories(plainMeta: $categoryFilter, orderBy: \"created\") {\n edges {\n node {\n ", "\n }\n }\n }\n records: directories(plainMeta: $recordFilter, orderBy: \"created\") {\n edges {\n node {\n id\n keyId\n archived\n plainMeta\n cipherMeta\n created\n modified\n content: childFileLinks(plainMeta: $contentFilter) {\n edges {\n node {\n childFile {\n id\n archived\n currentVersion {\n state {\n keyId\n plainMeta\n cipherMeta\n created\n modified\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n keyGraph(cachedKeyIds: $cachedKeyIds) {\n ...KeyGraphFragment\n }\n}\n", "\n"], ["\nquery GetMySharedCategoriesQuery($trustedPartyId: LrRelayIdInput!, $categoryFilter: LrJSONFilter!, $recordFilter: LrJSONFilter!, $contentFilter: LrJSONFilter, $cachedKeyIds: [LrRelayIdInput!])\n{\n tp(id: $trustedPartyId) {\n myItems {\n list: directories(plainMeta: $categoryFilter, orderBy: \"created\") {\n edges {\n node {\n ", "\n }\n }\n }\n records: directories(plainMeta: $recordFilter, orderBy: \"created\") {\n edges {\n node {\n id\n keyId\n archived\n plainMeta\n cipherMeta\n created\n modified\n content: childFileLinks(plainMeta: $contentFilter) {\n edges {\n node {\n childFile {\n id\n archived\n currentVersion {\n state {\n keyId\n plainMeta\n cipherMeta\n created\n modified\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n keyGraph(cachedKeyIds: $cachedKeyIds) {\n ...KeyGraphFragment\n }\n}\n", "\n"])), CategoryFields, KeyGraphFragment);
4159
4159
  var parentCategoriesField = function (depth) {
4160
4160
  if (depth === void 0) { depth = DEFAULT_BREADCRUMB_DEPTH; }
@@ -4711,7 +4711,7 @@
4711
4711
  { type: LrApolloService }
4712
4712
  ]; };
4713
4713
 
4714
- var CurrentUserQuery = gql__default['default'](templateObject_1$7 || (templateObject_1$7 = __makeTemplateObject(["\n query {\n currentUser {\n id\n username\n currentUserKey {\n passKey {\n id\n passKeyParams\n passIdpParams\n wrappedPassIdpVerifierPrk\n created\n }\n masterKey {\n id\n }\n rootKey {\n id\n }\n pxk {\n id\n }\n sigPxk {\n id\n }\n }\n userDelete {\n id\n created\n state\n }\n features {\n myVault\n tpVault\n shareVault\n }\n sessionEncryptionKey\n }\n userPlans {\n id\n stripe {\n subscriptionId\n }\n plan {\n name\n data\n state\n }\n periodEnd\n }\n contactCards(orderBy: \"created\") {\n edges {\n node {\n id\n key {\n id\n }\n cipherData\n plainData\n }\n }\n }\n keyGraph {\n ...KeyGraphFragment\n }\n }\n ", "\n"], ["\n query {\n currentUser {\n id\n username\n currentUserKey {\n passKey {\n id\n passKeyParams\n passIdpParams\n wrappedPassIdpVerifierPrk\n created\n }\n masterKey {\n id\n }\n rootKey {\n id\n }\n pxk {\n id\n }\n sigPxk {\n id\n }\n }\n userDelete {\n id\n created\n state\n }\n features {\n myVault\n tpVault\n shareVault\n }\n sessionEncryptionKey\n }\n userPlans {\n id\n stripe {\n subscriptionId\n }\n plan {\n name\n data\n state\n }\n periodEnd\n }\n contactCards(orderBy: \"created\") {\n edges {\n node {\n id\n key {\n id\n }\n cipherData\n plainData\n }\n }\n }\n keyGraph {\n ...KeyGraphFragment\n }\n }\n ", "\n"])), KeyGraphFragment);
4714
+ var CurrentUserQuery = gql__default['default'](templateObject_1$7 || (templateObject_1$7 = __makeTemplateObject(["\n query {\n currentUser {\n id\n username\n currentUserKey {\n passKey {\n id\n passKeyParams\n passIdpParams\n wrappedPassIdpVerifierPrk\n created\n }\n masterKey {\n id\n }\n rootKey {\n id\n }\n pxk {\n id\n }\n sigPxk {\n id\n }\n }\n userDelete {\n id\n created\n state\n }\n features {\n myVault\n tpVault\n shareVault\n }\n sessionEncryptionKey\n dateJoined\n }\n userPlans {\n id\n stripe {\n subscriptionId\n }\n plan {\n name\n data\n state\n }\n periodEnd\n }\n contactCards(orderBy: \"created\") {\n edges {\n node {\n id\n key {\n id\n }\n cipherData\n plainData\n }\n }\n }\n keyGraph {\n ...KeyGraphFragment\n }\n }\n ", "\n"], ["\n query {\n currentUser {\n id\n username\n currentUserKey {\n passKey {\n id\n passKeyParams\n passIdpParams\n wrappedPassIdpVerifierPrk\n created\n }\n masterKey {\n id\n }\n rootKey {\n id\n }\n pxk {\n id\n }\n sigPxk {\n id\n }\n }\n userDelete {\n id\n created\n state\n }\n features {\n myVault\n tpVault\n shareVault\n }\n sessionEncryptionKey\n dateJoined\n }\n userPlans {\n id\n stripe {\n subscriptionId\n }\n plan {\n name\n data\n state\n }\n periodEnd\n }\n contactCards(orderBy: \"created\") {\n edges {\n node {\n id\n key {\n id\n }\n cipherData\n plainData\n }\n }\n }\n keyGraph {\n ...KeyGraphFragment\n }\n }\n ", "\n"])), KeyGraphFragment);
4715
4715
  var CreateContactCardMutation$1 = gql__default['default'](templateObject_2$5 || (templateObject_2$5 = __makeTemplateObject(["\n mutation CreateContactCardMutation($input: CreateContactCardInput!) {\n createContactCard(input: $input) {\n contactCard {\n id\n key {\n id\n }\n cipherData\n }\n }\n }\n"], ["\n mutation CreateContactCardMutation($input: CreateContactCardInput!) {\n createContactCard(input: $input) {\n contactCard {\n id\n key {\n id\n }\n cipherData\n }\n }\n }\n"])));
4716
4716
  var UpdateContactCardMutation$1 = gql__default['default'](templateObject_3$4 || (templateObject_3$4 = __makeTemplateObject(["\n mutation UpdateContactCardMutation($input: UpdateContactCardInput!) {\n updateContactCard(input: $input) {\n contactCard {\n id\n key {\n id\n }\n cipherData\n }\n }\n }\n"], ["\n mutation UpdateContactCardMutation($input: UpdateContactCardInput!) {\n updateContactCard(input: $input) {\n contactCard {\n id\n key {\n id\n }\n cipherData\n }\n }\n }\n"])));
4717
4717
  var templateObject_1$7, templateObject_2$5, templateObject_3$4;
@@ -6324,6 +6324,7 @@
6324
6324
  _c.hasTPVaultAccess = this.mapTPVaultAccess(currentUser.features),
6325
6325
  _c.features = currentUser.features,
6326
6326
  _c.sessionEncryptionKey = currentUser.sessionEncryptionKey,
6327
+ _c.dateJoined = currentUser.dateJoined,
6327
6328
  _c)];
6328
6329
  }
6329
6330
  });
@@ -6710,6 +6711,7 @@
6710
6711
  _g.hasTPVaultAccess = this.mapTPVaultAccess(currentUser.features),
6711
6712
  _g.features = currentUser.features,
6712
6713
  _g.sessionEncryptionKey = currentUser.sessionEncryptionKey,
6714
+ _g.dateJoined = currentUser.dateJoined,
6713
6715
  _g)];
6714
6716
  }
6715
6717
  });
@@ -7116,10 +7118,10 @@
7116
7118
  case 1:
7117
7119
  tp = (_c.sent()).tp;
7118
7120
  _b = {};
7119
- return [4 /*yield*/, this.mapCategories(tp.sharedItems.list)];
7121
+ return [4 /*yield*/, this.mapCategories(tp.theirItems.list)];
7120
7122
  case 2:
7121
7123
  _b.categories = _c.sent();
7122
- return [4 /*yield*/, this.mapRecords(tp.sharedItems.records)];
7124
+ return [4 /*yield*/, this.mapRecords(tp.theirItems.records)];
7123
7125
  case 3: return [2 /*return*/, (_b.records = _c.sent(),
7124
7126
  _b)];
7125
7127
  }
@@ -8106,14 +8108,14 @@
8106
8108
  return __awaiter(this, void 0, void 0, function () {
8107
8109
  var fileContent, fileStateKey;
8108
8110
  var _this = this;
8109
- return __generator(this, function (_c) {
8110
- switch (_c.label) {
8111
+ return __generator(this, function (_d) {
8112
+ switch (_d.label) {
8111
8113
  case 0: return [4 /*yield*/, this.fileUploadService.downloadEncryptedFile2(options.fileStateNodeId)];
8112
8114
  case 1:
8113
- fileContent = _c.sent();
8115
+ fileContent = _d.sent();
8114
8116
  return [4 /*yield*/, this.keyGraph.getKey(options.fileStateKeyId, function () { return _this.getFileStateKeyId(options.fileStateNodeId); })];
8115
8117
  case 2:
8116
- fileStateKey = _c.sent();
8118
+ fileStateKey = _d.sent();
8117
8119
  return [2 /*return*/, this.keyGraph.decryptFromString(fileStateKey, fileContent, {
8118
8120
  payloadType: 'ArrayBuffer',
8119
8121
  })];
@@ -8123,30 +8125,30 @@
8123
8125
  };
8124
8126
  Item2Service.prototype.getDirectoryKeyId = function (directoryId) {
8125
8127
  return __awaiter(this, void 0, void 0, function () {
8126
- return __generator(this, function (_c) {
8127
- switch (_c.label) {
8128
+ return __generator(this, function (_d) {
8129
+ switch (_d.label) {
8128
8130
  case 0: return [4 /*yield*/, this.query({
8129
8131
  query: DirectoryKeyQuery,
8130
8132
  variables: {
8131
8133
  id: directoryId,
8132
8134
  },
8133
8135
  })];
8134
- case 1: return [2 /*return*/, (_c.sent()).directory.keyId];
8136
+ case 1: return [2 /*return*/, (_d.sent()).directory.keyId];
8135
8137
  }
8136
8138
  });
8137
8139
  });
8138
8140
  };
8139
8141
  Item2Service.prototype.getFileKeyId = function (fileId) {
8140
8142
  return __awaiter(this, void 0, void 0, function () {
8141
- return __generator(this, function (_c) {
8142
- switch (_c.label) {
8143
+ return __generator(this, function (_d) {
8144
+ switch (_d.label) {
8143
8145
  case 0: return [4 /*yield*/, this.query({
8144
8146
  query: FileKeyQuery,
8145
8147
  variables: {
8146
8148
  id: fileId,
8147
8149
  },
8148
8150
  })];
8149
- case 1: return [2 /*return*/, (_c.sent()).file.keyId];
8151
+ case 1: return [2 /*return*/, (_d.sent()).file.keyId];
8150
8152
  }
8151
8153
  });
8152
8154
  });
@@ -8154,7 +8156,7 @@
8154
8156
  Item2Service.prototype.getDirectoryKey = function (directoryId, directoryKeyId) {
8155
8157
  return __awaiter(this, void 0, void 0, function () {
8156
8158
  var _this = this;
8157
- return __generator(this, function (_c) {
8159
+ return __generator(this, function (_d) {
8158
8160
  return [2 /*return*/, this.keyGraph.getKey(directoryKeyId, function () { return _this.getDirectoryKeyId(directoryId); })];
8159
8161
  });
8160
8162
  });
@@ -8162,7 +8164,7 @@
8162
8164
  Item2Service.prototype.getFileKey = function (fileId, fileKeyId) {
8163
8165
  return __awaiter(this, void 0, void 0, function () {
8164
8166
  var _this = this;
8165
- return __generator(this, function (_c) {
8167
+ return __generator(this, function (_d) {
8166
8168
  return [2 /*return*/, this.keyGraph.getKey(fileKeyId, function () { return _this.getFileKeyId(fileId); })];
8167
8169
  });
8168
8170
  });
@@ -8175,19 +8177,19 @@
8175
8177
  };
8176
8178
  Item2Service.prototype.createDirectoryMutation = function (options) {
8177
8179
  return __awaiter(this, void 0, void 0, function () {
8178
- var _c, _d, _e;
8179
- return __generator(this, function (_f) {
8180
- switch (_f.label) {
8180
+ var _d, _e, _f;
8181
+ return __generator(this, function (_g) {
8182
+ switch (_g.label) {
8181
8183
  case 0:
8182
- _c = LrMutation.bind;
8183
- _d = {
8184
+ _d = LrMutation.bind;
8185
+ _e = {
8184
8186
  mutation: CreateDirectoryMutation
8185
8187
  };
8186
- _e = {};
8188
+ _f = {};
8187
8189
  return [4 /*yield*/, this.prepareCreateDirectory(options)];
8188
- case 1: return [2 /*return*/, new (_c.apply(LrMutation, [void 0, (_d.variables = (_e.input = _f.sent(),
8189
- _e),
8190
- _d)]))()];
8190
+ case 1: return [2 /*return*/, new (_d.apply(LrMutation, [void 0, (_e.variables = (_f.input = _g.sent(),
8191
+ _f),
8192
+ _e)]))()];
8191
8193
  }
8192
8194
  });
8193
8195
  });
@@ -8200,19 +8202,19 @@
8200
8202
  };
8201
8203
  Item2Service.prototype.updateDirectoryMutation = function (options) {
8202
8204
  return __awaiter(this, void 0, void 0, function () {
8203
- var _c, _d, _e;
8204
- return __generator(this, function (_f) {
8205
- switch (_f.label) {
8205
+ var _d, _e, _f;
8206
+ return __generator(this, function (_g) {
8207
+ switch (_g.label) {
8206
8208
  case 0:
8207
- _c = LrMutation.bind;
8208
- _d = {
8209
+ _d = LrMutation.bind;
8210
+ _e = {
8209
8211
  mutation: UpdateDirectoryMutation
8210
8212
  };
8211
- _e = {};
8213
+ _f = {};
8212
8214
  return [4 /*yield*/, this.prepareUpdateDirectory(options)];
8213
- case 1: return [2 /*return*/, new (_c.apply(LrMutation, [void 0, (_d.variables = (_e.input = _f.sent(),
8214
- _e),
8215
- _d)]))()];
8215
+ case 1: return [2 /*return*/, new (_d.apply(LrMutation, [void 0, (_e.variables = (_f.input = _g.sent(),
8216
+ _f),
8217
+ _e)]))()];
8216
8218
  }
8217
8219
  });
8218
8220
  });
@@ -8241,19 +8243,19 @@
8241
8243
  };
8242
8244
  Item2Service.prototype.createFileMutation = function (options) {
8243
8245
  return __awaiter(this, void 0, void 0, function () {
8244
- var _c, _d, _e;
8245
- return __generator(this, function (_f) {
8246
- switch (_f.label) {
8246
+ var _d, _e, _f;
8247
+ return __generator(this, function (_g) {
8248
+ switch (_g.label) {
8247
8249
  case 0:
8248
- _c = LrMutation.bind;
8249
- _d = {
8250
+ _d = LrMutation.bind;
8251
+ _e = {
8250
8252
  mutation: CreateFileMutation$1
8251
8253
  };
8252
- _e = {};
8254
+ _f = {};
8253
8255
  return [4 /*yield*/, this.prepareCreateFile(options)];
8254
- case 1: return [2 /*return*/, new (_c.apply(LrMutation, [void 0, (_d.variables = (_e.input = _f.sent(),
8255
- _e),
8256
- _d)]))()];
8256
+ case 1: return [2 /*return*/, new (_d.apply(LrMutation, [void 0, (_e.variables = (_f.input = _g.sent(),
8257
+ _f),
8258
+ _e)]))()];
8257
8259
  }
8258
8260
  });
8259
8261
  });
@@ -8266,19 +8268,19 @@
8266
8268
  };
8267
8269
  Item2Service.prototype.updateFileMutation = function (options) {
8268
8270
  return __awaiter(this, void 0, void 0, function () {
8269
- var _c, _d, _e;
8270
- return __generator(this, function (_f) {
8271
- switch (_f.label) {
8271
+ var _d, _e, _f;
8272
+ return __generator(this, function (_g) {
8273
+ switch (_g.label) {
8272
8274
  case 0:
8273
- _c = LrMutation.bind;
8274
- _d = {
8275
+ _d = LrMutation.bind;
8276
+ _e = {
8275
8277
  mutation: UpdateFileMutation
8276
8278
  };
8277
- _e = {};
8279
+ _f = {};
8278
8280
  return [4 /*yield*/, this.prepareUpdateFile(options)];
8279
- case 1: return [2 /*return*/, new (_c.apply(LrMutation, [void 0, (_d.variables = (_e.input = _f.sent(),
8280
- _e),
8281
- _d)]))()];
8281
+ case 1: return [2 /*return*/, new (_d.apply(LrMutation, [void 0, (_e.variables = (_f.input = _g.sent(),
8282
+ _f),
8283
+ _e)]))()];
8282
8284
  }
8283
8285
  });
8284
8286
  });
@@ -8291,7 +8293,7 @@
8291
8293
  };
8292
8294
  Item2Service.prototype.revertFileMutation = function (options) {
8293
8295
  return __awaiter(this, void 0, void 0, function () {
8294
- return __generator(this, function (_c) {
8296
+ return __generator(this, function (_d) {
8295
8297
  return [2 /*return*/, new LrMutation({
8296
8298
  mutation: RevertFileMutation,
8297
8299
  variables: {
@@ -8385,45 +8387,45 @@
8385
8387
  };
8386
8388
  Item2Service.prototype.changeDirectoryParentsMutation = function (options) {
8387
8389
  return __awaiter(this, void 0, void 0, function () {
8388
- var _c, _d, _e;
8389
- return __generator(this, function (_f) {
8390
- switch (_f.label) {
8390
+ var _d, _e, _f;
8391
+ return __generator(this, function (_g) {
8392
+ switch (_g.label) {
8391
8393
  case 0:
8392
- _c = LrMutation.bind;
8393
- _d = {
8394
+ _d = LrMutation.bind;
8395
+ _e = {
8394
8396
  mutation: ChangeDirectoryParentsMutation
8395
8397
  };
8396
- _e = {};
8398
+ _f = {};
8397
8399
  return [4 /*yield*/, this.prepareChangeDirectoryParents(options)];
8398
- case 1: return [2 /*return*/, new (_c.apply(LrMutation, [void 0, (_d.variables = (_e.input = _f.sent(),
8399
- _e),
8400
- _d)]))()];
8400
+ case 1: return [2 /*return*/, new (_d.apply(LrMutation, [void 0, (_e.variables = (_f.input = _g.sent(),
8401
+ _f),
8402
+ _e)]))()];
8401
8403
  }
8402
8404
  });
8403
8405
  });
8404
8406
  };
8405
8407
  Item2Service.prototype.changeFileParents = function (options) {
8406
8408
  return __awaiter(this, void 0, void 0, function () {
8407
- return __generator(this, function (_c) {
8409
+ return __generator(this, function (_d) {
8408
8410
  return [2 /*return*/, this.mutate(this.changeFileParentsMutation(options))];
8409
8411
  });
8410
8412
  });
8411
8413
  };
8412
8414
  Item2Service.prototype.changeFileParentsMutation = function (options) {
8413
8415
  return __awaiter(this, void 0, void 0, function () {
8414
- var _c, _d, _e;
8415
- return __generator(this, function (_f) {
8416
- switch (_f.label) {
8416
+ var _d, _e, _f;
8417
+ return __generator(this, function (_g) {
8418
+ switch (_g.label) {
8417
8419
  case 0:
8418
- _c = LrMutation.bind;
8419
- _d = {
8420
+ _d = LrMutation.bind;
8421
+ _e = {
8420
8422
  mutation: ChangeFileParentsMutation
8421
8423
  };
8422
- _e = {};
8424
+ _f = {};
8423
8425
  return [4 /*yield*/, this.prepareChangeFileParents(options)];
8424
- case 1: return [2 /*return*/, new (_c.apply(LrMutation, [void 0, (_d.variables = (_e.input = _f.sent(),
8425
- _e),
8426
- _d)]))()];
8426
+ case 1: return [2 /*return*/, new (_d.apply(LrMutation, [void 0, (_e.variables = (_f.input = _g.sent(),
8427
+ _f),
8428
+ _e)]))()];
8427
8429
  }
8428
8430
  });
8429
8431
  });
@@ -8443,7 +8445,7 @@
8443
8445
  */
8444
8446
  Item2Service.prototype.beginDeleteChildItemLinksWindowMutation = function (options) {
8445
8447
  return __awaiter(this, void 0, void 0, function () {
8446
- return __generator(this, function (_c) {
8448
+ return __generator(this, function (_d) {
8447
8449
  return [2 /*return*/, new LrMutation({
8448
8450
  mutation: BeginDeleteChildItemLinksWindowMutation,
8449
8451
  variables: {
@@ -8467,9 +8469,9 @@
8467
8469
  Item2Service.prototype.ensureTempDirectory = function () {
8468
8470
  var _a;
8469
8471
  return __awaiter(this, void 0, void 0, function () {
8470
- var existing, createDirectory, updateLock, _c, createDirectoryResult, _d, id, keyId, _e, id, keyId;
8471
- return __generator(this, function (_f) {
8472
- switch (_f.label) {
8472
+ var existing, createDirectory, updateLock, _d, createDirectoryResult, _e, id, keyId, _f, id, keyId;
8473
+ return __generator(this, function (_g) {
8474
+ switch (_g.label) {
8473
8475
  case 0:
8474
8476
  if (this.tempDirectory) {
8475
8477
  return [2 /*return*/, this.tempDirectory];
@@ -8481,7 +8483,7 @@
8481
8483
  },
8482
8484
  })];
8483
8485
  case 1:
8484
- existing = _f.sent();
8486
+ existing = _g.sent();
8485
8487
  if (existing.rootDirectories.edges.length > 1) {
8486
8488
  console.error("There is more than 1 temp directory (plainMeta filter: " + Item2Service_1.TEMP_DIRECTORY_PLAIN_META_FILTER + ")");
8487
8489
  }
@@ -8491,7 +8493,7 @@
8491
8493
  plainMetaJson: Item2Service_1.TEMP_DIRECTORY_PLAIN_META,
8492
8494
  })];
8493
8495
  case 2:
8494
- createDirectory = _f.sent();
8496
+ createDirectory = _g.sent();
8495
8497
  updateLock = this.lockService.updateLockMutation({
8496
8498
  version: (_a = existing.lock) === null || _a === void 0 ? void 0 : _a.version,
8497
8499
  });
@@ -8500,20 +8502,20 @@
8500
8502
  updateLock,
8501
8503
  ])];
8502
8504
  case 3:
8503
- _c = __read.apply(void 0, [_f.sent(), 1]), createDirectoryResult = _c[0];
8504
- _d = createDirectoryResult.createDirectory.directory, id = _d.id, keyId = _d.keyId;
8505
+ _d = __read.apply(void 0, [_g.sent(), 1]), createDirectoryResult = _d[0];
8506
+ _e = createDirectoryResult.createDirectory.directory, id = _e.id, keyId = _e.keyId;
8505
8507
  this.tempDirectory = {
8506
8508
  id: id,
8507
8509
  keyId: keyId,
8508
8510
  };
8509
8511
  return [3 /*break*/, 5];
8510
8512
  case 4:
8511
- _e = existing.rootDirectories.edges[0].node, id = _e.id, keyId = _e.keyId;
8513
+ _f = existing.rootDirectories.edges[0].node, id = _f.id, keyId = _f.keyId;
8512
8514
  this.tempDirectory = {
8513
8515
  id: id,
8514
8516
  keyId: keyId,
8515
8517
  };
8516
- _f.label = 5;
8518
+ _g.label = 5;
8517
8519
  case 5: return [2 /*return*/, this.tempDirectory];
8518
8520
  }
8519
8521
  });
@@ -8521,7 +8523,7 @@
8521
8523
  };
8522
8524
  Item2Service.prototype.createDirectoryTree = function (options) {
8523
8525
  return __awaiter(this, void 0, void 0, function () {
8524
- return __generator(this, function (_c) {
8526
+ return __generator(this, function (_d) {
8525
8527
  return [2 /*return*/, this.mutate(this.createDirectoryTreeMutation(options))];
8526
8528
  });
8527
8529
  });
@@ -8534,11 +8536,11 @@
8534
8536
  Item2Service.prototype.createDirectoryTreeMutation = function (options) {
8535
8537
  return __awaiter(this, void 0, void 0, function () {
8536
8538
  var tempDir, directory;
8537
- return __generator(this, function (_c) {
8538
- switch (_c.label) {
8539
+ return __generator(this, function (_d) {
8540
+ switch (_d.label) {
8539
8541
  case 0: return [4 /*yield*/, this.ensureTempDirectory()];
8540
8542
  case 1:
8541
- tempDir = _c.sent();
8543
+ tempDir = _d.sent();
8542
8544
  // Clear the temp directory of the ones we are about to create.
8543
8545
  // NOTE: this mutation can not be merged into a single mutation with the
8544
8546
  // the createDirectory mutation because it uses the current server time to
@@ -8554,7 +8556,7 @@
8554
8556
  // the createDirectory mutation because it uses the current server time to
8555
8557
  // clean up. So it must successfully complete before the creation of the
8556
8558
  // directories.
8557
- _c.sent();
8559
+ _d.sent();
8558
8560
  return [4 /*yield*/, this.createDirectoryExec({
8559
8561
  cipherMetaClearJson: options.cipherMetaClearJson,
8560
8562
  parentDirectories: [
@@ -8566,7 +8568,7 @@
8566
8568
  plainMetaJson: options.plainMetaJson,
8567
8569
  })];
8568
8570
  case 3:
8569
- directory = (_c.sent()).createDirectory.directory;
8571
+ directory = (_d.sent()).createDirectory.directory;
8570
8572
  // Create the contents
8571
8573
  return [4 /*yield*/, options.createContent({
8572
8574
  id: directory.id,
@@ -8574,7 +8576,7 @@
8574
8576
  })];
8575
8577
  case 4:
8576
8578
  // Create the contents
8577
- _c.sent();
8579
+ _d.sent();
8578
8580
  // TODO client-side check for timeout on requestWindowMs
8579
8581
  // TODO return the server time where delete is scheduled. Expirable mutation
8580
8582
  // Return the mutation that moves the directory into the dst directories
@@ -8590,14 +8592,14 @@
8590
8592
  };
8591
8593
  Item2Service.prototype.setFileConfidential = function (options) {
8592
8594
  return __awaiter(this, void 0, void 0, function () {
8593
- return __generator(this, function (_c) {
8595
+ return __generator(this, function (_d) {
8594
8596
  return [2 /*return*/, this.mutate(this.setFileConfidentialMutation(options))];
8595
8597
  });
8596
8598
  });
8597
8599
  };
8598
8600
  Item2Service.prototype.setFileConfidentialMutation = function (options) {
8599
8601
  return __awaiter(this, void 0, void 0, function () {
8600
- return __generator(this, function (_c) {
8602
+ return __generator(this, function (_d) {
8601
8603
  return [2 /*return*/, new LrMutation({
8602
8604
  mutation: SetFileConfidentialMutation,
8603
8605
  variables: {
@@ -8612,14 +8614,14 @@
8612
8614
  };
8613
8615
  Item2Service.prototype.setDirectoryConfidential = function (options) {
8614
8616
  return __awaiter(this, void 0, void 0, function () {
8615
- return __generator(this, function (_c) {
8617
+ return __generator(this, function (_d) {
8616
8618
  return [2 /*return*/, this.mutate(this.setDirectoryConfidentialMutation(options))];
8617
8619
  });
8618
8620
  });
8619
8621
  };
8620
8622
  Item2Service.prototype.setDirectoryConfidentialMutation = function (options) {
8621
8623
  return __awaiter(this, void 0, void 0, function () {
8622
- return __generator(this, function (_c) {
8624
+ return __generator(this, function (_d) {
8623
8625
  return [2 /*return*/, new LrMutation({
8624
8626
  mutation: SetDirectoryConfidentialMutation,
8625
8627
  variables: {
@@ -8639,101 +8641,101 @@
8639
8641
  // ------------------------------------------------------------------------------
8640
8642
  Item2Service.prototype.prepareParentDirectory = function (options, newKey) {
8641
8643
  return __awaiter(this, void 0, void 0, function () {
8642
- var wrappingKey, _c;
8643
- return __generator(this, function (_d) {
8644
- switch (_d.label) {
8644
+ var wrappingKey, _d;
8645
+ return __generator(this, function (_e) {
8646
+ switch (_e.label) {
8645
8647
  case 0: return [4 /*yield*/, this.getDirectoryKey(options.directoryId, options.wrappingKeyId)];
8646
8648
  case 1:
8647
- wrappingKey = _d.sent();
8648
- _c = {
8649
+ wrappingKey = _e.sent();
8650
+ _d = {
8649
8651
  directoryId: options.directoryId,
8650
8652
  wrappingKeyId: wrappingKey.id
8651
8653
  };
8652
8654
  return [4 /*yield*/, this.keyGraph.wrapKey(wrappingKey, newKey)];
8653
- case 2: return [2 /*return*/, (_c.wrappedKey = _d.sent(),
8654
- _c.linkType = options.linkType,
8655
- _c)];
8655
+ case 2: return [2 /*return*/, (_d.wrappedKey = _e.sent(),
8656
+ _d.linkType = options.linkType,
8657
+ _d)];
8656
8658
  }
8657
8659
  });
8658
8660
  });
8659
8661
  };
8660
8662
  Item2Service.prototype.getFileStateKeyId = function (fileStateNodeId) {
8661
8663
  return __awaiter(this, void 0, void 0, function () {
8662
- return __generator(this, function (_c) {
8663
- switch (_c.label) {
8664
+ return __generator(this, function (_d) {
8665
+ switch (_d.label) {
8664
8666
  case 0: return [4 /*yield*/, this.query({
8665
8667
  query: FileStateKeyQuery,
8666
8668
  variables: {
8667
8669
  id: fileStateNodeId,
8668
8670
  },
8669
8671
  })];
8670
- case 1: return [2 /*return*/, (_c.sent()).fileState.keyId];
8672
+ case 1: return [2 /*return*/, (_d.sent()).fileState.keyId];
8671
8673
  }
8672
8674
  });
8673
8675
  });
8674
8676
  };
8675
8677
  Item2Service.prototype.prepareCreateFileState = function (fileKey, options) {
8676
8678
  return __awaiter(this, void 0, void 0, function () {
8677
- var fileStateKey, fileContent, _c, contentResource, cipherFileContent, _d, _e, _f, _g, _h, _j, _k;
8678
- return __generator(this, function (_l) {
8679
- switch (_l.label) {
8679
+ var fileStateKey, fileContent, _d, contentResource, cipherFileContent, _e, _f, _g, _h, _j, _k, _l;
8680
+ return __generator(this, function (_m) {
8681
+ switch (_m.label) {
8680
8682
  case 0: return [4 /*yield*/, this.keyFactory.createKey()];
8681
8683
  case 1:
8682
- fileStateKey = _l.sent();
8683
- _c = options.file;
8684
- if (!_c) return [3 /*break*/, 3];
8684
+ fileStateKey = _m.sent();
8685
+ _d = options.file;
8686
+ if (!_d) return [3 /*break*/, 3];
8685
8687
  return [4 /*yield*/, this.fileUploadService.loadFile(options.file)];
8686
8688
  case 2:
8687
- _c = (_l.sent());
8688
- _l.label = 3;
8689
+ _d = (_m.sent());
8690
+ _m.label = 3;
8689
8691
  case 3:
8690
- fileContent = _c;
8692
+ fileContent = _d;
8691
8693
  if (!fileContent) return [3 /*break*/, 8];
8692
8694
  return [4 /*yield*/, this.keyGraph.encryptToString(fileStateKey, fileContent)];
8693
8695
  case 4:
8694
- cipherFileContent = _l.sent();
8696
+ cipherFileContent = _m.sent();
8695
8697
  if (!options.upload) return [3 /*break*/, 6];
8696
8698
  return [4 /*yield*/, options.upload(cipherFileContent)];
8697
8699
  case 5:
8698
- contentResource = _l.sent();
8700
+ contentResource = _m.sent();
8699
8701
  return [3 /*break*/, 8];
8700
8702
  case 6: return [4 /*yield*/, this.fileUploadService.uploadEncryptedFile({
8701
8703
  encryptedContent: cipherFileContent,
8702
8704
  })];
8703
8705
  case 7:
8704
- contentResource = _l.sent();
8705
- _l.label = 8;
8706
+ contentResource = _m.sent();
8707
+ _m.label = 8;
8706
8708
  case 8:
8707
- _e = (_d = Object).assign;
8708
- _g = (_f = Object).assign;
8709
- _h = [{}];
8709
+ _f = (_e = Object).assign;
8710
+ _h = (_g = Object).assign;
8711
+ _j = [{}];
8710
8712
  return [4 /*yield*/, this.prepareItem(fileStateKey, options)];
8711
8713
  case 9:
8712
- _j = [_g.apply(_f, _h.concat([(_l.sent())]))];
8713
- _k = {};
8714
+ _k = [_h.apply(_g, _j.concat([(_m.sent())]))];
8715
+ _l = {};
8714
8716
  return [4 /*yield*/, this.keyGraph.wrapKey(fileKey, fileStateKey)];
8715
- case 10: return [2 /*return*/, _e.apply(_d, _j.concat([(_k.wrappedStateKey = _l.sent(), _k.contentResource = contentResource, _k)]))];
8717
+ case 10: return [2 /*return*/, _f.apply(_e, _k.concat([(_l.wrappedStateKey = _m.sent(), _l.contentResource = contentResource, _l)]))];
8716
8718
  }
8717
8719
  });
8718
8720
  });
8719
8721
  };
8720
8722
  Item2Service.prototype.prepareChangeItemParents = function (options, itemKey) {
8721
8723
  return __awaiter(this, void 0, void 0, function () {
8722
- var parentsToAdd, _c;
8724
+ var parentsToAdd, _d;
8723
8725
  var _this = this;
8724
- return __generator(this, function (_d) {
8725
- switch (_d.label) {
8726
+ return __generator(this, function (_e) {
8727
+ switch (_e.label) {
8726
8728
  case 0:
8727
8729
  if (!options.parentsToAdd) return [3 /*break*/, 2];
8728
8730
  return [4 /*yield*/, Promise.all(options.parentsToAdd.map(function (t) { return _this.prepareParentDirectory(t, itemKey); }))];
8729
8731
  case 1:
8730
- _c = _d.sent();
8732
+ _d = _e.sent();
8731
8733
  return [3 /*break*/, 3];
8732
8734
  case 2:
8733
- _c = [];
8734
- _d.label = 3;
8735
+ _d = [];
8736
+ _e.label = 3;
8735
8737
  case 3:
8736
- parentsToAdd = _c;
8738
+ parentsToAdd = _d;
8737
8739
  return [2 /*return*/, {
8738
8740
  directoriesToRemove: options.parentsToRemove || [],
8739
8741
  directoriesToAdd: parentsToAdd,
@@ -8744,56 +8746,59 @@
8744
8746
  };
8745
8747
  Item2Service.prototype.prepareItem = function (key, options) {
8746
8748
  return __awaiter(this, void 0, void 0, function () {
8747
- var plainMetaJson, cipherMetaClearJson, _c, _d;
8748
- return __generator(this, function (_e) {
8749
- switch (_e.label) {
8749
+ var plainMetaJson, cipherMetaClearJson, _d, _e;
8750
+ return __generator(this, function (_f) {
8751
+ switch (_f.label) {
8750
8752
  case 0:
8751
8753
  plainMetaJson = options.plainMetaJson, cipherMetaClearJson = options.cipherMetaClearJson;
8752
- _c = {
8754
+ _d = {
8753
8755
  plainMeta: plainMetaJson && JSON.stringify(plainMetaJson)
8754
8756
  };
8755
- _d = cipherMetaClearJson;
8756
- if (!_d) return [3 /*break*/, 2];
8757
+ _e = cipherMetaClearJson;
8758
+ if (!_e) return [3 /*break*/, 2];
8757
8759
  return [4 /*yield*/, this.keyGraph.encryptToString(key, cipherMetaClearJson)];
8758
8760
  case 1:
8759
- _d = (_e.sent());
8760
- _e.label = 2;
8761
- case 2: return [2 /*return*/, (_c.cipherMeta = _d,
8762
- _c)];
8761
+ _e = (_f.sent());
8762
+ _f.label = 2;
8763
+ case 2: return [2 /*return*/, (_d.cipherMeta = _e,
8764
+ _d)];
8763
8765
  }
8764
8766
  });
8765
8767
  });
8766
8768
  };
8767
8769
  Item2Service.prototype.prepareCreateDirectory = function (options) {
8768
- var _a, _b;
8770
+ var _a, _b, _c;
8769
8771
  return __awaiter(this, void 0, void 0, function () {
8770
- var directoryKey, parentDirectories, parentRootDirectory, rootKey, _c, itemInput;
8772
+ var directoryKey, parentDirectories, parentRootDirectory, rootKey, _d, itemInput;
8771
8773
  var _this = this;
8772
- return __generator(this, function (_d) {
8773
- switch (_d.label) {
8774
+ return __generator(this, function (_e) {
8775
+ switch (_e.label) {
8774
8776
  case 0: return [4 /*yield*/, this.keyFactory.createKey()];
8775
8777
  case 1:
8776
- directoryKey = _d.sent();
8778
+ directoryKey = _e.sent();
8777
8779
  options.parentDirectories = options.parentDirectories || [];
8778
8780
  if (!options.asRootDirectory && !((_a = options.parentDirectories) === null || _a === void 0 ? void 0 : _a.length)) {
8779
- throw new KcBadArgumentException('A new directory must be either a root directory or a sub-directory. So you must provide either parentDirectories and/or asRootDirectory parameter.');
8781
+ throw new KcBadArgumentException('A new directory must be either a root directory or a sub-directory. So you must provide either parentDirectories or asRootDirectory parameter.');
8782
+ }
8783
+ if (options.asRootDirectory && ((_b = options.parentDirectories) === null || _b === void 0 ? void 0 : _b.length)) {
8784
+ throw new KcBadArgumentException('A new directory must be either a root directory or a sub-directory. So you can only provide either parentDirectories or asRootDirectory parameter.');
8780
8785
  }
8781
- return [4 /*yield*/, Promise.all((_b = options.parentDirectories) === null || _b === void 0 ? void 0 : _b.map(function (t) { return _this.prepareParentDirectory(t, directoryKey); }))];
8786
+ return [4 /*yield*/, Promise.all((_c = options.parentDirectories) === null || _c === void 0 ? void 0 : _c.map(function (t) { return _this.prepareParentDirectory(t, directoryKey); }))];
8782
8787
  case 2:
8783
- parentDirectories = _d.sent();
8788
+ parentDirectories = _e.sent();
8784
8789
  if (!options.asRootDirectory) return [3 /*break*/, 4];
8785
8790
  rootKey = this.keyService.getCurrentRootKey();
8786
- _c = {
8791
+ _d = {
8787
8792
  wrappingKeyId: rootKey.id
8788
8793
  };
8789
8794
  return [4 /*yield*/, this.keyGraph.wrapKey(rootKey, directoryKey)];
8790
8795
  case 3:
8791
- parentRootDirectory = (_c.wrappedKey = _d.sent(),
8792
- _c);
8793
- _d.label = 4;
8796
+ parentRootDirectory = (_d.wrappedKey = _e.sent(),
8797
+ _d);
8798
+ _e.label = 4;
8794
8799
  case 4: return [4 /*yield*/, this.prepareItem(directoryKey, options)];
8795
8800
  case 5:
8796
- itemInput = _d.sent();
8801
+ itemInput = _e.sent();
8797
8802
  return [2 /*return*/, Object.assign(Object.assign({}, itemInput), { parentDirectories: parentDirectories,
8798
8803
  parentRootDirectory: parentRootDirectory })];
8799
8804
  }
@@ -8803,14 +8808,14 @@
8803
8808
  Item2Service.prototype.prepareUpdateDirectory = function (options) {
8804
8809
  return __awaiter(this, void 0, void 0, function () {
8805
8810
  var directoryKey, itemInput;
8806
- return __generator(this, function (_c) {
8807
- switch (_c.label) {
8811
+ return __generator(this, function (_d) {
8812
+ switch (_d.label) {
8808
8813
  case 0: return [4 /*yield*/, this.getDirectoryKey(options.directoryId, options.directoryKeyId)];
8809
8814
  case 1:
8810
- directoryKey = _c.sent();
8815
+ directoryKey = _d.sent();
8811
8816
  return [4 /*yield*/, this.prepareItem(directoryKey.jwk, options)];
8812
8817
  case 2:
8813
- itemInput = _c.sent();
8818
+ itemInput = _d.sent();
8814
8819
  return [2 /*return*/, Object.assign(Object.assign({}, itemInput), { directoryId: options.directoryId })];
8815
8820
  }
8816
8821
  });
@@ -8820,18 +8825,18 @@
8820
8825
  return __awaiter(this, void 0, void 0, function () {
8821
8826
  var fileKey, parentDirectories, input;
8822
8827
  var _this = this;
8823
- return __generator(this, function (_c) {
8824
- switch (_c.label) {
8828
+ return __generator(this, function (_d) {
8829
+ switch (_d.label) {
8825
8830
  case 0: return [4 /*yield*/, this.keyFactory.createKey()];
8826
8831
  case 1:
8827
- fileKey = _c.sent();
8832
+ fileKey = _d.sent();
8828
8833
  return [4 /*yield*/, Promise.all(options.parentDirectories.map(function (t) { return __awaiter(_this, void 0, void 0, function () {
8829
- var _c, directoryId, wrappingKeyId, wrappedKey;
8830
- return __generator(this, function (_d) {
8831
- switch (_d.label) {
8834
+ var _d, directoryId, wrappingKeyId, wrappedKey;
8835
+ return __generator(this, function (_e) {
8836
+ switch (_e.label) {
8832
8837
  case 0: return [4 /*yield*/, this.prepareParentDirectory(t, fileKey)];
8833
8838
  case 1:
8834
- _c = _d.sent(), directoryId = _c.directoryId, wrappingKeyId = _c.wrappingKeyId, wrappedKey = _c.wrappedKey;
8839
+ _d = _e.sent(), directoryId = _d.directoryId, wrappingKeyId = _d.wrappingKeyId, wrappedKey = _d.wrappedKey;
8835
8840
  // remap from ParentDirectoryInput to FileParentDirectoryInput
8836
8841
  // TODO the server should really just use wrappedKey instead of wrappedFileKey
8837
8842
  return [2 /*return*/, {
@@ -8843,10 +8848,10 @@
8843
8848
  });
8844
8849
  }); }))];
8845
8850
  case 2:
8846
- parentDirectories = _c.sent();
8851
+ parentDirectories = _d.sent();
8847
8852
  return [4 /*yield*/, this.prepareCreateFileState(fileKey, options)];
8848
8853
  case 3:
8849
- input = _c.sent();
8854
+ input = _d.sent();
8850
8855
  return [2 /*return*/, Object.assign(Object.assign({}, input), { parentDirectories: parentDirectories })];
8851
8856
  }
8852
8857
  });
@@ -8855,14 +8860,14 @@
8855
8860
  Item2Service.prototype.prepareUpdateFile = function (options) {
8856
8861
  return __awaiter(this, void 0, void 0, function () {
8857
8862
  var fileKey, input;
8858
- return __generator(this, function (_c) {
8859
- switch (_c.label) {
8863
+ return __generator(this, function (_d) {
8864
+ switch (_d.label) {
8860
8865
  case 0: return [4 /*yield*/, this.getFileKey(options.fileId, options.fileKeyId)];
8861
8866
  case 1:
8862
- fileKey = _c.sent();
8867
+ fileKey = _d.sent();
8863
8868
  return [4 /*yield*/, this.prepareCreateFileState(fileKey.jwk, options)];
8864
8869
  case 2:
8865
- input = _c.sent();
8870
+ input = _d.sent();
8866
8871
  return [2 /*return*/, Object.assign(Object.assign({}, input), { fileId: options.fileId })];
8867
8872
  }
8868
8873
  });
@@ -8871,14 +8876,14 @@
8871
8876
  Item2Service.prototype.prepareChangeDirectoryParents = function (options) {
8872
8877
  return __awaiter(this, void 0, void 0, function () {
8873
8878
  var directoryKey, input;
8874
- return __generator(this, function (_c) {
8875
- switch (_c.label) {
8879
+ return __generator(this, function (_d) {
8880
+ switch (_d.label) {
8876
8881
  case 0: return [4 /*yield*/, this.getDirectoryKey(options.directoryId, options.directoryKeyId)];
8877
8882
  case 1:
8878
- directoryKey = _c.sent();
8883
+ directoryKey = _d.sent();
8879
8884
  return [4 /*yield*/, this.prepareChangeItemParents(options, directoryKey.jwk)];
8880
8885
  case 2:
8881
- input = _c.sent();
8886
+ input = _d.sent();
8882
8887
  return [2 /*return*/, Object.assign(Object.assign({}, input), { directoryId: options.directoryId })];
8883
8888
  }
8884
8889
  });
@@ -8887,14 +8892,14 @@
8887
8892
  Item2Service.prototype.prepareChangeFileParents = function (options) {
8888
8893
  return __awaiter(this, void 0, void 0, function () {
8889
8894
  var fileKey, input;
8890
- return __generator(this, function (_c) {
8891
- switch (_c.label) {
8895
+ return __generator(this, function (_d) {
8896
+ switch (_d.label) {
8892
8897
  case 0: return [4 /*yield*/, this.getFileKey(options.fileId, options.fileKeyId)];
8893
8898
  case 1:
8894
- fileKey = _c.sent();
8899
+ fileKey = _d.sent();
8895
8900
  return [4 /*yield*/, this.prepareChangeItemParents(options, fileKey.jwk)];
8896
8901
  case 2:
8897
- input = _c.sent();
8902
+ input = _d.sent();
8898
8903
  return [2 /*return*/, Object.assign(Object.assign({}, input), { fileId: options.fileId })];
8899
8904
  }
8900
8905
  });
@@ -11530,7 +11535,7 @@
11530
11535
  ]; };
11531
11536
  var templateObject_1$p;
11532
11537
 
11533
- var TrustedPartyProperties = "\n id\n user {\n id\n username\n }\n other{\n id\n username,\n features {\n shareVault\n }\n }\n sharedContactCard {\n " + SharedContactCardFields + "\n }\n myContactCard {\n " + SharedContactCardFields + "\n }\n sharedScenarios {\n edges {\n node {\n id\n }\n }\n }\n sharedItems {\n directories {\n edges {\n node {\n id\n }\n }\n }\n }\n currentUserSharedKey {\n userSharedKey {\n keyExchange {\n " + KeyExchangeFields + "\n }\n " + UserSharedKeyFields + "\n }\n }";
11538
+ var TrustedPartyProperties = "\n id\n user {\n id\n username\n }\n other{\n id\n username,\n features {\n shareVault\n }\n }\n sharedContactCard {\n " + SharedContactCardFields + "\n }\n myContactCard {\n " + SharedContactCardFields + "\n }\n sharedScenarios {\n edges {\n node {\n id\n }\n }\n }\n theirItems {\n directories {\n edges {\n node {\n id\n }\n }\n }\n }\n currentUserSharedKey {\n userSharedKey {\n keyExchange {\n " + KeyExchangeFields + "\n }\n " + UserSharedKeyFields + "\n }\n }";
11534
11539
  var GetTrustedPartiesQuery = gql__default['default'](templateObject_1$q || (templateObject_1$q = __makeTemplateObject(["\nquery GetTrustedPartiesQuery {\n tps {\n edges {\n node {\n ", "\n }\n }\n }\n ", "\n}"], ["\nquery GetTrustedPartiesQuery {\n tps {\n edges {\n node {\n ", "\n }\n }\n }\n ", "\n}"])), TrustedPartyProperties, KeyGraphField);
11535
11540
  var GetAllTrustedPartiesQuery = gql__default['default'](templateObject_2$m || (templateObject_2$m = __makeTemplateObject(["\nquery GetAllTrustedPartiesQuery($userId: ID, $isExpired: Boolean, $inviteState: String, $sentInviteState: String) {\n tps {\n edges {\n node {\n ", "\n }\n }\n }\n invites: keyExchanges(\n responder: $userId\n isExpired: $isExpired\n state: $inviteState\n orderBy: \"state,-created\"\n ) {\n edges {\n node {\n ", "\n }\n }\n }\n sentInvites: keyExchanges(\n initiator: $userId\n isExpired: $isExpired\n state: $sentInviteState\n orderBy: \"state,-created\"\n ) {\n edges {\n node {\n ", "\n }\n }\n }\n ", "\n}"], ["\nquery GetAllTrustedPartiesQuery($userId: ID, $isExpired: Boolean, $inviteState: String, $sentInviteState: String) {\n tps {\n edges {\n node {\n ", "\n }\n }\n }\n invites: keyExchanges(\n responder: $userId\n isExpired: $isExpired\n state: $inviteState\n orderBy: \"state,-created\"\n ) {\n edges {\n node {\n ", "\n }\n }\n }\n sentInvites: keyExchanges(\n initiator: $userId\n isExpired: $isExpired\n state: $sentInviteState\n orderBy: \"state,-created\"\n ) {\n edges {\n node {\n ", "\n }\n }\n }\n ", "\n}"])), TrustedPartyProperties, KeyExchangeFields, KeyExchangeFields, KeyGraphField);
11536
11541
  var GetTrustedPartyQuery = gql__default['default'](templateObject_3$j || (templateObject_3$j = __makeTemplateObject(["\nquery GetTrustedPartyQuery($partyId: LrRelayIdInput!) {\n tp(id: $partyId) {\n ", "\n }\n ", "\n}"], ["\nquery GetTrustedPartyQuery($partyId: LrRelayIdInput!) {\n tp(id: $partyId) {\n ", "\n }\n ", "\n}"])), TrustedPartyProperties, KeyGraphField);
@@ -11974,7 +11979,7 @@
11974
11979
  id: tp.id,
11975
11980
  type: TrustedPartyType.User,
11976
11981
  hasScenarios: !!tp.sharedScenarios.edges.length,
11977
- hasSharedVault: !!tp.sharedItems.directories.edges.length,
11982
+ hasSharedVault: !!tp.theirItems.directories.edges.length,
11978
11983
  name: contactCard && contactCard.name && contactCard.name.name,
11979
11984
  details: contactCard,
11980
11985
  mySharedDetails: myContactCard,