@lifeready/core 8.0.3 → 8.0.5

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.
@@ -9986,42 +9986,6 @@ mutation DeleteTpMutation($input: DeleteTpInput!) {
9986
9986
  }
9987
9987
  }
9988
9988
  `;
9989
- const ShareDirectoryMutation = gqlTyped `
9990
- mutation ShareDirectoryMutation($input: ShareDirectoryInput!) {
9991
- shareDirectory(input: $input) {
9992
- directoryShare {
9993
- id
9994
- }
9995
- }
9996
- }
9997
- `;
9998
- const UnshareDirectoryMutation = gqlTyped `
9999
- mutation UnshareDirectoryMutation($input: UnshareDirectoryInput!) {
10000
- unshareDirectory(input: $input) {
10001
- directoryShare {
10002
- id
10003
- }
10004
- }
10005
- }
10006
- `;
10007
- const ShareFileMutation = gqlTyped `
10008
- mutation ShareFileMutation($input: ShareFileInput!) {
10009
- shareFile(input: $input) {
10010
- fileShare {
10011
- id
10012
- }
10013
- }
10014
- }
10015
- `;
10016
- const UnshareFileMutation = gqlTyped `
10017
- mutation UnshareFileMutation($input: UnshareFileInput!) {
10018
- unshareFile(input: $input) {
10019
- fileShare {
10020
- id
10021
- }
10022
- }
10023
- }
10024
- `;
10025
9989
  const CreateDirectoryShareMutation = gqlTyped `
10026
9990
  mutation CreateDirectoryShareMutation($input: CreateDirectoryShareInput!) {
10027
9991
  createDirectoryShare(input: $input) {
@@ -10158,85 +10122,6 @@ let TrustedPartyService = class TrustedPartyService extends LrService {
10158
10122
  },
10159
10123
  });
10160
10124
  }
10161
- shareDirectory(options) {
10162
- return __awaiter(this, void 0, void 0, function* () {
10163
- return this.mutate(this.shareDirectoryMutation(options));
10164
- });
10165
- }
10166
- shareDirectoryMutation(options) {
10167
- return __awaiter(this, void 0, void 0, function* () {
10168
- return new LrMutation({
10169
- mutation: ShareDirectoryMutation,
10170
- variables: yield this.prepareShareItemMutation(Object.assign(Object.assign({}, options), { isDirectory: true })),
10171
- });
10172
- });
10173
- }
10174
- shareFile(options) {
10175
- return __awaiter(this, void 0, void 0, function* () {
10176
- return this.mutate(this.shareFileMutation(options));
10177
- });
10178
- }
10179
- shareFileMutation(options) {
10180
- return __awaiter(this, void 0, void 0, function* () {
10181
- return new LrMutation({
10182
- mutation: ShareFileMutation,
10183
- variables: yield this.prepareShareItemMutation(Object.assign(Object.assign({}, options), { isDirectory: false })),
10184
- });
10185
- });
10186
- }
10187
- prepareShareItemMutation(options) {
10188
- return __awaiter(this, void 0, void 0, function* () {
10189
- const { itemId, itemKeyId, tpId, tpSharedKeyId, accessRole, isDirectory } = options;
10190
- const itemKey = yield this.keyGraph.getKey(itemKeyId, () => isDirectory
10191
- ? this.itemService.getDirectoryKeyId(itemId)
10192
- : this.itemService.getFileKeyId(itemId));
10193
- const wrappingKey = yield this.keyGraph.getKey(tpSharedKeyId, () => this.getTpCurrentUserSharedKey(tpId).then((res) => res.sharedKey.id));
10194
- const wrappedKey = yield this.keyGraph.wrapKey(wrappingKey, itemKey.jwk);
10195
- return {
10196
- input: {
10197
- id: itemId,
10198
- tpId,
10199
- accessRole,
10200
- keyId: itemKey.id,
10201
- wrappingKeyId: wrappingKey.id,
10202
- wrappedKey,
10203
- },
10204
- };
10205
- });
10206
- }
10207
- unshareDirectory(options) {
10208
- return __awaiter(this, void 0, void 0, function* () {
10209
- return this.mutate(this.unshareDirectoryMutation(options));
10210
- });
10211
- }
10212
- unshareDirectoryMutation(options) {
10213
- return __awaiter(this, void 0, void 0, function* () {
10214
- return this.unshareItemMutation(Object.assign(Object.assign({}, options), { isDirectory: true }));
10215
- });
10216
- }
10217
- unshareFile(options) {
10218
- return __awaiter(this, void 0, void 0, function* () {
10219
- return this.mutate(this.unshareFileMutation(options));
10220
- });
10221
- }
10222
- unshareFileMutation(options) {
10223
- return __awaiter(this, void 0, void 0, function* () {
10224
- return this.unshareItemMutation(Object.assign(Object.assign({}, options), { isDirectory: false }));
10225
- });
10226
- }
10227
- unshareItemMutation({ itemId, tpId, isDirectory, }) {
10228
- return __awaiter(this, void 0, void 0, function* () {
10229
- return new LrMutation({
10230
- mutation: isDirectory ? UnshareDirectoryMutation : UnshareFileMutation,
10231
- variables: {
10232
- input: {
10233
- id: itemId,
10234
- tpId,
10235
- },
10236
- },
10237
- });
10238
- });
10239
- }
10240
10125
  createDirectoryShare(options) {
10241
10126
  return __awaiter(this, void 0, void 0, function* () {
10242
10127
  return this.mutate(this.createDirectoryShareMutation(options));
@@ -10246,7 +10131,7 @@ let TrustedPartyService = class TrustedPartyService extends LrService {
10246
10131
  return __awaiter(this, void 0, void 0, function* () {
10247
10132
  return new LrMutation({
10248
10133
  mutation: CreateDirectoryShareMutation,
10249
- variables: yield this.prepareCreateSharedItemMutation(Object.assign(Object.assign({}, options), { isDirectory: true })),
10134
+ variables: yield this.prepareCreateItemShareMutation(Object.assign(Object.assign({}, options), { isDirectory: true })),
10250
10135
  });
10251
10136
  });
10252
10137
  }
@@ -10259,18 +10144,16 @@ let TrustedPartyService = class TrustedPartyService extends LrService {
10259
10144
  return __awaiter(this, void 0, void 0, function* () {
10260
10145
  return new LrMutation({
10261
10146
  mutation: CreateFileShareMutation,
10262
- variables: yield this.prepareCreateSharedItemMutation(Object.assign(Object.assign({}, options), { isDirectory: false })),
10147
+ variables: yield this.prepareCreateItemShareMutation(Object.assign(Object.assign({}, options), { isDirectory: false })),
10263
10148
  });
10264
10149
  });
10265
10150
  }
10266
- prepareCreateSharedItemMutation(options) {
10151
+ prepareCreateItemShareMutation(options) {
10267
10152
  return __awaiter(this, void 0, void 0, function* () {
10268
10153
  const { itemId, itemKeyId, tpId, tpSharedKeyId, accessRole, isDirectory, shareType, } = options;
10269
- console.log('createSharedItemMutation()', itemKeyId);
10270
10154
  const itemKey = yield this.keyGraph.getKey(itemKeyId, () => isDirectory
10271
10155
  ? this.itemService.getDirectoryKeyId(itemId)
10272
10156
  : this.itemService.getFileKeyId(itemId));
10273
- console.log('createSharedItemMutation()', itemKey.id);
10274
10157
  const wrappingKey = yield this.keyGraph.getKey(tpSharedKeyId, () => this.getTpCurrentUserSharedKey(tpId).then((res) => res.sharedKey.id));
10275
10158
  const wrappedKey = yield this.keyGraph.wrapKey(wrappingKey, itemKey.jwk);
10276
10159
  return {
@@ -10295,7 +10178,7 @@ let TrustedPartyService = class TrustedPartyService extends LrService {
10295
10178
  return __awaiter(this, void 0, void 0, function* () {
10296
10179
  return new LrMutation({
10297
10180
  mutation: UpdateDirectoryShareMutation,
10298
- variables: this.prepareUpdateSharedItemMutation(options),
10181
+ variables: this.prepareUpdateItemShareMutation(options),
10299
10182
  });
10300
10183
  });
10301
10184
  }
@@ -10308,15 +10191,15 @@ let TrustedPartyService = class TrustedPartyService extends LrService {
10308
10191
  return __awaiter(this, void 0, void 0, function* () {
10309
10192
  return new LrMutation({
10310
10193
  mutation: UpdateFileShareMutation,
10311
- variables: this.prepareUpdateSharedItemMutation(options),
10194
+ variables: this.prepareUpdateItemShareMutation(options),
10312
10195
  });
10313
10196
  });
10314
10197
  }
10315
- prepareUpdateSharedItemMutation(options) {
10316
- const { sharedItemId, accessRole } = options;
10198
+ prepareUpdateItemShareMutation(options) {
10199
+ const { itemShareId, accessRole } = options;
10317
10200
  return {
10318
10201
  input: {
10319
- id: sharedItemId,
10202
+ id: itemShareId,
10320
10203
  accessRole,
10321
10204
  },
10322
10205
  };
@@ -10347,7 +10230,7 @@ let TrustedPartyService = class TrustedPartyService extends LrService {
10347
10230
  return __awaiter(this, void 0, void 0, function* () {
10348
10231
  return new LrMutation({
10349
10232
  mutation: CompleteDetachedDirectoryShareMutation,
10350
- variables: yield this.prepareCompleteDetachedSharedItemMutation(Object.assign(Object.assign({}, options), { isDirectory: true })),
10233
+ variables: yield this.prepareCompleteDetachedItemShareMutation(Object.assign(Object.assign({}, options), { isDirectory: true })),
10351
10234
  });
10352
10235
  });
10353
10236
  }
@@ -10360,21 +10243,21 @@ let TrustedPartyService = class TrustedPartyService extends LrService {
10360
10243
  return __awaiter(this, void 0, void 0, function* () {
10361
10244
  return new LrMutation({
10362
10245
  mutation: CompleteDetachedFileShareMutation,
10363
- variables: yield this.prepareCompleteDetachedSharedItemMutation(Object.assign(Object.assign({}, options), { isDirectory: false })),
10246
+ variables: yield this.prepareCompleteDetachedItemShareMutation(Object.assign(Object.assign({}, options), { isDirectory: false })),
10364
10247
  });
10365
10248
  });
10366
10249
  }
10367
- prepareCompleteDetachedSharedItemMutation(options) {
10250
+ prepareCompleteDetachedItemShareMutation(options) {
10368
10251
  return __awaiter(this, void 0, void 0, function* () {
10369
- const { sharedItemId, itemKeyId, isDirectory } = options;
10252
+ const { itemShareId, itemKeyId, isDirectory } = options;
10370
10253
  const itemKey = yield this.keyGraph.getKey(itemKeyId, () => isDirectory
10371
- ? this.itemService.getDirectoryKeyIdFromDirectoryShare(sharedItemId)
10372
- : this.itemService.getFileKeyIdFromFileShare(sharedItemId));
10254
+ ? this.itemService.getDirectoryKeyIdFromDirectoryShare(itemShareId)
10255
+ : this.itemService.getFileKeyIdFromFileShare(itemShareId));
10373
10256
  const rootKey = this.keyService.currentRootKey;
10374
10257
  const wrappedKey = yield this.keyGraph.wrapKey(rootKey, itemKey.jwk);
10375
10258
  return {
10376
10259
  input: {
10377
- id: sharedItemId,
10260
+ id: itemShareId,
10378
10261
  keyId: itemKey.id,
10379
10262
  wrappingKeyId: rootKey.id,
10380
10263
  wrappedKey,