@salesforce/lds-worker-api 1.380.0-dev8 → 1.380.0-dev9

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.
@@ -21,7 +21,7 @@ var SnapshotState$3;
21
21
  })(SnapshotState$3 || (SnapshotState$3 = {}));
22
22
 
23
23
  const { create: create$b, entries: entries$7, freeze: freeze$7, keys: keys$b, values: values$3, assign: assign$8 } = Object;
24
- const { hasOwnProperty: hasOwnProperty$5 } = Object.prototype;
24
+ const { hasOwnProperty: hasOwnProperty$6 } = Object.prototype;
25
25
  const { isArray: isArray$a } = Array;
26
26
  const { push: push$5, indexOf, slice: slice$2 } = Array.prototype;
27
27
  const { parse: parse$c, stringify: stringify$c } = JSON;
@@ -623,9 +623,9 @@ class StringKeyInMemoryStore {
623
623
  readMetadataWhere(query) {
624
624
  const keys$1 = keys$b(this.metadata);
625
625
  const results = [];
626
- const hasNamespaceQuery = hasOwnProperty$5.call(query, 'namespace');
627
- const hasRepresentationNameQuery = hasOwnProperty$5.call(query, 'representationName');
628
- const hasTtlOverrideQuery = hasOwnProperty$5.call(query, 'ttlOverride');
626
+ const hasNamespaceQuery = hasOwnProperty$6.call(query, 'namespace');
627
+ const hasRepresentationNameQuery = hasOwnProperty$6.call(query, 'representationName');
628
+ const hasTtlOverrideQuery = hasOwnProperty$6.call(query, 'ttlOverride');
629
629
  for (let i = 0, length = keys$1.length; i < length; i++) {
630
630
  const key = keys$1[i];
631
631
  const storeMetadata = this.metadata[key];
@@ -649,7 +649,7 @@ class StringKeyInMemoryStore {
649
649
  put(recordId, record) {
650
650
  const { records, insertedIds, pendingTrimKeys, retainedIds } = this;
651
651
  const canonicalKey = this.getCanonicalRecordId(recordId);
652
- if (hasOwnProperty$5.call(records, canonicalKey) === false) {
652
+ if (hasOwnProperty$6.call(records, canonicalKey) === false) {
653
653
  insertedIds[canonicalKey] = true;
654
654
  }
655
655
  records[canonicalKey] = record;
@@ -1324,9 +1324,9 @@ class InMemoryStore {
1324
1324
  return this.fallbackStringKeyInMemoryStore.readMetadataWhere(query);
1325
1325
  }
1326
1326
  const results = [];
1327
- const hasNamespaceQuery = hasOwnProperty$5.call(query, 'namespace');
1328
- const hasRepresentationNameQuery = hasOwnProperty$5.call(query, 'representationName');
1329
- const hasTtlOverrideQuery = hasOwnProperty$5.call(query, 'ttlOverride');
1327
+ const hasNamespaceQuery = hasOwnProperty$6.call(query, 'namespace');
1328
+ const hasRepresentationNameQuery = hasOwnProperty$6.call(query, 'representationName');
1329
+ const hasTtlOverrideQuery = hasOwnProperty$6.call(query, 'ttlOverride');
1330
1330
  for (let i = 0, length = keys.length; i < length; i++) {
1331
1331
  const key = keys[i];
1332
1332
  const storeMetadata = this.metadataMap.get(key);
@@ -2165,8 +2165,8 @@ function buildValidAtImplementation(basePolicyImplementation, timestamp) {
2165
2165
  function isNodeLink(node) {
2166
2166
  return (typeof node === 'object' &&
2167
2167
  node !== null &&
2168
- (hasOwnProperty$5.call(node, '__ref') ||
2169
- hasOwnProperty$5.call(node, 'isMissing')));
2168
+ (hasOwnProperty$6.call(node, '__ref') ||
2169
+ hasOwnProperty$6.call(node, 'isMissing')));
2170
2170
  }
2171
2171
  function isGraphNode$2(node) {
2172
2172
  return node !== null && node.type === GraphNodeType$1.Node;
@@ -2311,7 +2311,7 @@ function formatStorageKey(name, argValues) {
2311
2311
  }
2312
2312
  var values = [];
2313
2313
  for (var _argName in argValues) {
2314
- if (hasOwnProperty$5.call(argValues, _argName)) {
2314
+ if (hasOwnProperty$6.call(argValues, _argName)) {
2315
2315
  var value = argValues[_argName];
2316
2316
  if (value !== null || value !== undefined) {
2317
2317
  values.push(_argName + ':' + stringify$c(value));
@@ -2651,7 +2651,7 @@ class Reader {
2651
2651
  data[key] = items;
2652
2652
  }
2653
2653
  else {
2654
- if (hasOwnProperty$5.call(visitedKeys, nextRecordId) === true) {
2654
+ if (hasOwnProperty$6.call(visitedKeys, nextRecordId) === true) {
2655
2655
  throw new Error(`Invalid eager selection on records with circular references.`);
2656
2656
  }
2657
2657
  const lookupResult = this.resolveKey(nextRecordId);
@@ -3133,7 +3133,7 @@ class Reader {
3133
3133
  }
3134
3134
  }
3135
3135
  readScalar(propertyName, record, data, required) {
3136
- if (!hasOwnProperty$5.call(record, propertyName)) {
3136
+ if (!hasOwnProperty$6.call(record, propertyName)) {
3137
3137
  if (required !== false) {
3138
3138
  this.markMissing();
3139
3139
  return;
@@ -4274,7 +4274,7 @@ function withDefaultLuvio(callback) {
4274
4274
  }
4275
4275
  callbacks.push(callback);
4276
4276
  }
4277
- // version: 1.380.0-dev8-c2a0c4e2de
4277
+ // version: 1.380.0-dev9-0a2876c461
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.380.0-dev8-c2a0c4e2de
5321
+ // version: 1.380.0-dev9-0a2876c461
5322
5322
 
5323
5323
  /**
5324
5324
  * Copyright (c) 2022, Salesforce, Inc.,
@@ -6139,7 +6139,7 @@ function buildAdapterValidationConfig$3(displayName, paramsMeta) {
6139
6139
  const keyPrefix$3 = 'UiApi';
6140
6140
 
6141
6141
  const { assign: assign$6, create: create$8, freeze: freeze$5, isFrozen: isFrozen$3, keys: keys$9 } = Object;
6142
- const { hasOwnProperty: hasOwnProperty$4 } = Object.prototype;
6142
+ const { hasOwnProperty: hasOwnProperty$5 } = Object.prototype;
6143
6143
  const { split: split$1, endsWith: endsWith$1 } = String.prototype;
6144
6144
  const { isArray: isArray$8 } = Array;
6145
6145
  const { concat: concat$3, filter: filter$3, includes: includes$3, push: push$4, reduce: reduce$3 } = Array.prototype;
@@ -9352,7 +9352,7 @@ function extractTrackedFieldsToTrie$1(recordId, node, root, config, visitedRecor
9352
9352
  }
9353
9353
  // Stop the traversal if the key has already been visited, since the fields for this record
9354
9354
  // have already been gathered at this point.
9355
- if (hasOwnProperty$4.call(visitedRecordIds, recordId)) {
9355
+ if (hasOwnProperty$5.call(visitedRecordIds, recordId)) {
9356
9356
  return;
9357
9357
  }
9358
9358
  // The visitedRecordIds object passed to the spanning record is a copy of the original
@@ -10158,20 +10158,20 @@ function unionFields$1(fields, optionalFields) {
10158
10158
  return [...fieldsArray, ...optionalFieldsArray];
10159
10159
  }
10160
10160
  function getRecordIdsFromUrlParams$1(urlParams) {
10161
- if (hasOwnProperty$4.call(urlParams, 'recordId')) {
10161
+ if (hasOwnProperty$5.call(urlParams, 'recordId')) {
10162
10162
  return [urlParams.recordId];
10163
10163
  }
10164
- else if (hasOwnProperty$4.call(urlParams, 'recordIds')) {
10164
+ else if (hasOwnProperty$5.call(urlParams, 'recordIds')) {
10165
10165
  return urlParams.recordIds;
10166
10166
  }
10167
10167
  return [];
10168
10168
  }
10169
10169
  function isSingleBatchRecordRequest$1(urlParams) {
10170
- return (hasOwnProperty$4.call(urlParams, 'recordIds') &&
10170
+ return (hasOwnProperty$5.call(urlParams, 'recordIds') &&
10171
10171
  urlParams.recordIds.length === 1);
10172
10172
  }
10173
10173
  function isSingleRecordRequest$1(urlParams) {
10174
- return hasOwnProperty$4.call(urlParams, 'recordId');
10174
+ return hasOwnProperty$5.call(urlParams, 'recordId');
10175
10175
  }
10176
10176
  function isRestrictedPathCondition$1(existingPath, path) {
10177
10177
  // should not dedupe getRecordUi and getRecord as both of their representation is different
@@ -15121,7 +15121,7 @@ function getLayoutMapAndObjectInfo$1(recordId, data) {
15121
15121
  // W-12697744 - Return an empty layoutMap if the entity does not have a layout.
15122
15122
  // Temp fix until we can mimic the server behavior for non-layoutable entities.
15123
15123
  let layoutMap = {};
15124
- if (hasOwnProperty$4.call(layouts, apiName)) {
15124
+ if (hasOwnProperty$5.call(layouts, apiName)) {
15125
15125
  layoutMap = layouts[apiName][recordTypeId] || {};
15126
15126
  }
15127
15127
  return {
@@ -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.380.0-dev8-60930b5790
34157
+ // version: 1.380.0-dev9-476a6580cf
34158
34158
 
34159
34159
  function requestIdleDetectedCallback(_callback) { }
34160
34160
  function declareNotifierTaskSingle(_name) {
@@ -43124,7 +43124,7 @@ function coerceVariableValues(schema, varDefNodes, inputs, onError) {
43124
43124
  return "continue";
43125
43125
  }
43126
43126
 
43127
- if (!hasOwnProperty$3(inputs, varName)) {
43127
+ if (!hasOwnProperty$4(inputs, varName)) {
43128
43128
  if (varDefNode.defaultValue) {
43129
43129
  coercedValues[varName] = valueFromAST(varDefNode.defaultValue, varType);
43130
43130
  } else if (isNonNullType(varType)) {
@@ -43208,7 +43208,7 @@ function getArgumentValues(def, node, variableValues) {
43208
43208
  if (valueNode.kind === Kind$3.VARIABLE) {
43209
43209
  var variableName = valueNode.name.value;
43210
43210
 
43211
- if (variableValues == null || !hasOwnProperty$3(variableValues, variableName)) {
43211
+ if (variableValues == null || !hasOwnProperty$4(variableValues, variableName)) {
43212
43212
  if (argDef.defaultValue !== undefined) {
43213
43213
  coercedValues[name] = argDef.defaultValue;
43214
43214
  } else if (isNonNullType(argType)) {
@@ -43261,7 +43261,7 @@ function getDirectiveValues(directiveDef, node, variableValues) {
43261
43261
  }
43262
43262
  }
43263
43263
 
43264
- function hasOwnProperty$3(obj, prop) {
43264
+ function hasOwnProperty$4(obj, prop) {
43265
43265
  return Object.prototype.hasOwnProperty.call(obj, prop);
43266
43266
  }
43267
43267
 
@@ -45779,7 +45779,7 @@ var useOneStore = {
45779
45779
  * For full license text, see the LICENSE.txt file
45780
45780
  */
45781
45781
  const { create: create$7, freeze: freeze$4, keys: keys$8, entries: entries$6 } = Object;
45782
- const { hasOwnProperty: hasOwnProperty$2 } = Object.prototype;
45782
+ const { hasOwnProperty: hasOwnProperty$3 } = Object.prototype;
45783
45783
  const { isArray: isArray$7 } = Array;
45784
45784
  const { stringify: stringify$9, parse: parse$9 } = JSON;
45785
45785
  let Ok$4 = class Ok {
@@ -49288,7 +49288,7 @@ function buildAdapterValidationConfig$2(displayName, paramsMeta) {
49288
49288
  const keyPrefix$2 = 'UiApi';
49289
49289
 
49290
49290
  const { assign: assign$2, create: create$3$1, entries: entries$3, freeze: freeze$1$1, isFrozen: isFrozen$2, keys: keys$3$1, values: values$1 } = Object;
49291
- const { hasOwnProperty: hasOwnProperty$1 } = Object.prototype;
49291
+ const { hasOwnProperty: hasOwnProperty$2 } = Object.prototype;
49292
49292
  const { split, endsWith } = String.prototype;
49293
49293
  const { from: from$1, isArray: isArray$3$1 } = Array;
49294
49294
  const { concat: concat$2, filter: filter$2, includes: includes$2, push: push$1$1, reduce: reduce$2, shift, slice: slice$1 } = Array.prototype;
@@ -51410,20 +51410,20 @@ function unionFields(fields, optionalFields) {
51410
51410
  return [...fieldsArray, ...optionalFieldsArray];
51411
51411
  }
51412
51412
  function getRecordIdsFromUrlParams(urlParams) {
51413
- if (hasOwnProperty$1.call(urlParams, 'recordId')) {
51413
+ if (hasOwnProperty$2.call(urlParams, 'recordId')) {
51414
51414
  return [urlParams.recordId];
51415
51415
  }
51416
- else if (hasOwnProperty$1.call(urlParams, 'recordIds')) {
51416
+ else if (hasOwnProperty$2.call(urlParams, 'recordIds')) {
51417
51417
  return urlParams.recordIds;
51418
51418
  }
51419
51419
  return [];
51420
51420
  }
51421
51421
  function isSingleBatchRecordRequest(urlParams) {
51422
- return (hasOwnProperty$1.call(urlParams, 'recordIds') &&
51422
+ return (hasOwnProperty$2.call(urlParams, 'recordIds') &&
51423
51423
  urlParams.recordIds.length === 1);
51424
51424
  }
51425
51425
  function isSingleRecordRequest(urlParams) {
51426
- return hasOwnProperty$1.call(urlParams, 'recordId');
51426
+ return hasOwnProperty$2.call(urlParams, 'recordId');
51427
51427
  }
51428
51428
  function isRestrictedPathCondition(existingPath, path) {
51429
51429
  // should not dedupe getRecordUi and getRecord as both of their representation is different
@@ -55946,7 +55946,7 @@ function getLayoutMapAndObjectInfo(recordId, data) {
55946
55946
  // W-12697744 - Return an empty layoutMap if the entity does not have a layout.
55947
55947
  // Temp fix until we can mimic the server behavior for non-layoutable entities.
55948
55948
  let layoutMap = {};
55949
- if (hasOwnProperty$1.call(layouts, apiName)) {
55949
+ if (hasOwnProperty$2.call(layouts, apiName)) {
55950
55950
  layoutMap = layouts[apiName][recordTypeId] || {};
55951
55951
  }
55952
55952
  return {
@@ -95994,7 +95994,7 @@ function buildServiceDescriptor$5(luvio) {
95994
95994
  },
95995
95995
  };
95996
95996
  }
95997
- // version: 1.380.0-dev8-60930b5790
95997
+ // version: 1.380.0-dev9-476a6580cf
95998
95998
 
95999
95999
  /**
96000
96000
  * Copyright (c) 2022, Salesforce, Inc.,
@@ -96020,7 +96020,7 @@ function buildServiceDescriptor$4(notifyRecordUpdateAvailable, getNormalizedLuvi
96020
96020
  },
96021
96021
  };
96022
96022
  }
96023
- // version: 1.380.0-dev8-60930b5790
96023
+ // version: 1.380.0-dev9-476a6580cf
96024
96024
 
96025
96025
  /*!
96026
96026
  * Copyright (c) 2022, Salesforce, Inc.,
@@ -98168,7 +98168,7 @@ register$1({
98168
98168
  id: '@salesforce/lds-network-adapter',
98169
98169
  instrument: instrument$2,
98170
98170
  });
98171
- // version: 1.380.0-dev8-c2a0c4e2de
98171
+ // version: 1.380.0-dev9-0a2876c461
98172
98172
 
98173
98173
  const { create: create$3, keys: keys$3 } = Object;
98174
98174
  const { stringify: stringify$1, parse } = JSON;
@@ -99057,7 +99057,7 @@ function validateExpectedType(value, expectedType) {
99057
99057
  function deepMerge$2(target, ...sources) {
99058
99058
  for (const source of sources) {
99059
99059
  for (const key in source) {
99060
- if (hasOwnProperty$2.call(source, key)) {
99060
+ if (hasOwnProperty$3.call(source, key)) {
99061
99061
  const targetValue = target[key];
99062
99062
  const sourceValue = source[key];
99063
99063
  if (Array.isArray(targetValue) && Array.isArray(sourceValue)) {
@@ -100822,6 +100822,94 @@ class GraphQLCommandWireAdapterConstructor extends CommandWireAdapterConstructor
100822
100822
  this.invokeAdapter();
100823
100823
  }
100824
100824
  }
100825
+ function buildAsyncGraphQLImperativeInvoker(getCommand, exposeRefresh = false) {
100826
+ return async (...params) => {
100827
+ try {
100828
+ if (params.length) {
100829
+ params[0] = wrapConfigAndVerify(params[0]);
100830
+ }
100831
+ const command = getCommand({ params, assertIsValid });
100832
+ const result = await command.execute();
100833
+ const consumerEmittedData = {
100834
+ data: void 0,
100835
+ errors: void 0
100836
+ };
100837
+ if (result.isOk()) {
100838
+ deepFreeze(result.value);
100839
+ consumerEmittedData.data = result.value.data.data;
100840
+ consumerEmittedData.subscribe = (cb) => {
100841
+ result.value.subscribe((res) => {
100842
+ const consumerEmittedData2 = {
100843
+ data: void 0,
100844
+ errors: void 0
100845
+ };
100846
+ if (res.isOk()) {
100847
+ consumerEmittedData2.data = res.value.data;
100848
+ } else {
100849
+ if (isUserVisibleError(res.error)) {
100850
+ consumerEmittedData2.data = res.error.data.data;
100851
+ consumerEmittedData2.errors = res.error.data.errors;
100852
+ } else {
100853
+ logError(res.error);
100854
+ consumerEmittedData2.errors = [
100855
+ {
100856
+ message: "Internal error in GraphQL adapter occurred",
100857
+ locations: []
100858
+ }
100859
+ ];
100860
+ }
100861
+ }
100862
+ cb(consumerEmittedData2);
100863
+ });
100864
+ };
100865
+ if (exposeRefresh) {
100866
+ consumerEmittedData.refresh = () => {
100867
+ return new Promise((resolve, reject) => {
100868
+ try {
100869
+ result.value.refresh().then((res) => {
100870
+ if (res.isOk()) {
100871
+ resolve();
100872
+ } else {
100873
+ reject(
100874
+ new Error(
100875
+ "Internal error in GraphQL adapter occurred: Failed to refresh GraphQL data"
100876
+ )
100877
+ );
100878
+ }
100879
+ });
100880
+ } catch (error) {
100881
+ logError(error);
100882
+ reject(
100883
+ new Error(
100884
+ "Internal error in GraphQL adapter occurred: Failed to refresh GraphQL data"
100885
+ )
100886
+ );
100887
+ }
100888
+ });
100889
+ };
100890
+ }
100891
+ } else {
100892
+ const failure = result.error.failure;
100893
+ if (isUserVisibleError(failure)) {
100894
+ consumerEmittedData.data = failure.data.data;
100895
+ consumerEmittedData.errors = failure.data.errors;
100896
+ } else {
100897
+ logError(failure);
100898
+ consumerEmittedData.errors = [
100899
+ { message: "Internal error in GraphQL adapter occurred", locations: [] }
100900
+ ];
100901
+ }
100902
+ }
100903
+ return consumerEmittedData;
100904
+ } catch (error) {
100905
+ logError(error);
100906
+ return {
100907
+ data: void 0,
100908
+ errors: [{ message: "Internal error in GraphQL adapter occurred", locations: [] }]
100909
+ };
100910
+ }
100911
+ };
100912
+ }
100825
100913
  function buildAsyncGraphQLImperativeLegacyInvoker(getCommand) {
100826
100914
  const invoke = async (config, requestContext, callback) => {
100827
100915
  config = wrapConfigAndVerify(config);
@@ -100927,7 +101015,7 @@ function handleEmit(res, callback) {
100927
101015
  }
100928
101016
  callback(consumerEmittedData);
100929
101017
  }
100930
- // version: 1.380.0-dev8-60930b5790
101018
+ // version: 1.380.0-dev9-476a6580cf
100931
101019
 
100932
101020
  class Analytics__AnalyticsBrowseRepository extends UnidentifiableGraphQLTypeRepository {
100933
101021
  constructor(services, typeRegistry) {
@@ -103584,6 +103672,7 @@ class GraphQLTypeRegistry {
103584
103672
  * All rights reserved.
103585
103673
  * For full license text, see the LICENSE.txt file
103586
103674
  */
103675
+ const { hasOwnProperty: hasOwnProperty$1 } = Object.prototype;
103587
103676
  class Ok {
103588
103677
  constructor(value) {
103589
103678
  this.value = value;
@@ -104009,18 +104098,133 @@ class RecordQueryAggregateRepository extends RecordQueryAggregateRepository$1 {
104009
104098
  }
104010
104099
  }
104011
104100
 
104012
- // This should be smarter, and filter on selections, but for now,
104013
- // we'll match the luvio behavior of returning the blob
104014
- const blobTypeDef = {
104015
- read: (_cache, input) => {
104016
- return ok(input.normalizedData);
104017
- },
104018
- write: (_cache, input) => {
104019
- return ok(input.data);
104020
- },
104021
- buildFieldKey: (selection, variables) => buildFieldKey(selection.name.value, selection.arguments, variables),
104022
- augmentSelections: (input) => input,
104023
- };
104101
+ class BlobObjectRepository extends UnidentifiableGraphQLTypeRepository {
104102
+ constructor() {
104103
+ super(...arguments);
104104
+ this.namespace = 'uiapi';
104105
+ this.typeName = 'Blob';
104106
+ this.fields = {};
104107
+ this.implementedInterfaces = [];
104108
+ }
104109
+ normalizeFragment(_cache, _input, _fragment, errorCollector) {
104110
+ errorCollector.push({
104111
+ type: 'unknown',
104112
+ error: new Error('Fragments are not supported for Blob fields'),
104113
+ });
104114
+ return {};
104115
+ }
104116
+ denormalizeFragment(_cache, _input, _fragment, errorCollector) {
104117
+ errorCollector.push({
104118
+ type: 'unknown',
104119
+ error: new Error('Fragments are not supported for Blob fields'),
104120
+ });
104121
+ return {};
104122
+ }
104123
+ getFieldDef(_input, _selection) {
104124
+ return new BlobFieldDef({});
104125
+ }
104126
+ }
104127
+ class BlobFieldDef {
104128
+ constructor(services) {
104129
+ this.objectRepository = new BlobObjectRepository(services);
104130
+ }
104131
+ read(cache, input) {
104132
+ const errors = [];
104133
+ if (input.normalizedData.type === 'array') {
104134
+ const data = input.normalizedData.data.map((item) => {
104135
+ const result = this.read(cache, { ...input, normalizedData: item });
104136
+ if (result.isErr()) {
104137
+ errors.push(...result.error);
104138
+ return undefined;
104139
+ }
104140
+ return result.value;
104141
+ });
104142
+ if (errors.length > 0) {
104143
+ return err(errors);
104144
+ }
104145
+ return ok(data);
104146
+ }
104147
+ else if (input.normalizedData.type === 'object') {
104148
+ const selections = input.selection.selectionSet?.selections;
104149
+ if (!selections) {
104150
+ return err([
104151
+ {
104152
+ type: 'unknown',
104153
+ error: new Error('Object data must have a selection set'),
104154
+ },
104155
+ ]);
104156
+ }
104157
+ const result = this.objectRepository.read(cache, {
104158
+ ...input,
104159
+ normalizedData: input.normalizedData.data,
104160
+ selections,
104161
+ request: input.request,
104162
+ });
104163
+ if (result.isErr()) {
104164
+ return err(result.error);
104165
+ }
104166
+ return ok(result.value);
104167
+ }
104168
+ else {
104169
+ return ok(input.normalizedData.data);
104170
+ }
104171
+ }
104172
+ write(cache, input) {
104173
+ if (Array.isArray(input.data)) {
104174
+ const errors = [];
104175
+ const result = {
104176
+ type: 'array',
104177
+ data: input.data.map((item) => {
104178
+ const result = this.write(cache, { ...input, data: item });
104179
+ if (result.isErr()) {
104180
+ errors.push(...result.error);
104181
+ return undefined;
104182
+ }
104183
+ return result.value;
104184
+ }),
104185
+ };
104186
+ if (errors.length > 0) {
104187
+ return err(errors);
104188
+ }
104189
+ return ok(result);
104190
+ }
104191
+ else if (typeof input.data === 'object' && input.data !== null) {
104192
+ const selections = input.selection.selectionSet?.selections;
104193
+ if (!selections) {
104194
+ return err([
104195
+ {
104196
+ type: 'unknown',
104197
+ error: new Error('Object data must have a selection set'),
104198
+ },
104199
+ ]);
104200
+ }
104201
+ const result = this.objectRepository.write(cache, {
104202
+ ...input,
104203
+ selections,
104204
+ request: input.request,
104205
+ });
104206
+ if (result.isErr()) {
104207
+ return err(result.error);
104208
+ }
104209
+ return ok({
104210
+ type: 'object',
104211
+ data: result.value,
104212
+ });
104213
+ }
104214
+ else {
104215
+ return ok({
104216
+ type: 'scalar',
104217
+ data: input.data,
104218
+ });
104219
+ }
104220
+ }
104221
+ buildFieldKey(selection, variables) {
104222
+ return buildFieldKey(selection.name.value, selection.arguments, variables);
104223
+ }
104224
+ augmentSelections(input) {
104225
+ return input;
104226
+ }
104227
+ }
104024
104228
 
104025
104229
  // The generated repository is identifiable, since setup data isn't cached,
104026
104230
  // there's no need for an identifiable repository
@@ -104076,7 +104280,7 @@ class SetupEntityRepresentationRepository extends UnidentifiableGraphQLTypeRepos
104076
104280
  return super.getFieldDef(input, selection);
104077
104281
  }
104078
104282
  // We should make this smarter, storing and returning blobs isn't great since it could, and likely will, include unrequested field data
104079
- return blobTypeDef;
104283
+ return new BlobFieldDef(this.services);
104080
104284
  }
104081
104285
  satisfiesFragmentTypeCondition(input, fragment) {
104082
104286
  return genericSatisfiesFragmentTypeCondition(super.satisfiesFragmentTypeCondition.bind(this), input, fragment, this.typeName);
@@ -104116,7 +104320,7 @@ class SetupRecordAggregateRepository extends Setup__SetupRecordAggregateReposito
104116
104320
  if (staticFields.includes(selection.name.value)) {
104117
104321
  return super.getFieldDef(input, selection);
104118
104322
  }
104119
- return blobTypeDef;
104323
+ return new BlobFieldDef(this.services);
104120
104324
  }
104121
104325
  satisfiesFragmentTypeCondition(_input, fragment) {
104122
104326
  return genericSatisfiesFragmentTypeCondition(super.satisfiesFragmentTypeCondition.bind(this), _input, fragment, this.typeName);
@@ -104638,8 +104842,56 @@ function buildCommandClass(baseClass) {
104638
104842
  };
104639
104843
  }
104640
104844
 
104845
+ function validateNonQueryGraphQLConfig(config) {
104846
+ if (config !== null && typeof config === 'object') {
104847
+ if (hasOwnProperty$1.call(config, 'operationName') &&
104848
+ config.operationName === undefined) {
104849
+ return err('operationName is undefined');
104850
+ }
104851
+ if (hasOwnProperty$1.call(config, 'variables') &&
104852
+ config.variables === undefined) {
104853
+ return err('variables is undefined');
104854
+ }
104855
+ return ok(config);
104856
+ }
104857
+ return err('config is not an object');
104858
+ }
104859
+
104860
+ class GraphQLCommandWireAdapterConstructorV1Import extends GraphQLCommandWireAdapterConstructor {
104861
+ update(config, _context) {
104862
+ const validatedConfig = validateNonQueryGraphQLConfig(config);
104863
+ if (validatedConfig.isErr()) {
104864
+ // config is incomplete, delay execution
104865
+ return;
104866
+ }
104867
+ super.update(validatedConfig.value, _context);
104868
+ }
104869
+ }
104870
+
104871
+ function buildAsyncGraphQLImperativeLegacyInvokerV1Import(getCommand) {
104872
+ const { invoke: invokeOriginal, subscribe: subscribeOriginal } = buildAsyncGraphQLImperativeLegacyInvoker(getCommand);
104873
+ const invoke = async (config, requestContext, callback) => {
104874
+ const validatedConfig = validateNonQueryGraphQLConfig(config);
104875
+ if (validatedConfig.isErr()) {
104876
+ throw new Error(`Invalid configuration passed to GraphQL: ${validatedConfig.error}`);
104877
+ }
104878
+ return invokeOriginal(validatedConfig.value, requestContext, callback);
104879
+ };
104880
+ const subscribe = (config, requestContext, callback) => {
104881
+ const validatedConfig = validateNonQueryGraphQLConfig(config);
104882
+ if (validatedConfig.isErr()) {
104883
+ throw new Error(`Invalid configuration passed to GraphQL: ${validatedConfig.error}`);
104884
+ }
104885
+ return subscribeOriginal(validatedConfig.value, requestContext, callback);
104886
+ };
104887
+ return { invoke, subscribe };
104888
+ }
104889
+
104641
104890
  let graphql$1;
104891
+ let graphql_v1_import;
104642
104892
  let graphql_imperative$1;
104893
+ let graphql_imperative_legacy;
104894
+ let graphql_imperative_legacy_v1_import;
104643
104895
  let useOneStoreGraphQL = false;
104644
104896
  const serviceRequirements = {
104645
104897
  instrumentCommand: {
@@ -104702,15 +104954,37 @@ getServices(serviceRequirements).then((services) => {
104702
104954
  return new graphql_ctor(this.config, documentRootType, services);
104703
104955
  }
104704
104956
  };
104957
+ graphql_v1_import = class extends GraphQLCommandWireAdapterConstructorV1Import {
104958
+ constructor() {
104959
+ super(...arguments);
104960
+ this.configSchema = CONFIG_SCHEMA;
104961
+ this.exposeRefresh = true;
104962
+ }
104963
+ getCommand() {
104964
+ return new graphql_ctor(this.config, documentRootType, services);
104965
+ }
104966
+ };
104705
104967
  const graphql_imperative_ctor = services.instrumentCommand(buildCommandClass(services.auraGraphQLNormalizedCacheControlCommand), 'graphql_imperative');
104706
- graphql_imperative$1 = buildAsyncGraphQLImperativeLegacyInvoker(({ config, assertIsValid }) => {
104968
+ graphql_imperative$1 = buildAsyncGraphQLImperativeInvoker(({ params, assertIsValid }) => {
104969
+ const config = params[0];
104970
+ const _ = assertIsValid;
104971
+ _(config, CONFIG_SCHEMA);
104972
+ return new graphql_imperative_ctor(config, documentRootType, services);
104973
+ }, true);
104974
+ graphql_imperative_legacy = buildAsyncGraphQLImperativeLegacyInvoker(({ config, assertIsValid }) => {
104707
104975
  const _ = assertIsValid;
104708
104976
  _(config, CONFIG_SCHEMA);
104709
104977
  return new graphql_imperative_ctor(config, documentRootType, services);
104710
104978
  });
104979
+ graphql_imperative_legacy_v1_import =
104980
+ buildAsyncGraphQLImperativeLegacyInvokerV1Import(({ config, assertIsValid }) => {
104981
+ const _ = assertIsValid;
104982
+ _(config, CONFIG_SCHEMA);
104983
+ return new graphql_imperative_ctor(config, documentRootType, services);
104984
+ });
104711
104985
  useOneStoreGraphQL = services.featureFlags?.get('useOneStoreGraphQL') ?? false;
104712
104986
  if (provisionedCallback) {
104713
- provisionedCallback(graphql$1, graphql_imperative$1, useOneStoreGraphQL);
104987
+ provisionedCallback(graphql$1, graphql_imperative$1, graphql_imperative_legacy, useOneStoreGraphQL);
104714
104988
  }
104715
104989
  }, (_err) => { });
104716
104990
  function registerCallback(cb) {
@@ -104718,10 +104992,10 @@ function registerCallback(cb) {
104718
104992
  provisionedCallback = cb;
104719
104993
  }
104720
104994
  else {
104721
- cb(graphql$1, graphql_imperative$1, useOneStoreGraphQL);
104995
+ cb(graphql_v1_import, graphql_imperative$1, graphql_imperative_legacy_v1_import, useOneStoreGraphQL);
104722
104996
  }
104723
104997
  }
104724
- // version: 1.380.0-dev8-60930b5790
104998
+ // version: 1.380.0-dev9-476a6580cf
104725
104999
 
104726
105000
  function createFragmentMap(documentNode) {
104727
105001
  const fragments = {};
@@ -130837,6 +131111,7 @@ function buildCachedSnapshotCachePolicy(context, storeLookup) {
130837
131111
  return cacheSnapshot;
130838
131112
  }
130839
131113
 
131114
+ // Wire Adapters
130840
131115
  let graphql;
130841
131116
  let graphqlBatch;
130842
131117
  // Imperative GET Adapters
@@ -130863,10 +131138,10 @@ withDefaultLuvio((luvio) => {
130863
131138
  ({ graphql, graphqlBatch, graphql_imperative, graphqlBatch_imperative } = bindExportsTo(luvio));
130864
131139
  // We register the callback here rather than above withDefaultLuvio because we want environments
130865
131140
  // that don't have onestore bootstrapped with the required services to default to the luvio versions of the adapters
130866
- registerCallback((oneStoreGraphql, oneStoreGraphql_imperative, useOneStoreGraphQL) => {
131141
+ registerCallback((oneStoreGraphql, oneStoreGraphql_imperative, oneStoreGraphql_imperative_legacy, useOneStoreGraphQL) => {
130867
131142
  if (useOneStoreGraphQL) {
130868
131143
  graphql = oneStoreGraphql;
130869
- graphql_imperative = oneStoreGraphql_imperative;
131144
+ graphql_imperative = oneStoreGraphql_imperative_legacy;
130870
131145
  }
130871
131146
  });
130872
131147
  });
@@ -131380,7 +131655,7 @@ function refreshGraphQL(data) {
131380
131655
  }
131381
131656
  return refresh$3(data, 'refreshUiApi');
131382
131657
  }
131383
- // version: 1.380.0-dev8-60930b5790
131658
+ // version: 1.380.0-dev9-476a6580cf
131384
131659
 
131385
131660
  // On core the unstable adapters are re-exported with different names,
131386
131661
  // we want to match them here.
@@ -131532,7 +131807,7 @@ withDefaultLuvio((luvio) => {
131532
131807
  unstable_graphQL_imperative = createImperativeAdapter(luvio, createInstrumentedAdapter(ldsAdapter, adapterMetadata), adapterMetadata);
131533
131808
  graphQLImperative = ldsAdapter;
131534
131809
  });
131535
- // version: 1.380.0-dev8-60930b5790
131810
+ // version: 1.380.0-dev9-476a6580cf
131536
131811
 
131537
131812
  var gqlApi = /*#__PURE__*/Object.freeze({
131538
131813
  __proto__: null,
@@ -132331,7 +132606,7 @@ const callbacks$1 = [];
132331
132606
  function register(r) {
132332
132607
  callbacks$1.forEach((callback) => callback(r));
132333
132608
  }
132334
- // version: 1.380.0-dev8-c2a0c4e2de
132609
+ // version: 1.380.0-dev9-0a2876c461
132335
132610
 
132336
132611
  /**
132337
132612
  * Copyright (c) 2022, Salesforce, Inc.,
@@ -133647,4 +133922,4 @@ const { luvio } = getRuntime();
133647
133922
  setDefaultLuvio({ luvio });
133648
133923
 
133649
133924
  export { createPrimingSession, draftManager, draftQueue, evictCacheRecordsByIds, evictExpiredCacheEntries, executeAdapter, executeMutatingAdapter, getImperativeAdapterNames, importLuvioAdapterModule, importOneStoreAdapterModule, invokeAdapter, invokeAdapterWithDraftToMerge, invokeAdapterWithDraftToReplace, invokeAdapterWithMetadata, nimbusDraftQueue, registerReportObserver, setMetadataTTL, setUiApiRecordTTL, stopEviction, subscribeToAdapter };
133650
- // version: 1.380.0-dev8-c2a0c4e2de
133925
+ // version: 1.380.0-dev9-0a2876c461