@salesforce/lds-worker-api 1.432.0 → 1.434.0

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.
@@ -4274,7 +4274,7 @@ function withDefaultLuvio(callback) {
4274
4274
  }
4275
4275
  callbacks.push(callback);
4276
4276
  }
4277
- // version: 1.432.0-a57c62b660
4277
+ // version: 1.434.0-d8deb0d4ea
4278
4278
 
4279
4279
  // TODO [TD-0081508]: once that TD is fulfilled we can probably change this file
4280
4280
  function instrumentAdapter$1(createFunction, _metadata) {
@@ -5318,7 +5318,7 @@ function createGraphQLWireAdapterConstructor(luvio, adapter, metadata, astResolv
5318
5318
  const { apiFamily, name } = metadata;
5319
5319
  return createGraphQLWireAdapterConstructor$1(adapter, `${apiFamily}.${name}`, luvio, astResolver);
5320
5320
  }
5321
- // version: 1.432.0-a57c62b660
5321
+ // version: 1.434.0-d8deb0d4ea
5322
5322
 
5323
5323
  function isSupportedEntity(_objectApiName) {
5324
5324
  return true;
@@ -5455,28 +5455,23 @@ let configurableCreateContentVersion$3 = new Configurable$3();
5455
5455
  * Depth to which tracked fields will be added to a request that results from a cache miss.
5456
5456
  * A value of 0 inhibits the addition of tracked fields, 1 will add tracked fields that can
5457
5457
  * be reached by following 1 relationship from the root record, etc.
5458
- * @defaultValue '5', replicates the current behavior
5458
+ * @defaultValue '1'
5459
5459
  */
5460
- let trackedFieldDepthOnCacheMiss$3 = 5;
5460
+ let trackedFieldDepthOnCacheMiss$3 = 1;
5461
5461
  /**
5462
5462
  * Depth to which tracked fields will be added to a request that results from a merge conflict
5463
5463
  * A value of 0 inhibits the addition of tracked fields, 1 will add tracked fields that can
5464
5464
  * be reached by following 1 relationship from the root record, etc.
5465
- * @defaultValue '5', replicates the current behavior
5465
+ * @defaultValue '1'
5466
5466
  */
5467
- let trackedFieldDepthOnCacheMergeConflict$3 = 5;
5467
+ let trackedFieldDepthOnCacheMergeConflict$3 = 1;
5468
5468
  /**
5469
5469
  * Depth to which tracked fields will be added to a request that results from a notify change invocation by the consumer
5470
5470
  * A value of 0 inhibits the addition of tracked fields, 1 will add tracked fields that can
5471
5471
  * be reached by following 1 relationship from the root record, etc.
5472
- * @defaultValue '5', replicates the current behavior
5472
+ * @defaultValue '1'
5473
5473
  */
5474
- let trackedFieldDepthOnNotifyChange$3 = 5;
5475
- /**
5476
- * Determines if we will only fetch the 'Id' field for the leaf relationship record
5477
- * @defaultValue 'false', replicates the current behavior and fetches all fields in the store for the leaf relationship record
5478
- */
5479
- let trackedFieldLeafNodeIdAndNameOnly$3 = false;
5474
+ let trackedFieldDepthOnNotifyChange$3 = 1;
5480
5475
  /**
5481
5476
  * One store enabled Get Object Info adapter
5482
5477
  */
@@ -5573,12 +5568,6 @@ const configurationForEnvironmentFactoryOverrides$3 = {
5573
5568
  getTrackedFieldDepthOnNotifyChange: function () {
5574
5569
  return trackedFieldDepthOnNotifyChange$3;
5575
5570
  },
5576
- setTrackedFieldLeafNodeIdAndNameOnly: function (trackedFieldLeafNodeIdAndNameOnlyParam) {
5577
- trackedFieldLeafNodeIdAndNameOnly$3 = trackedFieldLeafNodeIdAndNameOnlyParam;
5578
- },
5579
- getTrackedFieldLeafNodeIdAndNameOnly: function () {
5580
- return trackedFieldLeafNodeIdAndNameOnly$3;
5581
- },
5582
5571
  setRecordRepresentationIngestionOverride: function (ingest) {
5583
5572
  recordRepresentationIngestionOverride$3 = ingest;
5584
5573
  },
@@ -5700,28 +5689,23 @@ let configurableCreateContentVersion$2 = new Configurable$2();
5700
5689
  * Depth to which tracked fields will be added to a request that results from a cache miss.
5701
5690
  * A value of 0 inhibits the addition of tracked fields, 1 will add tracked fields that can
5702
5691
  * be reached by following 1 relationship from the root record, etc.
5703
- * @defaultValue '5', replicates the current behavior
5692
+ * @defaultValue '1'
5704
5693
  */
5705
- let trackedFieldDepthOnCacheMiss$2 = 5;
5694
+ let trackedFieldDepthOnCacheMiss$2 = 1;
5706
5695
  /**
5707
5696
  * Depth to which tracked fields will be added to a request that results from a merge conflict
5708
5697
  * A value of 0 inhibits the addition of tracked fields, 1 will add tracked fields that can
5709
5698
  * be reached by following 1 relationship from the root record, etc.
5710
- * @defaultValue '5', replicates the current behavior
5699
+ * @defaultValue '1'
5711
5700
  */
5712
- let trackedFieldDepthOnCacheMergeConflict$2 = 5;
5701
+ let trackedFieldDepthOnCacheMergeConflict$2 = 1;
5713
5702
  /**
5714
5703
  * Depth to which tracked fields will be added to a request that results from a notify change invocation by the consumer
5715
5704
  * A value of 0 inhibits the addition of tracked fields, 1 will add tracked fields that can
5716
5705
  * be reached by following 1 relationship from the root record, etc.
5717
- * @defaultValue '5', replicates the current behavior
5706
+ * @defaultValue '1'
5718
5707
  */
5719
- let trackedFieldDepthOnNotifyChange$2 = 5;
5720
- /**
5721
- * Determines if we will only fetch the 'Id' field for the leaf relationship record
5722
- * @defaultValue 'false', replicates the current behavior and fetches all fields in the store for the leaf relationship record
5723
- */
5724
- let trackedFieldLeafNodeIdAndNameOnly$2 = false;
5708
+ let trackedFieldDepthOnNotifyChange$2 = 1;
5725
5709
  /**
5726
5710
  * One store enabled Get Object Info adapter
5727
5711
  */
@@ -5827,12 +5811,6 @@ const configurationForRestAdapters$2 = {
5827
5811
  getTrackedFieldDepthOnNotifyChange: function () {
5828
5812
  return trackedFieldDepthOnNotifyChange$2;
5829
5813
  },
5830
- setTrackedFieldLeafNodeIdAndNameOnly: function (trackedFieldLeafNodeIdAndNameOnlyParam) {
5831
- trackedFieldLeafNodeIdAndNameOnly$2 = trackedFieldLeafNodeIdAndNameOnlyParam;
5832
- },
5833
- getTrackedFieldLeafNodeIdAndNameOnly: function () {
5834
- return trackedFieldLeafNodeIdAndNameOnly$2;
5835
- },
5836
5814
  setRecordRepresentationIngestionOverride: function (ingest) {
5837
5815
  recordRepresentationIngestionOverride$2 = ingest;
5838
5816
  },
@@ -7673,6 +7651,9 @@ function buildSelectionFromRecord$1(record) {
7673
7651
  return [...sel.selections, DRAFTS_SELECTION$1];
7674
7652
  }
7675
7653
 
7654
+ // Unused suffixes, but leaving in as comments to avoid eslint errors
7655
+ // const CUSTOM_API_NAME_SUFFIX = '__c';
7656
+ // const DMO_API_NAME_SUFFIX = '__dlm';
7676
7657
  const CUSTOM_EXTERNAL_OBJECT_FIELD_SUFFIX$1 = '__x';
7677
7658
  const RECORD_REPRESENTATION_ERROR_VERSION$1 = 'RECORD_REPRESENTATION_ERROR_VERSION_1';
7678
7659
  const RECORD_REPRESENTATION_ERROR_STORE_METADATA_PARAMS$1 = {
@@ -7736,13 +7717,11 @@ function extractTrackedFieldsToTrie$1(recordId, node, root, config, visitedRecor
7736
7717
  if (!isGraphNode$1(field)) {
7737
7718
  continue;
7738
7719
  }
7739
- const { maxDepth, onlyFetchLeafNodeIdAndName } = config;
7720
+ const { maxDepth } = config;
7740
7721
  if (field.isScalar('value') === false && !Array.isArray(field.data?.value)) {
7741
7722
  if (depth + 1 > maxDepth) {
7742
- if (onlyFetchLeafNodeIdAndName === true) {
7743
- addScalarFieldId$1(current);
7744
- addScalarFieldName$1(current);
7745
- }
7723
+ addScalarFieldId$1(current);
7724
+ addScalarFieldName$1(current);
7746
7725
  continue;
7747
7726
  }
7748
7727
  const spanningLink = field.link('value');
@@ -7764,19 +7743,10 @@ function extractTrackedFieldsToTrie$1(recordId, node, root, config, visitedRecor
7764
7743
  current.children[key] = next;
7765
7744
  }
7766
7745
  else {
7767
- // Skip the field, if its value is null at the max level depth.
7768
- // Ideally, it should only skip relationship field. However,
7769
- // on the client, there is not a reliable way to determine the
7770
- // the field type.
7771
7746
  if (depth === maxDepth) {
7772
- if (onlyFetchLeafNodeIdAndName === true) {
7773
- addScalarFieldId$1(current);
7774
- addScalarFieldName$1(current);
7775
- continue;
7776
- }
7777
- if (field.scalar('value') === null && !Array.isArray(field.data?.value)) {
7778
- continue;
7779
- }
7747
+ addScalarFieldId$1(current);
7748
+ addScalarFieldName$1(current);
7749
+ continue;
7780
7750
  }
7781
7751
  const state = fieldValueRep.linkData();
7782
7752
  if (state !== undefined) {
@@ -8162,7 +8132,6 @@ function mergeRecordConflict$1(luvio, incoming, existing, recordConflictMap) {
8162
8132
  };
8163
8133
  const trackedFieldsConfig = {
8164
8134
  maxDepth: configurationForRestAdapters$2.getTrackedFieldDepthOnCacheMergeConflict(),
8165
- onlyFetchLeafNodeIdAndName: configurationForRestAdapters$2.getTrackedFieldLeafNodeIdAndNameOnly(),
8166
8135
  };
8167
8136
  extractTrackedFieldsToTrie$1(recordKey, incomingNode, incomingTrackedFieldsTrieRoot, trackedFieldsConfig);
8168
8137
  extractTrackedFieldsToTrie$1(recordKey, existingNode, existingTrackedFieldsTrieRoot, trackedFieldsConfig);
@@ -8606,7 +8575,6 @@ function prepareRequest$7(luvio, config) {
8606
8575
  const key = keyBuilder$28(luvio, createResourceParams$12(config));
8607
8576
  const allTrackedFields = getTrackedFields$1(key, luvio.getNode(key), {
8608
8577
  maxDepth: configurationForRestAdapters$2.getTrackedFieldDepthOnCacheMiss(),
8609
- onlyFetchLeafNodeIdAndName: configurationForRestAdapters$2.getTrackedFieldLeafNodeIdAndNameOnly(),
8610
8578
  }, config.optionalFields);
8611
8579
  const optionalFields = fields === undefined ? allTrackedFields : difference$1(allTrackedFields, fields);
8612
8580
  const resourceParams = createResourceParams$12({
@@ -8733,7 +8701,6 @@ function ingestSuccessChildResourceParams$8(luvio, childResourceParamsArray, chi
8733
8701
  };
8734
8702
  const childTrackedFields = getTrackedFields$1(childKey, luvio.getNode(childKey), {
8735
8703
  maxDepth: configurationForRestAdapters$2.getTrackedFieldDepthOnCacheMiss(),
8736
- onlyFetchLeafNodeIdAndName: configurationForRestAdapters$2.getTrackedFieldLeafNodeIdAndNameOnly(),
8737
8704
  }, childResourceParams.queryParams.optionalFields);
8738
8705
  const childSnapshot = ingestSuccess$S(luvio, {
8739
8706
  recordId: childResourceParams.urlParams.recordId,
@@ -13906,7 +13873,6 @@ const notifyChangeFactory = (luvio) => {
13906
13873
  const node = luvio.wrapNormalizedGraphNode(record, key);
13907
13874
  const optionalFields = getTrackedFields$1(key, node, {
13908
13875
  maxDepth: configurationForRestAdapters$2.getTrackedFieldDepthOnNotifyChange(),
13909
- onlyFetchLeafNodeIdAndName: configurationForRestAdapters$2.getTrackedFieldLeafNodeIdAndNameOnly(),
13910
13876
  });
13911
13877
  const refreshRequest = createResourceRequestFromRepresentation(record, optionalFields);
13912
13878
  const existingWeakEtag = record.weakEtag;
@@ -16495,7 +16461,6 @@ function buildNetworkSnapshot$V(luvio, config, options) {
16495
16461
  const key = keyBuilder$1w$2(luvio, config);
16496
16462
  const trackedFieldsConfig = {
16497
16463
  maxDepth: configurationForRestAdapters$2.getTrackedFieldDepthOnCacheMiss(),
16498
- onlyFetchLeafNodeIdAndName: configurationForRestAdapters$2.getTrackedFieldLeafNodeIdAndNameOnly()
16499
16464
  };
16500
16465
  const optionalFieldsTrie = convertFieldsToTrie$1(getTrackedFields$1(key, luvio.getNode(key), trackedFieldsConfig, config.optionalFields));
16501
16466
  const fieldsTrie = BLANK_RECORD_FIELDS_TRIE$1;
@@ -30539,7 +30504,6 @@ const buildNetworkSnapshot$6$1 = (luvio, context, config, options) => {
30539
30504
  ...resourceRequest.queryParams,
30540
30505
  optionalFields: getTrackedFields$1(templateRecordKey, luvio.getNode(templateRecordKey), {
30541
30506
  maxDepth: configurationForRestAdapters$2.getTrackedFieldDepthOnCacheMiss(),
30542
- onlyFetchLeafNodeIdAndName: configurationForRestAdapters$2.getTrackedFieldLeafNodeIdAndNameOnly(),
30543
30507
  }, config.optionalFields),
30544
30508
  },
30545
30509
  });
@@ -31074,7 +31038,6 @@ function prepareRequest$8(luvio, context, config) {
31074
31038
  ...resourceRequest.queryParams,
31075
31039
  optionalFields: getTrackedFields$1(recordTemplateKey, luvio.getNode(recordTemplateKey), {
31076
31040
  maxDepth: configurationForRestAdapters$2.getTrackedFieldDepthOnCacheMiss(),
31077
- onlyFetchLeafNodeIdAndName: configurationForRestAdapters$2.getTrackedFieldLeafNodeIdAndNameOnly(),
31078
31041
  }, config.optionalFields),
31079
31042
  },
31080
31043
  });
@@ -31094,7 +31057,6 @@ function onFetchResponseSuccess$O(luvio, context, config, request, response, res
31094
31057
  });
31095
31058
  const allTrackedFields = getTrackedFields$1(templateRecordKey, luvio.getNode(templateRecordKey), {
31096
31059
  maxDepth: configurationForRestAdapters$2.getTrackedFieldDepthOnCacheMiss(),
31097
- onlyFetchLeafNodeIdAndName: configurationForRestAdapters$2.getTrackedFieldLeafNodeIdAndNameOnly(),
31098
31060
  }, optionalFields);
31099
31061
  const allTrackedFieldsTrie = convertFieldsToTrie$1(allTrackedFields, true);
31100
31062
  const ingest = createFieldsIngestSuccess$4({
@@ -32550,7 +32512,7 @@ withDefaultLuvio((luvio) => {
32550
32512
  throttle(60, 60000, setupNotifyAllListRecordUpdateAvailable(luvio));
32551
32513
  throttle(60, 60000, setupNotifyAllListInfoSummaryUpdateAvailable(luvio));
32552
32514
  });
32553
- // version: 1.432.0-b99ba9d219
32515
+ // version: 1.434.0-6aa2dd15e3
32554
32516
 
32555
32517
  var allowUpdatesForNonCachedRecords = {
32556
32518
  isOpen: function (e) {
@@ -44200,7 +44162,7 @@ const { create: create$7, freeze: freeze$4, keys: keys$8, entries: entries$5 } =
44200
44162
  const { hasOwnProperty: hasOwnProperty$3 } = Object.prototype;
44201
44163
  const { isArray: isArray$7 } = Array;
44202
44164
  const { stringify: stringify$9, parse: parse$9 } = JSON;
44203
- let Ok$4 = class Ok {
44165
+ let Ok$3 = class Ok {
44204
44166
  constructor(value) {
44205
44167
  this.value = value;
44206
44168
  }
@@ -44211,7 +44173,7 @@ let Ok$4 = class Ok {
44211
44173
  return !this.isOk();
44212
44174
  }
44213
44175
  };
44214
- let Err$4 = class Err {
44176
+ let Err$3 = class Err {
44215
44177
  constructor(error) {
44216
44178
  this.error = error;
44217
44179
  }
@@ -44222,8 +44184,8 @@ let Err$4 = class Err {
44222
44184
  return !this.isOk();
44223
44185
  }
44224
44186
  };
44225
- const ok$4 = (value) => new Ok$4(value);
44226
- const err$4 = (err2) => new Err$4(err2);
44187
+ const ok$3 = (value) => new Ok$3(value);
44188
+ const err$3 = (err2) => new Err$3(err2);
44227
44189
  function resolvedPromiseLike$4(result) {
44228
44190
  if (isPromiseLike$4(result)) {
44229
44191
  return result.then((nextResult) => nextResult);
@@ -44366,6 +44328,15 @@ function satisfies(provided, requested) {
44366
44328
  const requestedN = requested.split(".").map((s) => parseInt(s));
44367
44329
  return providedN[0] === requestedN[0] && providedN[1] >= requestedN[1];
44368
44330
  }
44331
+ function isUserVisibleError$3(error) {
44332
+ return error instanceof Error && "type" in error && error.type === "user-visible";
44333
+ }
44334
+ function logError$2(error) {
44335
+ if (isUserVisibleError$3(error)) {
44336
+ return;
44337
+ }
44338
+ console.error("OneStore Command threw an error that we did not expect", error);
44339
+ }
44369
44340
 
44370
44341
  /*!
44371
44342
  * Copyright (c) 2022, Salesforce, Inc.,
@@ -44465,20 +44436,20 @@ class IdentifiableTypeRepository {
44465
44436
  const existingNormalizedData = (_a = cache.get(key)) == null ? void 0 : _a.value;
44466
44437
  const normalized = this.normalizeData(cache, { ...input, existingNormalizedData });
44467
44438
  if (normalized.isErr()) {
44468
- return err$4(normalized.error);
44439
+ return err$3(normalized.error);
44469
44440
  }
44470
44441
  cache.set(key, {
44471
44442
  value: normalized.value,
44472
44443
  metadata: this.cacheMetadata
44473
44444
  });
44474
- return ok$4({
44445
+ return ok$3({
44475
44446
  type: "link",
44476
44447
  linkedKey: key
44477
44448
  });
44478
44449
  }
44479
44450
  validateEntry(entry) {
44480
44451
  if (!isCacheEntryForType(entry, this)) {
44481
- return err$4([
44452
+ return err$3([
44482
44453
  {
44483
44454
  type: "incorrectType",
44484
44455
  expectedType: this.typeName,
@@ -44486,7 +44457,7 @@ class IdentifiableTypeRepository {
44486
44457
  }
44487
44458
  ]);
44488
44459
  }
44489
- return ok$4(void 0);
44460
+ return ok$3(void 0);
44490
44461
  }
44491
44462
  query(cache, query) {
44492
44463
  return this.read(cache, {
@@ -44504,12 +44475,12 @@ class IdentifiableTypeRepository {
44504
44475
  if (cacheEntry) {
44505
44476
  const validationResult = this.validateEntry(cacheEntry);
44506
44477
  if (validationResult.isErr()) {
44507
- return err$4([...validationResult.error]);
44478
+ return err$3([...validationResult.error]);
44508
44479
  }
44509
44480
  const normalizedData = cacheEntry.value;
44510
44481
  return this.denormalizeData(cache, { ...input, normalizedData });
44511
44482
  }
44512
- return err$4([this.buildMissingDataError()]);
44483
+ return err$3([this.buildMissingDataError()]);
44513
44484
  }
44514
44485
  equals(x, y) {
44515
44486
  return deepEquals$2(x, y);
@@ -44532,9 +44503,375 @@ function extractReadWriteData(result, errorCollector) {
44532
44503
  }
44533
44504
  function buildReadWriteResult(data, errors) {
44534
44505
  if (errors.length > 0) {
44535
- return err$4(errors);
44506
+ return err$3(errors);
44507
+ }
44508
+ return ok$3(data);
44509
+ }
44510
+
44511
+ /*!
44512
+ * Copyright (c) 2022, Salesforce, Inc.,
44513
+ * All rights reserved.
44514
+ * For full license text, see the LICENSE.txt file
44515
+ */
44516
+ let JsonSchemaViolationError$1 = class JsonSchemaViolationError extends Error {
44517
+ constructor(message, validationErrors) {
44518
+ super(message);
44519
+ this.validationErrors = [];
44520
+ this.validationErrors = validationErrors || [];
44521
+ }
44522
+ };
44523
+ let MinItemsViolationError$1 = class MinItemsViolationError extends JsonSchemaViolationError$1 {
44524
+ };
44525
+ let MaxItemsViolationError$1 = class MaxItemsViolationError extends JsonSchemaViolationError$1 {
44526
+ };
44527
+ let IncorrectTypeError$1 = class IncorrectTypeError extends JsonSchemaViolationError$1 {
44528
+ };
44529
+ let AdditionalPropertiesError$1 = class AdditionalPropertiesError extends JsonSchemaViolationError$1 {
44530
+ };
44531
+ let MissingRequiredPropertyError$1 = class MissingRequiredPropertyError extends JsonSchemaViolationError$1 {
44532
+ };
44533
+ let InvalidRefError$1 = class InvalidRefError extends JsonSchemaViolationError$1 {
44534
+ };
44535
+ let JsonSchemaErrorCollector$1 = class JsonSchemaErrorCollector {
44536
+ constructor() {
44537
+ this.errors = [];
44538
+ }
44539
+ add(error) {
44540
+ this.errors.push(error);
44541
+ }
44542
+ append(response) {
44543
+ if (response.isErr()) {
44544
+ this.errors.push(...response.error);
44545
+ }
44546
+ }
44547
+ hasErrors() {
44548
+ return this.errors.length > 0;
44549
+ }
44550
+ prepend(error) {
44551
+ this.errors.unshift(error);
44552
+ }
44553
+ toValidationResponse() {
44554
+ return !this.hasErrors() ? ok$3(true) : err$3(this.errors);
44555
+ }
44556
+ };
44557
+ function createThrowableError$1(errors) {
44558
+ if (errors[0] instanceof MinItemsViolationError$1) {
44559
+ return new MinItemsViolationError$1(errors[0].message, errors);
44560
+ }
44561
+ if (errors[0] instanceof MaxItemsViolationError$1) {
44562
+ return new MaxItemsViolationError$1(errors[0].message, errors);
44563
+ }
44564
+ if (errors[0] instanceof IncorrectTypeError$1) {
44565
+ return new IncorrectTypeError$1(errors[0].message, errors);
44566
+ }
44567
+ if (errors[0] instanceof AdditionalPropertiesError$1) {
44568
+ return new AdditionalPropertiesError$1(errors[0].message, errors);
44569
+ }
44570
+ if (errors[0] instanceof MissingRequiredPropertyError$1) {
44571
+ return new MissingRequiredPropertyError$1(errors[0].message, errors);
44572
+ }
44573
+ if (errors[0] instanceof InvalidRefError$1) {
44574
+ return new InvalidRefError$1(errors[0].message, errors);
44575
+ }
44576
+ return new JsonSchemaViolationError$1(errors[0].message, errors);
44577
+ }
44578
+ function assertIsValid$1(data, schema) {
44579
+ const validationResponse = validateJsonSchema$1(data, schema);
44580
+ if (validationResponse.isErr()) {
44581
+ throw createThrowableError$1(validationResponse.error);
44582
+ }
44583
+ }
44584
+ function incorrectTypeError$1(expected, actual, path) {
44585
+ return new IncorrectTypeError$1(
44586
+ `Expected type ${expected} at path '${path}', found type ${actual}.`
44587
+ );
44588
+ }
44589
+ function validSchemaResponse$1() {
44590
+ return ok$3(true);
44591
+ }
44592
+ function invalidSchemaResponseWithError$1(error) {
44593
+ return err$3([error]);
44594
+ }
44595
+ function validateJsonSchema$1(data, schema, path = "$", document = schema) {
44596
+ if (schema === true) return validSchemaResponse$1();
44597
+ if (schema === false)
44598
+ return invalidSchemaResponseWithError$1(
44599
+ new JsonSchemaViolationError$1(`Data at ${path} has schema 'false'`)
44600
+ );
44601
+ const dataType = data === null ? "null" : Array.isArray(data) ? "array" : typeof data;
44602
+ const errorCollector = new JsonSchemaErrorCollector$1();
44603
+ if ("anyOf" in schema) {
44604
+ errorCollector.append(validateAnyOf$1(data, schema, path, document));
44605
+ } else if ("oneOf" in schema) {
44606
+ errorCollector.append(validateOneOf$1(data, schema, path, document));
44607
+ } else if ("allOf" in schema) {
44608
+ errorCollector.append(validateAllOf$1(data, schema, path, document));
44609
+ } else if ("not" in schema) {
44610
+ errorCollector.append(validateNot$1(data, schema, path, document));
44611
+ } else if ("$ref" in schema) {
44612
+ errorCollector.append(validateRef$1(data, schema, path, document));
44613
+ } else if ("type" in schema) {
44614
+ if (schema.type === "object") {
44615
+ if (dataType !== "object") {
44616
+ errorCollector.add(incorrectTypeError$1("object", dataType, path));
44617
+ } else {
44618
+ errorCollector.append(
44619
+ validateObject$1(data, schema, path, document)
44620
+ );
44621
+ }
44622
+ } else if (schema.type === "array") {
44623
+ if (dataType !== "array") {
44624
+ errorCollector.add(incorrectTypeError$1("array", dataType, path));
44625
+ } else {
44626
+ errorCollector.append(
44627
+ validateArray$1(data, schema, path, document)
44628
+ );
44629
+ }
44630
+ } else {
44631
+ errorCollector.append(
44632
+ validateScalar$1(data, schema, path)
44633
+ );
44634
+ }
44635
+ }
44636
+ if (schema.enum) {
44637
+ errorCollector.append(validateEnum$1(data, schema.enum, path));
44638
+ }
44639
+ if (schema.const) {
44640
+ errorCollector.append(validateConst$1(data, schema.const, path));
44641
+ }
44642
+ return errorCollector.toValidationResponse();
44643
+ }
44644
+ function validateAnyOf$1(data, schema, path, document) {
44645
+ let isValid = false;
44646
+ const errorCollector = new JsonSchemaErrorCollector$1();
44647
+ for (let i = 0, { length } = schema.anyOf; i < length; i++) {
44648
+ const element = schema.anyOf[i];
44649
+ const validationResponse = validateJsonSchema$1(
44650
+ data,
44651
+ element,
44652
+ `${path}.anyOf[${i}]`,
44653
+ document
44654
+ );
44655
+ if (validationResponse.isOk()) {
44656
+ isValid = true;
44657
+ break;
44658
+ } else {
44659
+ errorCollector.append(validationResponse);
44660
+ }
44661
+ }
44662
+ if (!isValid) {
44663
+ errorCollector.prepend(
44664
+ new JsonSchemaViolationError$1(`Data at ${path} did not match any subschema in anyOf.`)
44665
+ );
44666
+ return errorCollector.toValidationResponse();
44667
+ }
44668
+ return validSchemaResponse$1();
44669
+ }
44670
+ function validateOneOf$1(data, schema, path, document) {
44671
+ let validSubShemaPaths = [];
44672
+ const errorCollector = new JsonSchemaErrorCollector$1();
44673
+ for (let i = 0, { length } = schema.oneOf; i < length; i++) {
44674
+ const element = schema.oneOf[i];
44675
+ const oneOfPath = `${path}.oneOf[${i}]`;
44676
+ const validationResponse = validateJsonSchema$1(data, element, oneOfPath, document);
44677
+ if (validationResponse.isOk()) {
44678
+ validSubShemaPaths.push(oneOfPath);
44679
+ } else {
44680
+ errorCollector.append(validationResponse);
44681
+ }
44682
+ }
44683
+ if (validSubShemaPaths.length === 0) {
44684
+ errorCollector.prepend(
44685
+ new JsonSchemaViolationError$1(`Data at ${path} did not match any subschema in oneOf.`)
44686
+ );
44687
+ return errorCollector.toValidationResponse();
44688
+ } else if (validSubShemaPaths.length > 1) {
44689
+ errorCollector.prepend(
44690
+ new JsonSchemaViolationError$1(
44691
+ `Data at ${path} matched multiple subschemas: [${validSubShemaPaths.join(", ")}].`
44692
+ )
44693
+ );
44694
+ return errorCollector.toValidationResponse();
44695
+ }
44696
+ return validSchemaResponse$1();
44697
+ }
44698
+ function validateAllOf$1(data, schema, path, document) {
44699
+ let isValid = true;
44700
+ const errorCollector = new JsonSchemaErrorCollector$1();
44701
+ for (let i = 0, { length } = schema.allOf; i < length; i++) {
44702
+ const element = schema.allOf[i];
44703
+ const validationResponse = validateJsonSchema$1(
44704
+ data,
44705
+ element,
44706
+ `${path}.allOf[${i}]`,
44707
+ document
44708
+ );
44709
+ if (!validationResponse.isOk()) {
44710
+ errorCollector.append(validationResponse);
44711
+ isValid = false;
44712
+ }
44713
+ }
44714
+ if (!isValid) {
44715
+ errorCollector.prepend(
44716
+ new JsonSchemaViolationError$1(`Data at ${path} did not match some subschemas in allOf.`)
44717
+ );
44718
+ }
44719
+ return errorCollector.toValidationResponse();
44720
+ }
44721
+ function validateNot$1(data, schema, path, document) {
44722
+ const validationResponse = validateJsonSchema$1(data, schema.not, path, document);
44723
+ if (validationResponse.isOk()) {
44724
+ return invalidSchemaResponseWithError$1(
44725
+ new JsonSchemaViolationError$1(
44726
+ `Data at ${path} validated against the schema of a not clause.`
44727
+ )
44728
+ );
44729
+ }
44730
+ return validSchemaResponse$1();
44731
+ }
44732
+ function validateObject$1(data, schema, path, document) {
44733
+ const schemaKeys = Object.keys(schema.properties);
44734
+ const requiredKeys = new Set(schema.required);
44735
+ const schemaKeySet = new Set(schemaKeys);
44736
+ const errorCollector = new JsonSchemaErrorCollector$1();
44737
+ Object.keys(data).forEach((key) => {
44738
+ if (!schemaKeySet.has(key)) {
44739
+ errorCollector.append(
44740
+ validateJsonSchema$1(
44741
+ data[key],
44742
+ schema.additionalProperties,
44743
+ `${path}.additionalProperties[${key}]`,
44744
+ document
44745
+ )
44746
+ );
44747
+ }
44748
+ });
44749
+ for (let i = 0, length = schemaKeys.length; i < length; i++) {
44750
+ const key = schemaKeys[i];
44751
+ const keyInData = key in data && data[key] !== void 0;
44752
+ if (requiredKeys.has(key) && !keyInData) {
44753
+ errorCollector.add(
44754
+ new MissingRequiredPropertyError$1(
44755
+ `Object at path '${path}' is missing required property '${key}'.`
44756
+ )
44757
+ );
44758
+ }
44759
+ if (keyInData) {
44760
+ errorCollector.append(
44761
+ validateJsonSchema$1(
44762
+ data[key],
44763
+ schema.properties[key],
44764
+ `${path}.${key}`,
44765
+ document
44766
+ )
44767
+ );
44768
+ }
44769
+ }
44770
+ return errorCollector.toValidationResponse();
44771
+ }
44772
+ function validateArray$1(data, schema, path, document) {
44773
+ if (schema.minItems !== void 0 && data.length < schema.minItems) {
44774
+ return invalidSchemaResponseWithError$1(
44775
+ new MinItemsViolationError$1(
44776
+ `Array at path '${path}' fails minItems constraint. Has ${data.length} items, needs at least ${schema.minItems}.`
44777
+ )
44778
+ );
44779
+ }
44780
+ if (schema.maxItems !== void 0 && data.length > schema.maxItems) {
44781
+ return invalidSchemaResponseWithError$1(
44782
+ new MaxItemsViolationError$1(
44783
+ `Array at path '${path}' fails maxItems constraint. Has ${data.length} items, needs at most ${schema.maxItems}.`
44784
+ )
44785
+ );
44786
+ }
44787
+ const errorCollector = new JsonSchemaErrorCollector$1();
44788
+ data.forEach(
44789
+ (element, index) => errorCollector.append(
44790
+ validateJsonSchema$1(element, schema.items, `${path}[${index}]`, document)
44791
+ )
44792
+ );
44793
+ return errorCollector.toValidationResponse();
44794
+ }
44795
+ function validateScalar$1(data, schema, path) {
44796
+ const schemaDataType = schema.type;
44797
+ const dataType = typeof data;
44798
+ if (schemaDataType === "integer") {
44799
+ if (dataType !== "number" || !Number.isInteger(data)) {
44800
+ return invalidSchemaResponseWithError$1(incorrectTypeError$1("integer", dataType, path));
44801
+ }
44802
+ } else if (schemaDataType === "number") {
44803
+ if (dataType !== "number") {
44804
+ return invalidSchemaResponseWithError$1(incorrectTypeError$1("number", dataType, path));
44805
+ }
44806
+ } else if (schemaDataType === "string") {
44807
+ if (dataType !== "string") {
44808
+ return invalidSchemaResponseWithError$1(incorrectTypeError$1("string", dataType, path));
44809
+ }
44810
+ } else if (schemaDataType === "boolean") {
44811
+ if (dataType !== "boolean") {
44812
+ return invalidSchemaResponseWithError$1(incorrectTypeError$1("boolean", dataType, path));
44813
+ }
44814
+ } else if (schemaDataType === "null") {
44815
+ if (data !== null) {
44816
+ return invalidSchemaResponseWithError$1(incorrectTypeError$1("null", dataType, path));
44817
+ }
44818
+ } else {
44819
+ return invalidSchemaResponseWithError$1(
44820
+ new IncorrectTypeError$1(`Unknown schema data type: ${schemaDataType}.`)
44821
+ );
44822
+ }
44823
+ return validSchemaResponse$1();
44824
+ }
44825
+ function validateRef$1(data, schema, path, document) {
44826
+ if (!schema.$ref.startsWith("#")) {
44827
+ return invalidSchemaResponseWithError$1(
44828
+ new InvalidRefError$1(
44829
+ `$ref values that do not refer to the current document are unsupported (must start with '#')`
44830
+ )
44831
+ );
44832
+ }
44833
+ try {
44834
+ const schemaToValidate = findSchemaAtPath$1(document, schema.$ref);
44835
+ return validateJsonSchema$1(data, schemaToValidate, path, document);
44836
+ } catch (e) {
44837
+ return invalidSchemaResponseWithError$1(e);
44838
+ }
44839
+ }
44840
+ function validateEnum$1(data, enumValue, path) {
44841
+ if (!enumValue.some((value) => deepEquals$2(value, data))) {
44842
+ return invalidSchemaResponseWithError$1(
44843
+ new JsonSchemaViolationError$1(
44844
+ `Data at ${path} did not match any values in enum. Expected value in: [${enumValue.map((value) => stringify$9(value)).join()}]`
44845
+ )
44846
+ );
44847
+ }
44848
+ return validSchemaResponse$1();
44849
+ }
44850
+ function validateConst$1(data, constValue, path) {
44851
+ if (!deepEquals$2(constValue, data)) {
44852
+ return invalidSchemaResponseWithError$1(
44853
+ new JsonSchemaViolationError$1(
44854
+ `Data at ${path} did not match const. Expected: ${stringify$9(constValue)}`
44855
+ )
44856
+ );
44857
+ }
44858
+ return validSchemaResponse$1();
44859
+ }
44860
+ function findSchemaAtPath$1(document, ref) {
44861
+ if (ref === "#") return document;
44862
+ const keys = ref.replace(/^#\//, "").split("/");
44863
+ let current = document;
44864
+ let path = "#";
44865
+ for (const key of keys) {
44866
+ path = `${path}/${key}`;
44867
+ if (current[key] === void 0) {
44868
+ throw new InvalidRefError$1(
44869
+ `Invalid $ref value '${ref}'. Cannot find target schema at '${path}'`
44870
+ );
44871
+ }
44872
+ current = current[key];
44536
44873
  }
44537
- return ok$4(data);
44874
+ return current;
44538
44875
  }
44539
44876
 
44540
44877
  /*!
@@ -45381,35 +45718,6 @@ const astResolver = function(astReference) {
45381
45718
  }
45382
45719
  return referenceMap.get(astReference);
45383
45720
  };
45384
- /*!
45385
- * Copyright (c) 2022, Salesforce, Inc.,
45386
- * All rights reserved.
45387
- * For full license text, see the LICENSE.txt file
45388
- */
45389
- let Ok$3 = class Ok {
45390
- constructor(value) {
45391
- this.value = value;
45392
- }
45393
- isOk() {
45394
- return true;
45395
- }
45396
- isErr() {
45397
- return !this.isOk();
45398
- }
45399
- };
45400
- let Err$3 = class Err {
45401
- constructor(error) {
45402
- this.error = error;
45403
- }
45404
- isOk() {
45405
- return false;
45406
- }
45407
- isErr() {
45408
- return !this.isOk();
45409
- }
45410
- };
45411
- const ok$3 = (value) => new Ok$3(value);
45412
- const err$3 = (err2) => new Err$3(err2);
45413
45721
  function findExecutableOperation$2(document, operationName) {
45414
45722
  const operations = document.definitions.filter(
45415
45723
  (def) => def.kind === Kind$1.OPERATION_DEFINITION
@@ -45460,6 +45768,14 @@ function resolveAndValidateGraphQLConfig(config, options) {
45460
45768
  query: result.value
45461
45769
  });
45462
45770
  }
45771
+ function toGraphQLErrorResponse(error) {
45772
+ logError$2(error);
45773
+ const message = error instanceof JsonSchemaViolationError$1 ? `Invalid GraphQL config: ${error.message}` : "Internal error in GraphQL adapter occurred";
45774
+ return {
45775
+ data: void 0,
45776
+ errors: [{ message, locations: [] }]
45777
+ };
45778
+ }
45463
45779
  function resolveAndValidateGraphQLDocument(query, operationName, options) {
45464
45780
  const resolved = resolveAst(query);
45465
45781
  if (resolved === void 0) {
@@ -51198,7 +51514,6 @@ function prepareRequest$5(luvio, config) {
51198
51514
  const key = keyBuilder$1M(luvio, createResourceParams$g(config));
51199
51515
  const allTrackedFields = getTrackedFields(key, luvio.getNode(key), {
51200
51516
  maxDepth: configurationForRestAdapters$2.getTrackedFieldDepthOnCacheMiss(),
51201
- onlyFetchLeafNodeIdAndName: configurationForRestAdapters$2.getTrackedFieldLeafNodeIdAndNameOnly(),
51202
51517
  }, config.optionalFields);
51203
51518
  const optionalFields = fields === undefined ? allTrackedFields : difference(allTrackedFields, fields);
51204
51519
  const resourceParams = createResourceParams$g({
@@ -51325,7 +51640,6 @@ function ingestSuccessChildResourceParams$2(luvio, childResourceParamsArray, chi
51325
51640
  };
51326
51641
  const childTrackedFields = getTrackedFields(childKey, luvio.getNode(childKey), {
51327
51642
  maxDepth: configurationForRestAdapters$2.getTrackedFieldDepthOnCacheMiss(),
51328
- onlyFetchLeafNodeIdAndName: configurationForRestAdapters$2.getTrackedFieldLeafNodeIdAndNameOnly(),
51329
51643
  }, childResourceParams.queryParams.optionalFields);
51330
51644
  const childSnapshot = ingestSuccess$8(luvio, {
51331
51645
  recordId: childResourceParams.urlParams.recordId,
@@ -56295,7 +56609,6 @@ function buildNetworkSnapshot$c(luvio, config, options) {
56295
56609
  const key = keyBuilder$1w$1(luvio, config);
56296
56610
  const trackedFieldsConfig = {
56297
56611
  maxDepth: configurationForRestAdapters$2.getTrackedFieldDepthOnCacheMiss(),
56298
- onlyFetchLeafNodeIdAndName: configurationForRestAdapters$2.getTrackedFieldLeafNodeIdAndNameOnly(),
56299
56612
  };
56300
56613
  const optionalFieldsTrie = convertFieldsToTrie(getTrackedFields(key, luvio.getNode(key), trackedFieldsConfig, config.optionalFields));
56301
56614
  const fieldsTrie = BLANK_RECORD_FIELDS_TRIE;
@@ -60167,7 +60480,6 @@ const buildNetworkSnapshot$3 = (luvio, context, config, options) => {
60167
60480
  ...resourceRequest.queryParams,
60168
60481
  optionalFields: getTrackedFields(templateRecordKey, luvio.getNode(templateRecordKey), {
60169
60482
  maxDepth: configurationForRestAdapters$2.getTrackedFieldDepthOnCacheMiss(),
60170
- onlyFetchLeafNodeIdAndName: configurationForRestAdapters$2.getTrackedFieldLeafNodeIdAndNameOnly(),
60171
60483
  }, config.optionalFields),
60172
60484
  },
60173
60485
  });
@@ -60719,7 +61031,6 @@ function prepareRequest(luvio, context, config) {
60719
61031
  ...resourceRequest.queryParams,
60720
61032
  optionalFields: getTrackedFields(recordTemplateKey, luvio.getNode(recordTemplateKey), {
60721
61033
  maxDepth: configurationForRestAdapters$2.getTrackedFieldDepthOnCacheMiss(),
60722
- onlyFetchLeafNodeIdAndName: configurationForRestAdapters$2.getTrackedFieldLeafNodeIdAndNameOnly(),
60723
61034
  }, config.optionalFields),
60724
61035
  },
60725
61036
  });
@@ -60739,7 +61050,6 @@ function onFetchResponseSuccess$2(luvio, context, config, request, response, res
60739
61050
  });
60740
61051
  const allTrackedFields = getTrackedFields(templateRecordKey, luvio.getNode(templateRecordKey), {
60741
61052
  maxDepth: configurationForRestAdapters$2.getTrackedFieldDepthOnCacheMiss(),
60742
- onlyFetchLeafNodeIdAndName: configurationForRestAdapters$2.getTrackedFieldLeafNodeIdAndNameOnly(),
60743
61053
  }, optionalFields);
60744
61054
  const allTrackedFieldsTrie = convertFieldsToTrie(allTrackedFields, true);
60745
61055
  const ingest = createFieldsIngestSuccess({
@@ -80503,6 +80813,7 @@ class AbstractQuickActionHandler extends AbstractResourceRequestActionHandler {
80503
80813
  }
80504
80814
  async buildPendingAction(request, queue) {
80505
80815
  this.resolveResourceRequestBody(request.body);
80816
+ // eslint-disable-next-line no-return-await
80506
80817
  return await super.buildPendingAction(request, queue);
80507
80818
  }
80508
80819
  resolveResourceRequestBody(body) {
@@ -80935,8 +81246,6 @@ function isCreateContentDocumentAndVersionDraftAdapterEvent(customEvent) {
80935
81246
  return customEvent.namespace === CONTENT_DOCUMENT_AND_VERSION_NAMESPACE;
80936
81247
  }
80937
81248
 
80938
- // so eslint doesn't complain about nimbus
80939
- /* global __nimbus */
80940
81249
  function chunkToBase64(chunk) {
80941
81250
  const bytes = new Uint8Array(chunk);
80942
81251
  const CHUNK_SIZE = 64 * 1024; // 64kb, any bigger and fromCharCode() can error out with an overflow.
@@ -87016,6 +87325,7 @@ function isPolymorphicFieldPath(path, pathToObjectApiNamesMap, objectInfos) {
87016
87325
  const parentObjectInfo = objectInfos[parentObjectApiNames[0]];
87017
87326
  // this should not be undefined, but lets catch it if we do end up in that state.
87018
87327
  if (parentObjectInfo === undefined) {
87328
+ // eslint-disable-next-line @salesforce/lds/no-error-in-production
87019
87329
  throw new Error(`ObjectInfo is missing for ${parentObjectApiNames[0]} for ${parentApiPath}`);
87020
87330
  }
87021
87331
  const relationshipField = referenceIdFieldForRelationship(lastSegment);
@@ -88388,6 +88698,7 @@ function checkForEmptyData(gqlResult) {
88388
88698
  }
88389
88699
  const query = data.uiapi.query;
88390
88700
  // Check all entity types in the query for edges - using for...in to avoid array allocation
88701
+ // eslint-disable-next-line guard-for-in
88391
88702
  for (const entityType in query) {
88392
88703
  const entity = query[entityType];
88393
88704
  if (entity && entity.edges && isArray$3$1(entity.edges) && entity.edges.length > 0) {
@@ -90309,7 +90620,9 @@ class NimbusSqliteStore {
90309
90620
  }
90310
90621
  instrumentation$2$1.trackValue(GRAPHQL_QUERY_ROOT_METRIC_NAME, row[1].length);
90311
90622
  }
90312
- catch { }
90623
+ catch {
90624
+ // intentionally do nothing
90625
+ }
90313
90626
  }
90314
90627
  }
90315
90628
 
@@ -91018,6 +91331,7 @@ class PrimingSession extends EventEmitter {
91018
91331
  const userData = {
91019
91332
  ...stats,
91020
91333
  };
91334
+ // eslint-disable-next-line guard-for-in
91021
91335
  for (const error in errors) {
91022
91336
  activity.error(error);
91023
91337
  }
@@ -91198,6 +91512,7 @@ class PrimingSession extends EventEmitter {
91198
91512
  let limitedResult = this.applyRetryLimits(result.additionalWork);
91199
91513
  this.enqueue(limitedResult.additionalWork);
91200
91514
  if (limitedResult.recordsNeedingRefetch.size > 0) {
91515
+ // eslint-disable-next-line guard-for-in
91201
91516
  for (const key in keys$3(limitedResult.recordsNeedingRefetch)) {
91202
91517
  const value = limitedResult.recordsNeedingRefetch.get(key);
91203
91518
  if (result.recordsNeedingRefetch.has(key)) {
@@ -93463,6 +93778,7 @@ class DurableRecordStore {
93463
93778
  async exists(key) {
93464
93779
  const result = await this.durableStore.query('SELECT EXISTS(SELECT 1 FROM lds_data WHERE key = ?)', [key]);
93465
93780
  const exists = result.rows[0][0];
93781
+ // eslint-disable-next-line eqeqeq
93466
93782
  return exists == true;
93467
93783
  }
93468
93784
  async getRecord(key) {
@@ -93677,7 +93993,7 @@ var CounterResult;
93677
93993
  CounterResult["Error"] = "Error";
93678
93994
  })(CounterResult || (CounterResult = {}));
93679
93995
  function incrementCounter(name, result) {
93680
- instrumentation$4.incrementCounter('SFSSideEffect', 1, result == CounterResult.Error, {
93996
+ instrumentation$4.incrementCounter('SFSSideEffect', 1, result === CounterResult.Error, {
93681
93997
  Name: name,
93682
93998
  Result: result,
93683
93999
  });
@@ -94090,16 +94406,17 @@ class AuraNetworkCommand extends NetworkCommand$1 {
94090
94406
  }
94091
94407
  return ok$1(auraReturnValue);
94092
94408
  }).catch((error) => {
94093
- if (!error || !error.getError) {
94409
+ if (!error) {
94094
94410
  return err$1(toError("Failed to get error from response"));
94095
- } else {
94096
- const actionErrors = error.getError();
94097
- if (actionErrors.length > 0) {
94098
- return err$1(coerceError(actionErrors));
94099
- } else {
94100
- return err$1(toError("Error fetching component"));
94101
- }
94102
94411
  }
94412
+ if (!error.getError) {
94413
+ return err$1(toError(error));
94414
+ }
94415
+ const actionErrors = error.getError();
94416
+ if (actionErrors.length > 0) {
94417
+ return err$1(coerceError(actionErrors));
94418
+ }
94419
+ return err$1(toError("Error fetching component"));
94103
94420
  });
94104
94421
  }
94105
94422
  convertFetchResponseToData(response) {
@@ -94782,16 +95099,17 @@ let AuraCacheControlCommand$1 = class AuraCacheControlCommand extends CacheContr
94782
95099
  } catch {
94783
95100
  }
94784
95101
  }).catch((error) => {
94785
- if (!error || !error.getError) {
95102
+ if (!error) {
94786
95103
  return err$1(toError("Failed to get error from response"));
94787
- } else {
94788
- const actionErrors = error.getError();
94789
- if (actionErrors.length > 0) {
94790
- return err$1(coerceError(actionErrors));
94791
- } else {
94792
- return err$1(toError("Error fetching component"));
94793
- }
94794
95104
  }
95105
+ if (!error.getError) {
95106
+ return err$1(toError(error));
95107
+ }
95108
+ const actionErrors = error.getError();
95109
+ if (actionErrors.length > 0) {
95110
+ return err$1(coerceError(actionErrors));
95111
+ }
95112
+ return err$1(toError("Error fetching component"));
94795
95113
  });
94796
95114
  }
94797
95115
  convertFetchResponseToData(response) {
@@ -94926,16 +95244,17 @@ class AuraCacheControlCommand extends CacheControlCommand {
94926
95244
  } catch {
94927
95245
  }
94928
95246
  }).catch((error) => {
94929
- if (!error || !error.getError) {
95247
+ if (!error) {
94930
95248
  return err$1(toError("Failed to get error from response"));
94931
- } else {
94932
- const actionErrors = error.getError();
94933
- if (actionErrors.length > 0) {
94934
- return err$1(coerceError(actionErrors));
94935
- } else {
94936
- return err$1(toError("Error fetching component"));
94937
- }
94938
95249
  }
95250
+ if (!error.getError) {
95251
+ return err$1(toError(error));
95252
+ }
95253
+ const actionErrors = error.getError();
95254
+ if (actionErrors.length > 0) {
95255
+ return err$1(coerceError(actionErrors));
95256
+ }
95257
+ return err$1(toError("Error fetching component"));
94939
95258
  });
94940
95259
  }
94941
95260
  convertFetchResponseToData(response) {
@@ -96246,7 +96565,7 @@ function buildServiceDescriptor$b(luvio) {
96246
96565
  },
96247
96566
  };
96248
96567
  }
96249
- // version: 1.432.0-b99ba9d219
96568
+ // version: 1.434.0-6aa2dd15e3
96250
96569
 
96251
96570
  /**
96252
96571
  * Copyright (c) 2022, Salesforce, Inc.,
@@ -96272,7 +96591,7 @@ function buildServiceDescriptor$a(notifyRecordUpdateAvailable, getNormalizedLuvi
96272
96591
  },
96273
96592
  };
96274
96593
  }
96275
- // version: 1.432.0-b99ba9d219
96594
+ // version: 1.434.0-6aa2dd15e3
96276
96595
 
96277
96596
  /*!
96278
96597
  * Copyright (c) 2022, Salesforce, Inc.,
@@ -96677,26 +96996,26 @@ function buildServiceDescriptor$8() {
96677
96996
  * All rights reserved.
96678
96997
  * For full license text, see the LICENSE.txt file
96679
96998
  */
96680
- let JsonSchemaViolationError$1 = class JsonSchemaViolationError extends Error {
96999
+ class JsonSchemaViolationError extends Error {
96681
97000
  constructor(message, validationErrors) {
96682
97001
  super(message);
96683
97002
  this.validationErrors = [];
96684
97003
  this.validationErrors = validationErrors || [];
96685
97004
  }
96686
- };
96687
- let MinItemsViolationError$1 = class MinItemsViolationError extends JsonSchemaViolationError$1 {
96688
- };
96689
- let MaxItemsViolationError$1 = class MaxItemsViolationError extends JsonSchemaViolationError$1 {
96690
- };
96691
- let IncorrectTypeError$1 = class IncorrectTypeError extends JsonSchemaViolationError$1 {
96692
- };
96693
- let AdditionalPropertiesError$1 = class AdditionalPropertiesError extends JsonSchemaViolationError$1 {
96694
- };
96695
- let MissingRequiredPropertyError$1 = class MissingRequiredPropertyError extends JsonSchemaViolationError$1 {
96696
- };
96697
- let InvalidRefError$1 = class InvalidRefError extends JsonSchemaViolationError$1 {
96698
- };
96699
- let JsonSchemaErrorCollector$1 = class JsonSchemaErrorCollector {
97005
+ }
97006
+ class MinItemsViolationError extends JsonSchemaViolationError {
97007
+ }
97008
+ class MaxItemsViolationError extends JsonSchemaViolationError {
97009
+ }
97010
+ class IncorrectTypeError extends JsonSchemaViolationError {
97011
+ }
97012
+ class AdditionalPropertiesError extends JsonSchemaViolationError {
97013
+ }
97014
+ class MissingRequiredPropertyError extends JsonSchemaViolationError {
97015
+ }
97016
+ class InvalidRefError extends JsonSchemaViolationError {
97017
+ }
97018
+ class JsonSchemaErrorCollector {
96700
97019
  constructor() {
96701
97020
  this.errors = [];
96702
97021
  }
@@ -96717,100 +97036,100 @@ let JsonSchemaErrorCollector$1 = class JsonSchemaErrorCollector {
96717
97036
  toValidationResponse() {
96718
97037
  return !this.hasErrors() ? ok$1(true) : err$1(this.errors);
96719
97038
  }
96720
- };
96721
- function createThrowableError$1(errors) {
96722
- if (errors[0] instanceof MinItemsViolationError$1) {
96723
- return new MinItemsViolationError$1(errors[0].message, errors);
97039
+ }
97040
+ function createThrowableError(errors) {
97041
+ if (errors[0] instanceof MinItemsViolationError) {
97042
+ return new MinItemsViolationError(errors[0].message, errors);
96724
97043
  }
96725
- if (errors[0] instanceof MaxItemsViolationError$1) {
96726
- return new MaxItemsViolationError$1(errors[0].message, errors);
97044
+ if (errors[0] instanceof MaxItemsViolationError) {
97045
+ return new MaxItemsViolationError(errors[0].message, errors);
96727
97046
  }
96728
- if (errors[0] instanceof IncorrectTypeError$1) {
96729
- return new IncorrectTypeError$1(errors[0].message, errors);
97047
+ if (errors[0] instanceof IncorrectTypeError) {
97048
+ return new IncorrectTypeError(errors[0].message, errors);
96730
97049
  }
96731
- if (errors[0] instanceof AdditionalPropertiesError$1) {
96732
- return new AdditionalPropertiesError$1(errors[0].message, errors);
97050
+ if (errors[0] instanceof AdditionalPropertiesError) {
97051
+ return new AdditionalPropertiesError(errors[0].message, errors);
96733
97052
  }
96734
- if (errors[0] instanceof MissingRequiredPropertyError$1) {
96735
- return new MissingRequiredPropertyError$1(errors[0].message, errors);
97053
+ if (errors[0] instanceof MissingRequiredPropertyError) {
97054
+ return new MissingRequiredPropertyError(errors[0].message, errors);
96736
97055
  }
96737
- if (errors[0] instanceof InvalidRefError$1) {
96738
- return new InvalidRefError$1(errors[0].message, errors);
97056
+ if (errors[0] instanceof InvalidRefError) {
97057
+ return new InvalidRefError(errors[0].message, errors);
96739
97058
  }
96740
- return new JsonSchemaViolationError$1(errors[0].message, errors);
97059
+ return new JsonSchemaViolationError(errors[0].message, errors);
96741
97060
  }
96742
- function assertIsValid$1(data, schema) {
96743
- const validationResponse = validateJsonSchema$1(data, schema);
97061
+ function assertIsValid(data, schema) {
97062
+ const validationResponse = validateJsonSchema(data, schema);
96744
97063
  if (validationResponse.isErr()) {
96745
- throw createThrowableError$1(validationResponse.error);
97064
+ throw createThrowableError(validationResponse.error);
96746
97065
  }
96747
97066
  }
96748
- function incorrectTypeError$1(expected, actual, path) {
96749
- return new IncorrectTypeError$1(
97067
+ function incorrectTypeError(expected, actual, path) {
97068
+ return new IncorrectTypeError(
96750
97069
  `Expected type ${expected} at path '${path}', found type ${actual}.`
96751
97070
  );
96752
97071
  }
96753
- function validSchemaResponse$1() {
97072
+ function validSchemaResponse() {
96754
97073
  return ok$1(true);
96755
97074
  }
96756
- function invalidSchemaResponseWithError$1(error) {
97075
+ function invalidSchemaResponseWithError(error) {
96757
97076
  return err$1([error]);
96758
97077
  }
96759
- function validateJsonSchema$1(data, schema, path = "$", document = schema) {
96760
- if (schema === true) return validSchemaResponse$1();
97078
+ function validateJsonSchema(data, schema, path = "$", document = schema) {
97079
+ if (schema === true) return validSchemaResponse();
96761
97080
  if (schema === false)
96762
- return invalidSchemaResponseWithError$1(
96763
- new JsonSchemaViolationError$1(`Data at ${path} has schema 'false'`)
97081
+ return invalidSchemaResponseWithError(
97082
+ new JsonSchemaViolationError(`Data at ${path} has schema 'false'`)
96764
97083
  );
96765
97084
  const dataType = data === null ? "null" : Array.isArray(data) ? "array" : typeof data;
96766
- const errorCollector = new JsonSchemaErrorCollector$1();
97085
+ const errorCollector = new JsonSchemaErrorCollector();
96767
97086
  if ("anyOf" in schema) {
96768
- errorCollector.append(validateAnyOf$1(data, schema, path, document));
97087
+ errorCollector.append(validateAnyOf(data, schema, path, document));
96769
97088
  } else if ("oneOf" in schema) {
96770
- errorCollector.append(validateOneOf$1(data, schema, path, document));
97089
+ errorCollector.append(validateOneOf(data, schema, path, document));
96771
97090
  } else if ("allOf" in schema) {
96772
- errorCollector.append(validateAllOf$1(data, schema, path, document));
97091
+ errorCollector.append(validateAllOf(data, schema, path, document));
96773
97092
  } else if ("not" in schema) {
96774
- errorCollector.append(validateNot$1(data, schema, path, document));
97093
+ errorCollector.append(validateNot(data, schema, path, document));
96775
97094
  } else if ("$ref" in schema) {
96776
- errorCollector.append(validateRef$1(data, schema, path, document));
97095
+ errorCollector.append(validateRef(data, schema, path, document));
96777
97096
  } else if ("type" in schema) {
96778
97097
  if (schema.type === "object") {
96779
97098
  if (dataType !== "object") {
96780
- errorCollector.add(incorrectTypeError$1("object", dataType, path));
97099
+ errorCollector.add(incorrectTypeError("object", dataType, path));
96781
97100
  } else {
96782
97101
  errorCollector.append(
96783
- validateObject$1(data, schema, path, document)
97102
+ validateObject(data, schema, path, document)
96784
97103
  );
96785
97104
  }
96786
97105
  } else if (schema.type === "array") {
96787
97106
  if (dataType !== "array") {
96788
- errorCollector.add(incorrectTypeError$1("array", dataType, path));
97107
+ errorCollector.add(incorrectTypeError("array", dataType, path));
96789
97108
  } else {
96790
97109
  errorCollector.append(
96791
- validateArray$1(data, schema, path, document)
97110
+ validateArray(data, schema, path, document)
96792
97111
  );
96793
97112
  }
96794
97113
  } else {
96795
97114
  errorCollector.append(
96796
- validateScalar$1(data, schema, path)
97115
+ validateScalar(data, schema, path)
96797
97116
  );
96798
97117
  }
96799
97118
  }
96800
97119
  if (schema.enum) {
96801
- errorCollector.append(validateEnum$1(data, schema.enum, path));
97120
+ errorCollector.append(validateEnum(data, schema.enum, path));
96802
97121
  }
96803
97122
  if (schema.const) {
96804
- errorCollector.append(validateConst$1(data, schema.const, path));
97123
+ errorCollector.append(validateConst(data, schema.const, path));
96805
97124
  }
96806
97125
  return errorCollector.toValidationResponse();
96807
97126
  }
96808
- function validateAnyOf$1(data, schema, path, document) {
97127
+ function validateAnyOf(data, schema, path, document) {
96809
97128
  let isValid = false;
96810
- const errorCollector = new JsonSchemaErrorCollector$1();
97129
+ const errorCollector = new JsonSchemaErrorCollector();
96811
97130
  for (let i = 0, { length } = schema.anyOf; i < length; i++) {
96812
97131
  const element = schema.anyOf[i];
96813
- const validationResponse = validateJsonSchema$1(
97132
+ const validationResponse = validateJsonSchema(
96814
97133
  data,
96815
97134
  element,
96816
97135
  `${path}.anyOf[${i}]`,
@@ -96825,19 +97144,19 @@ function validateAnyOf$1(data, schema, path, document) {
96825
97144
  }
96826
97145
  if (!isValid) {
96827
97146
  errorCollector.prepend(
96828
- new JsonSchemaViolationError$1(`Data at ${path} did not match any subschema in anyOf.`)
97147
+ new JsonSchemaViolationError(`Data at ${path} did not match any subschema in anyOf.`)
96829
97148
  );
96830
97149
  return errorCollector.toValidationResponse();
96831
97150
  }
96832
- return validSchemaResponse$1();
97151
+ return validSchemaResponse();
96833
97152
  }
96834
- function validateOneOf$1(data, schema, path, document) {
97153
+ function validateOneOf(data, schema, path, document) {
96835
97154
  let validSubShemaPaths = [];
96836
- const errorCollector = new JsonSchemaErrorCollector$1();
97155
+ const errorCollector = new JsonSchemaErrorCollector();
96837
97156
  for (let i = 0, { length } = schema.oneOf; i < length; i++) {
96838
97157
  const element = schema.oneOf[i];
96839
97158
  const oneOfPath = `${path}.oneOf[${i}]`;
96840
- const validationResponse = validateJsonSchema$1(data, element, oneOfPath, document);
97159
+ const validationResponse = validateJsonSchema(data, element, oneOfPath, document);
96841
97160
  if (validationResponse.isOk()) {
96842
97161
  validSubShemaPaths.push(oneOfPath);
96843
97162
  } else {
@@ -96846,25 +97165,25 @@ function validateOneOf$1(data, schema, path, document) {
96846
97165
  }
96847
97166
  if (validSubShemaPaths.length === 0) {
96848
97167
  errorCollector.prepend(
96849
- new JsonSchemaViolationError$1(`Data at ${path} did not match any subschema in oneOf.`)
97168
+ new JsonSchemaViolationError(`Data at ${path} did not match any subschema in oneOf.`)
96850
97169
  );
96851
97170
  return errorCollector.toValidationResponse();
96852
97171
  } else if (validSubShemaPaths.length > 1) {
96853
97172
  errorCollector.prepend(
96854
- new JsonSchemaViolationError$1(
97173
+ new JsonSchemaViolationError(
96855
97174
  `Data at ${path} matched multiple subschemas: [${validSubShemaPaths.join(", ")}].`
96856
97175
  )
96857
97176
  );
96858
97177
  return errorCollector.toValidationResponse();
96859
97178
  }
96860
- return validSchemaResponse$1();
97179
+ return validSchemaResponse();
96861
97180
  }
96862
- function validateAllOf$1(data, schema, path, document) {
97181
+ function validateAllOf(data, schema, path, document) {
96863
97182
  let isValid = true;
96864
- const errorCollector = new JsonSchemaErrorCollector$1();
97183
+ const errorCollector = new JsonSchemaErrorCollector();
96865
97184
  for (let i = 0, { length } = schema.allOf; i < length; i++) {
96866
97185
  const element = schema.allOf[i];
96867
- const validationResponse = validateJsonSchema$1(
97186
+ const validationResponse = validateJsonSchema(
96868
97187
  data,
96869
97188
  element,
96870
97189
  `${path}.allOf[${i}]`,
@@ -96877,31 +97196,31 @@ function validateAllOf$1(data, schema, path, document) {
96877
97196
  }
96878
97197
  if (!isValid) {
96879
97198
  errorCollector.prepend(
96880
- new JsonSchemaViolationError$1(`Data at ${path} did not match some subschemas in allOf.`)
97199
+ new JsonSchemaViolationError(`Data at ${path} did not match some subschemas in allOf.`)
96881
97200
  );
96882
97201
  }
96883
97202
  return errorCollector.toValidationResponse();
96884
97203
  }
96885
- function validateNot$1(data, schema, path, document) {
96886
- const validationResponse = validateJsonSchema$1(data, schema.not, path, document);
97204
+ function validateNot(data, schema, path, document) {
97205
+ const validationResponse = validateJsonSchema(data, schema.not, path, document);
96887
97206
  if (validationResponse.isOk()) {
96888
- return invalidSchemaResponseWithError$1(
96889
- new JsonSchemaViolationError$1(
97207
+ return invalidSchemaResponseWithError(
97208
+ new JsonSchemaViolationError(
96890
97209
  `Data at ${path} validated against the schema of a not clause.`
96891
97210
  )
96892
97211
  );
96893
97212
  }
96894
- return validSchemaResponse$1();
97213
+ return validSchemaResponse();
96895
97214
  }
96896
- function validateObject$1(data, schema, path, document) {
97215
+ function validateObject(data, schema, path, document) {
96897
97216
  const schemaKeys = Object.keys(schema.properties);
96898
97217
  const requiredKeys = new Set(schema.required);
96899
97218
  const schemaKeySet = new Set(schemaKeys);
96900
- const errorCollector = new JsonSchemaErrorCollector$1();
97219
+ const errorCollector = new JsonSchemaErrorCollector();
96901
97220
  Object.keys(data).forEach((key) => {
96902
97221
  if (!schemaKeySet.has(key)) {
96903
97222
  errorCollector.append(
96904
- validateJsonSchema$1(
97223
+ validateJsonSchema(
96905
97224
  data[key],
96906
97225
  schema.additionalProperties,
96907
97226
  `${path}.additionalProperties[${key}]`,
@@ -96915,14 +97234,14 @@ function validateObject$1(data, schema, path, document) {
96915
97234
  const keyInData = key in data && data[key] !== void 0;
96916
97235
  if (requiredKeys.has(key) && !keyInData) {
96917
97236
  errorCollector.add(
96918
- new MissingRequiredPropertyError$1(
97237
+ new MissingRequiredPropertyError(
96919
97238
  `Object at path '${path}' is missing required property '${key}'.`
96920
97239
  )
96921
97240
  );
96922
97241
  }
96923
97242
  if (keyInData) {
96924
97243
  errorCollector.append(
96925
- validateJsonSchema$1(
97244
+ validateJsonSchema(
96926
97245
  data[key],
96927
97246
  schema.properties[key],
96928
97247
  `${path}.${key}`,
@@ -96933,95 +97252,95 @@ function validateObject$1(data, schema, path, document) {
96933
97252
  }
96934
97253
  return errorCollector.toValidationResponse();
96935
97254
  }
96936
- function validateArray$1(data, schema, path, document) {
97255
+ function validateArray(data, schema, path, document) {
96937
97256
  if (schema.minItems !== void 0 && data.length < schema.minItems) {
96938
- return invalidSchemaResponseWithError$1(
96939
- new MinItemsViolationError$1(
97257
+ return invalidSchemaResponseWithError(
97258
+ new MinItemsViolationError(
96940
97259
  `Array at path '${path}' fails minItems constraint. Has ${data.length} items, needs at least ${schema.minItems}.`
96941
97260
  )
96942
97261
  );
96943
97262
  }
96944
97263
  if (schema.maxItems !== void 0 && data.length > schema.maxItems) {
96945
- return invalidSchemaResponseWithError$1(
96946
- new MaxItemsViolationError$1(
97264
+ return invalidSchemaResponseWithError(
97265
+ new MaxItemsViolationError(
96947
97266
  `Array at path '${path}' fails maxItems constraint. Has ${data.length} items, needs at most ${schema.maxItems}.`
96948
97267
  )
96949
97268
  );
96950
97269
  }
96951
- const errorCollector = new JsonSchemaErrorCollector$1();
97270
+ const errorCollector = new JsonSchemaErrorCollector();
96952
97271
  data.forEach(
96953
97272
  (element, index) => errorCollector.append(
96954
- validateJsonSchema$1(element, schema.items, `${path}[${index}]`, document)
97273
+ validateJsonSchema(element, schema.items, `${path}[${index}]`, document)
96955
97274
  )
96956
97275
  );
96957
97276
  return errorCollector.toValidationResponse();
96958
97277
  }
96959
- function validateScalar$1(data, schema, path) {
97278
+ function validateScalar(data, schema, path) {
96960
97279
  const schemaDataType = schema.type;
96961
97280
  const dataType = typeof data;
96962
97281
  if (schemaDataType === "integer") {
96963
97282
  if (dataType !== "number" || !Number.isInteger(data)) {
96964
- return invalidSchemaResponseWithError$1(incorrectTypeError$1("integer", dataType, path));
97283
+ return invalidSchemaResponseWithError(incorrectTypeError("integer", dataType, path));
96965
97284
  }
96966
97285
  } else if (schemaDataType === "number") {
96967
97286
  if (dataType !== "number") {
96968
- return invalidSchemaResponseWithError$1(incorrectTypeError$1("number", dataType, path));
97287
+ return invalidSchemaResponseWithError(incorrectTypeError("number", dataType, path));
96969
97288
  }
96970
97289
  } else if (schemaDataType === "string") {
96971
97290
  if (dataType !== "string") {
96972
- return invalidSchemaResponseWithError$1(incorrectTypeError$1("string", dataType, path));
97291
+ return invalidSchemaResponseWithError(incorrectTypeError("string", dataType, path));
96973
97292
  }
96974
97293
  } else if (schemaDataType === "boolean") {
96975
97294
  if (dataType !== "boolean") {
96976
- return invalidSchemaResponseWithError$1(incorrectTypeError$1("boolean", dataType, path));
97295
+ return invalidSchemaResponseWithError(incorrectTypeError("boolean", dataType, path));
96977
97296
  }
96978
97297
  } else if (schemaDataType === "null") {
96979
97298
  if (data !== null) {
96980
- return invalidSchemaResponseWithError$1(incorrectTypeError$1("null", dataType, path));
97299
+ return invalidSchemaResponseWithError(incorrectTypeError("null", dataType, path));
96981
97300
  }
96982
97301
  } else {
96983
- return invalidSchemaResponseWithError$1(
96984
- new IncorrectTypeError$1(`Unknown schema data type: ${schemaDataType}.`)
97302
+ return invalidSchemaResponseWithError(
97303
+ new IncorrectTypeError(`Unknown schema data type: ${schemaDataType}.`)
96985
97304
  );
96986
97305
  }
96987
- return validSchemaResponse$1();
97306
+ return validSchemaResponse();
96988
97307
  }
96989
- function validateRef$1(data, schema, path, document) {
97308
+ function validateRef(data, schema, path, document) {
96990
97309
  if (!schema.$ref.startsWith("#")) {
96991
- return invalidSchemaResponseWithError$1(
96992
- new InvalidRefError$1(
97310
+ return invalidSchemaResponseWithError(
97311
+ new InvalidRefError(
96993
97312
  `$ref values that do not refer to the current document are unsupported (must start with '#')`
96994
97313
  )
96995
97314
  );
96996
97315
  }
96997
97316
  try {
96998
- const schemaToValidate = findSchemaAtPath$1(document, schema.$ref);
96999
- return validateJsonSchema$1(data, schemaToValidate, path, document);
97317
+ const schemaToValidate = findSchemaAtPath(document, schema.$ref);
97318
+ return validateJsonSchema(data, schemaToValidate, path, document);
97000
97319
  } catch (e) {
97001
- return invalidSchemaResponseWithError$1(e);
97320
+ return invalidSchemaResponseWithError(e);
97002
97321
  }
97003
97322
  }
97004
- function validateEnum$1(data, enumValue, path) {
97323
+ function validateEnum(data, enumValue, path) {
97005
97324
  if (!enumValue.some((value) => deepEquals$1(value, data))) {
97006
- return invalidSchemaResponseWithError$1(
97007
- new JsonSchemaViolationError$1(
97325
+ return invalidSchemaResponseWithError(
97326
+ new JsonSchemaViolationError(
97008
97327
  `Data at ${path} did not match any values in enum. Expected value in: [${enumValue.map((value) => stringify$2(value)).join()}]`
97009
97328
  )
97010
97329
  );
97011
97330
  }
97012
- return validSchemaResponse$1();
97331
+ return validSchemaResponse();
97013
97332
  }
97014
- function validateConst$1(data, constValue, path) {
97333
+ function validateConst(data, constValue, path) {
97015
97334
  if (!deepEquals$1(constValue, data)) {
97016
- return invalidSchemaResponseWithError$1(
97017
- new JsonSchemaViolationError$1(
97335
+ return invalidSchemaResponseWithError(
97336
+ new JsonSchemaViolationError(
97018
97337
  `Data at ${path} did not match const. Expected: ${stringify$2(constValue)}`
97019
97338
  )
97020
97339
  );
97021
97340
  }
97022
- return validSchemaResponse$1();
97341
+ return validSchemaResponse();
97023
97342
  }
97024
- function findSchemaAtPath$1(document, ref) {
97343
+ function findSchemaAtPath(document, ref) {
97025
97344
  if (ref === "#") return document;
97026
97345
  const keys = ref.replace(/^#\//, "").split("/");
97027
97346
  let current = document;
@@ -97029,7 +97348,7 @@ function findSchemaAtPath$1(document, ref) {
97029
97348
  for (const key of keys) {
97030
97349
  path = `${path}/${key}`;
97031
97350
  if (current[key] === void 0) {
97032
- throw new InvalidRefError$1(
97351
+ throw new InvalidRefError(
97033
97352
  `Invalid $ref value '${ref}'. Cannot find target schema at '${path}'`
97034
97353
  );
97035
97354
  }
@@ -97074,7 +97393,7 @@ function logError(error) {
97074
97393
  */
97075
97394
  function buildBaseImperativeInvoker(getCommand, transformResult) {
97076
97395
  return async (...params) => {
97077
- const command = getCommand({ params, assertIsValid: assertIsValid$1 });
97396
+ const command = getCommand({ params, assertIsValid });
97078
97397
  try {
97079
97398
  return command.execute().then((result) => transformResult(result));
97080
97399
  } catch (error) {
@@ -97214,7 +97533,7 @@ function buildServiceDescriptor$4() {
97214
97533
  class LegacyImperativeBindingsService {
97215
97534
  bind(getCommand) {
97216
97535
  const invoke = async (config, requestContext, callback) => {
97217
- const command = getCommand({ config, assertIsValid: assertIsValid$1 });
97536
+ const command = getCommand({ config, assertIsValid });
97218
97537
  try {
97219
97538
  const overrides = getOverridesForLegacyRequestContext(requestContext);
97220
97539
  const result = await command.execute(overrides);
@@ -97229,7 +97548,7 @@ class LegacyImperativeBindingsService {
97229
97548
  }
97230
97549
  };
97231
97550
  const subscribe = (config, requestContext, callback) => {
97232
- const command = getCommand({ config, assertIsValid: assertIsValid$1 });
97551
+ const command = getCommand({ config, assertIsValid });
97233
97552
  let unsubscribe = () => {
97234
97553
  };
97235
97554
  try {
@@ -97288,13 +97607,7 @@ class GraphQLImperativeBindingsService {
97288
97607
  }
97289
97608
  return await buildBaseImperativeInvoker(getCommand, (result) => this.transformResult(result, exposeRefresh))(...params);
97290
97609
  } catch (error) {
97291
- logError$1(error);
97292
- return {
97293
- data: void 0,
97294
- errors: [
97295
- { message: "Internal error in GraphQL adapter occurred", locations: [] }
97296
- ]
97297
- };
97610
+ return toGraphQLErrorResponse(error);
97298
97611
  }
97299
97612
  };
97300
97613
  }
@@ -97388,8 +97701,8 @@ class GraphQLLegacyImperativeBindingsService {
97388
97701
  config = result.value;
97389
97702
  }
97390
97703
  }
97391
- const command = getCommand({ config, assertIsValid: assertIsValid$1 });
97392
97704
  try {
97705
+ const command = getCommand({ config, assertIsValid });
97393
97706
  const overrides = getOverridesForLegacyRequestContext(requestContext);
97394
97707
  const result = await command.execute(overrides);
97395
97708
  const consumerEmittedData = {
@@ -97406,13 +97719,7 @@ class GraphQLLegacyImperativeBindingsService {
97406
97719
  }
97407
97720
  callback(consumerEmittedData);
97408
97721
  } catch (error) {
97409
- logError$1(error);
97410
- callback({
97411
- data: void 0,
97412
- errors: [
97413
- { message: "Internal error in GraphQL adapter occurred", locations: [] }
97414
- ]
97415
- });
97722
+ callback(toGraphQLErrorResponse(error));
97416
97723
  }
97417
97724
  };
97418
97725
  const subscribe = (config, requestContext, callback) => {
@@ -97430,35 +97737,41 @@ class GraphQLLegacyImperativeBindingsService {
97430
97737
  config = result.value;
97431
97738
  }
97432
97739
  }
97433
- const command = getCommand({ config, assertIsValid: assertIsValid$1 });
97434
97740
  let unsubscribe = () => {
97435
97741
  };
97436
- const overrides = getOverridesForLegacyRequestContext(requestContext);
97437
- command.execute(overrides).then((result) => {
97438
- const consumerEmittedData = {
97439
- data: void 0,
97440
- errors: void 0
97441
- };
97442
- if (result.isOk()) {
97443
- deepFreeze(result.value);
97444
- consumerEmittedData.data = result.value.data.data;
97445
- unsubscribe = result.value.subscribe(
97446
- (res) => {
97447
- handleEmit(res, callback);
97448
- }
97449
- );
97450
- } else {
97451
- const { data, errors } = toGraphQLResponseFromFailure$1(result.error.failure);
97452
- consumerEmittedData.data = data;
97453
- consumerEmittedData.errors = errors;
97454
- unsubscribe = result.error.subscribe(
97455
- (res) => {
97456
- handleEmit(res, callback);
97457
- }
97458
- );
97459
- }
97460
- callback(consumerEmittedData);
97461
- });
97742
+ try {
97743
+ const command = getCommand({ config, assertIsValid });
97744
+ const overrides = getOverridesForLegacyRequestContext(requestContext);
97745
+ command.execute(overrides).then((result) => {
97746
+ const consumerEmittedData = {
97747
+ data: void 0,
97748
+ errors: void 0
97749
+ };
97750
+ if (result.isOk()) {
97751
+ deepFreeze(result.value);
97752
+ consumerEmittedData.data = result.value.data.data;
97753
+ unsubscribe = result.value.subscribe(
97754
+ (res) => {
97755
+ handleEmit(res, callback);
97756
+ }
97757
+ );
97758
+ } else {
97759
+ const { data, errors } = toGraphQLResponseFromFailure$1(
97760
+ result.error.failure
97761
+ );
97762
+ consumerEmittedData.data = data;
97763
+ consumerEmittedData.errors = errors;
97764
+ unsubscribe = result.error.subscribe(
97765
+ (res) => {
97766
+ handleEmit(res, callback);
97767
+ }
97768
+ );
97769
+ }
97770
+ callback(consumerEmittedData);
97771
+ });
97772
+ } catch (error) {
97773
+ callback(toGraphQLErrorResponse(error));
97774
+ }
97462
97775
  return () => {
97463
97776
  unsubscribe();
97464
97777
  };
@@ -97492,7 +97805,7 @@ class GraphQLMutationBindingsService {
97492
97805
  params[0] = result2.value;
97493
97806
  }
97494
97807
  }
97495
- const command = getCommand({ params, assertIsValid: assertIsValid$1 });
97808
+ const command = getCommand({ params, assertIsValid });
97496
97809
  const result = await command.execute({ cacheControlConfig: { type: "no-cache" } });
97497
97810
  if (result.isOk()) {
97498
97811
  deepFreeze(result.value);
@@ -97501,13 +97814,7 @@ class GraphQLMutationBindingsService {
97501
97814
  return toGraphQLResponseFromFailure$1(result.error.failure);
97502
97815
  }
97503
97816
  } catch (error) {
97504
- logError$1(error);
97505
- return {
97506
- data: void 0,
97507
- errors: [
97508
- { message: "Internal error in GraphQL adapter occurred", locations: [] }
97509
- ]
97510
- };
97817
+ return toGraphQLErrorResponse(error);
97511
97818
  }
97512
97819
  };
97513
97820
  }
@@ -97575,8 +97882,8 @@ function sanitize(obj) {
97575
97882
  return new Sanitizer(obj).sanitize();
97576
97883
  }
97577
97884
  function isIncompleteConfigError(err) {
97578
- return err instanceof MissingRequiredPropertyError$1 || err instanceof JsonSchemaViolationError$1 && err.validationErrors.find(
97579
- (validationError) => validationError instanceof MissingRequiredPropertyError$1
97885
+ return err instanceof MissingRequiredPropertyError || err instanceof JsonSchemaViolationError && err.validationErrors.find(
97886
+ (validationError) => validationError instanceof MissingRequiredPropertyError
97580
97887
  ) !== void 0;
97581
97888
  }
97582
97889
  class CommandWireAdapterConstructor {
@@ -97662,11 +97969,15 @@ class CommandWireAdapterConstructor {
97662
97969
  }
97663
97970
  if (this.configSchema) {
97664
97971
  try {
97665
- assertIsValid$1(this.config, this.configSchema);
97972
+ assertIsValid(this.config, this.configSchema);
97666
97973
  } catch (err) {
97667
97974
  if (isIncompleteConfigError(err)) {
97668
97975
  return;
97669
97976
  }
97977
+ if (err instanceof JsonSchemaViolationError) {
97978
+ this.handleConfigSchemaViolation(err);
97979
+ return;
97980
+ }
97670
97981
  throw err;
97671
97982
  }
97672
97983
  }
@@ -97719,6 +98030,16 @@ class CommandWireAdapterConstructor {
97719
98030
  handleExecutionThrow(error) {
97720
98031
  emitError(this.callback, error);
97721
98032
  }
98033
+ /**
98034
+ * Hook for subclasses to handle a JsonSchemaViolationError from the config
98035
+ * schema assertion. The default re-throws so legacy non-GraphQL wire
98036
+ * adapters keep their existing throw behavior. Overrides are expected to
98037
+ * either emit an error result or re-throw — silently returning will
98038
+ * swallow the error.
98039
+ */
98040
+ handleConfigSchemaViolation(error) {
98041
+ throw error;
98042
+ }
97722
98043
  unsubscribe() {
97723
98044
  if (this.unsubscriber) {
97724
98045
  this.unsubscriber();
@@ -97811,16 +98132,14 @@ class GraphQLCommandWireAdapterConstructor extends CommandWireAdapterConstructor
97811
98132
  this.callback(consumerEmittedData);
97812
98133
  }
97813
98134
  } catch (e) {
97814
- logError$1(e);
97815
98135
  this.handleExecutionThrow(e);
97816
98136
  }
97817
98137
  }
97818
- handleExecutionThrow(e) {
97819
- logError$1(e);
97820
- this.callback({
97821
- data: void 0,
97822
- errors: [{ message: "Internal error in GraphQL adapter occurred", locations: [] }]
97823
- });
98138
+ handleExecutionThrow(error) {
98139
+ this.callback(toGraphQLErrorResponse(error));
98140
+ }
98141
+ handleConfigSchemaViolation(error) {
98142
+ this.handleExecutionThrow(error);
97824
98143
  }
97825
98144
  update(config, _context) {
97826
98145
  this.unsubscribe();
@@ -98472,9 +98791,11 @@ class NimbusDurableCacheInclusionPolicy extends DurableCacheInclusionPolicy {
98472
98791
  return entries.length > 0 ? this.store.setEntries(entries) : Promise.resolve();
98473
98792
  }
98474
98793
  find(_query) {
98794
+ // eslint-disable-next-line @salesforce/lds/no-error-in-production
98475
98795
  throw new Error('find not supported on the NimbusDurableCacheInclusionPolicy');
98476
98796
  }
98477
98797
  findAndModify(_query, _cacheUpdate) {
98798
+ // eslint-disable-next-line @salesforce/lds/no-error-in-production
98478
98799
  throw new Error('findAndModify not supported on the NimbusDurableCacheInclusionPolicy');
98479
98800
  }
98480
98801
  registerListener() {
@@ -98500,7 +98821,7 @@ class NimbusDurableCacheInclusionPolicy extends DurableCacheInclusionPolicy {
98500
98821
  });
98501
98822
  });
98502
98823
  }
98503
- // TODO: onestore doesnt support cache eviction yet
98824
+ // TODO [W-19368859]: onestore doesnt support cache eviction yet
98504
98825
  // if (evictKeys.size > 0) {
98505
98826
  // evictKeys.forEach((key) => {
98506
98827
  // this.services.cache.evict(key);
@@ -98595,6 +98916,7 @@ class NimbusSqliteOneStoreCache {
98595
98916
  batchQuery(operations) {
98596
98917
  return new Promise((resolve, reject) => {
98597
98918
  this.sqlStore.batchOperations(operations, (error) => {
98919
+ // eslint-disable-next-line no-unused-expressions
98598
98920
  error ? reject(error) : resolve();
98599
98921
  });
98600
98922
  });
@@ -98670,7 +98992,7 @@ function initializeOneStore(sqliteStore, luvio) {
98670
98992
  buildServiceDescriptor$7(),
98671
98993
  buildServiceDescriptor$1$1(),
98672
98994
  buildServiceDescriptor$2(),
98673
- // TODO[@W-18753648]: See note above.
98995
+ // TODO [W-18753648]: See note above.
98674
98996
  // buildStreamingCommandServiceDescriptor(),
98675
98997
  // buildNdJsonServiceDescriptor(),
98676
98998
  // buildSseCommandServiceDescriptor(),
@@ -98929,378 +99251,12 @@ register$1({
98929
99251
  id: '@salesforce/lds-network-adapter',
98930
99252
  instrument: instrument$2,
98931
99253
  });
98932
- // version: 1.432.0-a57c62b660
99254
+ // version: 1.434.0-d8deb0d4ea
98933
99255
 
98934
99256
  const { create: create$2, keys: keys$2 } = Object;
98935
99257
  const { stringify, parse } = JSON;
98936
99258
  const { isArray: isArray$3 } = Array;
98937
99259
 
98938
- /*!
98939
- * Copyright (c) 2022, Salesforce, Inc.,
98940
- * All rights reserved.
98941
- * For full license text, see the LICENSE.txt file
98942
- */
98943
- class JsonSchemaViolationError extends Error {
98944
- constructor(message, validationErrors) {
98945
- super(message);
98946
- this.validationErrors = [];
98947
- this.validationErrors = validationErrors || [];
98948
- }
98949
- }
98950
- class MinItemsViolationError extends JsonSchemaViolationError {
98951
- }
98952
- class MaxItemsViolationError extends JsonSchemaViolationError {
98953
- }
98954
- class IncorrectTypeError extends JsonSchemaViolationError {
98955
- }
98956
- class AdditionalPropertiesError extends JsonSchemaViolationError {
98957
- }
98958
- class MissingRequiredPropertyError extends JsonSchemaViolationError {
98959
- }
98960
- class InvalidRefError extends JsonSchemaViolationError {
98961
- }
98962
- class JsonSchemaErrorCollector {
98963
- constructor() {
98964
- this.errors = [];
98965
- }
98966
- add(error) {
98967
- this.errors.push(error);
98968
- }
98969
- append(response) {
98970
- if (response.isErr()) {
98971
- this.errors.push(...response.error);
98972
- }
98973
- }
98974
- hasErrors() {
98975
- return this.errors.length > 0;
98976
- }
98977
- prepend(error) {
98978
- this.errors.unshift(error);
98979
- }
98980
- toValidationResponse() {
98981
- return !this.hasErrors() ? ok$4(true) : err$4(this.errors);
98982
- }
98983
- }
98984
- function createThrowableError(errors) {
98985
- if (errors[0] instanceof MinItemsViolationError) {
98986
- return new MinItemsViolationError(errors[0].message, errors);
98987
- }
98988
- if (errors[0] instanceof MaxItemsViolationError) {
98989
- return new MaxItemsViolationError(errors[0].message, errors);
98990
- }
98991
- if (errors[0] instanceof IncorrectTypeError) {
98992
- return new IncorrectTypeError(errors[0].message, errors);
98993
- }
98994
- if (errors[0] instanceof AdditionalPropertiesError) {
98995
- return new AdditionalPropertiesError(errors[0].message, errors);
98996
- }
98997
- if (errors[0] instanceof MissingRequiredPropertyError) {
98998
- return new MissingRequiredPropertyError(errors[0].message, errors);
98999
- }
99000
- if (errors[0] instanceof InvalidRefError) {
99001
- return new InvalidRefError(errors[0].message, errors);
99002
- }
99003
- return new JsonSchemaViolationError(errors[0].message, errors);
99004
- }
99005
- function assertIsValid(data, schema) {
99006
- const validationResponse = validateJsonSchema(data, schema);
99007
- if (validationResponse.isErr()) {
99008
- throw createThrowableError(validationResponse.error);
99009
- }
99010
- }
99011
- function incorrectTypeError(expected, actual, path) {
99012
- return new IncorrectTypeError(
99013
- `Expected type ${expected} at path '${path}', found type ${actual}.`
99014
- );
99015
- }
99016
- function validSchemaResponse() {
99017
- return ok$4(true);
99018
- }
99019
- function invalidSchemaResponseWithError(error) {
99020
- return err$4([error]);
99021
- }
99022
- function validateJsonSchema(data, schema, path = "$", document = schema) {
99023
- if (schema === true) return validSchemaResponse();
99024
- if (schema === false)
99025
- return invalidSchemaResponseWithError(
99026
- new JsonSchemaViolationError(`Data at ${path} has schema 'false'`)
99027
- );
99028
- const dataType = data === null ? "null" : Array.isArray(data) ? "array" : typeof data;
99029
- const errorCollector = new JsonSchemaErrorCollector();
99030
- if ("anyOf" in schema) {
99031
- errorCollector.append(validateAnyOf(data, schema, path, document));
99032
- } else if ("oneOf" in schema) {
99033
- errorCollector.append(validateOneOf(data, schema, path, document));
99034
- } else if ("allOf" in schema) {
99035
- errorCollector.append(validateAllOf(data, schema, path, document));
99036
- } else if ("not" in schema) {
99037
- errorCollector.append(validateNot(data, schema, path, document));
99038
- } else if ("$ref" in schema) {
99039
- errorCollector.append(validateRef(data, schema, path, document));
99040
- } else if ("type" in schema) {
99041
- if (schema.type === "object") {
99042
- if (dataType !== "object") {
99043
- errorCollector.add(incorrectTypeError("object", dataType, path));
99044
- } else {
99045
- errorCollector.append(
99046
- validateObject(data, schema, path, document)
99047
- );
99048
- }
99049
- } else if (schema.type === "array") {
99050
- if (dataType !== "array") {
99051
- errorCollector.add(incorrectTypeError("array", dataType, path));
99052
- } else {
99053
- errorCollector.append(
99054
- validateArray(data, schema, path, document)
99055
- );
99056
- }
99057
- } else {
99058
- errorCollector.append(
99059
- validateScalar(data, schema, path)
99060
- );
99061
- }
99062
- }
99063
- if (schema.enum) {
99064
- errorCollector.append(validateEnum(data, schema.enum, path));
99065
- }
99066
- if (schema.const) {
99067
- errorCollector.append(validateConst(data, schema.const, path));
99068
- }
99069
- return errorCollector.toValidationResponse();
99070
- }
99071
- function validateAnyOf(data, schema, path, document) {
99072
- let isValid = false;
99073
- const errorCollector = new JsonSchemaErrorCollector();
99074
- for (let i = 0, { length } = schema.anyOf; i < length; i++) {
99075
- const element = schema.anyOf[i];
99076
- const validationResponse = validateJsonSchema(
99077
- data,
99078
- element,
99079
- `${path}.anyOf[${i}]`,
99080
- document
99081
- );
99082
- if (validationResponse.isOk()) {
99083
- isValid = true;
99084
- break;
99085
- } else {
99086
- errorCollector.append(validationResponse);
99087
- }
99088
- }
99089
- if (!isValid) {
99090
- errorCollector.prepend(
99091
- new JsonSchemaViolationError(`Data at ${path} did not match any subschema in anyOf.`)
99092
- );
99093
- return errorCollector.toValidationResponse();
99094
- }
99095
- return validSchemaResponse();
99096
- }
99097
- function validateOneOf(data, schema, path, document) {
99098
- let validSubShemaPaths = [];
99099
- const errorCollector = new JsonSchemaErrorCollector();
99100
- for (let i = 0, { length } = schema.oneOf; i < length; i++) {
99101
- const element = schema.oneOf[i];
99102
- const oneOfPath = `${path}.oneOf[${i}]`;
99103
- const validationResponse = validateJsonSchema(data, element, oneOfPath, document);
99104
- if (validationResponse.isOk()) {
99105
- validSubShemaPaths.push(oneOfPath);
99106
- } else {
99107
- errorCollector.append(validationResponse);
99108
- }
99109
- }
99110
- if (validSubShemaPaths.length === 0) {
99111
- errorCollector.prepend(
99112
- new JsonSchemaViolationError(`Data at ${path} did not match any subschema in oneOf.`)
99113
- );
99114
- return errorCollector.toValidationResponse();
99115
- } else if (validSubShemaPaths.length > 1) {
99116
- errorCollector.prepend(
99117
- new JsonSchemaViolationError(
99118
- `Data at ${path} matched multiple subschemas: [${validSubShemaPaths.join(", ")}].`
99119
- )
99120
- );
99121
- return errorCollector.toValidationResponse();
99122
- }
99123
- return validSchemaResponse();
99124
- }
99125
- function validateAllOf(data, schema, path, document) {
99126
- let isValid = true;
99127
- const errorCollector = new JsonSchemaErrorCollector();
99128
- for (let i = 0, { length } = schema.allOf; i < length; i++) {
99129
- const element = schema.allOf[i];
99130
- const validationResponse = validateJsonSchema(
99131
- data,
99132
- element,
99133
- `${path}.allOf[${i}]`,
99134
- document
99135
- );
99136
- if (!validationResponse.isOk()) {
99137
- errorCollector.append(validationResponse);
99138
- isValid = false;
99139
- }
99140
- }
99141
- if (!isValid) {
99142
- errorCollector.prepend(
99143
- new JsonSchemaViolationError(`Data at ${path} did not match some subschemas in allOf.`)
99144
- );
99145
- }
99146
- return errorCollector.toValidationResponse();
99147
- }
99148
- function validateNot(data, schema, path, document) {
99149
- const validationResponse = validateJsonSchema(data, schema.not, path, document);
99150
- if (validationResponse.isOk()) {
99151
- return invalidSchemaResponseWithError(
99152
- new JsonSchemaViolationError(
99153
- `Data at ${path} validated against the schema of a not clause.`
99154
- )
99155
- );
99156
- }
99157
- return validSchemaResponse();
99158
- }
99159
- function validateObject(data, schema, path, document) {
99160
- const schemaKeys = Object.keys(schema.properties);
99161
- const requiredKeys = new Set(schema.required);
99162
- const schemaKeySet = new Set(schemaKeys);
99163
- const errorCollector = new JsonSchemaErrorCollector();
99164
- Object.keys(data).forEach((key) => {
99165
- if (!schemaKeySet.has(key)) {
99166
- errorCollector.append(
99167
- validateJsonSchema(
99168
- data[key],
99169
- schema.additionalProperties,
99170
- `${path}.additionalProperties[${key}]`,
99171
- document
99172
- )
99173
- );
99174
- }
99175
- });
99176
- for (let i = 0, length = schemaKeys.length; i < length; i++) {
99177
- const key = schemaKeys[i];
99178
- const keyInData = key in data && data[key] !== void 0;
99179
- if (requiredKeys.has(key) && !keyInData) {
99180
- errorCollector.add(
99181
- new MissingRequiredPropertyError(
99182
- `Object at path '${path}' is missing required property '${key}'.`
99183
- )
99184
- );
99185
- }
99186
- if (keyInData) {
99187
- errorCollector.append(
99188
- validateJsonSchema(
99189
- data[key],
99190
- schema.properties[key],
99191
- `${path}.${key}`,
99192
- document
99193
- )
99194
- );
99195
- }
99196
- }
99197
- return errorCollector.toValidationResponse();
99198
- }
99199
- function validateArray(data, schema, path, document) {
99200
- if (schema.minItems !== void 0 && data.length < schema.minItems) {
99201
- return invalidSchemaResponseWithError(
99202
- new MinItemsViolationError(
99203
- `Array at path '${path}' fails minItems constraint. Has ${data.length} items, needs at least ${schema.minItems}.`
99204
- )
99205
- );
99206
- }
99207
- if (schema.maxItems !== void 0 && data.length > schema.maxItems) {
99208
- return invalidSchemaResponseWithError(
99209
- new MaxItemsViolationError(
99210
- `Array at path '${path}' fails maxItems constraint. Has ${data.length} items, needs at most ${schema.maxItems}.`
99211
- )
99212
- );
99213
- }
99214
- const errorCollector = new JsonSchemaErrorCollector();
99215
- data.forEach(
99216
- (element, index) => errorCollector.append(
99217
- validateJsonSchema(element, schema.items, `${path}[${index}]`, document)
99218
- )
99219
- );
99220
- return errorCollector.toValidationResponse();
99221
- }
99222
- function validateScalar(data, schema, path) {
99223
- const schemaDataType = schema.type;
99224
- const dataType = typeof data;
99225
- if (schemaDataType === "integer") {
99226
- if (dataType !== "number" || !Number.isInteger(data)) {
99227
- return invalidSchemaResponseWithError(incorrectTypeError("integer", dataType, path));
99228
- }
99229
- } else if (schemaDataType === "number") {
99230
- if (dataType !== "number") {
99231
- return invalidSchemaResponseWithError(incorrectTypeError("number", dataType, path));
99232
- }
99233
- } else if (schemaDataType === "string") {
99234
- if (dataType !== "string") {
99235
- return invalidSchemaResponseWithError(incorrectTypeError("string", dataType, path));
99236
- }
99237
- } else if (schemaDataType === "boolean") {
99238
- if (dataType !== "boolean") {
99239
- return invalidSchemaResponseWithError(incorrectTypeError("boolean", dataType, path));
99240
- }
99241
- } else if (schemaDataType === "null") {
99242
- if (data !== null) {
99243
- return invalidSchemaResponseWithError(incorrectTypeError("null", dataType, path));
99244
- }
99245
- } else {
99246
- return invalidSchemaResponseWithError(
99247
- new IncorrectTypeError(`Unknown schema data type: ${schemaDataType}.`)
99248
- );
99249
- }
99250
- return validSchemaResponse();
99251
- }
99252
- function validateRef(data, schema, path, document) {
99253
- if (!schema.$ref.startsWith("#")) {
99254
- return invalidSchemaResponseWithError(
99255
- new InvalidRefError(
99256
- `$ref values that do not refer to the current document are unsupported (must start with '#')`
99257
- )
99258
- );
99259
- }
99260
- try {
99261
- const schemaToValidate = findSchemaAtPath(document, schema.$ref);
99262
- return validateJsonSchema(data, schemaToValidate, path, document);
99263
- } catch (e) {
99264
- return invalidSchemaResponseWithError(e);
99265
- }
99266
- }
99267
- function validateEnum(data, enumValue, path) {
99268
- if (!enumValue.some((value) => deepEquals$2(value, data))) {
99269
- return invalidSchemaResponseWithError(
99270
- new JsonSchemaViolationError(
99271
- `Data at ${path} did not match any values in enum. Expected value in: [${enumValue.map((value) => stringify$9(value)).join()}]`
99272
- )
99273
- );
99274
- }
99275
- return validSchemaResponse();
99276
- }
99277
- function validateConst(data, constValue, path) {
99278
- if (!deepEquals$2(constValue, data)) {
99279
- return invalidSchemaResponseWithError(
99280
- new JsonSchemaViolationError(
99281
- `Data at ${path} did not match const. Expected: ${stringify$9(constValue)}`
99282
- )
99283
- );
99284
- }
99285
- return validSchemaResponse();
99286
- }
99287
- function findSchemaAtPath(document, ref) {
99288
- if (ref === "#") return document;
99289
- const keys = ref.replace(/^#\//, "").split("/");
99290
- let current = document;
99291
- let path = "#";
99292
- for (const key of keys) {
99293
- path = `${path}/${key}`;
99294
- if (current[key] === void 0) {
99295
- throw new InvalidRefError(
99296
- `Invalid $ref value '${ref}'. Cannot find target schema at '${path}'`
99297
- );
99298
- }
99299
- current = current[key];
99300
- }
99301
- return current;
99302
- }
99303
-
99304
99260
  /*!
99305
99261
  * Copyright (c) 2022, Salesforce, Inc.,
99306
99262
  * All rights reserved.
@@ -99349,35 +99305,35 @@ function extractValue(valueNode, variableDefinitions, expectedType) {
99349
99305
  function extractVariableValue(variableName, variableDefinitions) {
99350
99306
  const variable = variableDefinitions[variableName];
99351
99307
  if (!variable) {
99352
- return err$4(
99308
+ return err$3(
99353
99309
  new Error(`Variable '${variableName}' was used in the query but was not defined`)
99354
99310
  );
99355
99311
  }
99356
99312
  if (variable.value !== void 0) {
99357
- return ok$4(variable.value);
99313
+ return ok$3(variable.value);
99358
99314
  }
99359
99315
  if (variable.definition.defaultValue) {
99360
99316
  return extractValue(variable.definition.defaultValue, variableDefinitions);
99361
99317
  }
99362
- return ok$4(void 0);
99318
+ return ok$3(void 0);
99363
99319
  }
99364
99320
  function validateExpectedType(value, expectedType) {
99365
99321
  if (!expectedType) {
99366
- return ok$4(value);
99322
+ return ok$3(value);
99367
99323
  }
99368
99324
  if (value === null) {
99369
99325
  if (expectedType.nullable) {
99370
- return ok$4(value);
99326
+ return ok$3(value);
99371
99327
  } else {
99372
- return err$4(new Error(`Expected ${expectedType.type}, but got null`));
99328
+ return err$3(new Error(`Expected ${expectedType.type}, but got null`));
99373
99329
  }
99374
99330
  }
99375
99331
  const actualType = typeof value;
99376
99332
  if (actualType === expectedType.type) {
99377
- return ok$4(value);
99333
+ return ok$3(value);
99378
99334
  }
99379
99335
  const expectedTypeString = expectedType.nullable ? `${expectedType.type} | null` : expectedType.type;
99380
- return err$4(
99336
+ return err$3(
99381
99337
  new Error(`Expected ${expectedTypeString}, but got ${actualType}: ${JSON.stringify(value)}`)
99382
99338
  );
99383
99339
  }
@@ -99420,10 +99376,10 @@ function findExecutableOperation(input) {
99420
99376
  (def) => def.kind === Kind$1.OPERATION_DEFINITION
99421
99377
  );
99422
99378
  if (operations.length === 0) {
99423
- return err$4(new Error("No operations found in query"));
99379
+ return err$3(new Error("No operations found in query"));
99424
99380
  }
99425
99381
  if (operations.length === 1 && !input.operationName) {
99426
- return ok$4(operations[0]);
99382
+ return ok$3(operations[0]);
99427
99383
  }
99428
99384
  if (input.operationName) {
99429
99385
  const specifiedOperation = operations.find((op) => {
@@ -99431,16 +99387,16 @@ function findExecutableOperation(input) {
99431
99387
  return ((_a = op.name) == null ? void 0 : _a.value) === input.operationName;
99432
99388
  });
99433
99389
  if (specifiedOperation) {
99434
- return ok$4(specifiedOperation);
99390
+ return ok$3(specifiedOperation);
99435
99391
  }
99436
- return err$4(new Error(`Operation "${input.operationName}" not found in query`));
99392
+ return err$3(new Error(`Operation "${input.operationName}" not found in query`));
99437
99393
  }
99438
- return err$4(new Error("Multiple operations found in query, and no operation name provided"));
99394
+ return err$3(new Error("Multiple operations found in query, and no operation name provided"));
99439
99395
  }
99440
99396
  function buildGraphQLInputExtension(input) {
99441
99397
  const operationResult = findExecutableOperation(input);
99442
99398
  if (operationResult.isErr()) {
99443
- return err$4(operationResult.error);
99399
+ return err$3(operationResult.error);
99444
99400
  }
99445
99401
  const operation = operationResult.value;
99446
99402
  const selections = operation.selectionSet.selections;
@@ -99457,7 +99413,7 @@ function buildGraphQLInputExtension(input) {
99457
99413
  prev[fragment.name.value] = fragment;
99458
99414
  return prev;
99459
99415
  }, {});
99460
- return ok$4({
99416
+ return ok$3({
99461
99417
  selections,
99462
99418
  request: { definitions: { variables, fragments } },
99463
99419
  parentFieldSelection: void 0
@@ -99615,13 +99571,13 @@ function collectFieldNames(selections, fragments) {
99615
99571
  }
99616
99572
  function buildFieldKey(canonicalFieldName, fieldArguments, variables) {
99617
99573
  if (fieldArguments === void 0 || fieldArguments.length === 0) {
99618
- return ok$4(canonicalFieldName);
99574
+ return ok$3(canonicalFieldName);
99619
99575
  }
99620
99576
  const formattedArguments = {};
99621
99577
  for (const arg of fieldArguments) {
99622
99578
  const result = extractValue(arg.value, variables);
99623
99579
  if (result.isErr()) {
99624
- return err$4(
99580
+ return err$3(
99625
99581
  new Error(
99626
99582
  `Failed to extract argument '${arg.name.value}' for field '${canonicalFieldName}': ${result.error.message}`
99627
99583
  )
@@ -99629,7 +99585,7 @@ function buildFieldKey(canonicalFieldName, fieldArguments, variables) {
99629
99585
  }
99630
99586
  formattedArguments[arg.name.value] = result.value;
99631
99587
  }
99632
- return ok$4(`${canonicalFieldName}::${stableJSONStringify$3({ args: formattedArguments })}`);
99588
+ return ok$3(`${canonicalFieldName}::${stableJSONStringify$3({ args: formattedArguments })}`);
99633
99589
  }
99634
99590
  ({
99635
99591
  kind: Kind$1.FIELD,
@@ -99654,17 +99610,17 @@ function extractIfArgument(directive, variables, directiveName) {
99654
99610
  var _a;
99655
99611
  const ifArg = (_a = directive.arguments) == null ? void 0 : _a.find((arg) => arg.name.value === "if");
99656
99612
  if (!ifArg) {
99657
- return err$4(new Error(`@${directiveName} directive requires an 'if' argument`));
99613
+ return err$3(new Error(`@${directiveName} directive requires an 'if' argument`));
99658
99614
  }
99659
99615
  const result = extractValue(ifArg.value, variables, { type: "boolean", nullable: false });
99660
99616
  if (result.isErr()) {
99661
- return err$4(result.error);
99617
+ return err$3(result.error);
99662
99618
  }
99663
- return ok$4(result.value);
99619
+ return ok$3(result.value);
99664
99620
  }
99665
99621
  function shouldSkip(selection, variables) {
99666
99622
  if (!selection.directives || selection.directives.length === 0) {
99667
- return ok$4(false);
99623
+ return ok$3(false);
99668
99624
  }
99669
99625
  for (const directive of selection.directives) {
99670
99626
  if (directive.name.value === "skip") {
@@ -99673,7 +99629,7 @@ function shouldSkip(selection, variables) {
99673
99629
  return ifResult;
99674
99630
  }
99675
99631
  if (ifResult.value === true) {
99676
- return ok$4(true);
99632
+ return ok$3(true);
99677
99633
  }
99678
99634
  }
99679
99635
  if (directive.name.value === "include") {
@@ -99682,11 +99638,11 @@ function shouldSkip(selection, variables) {
99682
99638
  return ifResult;
99683
99639
  }
99684
99640
  if (ifResult.value === false) {
99685
- return ok$4(true);
99641
+ return ok$3(true);
99686
99642
  }
99687
99643
  }
99688
99644
  }
99689
- return ok$4(false);
99645
+ return ok$3(false);
99690
99646
  }
99691
99647
  class BaseScalarFieldDef {
99692
99648
  constructor(nullable) {
@@ -99694,11 +99650,11 @@ class BaseScalarFieldDef {
99694
99650
  }
99695
99651
  write(_cache, input) {
99696
99652
  if (input.data === void 0) {
99697
- return ok$4({ type: "missing" });
99653
+ return ok$3({ type: "missing" });
99698
99654
  }
99699
99655
  if (input.data === null) {
99700
99656
  if (!this.nullable) {
99701
- return err$4([
99657
+ return err$3([
99702
99658
  {
99703
99659
  type: "unknown",
99704
99660
  error: new Error(
@@ -99708,14 +99664,14 @@ class BaseScalarFieldDef {
99708
99664
  ]);
99709
99665
  }
99710
99666
  }
99711
- return ok$4({ type: "data", data: input.data });
99667
+ return ok$3({ type: "data", data: input.data });
99712
99668
  }
99713
99669
  read(_cache, input) {
99714
99670
  const normalizedData = input.normalizedData;
99715
99671
  if (normalizedData.type === "missing") {
99716
- return ok$4(void 0);
99672
+ return ok$3(void 0);
99717
99673
  }
99718
- return ok$4(normalizedData.data);
99674
+ return ok$3(normalizedData.data);
99719
99675
  }
99720
99676
  augmentSelections(input) {
99721
99677
  return input;
@@ -99737,11 +99693,11 @@ class BaseArrayFieldDef {
99737
99693
  }
99738
99694
  write(cache, input) {
99739
99695
  if (input.data === void 0) {
99740
- return ok$4({ type: "missing" });
99696
+ return ok$3({ type: "missing" });
99741
99697
  }
99742
99698
  if (input.data === null) {
99743
99699
  if (!this.nullable) {
99744
- return err$4([
99700
+ return err$3([
99745
99701
  {
99746
99702
  type: "unknown",
99747
99703
  error: new Error(
@@ -99750,10 +99706,10 @@ class BaseArrayFieldDef {
99750
99706
  }
99751
99707
  ]);
99752
99708
  }
99753
- return ok$4({ type: "data", data: input.data });
99709
+ return ok$3({ type: "data", data: input.data });
99754
99710
  }
99755
99711
  if (!Array.isArray(input.data)) {
99756
- return err$4([
99712
+ return err$3([
99757
99713
  {
99758
99714
  type: "unknown",
99759
99715
  error: new Error(
@@ -99781,18 +99737,18 @@ class BaseArrayFieldDef {
99781
99737
  }
99782
99738
  });
99783
99739
  if (arrayNormalizationErrors.length > 0) {
99784
- return err$4(arrayNormalizationErrors);
99740
+ return err$3(arrayNormalizationErrors);
99785
99741
  }
99786
- return ok$4({ type: "data", data: normalizedArray });
99742
+ return ok$3({ type: "data", data: normalizedArray });
99787
99743
  }
99788
99744
  read(cache, input) {
99789
99745
  const normalizedData = input.normalizedData;
99790
99746
  if (normalizedData.type === "missing") {
99791
- return ok$4(void 0);
99747
+ return ok$3(void 0);
99792
99748
  }
99793
99749
  if (normalizedData.data === null) {
99794
99750
  if (!this.nullable) {
99795
- return err$4([
99751
+ return err$3([
99796
99752
  {
99797
99753
  type: "unknown",
99798
99754
  error: new Error(
@@ -99801,10 +99757,10 @@ class BaseArrayFieldDef {
99801
99757
  }
99802
99758
  ]);
99803
99759
  }
99804
- return ok$4({ type: "data", data: null });
99760
+ return ok$3({ type: "data", data: null });
99805
99761
  }
99806
99762
  if (!Array.isArray(normalizedData.data)) {
99807
- return err$4([
99763
+ return err$3([
99808
99764
  {
99809
99765
  type: "unknown",
99810
99766
  error: new Error(
@@ -99829,9 +99785,9 @@ class BaseArrayFieldDef {
99829
99785
  }
99830
99786
  });
99831
99787
  if (arrayDenormalizationErrors.length > 0) {
99832
- return err$4(arrayDenormalizationErrors);
99788
+ return err$3(arrayDenormalizationErrors);
99833
99789
  }
99834
- return ok$4(denormalizedArray);
99790
+ return ok$3(denormalizedArray);
99835
99791
  }
99836
99792
  }
99837
99793
  class BaseObjectFieldDef {
@@ -99848,7 +99804,7 @@ class BaseObjectFieldDef {
99848
99804
  write(cache, input) {
99849
99805
  var _a;
99850
99806
  if (!input.selection.selectionSet) {
99851
- return err$4([
99807
+ return err$3([
99852
99808
  {
99853
99809
  type: "unknown",
99854
99810
  error: new Error(
@@ -99858,11 +99814,11 @@ class BaseObjectFieldDef {
99858
99814
  ]);
99859
99815
  }
99860
99816
  if (input.data === void 0) {
99861
- return ok$4({ type: "missing" });
99817
+ return ok$3({ type: "missing" });
99862
99818
  }
99863
99819
  if (input.data === null) {
99864
99820
  if (!this.nullable) {
99865
- return err$4([
99821
+ return err$3([
99866
99822
  {
99867
99823
  type: "unknown",
99868
99824
  error: new Error(
@@ -99871,7 +99827,7 @@ class BaseObjectFieldDef {
99871
99827
  }
99872
99828
  ]);
99873
99829
  }
99874
- return ok$4({ type: "data", data: null });
99830
+ return ok$3({ type: "data", data: null });
99875
99831
  }
99876
99832
  const writeResult = this.repository.write(cache, {
99877
99833
  ...input,
@@ -99884,12 +99840,12 @@ class BaseObjectFieldDef {
99884
99840
  if (writeResult.isErr()) {
99885
99841
  return writeResult;
99886
99842
  }
99887
- return ok$4({ type: "data", data: writeResult.value });
99843
+ return ok$3({ type: "data", data: writeResult.value });
99888
99844
  }
99889
99845
  read(cache, input) {
99890
99846
  var _a;
99891
99847
  if (!input.selection.selectionSet) {
99892
- return err$4([
99848
+ return err$3([
99893
99849
  {
99894
99850
  type: "unknown",
99895
99851
  error: new Error(
@@ -99900,11 +99856,11 @@ class BaseObjectFieldDef {
99900
99856
  }
99901
99857
  const normalizedData = input.normalizedData;
99902
99858
  if (normalizedData.type === "missing") {
99903
- return ok$4(void 0);
99859
+ return ok$3(void 0);
99904
99860
  }
99905
99861
  if (normalizedData.data === null) {
99906
99862
  if (!this.nullable) {
99907
- return err$4([
99863
+ return err$3([
99908
99864
  {
99909
99865
  type: "unknown",
99910
99866
  error: new Error(
@@ -99913,7 +99869,7 @@ class BaseObjectFieldDef {
99913
99869
  }
99914
99870
  ]);
99915
99871
  }
99916
- return ok$4(null);
99872
+ return ok$3(null);
99917
99873
  }
99918
99874
  return this.repository.read(cache, {
99919
99875
  ...input,
@@ -100196,7 +100152,7 @@ class BaseGraphQLTypeRepository {
100196
100152
  var _a;
100197
100153
  const fieldDef = this.getFieldDef(input, selection);
100198
100154
  if (!fieldDef) {
100199
- return err$4(
100155
+ return err$3(
100200
100156
  new Error(
100201
100157
  `Unknown field "${selection.name.value}" on type "${this.typeName}". Expected one of fields ${Object.keys(this.fields)}.`
100202
100158
  )
@@ -100207,10 +100163,10 @@ class BaseGraphQLTypeRepository {
100207
100163
  input.request.definitions.variables
100208
100164
  );
100209
100165
  if (cacheFieldKeyResult.isErr()) {
100210
- return err$4(cacheFieldKeyResult.error);
100166
+ return err$3(cacheFieldKeyResult.error);
100211
100167
  }
100212
100168
  const cacheFieldKey = cacheFieldKeyResult.value;
100213
- return ok$4((_a = input.existingNormalizedData || input.normalizedData) == null ? void 0 : _a[cacheFieldKey]);
100169
+ return ok$3((_a = input.existingNormalizedData || input.normalizedData) == null ? void 0 : _a[cacheFieldKey]);
100214
100170
  }
100215
100171
  denormalizeFieldSelection(cache, input, selection, errorCollector) {
100216
100172
  var _a;
@@ -100316,22 +100272,22 @@ class BaseGraphQLTypeRepository {
100316
100272
  return shouldSkipResult;
100317
100273
  }
100318
100274
  if (shouldSkipResult.value) {
100319
- return ok$4(false);
100275
+ return ok$3(false);
100320
100276
  }
100321
100277
  return this.satisfiesFragmentTypeCondition(input, fragment);
100322
100278
  }
100323
100279
  satisfiesFragmentTypeCondition(_input, fragment) {
100324
100280
  if (!fragment.typeCondition) {
100325
- return ok$4(true);
100281
+ return ok$3(true);
100326
100282
  }
100327
100283
  const conditionalTypeName = fragment.typeCondition.name.value;
100328
100284
  if (conditionalTypeName === this.typeName) {
100329
- return ok$4(true);
100285
+ return ok$3(true);
100330
100286
  }
100331
100287
  if (this.implementedInterfaces.includes(conditionalTypeName)) {
100332
- return ok$4(true);
100288
+ return ok$3(true);
100333
100289
  }
100334
- return ok$4(false);
100290
+ return ok$3(false);
100335
100291
  }
100336
100292
  getCacheKeyFieldArguments(selection) {
100337
100293
  return selection.arguments;
@@ -100390,7 +100346,7 @@ class IdentifiableGraphQLTypeRepository extends IdentifiableTypeRepository {
100390
100346
  const key = this.buildKey(this.buildKeyParams(input));
100391
100347
  const normalized = this.normalizeData(cache, input);
100392
100348
  if (normalized.isErr()) {
100393
- return err$4(normalized.error);
100349
+ return err$3(normalized.error);
100394
100350
  }
100395
100351
  const existing = cache.get(key);
100396
100352
  if (!deepEquals$2(existing == null ? void 0 : existing.value, normalized.value)) {
@@ -100399,7 +100355,7 @@ class IdentifiableGraphQLTypeRepository extends IdentifiableTypeRepository {
100399
100355
  metadata: this.cacheMetadata
100400
100356
  });
100401
100357
  }
100402
- return ok$4({
100358
+ return ok$3({
100403
100359
  type: "link",
100404
100360
  linkedKey: key
100405
100361
  });
@@ -100414,7 +100370,7 @@ class IdentifiableGraphQLTypeRepository extends IdentifiableTypeRepository {
100414
100370
  if (normalizeDataResult.isErr()) {
100415
100371
  return normalizeDataResult;
100416
100372
  }
100417
- return ok$4(
100373
+ return ok$3(
100418
100374
  deepMerge$2(
100419
100375
  {},
100420
100376
  (existingNormalizedData == null ? void 0 : existingNormalizedData.value) || {},
@@ -100484,7 +100440,7 @@ class GraphQLDocumentRootTypeRepository extends IdentifiableGraphQLTypeRepositor
100484
100440
  if (result.isErr()) {
100485
100441
  return result;
100486
100442
  }
100487
- return ok$4({
100443
+ return ok$3({
100488
100444
  data: result.value
100489
100445
  });
100490
100446
  }
@@ -100492,7 +100448,7 @@ class GraphQLDocumentRootTypeRepository extends IdentifiableGraphQLTypeRepositor
100492
100448
  var _a;
100493
100449
  const operationResult = findExecutableOperation(input);
100494
100450
  if (operationResult.isErr()) {
100495
- return err$4(operationResult.error);
100451
+ return err$3(operationResult.error);
100496
100452
  }
100497
100453
  const operation = operationResult.value;
100498
100454
  const fragmentDefinitions = input.query.definitions.filter(
@@ -100515,7 +100471,7 @@ class GraphQLDocumentRootTypeRepository extends IdentifiableGraphQLTypeRepositor
100515
100471
  ...operation,
100516
100472
  selectionSet: { kind: Kind$1.SELECTION_SET, selections: augmentedOperationSelections }
100517
100473
  };
100518
- return ok$4({
100474
+ return ok$3({
100519
100475
  ...input.query,
100520
100476
  definitions: [
100521
100477
  ...input.query.definitions.filter((def) => def.kind !== Kind$1.FRAGMENT_DEFINITION).map((def) => {
@@ -100550,7 +100506,7 @@ class BaseInterfaceRepository {
100550
100506
  }
100551
100507
  write(cache, input) {
100552
100508
  if (typeof input.data !== "object") {
100553
- return err$4([
100509
+ return err$3([
100554
100510
  {
100555
100511
  type: "unknown",
100556
100512
  error: new Error(`Got a non-object value for ${this.typeName} field"`)
@@ -100560,7 +100516,7 @@ class BaseInterfaceRepository {
100560
100516
  const discriminator = this.getTypeDiscriminator(input.data, input.selections);
100561
100517
  const concreteTypeRepository = this.possibleTypes[discriminator];
100562
100518
  if (!concreteTypeRepository) {
100563
- return err$4([
100519
+ return err$3([
100564
100520
  {
100565
100521
  type: "unknown",
100566
100522
  error: new Error(
@@ -100571,7 +100527,7 @@ class BaseInterfaceRepository {
100571
100527
  }
100572
100528
  const selectionErr = this.verifyInterfaceFields(input.selections);
100573
100529
  if (selectionErr) {
100574
- return err$4(selectionErr);
100530
+ return err$3(selectionErr);
100575
100531
  }
100576
100532
  const normalizeInput = {
100577
100533
  ...input,
@@ -100583,14 +100539,14 @@ class BaseInterfaceRepository {
100583
100539
  };
100584
100540
  const result = concreteTypeRepository.write(cache, normalizeInput);
100585
100541
  if (result.isOk()) {
100586
- return ok$4({ discriminator, data: result.value });
100542
+ return ok$3({ discriminator, data: result.value });
100587
100543
  }
100588
100544
  return result;
100589
100545
  }
100590
100546
  read(cache, input) {
100591
100547
  const unionRep = input.normalizedData;
100592
100548
  if (typeof unionRep.data !== "object" || unionRep.data === null) {
100593
- return err$4([
100549
+ return err$3([
100594
100550
  {
100595
100551
  type: "unknown",
100596
100552
  error: new Error(`Got a non-object value for ${this.typeName} field.`)
@@ -100600,7 +100556,7 @@ class BaseInterfaceRepository {
100600
100556
  const discriminator = unionRep.discriminator;
100601
100557
  const concreteRepository = this.possibleTypes[discriminator];
100602
100558
  if (!concreteRepository) {
100603
- return err$4([
100559
+ return err$3([
100604
100560
  {
100605
100561
  type: "unknown",
100606
100562
  error: new Error(
@@ -100611,7 +100567,7 @@ class BaseInterfaceRepository {
100611
100567
  }
100612
100568
  const selectionErr = this.verifyInterfaceFields(input.selections);
100613
100569
  if (selectionErr) {
100614
- return err$4(selectionErr);
100570
+ return err$3(selectionErr);
100615
100571
  }
100616
100572
  const denormalizeInput = {
100617
100573
  ...input,
@@ -100716,7 +100672,7 @@ class BaseUnionRepository {
100716
100672
  }
100717
100673
  write(cache, input) {
100718
100674
  if (typeof input.data !== "object") {
100719
- return err$4([
100675
+ return err$3([
100720
100676
  {
100721
100677
  type: "unknown",
100722
100678
  error: new Error(`Got a non-object value for ${this.typeName} field"`)
@@ -100726,7 +100682,7 @@ class BaseUnionRepository {
100726
100682
  const discriminator = this.getTypeDiscriminator(input.data, input.selections);
100727
100683
  const concreteTypeRepository = this.possibleTypes[discriminator];
100728
100684
  if (!concreteTypeRepository) {
100729
- return err$4([
100685
+ return err$3([
100730
100686
  {
100731
100687
  type: "unknown",
100732
100688
  error: new Error(
@@ -100737,7 +100693,7 @@ class BaseUnionRepository {
100737
100693
  }
100738
100694
  const selectionErr = this.verifyUnionFields(input.selections);
100739
100695
  if (selectionErr) {
100740
- return err$4(selectionErr);
100696
+ return err$3(selectionErr);
100741
100697
  }
100742
100698
  const normalizeInput = {
100743
100699
  ...input,
@@ -100749,14 +100705,14 @@ class BaseUnionRepository {
100749
100705
  };
100750
100706
  const result = concreteTypeRepository.write(cache, normalizeInput);
100751
100707
  if (result.isOk()) {
100752
- return ok$4({ discriminator, data: result.value });
100708
+ return ok$3({ discriminator, data: result.value });
100753
100709
  }
100754
100710
  return result;
100755
100711
  }
100756
100712
  read(cache, input) {
100757
100713
  const unionRep = input.normalizedData;
100758
100714
  if (typeof unionRep.data !== "object" || unionRep.data === null) {
100759
- return err$4([
100715
+ return err$3([
100760
100716
  {
100761
100717
  type: "unknown",
100762
100718
  error: new Error(`Got a non-object value for ${this.typeName} field.`)
@@ -100766,7 +100722,7 @@ class BaseUnionRepository {
100766
100722
  const discriminator = unionRep.discriminator;
100767
100723
  const concreteRepository = this.possibleTypes[discriminator];
100768
100724
  if (!concreteRepository) {
100769
- return err$4([
100725
+ return err$3([
100770
100726
  {
100771
100727
  type: "unknown",
100772
100728
  error: new Error(
@@ -100777,7 +100733,7 @@ class BaseUnionRepository {
100777
100733
  }
100778
100734
  const selectionErr = this.verifyUnionFields(input.selections);
100779
100735
  if (selectionErr) {
100780
- return err$4(selectionErr);
100736
+ return err$3(selectionErr);
100781
100737
  }
100782
100738
  const denormalizeInput = {
100783
100739
  ...input,
@@ -105296,7 +105252,7 @@ function dataSatisfiesFragmentTypeCondition(input, fragment) {
105296
105252
  * @param typeName - The repository type name for error messages
105297
105253
  * @returns Result<boolean, Error> - true if the fragment type condition is satisfied
105298
105254
  */
105299
- function genericSatisfiesFragmentTypeCondition(superSatisfiesFragmentTypeCondition, input, fragment, typeName) {
105255
+ function genericSatisfiesFragmentTypeCondition(superSatisfiesFragmentTypeCondition, input, fragment, _typeName) {
105300
105256
  // First try the base class implementation
105301
105257
  const result = superSatisfiesFragmentTypeCondition(input, fragment);
105302
105258
  if (result.isErr() || result.value) {
@@ -105764,7 +105720,7 @@ class SetupRecordAggregateRepository extends Setup__SetupRecordAggregateReposito
105764
105720
  }
105765
105721
 
105766
105722
  class PolymorphicParentRelationshipRepository extends PolymorphicParentRelationshipRepository$1 {
105767
- getTypeDiscriminator(data, _selections) {
105723
+ getTypeDiscriminator(_data, _selections) {
105768
105724
  // Hardcoded to record representation since that's the only type of parent
105769
105725
  // relationship possible
105770
105726
  return 'RecordRepresentation';
@@ -105804,7 +105760,7 @@ class SetupEdgeRepository extends Setup__SetupEdgeRepository {
105804
105760
  }
105805
105761
 
105806
105762
  class PolymorphicAggregateParentRelationshipRepository extends PolymorphicAggregateParentRelationshipRepository$1 {
105807
- getTypeDiscriminator(data, _selections) {
105763
+ getTypeDiscriminator(_data, _selections) {
105808
105764
  // Hardcoded to record aggregate since that's the only type of parent
105809
105765
  // relationship possible
105810
105766
  return 'RecordAggregate';
@@ -105861,6 +105817,7 @@ class RecordDeletePayloadRepository extends RecordDeletePayloadRepository$1 {
105861
105817
  let idFieldSelection = input.selections.find((selection) => selection.kind === 'Field' && selection.name.value === 'Id');
105862
105818
  // If Id exists in data but wasn't asked for, synthesize the selection like RecordRepresentation does
105863
105819
  if (input.data.Id !== undefined && !idFieldSelection) {
105820
+ // eslint-disable-next-line no-param-reassign
105864
105821
  input = {
105865
105822
  ...input,
105866
105823
  selections: [
@@ -105908,7 +105865,7 @@ class SetupConnectionRepository extends Setup__SetupConnectionRepository {
105908
105865
  }
105909
105866
 
105910
105867
  class SetupPolymorphicAggregateParentRelationshipRepository extends Setup__SetupPolymorphicAggregateParentRelationshipRepository {
105911
- getTypeDiscriminator(data, _selections) {
105868
+ getTypeDiscriminator(_data, _selections) {
105912
105869
  // Hardcoded to Setup__SetupRecordAggregate since that's the only type of parent
105913
105870
  // relationship possible
105914
105871
  return 'Setup__SetupRecordAggregate';
@@ -105916,7 +105873,7 @@ class SetupPolymorphicAggregateParentRelationshipRepository extends Setup__Setup
105916
105873
  }
105917
105874
 
105918
105875
  class SetupPolymorphicParentRelationshipRepository extends Setup__SetupPolymorphicParentRelationshipRepository {
105919
- getTypeDiscriminator(data, _selections) {
105876
+ getTypeDiscriminator(_data, _selections) {
105920
105877
  // Hardcoded to Setup__EntityRepresentation since that's the only type of parent
105921
105878
  // relationship possible
105922
105879
  return 'Setup__EntityRepresentation';
@@ -106057,6 +106014,7 @@ function deepMerge$1(data, extensions) {
106057
106014
  const dataType = typeof data;
106058
106015
  const extensionsType = typeof extensions;
106059
106016
  if (dataType === 'function' || extensionsType === 'function') {
106017
+ // eslint-disable-next-line @salesforce/lds/no-error-in-production
106060
106018
  throw new Error('Cannot merge functions');
106061
106019
  }
106062
106020
  if (dataType === 'undefined' || data === undefined) {
@@ -106397,7 +106355,9 @@ function buildCommandClass(baseClass) {
106397
106355
  });
106398
106356
  this.unsubscribers.push(unsubscribeFromLuvioSnapshot);
106399
106357
  }
106400
- catch (error) { }
106358
+ catch (error) {
106359
+ // intentionally do nothing
106360
+ }
106401
106361
  }
106402
106362
  }
106403
106363
  usedRecordsChanged() {
@@ -106503,6 +106463,7 @@ function defaultCheckConfig(config, requiredKeys, optionalKeys) {
106503
106463
  const invalidKeys = configKeys.filter((key) => !allowedKeysSet.includes(key));
106504
106464
  if (invalidKeys.length > 0) {
106505
106465
  // invalid keys, so set error state
106466
+ // eslint-disable-next-line no-throw-literal
106506
106467
  throw {
106507
106468
  error: `Invalid config keys: ${invalidKeys.join(', ')}`,
106508
106469
  errorType: 'adapterError',
@@ -106867,7 +106828,7 @@ getServices(serviceRequirements).then((services) => {
106867
106828
  _(config, CONFIG_SCHEMA);
106868
106829
  const baseCommand = new graphql_imperative_ctor(config, documentRootType, services);
106869
106830
  return applyDecorators(baseCommand, [services.fetchNetworkCommandBaseClass.availableDecorators.abortable], options);
106870
- }, false);
106831
+ }, true);
106871
106832
  graphql_imperative_legacy = services.graphQLLegacyImperativeBindings.bind(({ config, assertIsValid }) => {
106872
106833
  const _ = assertIsValid;
106873
106834
  _(config, CONFIG_SCHEMA);
@@ -106877,6 +106838,7 @@ getServices(serviceRequirements).then((services) => {
106877
106838
  services.graphQLLegacyImperativeBindings.bind(({ config, assertIsValid }) => {
106878
106839
  const validatedConfig = validateNonQueryGraphQLConfig(config);
106879
106840
  if (validatedConfig.isErr()) {
106841
+ // eslint-disable-next-line @salesforce/lds/no-error-in-production
106880
106842
  throw new Error(`Invalid configuration passed to GraphQL: ${validatedConfig.error}`);
106881
106843
  }
106882
106844
  const _ = assertIsValid;
@@ -106888,11 +106850,12 @@ getServices(serviceRequirements).then((services) => {
106888
106850
  */
106889
106851
  const graphql_state_manager_ctor = services.instrumentCommand(buildCommandClass(services.auraGraphQLNormalizedCacheControlCommand), 'graphql_state_manager');
106890
106852
  const factory = (config) => {
106891
- assertIsValid(config, CONFIG_SCHEMA);
106853
+ assertIsValid$1(config, CONFIG_SCHEMA);
106892
106854
  const validatedConfig = resolveAndValidateGraphQLConfig(config, {
106893
106855
  acceptedOperations: ['query'],
106894
106856
  });
106895
106857
  if (validatedConfig === undefined || validatedConfig.isErr()) {
106858
+ // eslint-disable-next-line @salesforce/lds/no-error-in-production
106896
106859
  throw new Error('Internal error in GraphQL adapter occurred: Unable to resolve query');
106897
106860
  }
106898
106861
  return new graphql_state_manager_ctor(validatedConfig.value, documentRootType, services);
@@ -106920,7 +106883,7 @@ function registerCallback(cb) {
106920
106883
  cb(graphql_v1_import, graphql_imperative$1, graphql_imperative_legacy_v1_import, graphql_state_manager, useOneStoreGraphQL);
106921
106884
  }
106922
106885
  }
106923
- // version: 1.432.0-b99ba9d219
106886
+ // version: 1.434.0-6aa2dd15e3
106924
106887
 
106925
106888
  function createFragmentMap(documentNode) {
106926
106889
  const fragments = {};
@@ -134949,28 +134912,23 @@ let configurableCreateContentVersion$1 = new Configurable$1();
134949
134912
  * Depth to which tracked fields will be added to a request that results from a cache miss.
134950
134913
  * A value of 0 inhibits the addition of tracked fields, 1 will add tracked fields that can
134951
134914
  * be reached by following 1 relationship from the root record, etc.
134952
- * @defaultValue '5', replicates the current behavior
134915
+ * @defaultValue '1'
134953
134916
  */
134954
- let trackedFieldDepthOnCacheMiss$1 = 5;
134917
+ let trackedFieldDepthOnCacheMiss$1 = 1;
134955
134918
  /**
134956
134919
  * Depth to which tracked fields will be added to a request that results from a merge conflict
134957
134920
  * A value of 0 inhibits the addition of tracked fields, 1 will add tracked fields that can
134958
134921
  * be reached by following 1 relationship from the root record, etc.
134959
- * @defaultValue '5', replicates the current behavior
134922
+ * @defaultValue '1'
134960
134923
  */
134961
- let trackedFieldDepthOnCacheMergeConflict$1 = 5;
134924
+ let trackedFieldDepthOnCacheMergeConflict$1 = 1;
134962
134925
  /**
134963
134926
  * Depth to which tracked fields will be added to a request that results from a notify change invocation by the consumer
134964
134927
  * A value of 0 inhibits the addition of tracked fields, 1 will add tracked fields that can
134965
134928
  * be reached by following 1 relationship from the root record, etc.
134966
- * @defaultValue '5', replicates the current behavior
134929
+ * @defaultValue '1'
134967
134930
  */
134968
- let trackedFieldDepthOnNotifyChange$1 = 5;
134969
- /**
134970
- * Determines if we will only fetch the 'Id' field for the leaf relationship record
134971
- * @defaultValue 'false', replicates the current behavior and fetches all fields in the store for the leaf relationship record
134972
- */
134973
- let trackedFieldLeafNodeIdAndNameOnly$1 = false;
134931
+ let trackedFieldDepthOnNotifyChange$1 = 1;
134974
134932
  /**
134975
134933
  * One store enabled Get Object Info adapter
134976
134934
  */
@@ -135067,12 +135025,6 @@ const configurationForRestAdapters$1 = {
135067
135025
  getTrackedFieldDepthOnNotifyChange: function () {
135068
135026
  return trackedFieldDepthOnNotifyChange$1;
135069
135027
  },
135070
- setTrackedFieldLeafNodeIdAndNameOnly: function (trackedFieldLeafNodeIdAndNameOnlyParam) {
135071
- trackedFieldLeafNodeIdAndNameOnly$1 = trackedFieldLeafNodeIdAndNameOnlyParam;
135072
- },
135073
- getTrackedFieldLeafNodeIdAndNameOnly: function () {
135074
- return trackedFieldLeafNodeIdAndNameOnly$1;
135075
- },
135076
135028
  setRecordRepresentationIngestionOverride: function (ingest) {
135077
135029
  recordRepresentationIngestionOverride$1 = ingest;
135078
135030
  },
@@ -135629,6 +135581,7 @@ withDefaultLuvio((luvio) => {
135629
135581
  if (typeof data?.refresh === 'function') {
135630
135582
  return data.refresh();
135631
135583
  }
135584
+ // eslint-disable-next-line @salesforce/lds/no-error-in-production
135632
135585
  throw new Error('Component attempted to refresh a GraphQL result that is not refreshable');
135633
135586
  };
135634
135587
  }
@@ -136137,7 +136090,7 @@ register$1({
136137
136090
  configuration: { ...configurationForGraphQLAdapters$1 },
136138
136091
  instrument: instrument$1,
136139
136092
  });
136140
- // version: 1.432.0-b99ba9d219
136093
+ // version: 1.434.0-6aa2dd15e3
136141
136094
 
136142
136095
  // On core the unstable adapters are re-exported with different names,
136143
136096
  // we want to match them here.
@@ -136289,7 +136242,7 @@ withDefaultLuvio((luvio) => {
136289
136242
  unstable_graphQL_imperative = createImperativeAdapter(luvio, createInstrumentedAdapter(ldsAdapter, adapterMetadata), adapterMetadata);
136290
136243
  graphQLImperative = ldsAdapter;
136291
136244
  });
136292
- // version: 1.432.0-b99ba9d219
136245
+ // version: 1.434.0-6aa2dd15e3
136293
136246
 
136294
136247
  var gqlApi = /*#__PURE__*/Object.freeze({
136295
136248
  __proto__: null,
@@ -137088,7 +137041,7 @@ const callbacks$1 = [];
137088
137041
  function register(r) {
137089
137042
  callbacks$1.forEach((callback) => callback(r));
137090
137043
  }
137091
- // version: 1.432.0-a57c62b660
137044
+ // version: 1.434.0-d8deb0d4ea
137092
137045
 
137093
137046
  /**
137094
137047
  * Copyright (c) 2022, Salesforce, Inc.,
@@ -137124,28 +137077,23 @@ let configurableCreateContentVersion = new Configurable();
137124
137077
  * Depth to which tracked fields will be added to a request that results from a cache miss.
137125
137078
  * A value of 0 inhibits the addition of tracked fields, 1 will add tracked fields that can
137126
137079
  * be reached by following 1 relationship from the root record, etc.
137127
- * @defaultValue '5', replicates the current behavior
137080
+ * @defaultValue '1'
137128
137081
  */
137129
- let trackedFieldDepthOnCacheMiss = 5;
137082
+ let trackedFieldDepthOnCacheMiss = 1;
137130
137083
  /**
137131
137084
  * Depth to which tracked fields will be added to a request that results from a merge conflict
137132
137085
  * A value of 0 inhibits the addition of tracked fields, 1 will add tracked fields that can
137133
137086
  * be reached by following 1 relationship from the root record, etc.
137134
- * @defaultValue '5', replicates the current behavior
137087
+ * @defaultValue '1'
137135
137088
  */
137136
- let trackedFieldDepthOnCacheMergeConflict = 5;
137089
+ let trackedFieldDepthOnCacheMergeConflict = 1;
137137
137090
  /**
137138
137091
  * Depth to which tracked fields will be added to a request that results from a notify change invocation by the consumer
137139
137092
  * A value of 0 inhibits the addition of tracked fields, 1 will add tracked fields that can
137140
137093
  * be reached by following 1 relationship from the root record, etc.
137141
- * @defaultValue '5', replicates the current behavior
137142
- */
137143
- let trackedFieldDepthOnNotifyChange = 5;
137144
- /**
137145
- * Determines if we will only fetch the 'Id' field for the leaf relationship record
137146
- * @defaultValue 'false', replicates the current behavior and fetches all fields in the store for the leaf relationship record
137094
+ * @defaultValue '1'
137147
137095
  */
137148
- let trackedFieldLeafNodeIdAndNameOnly = false;
137096
+ let trackedFieldDepthOnNotifyChange = 1;
137149
137097
  /**
137150
137098
  * One store enabled Get Object Info adapter
137151
137099
  */
@@ -137242,12 +137190,6 @@ const configurationForRestAdapters = {
137242
137190
  getTrackedFieldDepthOnNotifyChange: function () {
137243
137191
  return trackedFieldDepthOnNotifyChange;
137244
137192
  },
137245
- setTrackedFieldLeafNodeIdAndNameOnly: function (trackedFieldLeafNodeIdAndNameOnlyParam) {
137246
- trackedFieldLeafNodeIdAndNameOnly = trackedFieldLeafNodeIdAndNameOnlyParam;
137247
- },
137248
- getTrackedFieldLeafNodeIdAndNameOnly: function () {
137249
- return trackedFieldLeafNodeIdAndNameOnly;
137250
- },
137251
137193
  setRecordRepresentationIngestionOverride: function (ingest) {
137252
137194
  recordRepresentationIngestionOverride = ingest;
137253
137195
  },
@@ -138142,6 +138084,7 @@ function handleInstrumentation(activity, stat, progress) {
138142
138084
  const LUVIO_ADAPTER_FAMILY = /^force\/ldsAdapters/;
138143
138085
  async function importLuvioAdapterModule(specifier) {
138144
138086
  if (!LUVIO_ADAPTER_FAMILY.test(specifier)) {
138087
+ // eslint-disable-next-line no-throw-literal
138145
138088
  throw `${specifier} is not an allowed luvio adapter module`;
138146
138089
  }
138147
138090
  let module;
@@ -138149,6 +138092,7 @@ async function importLuvioAdapterModule(specifier) {
138149
138092
  module = await import(specifier);
138150
138093
  }
138151
138094
  catch {
138095
+ // eslint-disable-next-line no-throw-literal
138152
138096
  throw `module not found for specifier ${specifier}`;
138153
138097
  }
138154
138098
  return new LuvioAdapterModule(module);
@@ -138262,6 +138206,7 @@ function buildNativeResponse(response) {
138262
138206
  }
138263
138207
  async function importOneStoreAdapterModule(specifier) {
138264
138208
  if (!ONESTORE_ADAPTER_FAMILY.test(specifier)) {
138209
+ // eslint-disable-next-line no-throw-literal
138265
138210
  throw `${specifier} is not an allowed onestore adapter module`;
138266
138211
  }
138267
138212
  let module;
@@ -138269,6 +138214,7 @@ async function importOneStoreAdapterModule(specifier) {
138269
138214
  module = await import(specifier);
138270
138215
  }
138271
138216
  catch {
138217
+ // eslint-disable-next-line no-throw-literal
138272
138218
  throw `module not found for specifier ${specifier}`;
138273
138219
  }
138274
138220
  return new OneStoreAdapterModule(module);
@@ -138384,4 +138330,4 @@ const { luvio } = getRuntime();
138384
138330
  setDefaultLuvio({ luvio });
138385
138331
 
138386
138332
  export { createPrimingSession, draftManager, draftQueue, evictCacheRecordsByIds, evictExpiredCacheEntries, executeAdapter, executeMutatingAdapter, getImperativeAdapterNames, importLuvioAdapterModule, importOneStoreAdapterModule, invokeAdapter, invokeAdapterWithDraftToMerge, invokeAdapterWithDraftToReplace, invokeAdapterWithMetadata, nimbusDraftQueue, registerReportObserver, setMetadataTTL, setUiApiRecordTTL, stopEviction, subscribeToAdapter };
138387
- // version: 1.432.0-a57c62b660
138333
+ // version: 1.434.0-d8deb0d4ea