@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.
@@ -27,7 +27,7 @@
27
27
  })(SnapshotState$3 || (SnapshotState$3 = {}));
28
28
 
29
29
  const { create: create$b, entries: entries$7, freeze: freeze$7, keys: keys$b, values: values$3, assign: assign$8 } = Object;
30
- const { hasOwnProperty: hasOwnProperty$5 } = Object.prototype;
30
+ const { hasOwnProperty: hasOwnProperty$6 } = Object.prototype;
31
31
  const { isArray: isArray$a } = Array;
32
32
  const { push: push$5, indexOf, slice: slice$2 } = Array.prototype;
33
33
  const { parse: parse$c, stringify: stringify$c } = JSON;
@@ -629,9 +629,9 @@
629
629
  readMetadataWhere(query) {
630
630
  const keys$1 = keys$b(this.metadata);
631
631
  const results = [];
632
- const hasNamespaceQuery = hasOwnProperty$5.call(query, 'namespace');
633
- const hasRepresentationNameQuery = hasOwnProperty$5.call(query, 'representationName');
634
- const hasTtlOverrideQuery = hasOwnProperty$5.call(query, 'ttlOverride');
632
+ const hasNamespaceQuery = hasOwnProperty$6.call(query, 'namespace');
633
+ const hasRepresentationNameQuery = hasOwnProperty$6.call(query, 'representationName');
634
+ const hasTtlOverrideQuery = hasOwnProperty$6.call(query, 'ttlOverride');
635
635
  for (let i = 0, length = keys$1.length; i < length; i++) {
636
636
  const key = keys$1[i];
637
637
  const storeMetadata = this.metadata[key];
@@ -655,7 +655,7 @@
655
655
  put(recordId, record) {
656
656
  const { records, insertedIds, pendingTrimKeys, retainedIds } = this;
657
657
  const canonicalKey = this.getCanonicalRecordId(recordId);
658
- if (hasOwnProperty$5.call(records, canonicalKey) === false) {
658
+ if (hasOwnProperty$6.call(records, canonicalKey) === false) {
659
659
  insertedIds[canonicalKey] = true;
660
660
  }
661
661
  records[canonicalKey] = record;
@@ -1330,9 +1330,9 @@
1330
1330
  return this.fallbackStringKeyInMemoryStore.readMetadataWhere(query);
1331
1331
  }
1332
1332
  const results = [];
1333
- const hasNamespaceQuery = hasOwnProperty$5.call(query, 'namespace');
1334
- const hasRepresentationNameQuery = hasOwnProperty$5.call(query, 'representationName');
1335
- const hasTtlOverrideQuery = hasOwnProperty$5.call(query, 'ttlOverride');
1333
+ const hasNamespaceQuery = hasOwnProperty$6.call(query, 'namespace');
1334
+ const hasRepresentationNameQuery = hasOwnProperty$6.call(query, 'representationName');
1335
+ const hasTtlOverrideQuery = hasOwnProperty$6.call(query, 'ttlOverride');
1336
1336
  for (let i = 0, length = keys.length; i < length; i++) {
1337
1337
  const key = keys[i];
1338
1338
  const storeMetadata = this.metadataMap.get(key);
@@ -2171,8 +2171,8 @@
2171
2171
  function isNodeLink(node) {
2172
2172
  return (typeof node === 'object' &&
2173
2173
  node !== null &&
2174
- (hasOwnProperty$5.call(node, '__ref') ||
2175
- hasOwnProperty$5.call(node, 'isMissing')));
2174
+ (hasOwnProperty$6.call(node, '__ref') ||
2175
+ hasOwnProperty$6.call(node, 'isMissing')));
2176
2176
  }
2177
2177
  function isGraphNode$2(node) {
2178
2178
  return node !== null && node.type === GraphNodeType$1.Node;
@@ -2317,7 +2317,7 @@
2317
2317
  }
2318
2318
  var values = [];
2319
2319
  for (var _argName in argValues) {
2320
- if (hasOwnProperty$5.call(argValues, _argName)) {
2320
+ if (hasOwnProperty$6.call(argValues, _argName)) {
2321
2321
  var value = argValues[_argName];
2322
2322
  if (value !== null || value !== undefined) {
2323
2323
  values.push(_argName + ':' + stringify$c(value));
@@ -2657,7 +2657,7 @@
2657
2657
  data[key] = items;
2658
2658
  }
2659
2659
  else {
2660
- if (hasOwnProperty$5.call(visitedKeys, nextRecordId) === true) {
2660
+ if (hasOwnProperty$6.call(visitedKeys, nextRecordId) === true) {
2661
2661
  throw new Error(`Invalid eager selection on records with circular references.`);
2662
2662
  }
2663
2663
  const lookupResult = this.resolveKey(nextRecordId);
@@ -3139,7 +3139,7 @@
3139
3139
  }
3140
3140
  }
3141
3141
  readScalar(propertyName, record, data, required) {
3142
- if (!hasOwnProperty$5.call(record, propertyName)) {
3142
+ if (!hasOwnProperty$6.call(record, propertyName)) {
3143
3143
  if (required !== false) {
3144
3144
  this.markMissing();
3145
3145
  return;
@@ -4280,7 +4280,7 @@
4280
4280
  }
4281
4281
  callbacks.push(callback);
4282
4282
  }
4283
- // version: 1.380.0-dev8-c2a0c4e2de
4283
+ // version: 1.380.0-dev9-0a2876c461
4284
4284
 
4285
4285
  // TODO [TD-0081508]: once that TD is fulfilled we can probably change this file
4286
4286
  function instrumentAdapter$1(createFunction, _metadata) {
@@ -5324,7 +5324,7 @@
5324
5324
  const { apiFamily, name } = metadata;
5325
5325
  return createGraphQLWireAdapterConstructor$1(adapter, `${apiFamily}.${name}`, luvio, astResolver);
5326
5326
  }
5327
- // version: 1.380.0-dev8-c2a0c4e2de
5327
+ // version: 1.380.0-dev9-0a2876c461
5328
5328
 
5329
5329
  /**
5330
5330
  * Copyright (c) 2022, Salesforce, Inc.,
@@ -6145,7 +6145,7 @@
6145
6145
  const keyPrefix$3 = 'UiApi';
6146
6146
 
6147
6147
  const { assign: assign$6, create: create$8, freeze: freeze$5, isFrozen: isFrozen$3, keys: keys$9 } = Object;
6148
- const { hasOwnProperty: hasOwnProperty$4 } = Object.prototype;
6148
+ const { hasOwnProperty: hasOwnProperty$5 } = Object.prototype;
6149
6149
  const { split: split$1, endsWith: endsWith$1 } = String.prototype;
6150
6150
  const { isArray: isArray$8 } = Array;
6151
6151
  const { concat: concat$3, filter: filter$3, includes: includes$3, push: push$4, reduce: reduce$3 } = Array.prototype;
@@ -9358,7 +9358,7 @@
9358
9358
  }
9359
9359
  // Stop the traversal if the key has already been visited, since the fields for this record
9360
9360
  // have already been gathered at this point.
9361
- if (hasOwnProperty$4.call(visitedRecordIds, recordId)) {
9361
+ if (hasOwnProperty$5.call(visitedRecordIds, recordId)) {
9362
9362
  return;
9363
9363
  }
9364
9364
  // The visitedRecordIds object passed to the spanning record is a copy of the original
@@ -10164,20 +10164,20 @@
10164
10164
  return [...fieldsArray, ...optionalFieldsArray];
10165
10165
  }
10166
10166
  function getRecordIdsFromUrlParams$1(urlParams) {
10167
- if (hasOwnProperty$4.call(urlParams, 'recordId')) {
10167
+ if (hasOwnProperty$5.call(urlParams, 'recordId')) {
10168
10168
  return [urlParams.recordId];
10169
10169
  }
10170
- else if (hasOwnProperty$4.call(urlParams, 'recordIds')) {
10170
+ else if (hasOwnProperty$5.call(urlParams, 'recordIds')) {
10171
10171
  return urlParams.recordIds;
10172
10172
  }
10173
10173
  return [];
10174
10174
  }
10175
10175
  function isSingleBatchRecordRequest$1(urlParams) {
10176
- return (hasOwnProperty$4.call(urlParams, 'recordIds') &&
10176
+ return (hasOwnProperty$5.call(urlParams, 'recordIds') &&
10177
10177
  urlParams.recordIds.length === 1);
10178
10178
  }
10179
10179
  function isSingleRecordRequest$1(urlParams) {
10180
- return hasOwnProperty$4.call(urlParams, 'recordId');
10180
+ return hasOwnProperty$5.call(urlParams, 'recordId');
10181
10181
  }
10182
10182
  function isRestrictedPathCondition$1(existingPath, path) {
10183
10183
  // should not dedupe getRecordUi and getRecord as both of their representation is different
@@ -15127,7 +15127,7 @@
15127
15127
  // W-12697744 - Return an empty layoutMap if the entity does not have a layout.
15128
15128
  // Temp fix until we can mimic the server behavior for non-layoutable entities.
15129
15129
  let layoutMap = {};
15130
- if (hasOwnProperty$4.call(layouts, apiName)) {
15130
+ if (hasOwnProperty$5.call(layouts, apiName)) {
15131
15131
  layoutMap = layouts[apiName][recordTypeId] || {};
15132
15132
  }
15133
15133
  return {
@@ -34160,7 +34160,7 @@
34160
34160
  throttle(60, 60000, setupNotifyAllListRecordUpdateAvailable(luvio));
34161
34161
  throttle(60, 60000, setupNotifyAllListInfoSummaryUpdateAvailable(luvio));
34162
34162
  });
34163
- // version: 1.380.0-dev8-60930b5790
34163
+ // version: 1.380.0-dev9-476a6580cf
34164
34164
 
34165
34165
  function requestIdleDetectedCallback(_callback) { }
34166
34166
  function declareNotifierTaskSingle(_name) {
@@ -43130,7 +43130,7 @@
43130
43130
  return "continue";
43131
43131
  }
43132
43132
 
43133
- if (!hasOwnProperty$3(inputs, varName)) {
43133
+ if (!hasOwnProperty$4(inputs, varName)) {
43134
43134
  if (varDefNode.defaultValue) {
43135
43135
  coercedValues[varName] = valueFromAST(varDefNode.defaultValue, varType);
43136
43136
  } else if (isNonNullType(varType)) {
@@ -43214,7 +43214,7 @@
43214
43214
  if (valueNode.kind === Kind$3.VARIABLE) {
43215
43215
  var variableName = valueNode.name.value;
43216
43216
 
43217
- if (variableValues == null || !hasOwnProperty$3(variableValues, variableName)) {
43217
+ if (variableValues == null || !hasOwnProperty$4(variableValues, variableName)) {
43218
43218
  if (argDef.defaultValue !== undefined) {
43219
43219
  coercedValues[name] = argDef.defaultValue;
43220
43220
  } else if (isNonNullType(argType)) {
@@ -43267,7 +43267,7 @@
43267
43267
  }
43268
43268
  }
43269
43269
 
43270
- function hasOwnProperty$3(obj, prop) {
43270
+ function hasOwnProperty$4(obj, prop) {
43271
43271
  return Object.prototype.hasOwnProperty.call(obj, prop);
43272
43272
  }
43273
43273
 
@@ -45785,7 +45785,7 @@
45785
45785
  * For full license text, see the LICENSE.txt file
45786
45786
  */
45787
45787
  const { create: create$7, freeze: freeze$4, keys: keys$8, entries: entries$6 } = Object;
45788
- const { hasOwnProperty: hasOwnProperty$2 } = Object.prototype;
45788
+ const { hasOwnProperty: hasOwnProperty$3 } = Object.prototype;
45789
45789
  const { isArray: isArray$7 } = Array;
45790
45790
  const { stringify: stringify$9, parse: parse$9 } = JSON;
45791
45791
  let Ok$4 = class Ok {
@@ -49294,7 +49294,7 @@
49294
49294
  const keyPrefix$2 = 'UiApi';
49295
49295
 
49296
49296
  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;
49297
- const { hasOwnProperty: hasOwnProperty$1 } = Object.prototype;
49297
+ const { hasOwnProperty: hasOwnProperty$2 } = Object.prototype;
49298
49298
  const { split, endsWith } = String.prototype;
49299
49299
  const { from: from$1, isArray: isArray$3$1 } = Array;
49300
49300
  const { concat: concat$2, filter: filter$2, includes: includes$2, push: push$1$1, reduce: reduce$2, shift, slice: slice$1 } = Array.prototype;
@@ -51416,20 +51416,20 @@
51416
51416
  return [...fieldsArray, ...optionalFieldsArray];
51417
51417
  }
51418
51418
  function getRecordIdsFromUrlParams(urlParams) {
51419
- if (hasOwnProperty$1.call(urlParams, 'recordId')) {
51419
+ if (hasOwnProperty$2.call(urlParams, 'recordId')) {
51420
51420
  return [urlParams.recordId];
51421
51421
  }
51422
- else if (hasOwnProperty$1.call(urlParams, 'recordIds')) {
51422
+ else if (hasOwnProperty$2.call(urlParams, 'recordIds')) {
51423
51423
  return urlParams.recordIds;
51424
51424
  }
51425
51425
  return [];
51426
51426
  }
51427
51427
  function isSingleBatchRecordRequest(urlParams) {
51428
- return (hasOwnProperty$1.call(urlParams, 'recordIds') &&
51428
+ return (hasOwnProperty$2.call(urlParams, 'recordIds') &&
51429
51429
  urlParams.recordIds.length === 1);
51430
51430
  }
51431
51431
  function isSingleRecordRequest(urlParams) {
51432
- return hasOwnProperty$1.call(urlParams, 'recordId');
51432
+ return hasOwnProperty$2.call(urlParams, 'recordId');
51433
51433
  }
51434
51434
  function isRestrictedPathCondition(existingPath, path) {
51435
51435
  // should not dedupe getRecordUi and getRecord as both of their representation is different
@@ -55952,7 +55952,7 @@
55952
55952
  // W-12697744 - Return an empty layoutMap if the entity does not have a layout.
55953
55953
  // Temp fix until we can mimic the server behavior for non-layoutable entities.
55954
55954
  let layoutMap = {};
55955
- if (hasOwnProperty$1.call(layouts, apiName)) {
55955
+ if (hasOwnProperty$2.call(layouts, apiName)) {
55956
55956
  layoutMap = layouts[apiName][recordTypeId] || {};
55957
55957
  }
55958
55958
  return {
@@ -96000,7 +96000,7 @@
96000
96000
  },
96001
96001
  };
96002
96002
  }
96003
- // version: 1.380.0-dev8-60930b5790
96003
+ // version: 1.380.0-dev9-476a6580cf
96004
96004
 
96005
96005
  /**
96006
96006
  * Copyright (c) 2022, Salesforce, Inc.,
@@ -96026,7 +96026,7 @@
96026
96026
  },
96027
96027
  };
96028
96028
  }
96029
- // version: 1.380.0-dev8-60930b5790
96029
+ // version: 1.380.0-dev9-476a6580cf
96030
96030
 
96031
96031
  /*!
96032
96032
  * Copyright (c) 2022, Salesforce, Inc.,
@@ -98174,7 +98174,7 @@
98174
98174
  id: '@salesforce/lds-network-adapter',
98175
98175
  instrument: instrument$2,
98176
98176
  });
98177
- // version: 1.380.0-dev8-c2a0c4e2de
98177
+ // version: 1.380.0-dev9-0a2876c461
98178
98178
 
98179
98179
  const { create: create$3, keys: keys$3 } = Object;
98180
98180
  const { stringify: stringify$1, parse } = JSON;
@@ -99063,7 +99063,7 @@
99063
99063
  function deepMerge$2(target, ...sources) {
99064
99064
  for (const source of sources) {
99065
99065
  for (const key in source) {
99066
- if (hasOwnProperty$2.call(source, key)) {
99066
+ if (hasOwnProperty$3.call(source, key)) {
99067
99067
  const targetValue = target[key];
99068
99068
  const sourceValue = source[key];
99069
99069
  if (Array.isArray(targetValue) && Array.isArray(sourceValue)) {
@@ -100828,6 +100828,94 @@
100828
100828
  this.invokeAdapter();
100829
100829
  }
100830
100830
  }
100831
+ function buildAsyncGraphQLImperativeInvoker(getCommand, exposeRefresh = false) {
100832
+ return async (...params) => {
100833
+ try {
100834
+ if (params.length) {
100835
+ params[0] = wrapConfigAndVerify(params[0]);
100836
+ }
100837
+ const command = getCommand({ params, assertIsValid });
100838
+ const result = await command.execute();
100839
+ const consumerEmittedData = {
100840
+ data: void 0,
100841
+ errors: void 0
100842
+ };
100843
+ if (result.isOk()) {
100844
+ deepFreeze(result.value);
100845
+ consumerEmittedData.data = result.value.data.data;
100846
+ consumerEmittedData.subscribe = (cb) => {
100847
+ result.value.subscribe((res) => {
100848
+ const consumerEmittedData2 = {
100849
+ data: void 0,
100850
+ errors: void 0
100851
+ };
100852
+ if (res.isOk()) {
100853
+ consumerEmittedData2.data = res.value.data;
100854
+ } else {
100855
+ if (isUserVisibleError(res.error)) {
100856
+ consumerEmittedData2.data = res.error.data.data;
100857
+ consumerEmittedData2.errors = res.error.data.errors;
100858
+ } else {
100859
+ logError(res.error);
100860
+ consumerEmittedData2.errors = [
100861
+ {
100862
+ message: "Internal error in GraphQL adapter occurred",
100863
+ locations: []
100864
+ }
100865
+ ];
100866
+ }
100867
+ }
100868
+ cb(consumerEmittedData2);
100869
+ });
100870
+ };
100871
+ if (exposeRefresh) {
100872
+ consumerEmittedData.refresh = () => {
100873
+ return new Promise((resolve, reject) => {
100874
+ try {
100875
+ result.value.refresh().then((res) => {
100876
+ if (res.isOk()) {
100877
+ resolve();
100878
+ } else {
100879
+ reject(
100880
+ new Error(
100881
+ "Internal error in GraphQL adapter occurred: Failed to refresh GraphQL data"
100882
+ )
100883
+ );
100884
+ }
100885
+ });
100886
+ } catch (error) {
100887
+ logError(error);
100888
+ reject(
100889
+ new Error(
100890
+ "Internal error in GraphQL adapter occurred: Failed to refresh GraphQL data"
100891
+ )
100892
+ );
100893
+ }
100894
+ });
100895
+ };
100896
+ }
100897
+ } else {
100898
+ const failure = result.error.failure;
100899
+ if (isUserVisibleError(failure)) {
100900
+ consumerEmittedData.data = failure.data.data;
100901
+ consumerEmittedData.errors = failure.data.errors;
100902
+ } else {
100903
+ logError(failure);
100904
+ consumerEmittedData.errors = [
100905
+ { message: "Internal error in GraphQL adapter occurred", locations: [] }
100906
+ ];
100907
+ }
100908
+ }
100909
+ return consumerEmittedData;
100910
+ } catch (error) {
100911
+ logError(error);
100912
+ return {
100913
+ data: void 0,
100914
+ errors: [{ message: "Internal error in GraphQL adapter occurred", locations: [] }]
100915
+ };
100916
+ }
100917
+ };
100918
+ }
100831
100919
  function buildAsyncGraphQLImperativeLegacyInvoker(getCommand) {
100832
100920
  const invoke = async (config, requestContext, callback) => {
100833
100921
  config = wrapConfigAndVerify(config);
@@ -100933,7 +101021,7 @@
100933
101021
  }
100934
101022
  callback(consumerEmittedData);
100935
101023
  }
100936
- // version: 1.380.0-dev8-60930b5790
101024
+ // version: 1.380.0-dev9-476a6580cf
100937
101025
 
100938
101026
  class Analytics__AnalyticsBrowseRepository extends UnidentifiableGraphQLTypeRepository {
100939
101027
  constructor(services, typeRegistry) {
@@ -103590,6 +103678,7 @@
103590
103678
  * All rights reserved.
103591
103679
  * For full license text, see the LICENSE.txt file
103592
103680
  */
103681
+ const { hasOwnProperty: hasOwnProperty$1 } = Object.prototype;
103593
103682
  class Ok {
103594
103683
  constructor(value) {
103595
103684
  this.value = value;
@@ -104015,18 +104104,133 @@
104015
104104
  }
104016
104105
  }
104017
104106
 
104018
- // This should be smarter, and filter on selections, but for now,
104019
- // we'll match the luvio behavior of returning the blob
104020
- const blobTypeDef = {
104021
- read: (_cache, input) => {
104022
- return ok(input.normalizedData);
104023
- },
104024
- write: (_cache, input) => {
104025
- return ok(input.data);
104026
- },
104027
- buildFieldKey: (selection, variables) => buildFieldKey(selection.name.value, selection.arguments, variables),
104028
- augmentSelections: (input) => input,
104029
- };
104107
+ class BlobObjectRepository extends UnidentifiableGraphQLTypeRepository {
104108
+ constructor() {
104109
+ super(...arguments);
104110
+ this.namespace = 'uiapi';
104111
+ this.typeName = 'Blob';
104112
+ this.fields = {};
104113
+ this.implementedInterfaces = [];
104114
+ }
104115
+ normalizeFragment(_cache, _input, _fragment, errorCollector) {
104116
+ errorCollector.push({
104117
+ type: 'unknown',
104118
+ error: new Error('Fragments are not supported for Blob fields'),
104119
+ });
104120
+ return {};
104121
+ }
104122
+ denormalizeFragment(_cache, _input, _fragment, errorCollector) {
104123
+ errorCollector.push({
104124
+ type: 'unknown',
104125
+ error: new Error('Fragments are not supported for Blob fields'),
104126
+ });
104127
+ return {};
104128
+ }
104129
+ getFieldDef(_input, _selection) {
104130
+ return new BlobFieldDef({});
104131
+ }
104132
+ }
104133
+ class BlobFieldDef {
104134
+ constructor(services) {
104135
+ this.objectRepository = new BlobObjectRepository(services);
104136
+ }
104137
+ read(cache, input) {
104138
+ const errors = [];
104139
+ if (input.normalizedData.type === 'array') {
104140
+ const data = input.normalizedData.data.map((item) => {
104141
+ const result = this.read(cache, { ...input, normalizedData: item });
104142
+ if (result.isErr()) {
104143
+ errors.push(...result.error);
104144
+ return undefined;
104145
+ }
104146
+ return result.value;
104147
+ });
104148
+ if (errors.length > 0) {
104149
+ return err(errors);
104150
+ }
104151
+ return ok(data);
104152
+ }
104153
+ else if (input.normalizedData.type === 'object') {
104154
+ const selections = input.selection.selectionSet?.selections;
104155
+ if (!selections) {
104156
+ return err([
104157
+ {
104158
+ type: 'unknown',
104159
+ error: new Error('Object data must have a selection set'),
104160
+ },
104161
+ ]);
104162
+ }
104163
+ const result = this.objectRepository.read(cache, {
104164
+ ...input,
104165
+ normalizedData: input.normalizedData.data,
104166
+ selections,
104167
+ request: input.request,
104168
+ });
104169
+ if (result.isErr()) {
104170
+ return err(result.error);
104171
+ }
104172
+ return ok(result.value);
104173
+ }
104174
+ else {
104175
+ return ok(input.normalizedData.data);
104176
+ }
104177
+ }
104178
+ write(cache, input) {
104179
+ if (Array.isArray(input.data)) {
104180
+ const errors = [];
104181
+ const result = {
104182
+ type: 'array',
104183
+ data: input.data.map((item) => {
104184
+ const result = this.write(cache, { ...input, data: item });
104185
+ if (result.isErr()) {
104186
+ errors.push(...result.error);
104187
+ return undefined;
104188
+ }
104189
+ return result.value;
104190
+ }),
104191
+ };
104192
+ if (errors.length > 0) {
104193
+ return err(errors);
104194
+ }
104195
+ return ok(result);
104196
+ }
104197
+ else if (typeof input.data === 'object' && input.data !== null) {
104198
+ const selections = input.selection.selectionSet?.selections;
104199
+ if (!selections) {
104200
+ return err([
104201
+ {
104202
+ type: 'unknown',
104203
+ error: new Error('Object data must have a selection set'),
104204
+ },
104205
+ ]);
104206
+ }
104207
+ const result = this.objectRepository.write(cache, {
104208
+ ...input,
104209
+ selections,
104210
+ request: input.request,
104211
+ });
104212
+ if (result.isErr()) {
104213
+ return err(result.error);
104214
+ }
104215
+ return ok({
104216
+ type: 'object',
104217
+ data: result.value,
104218
+ });
104219
+ }
104220
+ else {
104221
+ return ok({
104222
+ type: 'scalar',
104223
+ data: input.data,
104224
+ });
104225
+ }
104226
+ }
104227
+ buildFieldKey(selection, variables) {
104228
+ return buildFieldKey(selection.name.value, selection.arguments, variables);
104229
+ }
104230
+ augmentSelections(input) {
104231
+ return input;
104232
+ }
104233
+ }
104030
104234
 
104031
104235
  // The generated repository is identifiable, since setup data isn't cached,
104032
104236
  // there's no need for an identifiable repository
@@ -104082,7 +104286,7 @@
104082
104286
  return super.getFieldDef(input, selection);
104083
104287
  }
104084
104288
  // We should make this smarter, storing and returning blobs isn't great since it could, and likely will, include unrequested field data
104085
- return blobTypeDef;
104289
+ return new BlobFieldDef(this.services);
104086
104290
  }
104087
104291
  satisfiesFragmentTypeCondition(input, fragment) {
104088
104292
  return genericSatisfiesFragmentTypeCondition(super.satisfiesFragmentTypeCondition.bind(this), input, fragment, this.typeName);
@@ -104122,7 +104326,7 @@
104122
104326
  if (staticFields.includes(selection.name.value)) {
104123
104327
  return super.getFieldDef(input, selection);
104124
104328
  }
104125
- return blobTypeDef;
104329
+ return new BlobFieldDef(this.services);
104126
104330
  }
104127
104331
  satisfiesFragmentTypeCondition(_input, fragment) {
104128
104332
  return genericSatisfiesFragmentTypeCondition(super.satisfiesFragmentTypeCondition.bind(this), _input, fragment, this.typeName);
@@ -104644,8 +104848,56 @@
104644
104848
  };
104645
104849
  }
104646
104850
 
104851
+ function validateNonQueryGraphQLConfig(config) {
104852
+ if (config !== null && typeof config === 'object') {
104853
+ if (hasOwnProperty$1.call(config, 'operationName') &&
104854
+ config.operationName === undefined) {
104855
+ return err('operationName is undefined');
104856
+ }
104857
+ if (hasOwnProperty$1.call(config, 'variables') &&
104858
+ config.variables === undefined) {
104859
+ return err('variables is undefined');
104860
+ }
104861
+ return ok(config);
104862
+ }
104863
+ return err('config is not an object');
104864
+ }
104865
+
104866
+ class GraphQLCommandWireAdapterConstructorV1Import extends GraphQLCommandWireAdapterConstructor {
104867
+ update(config, _context) {
104868
+ const validatedConfig = validateNonQueryGraphQLConfig(config);
104869
+ if (validatedConfig.isErr()) {
104870
+ // config is incomplete, delay execution
104871
+ return;
104872
+ }
104873
+ super.update(validatedConfig.value, _context);
104874
+ }
104875
+ }
104876
+
104877
+ function buildAsyncGraphQLImperativeLegacyInvokerV1Import(getCommand) {
104878
+ const { invoke: invokeOriginal, subscribe: subscribeOriginal } = buildAsyncGraphQLImperativeLegacyInvoker(getCommand);
104879
+ const invoke = async (config, requestContext, callback) => {
104880
+ const validatedConfig = validateNonQueryGraphQLConfig(config);
104881
+ if (validatedConfig.isErr()) {
104882
+ throw new Error(`Invalid configuration passed to GraphQL: ${validatedConfig.error}`);
104883
+ }
104884
+ return invokeOriginal(validatedConfig.value, requestContext, callback);
104885
+ };
104886
+ const subscribe = (config, requestContext, callback) => {
104887
+ const validatedConfig = validateNonQueryGraphQLConfig(config);
104888
+ if (validatedConfig.isErr()) {
104889
+ throw new Error(`Invalid configuration passed to GraphQL: ${validatedConfig.error}`);
104890
+ }
104891
+ return subscribeOriginal(validatedConfig.value, requestContext, callback);
104892
+ };
104893
+ return { invoke, subscribe };
104894
+ }
104895
+
104647
104896
  let graphql$1;
104897
+ let graphql_v1_import;
104648
104898
  let graphql_imperative$1;
104899
+ let graphql_imperative_legacy;
104900
+ let graphql_imperative_legacy_v1_import;
104649
104901
  let useOneStoreGraphQL = false;
104650
104902
  const serviceRequirements = {
104651
104903
  instrumentCommand: {
@@ -104708,15 +104960,37 @@
104708
104960
  return new graphql_ctor(this.config, documentRootType, services);
104709
104961
  }
104710
104962
  };
104963
+ graphql_v1_import = class extends GraphQLCommandWireAdapterConstructorV1Import {
104964
+ constructor() {
104965
+ super(...arguments);
104966
+ this.configSchema = CONFIG_SCHEMA;
104967
+ this.exposeRefresh = true;
104968
+ }
104969
+ getCommand() {
104970
+ return new graphql_ctor(this.config, documentRootType, services);
104971
+ }
104972
+ };
104711
104973
  const graphql_imperative_ctor = services.instrumentCommand(buildCommandClass(services.auraGraphQLNormalizedCacheControlCommand), 'graphql_imperative');
104712
- graphql_imperative$1 = buildAsyncGraphQLImperativeLegacyInvoker(({ config, assertIsValid }) => {
104974
+ graphql_imperative$1 = buildAsyncGraphQLImperativeInvoker(({ params, assertIsValid }) => {
104975
+ const config = params[0];
104976
+ const _ = assertIsValid;
104977
+ _(config, CONFIG_SCHEMA);
104978
+ return new graphql_imperative_ctor(config, documentRootType, services);
104979
+ }, true);
104980
+ graphql_imperative_legacy = buildAsyncGraphQLImperativeLegacyInvoker(({ config, assertIsValid }) => {
104713
104981
  const _ = assertIsValid;
104714
104982
  _(config, CONFIG_SCHEMA);
104715
104983
  return new graphql_imperative_ctor(config, documentRootType, services);
104716
104984
  });
104985
+ graphql_imperative_legacy_v1_import =
104986
+ buildAsyncGraphQLImperativeLegacyInvokerV1Import(({ config, assertIsValid }) => {
104987
+ const _ = assertIsValid;
104988
+ _(config, CONFIG_SCHEMA);
104989
+ return new graphql_imperative_ctor(config, documentRootType, services);
104990
+ });
104717
104991
  useOneStoreGraphQL = services.featureFlags?.get('useOneStoreGraphQL') ?? false;
104718
104992
  if (provisionedCallback) {
104719
- provisionedCallback(graphql$1, graphql_imperative$1, useOneStoreGraphQL);
104993
+ provisionedCallback(graphql$1, graphql_imperative$1, graphql_imperative_legacy, useOneStoreGraphQL);
104720
104994
  }
104721
104995
  }, (_err) => { });
104722
104996
  function registerCallback(cb) {
@@ -104724,10 +104998,10 @@
104724
104998
  provisionedCallback = cb;
104725
104999
  }
104726
105000
  else {
104727
- cb(graphql$1, graphql_imperative$1, useOneStoreGraphQL);
105001
+ cb(graphql_v1_import, graphql_imperative$1, graphql_imperative_legacy_v1_import, useOneStoreGraphQL);
104728
105002
  }
104729
105003
  }
104730
- // version: 1.380.0-dev8-60930b5790
105004
+ // version: 1.380.0-dev9-476a6580cf
104731
105005
 
104732
105006
  function createFragmentMap(documentNode) {
104733
105007
  const fragments = {};
@@ -130843,6 +131117,7 @@
130843
131117
  return cacheSnapshot;
130844
131118
  }
130845
131119
 
131120
+ // Wire Adapters
130846
131121
  let graphql;
130847
131122
  let graphqlBatch;
130848
131123
  // Imperative GET Adapters
@@ -130869,10 +131144,10 @@
130869
131144
  ({ graphql, graphqlBatch, graphql_imperative, graphqlBatch_imperative } = bindExportsTo(luvio));
130870
131145
  // We register the callback here rather than above withDefaultLuvio because we want environments
130871
131146
  // that don't have onestore bootstrapped with the required services to default to the luvio versions of the adapters
130872
- registerCallback((oneStoreGraphql, oneStoreGraphql_imperative, useOneStoreGraphQL) => {
131147
+ registerCallback((oneStoreGraphql, oneStoreGraphql_imperative, oneStoreGraphql_imperative_legacy, useOneStoreGraphQL) => {
130873
131148
  if (useOneStoreGraphQL) {
130874
131149
  graphql = oneStoreGraphql;
130875
- graphql_imperative = oneStoreGraphql_imperative;
131150
+ graphql_imperative = oneStoreGraphql_imperative_legacy;
130876
131151
  }
130877
131152
  });
130878
131153
  });
@@ -131386,7 +131661,7 @@
131386
131661
  }
131387
131662
  return refresh$3(data, 'refreshUiApi');
131388
131663
  }
131389
- // version: 1.380.0-dev8-60930b5790
131664
+ // version: 1.380.0-dev9-476a6580cf
131390
131665
 
131391
131666
  // On core the unstable adapters are re-exported with different names,
131392
131667
  // we want to match them here.
@@ -131538,7 +131813,7 @@
131538
131813
  unstable_graphQL_imperative = createImperativeAdapter(luvio, createInstrumentedAdapter(ldsAdapter, adapterMetadata), adapterMetadata);
131539
131814
  graphQLImperative = ldsAdapter;
131540
131815
  });
131541
- // version: 1.380.0-dev8-60930b5790
131816
+ // version: 1.380.0-dev9-476a6580cf
131542
131817
 
131543
131818
  var gqlApi = /*#__PURE__*/Object.freeze({
131544
131819
  __proto__: null,
@@ -132337,7 +132612,7 @@
132337
132612
  function register(r) {
132338
132613
  callbacks$1.forEach((callback) => callback(r));
132339
132614
  }
132340
- // version: 1.380.0-dev8-c2a0c4e2de
132615
+ // version: 1.380.0-dev9-0a2876c461
132341
132616
 
132342
132617
  /**
132343
132618
  * Copyright (c) 2022, Salesforce, Inc.,
@@ -133674,4 +133949,4 @@
133674
133949
  exports.subscribeToAdapter = subscribeToAdapter;
133675
133950
 
133676
133951
  }));
133677
- // version: 1.380.0-dev8-c2a0c4e2de
133952
+ // version: 1.380.0-dev9-0a2876c461