@salesforce/lds-worker-api 1.378.0 → 1.379.1

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.
@@ -4280,7 +4280,7 @@
4280
4280
  }
4281
4281
  callbacks.push(callback);
4282
4282
  }
4283
- // version: 1.378.0-0ab3d40d29
4283
+ // version: 1.379.1-5350e195b2
4284
4284
 
4285
4285
  // TODO [TD-0081508]: once that TD is fulfilled we can probably change this file
4286
4286
  function instrumentAdapter$1(createFunction, _metadata) {
@@ -5324,7 +5324,7 @@
5324
5324
  const { apiFamily, name } = metadata;
5325
5325
  return createGraphQLWireAdapterConstructor$1(adapter, `${apiFamily}.${name}`, luvio, astResolver);
5326
5326
  }
5327
- // version: 1.378.0-0ab3d40d29
5327
+ // version: 1.379.1-5350e195b2
5328
5328
 
5329
5329
  /**
5330
5330
  * Copyright (c) 2022, Salesforce, Inc.,
@@ -34160,7 +34160,7 @@
34160
34160
  throttle(60, 60000, setupNotifyAllListRecordUpdateAvailable(luvio));
34161
34161
  throttle(60, 60000, setupNotifyAllListInfoSummaryUpdateAvailable(luvio));
34162
34162
  });
34163
- // version: 1.378.0-63d7c07562
34163
+ // version: 1.379.1-7ea94edc38
34164
34164
 
34165
34165
  function requestIdleDetectedCallback(_callback) { }
34166
34166
  function declareNotifierTaskSingle(_name) {
@@ -45770,15 +45770,6 @@
45770
45770
  },
45771
45771
  };
45772
45772
 
45773
- var productConsumedSideEffects = {
45774
- isOpen: function (e) {
45775
- return e.fallback;
45776
- },
45777
- hasError: function () {
45778
- return !0;
45779
- },
45780
- };
45781
-
45782
45773
  var useOneStore = {
45783
45774
  isOpen: function (e) {
45784
45775
  return e.fallback;
@@ -45808,7 +45799,7 @@
45808
45799
  return !this.isOk();
45809
45800
  }
45810
45801
  };
45811
- let Err$4 = class Err {
45802
+ let Err$3 = class Err {
45812
45803
  constructor(error) {
45813
45804
  this.error = error;
45814
45805
  }
@@ -45820,7 +45811,7 @@
45820
45811
  }
45821
45812
  };
45822
45813
  const ok$4 = (value) => new Ok$4(value);
45823
- const err$4 = (err2) => new Err$4(err2);
45814
+ const err$3 = (err2) => new Err$3(err2);
45824
45815
  function resolvedPromiseLike$5(result) {
45825
45816
  if (isPromiseLike$5(result)) {
45826
45817
  return result.then((nextResult) => nextResult);
@@ -46051,7 +46042,7 @@
46051
46042
  const existingNormalizedData = (_a = cache.get(key)) == null ? void 0 : _a.value;
46052
46043
  const normalized = this.normalizeData(cache, { ...input, existingNormalizedData });
46053
46044
  if (normalized.isErr()) {
46054
- return err$4(normalized.error);
46045
+ return err$3(normalized.error);
46055
46046
  }
46056
46047
  cache.set(key, {
46057
46048
  value: normalized.value,
@@ -46064,7 +46055,7 @@
46064
46055
  }
46065
46056
  validateEntry(entry) {
46066
46057
  if (!isCacheEntryForType(entry, this)) {
46067
- return err$4([
46058
+ return err$3([
46068
46059
  {
46069
46060
  type: "incorrectType",
46070
46061
  expectedType: this.typeName,
@@ -46090,12 +46081,12 @@
46090
46081
  if (cacheEntry) {
46091
46082
  const validationResult = this.validateEntry(cacheEntry);
46092
46083
  if (validationResult.isErr()) {
46093
- return err$4([...validationResult.error]);
46084
+ return err$3([...validationResult.error]);
46094
46085
  }
46095
46086
  const normalizedData = cacheEntry.value;
46096
46087
  return this.denormalizeData(cache, { ...input, normalizedData });
46097
46088
  }
46098
- return err$4([this.buildMissingDataError()]);
46089
+ return err$3([this.buildMissingDataError()]);
46099
46090
  }
46100
46091
  equals(x, y) {
46101
46092
  return deepEquals$2(x, y);
@@ -46118,11 +46109,20 @@
46118
46109
  }
46119
46110
  function buildReadWriteResult(data, errors) {
46120
46111
  if (errors.length > 0) {
46121
- return err$4(errors);
46112
+ return err$3(errors);
46122
46113
  }
46123
46114
  return ok$4(data);
46124
46115
  }
46125
46116
 
46117
+ var productConsumedSideEffects = {
46118
+ isOpen: function (e) {
46119
+ return e.fallback;
46120
+ },
46121
+ hasError: function () {
46122
+ return !0;
46123
+ },
46124
+ };
46125
+
46126
46126
  /**
46127
46127
  * Copyright (c) 2022, Salesforce, Inc.,
46128
46128
  * All rights reserved.
@@ -94154,7 +94154,7 @@
94154
94154
  return !this.isOk();
94155
94155
  }
94156
94156
  };
94157
- let Err$3 = class Err {
94157
+ let Err$2 = class Err {
94158
94158
  constructor(error) {
94159
94159
  this.error = error;
94160
94160
  }
@@ -94166,7 +94166,7 @@
94166
94166
  }
94167
94167
  };
94168
94168
  const ok$3 = (value) => new Ok$3(value);
94169
- const err$3 = (err2) => new Err$3(err2);
94169
+ const err$2 = (err2) => new Err$2(err2);
94170
94170
  function resolvedPromiseLike$2(result) {
94171
94171
  if (isPromiseLike$2(result)) {
94172
94172
  return result.then((nextResult) => nextResult);
@@ -94266,7 +94266,7 @@
94266
94266
  const resultPromise = this.readFromCacheInternal(cache);
94267
94267
  return resultPromise.then((result) => {
94268
94268
  if (result.isErr()) {
94269
- return err$3(result.error);
94269
+ return err$2(result.error);
94270
94270
  }
94271
94271
  this.returnData = result;
94272
94272
  return ok$3(void 0);
@@ -94325,7 +94325,7 @@
94325
94325
  if (networkData) {
94326
94326
  return this.constructSubscribableResult(networkData.value);
94327
94327
  }
94328
- return err$3(result.error);
94328
+ return err$2(result.error);
94329
94329
  }
94330
94330
  if (this.subscriptions.length > 0) {
94331
94331
  this.subscribeToKeysUsed();
@@ -94334,7 +94334,7 @@
94334
94334
  if (networkData) {
94335
94335
  return this.constructSubscribableResult(networkData.value);
94336
94336
  }
94337
- return err$3(new Error("Cache miss after fetching from network"));
94337
+ return err$2(new Error("Cache miss after fetching from network"));
94338
94338
  }
94339
94339
  if (returnData.isOk() && this.lastEmittedData === void 0) {
94340
94340
  this.lastEmittedData = returnData.value.data;
@@ -94397,7 +94397,7 @@
94397
94397
  refresh() {
94398
94398
  return this.rerun({ cacheControlConfig: { type: "no-cache" } }).then((result) => {
94399
94399
  if (result.isErr()) {
94400
- return err$3(result.error);
94400
+ return err$2(result.error);
94401
94401
  }
94402
94402
  return ok$3(void 0);
94403
94403
  });
@@ -94415,7 +94415,7 @@
94415
94415
  const result = this.readFromCache(recordableCache);
94416
94416
  return result.then((readResult) => {
94417
94417
  if (readResult.isErr()) {
94418
- return err$3(readResult.error);
94418
+ return err$2(readResult.error);
94419
94419
  } else {
94420
94420
  const data = readResult.value;
94421
94421
  this.keysUsed = recordableCache.keysRead;
@@ -95887,7 +95887,7 @@
95887
95887
  },
95888
95888
  };
95889
95889
  }
95890
- // version: 1.378.0-63d7c07562
95890
+ // version: 1.379.1-7ea94edc38
95891
95891
 
95892
95892
  /**
95893
95893
  * Copyright (c) 2022, Salesforce, Inc.,
@@ -95913,7 +95913,7 @@
95913
95913
  },
95914
95914
  };
95915
95915
  }
95916
- // version: 1.378.0-63d7c07562
95916
+ // version: 1.379.1-7ea94edc38
95917
95917
 
95918
95918
  /*!
95919
95919
  * Copyright (c) 2022, Salesforce, Inc.,
@@ -98029,7 +98029,7 @@
98029
98029
  id: '@salesforce/lds-network-adapter',
98030
98030
  instrument: instrument$2,
98031
98031
  });
98032
- // version: 1.378.0-0ab3d40d29
98032
+ // version: 1.379.1-5350e195b2
98033
98033
 
98034
98034
  const { create: create$3, keys: keys$3 } = Object;
98035
98035
  const { stringify: stringify$1, parse } = JSON;
@@ -98058,7 +98058,7 @@
98058
98058
  return !this.isOk();
98059
98059
  }
98060
98060
  };
98061
- let Err$2 = class Err {
98061
+ let Err$1 = class Err {
98062
98062
  constructor(error) {
98063
98063
  this.error = error;
98064
98064
  }
@@ -98070,7 +98070,7 @@
98070
98070
  }
98071
98071
  };
98072
98072
  const ok$2 = (value) => new Ok$2(value);
98073
- const err$2 = (err2) => new Err$2(err2);
98073
+ const err$1 = (err2) => new Err$1(err2);
98074
98074
  function deepEquals(x, y) {
98075
98075
  if (x === void 0) {
98076
98076
  return y === void 0;
@@ -98145,7 +98145,7 @@
98145
98145
  this.errors.unshift(error);
98146
98146
  }
98147
98147
  toValidationResponse() {
98148
- return !this.hasErrors() ? ok$2(true) : err$2(this.errors);
98148
+ return !this.hasErrors() ? ok$2(true) : err$1(this.errors);
98149
98149
  }
98150
98150
  }
98151
98151
  function createThrowableError(errors) {
@@ -98184,7 +98184,7 @@
98184
98184
  return ok$2(true);
98185
98185
  }
98186
98186
  function invalidSchemaResponseWithError(error) {
98187
- return err$2([error]);
98187
+ return err$1([error]);
98188
98188
  }
98189
98189
  function validateJsonSchema(data, schema, path = "$", document = schema) {
98190
98190
  if (schema === true) return validSchemaResponse();
@@ -98883,7 +98883,7 @@
98883
98883
  function extractVariableValue(variableName, variableDefinitions) {
98884
98884
  const variable = variableDefinitions[variableName];
98885
98885
  if (!variable) {
98886
- return err$4(
98886
+ return err$3(
98887
98887
  new Error(`Variable '${variableName}' was used in the query but was not defined`)
98888
98888
  );
98889
98889
  }
@@ -98903,7 +98903,7 @@
98903
98903
  if (expectedType.nullable) {
98904
98904
  return ok$4(value);
98905
98905
  } else {
98906
- return err$4(new Error(`Expected ${expectedType.type}, but got null`));
98906
+ return err$3(new Error(`Expected ${expectedType.type}, but got null`));
98907
98907
  }
98908
98908
  }
98909
98909
  const actualType = typeof value;
@@ -98911,7 +98911,7 @@
98911
98911
  return ok$4(value);
98912
98912
  }
98913
98913
  const expectedTypeString = expectedType.nullable ? `${expectedType.type} | null` : expectedType.type;
98914
- return err$4(
98914
+ return err$3(
98915
98915
  new Error(`Expected ${expectedTypeString}, but got ${actualType}: ${JSON.stringify(value)}`)
98916
98916
  );
98917
98917
  }
@@ -98954,7 +98954,7 @@
98954
98954
  (def) => def.kind === Kind.OPERATION_DEFINITION
98955
98955
  );
98956
98956
  if (operations.length === 0) {
98957
- return err$4(new Error("No operations found in query"));
98957
+ return err$3(new Error("No operations found in query"));
98958
98958
  }
98959
98959
  if (operations.length === 1 && !input.operationName) {
98960
98960
  return ok$4(operations[0]);
@@ -98967,14 +98967,14 @@
98967
98967
  if (specifiedOperation) {
98968
98968
  return ok$4(specifiedOperation);
98969
98969
  }
98970
- return err$4(new Error(`Operation "${input.operationName}" not found in query`));
98970
+ return err$3(new Error(`Operation "${input.operationName}" not found in query`));
98971
98971
  }
98972
- return err$4(new Error("Multiple operations found in query, and no operation name provided"));
98972
+ return err$3(new Error("Multiple operations found in query, and no operation name provided"));
98973
98973
  }
98974
98974
  function buildGraphQLInputExtension(input) {
98975
98975
  const operationResult = findExecutableOperation(input);
98976
98976
  if (operationResult.isErr()) {
98977
- return err$4(operationResult.error);
98977
+ return err$3(operationResult.error);
98978
98978
  }
98979
98979
  const operation = operationResult.value;
98980
98980
  const selections = operation.selectionSet.selections;
@@ -99055,7 +99055,7 @@
99055
99055
  for (const arg of fieldArguments) {
99056
99056
  const result = extractValue(arg.value, variables);
99057
99057
  if (result.isErr()) {
99058
- return err$4(
99058
+ return err$3(
99059
99059
  new Error(
99060
99060
  `Failed to extract argument '${arg.name.value}' for field '${canonicalFieldName}': ${result.error.message}`
99061
99061
  )
@@ -99069,11 +99069,11 @@
99069
99069
  var _a;
99070
99070
  const ifArg = (_a = directive.arguments) == null ? void 0 : _a.find((arg) => arg.name.value === "if");
99071
99071
  if (!ifArg) {
99072
- return err$4(new Error(`@${directiveName} directive requires an 'if' argument`));
99072
+ return err$3(new Error(`@${directiveName} directive requires an 'if' argument`));
99073
99073
  }
99074
99074
  const result = extractValue(ifArg.value, variables, { type: "boolean", nullable: false });
99075
99075
  if (result.isErr()) {
99076
- return err$4(result.error);
99076
+ return err$3(result.error);
99077
99077
  }
99078
99078
  return ok$4(result.value);
99079
99079
  }
@@ -99113,7 +99113,7 @@
99113
99113
  }
99114
99114
  if (input.data === null) {
99115
99115
  if (!this.nullable) {
99116
- return err$4([
99116
+ return err$3([
99117
99117
  {
99118
99118
  type: "unknown",
99119
99119
  error: new Error(
@@ -99156,7 +99156,7 @@
99156
99156
  }
99157
99157
  if (input.data === null) {
99158
99158
  if (!this.nullable) {
99159
- return err$4([
99159
+ return err$3([
99160
99160
  {
99161
99161
  type: "unknown",
99162
99162
  error: new Error(
@@ -99168,7 +99168,7 @@
99168
99168
  return ok$4({ type: "data", data: input.data });
99169
99169
  }
99170
99170
  if (!Array.isArray(input.data)) {
99171
- return err$4([
99171
+ return err$3([
99172
99172
  {
99173
99173
  type: "unknown",
99174
99174
  error: new Error(
@@ -99196,7 +99196,7 @@
99196
99196
  }
99197
99197
  });
99198
99198
  if (arrayNormalizationErrors.length > 0) {
99199
- return err$4(arrayNormalizationErrors);
99199
+ return err$3(arrayNormalizationErrors);
99200
99200
  }
99201
99201
  return ok$4({ type: "data", data: normalizedArray });
99202
99202
  }
@@ -99207,7 +99207,7 @@
99207
99207
  }
99208
99208
  if (normalizedData.data === null) {
99209
99209
  if (!this.nullable) {
99210
- return err$4([
99210
+ return err$3([
99211
99211
  {
99212
99212
  type: "unknown",
99213
99213
  error: new Error(
@@ -99219,7 +99219,7 @@
99219
99219
  return ok$4({ type: "data", data: null });
99220
99220
  }
99221
99221
  if (!Array.isArray(normalizedData.data)) {
99222
- return err$4([
99222
+ return err$3([
99223
99223
  {
99224
99224
  type: "unknown",
99225
99225
  error: new Error(
@@ -99244,7 +99244,7 @@
99244
99244
  }
99245
99245
  });
99246
99246
  if (arrayDenormalizationErrors.length > 0) {
99247
- return err$4(arrayDenormalizationErrors);
99247
+ return err$3(arrayDenormalizationErrors);
99248
99248
  }
99249
99249
  return ok$4(denormalizedArray);
99250
99250
  }
@@ -99263,7 +99263,7 @@
99263
99263
  write(cache, input) {
99264
99264
  var _a;
99265
99265
  if (!input.selection.selectionSet) {
99266
- return err$4([
99266
+ return err$3([
99267
99267
  {
99268
99268
  type: "unknown",
99269
99269
  error: new Error(
@@ -99277,7 +99277,7 @@
99277
99277
  }
99278
99278
  if (input.data === null) {
99279
99279
  if (!this.nullable) {
99280
- return err$4([
99280
+ return err$3([
99281
99281
  {
99282
99282
  type: "unknown",
99283
99283
  error: new Error(
@@ -99304,7 +99304,7 @@
99304
99304
  read(cache, input) {
99305
99305
  var _a;
99306
99306
  if (!input.selection.selectionSet) {
99307
- return err$4([
99307
+ return err$3([
99308
99308
  {
99309
99309
  type: "unknown",
99310
99310
  error: new Error(
@@ -99319,7 +99319,7 @@
99319
99319
  }
99320
99320
  if (normalizedData.data === null) {
99321
99321
  if (!this.nullable) {
99322
- return err$4([
99322
+ return err$3([
99323
99323
  {
99324
99324
  type: "unknown",
99325
99325
  error: new Error(
@@ -99408,7 +99408,11 @@
99408
99408
  }
99409
99409
  augmentInlineFragmentSelection(fragment, fragments) {
99410
99410
  var _a;
99411
- if (!this.satisfiesFragmentTypeCondition(fragment)) {
99411
+ const satisfiedFragmentTypeConditionResult = this.satisfiesFragmentTypeCondition(
99412
+ void 0,
99413
+ fragment
99414
+ );
99415
+ if (satisfiedFragmentTypeConditionResult.isErr() || !satisfiedFragmentTypeConditionResult.value) {
99412
99416
  return { selections: [], fragments };
99413
99417
  }
99414
99418
  const augmentedFragmentSelections = this.augmentSelections({
@@ -99434,7 +99438,11 @@
99434
99438
  if (fragment === void 0) {
99435
99439
  return { selections: [selection], fragments };
99436
99440
  }
99437
- if (!this.satisfiesFragmentTypeCondition(fragment)) {
99441
+ const satisfiedFragmentTypeConditionResult = this.satisfiesFragmentTypeCondition(
99442
+ void 0,
99443
+ fragment
99444
+ );
99445
+ if (satisfiedFragmentTypeConditionResult.isErr() || !satisfiedFragmentTypeConditionResult.value) {
99438
99446
  return { selections: [], fragments };
99439
99447
  }
99440
99448
  const augmentedFragmentSelections = this.augmentSelections({
@@ -99547,10 +99555,7 @@
99547
99555
  };
99548
99556
  }
99549
99557
  normalizeFragment(cache, input, fragment, errorCollector) {
99550
- const shouldProcessResult = this.shouldProcessFragment(
99551
- fragment,
99552
- input.request.definitions.variables
99553
- );
99558
+ const shouldProcessResult = this.shouldProcessFragment(input, fragment);
99554
99559
  if (shouldProcessResult.isErr()) {
99555
99560
  errorCollector.push({
99556
99561
  type: "unknown",
@@ -99605,7 +99610,7 @@
99605
99610
  var _a;
99606
99611
  const fieldDef = this.getFieldDef(input, selection);
99607
99612
  if (!fieldDef) {
99608
- return err$4(
99613
+ return err$3(
99609
99614
  new Error(
99610
99615
  `Unknown field "${selection.name.value}" on type "${this.typeName}". Expected one of fields ${Object.keys(this.fields)}.`
99611
99616
  )
@@ -99616,7 +99621,7 @@
99616
99621
  input.request.definitions.variables
99617
99622
  );
99618
99623
  if (cacheFieldKeyResult.isErr()) {
99619
- return err$4(cacheFieldKeyResult.error);
99624
+ return err$3(cacheFieldKeyResult.error);
99620
99625
  }
99621
99626
  const cacheFieldKey = cacheFieldKeyResult.value;
99622
99627
  return ok$4((_a = input.existingNormalizedData || input.normalizedData) == null ? void 0 : _a[cacheFieldKey]);
@@ -99681,10 +99686,7 @@
99681
99686
  };
99682
99687
  }
99683
99688
  denormalizeFragment(cache, input, fragment, errorCollector) {
99684
- const shouldProcessResult = this.shouldProcessFragment(
99685
- fragment,
99686
- input.request.definitions.variables
99687
- );
99689
+ const shouldProcessResult = this.shouldProcessFragment(input, fragment);
99688
99690
  if (shouldProcessResult.isErr()) {
99689
99691
  errorCollector.push({
99690
99692
  type: "unknown",
@@ -99722,28 +99724,28 @@
99722
99724
  }
99723
99725
  return void 0;
99724
99726
  }
99725
- shouldProcessFragment(fragment, variables) {
99726
- const shouldSkipResult = shouldSkip(fragment, variables);
99727
+ shouldProcessFragment(input, fragment) {
99728
+ const shouldSkipResult = shouldSkip(fragment, input.request.definitions.variables);
99727
99729
  if (shouldSkipResult.isErr()) {
99728
99730
  return shouldSkipResult;
99729
99731
  }
99730
99732
  if (shouldSkipResult.value) {
99731
99733
  return ok$4(false);
99732
99734
  }
99733
- return ok$4(this.satisfiesFragmentTypeCondition(fragment));
99735
+ return this.satisfiesFragmentTypeCondition(input, fragment);
99734
99736
  }
99735
- satisfiesFragmentTypeCondition(fragment) {
99737
+ satisfiesFragmentTypeCondition(_input, fragment) {
99736
99738
  if (!fragment.typeCondition) {
99737
- return true;
99739
+ return ok$4(true);
99738
99740
  }
99739
99741
  const conditionalTypeName = fragment.typeCondition.name.value;
99740
99742
  if (conditionalTypeName === this.typeName) {
99741
- return true;
99743
+ return ok$4(true);
99742
99744
  }
99743
99745
  if (this.implementedInterfaces.includes(conditionalTypeName)) {
99744
- return true;
99746
+ return ok$4(true);
99745
99747
  }
99746
- return false;
99748
+ return ok$4(false);
99747
99749
  }
99748
99750
  getCacheKeyFieldArguments(selection) {
99749
99751
  return selection.arguments;
@@ -99801,7 +99803,7 @@
99801
99803
  const key = this.buildKey(this.buildKeyParams(input));
99802
99804
  const normalized = this.normalizeData(cache, input);
99803
99805
  if (normalized.isErr()) {
99804
- return err$4(normalized.error);
99806
+ return err$3(normalized.error);
99805
99807
  }
99806
99808
  const existing = cache.get(key);
99807
99809
  if (!deepEquals$2(existing == null ? void 0 : existing.value, normalized.value)) {
@@ -99890,7 +99892,7 @@
99890
99892
  var _a;
99891
99893
  const operationResult = findExecutableOperation(input);
99892
99894
  if (operationResult.isErr()) {
99893
- return err$4(operationResult.error);
99895
+ return err$3(operationResult.error);
99894
99896
  }
99895
99897
  const operation = operationResult.value;
99896
99898
  const fragmentDefinitions = input.query.definitions.filter(
@@ -99948,7 +99950,7 @@
99948
99950
  }
99949
99951
  write(cache, input) {
99950
99952
  if (typeof input.data !== "object") {
99951
- return err$4([
99953
+ return err$3([
99952
99954
  {
99953
99955
  type: "unknown",
99954
99956
  error: new Error(`Got a non-object value for ${this.typeName} field"`)
@@ -99958,7 +99960,7 @@
99958
99960
  const discriminator = this.getTypeDiscriminator(input.data, input.selections);
99959
99961
  const concreteTypeRepository = this.possibleTypes[discriminator];
99960
99962
  if (!concreteTypeRepository) {
99961
- return err$4([
99963
+ return err$3([
99962
99964
  {
99963
99965
  type: "unknown",
99964
99966
  error: new Error(
@@ -99969,7 +99971,7 @@
99969
99971
  }
99970
99972
  const selectionErr = this.verifyUnionFields(input.selections);
99971
99973
  if (selectionErr) {
99972
- return err$4(selectionErr);
99974
+ return err$3(selectionErr);
99973
99975
  }
99974
99976
  const normalizeInput = {
99975
99977
  ...input,
@@ -99988,7 +99990,7 @@
99988
99990
  read(cache, input) {
99989
99991
  const unionRep = input.normalizedData;
99990
99992
  if (typeof unionRep.data !== "object" || unionRep.data === null) {
99991
- return err$4([
99993
+ return err$3([
99992
99994
  {
99993
99995
  type: "unknown",
99994
99996
  error: new Error(`Got a non-object value for ${this.typeName} field.`)
@@ -99998,7 +100000,7 @@
99998
100000
  const discriminator = unionRep.discriminator;
99999
100001
  const concreteRepository = this.possibleTypes[discriminator];
100000
100002
  if (!concreteRepository) {
100001
- return err$4([
100003
+ return err$3([
100002
100004
  {
100003
100005
  type: "unknown",
100004
100006
  error: new Error(
@@ -100009,7 +100011,7 @@
100009
100011
  }
100010
100012
  const selectionErr = this.verifyUnionFields(input.selections);
100011
100013
  if (selectionErr) {
100012
- return err$4(selectionErr);
100014
+ return err$3(selectionErr);
100013
100015
  }
100014
100016
  const denormalizeInput = {
100015
100017
  ...input,
@@ -100146,19 +100148,7 @@
100146
100148
  return !this.isOk();
100147
100149
  }
100148
100150
  };
100149
- let Err$1 = class Err {
100150
- constructor(error) {
100151
- this.error = error;
100152
- }
100153
- isOk() {
100154
- return false;
100155
- }
100156
- isErr() {
100157
- return !this.isOk();
100158
- }
100159
- };
100160
100151
  const ok$1 = (value) => new Ok$1(value);
100161
- const err$1 = (err2) => new Err$1(err2);
100162
100152
  function isSubscribableResult(x) {
100163
100153
  if (typeof x !== "object" || x === null) {
100164
100154
  return false;
@@ -100291,41 +100281,50 @@
100291
100281
  if (result === void 0) {
100292
100282
  this.callback({ data: void 0, error: void 0 });
100293
100283
  } else {
100294
- if (result.isErr()) {
100295
- this.callback({
100296
- data: void 0,
100297
- error: result.error
100298
- });
100299
- return;
100300
- }
100301
- if (isSubscribableResult(result)) {
100302
- deepFreeze(result.value.data);
100303
- if (this.exposeRefresh) {
100304
- this.callback({
100305
- data: result.value.data,
100306
- error: void 0,
100307
- refresh: () => {
100308
- return result.value.refresh().then((res) => {
100309
- if (res.isOk()) {
100310
- return ok$1(void 0);
100311
- }
100312
- throw res.error;
100313
- });
100284
+ const consumerEmittedRefresh = () => {
100285
+ if (!this.refresh) {
100286
+ return Promise.resolve();
100287
+ }
100288
+ return new Promise((resolve, reject) => {
100289
+ if (!this.refresh) {
100290
+ resolve();
100291
+ return;
100292
+ }
100293
+ this.refresh().then((res) => {
100294
+ if (res.isOk()) {
100295
+ resolve();
100296
+ } else {
100297
+ reject(
100298
+ new Error(
100299
+ "Internal error in Lightning Data Service adapter occurred: Failed to refresh data"
100300
+ )
100301
+ );
100314
100302
  }
100315
100303
  });
100304
+ });
100305
+ };
100306
+ let consumerEmittedData = {
100307
+ data: void 0,
100308
+ error: void 0
100309
+ };
100310
+ if (this.exposeRefresh && this.refresh) {
100311
+ consumerEmittedData.refresh = consumerEmittedRefresh;
100312
+ }
100313
+ if (result.isErr()) {
100314
+ consumerEmittedData.error = result.error;
100315
+ } else {
100316
+ if (isSubscribableResult(result)) {
100317
+ deepFreeze(result.value.data);
100318
+ consumerEmittedData.data = result.value.data;
100316
100319
  } else {
100317
- this.callback({ data: result.value.data, error: void 0 });
100320
+ deepFreeze(result.value);
100321
+ consumerEmittedData.data = result.value;
100318
100322
  }
100319
- return;
100320
100323
  }
100321
- deepFreeze(result.value);
100322
- this.callback({
100323
- data: result.value,
100324
- error: void 0
100325
- });
100324
+ this.callback(consumerEmittedData);
100326
100325
  }
100327
100326
  } catch (e) {
100328
- emitError(this.callback, e);
100327
+ this.handleExecutionThrow(e);
100329
100328
  }
100330
100329
  }
100331
100330
  invokeAdapter() {
@@ -100335,11 +100334,11 @@
100335
100334
  if (this.configSchema) {
100336
100335
  try {
100337
100336
  assertIsValid(this.config, this.configSchema);
100338
- } catch (err2) {
100339
- if (isIncompleteConfigError(err2)) {
100337
+ } catch (err) {
100338
+ if (isIncompleteConfigError(err)) {
100340
100339
  return;
100341
100340
  }
100342
- throw err2;
100341
+ throw err;
100343
100342
  }
100344
100343
  }
100345
100344
  const initialConfig = this.config;
@@ -100349,10 +100348,10 @@
100349
100348
  if (!this.connected || this.config !== initialConfig) {
100350
100349
  return;
100351
100350
  }
100352
- this.emit(result);
100351
+ this.refresh = void 0;
100353
100352
  if (result.isOk()) {
100354
- const value = result.value;
100355
- if (typeof value === "object" && value !== null && "subscribe" in value) {
100353
+ if (isSubscribableResult(result)) {
100354
+ const value = result.value;
100356
100355
  this.unsubscriber = value.subscribe((updatedResult) => {
100357
100356
  if (!this.connected || this.config !== initialConfig) {
100358
100357
  this.unsubscribe();
@@ -100360,10 +100359,15 @@
100360
100359
  }
100361
100360
  this.emit(updatedResult);
100362
100361
  });
100362
+ this.refresh = value.refresh;
100363
+ this.emit(ok$1(value.data));
100364
+ } else {
100365
+ this.emit(result);
100363
100366
  }
100364
100367
  } else {
100365
100368
  this.unsubscriber = () => {
100366
100369
  };
100370
+ this.emit(result);
100367
100371
  }
100368
100372
  });
100369
100373
  } catch (e) {
@@ -100380,87 +100384,76 @@
100380
100384
  }
100381
100385
  }
100382
100386
  }
100383
- function isIncompleteConfigError(err2) {
100384
- return err2 instanceof MissingRequiredPropertyError || err2 instanceof JsonSchemaViolationError && err2.validationErrors.find(
100387
+ function isIncompleteConfigError(err) {
100388
+ return err instanceof MissingRequiredPropertyError || err instanceof JsonSchemaViolationError && err.validationErrors.find(
100385
100389
  (validationError) => validationError instanceof MissingRequiredPropertyError
100386
100390
  ) !== void 0;
100387
100391
  }
100388
- function emitGraphQLResult(callback, result) {
100389
- if (result.isErr()) {
100390
- logError(result.error);
100391
- if (isUserVisibleError(result.error)) {
100392
- callback({
100393
- data: result.error.data.data,
100394
- errors: result.error.data.errors
100395
- });
100396
- return;
100397
- }
100398
- callback({
100399
- data: void 0,
100400
- errors: [{ message: "Internal error in GraphQL adapter occurred", locations: [] }]
100401
- });
100402
- return;
100403
- }
100404
- if ("subscribe" in result.value) {
100405
- callback(formatGraphQLData(result.value.data));
100406
- return;
100407
- }
100408
- callback(formatGraphQLData(result.value));
100409
- }
100410
- function resolveAst(ast) {
100411
- const result = astResolver(ast);
100412
- if (result === void 0) {
100413
- throw new Error("Could not resolve AST. Did you parse the query with gql?");
100414
- }
100415
- return result;
100416
- }
100417
- function formatGraphQLData(data) {
100418
- if (data.errors === void 0 || data.errors.length === 0) {
100419
- return {
100420
- data: data.data,
100421
- errors: void 0
100422
- };
100423
- }
100424
- return {
100425
- data: data.data,
100426
- errors: data.errors
100427
- };
100428
- }
100429
100392
  class GraphQLCommandWireAdapterConstructor extends CommandWireAdapterConstructor {
100430
100393
  emit(result) {
100431
100394
  try {
100432
100395
  if (result === void 0) {
100433
100396
  this.callback({ data: void 0, errors: void 0 });
100434
100397
  } else {
100435
- if (result.isErr()) {
100436
- emitGraphQLResult(this.callback, result);
100437
- return;
100438
- }
100439
- const userEmittedData = {
100440
- ...result.value.data
100441
- };
100442
- if (this.exposeRefresh) {
100443
- userEmittedData.refresh = () => {
100444
- return result.value.refresh().then((res) => {
100398
+ const consumerEmittedRefresh = () => {
100399
+ if (!this.refresh) {
100400
+ return Promise.resolve();
100401
+ }
100402
+ return new Promise((resolve, reject) => {
100403
+ if (!this.refresh) {
100404
+ resolve();
100405
+ return;
100406
+ }
100407
+ this.refresh().then((res) => {
100445
100408
  if (res.isOk()) {
100446
- return;
100409
+ resolve();
100410
+ } else {
100411
+ reject(
100412
+ new Error(
100413
+ "Internal error in GraphQL adapter occurred: Failed to refresh GraphQL data"
100414
+ )
100415
+ );
100447
100416
  }
100448
- throw new Error(
100449
- "Internal error in GraphQL adapter occurred: Failed to refresh GraphQL data"
100450
- );
100451
100417
  });
100452
- };
100418
+ });
100419
+ };
100420
+ let consumerEmittedData = {
100421
+ data: void 0,
100422
+ errors: void 0
100423
+ };
100424
+ if (this.exposeRefresh && this.refresh) {
100425
+ consumerEmittedData.refresh = consumerEmittedRefresh;
100453
100426
  }
100454
- deepFreeze(userEmittedData);
100455
- this.callback(userEmittedData);
100456
- return;
100427
+ if (result.isErr()) {
100428
+ logError(result.error);
100429
+ if (isUserVisibleError(result.error)) {
100430
+ consumerEmittedData.data = result.error.data.data;
100431
+ consumerEmittedData.errors = result.error.data.errors;
100432
+ } else {
100433
+ consumerEmittedData.errors = [
100434
+ {
100435
+ message: "Internal error in GraphQL adapter occurred",
100436
+ locations: []
100437
+ }
100438
+ ];
100439
+ }
100440
+ } else {
100441
+ consumerEmittedData.data = result.value.data;
100442
+ }
100443
+ deepFreeze(consumerEmittedData);
100444
+ this.callback(consumerEmittedData);
100457
100445
  }
100458
100446
  } catch (e) {
100459
- emitGraphQLResult(this.callback, err$1(e));
100447
+ logError(e);
100448
+ this.handleExecutionThrow(e);
100460
100449
  }
100461
100450
  }
100462
100451
  handleExecutionThrow(e) {
100463
- emitGraphQLResult(this.callback, err$1(e));
100452
+ logError(e);
100453
+ this.callback({
100454
+ data: void 0,
100455
+ errors: [{ message: "Internal error in GraphQL adapter occurred", locations: [] }]
100456
+ });
100464
100457
  }
100465
100458
  update(config, _context) {
100466
100459
  this.unsubscribe();
@@ -100472,31 +100465,89 @@
100472
100465
  }
100473
100466
  }
100474
100467
  function buildAsyncGraphQLImperativeLegacyInvoker(getCommand) {
100475
- const invoke = async (config, _requestContext, callback) => {
100468
+ const invoke = async (config, requestContext, callback) => {
100476
100469
  const command = getCommand({ config, assertIsValid });
100477
100470
  try {
100478
- const result = await command.execute();
100471
+ const overrides = requestContextIsCachePolicy(requestContext) ? { cacheControlConfig: { type: "no-cache" } } : {};
100472
+ const result = await command.execute(overrides);
100473
+ const consumerEmittedData = {
100474
+ data: void 0,
100475
+ errors: void 0
100476
+ };
100479
100477
  if (result.isOk()) {
100480
100478
  deepFreeze(result.value);
100479
+ consumerEmittedData.data = result.value.data.data;
100480
+ } else {
100481
+ if (isUserVisibleError(result.error)) {
100482
+ consumerEmittedData.data = result.error.data.data;
100483
+ consumerEmittedData.errors = result.error.data.errors;
100484
+ } else {
100485
+ logError(result.error);
100486
+ consumerEmittedData.errors = [
100487
+ { message: "Internal error in GraphQL adapter occurred", locations: [] }
100488
+ ];
100489
+ }
100481
100490
  }
100482
- emitGraphQLResult(callback, result);
100491
+ callback(consumerEmittedData);
100483
100492
  } catch (error) {
100484
- emitGraphQLResult(callback, err$1(error));
100493
+ logError(error);
100494
+ callback({
100495
+ data: void 0,
100496
+ errors: [{ message: "Internal error in GraphQL adapter occurred", locations: [] }]
100497
+ });
100485
100498
  }
100486
100499
  };
100487
- const subscribe = (config, _requestContext, callback) => {
100500
+ const subscribe = (config, requestContext, callback) => {
100488
100501
  const command = getCommand({ config, assertIsValid });
100489
100502
  let unsubscribe = () => {
100490
100503
  };
100491
- command.execute().then((result) => {
100492
- if (!result.isOk()) {
100493
- emitGraphQLResult(callback, result);
100494
- return;
100504
+ const overrides = requestContextIsCachePolicy(requestContext) ? { cacheControlConfig: { type: "no-cache" } } : {};
100505
+ command.execute(overrides).then((result) => {
100506
+ const consumerEmittedData = {
100507
+ data: void 0,
100508
+ errors: void 0
100509
+ };
100510
+ if (result.isOk()) {
100511
+ deepFreeze(result.value);
100512
+ consumerEmittedData.data = result.value.data.data;
100513
+ unsubscribe = result.value.subscribe((res) => {
100514
+ const consumerEmittedData2 = {
100515
+ data: void 0,
100516
+ errors: void 0
100517
+ };
100518
+ if (res.isOk()) {
100519
+ consumerEmittedData2.data = res.value.data;
100520
+ } else {
100521
+ if (isUserVisibleError(res.error)) {
100522
+ consumerEmittedData2.data = res.error.data.data;
100523
+ consumerEmittedData2.errors = res.error.data.errors;
100524
+ } else {
100525
+ logError(res.error);
100526
+ consumerEmittedData2.errors = [
100527
+ {
100528
+ message: "Internal error in GraphQL adapter occurred",
100529
+ locations: []
100530
+ }
100531
+ ];
100532
+ }
100533
+ }
100534
+ callback(consumerEmittedData2);
100535
+ });
100536
+ } else {
100537
+ if (isUserVisibleError(result.error)) {
100538
+ consumerEmittedData.data = result.error.data.data;
100539
+ consumerEmittedData.errors = result.error.data.errors;
100540
+ } else {
100541
+ logError(result.error);
100542
+ consumerEmittedData.errors = [
100543
+ {
100544
+ message: "Internal error in GraphQL adapter occurred",
100545
+ locations: []
100546
+ }
100547
+ ];
100548
+ }
100495
100549
  }
100496
- unsubscribe = result.value.subscribe((res) => {
100497
- emitGraphQLResult(callback, res);
100498
- });
100499
- emitGraphQLResult(callback, result);
100550
+ callback(consumerEmittedData);
100500
100551
  });
100501
100552
  return () => {
100502
100553
  unsubscribe();
@@ -100504,7 +100555,17 @@
100504
100555
  };
100505
100556
  return { invoke, subscribe };
100506
100557
  }
100507
- // version: 1.378.0-63d7c07562
100558
+ function requestContextIsCachePolicy(requestContext) {
100559
+ return typeof requestContext === "object" && requestContext !== null && "cachePolicy" in requestContext && typeof requestContext.cachePolicy === "object" && requestContext.cachePolicy !== null && "type" in requestContext.cachePolicy && requestContext.cachePolicy.type === "no-cache";
100560
+ }
100561
+ function resolveAst(ast) {
100562
+ const result = astResolver(ast);
100563
+ if (result === void 0) {
100564
+ throw new Error("Could not resolve AST. Did you parse the query with gql?");
100565
+ }
100566
+ return result;
100567
+ }
100568
+ // version: 1.379.1-7ea94edc38
100508
100569
 
100509
100570
  class Analytics__AnalyticsBrowseRepository extends UnidentifiableGraphQLTypeRepository {
100510
100571
  constructor(services, typeRegistry) {
@@ -100716,7 +100777,14 @@
100716
100777
  this.namespace = "oas";
100717
100778
  this.typeName = "AnyType";
100718
100779
  this.implementedInterfaces = [];
100719
- this.possibleTypes = {
100780
+ }
100781
+ get fields() {
100782
+ return {
100783
+ __typename: new BaseScalarFieldDef(false),
100784
+ };
100785
+ }
100786
+ get possibleTypes() {
100787
+ return {
100720
100788
  BooleanValue: this.typeRegistry.BooleanValue,
100721
100789
  DateValue: this.typeRegistry.DateValue,
100722
100790
  DateTimeValue: this.typeRegistry.DateTimeValue,
@@ -100724,11 +100792,6 @@
100724
100792
  StringValue: this.typeRegistry.StringValue,
100725
100793
  };
100726
100794
  }
100727
- get fields() {
100728
- return {
100729
- __typename: new BaseScalarFieldDef(false),
100730
- };
100731
- }
100732
100795
  }
100733
100796
 
100734
100797
  class Base64ValueRepository extends UnidentifiableGraphQLTypeRepository {
@@ -101661,7 +101724,7 @@
101661
101724
  }
101662
101725
  }
101663
101726
 
101664
- class PolymorphicAggregateParentRelationshipRepository extends BaseUnionRepository {
101727
+ let PolymorphicAggregateParentRelationshipRepository$1 = class PolymorphicAggregateParentRelationshipRepository extends BaseUnionRepository {
101665
101728
  constructor(services, typeRegistry) {
101666
101729
  super(services);
101667
101730
  this.services = services;
@@ -101669,16 +101732,18 @@
101669
101732
  this.namespace = "oas";
101670
101733
  this.typeName = "PolymorphicAggregateParentRelationship";
101671
101734
  this.implementedInterfaces = [];
101672
- this.possibleTypes = {
101673
- RecordAggregate: this.typeRegistry.RecordAggregate,
101674
- };
101675
101735
  }
101676
101736
  get fields() {
101677
101737
  return {
101678
101738
  __typename: new BaseScalarFieldDef(false),
101679
101739
  };
101680
101740
  }
101681
- }
101741
+ get possibleTypes() {
101742
+ return {
101743
+ RecordAggregate: this.typeRegistry.RecordAggregate,
101744
+ };
101745
+ }
101746
+ };
101682
101747
 
101683
101748
  let PolymorphicParentRelationshipRepository$1 = class PolymorphicParentRelationshipRepository extends BaseUnionRepository {
101684
101749
  constructor(services, typeRegistry) {
@@ -101688,15 +101753,17 @@
101688
101753
  this.namespace = "oas";
101689
101754
  this.typeName = "PolymorphicParentRelationship";
101690
101755
  this.implementedInterfaces = [];
101691
- this.possibleTypes = {
101692
- RecordRepresentation: this.typeRegistry.RecordRepresentation,
101693
- };
101694
101756
  }
101695
101757
  get fields() {
101696
101758
  return {
101697
101759
  __typename: new BaseScalarFieldDef(false),
101698
101760
  };
101699
101761
  }
101762
+ get possibleTypes() {
101763
+ return {
101764
+ RecordRepresentation: this.typeRegistry.RecordRepresentation,
101765
+ };
101766
+ }
101700
101767
  };
101701
101768
 
101702
101769
  class QueryRepository extends GraphQLDocumentRootTypeRepository {
@@ -101721,7 +101788,7 @@
101721
101788
  }
101722
101789
  }
101723
101790
 
101724
- class RecordAggregateConnectionRepository extends UnidentifiableGraphQLTypeRepository {
101791
+ let RecordAggregateConnectionRepository$1 = class RecordAggregateConnectionRepository extends UnidentifiableGraphQLTypeRepository {
101725
101792
  constructor(services, typeRegistry) {
101726
101793
  super(services);
101727
101794
  this.services = services;
@@ -101738,9 +101805,9 @@
101738
101805
  totalCount: new BaseScalarFieldDef(false),
101739
101806
  };
101740
101807
  }
101741
- }
101808
+ };
101742
101809
 
101743
- class RecordAggregateEdgeRepository extends UnidentifiableGraphQLTypeRepository {
101810
+ let RecordAggregateEdgeRepository$1 = class RecordAggregateEdgeRepository extends UnidentifiableGraphQLTypeRepository {
101744
101811
  constructor(services, typeRegistry) {
101745
101812
  super(services);
101746
101813
  this.services = services;
@@ -101756,7 +101823,7 @@
101756
101823
  cursor: new BaseScalarFieldDef(false),
101757
101824
  };
101758
101825
  }
101759
- }
101826
+ };
101760
101827
 
101761
101828
  let RecordAggregateRepository$1 = class RecordAggregateRepository extends UnidentifiableGraphQLTypeRepository {
101762
101829
  constructor(services, typeRegistry) {
@@ -101794,7 +101861,7 @@
101794
101861
  }
101795
101862
  };
101796
101863
 
101797
- class RecordConnectionRepository extends UnidentifiableGraphQLTypeRepository {
101864
+ let RecordConnectionRepository$1 = class RecordConnectionRepository extends UnidentifiableGraphQLTypeRepository {
101798
101865
  constructor(services, typeRegistry) {
101799
101866
  super(services);
101800
101867
  this.services = services;
@@ -101812,9 +101879,9 @@
101812
101879
  pageResultCount: new BaseScalarFieldDef(false),
101813
101880
  };
101814
101881
  }
101815
- }
101882
+ };
101816
101883
 
101817
- class RecordEdgeRepository extends UnidentifiableGraphQLTypeRepository {
101884
+ let RecordEdgeRepository$1 = class RecordEdgeRepository extends UnidentifiableGraphQLTypeRepository {
101818
101885
  constructor(services, typeRegistry) {
101819
101886
  super(services);
101820
101887
  this.services = services;
@@ -101830,7 +101897,7 @@
101830
101897
  cursor: new BaseScalarFieldDef(false),
101831
101898
  };
101832
101899
  }
101833
- }
101900
+ };
101834
101901
 
101835
101902
  let RecordQueryAggregateRepository$1 = class RecordQueryAggregateRepository extends UnidentifiableGraphQLTypeRepository {
101836
101903
  constructor(services, typeRegistry) {
@@ -101925,7 +101992,7 @@
101925
101992
  }
101926
101993
  };
101927
101994
 
101928
- class RecordResultRepository extends UnidentifiableGraphQLTypeRepository {
101995
+ let RecordResultRepository$1 = class RecordResultRepository extends UnidentifiableGraphQLTypeRepository {
101929
101996
  constructor(services, typeRegistry) {
101930
101997
  super(services);
101931
101998
  this.services = services;
@@ -101940,7 +102007,7 @@
101940
102007
  aggregate: new BaseObjectFieldDef(this.typeRegistry.RecordAggregate, true),
101941
102008
  };
101942
102009
  }
101943
- }
102010
+ };
101944
102011
 
101945
102012
  class RecordTypeInfoRepository extends UnidentifiableGraphQLTypeRepository {
101946
102013
  constructor(services, typeRegistry) {
@@ -102363,15 +102430,17 @@
102363
102430
  this.namespace = "oas";
102364
102431
  this.typeName = "Setup__SetupPolymorphicAggregateParentRelationship";
102365
102432
  this.implementedInterfaces = [];
102366
- this.possibleTypes = {
102367
- Setup__SetupRecordAggregate: this.typeRegistry.Setup__SetupRecordAggregate,
102368
- };
102369
102433
  }
102370
102434
  get fields() {
102371
102435
  return {
102372
102436
  __typename: new BaseScalarFieldDef(false),
102373
102437
  };
102374
102438
  }
102439
+ get possibleTypes() {
102440
+ return {
102441
+ Setup__SetupRecordAggregate: this.typeRegistry.Setup__SetupRecordAggregate,
102442
+ };
102443
+ }
102375
102444
  }
102376
102445
 
102377
102446
  class Setup__SetupPolymorphicParentRelationshipRepository extends BaseUnionRepository {
@@ -102382,15 +102451,17 @@
102382
102451
  this.namespace = "oas";
102383
102452
  this.typeName = "Setup__SetupPolymorphicParentRelationship";
102384
102453
  this.implementedInterfaces = [];
102385
- this.possibleTypes = {
102386
- Setup__EntityRepresentation: this.typeRegistry.Setup__EntityRepresentation,
102387
- };
102388
102454
  }
102389
102455
  get fields() {
102390
102456
  return {
102391
102457
  __typename: new BaseScalarFieldDef(false),
102392
102458
  };
102393
102459
  }
102460
+ get possibleTypes() {
102461
+ return {
102462
+ Setup__EntityRepresentation: this.typeRegistry.Setup__EntityRepresentation,
102463
+ };
102464
+ }
102394
102465
  }
102395
102466
 
102396
102467
  class Setup__SetupQueryAggregateRepository extends UnidentifiableGraphQLTypeRepository {
@@ -102740,10 +102811,10 @@
102740
102811
  this._AnyType = new AnyTypeRepository(this.services, this);
102741
102812
  this._RecordRepresentation =
102742
102813
  new RecordRepresentationRepository$1(this.services, this);
102743
- this._RecordEdge = new RecordEdgeRepository(this.services, this);
102814
+ this._RecordEdge = new RecordEdgeRepository$1(this.services, this);
102744
102815
  this._PageInfo = new PageInfoRepository(this.services, this);
102745
102816
  this._RecordConnection =
102746
- new RecordConnectionRepository(this.services, this);
102817
+ new RecordConnectionRepository$1(this.services, this);
102747
102818
  this._RecordQuery = new RecordQueryRepository$1(this.services, this);
102748
102819
  this._BooleanAggregate =
102749
102820
  new BooleanAggregateRepository(this.services, this);
@@ -102773,13 +102844,13 @@
102773
102844
  this._TimeAggregate = new TimeAggregateRepository(this.services, this);
102774
102845
  this._UrlAggregate = new UrlAggregateRepository(this.services, this);
102775
102846
  this._PolymorphicAggregateParentRelationship =
102776
- new PolymorphicAggregateParentRelationshipRepository(this.services, this);
102847
+ new PolymorphicAggregateParentRelationshipRepository$1(this.services, this);
102777
102848
  this._RecordAggregate = new RecordAggregateRepository$1(this.services, this);
102778
- this._RecordResult = new RecordResultRepository(this.services, this);
102849
+ this._RecordResult = new RecordResultRepository$1(this.services, this);
102779
102850
  this._RecordAggregateEdge =
102780
- new RecordAggregateEdgeRepository(this.services, this);
102851
+ new RecordAggregateEdgeRepository$1(this.services, this);
102781
102852
  this._RecordAggregateConnection =
102782
- new RecordAggregateConnectionRepository(this.services, this);
102853
+ new RecordAggregateConnectionRepository$1(this.services, this);
102783
102854
  this._RecordQueryAggregate =
102784
102855
  new RecordQueryAggregateRepository$1(this.services, this);
102785
102856
  this._ChildRelationship =
@@ -103329,9 +103400,19 @@
103329
103400
  'RecordTypeId',
103330
103401
  ];
103331
103402
  }
103332
- getFieldDef(input, selection) {
103403
+ getFieldDef(_input, selection) {
103333
103404
  return buildGenericTypeFieldDef(selection, this.fields, this.staticFieldNames, this.typeName);
103334
103405
  }
103406
+ satisfiesFragmentTypeCondition(_input, fragment) {
103407
+ const result = super.satisfiesFragmentTypeCondition(_input, fragment);
103408
+ if (result.isErr()) {
103409
+ return result;
103410
+ }
103411
+ if (result.value) {
103412
+ return result;
103413
+ }
103414
+ return err(new Error(`${this.typeName}: unsupported fragment type condition: ${fragment.typeCondition?.name.value}`));
103415
+ }
103335
103416
  }
103336
103417
 
103337
103418
  class RecordRepresentationRepository extends RecordRepresentationRepository$1 {
@@ -103354,15 +103435,26 @@
103354
103435
  let overridenInput = input;
103355
103436
  // If ID exists in the data but wasn't asked for, its from the extensions, and we should normalize it
103356
103437
  if (input.data.Id !== undefined &&
103357
- input.selections.find((selection) => selection.kind === 'Field' && selection.name.value === 'Id')) {
103438
+ !input.selections.find((selection) => selection.kind === 'Field' && selection.name.value === 'Id')) {
103358
103439
  overridenInput = {
103359
- ...input,
103440
+ ...overridenInput,
103360
103441
  selections: [
103361
- ...input.selections,
103442
+ ...overridenInput.selections,
103362
103443
  { kind: 'Field', name: { kind: 'Name', value: 'Id' } },
103363
103444
  ],
103364
103445
  };
103365
103446
  }
103447
+ // If WeakEtag exists in the data but wasn't asked for, its from the extensions, and we should normalize it
103448
+ if (input.data.WeakEtag !== undefined &&
103449
+ !input.selections.find((selection) => selection.kind === 'Field' && selection.name.value === 'WeakEtag')) {
103450
+ overridenInput = {
103451
+ ...overridenInput,
103452
+ selections: [
103453
+ ...overridenInput.selections,
103454
+ { kind: 'Field', name: { kind: 'Name', value: 'WeakEtag' } },
103455
+ ],
103456
+ };
103457
+ }
103366
103458
  const result = super.write(cache, overridenInput);
103367
103459
  const recordId = input.data.Id;
103368
103460
  const luvioRecord = input.getNormalizedLuvioRecord(recordId, input.reader);
@@ -103375,13 +103467,18 @@
103375
103467
  }
103376
103468
  read(cache, input) {
103377
103469
  const result = super.read(cache, input);
103378
- const idData = super.read(cache, {
103470
+ const trackingData = super.read(cache, {
103379
103471
  ...input,
103380
- selections: [{ kind: 'Field', name: { kind: 'Name', value: 'Id' } }],
103472
+ selections: [
103473
+ { kind: 'Field', name: { kind: 'Name', value: 'Id' } },
103474
+ { kind: 'Field', name: { kind: 'Name', value: 'WeakEtag' } },
103475
+ ],
103381
103476
  });
103382
- if (idData.isOk()) {
103477
+ if (trackingData.isOk()) {
103383
103478
  // Read the record to track subscription
103384
- input.getNormalizedLuvioRecord(idData.value.Id, input.reader);
103479
+ input.getNormalizedLuvioRecord(trackingData.value.Id, input.reader);
103480
+ // Track the weak etag for the record for cross cache invalidation
103481
+ input.usedRecordIdToWeakEtagMap[trackingData.value.Id] = trackingData.value.WeakEtag;
103385
103482
  }
103386
103483
  return result;
103387
103484
  }
@@ -103474,6 +103571,16 @@
103474
103571
  isBaseFieldSelection(selection) {
103475
103572
  return super.getFieldDef(undefined, selection) !== undefined;
103476
103573
  }
103574
+ satisfiesFragmentTypeCondition(_input, fragment) {
103575
+ const result = super.satisfiesFragmentTypeCondition(_input, fragment);
103576
+ if (result.isErr()) {
103577
+ return result;
103578
+ }
103579
+ if (result.value) {
103580
+ return result;
103581
+ }
103582
+ return err(new Error(`${this.typeName}: unsupported fragment type condition: ${fragment.typeCondition?.name.value}`));
103583
+ }
103477
103584
  }
103478
103585
 
103479
103586
  class RecordQueryRepository extends RecordQueryRepository$1 {
@@ -103495,6 +103602,16 @@
103495
103602
  getFieldDef(input, selection) {
103496
103603
  return buildGenericTypeFieldDef(selection, this.fields, this.staticFieldNames, this.typeName);
103497
103604
  }
103605
+ satisfiesFragmentTypeCondition(_input, fragment) {
103606
+ const result = super.satisfiesFragmentTypeCondition(_input, fragment);
103607
+ if (result.isErr()) {
103608
+ return result;
103609
+ }
103610
+ if (result.value) {
103611
+ return result;
103612
+ }
103613
+ return err(new Error(`${this.typeName}: unsupported fragment type condition: ${fragment.typeCondition?.name.value}`));
103614
+ }
103498
103615
  }
103499
103616
 
103500
103617
  class RecordQueryAggregateRepository extends RecordQueryAggregateRepository$1 {
@@ -103509,16 +103626,14 @@
103509
103626
  }
103510
103627
  }
103511
103628
 
103629
+ // This should be smarter, and filter on selections, but for now,
103630
+ // we'll match the luvio behavior of returning the blob
103512
103631
  const blobTypeDef = {
103513
103632
  read: (_cache, input) => {
103514
- return ok({
103515
- data: input.data,
103516
- });
103633
+ return ok(input.normalizedData);
103517
103634
  },
103518
103635
  write: (_cache, input) => {
103519
- return ok({
103520
- data: input.data,
103521
- });
103636
+ return ok(input.data);
103522
103637
  },
103523
103638
  buildFieldKey: (selection, variables) => buildFieldKey(selection.name.value, selection.arguments, variables),
103524
103639
  augmentSelections: (input) => input,
@@ -103580,6 +103695,16 @@
103580
103695
  // We should make this smarter, storing and returning blobs isn't great since it could, and likely will, include unrequested field data
103581
103696
  return blobTypeDef;
103582
103697
  }
103698
+ satisfiesFragmentTypeCondition(input, fragment) {
103699
+ const result = super.satisfiesFragmentTypeCondition(input, fragment);
103700
+ if (result.isErr()) {
103701
+ return result;
103702
+ }
103703
+ if (result.value) {
103704
+ return result;
103705
+ }
103706
+ return err(new Error(`${this.typeName}: unsupported fragment type condition: ${fragment.typeCondition?.name.value}`));
103707
+ }
103583
103708
  }
103584
103709
 
103585
103710
  class SetupQueryAggregateRepository extends Setup__SetupQueryAggregateRepository {
@@ -103617,6 +103742,16 @@
103617
103742
  }
103618
103743
  return blobTypeDef;
103619
103744
  }
103745
+ satisfiesFragmentTypeCondition(_input, fragment) {
103746
+ const result = super.satisfiesFragmentTypeCondition(_input, fragment);
103747
+ if (result.isErr()) {
103748
+ return result;
103749
+ }
103750
+ if (result.value) {
103751
+ return result;
103752
+ }
103753
+ return err(new Error(`${this.typeName}: unsupported fragment type condition: ${fragment.typeCondition?.name.value}`));
103754
+ }
103620
103755
  }
103621
103756
 
103622
103757
  class PolymorphicParentRelationshipRepository extends PolymorphicParentRelationshipRepository$1 {
@@ -103627,26 +103762,242 @@
103627
103762
  }
103628
103763
  }
103629
103764
 
103765
+ // We're going to override the generated repository
103766
+ // to make this a pseudo-identifiable repository
103767
+ // so that we can independently control its cache control (no-cache)
103768
+ class SetupRepository extends IdentifiableGraphQLTypeRepository {
103769
+ constructor(services, typeRegistry) {
103770
+ super(services);
103771
+ this.typeRegistry = typeRegistry;
103772
+ this.namespace = 'oas';
103773
+ this.typeName = 'Setup__Setup';
103774
+ this.implementedInterfaces = [];
103775
+ this.cacheControl = {
103776
+ type: 'no-cache',
103777
+ };
103778
+ this.baseRepository = new Setup__SetupRepository(services, typeRegistry);
103779
+ }
103780
+ get fields() {
103781
+ return this.baseRepository.fields;
103782
+ }
103783
+ buildKeyParams(_input) {
103784
+ return null;
103785
+ }
103786
+ augmentSelections(input) {
103787
+ return this.baseRepository.augmentSelections(input);
103788
+ }
103789
+ }
103790
+
103791
+ class SetupEdgeRepository extends Setup__SetupEdgeRepository {
103792
+ satisfiesFragmentTypeCondition(_input, fragment) {
103793
+ const result = super.satisfiesFragmentTypeCondition(_input, fragment);
103794
+ if (result.isErr()) {
103795
+ return result;
103796
+ }
103797
+ if (result.value) {
103798
+ return result;
103799
+ }
103800
+ return err(new Error(`${this.typeName}: unsupported fragment type condition: ${fragment.typeCondition?.name.value}`));
103801
+ }
103802
+ }
103803
+
103804
+ class PolymorphicAggregateParentRelationshipRepository extends PolymorphicAggregateParentRelationshipRepository$1 {
103805
+ getTypeDiscriminator(data, _selections) {
103806
+ // Hardcoded to record aggregate since that's the only type of parent
103807
+ // relationship possible
103808
+ return 'RecordAggregate';
103809
+ }
103810
+ }
103811
+
103812
+ class RecordAggregateConnectionRepository extends RecordAggregateConnectionRepository$1 {
103813
+ satisfiesFragmentTypeCondition(_input, fragment) {
103814
+ const result = super.satisfiesFragmentTypeCondition(_input, fragment);
103815
+ if (result.isErr()) {
103816
+ return result;
103817
+ }
103818
+ if (result.value) {
103819
+ return result;
103820
+ }
103821
+ return err(new Error(`${this.typeName}: unsupported fragment type condition: ${fragment.typeCondition?.name.value}`));
103822
+ }
103823
+ }
103824
+
103825
+ class RecordAggregateEdgeRepository extends RecordAggregateEdgeRepository$1 {
103826
+ satisfiesFragmentTypeCondition(_input, fragment) {
103827
+ const result = super.satisfiesFragmentTypeCondition(_input, fragment);
103828
+ if (result.isErr()) {
103829
+ return result;
103830
+ }
103831
+ if (result.value) {
103832
+ return result;
103833
+ }
103834
+ return err(new Error(`${this.typeName}: unsupported fragment type condition: ${fragment.typeCondition?.name.value}`));
103835
+ }
103836
+ }
103837
+
103838
+ class RecordConnectionRepository extends RecordConnectionRepository$1 {
103839
+ satisfiesFragmentTypeCondition(_input, fragment) {
103840
+ const result = super.satisfiesFragmentTypeCondition(_input, fragment);
103841
+ if (result.isErr()) {
103842
+ return result;
103843
+ }
103844
+ if (result.value) {
103845
+ return result;
103846
+ }
103847
+ return err(new Error(`${this.typeName}: unsupported fragment type condition: ${fragment.typeCondition?.name.value}`));
103848
+ }
103849
+ }
103850
+
103851
+ class RecordEdgeRepository extends RecordEdgeRepository$1 {
103852
+ satisfiesFragmentTypeCondition(_input, fragment) {
103853
+ const result = super.satisfiesFragmentTypeCondition(_input, fragment);
103854
+ if (result.isErr()) {
103855
+ return result;
103856
+ }
103857
+ if (result.value) {
103858
+ return result;
103859
+ }
103860
+ return err(new Error(`${this.typeName}: unsupported fragment type condition: ${fragment.typeCondition?.name.value}`));
103861
+ }
103862
+ }
103863
+
103864
+ class RecordResultRepository extends RecordResultRepository$1 {
103865
+ satisfiesFragmentTypeCondition(_input, fragment) {
103866
+ const result = super.satisfiesFragmentTypeCondition(_input, fragment);
103867
+ if (result.isErr()) {
103868
+ return result;
103869
+ }
103870
+ if (result.value) {
103871
+ return result;
103872
+ }
103873
+ return err(new Error(`${this.typeName}: unsupported fragment type condition: ${fragment.typeCondition?.name.value}`));
103874
+ }
103875
+ }
103876
+
103877
+ class SetupRecordResultRepository extends Setup__SetupRecordResultRepository {
103878
+ satisfiesFragmentTypeCondition(_input, fragment) {
103879
+ const result = super.satisfiesFragmentTypeCondition(_input, fragment);
103880
+ if (result.isErr()) {
103881
+ return result;
103882
+ }
103883
+ if (result.value) {
103884
+ return result;
103885
+ }
103886
+ return err(new Error(`${this.typeName}: unsupported fragment type condition: ${fragment.typeCondition?.name.value}`));
103887
+ }
103888
+ }
103889
+
103890
+ class SetupAggregateConnectionRepository extends Setup__SetupAggregateConnectionRepository {
103891
+ satisfiesFragmentTypeCondition(_input, fragment) {
103892
+ const result = super.satisfiesFragmentTypeCondition(_input, fragment);
103893
+ if (result.isErr()) {
103894
+ return result;
103895
+ }
103896
+ if (result.value) {
103897
+ return result;
103898
+ }
103899
+ return err(new Error(`${this.typeName}: unsupported fragment type condition: ${fragment.typeCondition?.name.value}`));
103900
+ }
103901
+ }
103902
+
103903
+ class SetupAggregateEdgeRepository extends Setup__SetupAggregateEdgeRepository {
103904
+ satisfiesFragmentTypeCondition(_input, fragment) {
103905
+ const result = super.satisfiesFragmentTypeCondition(_input, fragment);
103906
+ if (result.isErr()) {
103907
+ return result;
103908
+ }
103909
+ if (result.value) {
103910
+ return result;
103911
+ }
103912
+ return err(new Error(`${this.typeName}: unsupported fragment type condition: ${fragment.typeCondition?.name.value}`));
103913
+ }
103914
+ }
103915
+
103916
+ class SetupConnectionRepository extends Setup__SetupConnectionRepository {
103917
+ satisfiesFragmentTypeCondition(_input, fragment) {
103918
+ const result = super.satisfiesFragmentTypeCondition(_input, fragment);
103919
+ if (result.isErr()) {
103920
+ return result;
103921
+ }
103922
+ if (result.value) {
103923
+ return result;
103924
+ }
103925
+ return err(new Error(`${this.typeName}: unsupported fragment type condition: ${fragment.typeCondition?.name.value}`));
103926
+ }
103927
+ }
103928
+
103929
+ class SetupPolymorphicAggregateParentRelationshipRepository extends Setup__SetupPolymorphicAggregateParentRelationshipRepository {
103930
+ getTypeDiscriminator(data, _selections) {
103931
+ // Hardcoded to Setup__SetupRecordAggregate since that's the only type of parent
103932
+ // relationship possible
103933
+ return 'Setup__SetupRecordAggregate';
103934
+ }
103935
+ }
103936
+
103937
+ class SetupPolymorphicParentRelationshipRepository extends Setup__SetupPolymorphicParentRelationshipRepository {
103938
+ getTypeDiscriminator(data, _selections) {
103939
+ // Hardcoded to Setup__EntityRepresentation since that's the only type of parent
103940
+ // relationship possible
103941
+ return 'Setup__EntityRepresentation';
103942
+ }
103943
+ }
103944
+
103630
103945
  class CustomGraphQLTypeRegistry extends GraphQLTypeRegistry {
103631
103946
  constructor(services) {
103632
103947
  super(services);
103633
- this._RecordRepresentation = new RecordRepresentationRepository(services, this);
103948
+ // UIAPI Records overrides
103634
103949
  this._CompoundField = new CompoundFieldRepository(services, this);
103635
- this._RecordQuery = new RecordQueryRepository(services, this);
103950
+ this._PolymorphicAggregateParentRelationship =
103951
+ new PolymorphicAggregateParentRelationshipRepository(services, this);
103952
+ this._PolymorphicParentRelationship = new PolymorphicParentRelationshipRepository(services, this);
103953
+ this._RecordAggregateConnection = new RecordAggregateConnectionRepository(services, this);
103954
+ this._RecordAggregateEdge = new RecordAggregateEdgeRepository(services, this);
103636
103955
  this._RecordAggregate = new RecordAggregateRepository(services, this);
103956
+ this._RecordConnection = new RecordConnectionRepository(services, this);
103957
+ this._RecordEdge = new RecordEdgeRepository(services, this);
103637
103958
  this._RecordQueryAggregate = new RecordQueryAggregateRepository(services, this);
103959
+ this._RecordQuery = new RecordQueryRepository(services, this);
103960
+ this._RecordRepresentation = new RecordRepresentationRepository(services, this);
103961
+ this._RecordResult = new RecordResultRepository(services, this);
103962
+ // Setup overrides
103963
+ this._SetupAggregateConnection = new SetupAggregateConnectionRepository(services, this);
103964
+ this._SetupAggregateEdge = new SetupAggregateEdgeRepository(services, this);
103965
+ this._SetupConnection = new SetupConnectionRepository(services, this);
103966
+ this._SetupEdge = new SetupEdgeRepository(services, this);
103638
103967
  this._SetupEntityRepresentation = new SetupEntityRepresentationRepository(services, this);
103968
+ this._SetupPolymorphicAggregateParentRelationship =
103969
+ new SetupPolymorphicAggregateParentRelationshipRepository(services, this);
103970
+ this._SetupPolymorphicParentRelationship = new SetupPolymorphicParentRelationshipRepository(services, this);
103639
103971
  this._SetupQueryAggregate = new SetupQueryAggregateRepository(services, this);
103640
103972
  this._SetupQuery = new SetupQueryRepository(services, this);
103641
103973
  this._SetupRecordAggregate = new SetupRecordAggregateRepository(services, this);
103642
- this._PolymorphicParentRelationship = new PolymorphicParentRelationshipRepository(services, this);
103974
+ this._SetupRecordResult = new SetupRecordResultRepository(services, this);
103975
+ this._Setup = new SetupRepository(services, this);
103643
103976
  }
103644
103977
  get CompoundField() {
103645
103978
  return this._CompoundField;
103646
103979
  }
103980
+ get PolymorphicAggregateParentRelationship() {
103981
+ return this._PolymorphicAggregateParentRelationship;
103982
+ }
103983
+ get PolymorphicParentRelationship() {
103984
+ return this._PolymorphicParentRelationship;
103985
+ }
103986
+ get RecordAggregateConnection() {
103987
+ return this._RecordAggregateConnection;
103988
+ }
103989
+ get RecordAggregateEdge() {
103990
+ return this._RecordAggregateEdge;
103991
+ }
103647
103992
  get RecordAggregate() {
103648
103993
  return this._RecordAggregate;
103649
103994
  }
103995
+ get RecordConnection() {
103996
+ return this._RecordConnection;
103997
+ }
103998
+ get RecordEdge() {
103999
+ return this._RecordEdge;
104000
+ }
103650
104001
  get RecordQueryAggregate() {
103651
104002
  return this._RecordQueryAggregate;
103652
104003
  }
@@ -103656,20 +104007,44 @@
103656
104007
  get RecordRepresentation() {
103657
104008
  return this._RecordRepresentation;
103658
104009
  }
103659
- get SetupEntityRepresentation() {
104010
+ get RecordResult() {
104011
+ return this._RecordResult;
104012
+ }
104013
+ get Setup__SetupAggregateConnection() {
104014
+ return this._SetupAggregateConnection;
104015
+ }
104016
+ get Setup__SetupAggregateEdge() {
104017
+ return this._SetupAggregateEdge;
104018
+ }
104019
+ get Setup__SetupConnection() {
104020
+ return this._SetupConnection;
104021
+ }
104022
+ get Setup__SetupEdge() {
104023
+ return this._SetupEdge;
104024
+ }
104025
+ get Setup__EntityRepresentation() {
103660
104026
  return this._SetupEntityRepresentation;
103661
104027
  }
103662
- get SetupQueryAggregate() {
104028
+ get Setup__SetupPolymorphicAggregateParentRelationship() {
104029
+ return this._SetupPolymorphicAggregateParentRelationship;
104030
+ }
104031
+ get Setup__SetupPolymorphicParentRelationship() {
104032
+ return this._SetupPolymorphicParentRelationship;
104033
+ }
104034
+ get Setup__SetupQueryAggregate() {
103663
104035
  return this._SetupQueryAggregate;
103664
104036
  }
103665
- get SetupQuery() {
104037
+ get Setup__SetupQuery() {
103666
104038
  return this._SetupQuery;
103667
104039
  }
103668
- get SetupRecordAggregate() {
104040
+ get Setup__SetupRecordAggregate() {
103669
104041
  return this._SetupRecordAggregate;
103670
104042
  }
103671
- get PolymorphicParentRelationship() {
103672
- return this._PolymorphicParentRelationship;
104043
+ get Setup__SetupRecordResult() {
104044
+ return this._SetupRecordResult;
104045
+ }
104046
+ get Setup__Setup() {
104047
+ return this._Setup;
103673
104048
  }
103674
104049
  }
103675
104050
 
@@ -103821,10 +104196,12 @@
103821
104196
  reader: true,
103822
104197
  synthetic: true,
103823
104198
  read: (reader) => {
104199
+ this.latestUsedRecordIdToWeakEtagMap = {};
103824
104200
  readFromCacheResult = this.buildResultType().query(cache, {
103825
104201
  ...this.buildQuery(),
103826
104202
  reader,
103827
104203
  getNormalizedLuvioRecord: this.services.luvioUiapiRecords.getNormalizedLuvioRecord,
104204
+ usedRecordIdToWeakEtagMap: this.latestUsedRecordIdToWeakEtagMap,
103828
104205
  });
103829
104206
  return readFromCacheResult;
103830
104207
  },
@@ -103876,15 +104253,20 @@
103876
104253
  }
103877
104254
  return resolvedPromiseLike(undefined);
103878
104255
  }
103879
- execute() {
104256
+ execute(overrides) {
104257
+ this.services.instrumentation?.metrics
104258
+ .getMeter('onestore')
104259
+ .createCounter(`graphql.execute.count`)
104260
+ .add(1);
103880
104261
  // Clear snapshot and unsubscribe from any existing subscriptions at the beginning of execute calls
103881
104262
  this.latestLuvioSnapshot = undefined;
103882
104263
  this.latestLuvioRecordIdsToInvalidate = undefined;
104264
+ this.latestUsedRecordIdToWeakEtagMap = undefined;
103883
104265
  if (this.unsubscribeFromLuvioSnapshot) {
103884
104266
  this.unsubscribeFromLuvioSnapshot();
103885
104267
  this.unsubscribeFromLuvioSnapshot = undefined;
103886
104268
  }
103887
- const result = super.execute();
104269
+ const result = super.execute(overrides);
103888
104270
  result.then((_) => {
103889
104271
  if (this.latestLuvioRecordIdsToInvalidate &&
103890
104272
  this.latestLuvioRecordIdsToInvalidate.length > 0) {
@@ -103893,6 +104275,13 @@
103893
104275
  });
103894
104276
  return result;
103895
104277
  }
104278
+ runOriginalRequest() {
104279
+ this.services.instrumentation?.metrics
104280
+ .getMeter('onestore')
104281
+ .createCounter(`graphql.fallback.count`)
104282
+ .add(1);
104283
+ return super.runOriginalRequest();
104284
+ }
103896
104285
  subscribeToKeysUsed() {
103897
104286
  super.subscribeToKeysUsed();
103898
104287
  // Subscribe to luvio cache changes using the stored snapshot
@@ -103900,15 +104289,53 @@
103900
104289
  try {
103901
104290
  const luvioService = this.services.luvio;
103902
104291
  const luvioInstance = luvioService.luvio;
103903
- // Subscribe to changes using the stored snapshot
104292
+ if (this.unsubscribeFromLuvioSnapshot) {
104293
+ this.unsubscribeFromLuvioSnapshot();
104294
+ }
103904
104295
  this.unsubscribeFromLuvioSnapshot = luvioInstance.storeSubscribe(this.latestLuvioSnapshot, (_) => {
103905
104296
  // If any records used change at the top level, refresh all the data
103906
- this.refresh();
104297
+ if (this.usedRecordsChanged()) {
104298
+ this.refresh();
104299
+ }
103907
104300
  });
103908
104301
  }
103909
104302
  catch (error) { }
103910
104303
  }
103911
104304
  }
104305
+ usedRecordsChanged() {
104306
+ if (!this.latestUsedRecordIdToWeakEtagMap ||
104307
+ Object.keys(this.latestUsedRecordIdToWeakEtagMap).length === 0) {
104308
+ return false;
104309
+ }
104310
+ const luvioService = this.services.luvio;
104311
+ const luvioInstance = luvioService.luvio;
104312
+ let dataChanged = false;
104313
+ luvioInstance.storeLookup({
104314
+ recordId: 'onestore-graphql',
104315
+ node: {
104316
+ kind: 'Fragment',
104317
+ reader: true,
104318
+ synthetic: true,
104319
+ read: (reader) => {
104320
+ if (this.latestUsedRecordIdToWeakEtagMap) {
104321
+ Object.entries(this.latestUsedRecordIdToWeakEtagMap).forEach(([recordId, oneStoreRecordWeakEtag]) => {
104322
+ const normalizedLuvioRecord = this.services.luvioUiapiRecords.getNormalizedLuvioRecord(recordId, reader);
104323
+ if (!normalizedLuvioRecord) {
104324
+ return;
104325
+ }
104326
+ const luvioRecordWeakEtag = normalizedLuvioRecord.weakEtag;
104327
+ if (luvioRecordWeakEtag !== oneStoreRecordWeakEtag) {
104328
+ dataChanged = true;
104329
+ }
104330
+ });
104331
+ }
104332
+ return {};
104333
+ },
104334
+ },
104335
+ variables: {},
104336
+ });
104337
+ return dataChanged;
104338
+ }
103912
104339
  };
103913
104340
  }
103914
104341
 
@@ -103955,6 +104382,11 @@
103955
104382
  type: 'luvioUiapiRecords',
103956
104383
  version: '1.0',
103957
104384
  },
104385
+ instrumentation: {
104386
+ type: 'instrumentation',
104387
+ version: '1.0',
104388
+ optional: true,
104389
+ },
103958
104390
  };
103959
104391
  let provisionedCallback;
103960
104392
  getServices(serviceRequirements).then((services) => {
@@ -103965,7 +104397,7 @@
103965
104397
  constructor() {
103966
104398
  super(...arguments);
103967
104399
  this.configSchema = CONFIG_SCHEMA;
103968
- this.exposeRefresh = false;
104400
+ this.exposeRefresh = true;
103969
104401
  }
103970
104402
  getCommand() {
103971
104403
  return new graphql_ctor({ ...this.config, query: resolveAst(this.config.query) }, documentRootType, services);
@@ -103990,7 +104422,7 @@
103990
104422
  cb(graphql$1, graphql_imperative$1, useOneStoreGraphQL);
103991
104423
  }
103992
104424
  }
103993
- // version: 1.378.0-63d7c07562
104425
+ // version: 1.379.1-7ea94edc38
103994
104426
 
103995
104427
  function createFragmentMap(documentNode) {
103996
104428
  const fragments = {};
@@ -130485,7 +130917,7 @@
130485
130917
  }
130486
130918
  return refresh$3(data, 'refreshUiApi');
130487
130919
  }
130488
- // version: 1.378.0-63d7c07562
130920
+ // version: 1.379.1-7ea94edc38
130489
130921
 
130490
130922
  // On core the unstable adapters are re-exported with different names,
130491
130923
  // we want to match them here.
@@ -130637,7 +131069,7 @@
130637
131069
  unstable_graphQL_imperative = createImperativeAdapter(luvio, createInstrumentedAdapter(ldsAdapter, adapterMetadata), adapterMetadata);
130638
131070
  graphQLImperative = ldsAdapter;
130639
131071
  });
130640
- // version: 1.378.0-63d7c07562
131072
+ // version: 1.379.1-7ea94edc38
130641
131073
 
130642
131074
  var gqlApi = /*#__PURE__*/Object.freeze({
130643
131075
  __proto__: null,
@@ -131436,7 +131868,7 @@
131436
131868
  function register(r) {
131437
131869
  callbacks$1.forEach((callback) => callback(r));
131438
131870
  }
131439
- // version: 1.378.0-0ab3d40d29
131871
+ // version: 1.379.1-5350e195b2
131440
131872
 
131441
131873
  /**
131442
131874
  * Copyright (c) 2022, Salesforce, Inc.,
@@ -132773,4 +133205,4 @@
132773
133205
  exports.subscribeToAdapter = subscribeToAdapter;
132774
133206
 
132775
133207
  }));
132776
- // version: 1.378.0-0ab3d40d29
133208
+ // version: 1.379.1-5350e195b2