@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.
@@ -4274,7 +4274,7 @@ function withDefaultLuvio(callback) {
4274
4274
  }
4275
4275
  callbacks.push(callback);
4276
4276
  }
4277
- // version: 1.378.0-0ab3d40d29
4277
+ // version: 1.379.1-5350e195b2
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.378.0-0ab3d40d29
5321
+ // version: 1.379.1-5350e195b2
5322
5322
 
5323
5323
  /**
5324
5324
  * Copyright (c) 2022, Salesforce, Inc.,
@@ -34154,7 +34154,7 @@ withDefaultLuvio((luvio) => {
34154
34154
  throttle(60, 60000, setupNotifyAllListRecordUpdateAvailable(luvio));
34155
34155
  throttle(60, 60000, setupNotifyAllListInfoSummaryUpdateAvailable(luvio));
34156
34156
  });
34157
- // version: 1.378.0-63d7c07562
34157
+ // version: 1.379.1-7ea94edc38
34158
34158
 
34159
34159
  function requestIdleDetectedCallback(_callback) { }
34160
34160
  function declareNotifierTaskSingle(_name) {
@@ -45764,15 +45764,6 @@ var graphqlL2AdapterGate = {
45764
45764
  },
45765
45765
  };
45766
45766
 
45767
- var productConsumedSideEffects = {
45768
- isOpen: function (e) {
45769
- return e.fallback;
45770
- },
45771
- hasError: function () {
45772
- return !0;
45773
- },
45774
- };
45775
-
45776
45767
  var useOneStore = {
45777
45768
  isOpen: function (e) {
45778
45769
  return e.fallback;
@@ -45802,7 +45793,7 @@ let Ok$4 = class Ok {
45802
45793
  return !this.isOk();
45803
45794
  }
45804
45795
  };
45805
- let Err$4 = class Err {
45796
+ let Err$3 = class Err {
45806
45797
  constructor(error) {
45807
45798
  this.error = error;
45808
45799
  }
@@ -45814,7 +45805,7 @@ let Err$4 = class Err {
45814
45805
  }
45815
45806
  };
45816
45807
  const ok$4 = (value) => new Ok$4(value);
45817
- const err$4 = (err2) => new Err$4(err2);
45808
+ const err$3 = (err2) => new Err$3(err2);
45818
45809
  function resolvedPromiseLike$5(result) {
45819
45810
  if (isPromiseLike$5(result)) {
45820
45811
  return result.then((nextResult) => nextResult);
@@ -46045,7 +46036,7 @@ class IdentifiableTypeRepository {
46045
46036
  const existingNormalizedData = (_a = cache.get(key)) == null ? void 0 : _a.value;
46046
46037
  const normalized = this.normalizeData(cache, { ...input, existingNormalizedData });
46047
46038
  if (normalized.isErr()) {
46048
- return err$4(normalized.error);
46039
+ return err$3(normalized.error);
46049
46040
  }
46050
46041
  cache.set(key, {
46051
46042
  value: normalized.value,
@@ -46058,7 +46049,7 @@ class IdentifiableTypeRepository {
46058
46049
  }
46059
46050
  validateEntry(entry) {
46060
46051
  if (!isCacheEntryForType(entry, this)) {
46061
- return err$4([
46052
+ return err$3([
46062
46053
  {
46063
46054
  type: "incorrectType",
46064
46055
  expectedType: this.typeName,
@@ -46084,12 +46075,12 @@ class IdentifiableTypeRepository {
46084
46075
  if (cacheEntry) {
46085
46076
  const validationResult = this.validateEntry(cacheEntry);
46086
46077
  if (validationResult.isErr()) {
46087
- return err$4([...validationResult.error]);
46078
+ return err$3([...validationResult.error]);
46088
46079
  }
46089
46080
  const normalizedData = cacheEntry.value;
46090
46081
  return this.denormalizeData(cache, { ...input, normalizedData });
46091
46082
  }
46092
- return err$4([this.buildMissingDataError()]);
46083
+ return err$3([this.buildMissingDataError()]);
46093
46084
  }
46094
46085
  equals(x, y) {
46095
46086
  return deepEquals$2(x, y);
@@ -46112,11 +46103,20 @@ function extractReadWriteData(result, errorCollector) {
46112
46103
  }
46113
46104
  function buildReadWriteResult(data, errors) {
46114
46105
  if (errors.length > 0) {
46115
- return err$4(errors);
46106
+ return err$3(errors);
46116
46107
  }
46117
46108
  return ok$4(data);
46118
46109
  }
46119
46110
 
46111
+ var productConsumedSideEffects = {
46112
+ isOpen: function (e) {
46113
+ return e.fallback;
46114
+ },
46115
+ hasError: function () {
46116
+ return !0;
46117
+ },
46118
+ };
46119
+
46120
46120
  /**
46121
46121
  * Copyright (c) 2022, Salesforce, Inc.,
46122
46122
  * All rights reserved.
@@ -94148,7 +94148,7 @@ let Ok$3 = class Ok {
94148
94148
  return !this.isOk();
94149
94149
  }
94150
94150
  };
94151
- let Err$3 = class Err {
94151
+ let Err$2 = class Err {
94152
94152
  constructor(error) {
94153
94153
  this.error = error;
94154
94154
  }
@@ -94160,7 +94160,7 @@ let Err$3 = class Err {
94160
94160
  }
94161
94161
  };
94162
94162
  const ok$3 = (value) => new Ok$3(value);
94163
- const err$3 = (err2) => new Err$3(err2);
94163
+ const err$2 = (err2) => new Err$2(err2);
94164
94164
  function resolvedPromiseLike$2(result) {
94165
94165
  if (isPromiseLike$2(result)) {
94166
94166
  return result.then((nextResult) => nextResult);
@@ -94260,7 +94260,7 @@ class CacheControlRequestRunner {
94260
94260
  const resultPromise = this.readFromCacheInternal(cache);
94261
94261
  return resultPromise.then((result) => {
94262
94262
  if (result.isErr()) {
94263
- return err$3(result.error);
94263
+ return err$2(result.error);
94264
94264
  }
94265
94265
  this.returnData = result;
94266
94266
  return ok$3(void 0);
@@ -94319,7 +94319,7 @@ class CacheControlCommand extends BaseCommand {
94319
94319
  if (networkData) {
94320
94320
  return this.constructSubscribableResult(networkData.value);
94321
94321
  }
94322
- return err$3(result.error);
94322
+ return err$2(result.error);
94323
94323
  }
94324
94324
  if (this.subscriptions.length > 0) {
94325
94325
  this.subscribeToKeysUsed();
@@ -94328,7 +94328,7 @@ class CacheControlCommand extends BaseCommand {
94328
94328
  if (networkData) {
94329
94329
  return this.constructSubscribableResult(networkData.value);
94330
94330
  }
94331
- return err$3(new Error("Cache miss after fetching from network"));
94331
+ return err$2(new Error("Cache miss after fetching from network"));
94332
94332
  }
94333
94333
  if (returnData.isOk() && this.lastEmittedData === void 0) {
94334
94334
  this.lastEmittedData = returnData.value.data;
@@ -94391,7 +94391,7 @@ class CacheControlCommand extends BaseCommand {
94391
94391
  refresh() {
94392
94392
  return this.rerun({ cacheControlConfig: { type: "no-cache" } }).then((result) => {
94393
94393
  if (result.isErr()) {
94394
- return err$3(result.error);
94394
+ return err$2(result.error);
94395
94395
  }
94396
94396
  return ok$3(void 0);
94397
94397
  });
@@ -94409,7 +94409,7 @@ class CacheControlCommand extends BaseCommand {
94409
94409
  const result = this.readFromCache(recordableCache);
94410
94410
  return result.then((readResult) => {
94411
94411
  if (readResult.isErr()) {
94412
- return err$3(readResult.error);
94412
+ return err$2(readResult.error);
94413
94413
  } else {
94414
94414
  const data = readResult.value;
94415
94415
  this.keysUsed = recordableCache.keysRead;
@@ -95881,7 +95881,7 @@ function buildServiceDescriptor$5(luvio) {
95881
95881
  },
95882
95882
  };
95883
95883
  }
95884
- // version: 1.378.0-63d7c07562
95884
+ // version: 1.379.1-7ea94edc38
95885
95885
 
95886
95886
  /**
95887
95887
  * Copyright (c) 2022, Salesforce, Inc.,
@@ -95907,7 +95907,7 @@ function buildServiceDescriptor$4(notifyRecordUpdateAvailable, getNormalizedLuvi
95907
95907
  },
95908
95908
  };
95909
95909
  }
95910
- // version: 1.378.0-63d7c07562
95910
+ // version: 1.379.1-7ea94edc38
95911
95911
 
95912
95912
  /*!
95913
95913
  * Copyright (c) 2022, Salesforce, Inc.,
@@ -98023,7 +98023,7 @@ register$1({
98023
98023
  id: '@salesforce/lds-network-adapter',
98024
98024
  instrument: instrument$2,
98025
98025
  });
98026
- // version: 1.378.0-0ab3d40d29
98026
+ // version: 1.379.1-5350e195b2
98027
98027
 
98028
98028
  const { create: create$3, keys: keys$3 } = Object;
98029
98029
  const { stringify: stringify$1, parse } = JSON;
@@ -98052,7 +98052,7 @@ let Ok$2 = class Ok {
98052
98052
  return !this.isOk();
98053
98053
  }
98054
98054
  };
98055
- let Err$2 = class Err {
98055
+ let Err$1 = class Err {
98056
98056
  constructor(error) {
98057
98057
  this.error = error;
98058
98058
  }
@@ -98064,7 +98064,7 @@ let Err$2 = class Err {
98064
98064
  }
98065
98065
  };
98066
98066
  const ok$2 = (value) => new Ok$2(value);
98067
- const err$2 = (err2) => new Err$2(err2);
98067
+ const err$1 = (err2) => new Err$1(err2);
98068
98068
  function deepEquals(x, y) {
98069
98069
  if (x === void 0) {
98070
98070
  return y === void 0;
@@ -98139,7 +98139,7 @@ class JsonSchemaErrorCollector {
98139
98139
  this.errors.unshift(error);
98140
98140
  }
98141
98141
  toValidationResponse() {
98142
- return !this.hasErrors() ? ok$2(true) : err$2(this.errors);
98142
+ return !this.hasErrors() ? ok$2(true) : err$1(this.errors);
98143
98143
  }
98144
98144
  }
98145
98145
  function createThrowableError(errors) {
@@ -98178,7 +98178,7 @@ function validSchemaResponse() {
98178
98178
  return ok$2(true);
98179
98179
  }
98180
98180
  function invalidSchemaResponseWithError(error) {
98181
- return err$2([error]);
98181
+ return err$1([error]);
98182
98182
  }
98183
98183
  function validateJsonSchema(data, schema, path = "$", document = schema) {
98184
98184
  if (schema === true) return validSchemaResponse();
@@ -98877,7 +98877,7 @@ function extractValue(valueNode, variableDefinitions, expectedType) {
98877
98877
  function extractVariableValue(variableName, variableDefinitions) {
98878
98878
  const variable = variableDefinitions[variableName];
98879
98879
  if (!variable) {
98880
- return err$4(
98880
+ return err$3(
98881
98881
  new Error(`Variable '${variableName}' was used in the query but was not defined`)
98882
98882
  );
98883
98883
  }
@@ -98897,7 +98897,7 @@ function validateExpectedType(value, expectedType) {
98897
98897
  if (expectedType.nullable) {
98898
98898
  return ok$4(value);
98899
98899
  } else {
98900
- return err$4(new Error(`Expected ${expectedType.type}, but got null`));
98900
+ return err$3(new Error(`Expected ${expectedType.type}, but got null`));
98901
98901
  }
98902
98902
  }
98903
98903
  const actualType = typeof value;
@@ -98905,7 +98905,7 @@ function validateExpectedType(value, expectedType) {
98905
98905
  return ok$4(value);
98906
98906
  }
98907
98907
  const expectedTypeString = expectedType.nullable ? `${expectedType.type} | null` : expectedType.type;
98908
- return err$4(
98908
+ return err$3(
98909
98909
  new Error(`Expected ${expectedTypeString}, but got ${actualType}: ${JSON.stringify(value)}`)
98910
98910
  );
98911
98911
  }
@@ -98948,7 +98948,7 @@ function findExecutableOperation(input) {
98948
98948
  (def) => def.kind === Kind.OPERATION_DEFINITION
98949
98949
  );
98950
98950
  if (operations.length === 0) {
98951
- return err$4(new Error("No operations found in query"));
98951
+ return err$3(new Error("No operations found in query"));
98952
98952
  }
98953
98953
  if (operations.length === 1 && !input.operationName) {
98954
98954
  return ok$4(operations[0]);
@@ -98961,14 +98961,14 @@ function findExecutableOperation(input) {
98961
98961
  if (specifiedOperation) {
98962
98962
  return ok$4(specifiedOperation);
98963
98963
  }
98964
- return err$4(new Error(`Operation "${input.operationName}" not found in query`));
98964
+ return err$3(new Error(`Operation "${input.operationName}" not found in query`));
98965
98965
  }
98966
- return err$4(new Error("Multiple operations found in query, and no operation name provided"));
98966
+ return err$3(new Error("Multiple operations found in query, and no operation name provided"));
98967
98967
  }
98968
98968
  function buildGraphQLInputExtension(input) {
98969
98969
  const operationResult = findExecutableOperation(input);
98970
98970
  if (operationResult.isErr()) {
98971
- return err$4(operationResult.error);
98971
+ return err$3(operationResult.error);
98972
98972
  }
98973
98973
  const operation = operationResult.value;
98974
98974
  const selections = operation.selectionSet.selections;
@@ -99049,7 +99049,7 @@ function buildFieldKey(canonicalFieldName, fieldArguments, variables) {
99049
99049
  for (const arg of fieldArguments) {
99050
99050
  const result = extractValue(arg.value, variables);
99051
99051
  if (result.isErr()) {
99052
- return err$4(
99052
+ return err$3(
99053
99053
  new Error(
99054
99054
  `Failed to extract argument '${arg.name.value}' for field '${canonicalFieldName}': ${result.error.message}`
99055
99055
  )
@@ -99063,11 +99063,11 @@ function extractIfArgument(directive, variables, directiveName) {
99063
99063
  var _a;
99064
99064
  const ifArg = (_a = directive.arguments) == null ? void 0 : _a.find((arg) => arg.name.value === "if");
99065
99065
  if (!ifArg) {
99066
- return err$4(new Error(`@${directiveName} directive requires an 'if' argument`));
99066
+ return err$3(new Error(`@${directiveName} directive requires an 'if' argument`));
99067
99067
  }
99068
99068
  const result = extractValue(ifArg.value, variables, { type: "boolean", nullable: false });
99069
99069
  if (result.isErr()) {
99070
- return err$4(result.error);
99070
+ return err$3(result.error);
99071
99071
  }
99072
99072
  return ok$4(result.value);
99073
99073
  }
@@ -99107,7 +99107,7 @@ class BaseScalarFieldDef {
99107
99107
  }
99108
99108
  if (input.data === null) {
99109
99109
  if (!this.nullable) {
99110
- return err$4([
99110
+ return err$3([
99111
99111
  {
99112
99112
  type: "unknown",
99113
99113
  error: new Error(
@@ -99150,7 +99150,7 @@ class BaseArrayFieldDef {
99150
99150
  }
99151
99151
  if (input.data === null) {
99152
99152
  if (!this.nullable) {
99153
- return err$4([
99153
+ return err$3([
99154
99154
  {
99155
99155
  type: "unknown",
99156
99156
  error: new Error(
@@ -99162,7 +99162,7 @@ class BaseArrayFieldDef {
99162
99162
  return ok$4({ type: "data", data: input.data });
99163
99163
  }
99164
99164
  if (!Array.isArray(input.data)) {
99165
- return err$4([
99165
+ return err$3([
99166
99166
  {
99167
99167
  type: "unknown",
99168
99168
  error: new Error(
@@ -99190,7 +99190,7 @@ class BaseArrayFieldDef {
99190
99190
  }
99191
99191
  });
99192
99192
  if (arrayNormalizationErrors.length > 0) {
99193
- return err$4(arrayNormalizationErrors);
99193
+ return err$3(arrayNormalizationErrors);
99194
99194
  }
99195
99195
  return ok$4({ type: "data", data: normalizedArray });
99196
99196
  }
@@ -99201,7 +99201,7 @@ class BaseArrayFieldDef {
99201
99201
  }
99202
99202
  if (normalizedData.data === null) {
99203
99203
  if (!this.nullable) {
99204
- return err$4([
99204
+ return err$3([
99205
99205
  {
99206
99206
  type: "unknown",
99207
99207
  error: new Error(
@@ -99213,7 +99213,7 @@ class BaseArrayFieldDef {
99213
99213
  return ok$4({ type: "data", data: null });
99214
99214
  }
99215
99215
  if (!Array.isArray(normalizedData.data)) {
99216
- return err$4([
99216
+ return err$3([
99217
99217
  {
99218
99218
  type: "unknown",
99219
99219
  error: new Error(
@@ -99238,7 +99238,7 @@ class BaseArrayFieldDef {
99238
99238
  }
99239
99239
  });
99240
99240
  if (arrayDenormalizationErrors.length > 0) {
99241
- return err$4(arrayDenormalizationErrors);
99241
+ return err$3(arrayDenormalizationErrors);
99242
99242
  }
99243
99243
  return ok$4(denormalizedArray);
99244
99244
  }
@@ -99257,7 +99257,7 @@ class BaseObjectFieldDef {
99257
99257
  write(cache, input) {
99258
99258
  var _a;
99259
99259
  if (!input.selection.selectionSet) {
99260
- return err$4([
99260
+ return err$3([
99261
99261
  {
99262
99262
  type: "unknown",
99263
99263
  error: new Error(
@@ -99271,7 +99271,7 @@ class BaseObjectFieldDef {
99271
99271
  }
99272
99272
  if (input.data === null) {
99273
99273
  if (!this.nullable) {
99274
- return err$4([
99274
+ return err$3([
99275
99275
  {
99276
99276
  type: "unknown",
99277
99277
  error: new Error(
@@ -99298,7 +99298,7 @@ class BaseObjectFieldDef {
99298
99298
  read(cache, input) {
99299
99299
  var _a;
99300
99300
  if (!input.selection.selectionSet) {
99301
- return err$4([
99301
+ return err$3([
99302
99302
  {
99303
99303
  type: "unknown",
99304
99304
  error: new Error(
@@ -99313,7 +99313,7 @@ class BaseObjectFieldDef {
99313
99313
  }
99314
99314
  if (normalizedData.data === null) {
99315
99315
  if (!this.nullable) {
99316
- return err$4([
99316
+ return err$3([
99317
99317
  {
99318
99318
  type: "unknown",
99319
99319
  error: new Error(
@@ -99402,7 +99402,11 @@ class BaseGraphQLTypeRepository {
99402
99402
  }
99403
99403
  augmentInlineFragmentSelection(fragment, fragments) {
99404
99404
  var _a;
99405
- if (!this.satisfiesFragmentTypeCondition(fragment)) {
99405
+ const satisfiedFragmentTypeConditionResult = this.satisfiesFragmentTypeCondition(
99406
+ void 0,
99407
+ fragment
99408
+ );
99409
+ if (satisfiedFragmentTypeConditionResult.isErr() || !satisfiedFragmentTypeConditionResult.value) {
99406
99410
  return { selections: [], fragments };
99407
99411
  }
99408
99412
  const augmentedFragmentSelections = this.augmentSelections({
@@ -99428,7 +99432,11 @@ class BaseGraphQLTypeRepository {
99428
99432
  if (fragment === void 0) {
99429
99433
  return { selections: [selection], fragments };
99430
99434
  }
99431
- if (!this.satisfiesFragmentTypeCondition(fragment)) {
99435
+ const satisfiedFragmentTypeConditionResult = this.satisfiesFragmentTypeCondition(
99436
+ void 0,
99437
+ fragment
99438
+ );
99439
+ if (satisfiedFragmentTypeConditionResult.isErr() || !satisfiedFragmentTypeConditionResult.value) {
99432
99440
  return { selections: [], fragments };
99433
99441
  }
99434
99442
  const augmentedFragmentSelections = this.augmentSelections({
@@ -99541,10 +99549,7 @@ class BaseGraphQLTypeRepository {
99541
99549
  };
99542
99550
  }
99543
99551
  normalizeFragment(cache, input, fragment, errorCollector) {
99544
- const shouldProcessResult = this.shouldProcessFragment(
99545
- fragment,
99546
- input.request.definitions.variables
99547
- );
99552
+ const shouldProcessResult = this.shouldProcessFragment(input, fragment);
99548
99553
  if (shouldProcessResult.isErr()) {
99549
99554
  errorCollector.push({
99550
99555
  type: "unknown",
@@ -99599,7 +99604,7 @@ class BaseGraphQLTypeRepository {
99599
99604
  var _a;
99600
99605
  const fieldDef = this.getFieldDef(input, selection);
99601
99606
  if (!fieldDef) {
99602
- return err$4(
99607
+ return err$3(
99603
99608
  new Error(
99604
99609
  `Unknown field "${selection.name.value}" on type "${this.typeName}". Expected one of fields ${Object.keys(this.fields)}.`
99605
99610
  )
@@ -99610,7 +99615,7 @@ class BaseGraphQLTypeRepository {
99610
99615
  input.request.definitions.variables
99611
99616
  );
99612
99617
  if (cacheFieldKeyResult.isErr()) {
99613
- return err$4(cacheFieldKeyResult.error);
99618
+ return err$3(cacheFieldKeyResult.error);
99614
99619
  }
99615
99620
  const cacheFieldKey = cacheFieldKeyResult.value;
99616
99621
  return ok$4((_a = input.existingNormalizedData || input.normalizedData) == null ? void 0 : _a[cacheFieldKey]);
@@ -99675,10 +99680,7 @@ class BaseGraphQLTypeRepository {
99675
99680
  };
99676
99681
  }
99677
99682
  denormalizeFragment(cache, input, fragment, errorCollector) {
99678
- const shouldProcessResult = this.shouldProcessFragment(
99679
- fragment,
99680
- input.request.definitions.variables
99681
- );
99683
+ const shouldProcessResult = this.shouldProcessFragment(input, fragment);
99682
99684
  if (shouldProcessResult.isErr()) {
99683
99685
  errorCollector.push({
99684
99686
  type: "unknown",
@@ -99716,28 +99718,28 @@ class BaseGraphQLTypeRepository {
99716
99718
  }
99717
99719
  return void 0;
99718
99720
  }
99719
- shouldProcessFragment(fragment, variables) {
99720
- const shouldSkipResult = shouldSkip(fragment, variables);
99721
+ shouldProcessFragment(input, fragment) {
99722
+ const shouldSkipResult = shouldSkip(fragment, input.request.definitions.variables);
99721
99723
  if (shouldSkipResult.isErr()) {
99722
99724
  return shouldSkipResult;
99723
99725
  }
99724
99726
  if (shouldSkipResult.value) {
99725
99727
  return ok$4(false);
99726
99728
  }
99727
- return ok$4(this.satisfiesFragmentTypeCondition(fragment));
99729
+ return this.satisfiesFragmentTypeCondition(input, fragment);
99728
99730
  }
99729
- satisfiesFragmentTypeCondition(fragment) {
99731
+ satisfiesFragmentTypeCondition(_input, fragment) {
99730
99732
  if (!fragment.typeCondition) {
99731
- return true;
99733
+ return ok$4(true);
99732
99734
  }
99733
99735
  const conditionalTypeName = fragment.typeCondition.name.value;
99734
99736
  if (conditionalTypeName === this.typeName) {
99735
- return true;
99737
+ return ok$4(true);
99736
99738
  }
99737
99739
  if (this.implementedInterfaces.includes(conditionalTypeName)) {
99738
- return true;
99740
+ return ok$4(true);
99739
99741
  }
99740
- return false;
99742
+ return ok$4(false);
99741
99743
  }
99742
99744
  getCacheKeyFieldArguments(selection) {
99743
99745
  return selection.arguments;
@@ -99795,7 +99797,7 @@ class IdentifiableGraphQLTypeRepository extends IdentifiableTypeRepository {
99795
99797
  const key = this.buildKey(this.buildKeyParams(input));
99796
99798
  const normalized = this.normalizeData(cache, input);
99797
99799
  if (normalized.isErr()) {
99798
- return err$4(normalized.error);
99800
+ return err$3(normalized.error);
99799
99801
  }
99800
99802
  const existing = cache.get(key);
99801
99803
  if (!deepEquals$2(existing == null ? void 0 : existing.value, normalized.value)) {
@@ -99884,7 +99886,7 @@ class GraphQLDocumentRootTypeRepository extends IdentifiableGraphQLTypeRepositor
99884
99886
  var _a;
99885
99887
  const operationResult = findExecutableOperation(input);
99886
99888
  if (operationResult.isErr()) {
99887
- return err$4(operationResult.error);
99889
+ return err$3(operationResult.error);
99888
99890
  }
99889
99891
  const operation = operationResult.value;
99890
99892
  const fragmentDefinitions = input.query.definitions.filter(
@@ -99942,7 +99944,7 @@ class BaseUnionRepository {
99942
99944
  }
99943
99945
  write(cache, input) {
99944
99946
  if (typeof input.data !== "object") {
99945
- return err$4([
99947
+ return err$3([
99946
99948
  {
99947
99949
  type: "unknown",
99948
99950
  error: new Error(`Got a non-object value for ${this.typeName} field"`)
@@ -99952,7 +99954,7 @@ class BaseUnionRepository {
99952
99954
  const discriminator = this.getTypeDiscriminator(input.data, input.selections);
99953
99955
  const concreteTypeRepository = this.possibleTypes[discriminator];
99954
99956
  if (!concreteTypeRepository) {
99955
- return err$4([
99957
+ return err$3([
99956
99958
  {
99957
99959
  type: "unknown",
99958
99960
  error: new Error(
@@ -99963,7 +99965,7 @@ class BaseUnionRepository {
99963
99965
  }
99964
99966
  const selectionErr = this.verifyUnionFields(input.selections);
99965
99967
  if (selectionErr) {
99966
- return err$4(selectionErr);
99968
+ return err$3(selectionErr);
99967
99969
  }
99968
99970
  const normalizeInput = {
99969
99971
  ...input,
@@ -99982,7 +99984,7 @@ class BaseUnionRepository {
99982
99984
  read(cache, input) {
99983
99985
  const unionRep = input.normalizedData;
99984
99986
  if (typeof unionRep.data !== "object" || unionRep.data === null) {
99985
- return err$4([
99987
+ return err$3([
99986
99988
  {
99987
99989
  type: "unknown",
99988
99990
  error: new Error(`Got a non-object value for ${this.typeName} field.`)
@@ -99992,7 +99994,7 @@ class BaseUnionRepository {
99992
99994
  const discriminator = unionRep.discriminator;
99993
99995
  const concreteRepository = this.possibleTypes[discriminator];
99994
99996
  if (!concreteRepository) {
99995
- return err$4([
99997
+ return err$3([
99996
99998
  {
99997
99999
  type: "unknown",
99998
100000
  error: new Error(
@@ -100003,7 +100005,7 @@ class BaseUnionRepository {
100003
100005
  }
100004
100006
  const selectionErr = this.verifyUnionFields(input.selections);
100005
100007
  if (selectionErr) {
100006
- return err$4(selectionErr);
100008
+ return err$3(selectionErr);
100007
100009
  }
100008
100010
  const denormalizeInput = {
100009
100011
  ...input,
@@ -100140,19 +100142,7 @@ let Ok$1 = class Ok {
100140
100142
  return !this.isOk();
100141
100143
  }
100142
100144
  };
100143
- let Err$1 = class Err {
100144
- constructor(error) {
100145
- this.error = error;
100146
- }
100147
- isOk() {
100148
- return false;
100149
- }
100150
- isErr() {
100151
- return !this.isOk();
100152
- }
100153
- };
100154
100145
  const ok$1 = (value) => new Ok$1(value);
100155
- const err$1 = (err2) => new Err$1(err2);
100156
100146
  function isSubscribableResult(x) {
100157
100147
  if (typeof x !== "object" || x === null) {
100158
100148
  return false;
@@ -100285,41 +100275,50 @@ class CommandWireAdapterConstructor {
100285
100275
  if (result === void 0) {
100286
100276
  this.callback({ data: void 0, error: void 0 });
100287
100277
  } else {
100288
- if (result.isErr()) {
100289
- this.callback({
100290
- data: void 0,
100291
- error: result.error
100292
- });
100293
- return;
100294
- }
100295
- if (isSubscribableResult(result)) {
100296
- deepFreeze(result.value.data);
100297
- if (this.exposeRefresh) {
100298
- this.callback({
100299
- data: result.value.data,
100300
- error: void 0,
100301
- refresh: () => {
100302
- return result.value.refresh().then((res) => {
100303
- if (res.isOk()) {
100304
- return ok$1(void 0);
100305
- }
100306
- throw res.error;
100307
- });
100278
+ const consumerEmittedRefresh = () => {
100279
+ if (!this.refresh) {
100280
+ return Promise.resolve();
100281
+ }
100282
+ return new Promise((resolve, reject) => {
100283
+ if (!this.refresh) {
100284
+ resolve();
100285
+ return;
100286
+ }
100287
+ this.refresh().then((res) => {
100288
+ if (res.isOk()) {
100289
+ resolve();
100290
+ } else {
100291
+ reject(
100292
+ new Error(
100293
+ "Internal error in Lightning Data Service adapter occurred: Failed to refresh data"
100294
+ )
100295
+ );
100308
100296
  }
100309
100297
  });
100298
+ });
100299
+ };
100300
+ let consumerEmittedData = {
100301
+ data: void 0,
100302
+ error: void 0
100303
+ };
100304
+ if (this.exposeRefresh && this.refresh) {
100305
+ consumerEmittedData.refresh = consumerEmittedRefresh;
100306
+ }
100307
+ if (result.isErr()) {
100308
+ consumerEmittedData.error = result.error;
100309
+ } else {
100310
+ if (isSubscribableResult(result)) {
100311
+ deepFreeze(result.value.data);
100312
+ consumerEmittedData.data = result.value.data;
100310
100313
  } else {
100311
- this.callback({ data: result.value.data, error: void 0 });
100314
+ deepFreeze(result.value);
100315
+ consumerEmittedData.data = result.value;
100312
100316
  }
100313
- return;
100314
100317
  }
100315
- deepFreeze(result.value);
100316
- this.callback({
100317
- data: result.value,
100318
- error: void 0
100319
- });
100318
+ this.callback(consumerEmittedData);
100320
100319
  }
100321
100320
  } catch (e) {
100322
- emitError(this.callback, e);
100321
+ this.handleExecutionThrow(e);
100323
100322
  }
100324
100323
  }
100325
100324
  invokeAdapter() {
@@ -100329,11 +100328,11 @@ class CommandWireAdapterConstructor {
100329
100328
  if (this.configSchema) {
100330
100329
  try {
100331
100330
  assertIsValid(this.config, this.configSchema);
100332
- } catch (err2) {
100333
- if (isIncompleteConfigError(err2)) {
100331
+ } catch (err) {
100332
+ if (isIncompleteConfigError(err)) {
100334
100333
  return;
100335
100334
  }
100336
- throw err2;
100335
+ throw err;
100337
100336
  }
100338
100337
  }
100339
100338
  const initialConfig = this.config;
@@ -100343,10 +100342,10 @@ class CommandWireAdapterConstructor {
100343
100342
  if (!this.connected || this.config !== initialConfig) {
100344
100343
  return;
100345
100344
  }
100346
- this.emit(result);
100345
+ this.refresh = void 0;
100347
100346
  if (result.isOk()) {
100348
- const value = result.value;
100349
- if (typeof value === "object" && value !== null && "subscribe" in value) {
100347
+ if (isSubscribableResult(result)) {
100348
+ const value = result.value;
100350
100349
  this.unsubscriber = value.subscribe((updatedResult) => {
100351
100350
  if (!this.connected || this.config !== initialConfig) {
100352
100351
  this.unsubscribe();
@@ -100354,10 +100353,15 @@ class CommandWireAdapterConstructor {
100354
100353
  }
100355
100354
  this.emit(updatedResult);
100356
100355
  });
100356
+ this.refresh = value.refresh;
100357
+ this.emit(ok$1(value.data));
100358
+ } else {
100359
+ this.emit(result);
100357
100360
  }
100358
100361
  } else {
100359
100362
  this.unsubscriber = () => {
100360
100363
  };
100364
+ this.emit(result);
100361
100365
  }
100362
100366
  });
100363
100367
  } catch (e) {
@@ -100374,87 +100378,76 @@ class CommandWireAdapterConstructor {
100374
100378
  }
100375
100379
  }
100376
100380
  }
100377
- function isIncompleteConfigError(err2) {
100378
- return err2 instanceof MissingRequiredPropertyError || err2 instanceof JsonSchemaViolationError && err2.validationErrors.find(
100381
+ function isIncompleteConfigError(err) {
100382
+ return err instanceof MissingRequiredPropertyError || err instanceof JsonSchemaViolationError && err.validationErrors.find(
100379
100383
  (validationError) => validationError instanceof MissingRequiredPropertyError
100380
100384
  ) !== void 0;
100381
100385
  }
100382
- function emitGraphQLResult(callback, result) {
100383
- if (result.isErr()) {
100384
- logError(result.error);
100385
- if (isUserVisibleError(result.error)) {
100386
- callback({
100387
- data: result.error.data.data,
100388
- errors: result.error.data.errors
100389
- });
100390
- return;
100391
- }
100392
- callback({
100393
- data: void 0,
100394
- errors: [{ message: "Internal error in GraphQL adapter occurred", locations: [] }]
100395
- });
100396
- return;
100397
- }
100398
- if ("subscribe" in result.value) {
100399
- callback(formatGraphQLData(result.value.data));
100400
- return;
100401
- }
100402
- callback(formatGraphQLData(result.value));
100403
- }
100404
- function resolveAst(ast) {
100405
- const result = astResolver(ast);
100406
- if (result === void 0) {
100407
- throw new Error("Could not resolve AST. Did you parse the query with gql?");
100408
- }
100409
- return result;
100410
- }
100411
- function formatGraphQLData(data) {
100412
- if (data.errors === void 0 || data.errors.length === 0) {
100413
- return {
100414
- data: data.data,
100415
- errors: void 0
100416
- };
100417
- }
100418
- return {
100419
- data: data.data,
100420
- errors: data.errors
100421
- };
100422
- }
100423
100386
  class GraphQLCommandWireAdapterConstructor extends CommandWireAdapterConstructor {
100424
100387
  emit(result) {
100425
100388
  try {
100426
100389
  if (result === void 0) {
100427
100390
  this.callback({ data: void 0, errors: void 0 });
100428
100391
  } else {
100429
- if (result.isErr()) {
100430
- emitGraphQLResult(this.callback, result);
100431
- return;
100432
- }
100433
- const userEmittedData = {
100434
- ...result.value.data
100435
- };
100436
- if (this.exposeRefresh) {
100437
- userEmittedData.refresh = () => {
100438
- return result.value.refresh().then((res) => {
100392
+ const consumerEmittedRefresh = () => {
100393
+ if (!this.refresh) {
100394
+ return Promise.resolve();
100395
+ }
100396
+ return new Promise((resolve, reject) => {
100397
+ if (!this.refresh) {
100398
+ resolve();
100399
+ return;
100400
+ }
100401
+ this.refresh().then((res) => {
100439
100402
  if (res.isOk()) {
100440
- return;
100403
+ resolve();
100404
+ } else {
100405
+ reject(
100406
+ new Error(
100407
+ "Internal error in GraphQL adapter occurred: Failed to refresh GraphQL data"
100408
+ )
100409
+ );
100441
100410
  }
100442
- throw new Error(
100443
- "Internal error in GraphQL adapter occurred: Failed to refresh GraphQL data"
100444
- );
100445
100411
  });
100446
- };
100412
+ });
100413
+ };
100414
+ let consumerEmittedData = {
100415
+ data: void 0,
100416
+ errors: void 0
100417
+ };
100418
+ if (this.exposeRefresh && this.refresh) {
100419
+ consumerEmittedData.refresh = consumerEmittedRefresh;
100447
100420
  }
100448
- deepFreeze(userEmittedData);
100449
- this.callback(userEmittedData);
100450
- return;
100421
+ if (result.isErr()) {
100422
+ logError(result.error);
100423
+ if (isUserVisibleError(result.error)) {
100424
+ consumerEmittedData.data = result.error.data.data;
100425
+ consumerEmittedData.errors = result.error.data.errors;
100426
+ } else {
100427
+ consumerEmittedData.errors = [
100428
+ {
100429
+ message: "Internal error in GraphQL adapter occurred",
100430
+ locations: []
100431
+ }
100432
+ ];
100433
+ }
100434
+ } else {
100435
+ consumerEmittedData.data = result.value.data;
100436
+ }
100437
+ deepFreeze(consumerEmittedData);
100438
+ this.callback(consumerEmittedData);
100451
100439
  }
100452
100440
  } catch (e) {
100453
- emitGraphQLResult(this.callback, err$1(e));
100441
+ logError(e);
100442
+ this.handleExecutionThrow(e);
100454
100443
  }
100455
100444
  }
100456
100445
  handleExecutionThrow(e) {
100457
- emitGraphQLResult(this.callback, err$1(e));
100446
+ logError(e);
100447
+ this.callback({
100448
+ data: void 0,
100449
+ errors: [{ message: "Internal error in GraphQL adapter occurred", locations: [] }]
100450
+ });
100458
100451
  }
100459
100452
  update(config, _context) {
100460
100453
  this.unsubscribe();
@@ -100466,31 +100459,89 @@ class GraphQLCommandWireAdapterConstructor extends CommandWireAdapterConstructor
100466
100459
  }
100467
100460
  }
100468
100461
  function buildAsyncGraphQLImperativeLegacyInvoker(getCommand) {
100469
- const invoke = async (config, _requestContext, callback) => {
100462
+ const invoke = async (config, requestContext, callback) => {
100470
100463
  const command = getCommand({ config, assertIsValid });
100471
100464
  try {
100472
- const result = await command.execute();
100465
+ const overrides = requestContextIsCachePolicy(requestContext) ? { cacheControlConfig: { type: "no-cache" } } : {};
100466
+ const result = await command.execute(overrides);
100467
+ const consumerEmittedData = {
100468
+ data: void 0,
100469
+ errors: void 0
100470
+ };
100473
100471
  if (result.isOk()) {
100474
100472
  deepFreeze(result.value);
100473
+ consumerEmittedData.data = result.value.data.data;
100474
+ } else {
100475
+ if (isUserVisibleError(result.error)) {
100476
+ consumerEmittedData.data = result.error.data.data;
100477
+ consumerEmittedData.errors = result.error.data.errors;
100478
+ } else {
100479
+ logError(result.error);
100480
+ consumerEmittedData.errors = [
100481
+ { message: "Internal error in GraphQL adapter occurred", locations: [] }
100482
+ ];
100483
+ }
100475
100484
  }
100476
- emitGraphQLResult(callback, result);
100485
+ callback(consumerEmittedData);
100477
100486
  } catch (error) {
100478
- emitGraphQLResult(callback, err$1(error));
100487
+ logError(error);
100488
+ callback({
100489
+ data: void 0,
100490
+ errors: [{ message: "Internal error in GraphQL adapter occurred", locations: [] }]
100491
+ });
100479
100492
  }
100480
100493
  };
100481
- const subscribe = (config, _requestContext, callback) => {
100494
+ const subscribe = (config, requestContext, callback) => {
100482
100495
  const command = getCommand({ config, assertIsValid });
100483
100496
  let unsubscribe = () => {
100484
100497
  };
100485
- command.execute().then((result) => {
100486
- if (!result.isOk()) {
100487
- emitGraphQLResult(callback, result);
100488
- return;
100498
+ const overrides = requestContextIsCachePolicy(requestContext) ? { cacheControlConfig: { type: "no-cache" } } : {};
100499
+ command.execute(overrides).then((result) => {
100500
+ const consumerEmittedData = {
100501
+ data: void 0,
100502
+ errors: void 0
100503
+ };
100504
+ if (result.isOk()) {
100505
+ deepFreeze(result.value);
100506
+ consumerEmittedData.data = result.value.data.data;
100507
+ unsubscribe = result.value.subscribe((res) => {
100508
+ const consumerEmittedData2 = {
100509
+ data: void 0,
100510
+ errors: void 0
100511
+ };
100512
+ if (res.isOk()) {
100513
+ consumerEmittedData2.data = res.value.data;
100514
+ } else {
100515
+ if (isUserVisibleError(res.error)) {
100516
+ consumerEmittedData2.data = res.error.data.data;
100517
+ consumerEmittedData2.errors = res.error.data.errors;
100518
+ } else {
100519
+ logError(res.error);
100520
+ consumerEmittedData2.errors = [
100521
+ {
100522
+ message: "Internal error in GraphQL adapter occurred",
100523
+ locations: []
100524
+ }
100525
+ ];
100526
+ }
100527
+ }
100528
+ callback(consumerEmittedData2);
100529
+ });
100530
+ } else {
100531
+ if (isUserVisibleError(result.error)) {
100532
+ consumerEmittedData.data = result.error.data.data;
100533
+ consumerEmittedData.errors = result.error.data.errors;
100534
+ } else {
100535
+ logError(result.error);
100536
+ consumerEmittedData.errors = [
100537
+ {
100538
+ message: "Internal error in GraphQL adapter occurred",
100539
+ locations: []
100540
+ }
100541
+ ];
100542
+ }
100489
100543
  }
100490
- unsubscribe = result.value.subscribe((res) => {
100491
- emitGraphQLResult(callback, res);
100492
- });
100493
- emitGraphQLResult(callback, result);
100544
+ callback(consumerEmittedData);
100494
100545
  });
100495
100546
  return () => {
100496
100547
  unsubscribe();
@@ -100498,7 +100549,17 @@ function buildAsyncGraphQLImperativeLegacyInvoker(getCommand) {
100498
100549
  };
100499
100550
  return { invoke, subscribe };
100500
100551
  }
100501
- // version: 1.378.0-63d7c07562
100552
+ function requestContextIsCachePolicy(requestContext) {
100553
+ 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";
100554
+ }
100555
+ function resolveAst(ast) {
100556
+ const result = astResolver(ast);
100557
+ if (result === void 0) {
100558
+ throw new Error("Could not resolve AST. Did you parse the query with gql?");
100559
+ }
100560
+ return result;
100561
+ }
100562
+ // version: 1.379.1-7ea94edc38
100502
100563
 
100503
100564
  class Analytics__AnalyticsBrowseRepository extends UnidentifiableGraphQLTypeRepository {
100504
100565
  constructor(services, typeRegistry) {
@@ -100710,7 +100771,14 @@ class AnyTypeRepository extends BaseUnionRepository {
100710
100771
  this.namespace = "oas";
100711
100772
  this.typeName = "AnyType";
100712
100773
  this.implementedInterfaces = [];
100713
- this.possibleTypes = {
100774
+ }
100775
+ get fields() {
100776
+ return {
100777
+ __typename: new BaseScalarFieldDef(false),
100778
+ };
100779
+ }
100780
+ get possibleTypes() {
100781
+ return {
100714
100782
  BooleanValue: this.typeRegistry.BooleanValue,
100715
100783
  DateValue: this.typeRegistry.DateValue,
100716
100784
  DateTimeValue: this.typeRegistry.DateTimeValue,
@@ -100718,11 +100786,6 @@ class AnyTypeRepository extends BaseUnionRepository {
100718
100786
  StringValue: this.typeRegistry.StringValue,
100719
100787
  };
100720
100788
  }
100721
- get fields() {
100722
- return {
100723
- __typename: new BaseScalarFieldDef(false),
100724
- };
100725
- }
100726
100789
  }
100727
100790
 
100728
100791
  class Base64ValueRepository extends UnidentifiableGraphQLTypeRepository {
@@ -101655,7 +101718,7 @@ class PicklistValueRepository extends UnidentifiableGraphQLTypeRepository {
101655
101718
  }
101656
101719
  }
101657
101720
 
101658
- class PolymorphicAggregateParentRelationshipRepository extends BaseUnionRepository {
101721
+ let PolymorphicAggregateParentRelationshipRepository$1 = class PolymorphicAggregateParentRelationshipRepository extends BaseUnionRepository {
101659
101722
  constructor(services, typeRegistry) {
101660
101723
  super(services);
101661
101724
  this.services = services;
@@ -101663,16 +101726,18 @@ class PolymorphicAggregateParentRelationshipRepository extends BaseUnionReposito
101663
101726
  this.namespace = "oas";
101664
101727
  this.typeName = "PolymorphicAggregateParentRelationship";
101665
101728
  this.implementedInterfaces = [];
101666
- this.possibleTypes = {
101667
- RecordAggregate: this.typeRegistry.RecordAggregate,
101668
- };
101669
101729
  }
101670
101730
  get fields() {
101671
101731
  return {
101672
101732
  __typename: new BaseScalarFieldDef(false),
101673
101733
  };
101674
101734
  }
101675
- }
101735
+ get possibleTypes() {
101736
+ return {
101737
+ RecordAggregate: this.typeRegistry.RecordAggregate,
101738
+ };
101739
+ }
101740
+ };
101676
101741
 
101677
101742
  let PolymorphicParentRelationshipRepository$1 = class PolymorphicParentRelationshipRepository extends BaseUnionRepository {
101678
101743
  constructor(services, typeRegistry) {
@@ -101682,15 +101747,17 @@ let PolymorphicParentRelationshipRepository$1 = class PolymorphicParentRelations
101682
101747
  this.namespace = "oas";
101683
101748
  this.typeName = "PolymorphicParentRelationship";
101684
101749
  this.implementedInterfaces = [];
101685
- this.possibleTypes = {
101686
- RecordRepresentation: this.typeRegistry.RecordRepresentation,
101687
- };
101688
101750
  }
101689
101751
  get fields() {
101690
101752
  return {
101691
101753
  __typename: new BaseScalarFieldDef(false),
101692
101754
  };
101693
101755
  }
101756
+ get possibleTypes() {
101757
+ return {
101758
+ RecordRepresentation: this.typeRegistry.RecordRepresentation,
101759
+ };
101760
+ }
101694
101761
  };
101695
101762
 
101696
101763
  class QueryRepository extends GraphQLDocumentRootTypeRepository {
@@ -101715,7 +101782,7 @@ class QueryRepository extends GraphQLDocumentRootTypeRepository {
101715
101782
  }
101716
101783
  }
101717
101784
 
101718
- class RecordAggregateConnectionRepository extends UnidentifiableGraphQLTypeRepository {
101785
+ let RecordAggregateConnectionRepository$1 = class RecordAggregateConnectionRepository extends UnidentifiableGraphQLTypeRepository {
101719
101786
  constructor(services, typeRegistry) {
101720
101787
  super(services);
101721
101788
  this.services = services;
@@ -101732,9 +101799,9 @@ class RecordAggregateConnectionRepository extends UnidentifiableGraphQLTypeRepos
101732
101799
  totalCount: new BaseScalarFieldDef(false),
101733
101800
  };
101734
101801
  }
101735
- }
101802
+ };
101736
101803
 
101737
- class RecordAggregateEdgeRepository extends UnidentifiableGraphQLTypeRepository {
101804
+ let RecordAggregateEdgeRepository$1 = class RecordAggregateEdgeRepository extends UnidentifiableGraphQLTypeRepository {
101738
101805
  constructor(services, typeRegistry) {
101739
101806
  super(services);
101740
101807
  this.services = services;
@@ -101750,7 +101817,7 @@ class RecordAggregateEdgeRepository extends UnidentifiableGraphQLTypeRepository
101750
101817
  cursor: new BaseScalarFieldDef(false),
101751
101818
  };
101752
101819
  }
101753
- }
101820
+ };
101754
101821
 
101755
101822
  let RecordAggregateRepository$1 = class RecordAggregateRepository extends UnidentifiableGraphQLTypeRepository {
101756
101823
  constructor(services, typeRegistry) {
@@ -101788,7 +101855,7 @@ let RecordAggregateRepository$1 = class RecordAggregateRepository extends Uniden
101788
101855
  }
101789
101856
  };
101790
101857
 
101791
- class RecordConnectionRepository extends UnidentifiableGraphQLTypeRepository {
101858
+ let RecordConnectionRepository$1 = class RecordConnectionRepository extends UnidentifiableGraphQLTypeRepository {
101792
101859
  constructor(services, typeRegistry) {
101793
101860
  super(services);
101794
101861
  this.services = services;
@@ -101806,9 +101873,9 @@ class RecordConnectionRepository extends UnidentifiableGraphQLTypeRepository {
101806
101873
  pageResultCount: new BaseScalarFieldDef(false),
101807
101874
  };
101808
101875
  }
101809
- }
101876
+ };
101810
101877
 
101811
- class RecordEdgeRepository extends UnidentifiableGraphQLTypeRepository {
101878
+ let RecordEdgeRepository$1 = class RecordEdgeRepository extends UnidentifiableGraphQLTypeRepository {
101812
101879
  constructor(services, typeRegistry) {
101813
101880
  super(services);
101814
101881
  this.services = services;
@@ -101824,7 +101891,7 @@ class RecordEdgeRepository extends UnidentifiableGraphQLTypeRepository {
101824
101891
  cursor: new BaseScalarFieldDef(false),
101825
101892
  };
101826
101893
  }
101827
- }
101894
+ };
101828
101895
 
101829
101896
  let RecordQueryAggregateRepository$1 = class RecordQueryAggregateRepository extends UnidentifiableGraphQLTypeRepository {
101830
101897
  constructor(services, typeRegistry) {
@@ -101919,7 +101986,7 @@ let RecordRepresentationRepository$1 = class RecordRepresentationRepository exte
101919
101986
  }
101920
101987
  };
101921
101988
 
101922
- class RecordResultRepository extends UnidentifiableGraphQLTypeRepository {
101989
+ let RecordResultRepository$1 = class RecordResultRepository extends UnidentifiableGraphQLTypeRepository {
101923
101990
  constructor(services, typeRegistry) {
101924
101991
  super(services);
101925
101992
  this.services = services;
@@ -101934,7 +102001,7 @@ class RecordResultRepository extends UnidentifiableGraphQLTypeRepository {
101934
102001
  aggregate: new BaseObjectFieldDef(this.typeRegistry.RecordAggregate, true),
101935
102002
  };
101936
102003
  }
101937
- }
102004
+ };
101938
102005
 
101939
102006
  class RecordTypeInfoRepository extends UnidentifiableGraphQLTypeRepository {
101940
102007
  constructor(services, typeRegistry) {
@@ -102357,15 +102424,17 @@ class Setup__SetupPolymorphicAggregateParentRelationshipRepository extends BaseU
102357
102424
  this.namespace = "oas";
102358
102425
  this.typeName = "Setup__SetupPolymorphicAggregateParentRelationship";
102359
102426
  this.implementedInterfaces = [];
102360
- this.possibleTypes = {
102361
- Setup__SetupRecordAggregate: this.typeRegistry.Setup__SetupRecordAggregate,
102362
- };
102363
102427
  }
102364
102428
  get fields() {
102365
102429
  return {
102366
102430
  __typename: new BaseScalarFieldDef(false),
102367
102431
  };
102368
102432
  }
102433
+ get possibleTypes() {
102434
+ return {
102435
+ Setup__SetupRecordAggregate: this.typeRegistry.Setup__SetupRecordAggregate,
102436
+ };
102437
+ }
102369
102438
  }
102370
102439
 
102371
102440
  class Setup__SetupPolymorphicParentRelationshipRepository extends BaseUnionRepository {
@@ -102376,15 +102445,17 @@ class Setup__SetupPolymorphicParentRelationshipRepository extends BaseUnionRepos
102376
102445
  this.namespace = "oas";
102377
102446
  this.typeName = "Setup__SetupPolymorphicParentRelationship";
102378
102447
  this.implementedInterfaces = [];
102379
- this.possibleTypes = {
102380
- Setup__EntityRepresentation: this.typeRegistry.Setup__EntityRepresentation,
102381
- };
102382
102448
  }
102383
102449
  get fields() {
102384
102450
  return {
102385
102451
  __typename: new BaseScalarFieldDef(false),
102386
102452
  };
102387
102453
  }
102454
+ get possibleTypes() {
102455
+ return {
102456
+ Setup__EntityRepresentation: this.typeRegistry.Setup__EntityRepresentation,
102457
+ };
102458
+ }
102388
102459
  }
102389
102460
 
102390
102461
  class Setup__SetupQueryAggregateRepository extends UnidentifiableGraphQLTypeRepository {
@@ -102734,10 +102805,10 @@ class GraphQLTypeRegistry {
102734
102805
  this._AnyType = new AnyTypeRepository(this.services, this);
102735
102806
  this._RecordRepresentation =
102736
102807
  new RecordRepresentationRepository$1(this.services, this);
102737
- this._RecordEdge = new RecordEdgeRepository(this.services, this);
102808
+ this._RecordEdge = new RecordEdgeRepository$1(this.services, this);
102738
102809
  this._PageInfo = new PageInfoRepository(this.services, this);
102739
102810
  this._RecordConnection =
102740
- new RecordConnectionRepository(this.services, this);
102811
+ new RecordConnectionRepository$1(this.services, this);
102741
102812
  this._RecordQuery = new RecordQueryRepository$1(this.services, this);
102742
102813
  this._BooleanAggregate =
102743
102814
  new BooleanAggregateRepository(this.services, this);
@@ -102767,13 +102838,13 @@ class GraphQLTypeRegistry {
102767
102838
  this._TimeAggregate = new TimeAggregateRepository(this.services, this);
102768
102839
  this._UrlAggregate = new UrlAggregateRepository(this.services, this);
102769
102840
  this._PolymorphicAggregateParentRelationship =
102770
- new PolymorphicAggregateParentRelationshipRepository(this.services, this);
102841
+ new PolymorphicAggregateParentRelationshipRepository$1(this.services, this);
102771
102842
  this._RecordAggregate = new RecordAggregateRepository$1(this.services, this);
102772
- this._RecordResult = new RecordResultRepository(this.services, this);
102843
+ this._RecordResult = new RecordResultRepository$1(this.services, this);
102773
102844
  this._RecordAggregateEdge =
102774
- new RecordAggregateEdgeRepository(this.services, this);
102845
+ new RecordAggregateEdgeRepository$1(this.services, this);
102775
102846
  this._RecordAggregateConnection =
102776
- new RecordAggregateConnectionRepository(this.services, this);
102847
+ new RecordAggregateConnectionRepository$1(this.services, this);
102777
102848
  this._RecordQueryAggregate =
102778
102849
  new RecordQueryAggregateRepository$1(this.services, this);
102779
102850
  this._ChildRelationship =
@@ -103323,9 +103394,19 @@ class RecordRepresentationBaseRepository extends BaseGraphQLTypeRepository {
103323
103394
  'RecordTypeId',
103324
103395
  ];
103325
103396
  }
103326
- getFieldDef(input, selection) {
103397
+ getFieldDef(_input, selection) {
103327
103398
  return buildGenericTypeFieldDef(selection, this.fields, this.staticFieldNames, this.typeName);
103328
103399
  }
103400
+ satisfiesFragmentTypeCondition(_input, fragment) {
103401
+ const result = super.satisfiesFragmentTypeCondition(_input, fragment);
103402
+ if (result.isErr()) {
103403
+ return result;
103404
+ }
103405
+ if (result.value) {
103406
+ return result;
103407
+ }
103408
+ return err(new Error(`${this.typeName}: unsupported fragment type condition: ${fragment.typeCondition?.name.value}`));
103409
+ }
103329
103410
  }
103330
103411
 
103331
103412
  class RecordRepresentationRepository extends RecordRepresentationRepository$1 {
@@ -103348,15 +103429,26 @@ class RecordRepresentationRepository extends RecordRepresentationRepository$1 {
103348
103429
  let overridenInput = input;
103349
103430
  // If ID exists in the data but wasn't asked for, its from the extensions, and we should normalize it
103350
103431
  if (input.data.Id !== undefined &&
103351
- input.selections.find((selection) => selection.kind === 'Field' && selection.name.value === 'Id')) {
103432
+ !input.selections.find((selection) => selection.kind === 'Field' && selection.name.value === 'Id')) {
103352
103433
  overridenInput = {
103353
- ...input,
103434
+ ...overridenInput,
103354
103435
  selections: [
103355
- ...input.selections,
103436
+ ...overridenInput.selections,
103356
103437
  { kind: 'Field', name: { kind: 'Name', value: 'Id' } },
103357
103438
  ],
103358
103439
  };
103359
103440
  }
103441
+ // If WeakEtag exists in the data but wasn't asked for, its from the extensions, and we should normalize it
103442
+ if (input.data.WeakEtag !== undefined &&
103443
+ !input.selections.find((selection) => selection.kind === 'Field' && selection.name.value === 'WeakEtag')) {
103444
+ overridenInput = {
103445
+ ...overridenInput,
103446
+ selections: [
103447
+ ...overridenInput.selections,
103448
+ { kind: 'Field', name: { kind: 'Name', value: 'WeakEtag' } },
103449
+ ],
103450
+ };
103451
+ }
103360
103452
  const result = super.write(cache, overridenInput);
103361
103453
  const recordId = input.data.Id;
103362
103454
  const luvioRecord = input.getNormalizedLuvioRecord(recordId, input.reader);
@@ -103369,13 +103461,18 @@ class RecordRepresentationRepository extends RecordRepresentationRepository$1 {
103369
103461
  }
103370
103462
  read(cache, input) {
103371
103463
  const result = super.read(cache, input);
103372
- const idData = super.read(cache, {
103464
+ const trackingData = super.read(cache, {
103373
103465
  ...input,
103374
- selections: [{ kind: 'Field', name: { kind: 'Name', value: 'Id' } }],
103466
+ selections: [
103467
+ { kind: 'Field', name: { kind: 'Name', value: 'Id' } },
103468
+ { kind: 'Field', name: { kind: 'Name', value: 'WeakEtag' } },
103469
+ ],
103375
103470
  });
103376
- if (idData.isOk()) {
103471
+ if (trackingData.isOk()) {
103377
103472
  // Read the record to track subscription
103378
- input.getNormalizedLuvioRecord(idData.value.Id, input.reader);
103473
+ input.getNormalizedLuvioRecord(trackingData.value.Id, input.reader);
103474
+ // Track the weak etag for the record for cross cache invalidation
103475
+ input.usedRecordIdToWeakEtagMap[trackingData.value.Id] = trackingData.value.WeakEtag;
103379
103476
  }
103380
103477
  return result;
103381
103478
  }
@@ -103468,6 +103565,16 @@ class CompoundFieldRepository extends CompoundFieldRepository$1 {
103468
103565
  isBaseFieldSelection(selection) {
103469
103566
  return super.getFieldDef(undefined, selection) !== undefined;
103470
103567
  }
103568
+ satisfiesFragmentTypeCondition(_input, fragment) {
103569
+ const result = super.satisfiesFragmentTypeCondition(_input, fragment);
103570
+ if (result.isErr()) {
103571
+ return result;
103572
+ }
103573
+ if (result.value) {
103574
+ return result;
103575
+ }
103576
+ return err(new Error(`${this.typeName}: unsupported fragment type condition: ${fragment.typeCondition?.name.value}`));
103577
+ }
103471
103578
  }
103472
103579
 
103473
103580
  class RecordQueryRepository extends RecordQueryRepository$1 {
@@ -103489,6 +103596,16 @@ class RecordAggregateRepository extends RecordAggregateRepository$1 {
103489
103596
  getFieldDef(input, selection) {
103490
103597
  return buildGenericTypeFieldDef(selection, this.fields, this.staticFieldNames, this.typeName);
103491
103598
  }
103599
+ satisfiesFragmentTypeCondition(_input, fragment) {
103600
+ const result = super.satisfiesFragmentTypeCondition(_input, fragment);
103601
+ if (result.isErr()) {
103602
+ return result;
103603
+ }
103604
+ if (result.value) {
103605
+ return result;
103606
+ }
103607
+ return err(new Error(`${this.typeName}: unsupported fragment type condition: ${fragment.typeCondition?.name.value}`));
103608
+ }
103492
103609
  }
103493
103610
 
103494
103611
  class RecordQueryAggregateRepository extends RecordQueryAggregateRepository$1 {
@@ -103503,16 +103620,14 @@ class RecordQueryAggregateRepository extends RecordQueryAggregateRepository$1 {
103503
103620
  }
103504
103621
  }
103505
103622
 
103623
+ // This should be smarter, and filter on selections, but for now,
103624
+ // we'll match the luvio behavior of returning the blob
103506
103625
  const blobTypeDef = {
103507
103626
  read: (_cache, input) => {
103508
- return ok({
103509
- data: input.data,
103510
- });
103627
+ return ok(input.normalizedData);
103511
103628
  },
103512
103629
  write: (_cache, input) => {
103513
- return ok({
103514
- data: input.data,
103515
- });
103630
+ return ok(input.data);
103516
103631
  },
103517
103632
  buildFieldKey: (selection, variables) => buildFieldKey(selection.name.value, selection.arguments, variables),
103518
103633
  augmentSelections: (input) => input,
@@ -103574,6 +103689,16 @@ class SetupEntityRepresentationRepository extends UnidentifiableGraphQLTypeRepos
103574
103689
  // We should make this smarter, storing and returning blobs isn't great since it could, and likely will, include unrequested field data
103575
103690
  return blobTypeDef;
103576
103691
  }
103692
+ satisfiesFragmentTypeCondition(input, fragment) {
103693
+ const result = super.satisfiesFragmentTypeCondition(input, fragment);
103694
+ if (result.isErr()) {
103695
+ return result;
103696
+ }
103697
+ if (result.value) {
103698
+ return result;
103699
+ }
103700
+ return err(new Error(`${this.typeName}: unsupported fragment type condition: ${fragment.typeCondition?.name.value}`));
103701
+ }
103577
103702
  }
103578
103703
 
103579
103704
  class SetupQueryAggregateRepository extends Setup__SetupQueryAggregateRepository {
@@ -103611,6 +103736,16 @@ class SetupRecordAggregateRepository extends Setup__SetupRecordAggregateReposito
103611
103736
  }
103612
103737
  return blobTypeDef;
103613
103738
  }
103739
+ satisfiesFragmentTypeCondition(_input, fragment) {
103740
+ const result = super.satisfiesFragmentTypeCondition(_input, fragment);
103741
+ if (result.isErr()) {
103742
+ return result;
103743
+ }
103744
+ if (result.value) {
103745
+ return result;
103746
+ }
103747
+ return err(new Error(`${this.typeName}: unsupported fragment type condition: ${fragment.typeCondition?.name.value}`));
103748
+ }
103614
103749
  }
103615
103750
 
103616
103751
  class PolymorphicParentRelationshipRepository extends PolymorphicParentRelationshipRepository$1 {
@@ -103621,26 +103756,242 @@ class PolymorphicParentRelationshipRepository extends PolymorphicParentRelations
103621
103756
  }
103622
103757
  }
103623
103758
 
103759
+ // We're going to override the generated repository
103760
+ // to make this a pseudo-identifiable repository
103761
+ // so that we can independently control its cache control (no-cache)
103762
+ class SetupRepository extends IdentifiableGraphQLTypeRepository {
103763
+ constructor(services, typeRegistry) {
103764
+ super(services);
103765
+ this.typeRegistry = typeRegistry;
103766
+ this.namespace = 'oas';
103767
+ this.typeName = 'Setup__Setup';
103768
+ this.implementedInterfaces = [];
103769
+ this.cacheControl = {
103770
+ type: 'no-cache',
103771
+ };
103772
+ this.baseRepository = new Setup__SetupRepository(services, typeRegistry);
103773
+ }
103774
+ get fields() {
103775
+ return this.baseRepository.fields;
103776
+ }
103777
+ buildKeyParams(_input) {
103778
+ return null;
103779
+ }
103780
+ augmentSelections(input) {
103781
+ return this.baseRepository.augmentSelections(input);
103782
+ }
103783
+ }
103784
+
103785
+ class SetupEdgeRepository extends Setup__SetupEdgeRepository {
103786
+ satisfiesFragmentTypeCondition(_input, fragment) {
103787
+ const result = super.satisfiesFragmentTypeCondition(_input, fragment);
103788
+ if (result.isErr()) {
103789
+ return result;
103790
+ }
103791
+ if (result.value) {
103792
+ return result;
103793
+ }
103794
+ return err(new Error(`${this.typeName}: unsupported fragment type condition: ${fragment.typeCondition?.name.value}`));
103795
+ }
103796
+ }
103797
+
103798
+ class PolymorphicAggregateParentRelationshipRepository extends PolymorphicAggregateParentRelationshipRepository$1 {
103799
+ getTypeDiscriminator(data, _selections) {
103800
+ // Hardcoded to record aggregate since that's the only type of parent
103801
+ // relationship possible
103802
+ return 'RecordAggregate';
103803
+ }
103804
+ }
103805
+
103806
+ class RecordAggregateConnectionRepository extends RecordAggregateConnectionRepository$1 {
103807
+ satisfiesFragmentTypeCondition(_input, fragment) {
103808
+ const result = super.satisfiesFragmentTypeCondition(_input, fragment);
103809
+ if (result.isErr()) {
103810
+ return result;
103811
+ }
103812
+ if (result.value) {
103813
+ return result;
103814
+ }
103815
+ return err(new Error(`${this.typeName}: unsupported fragment type condition: ${fragment.typeCondition?.name.value}`));
103816
+ }
103817
+ }
103818
+
103819
+ class RecordAggregateEdgeRepository extends RecordAggregateEdgeRepository$1 {
103820
+ satisfiesFragmentTypeCondition(_input, fragment) {
103821
+ const result = super.satisfiesFragmentTypeCondition(_input, fragment);
103822
+ if (result.isErr()) {
103823
+ return result;
103824
+ }
103825
+ if (result.value) {
103826
+ return result;
103827
+ }
103828
+ return err(new Error(`${this.typeName}: unsupported fragment type condition: ${fragment.typeCondition?.name.value}`));
103829
+ }
103830
+ }
103831
+
103832
+ class RecordConnectionRepository extends RecordConnectionRepository$1 {
103833
+ satisfiesFragmentTypeCondition(_input, fragment) {
103834
+ const result = super.satisfiesFragmentTypeCondition(_input, fragment);
103835
+ if (result.isErr()) {
103836
+ return result;
103837
+ }
103838
+ if (result.value) {
103839
+ return result;
103840
+ }
103841
+ return err(new Error(`${this.typeName}: unsupported fragment type condition: ${fragment.typeCondition?.name.value}`));
103842
+ }
103843
+ }
103844
+
103845
+ class RecordEdgeRepository extends RecordEdgeRepository$1 {
103846
+ satisfiesFragmentTypeCondition(_input, fragment) {
103847
+ const result = super.satisfiesFragmentTypeCondition(_input, fragment);
103848
+ if (result.isErr()) {
103849
+ return result;
103850
+ }
103851
+ if (result.value) {
103852
+ return result;
103853
+ }
103854
+ return err(new Error(`${this.typeName}: unsupported fragment type condition: ${fragment.typeCondition?.name.value}`));
103855
+ }
103856
+ }
103857
+
103858
+ class RecordResultRepository extends RecordResultRepository$1 {
103859
+ satisfiesFragmentTypeCondition(_input, fragment) {
103860
+ const result = super.satisfiesFragmentTypeCondition(_input, fragment);
103861
+ if (result.isErr()) {
103862
+ return result;
103863
+ }
103864
+ if (result.value) {
103865
+ return result;
103866
+ }
103867
+ return err(new Error(`${this.typeName}: unsupported fragment type condition: ${fragment.typeCondition?.name.value}`));
103868
+ }
103869
+ }
103870
+
103871
+ class SetupRecordResultRepository extends Setup__SetupRecordResultRepository {
103872
+ satisfiesFragmentTypeCondition(_input, fragment) {
103873
+ const result = super.satisfiesFragmentTypeCondition(_input, fragment);
103874
+ if (result.isErr()) {
103875
+ return result;
103876
+ }
103877
+ if (result.value) {
103878
+ return result;
103879
+ }
103880
+ return err(new Error(`${this.typeName}: unsupported fragment type condition: ${fragment.typeCondition?.name.value}`));
103881
+ }
103882
+ }
103883
+
103884
+ class SetupAggregateConnectionRepository extends Setup__SetupAggregateConnectionRepository {
103885
+ satisfiesFragmentTypeCondition(_input, fragment) {
103886
+ const result = super.satisfiesFragmentTypeCondition(_input, fragment);
103887
+ if (result.isErr()) {
103888
+ return result;
103889
+ }
103890
+ if (result.value) {
103891
+ return result;
103892
+ }
103893
+ return err(new Error(`${this.typeName}: unsupported fragment type condition: ${fragment.typeCondition?.name.value}`));
103894
+ }
103895
+ }
103896
+
103897
+ class SetupAggregateEdgeRepository extends Setup__SetupAggregateEdgeRepository {
103898
+ satisfiesFragmentTypeCondition(_input, fragment) {
103899
+ const result = super.satisfiesFragmentTypeCondition(_input, fragment);
103900
+ if (result.isErr()) {
103901
+ return result;
103902
+ }
103903
+ if (result.value) {
103904
+ return result;
103905
+ }
103906
+ return err(new Error(`${this.typeName}: unsupported fragment type condition: ${fragment.typeCondition?.name.value}`));
103907
+ }
103908
+ }
103909
+
103910
+ class SetupConnectionRepository extends Setup__SetupConnectionRepository {
103911
+ satisfiesFragmentTypeCondition(_input, fragment) {
103912
+ const result = super.satisfiesFragmentTypeCondition(_input, fragment);
103913
+ if (result.isErr()) {
103914
+ return result;
103915
+ }
103916
+ if (result.value) {
103917
+ return result;
103918
+ }
103919
+ return err(new Error(`${this.typeName}: unsupported fragment type condition: ${fragment.typeCondition?.name.value}`));
103920
+ }
103921
+ }
103922
+
103923
+ class SetupPolymorphicAggregateParentRelationshipRepository extends Setup__SetupPolymorphicAggregateParentRelationshipRepository {
103924
+ getTypeDiscriminator(data, _selections) {
103925
+ // Hardcoded to Setup__SetupRecordAggregate since that's the only type of parent
103926
+ // relationship possible
103927
+ return 'Setup__SetupRecordAggregate';
103928
+ }
103929
+ }
103930
+
103931
+ class SetupPolymorphicParentRelationshipRepository extends Setup__SetupPolymorphicParentRelationshipRepository {
103932
+ getTypeDiscriminator(data, _selections) {
103933
+ // Hardcoded to Setup__EntityRepresentation since that's the only type of parent
103934
+ // relationship possible
103935
+ return 'Setup__EntityRepresentation';
103936
+ }
103937
+ }
103938
+
103624
103939
  class CustomGraphQLTypeRegistry extends GraphQLTypeRegistry {
103625
103940
  constructor(services) {
103626
103941
  super(services);
103627
- this._RecordRepresentation = new RecordRepresentationRepository(services, this);
103942
+ // UIAPI Records overrides
103628
103943
  this._CompoundField = new CompoundFieldRepository(services, this);
103629
- this._RecordQuery = new RecordQueryRepository(services, this);
103944
+ this._PolymorphicAggregateParentRelationship =
103945
+ new PolymorphicAggregateParentRelationshipRepository(services, this);
103946
+ this._PolymorphicParentRelationship = new PolymorphicParentRelationshipRepository(services, this);
103947
+ this._RecordAggregateConnection = new RecordAggregateConnectionRepository(services, this);
103948
+ this._RecordAggregateEdge = new RecordAggregateEdgeRepository(services, this);
103630
103949
  this._RecordAggregate = new RecordAggregateRepository(services, this);
103950
+ this._RecordConnection = new RecordConnectionRepository(services, this);
103951
+ this._RecordEdge = new RecordEdgeRepository(services, this);
103631
103952
  this._RecordQueryAggregate = new RecordQueryAggregateRepository(services, this);
103953
+ this._RecordQuery = new RecordQueryRepository(services, this);
103954
+ this._RecordRepresentation = new RecordRepresentationRepository(services, this);
103955
+ this._RecordResult = new RecordResultRepository(services, this);
103956
+ // Setup overrides
103957
+ this._SetupAggregateConnection = new SetupAggregateConnectionRepository(services, this);
103958
+ this._SetupAggregateEdge = new SetupAggregateEdgeRepository(services, this);
103959
+ this._SetupConnection = new SetupConnectionRepository(services, this);
103960
+ this._SetupEdge = new SetupEdgeRepository(services, this);
103632
103961
  this._SetupEntityRepresentation = new SetupEntityRepresentationRepository(services, this);
103962
+ this._SetupPolymorphicAggregateParentRelationship =
103963
+ new SetupPolymorphicAggregateParentRelationshipRepository(services, this);
103964
+ this._SetupPolymorphicParentRelationship = new SetupPolymorphicParentRelationshipRepository(services, this);
103633
103965
  this._SetupQueryAggregate = new SetupQueryAggregateRepository(services, this);
103634
103966
  this._SetupQuery = new SetupQueryRepository(services, this);
103635
103967
  this._SetupRecordAggregate = new SetupRecordAggregateRepository(services, this);
103636
- this._PolymorphicParentRelationship = new PolymorphicParentRelationshipRepository(services, this);
103968
+ this._SetupRecordResult = new SetupRecordResultRepository(services, this);
103969
+ this._Setup = new SetupRepository(services, this);
103637
103970
  }
103638
103971
  get CompoundField() {
103639
103972
  return this._CompoundField;
103640
103973
  }
103974
+ get PolymorphicAggregateParentRelationship() {
103975
+ return this._PolymorphicAggregateParentRelationship;
103976
+ }
103977
+ get PolymorphicParentRelationship() {
103978
+ return this._PolymorphicParentRelationship;
103979
+ }
103980
+ get RecordAggregateConnection() {
103981
+ return this._RecordAggregateConnection;
103982
+ }
103983
+ get RecordAggregateEdge() {
103984
+ return this._RecordAggregateEdge;
103985
+ }
103641
103986
  get RecordAggregate() {
103642
103987
  return this._RecordAggregate;
103643
103988
  }
103989
+ get RecordConnection() {
103990
+ return this._RecordConnection;
103991
+ }
103992
+ get RecordEdge() {
103993
+ return this._RecordEdge;
103994
+ }
103644
103995
  get RecordQueryAggregate() {
103645
103996
  return this._RecordQueryAggregate;
103646
103997
  }
@@ -103650,20 +104001,44 @@ class CustomGraphQLTypeRegistry extends GraphQLTypeRegistry {
103650
104001
  get RecordRepresentation() {
103651
104002
  return this._RecordRepresentation;
103652
104003
  }
103653
- get SetupEntityRepresentation() {
104004
+ get RecordResult() {
104005
+ return this._RecordResult;
104006
+ }
104007
+ get Setup__SetupAggregateConnection() {
104008
+ return this._SetupAggregateConnection;
104009
+ }
104010
+ get Setup__SetupAggregateEdge() {
104011
+ return this._SetupAggregateEdge;
104012
+ }
104013
+ get Setup__SetupConnection() {
104014
+ return this._SetupConnection;
104015
+ }
104016
+ get Setup__SetupEdge() {
104017
+ return this._SetupEdge;
104018
+ }
104019
+ get Setup__EntityRepresentation() {
103654
104020
  return this._SetupEntityRepresentation;
103655
104021
  }
103656
- get SetupQueryAggregate() {
104022
+ get Setup__SetupPolymorphicAggregateParentRelationship() {
104023
+ return this._SetupPolymorphicAggregateParentRelationship;
104024
+ }
104025
+ get Setup__SetupPolymorphicParentRelationship() {
104026
+ return this._SetupPolymorphicParentRelationship;
104027
+ }
104028
+ get Setup__SetupQueryAggregate() {
103657
104029
  return this._SetupQueryAggregate;
103658
104030
  }
103659
- get SetupQuery() {
104031
+ get Setup__SetupQuery() {
103660
104032
  return this._SetupQuery;
103661
104033
  }
103662
- get SetupRecordAggregate() {
104034
+ get Setup__SetupRecordAggregate() {
103663
104035
  return this._SetupRecordAggregate;
103664
104036
  }
103665
- get PolymorphicParentRelationship() {
103666
- return this._PolymorphicParentRelationship;
104037
+ get Setup__SetupRecordResult() {
104038
+ return this._SetupRecordResult;
104039
+ }
104040
+ get Setup__Setup() {
104041
+ return this._Setup;
103667
104042
  }
103668
104043
  }
103669
104044
 
@@ -103815,10 +104190,12 @@ function buildCommandClass(baseClass) {
103815
104190
  reader: true,
103816
104191
  synthetic: true,
103817
104192
  read: (reader) => {
104193
+ this.latestUsedRecordIdToWeakEtagMap = {};
103818
104194
  readFromCacheResult = this.buildResultType().query(cache, {
103819
104195
  ...this.buildQuery(),
103820
104196
  reader,
103821
104197
  getNormalizedLuvioRecord: this.services.luvioUiapiRecords.getNormalizedLuvioRecord,
104198
+ usedRecordIdToWeakEtagMap: this.latestUsedRecordIdToWeakEtagMap,
103822
104199
  });
103823
104200
  return readFromCacheResult;
103824
104201
  },
@@ -103870,15 +104247,20 @@ function buildCommandClass(baseClass) {
103870
104247
  }
103871
104248
  return resolvedPromiseLike(undefined);
103872
104249
  }
103873
- execute() {
104250
+ execute(overrides) {
104251
+ this.services.instrumentation?.metrics
104252
+ .getMeter('onestore')
104253
+ .createCounter(`graphql.execute.count`)
104254
+ .add(1);
103874
104255
  // Clear snapshot and unsubscribe from any existing subscriptions at the beginning of execute calls
103875
104256
  this.latestLuvioSnapshot = undefined;
103876
104257
  this.latestLuvioRecordIdsToInvalidate = undefined;
104258
+ this.latestUsedRecordIdToWeakEtagMap = undefined;
103877
104259
  if (this.unsubscribeFromLuvioSnapshot) {
103878
104260
  this.unsubscribeFromLuvioSnapshot();
103879
104261
  this.unsubscribeFromLuvioSnapshot = undefined;
103880
104262
  }
103881
- const result = super.execute();
104263
+ const result = super.execute(overrides);
103882
104264
  result.then((_) => {
103883
104265
  if (this.latestLuvioRecordIdsToInvalidate &&
103884
104266
  this.latestLuvioRecordIdsToInvalidate.length > 0) {
@@ -103887,6 +104269,13 @@ function buildCommandClass(baseClass) {
103887
104269
  });
103888
104270
  return result;
103889
104271
  }
104272
+ runOriginalRequest() {
104273
+ this.services.instrumentation?.metrics
104274
+ .getMeter('onestore')
104275
+ .createCounter(`graphql.fallback.count`)
104276
+ .add(1);
104277
+ return super.runOriginalRequest();
104278
+ }
103890
104279
  subscribeToKeysUsed() {
103891
104280
  super.subscribeToKeysUsed();
103892
104281
  // Subscribe to luvio cache changes using the stored snapshot
@@ -103894,15 +104283,53 @@ function buildCommandClass(baseClass) {
103894
104283
  try {
103895
104284
  const luvioService = this.services.luvio;
103896
104285
  const luvioInstance = luvioService.luvio;
103897
- // Subscribe to changes using the stored snapshot
104286
+ if (this.unsubscribeFromLuvioSnapshot) {
104287
+ this.unsubscribeFromLuvioSnapshot();
104288
+ }
103898
104289
  this.unsubscribeFromLuvioSnapshot = luvioInstance.storeSubscribe(this.latestLuvioSnapshot, (_) => {
103899
104290
  // If any records used change at the top level, refresh all the data
103900
- this.refresh();
104291
+ if (this.usedRecordsChanged()) {
104292
+ this.refresh();
104293
+ }
103901
104294
  });
103902
104295
  }
103903
104296
  catch (error) { }
103904
104297
  }
103905
104298
  }
104299
+ usedRecordsChanged() {
104300
+ if (!this.latestUsedRecordIdToWeakEtagMap ||
104301
+ Object.keys(this.latestUsedRecordIdToWeakEtagMap).length === 0) {
104302
+ return false;
104303
+ }
104304
+ const luvioService = this.services.luvio;
104305
+ const luvioInstance = luvioService.luvio;
104306
+ let dataChanged = false;
104307
+ luvioInstance.storeLookup({
104308
+ recordId: 'onestore-graphql',
104309
+ node: {
104310
+ kind: 'Fragment',
104311
+ reader: true,
104312
+ synthetic: true,
104313
+ read: (reader) => {
104314
+ if (this.latestUsedRecordIdToWeakEtagMap) {
104315
+ Object.entries(this.latestUsedRecordIdToWeakEtagMap).forEach(([recordId, oneStoreRecordWeakEtag]) => {
104316
+ const normalizedLuvioRecord = this.services.luvioUiapiRecords.getNormalizedLuvioRecord(recordId, reader);
104317
+ if (!normalizedLuvioRecord) {
104318
+ return;
104319
+ }
104320
+ const luvioRecordWeakEtag = normalizedLuvioRecord.weakEtag;
104321
+ if (luvioRecordWeakEtag !== oneStoreRecordWeakEtag) {
104322
+ dataChanged = true;
104323
+ }
104324
+ });
104325
+ }
104326
+ return {};
104327
+ },
104328
+ },
104329
+ variables: {},
104330
+ });
104331
+ return dataChanged;
104332
+ }
103906
104333
  };
103907
104334
  }
103908
104335
 
@@ -103949,6 +104376,11 @@ const serviceRequirements = {
103949
104376
  type: 'luvioUiapiRecords',
103950
104377
  version: '1.0',
103951
104378
  },
104379
+ instrumentation: {
104380
+ type: 'instrumentation',
104381
+ version: '1.0',
104382
+ optional: true,
104383
+ },
103952
104384
  };
103953
104385
  let provisionedCallback;
103954
104386
  getServices(serviceRequirements).then((services) => {
@@ -103959,7 +104391,7 @@ getServices(serviceRequirements).then((services) => {
103959
104391
  constructor() {
103960
104392
  super(...arguments);
103961
104393
  this.configSchema = CONFIG_SCHEMA;
103962
- this.exposeRefresh = false;
104394
+ this.exposeRefresh = true;
103963
104395
  }
103964
104396
  getCommand() {
103965
104397
  return new graphql_ctor({ ...this.config, query: resolveAst(this.config.query) }, documentRootType, services);
@@ -103984,7 +104416,7 @@ function registerCallback(cb) {
103984
104416
  cb(graphql$1, graphql_imperative$1, useOneStoreGraphQL);
103985
104417
  }
103986
104418
  }
103987
- // version: 1.378.0-63d7c07562
104419
+ // version: 1.379.1-7ea94edc38
103988
104420
 
103989
104421
  function createFragmentMap(documentNode) {
103990
104422
  const fragments = {};
@@ -130479,7 +130911,7 @@ function refreshGraphQL(data) {
130479
130911
  }
130480
130912
  return refresh$3(data, 'refreshUiApi');
130481
130913
  }
130482
- // version: 1.378.0-63d7c07562
130914
+ // version: 1.379.1-7ea94edc38
130483
130915
 
130484
130916
  // On core the unstable adapters are re-exported with different names,
130485
130917
  // we want to match them here.
@@ -130631,7 +131063,7 @@ withDefaultLuvio((luvio) => {
130631
131063
  unstable_graphQL_imperative = createImperativeAdapter(luvio, createInstrumentedAdapter(ldsAdapter, adapterMetadata), adapterMetadata);
130632
131064
  graphQLImperative = ldsAdapter;
130633
131065
  });
130634
- // version: 1.378.0-63d7c07562
131066
+ // version: 1.379.1-7ea94edc38
130635
131067
 
130636
131068
  var gqlApi = /*#__PURE__*/Object.freeze({
130637
131069
  __proto__: null,
@@ -131430,7 +131862,7 @@ const callbacks$1 = [];
131430
131862
  function register(r) {
131431
131863
  callbacks$1.forEach((callback) => callback(r));
131432
131864
  }
131433
- // version: 1.378.0-0ab3d40d29
131865
+ // version: 1.379.1-5350e195b2
131434
131866
 
131435
131867
  /**
131436
131868
  * Copyright (c) 2022, Salesforce, Inc.,
@@ -132746,4 +133178,4 @@ const { luvio } = getRuntime();
132746
133178
  setDefaultLuvio({ luvio });
132747
133179
 
132748
133180
  export { createPrimingSession, draftManager, draftQueue, evictCacheRecordsByIds, evictExpiredCacheEntries, executeAdapter, executeMutatingAdapter, getImperativeAdapterNames, importLuvioAdapterModule, importOneStoreAdapterModule, invokeAdapter, invokeAdapterWithDraftToMerge, invokeAdapterWithDraftToReplace, invokeAdapterWithMetadata, nimbusDraftQueue, registerReportObserver, setMetadataTTL, setUiApiRecordTTL, stopEviction, subscribeToAdapter };
132749
- // version: 1.378.0-0ab3d40d29
133181
+ // version: 1.379.1-5350e195b2