@lifeready/core 1.1.7 → 1.1.8

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.
@@ -3169,6 +3169,47 @@
3169
3169
  _this.variables = options.variables;
3170
3170
  return _this;
3171
3171
  }
3172
+ /**
3173
+ * Select a different set of fields from the mutation. Example usage:
3174
+ *
3175
+ * interface CreateDirectoryMutationResult {
3176
+ * createDirectory: {
3177
+ * directory: DirectoryNode;
3178
+ * };
3179
+ * };
3180
+ *
3181
+ * const CreateDirectoryMutation = gqlTyped<CreateDirectoryMutationResult>`
3182
+ * mutation CreateDirectoryMutation(...) {
3183
+ * createDirectory(...) {
3184
+ * directory {
3185
+ * id
3186
+ * }
3187
+ * }
3188
+ * }
3189
+ * `
3190
+ * interface CreateDirectoryFragmentResult {
3191
+ * createDirectory: {
3192
+ * directory: DirectoryNode;
3193
+ * };
3194
+ * };
3195
+ *
3196
+ * const CreateDirectoryFragment = gqlTyped<CreateDirectoryFragmentResult>`
3197
+ * // Note that the string 'createDirectory' can not be changed.
3198
+ * // It must match with the mutation field above.
3199
+ * // The 'CreateDirectoryPayload' is the return type of the mutation.
3200
+ * fragment createDirectory on CreateDirectoryPayload {
3201
+ * directory {
3202
+ * plainMeta
3203
+ * }
3204
+ * }
3205
+ * `
3206
+ * lrGraphQLService.lrMutate({
3207
+ * mutation: CreateDirectoryMutation
3208
+ * }).select(CreateDirectoryFragment).createDirectory.directory.plainMeta.
3209
+ *
3210
+ * @param fragments
3211
+ * @returns
3212
+ */
3172
3213
  LrMutation.prototype.select = function (fragments) {
3173
3214
  // Don't touch the original
3174
3215
  var mutationDoc = _.cloneDeep(this.mutation);
@@ -3383,7 +3424,6 @@
3383
3424
  // Rename and merge selections
3384
3425
  selections = __spread(selections, _this.renameSelections(childMutationNode.selectionSet.selections, prefix));
3385
3426
  try {
3386
- // TODO Rename and merge fragments
3387
3427
  // Rename and merge variables
3388
3428
  for (var _c = __values(Object.keys(variables)), _d = _c.next(); !_d.done; _d = _c.next()) {
3389
3429
  var key2 = _d.value;
@@ -3436,7 +3476,7 @@
3436
3476
  }
3437
3477
  LrGraphQLService.prototype.query = function (options) {
3438
3478
  return __awaiter(this, void 0, void 0, function () {
3439
- var includeKeyGraph, operation, response, data;
3479
+ var includeKeyGraph, operation, operation, response, data;
3440
3480
  return __generator(this, function (_a) {
3441
3481
  switch (_a.label) {
3442
3482
  case 0:
@@ -3449,6 +3489,13 @@
3449
3489
  keyGraphFieldAstSelection,
3450
3490
  ]);
3451
3491
  }
3492
+ if (options.name) {
3493
+ operation = getQuery(options.query);
3494
+ operation.name = {
3495
+ kind: 'Name',
3496
+ value: options.name,
3497
+ };
3498
+ }
3452
3499
  return [4 /*yield*/, this.apollo.query(options).toPromise()];
3453
3500
  case 1:
3454
3501
  response = _a.sent();
@@ -3489,7 +3536,7 @@
3489
3536
  };
3490
3537
  LrGraphQLService.prototype.apolloMutate = function (options) {
3491
3538
  return __awaiter(this, void 0, void 0, function () {
3492
- var includeKeyGraph, operation, response, data;
3539
+ var includeKeyGraph, operation, operation, response, data;
3493
3540
  return __generator(this, function (_a) {
3494
3541
  switch (_a.label) {
3495
3542
  case 0:
@@ -3502,6 +3549,13 @@
3502
3549
  fetchKeyGraphFieldAstSelection,
3503
3550
  ]);
3504
3551
  }
3552
+ if (options.name) {
3553
+ operation = getMutation(options.mutation);
3554
+ operation.name = {
3555
+ kind: 'Name',
3556
+ value: options.name,
3557
+ };
3558
+ }
3505
3559
  // Format to string and parse again. This allows the "loc": { "start": ... }
3506
3560
  // part of the DocumentNode to be correctly setup. It's extra processing
3507
3561
  // in serialising and parsing, but probably minimal overhead.
@@ -8217,6 +8271,16 @@
8217
8271
  Item2Service.prototype.beginDeleteChildItemLinksWindow = function (options) {
8218
8272
  return this.mutate(this.beginDeleteChildItemLinksWindowMutation(options));
8219
8273
  };
8274
+ /**
8275
+ * Schedule cleanup of the hard links in a directory.
8276
+ * The server will delete all hard link within the directory within a time window: starting from now and
8277
+ * ending at requestWindowMs after now.
8278
+ * The server decides _when_ it will perform the delete. It's not guaranteed that it will perform
8279
+ * the delete at "now + requestWindowMs", but it will happen at some time after "now + requestWindowMs".
8280
+ * This allows multiple overlapping calls to this function and the server allocates enough for each request.
8281
+ * The server has a setting that allows for a maximum value on requestWindowMs. If the requested value
8282
+ * is larger than this maximum, the call will fail.
8283
+ */
8220
8284
  Item2Service.prototype.beginDeleteChildItemLinksWindowMutation = function (options) {
8221
8285
  return __awaiter(this, void 0, void 0, function () {
8222
8286
  return __generator(this, function (_c) {