@salesforce/lds-worker-api 1.283.0 → 1.284.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4177,7 +4177,7 @@ function withDefaultLuvio(callback) {
4177
4177
  }
4178
4178
  callbacks.push(callback);
4179
4179
  }
4180
- // version: 1.283.0-a330da944
4180
+ // version: 1.284.0-a7e8dc51c
4181
4181
 
4182
4182
  // TODO [TD-0081508]: once that TD is fulfilled we can probably change this file
4183
4183
  function instrumentAdapter$1(createFunction, _metadata) {
@@ -15685,7 +15685,7 @@ function gql(literals, ...subs) {
15685
15685
  }
15686
15686
  return superResult;
15687
15687
  }
15688
- // version: 1.283.0-a330da944
15688
+ // version: 1.284.0-a7e8dc51c
15689
15689
 
15690
15690
  function unwrap(data) {
15691
15691
  // The lwc-luvio bindings import a function from lwc called "unwrap".
@@ -16610,7 +16610,7 @@ function createGraphQLWireAdapterConstructor(luvio, adapter, metadata, astResolv
16610
16610
  const { apiFamily, name } = metadata;
16611
16611
  return createGraphQLWireAdapterConstructor$1(adapter, `${apiFamily}.${name}`, luvio, astResolver);
16612
16612
  }
16613
- // version: 1.283.0-a330da944
16613
+ // version: 1.284.0-a7e8dc51c
16614
16614
 
16615
16615
  /**
16616
16616
  * Copyright (c) 2022, Salesforce, Inc.,
@@ -16823,6 +16823,41 @@ let trackedFieldDepthOnNotifyChange$2 = 5;
16823
16823
  * @defaultValue 'false', replicates the current behavior and fetches all fields in the store for the leaf relationship record
16824
16824
  */
16825
16825
  let trackedFieldLeafNodeIdAndNameOnly$2 = false;
16826
+ /**
16827
+ * One store enabled Get Object Info adapter
16828
+ */
16829
+ let oneStoreGetObjectInfoAdapter$2 = undefined;
16830
+ /**
16831
+ * One store enabled Get Object Infos adapter
16832
+ */
16833
+ let oneStoreGetObjectInfosAdapter$2 = undefined;
16834
+ /**
16835
+ * Defines the configuration API and is exposed internally as well as externally.
16836
+ * Configuration for one store enabled REST adapters only.
16837
+ */
16838
+ const configurationForOneStoreEnabledAdapters$2 = {
16839
+ setGetObjectInfoAdapter: function (adapter) {
16840
+ oneStoreGetObjectInfoAdapter$2 = adapter;
16841
+ },
16842
+ getGetObjectInfoAdapter: function () {
16843
+ return oneStoreGetObjectInfoAdapter$2;
16844
+ },
16845
+ setGetObjectInfosAdapter: function (adapter) {
16846
+ oneStoreGetObjectInfosAdapter$2 = adapter;
16847
+ },
16848
+ getGetObjectInfosAdapter: function () {
16849
+ return oneStoreGetObjectInfosAdapter$2;
16850
+ },
16851
+ };
16852
+ /**
16853
+ * Helper function to return the one store adapter if it's defined, otherwise return the luvio adapter.
16854
+ * @param luvioAdapter - The luvio bound adapter.
16855
+ * @param oneStoreAdapter - The one store bound adapter.
16856
+ * @returns Luvio or one store wire adapter constructor.
16857
+ */
16858
+ function getLuvioOrOneStoreAdapter(luvioAdapter, oneStoreAdapter) {
16859
+ return oneStoreAdapter !== null && oneStoreAdapter !== void 0 ? oneStoreAdapter : luvioAdapter;
16860
+ }
16826
16861
  /**
16827
16862
  * Defines the configuration API and is exposed internally as well as externally.
16828
16863
  * Configuration for REST adapters only.
@@ -16887,6 +16922,7 @@ const configurationForRestAdapters$2 = {
16887
16922
  getDraftAwareCreateContentVersionAdapter: function () {
16888
16923
  return draftAwareCreateContentVersionAdapter$2;
16889
16924
  },
16925
+ ...configurationForOneStoreEnabledAdapters$2,
16890
16926
  };
16891
16927
  /**
16892
16928
  * Defines the configuration API and is exposed internally as well as externally.
@@ -17243,15 +17279,17 @@ function splitQualifiedFieldApiName(fieldApiName) {
17243
17279
  /**
17244
17280
  * Returns the field API name, qualified with an object name if possible.
17245
17281
  * @param value The value from which to get the qualified field API name.
17282
+ * @param onlyQualifiedFieldNames - Whether or not this function should skip fieldApiName that do not include the delimiter '.'
17246
17283
  * @return The qualified field API name.
17247
17284
  */
17248
- function getFieldApiName$2(value) {
17285
+ function getFieldApiName$2(value, onlyQualifiedFieldNames = false) {
17249
17286
  // Note: tightening validation logic changes behavior from userland getting
17250
17287
  // a server-provided error to the adapter noop'ing. In 224 we decided to not
17251
- // change the behavior.
17288
+ // change the behavior. In 250 we decided to add the 'onlyQualifiedFieldName' flag to tighten the logic
17289
+ // optionally to avoid issues with persisted invalid field names.
17252
17290
  if (isString$2(value)) {
17253
17291
  const trimmed = value.trim();
17254
- if (trimmed.length > 0) {
17292
+ if (trimmed.length > 0 && (onlyQualifiedFieldNames ? trimmed.indexOf('.') > -1 : true)) {
17255
17293
  return trimmed;
17256
17294
  }
17257
17295
  }
@@ -17264,15 +17302,19 @@ function getFieldApiName$2(value) {
17264
17302
  /**
17265
17303
  * Returns the field API name.
17266
17304
  * @param value The value from which to get the field API name.
17305
+ * @param options Option bag. onlyQualifiedFieldNames is a boolean that allows this function to skip returning invalid FieldApiNames.
17267
17306
  * @returns The field API name.
17268
17307
  */
17269
- function getFieldApiNamesArray$2(value) {
17308
+ function getFieldApiNamesArray$2(value, options = { onlyQualifiedFieldNames: false }) {
17270
17309
  const valueArray = isArray$7(value) ? value : [value];
17271
17310
  const array = [];
17272
17311
  for (let i = 0, len = valueArray.length; i < len; i += 1) {
17273
17312
  const item = valueArray[i];
17274
- const apiName = getFieldApiName$2(item);
17313
+ const apiName = getFieldApiName$2(item, options.onlyQualifiedFieldNames);
17275
17314
  if (apiName === undefined) {
17315
+ if (options.onlyQualifiedFieldNames) {
17316
+ continue; // Just skips invalid field names rather than failing to return an array at all
17317
+ }
17276
17318
  return undefined;
17277
17319
  }
17278
17320
  push$4.call(array, apiName);
@@ -21639,17 +21681,16 @@ function tokenForAtMost$1(paginationMetadata, maxOffset) {
21639
21681
  }
21640
21682
 
21641
21683
  const TTL$x = 30000;
21642
- const VERSION$18$1 = "e635ab62cb633d32aeeb183e568bb2c7";
21684
+ const VERSION$18$1 = "e5c90c4081cd557f8ffec53028ede1e8";
21643
21685
  const RepresentationType$T = 'ListRecordCollectionRepresentation';
21644
21686
  function keyBuilder$23(luvio, config) {
21645
- return keyPrefix$2 + '::' + RepresentationType$T + ':' + config.objectApiName + ':' + (config.searchTerm === null ? '' : config.searchTerm) + ':' + (config.sortBy === null ? '' : '[' + config.sortBy.join(',') + ']') + ':' + (config.listViewId === null ? '' : config.listViewId) + ':' + (config.where === null ? '' : config.where) + ':' + (config.listViewApiName === null ? '' : config.listViewApiName);
21687
+ return keyPrefix$2 + '::' + RepresentationType$T + ':' + config.objectApiName + ':' + (config.searchTerm === null ? '' : config.searchTerm) + ':' + (config.sortBy === null ? '' : '[' + config.sortBy.join(',') + ']') + ':' + (config.where === null ? '' : config.where) + ':' + (config.listViewApiName === null ? '' : config.listViewApiName);
21646
21688
  }
21647
21689
  function keyBuilderFromType$B(luvio, object) {
21648
21690
  const keyParams = {
21649
21691
  objectApiName: object.listReference.objectApiName,
21650
21692
  searchTerm: object.searchTerm,
21651
21693
  sortBy: object.sortBy,
21652
- listViewId: object.listInfoETag,
21653
21694
  where: object.where,
21654
21695
  listViewApiName: object.listReference.listViewApiName
21655
21696
  };
@@ -22710,7 +22751,7 @@ function splitListRecordCollectionKey(key) {
22710
22751
  const keyElements = key.split(':');
22711
22752
  return {
22712
22753
  objectApiName: keyElements[3],
22713
- listViewApiName: keyElements[8],
22754
+ listViewApiName: keyElements[7],
22714
22755
  };
22715
22756
  }
22716
22757
  function splitListSummaryCollectionKey(key) {
@@ -23008,7 +23049,8 @@ function keyBuilder$1$(luvio, params) {
23008
23049
  return keyBuilder$23(luvio, {
23009
23050
  objectApiName: listReference.objectApiName,
23010
23051
  listViewApiName: listReference.listViewApiName,
23011
- listViewId: listReference.id,
23052
+ // # removing listViewId from key only supporing getting records using api name
23053
+ // listViewId: listReference.id,
23012
23054
  searchTerm: params.body.searchTerm || null,
23013
23055
  where: params.body.where || null,
23014
23056
  sortBy: params.body.sortBy !== undefined && params.body.sortBy.length <= 0
@@ -23021,7 +23063,8 @@ function keyBuilder$1$(luvio, params) {
23021
23063
  return keyBuilder$23(luvio, {
23022
23064
  objectApiName: params.urlParams.objectApiName,
23023
23065
  listViewApiName: params.urlParams.listViewApiName,
23024
- listViewId: '',
23066
+ // # removing listViewId from key only supporing getting records using api name
23067
+ // listViewId: '',
23025
23068
  searchTerm: params.body.searchTerm || null,
23026
23069
  where: params.body.where || null,
23027
23070
  sortBy: params.body.sortBy || [],
@@ -32193,7 +32236,7 @@ function equals$y(existing, incoming) {
32193
32236
  }
32194
32237
 
32195
32238
  const TTL$k = 900000;
32196
- const VERSION$D$1 = "84e1e3ffdfcb59f65d7b8906e33027ac";
32239
+ const VERSION$D$1 = "2405a0b25c2c00f82e88b600edc16387";
32197
32240
  const RepresentationType$u = 'ListObjectInfoRepresentation';
32198
32241
  function keyBuilder$15$1(luvio, config) {
32199
32242
  return keyPrefix$2 + '::' + RepresentationType$u + ':' + config.objectApiName;
@@ -32235,6 +32278,10 @@ const select$Z$1 = function ListObjectInfoRepresentationSelect() {
32235
32278
  name: 'objectApiName',
32236
32279
  kind: 'Scalar'
32237
32280
  },
32281
+ {
32282
+ name: 'publicOrSharedCreateable',
32283
+ kind: 'Scalar'
32284
+ },
32238
32285
  {
32239
32286
  name: 'relatedEntityApiName',
32240
32287
  kind: 'Scalar'
@@ -32248,6 +32295,11 @@ function equals$x(existing, incoming) {
32248
32295
  if (!(existing_createable === incoming_createable)) {
32249
32296
  return false;
32250
32297
  }
32298
+ const existing_publicOrSharedCreateable = existing.publicOrSharedCreateable;
32299
+ const incoming_publicOrSharedCreateable = incoming.publicOrSharedCreateable;
32300
+ if (!(existing_publicOrSharedCreateable === incoming_publicOrSharedCreateable)) {
32301
+ return false;
32302
+ }
32251
32303
  const existing_objectApiName = existing.objectApiName;
32252
32304
  const incoming_objectApiName = incoming.objectApiName;
32253
32305
  if (!(existing_objectApiName === incoming_objectApiName)) {
@@ -40849,6 +40901,7 @@ function onFetchResponseSuccess$1$1(luvio, config, resourceParams, response) {
40849
40901
  // Note: The original listReference will remain unchanged in the response.
40850
40902
  mutatedListRef.id = body.listInfoETag;
40851
40903
  addListReferenceWithId(mutatedListRef, context, body.listReference.id);
40904
+ // storing sortBy ensuring a cache hit when requesting records with no sortBy provided
40852
40905
  addServerDefaults(config, body, originalListRef, context);
40853
40906
  }
40854
40907
  return onFetchResponseSuccess$2$1(luvio, config, resourceParams, response);
@@ -43563,7 +43616,11 @@ function createDispatchResourceRequestContext(requestContext) {
43563
43616
  }
43564
43617
  ensureRegisteredOnce$2({
43565
43618
  id: '@salesforce/lds-adapters-uiapi',
43566
- configuration: { ...configurationForRestAdapters$2, ...configurationForGraphQLAdapters$2 },
43619
+ configuration: {
43620
+ ...configurationForRestAdapters$2,
43621
+ ...configurationForGraphQLAdapters$2,
43622
+ ...configurationForOneStoreEnabledAdapters$2,
43623
+ },
43567
43624
  instrument: instrument$3,
43568
43625
  });
43569
43626
 
@@ -43824,15 +43881,13 @@ function bindExportsTo$1(luvio) {
43824
43881
  getListInfosByObjectName: createWireAdapterConstructor(luvio, getListInfosByObjectName_ldsAdapter, getListInfosByObjectNameMetadata),
43825
43882
  getListObjectInfo: createWireAdapterConstructor(luvio, getListObjectInfo_ldsAdapter, getListObjectInfoMetadata),
43826
43883
  getListPreferences: createWireAdapterConstructor(luvio, getListPreferences_ldsAdapter, getListPreferencesMetadata),
43827
- getListRecordsByName: createWireAdapterConstructor(luvio, getListRecordsByName_ldsAdapter, getListRecordsByNameMetadata),
43884
+ getListRecordsByName: createInfiniteScrollingWireAdapterConstructor(luvio, getListRecordsByName_ldsAdapter, getListRecordsByNameMetadata),
43828
43885
  getListUi: createInfiniteScrollingWireAdapterConstructor(luvio, getListUi_ldsAdapter, getListUiMetadata),
43829
43886
  getLookupActions: createWireAdapterConstructor(luvio, getLookupActions_ldsAdapter, getLookupActionsMetadata),
43830
43887
  getLookupMetadata: createWireAdapterConstructor(luvio, getLookupMetadata_ldsAdapter, getLookupMetadataMetadata),
43831
43888
  getLookupRecords: createWireAdapterConstructor(luvio, getLookupRecords_ldsAdapter, getLookupRecordsMetadata),
43832
43889
  getNavItems: createWireAdapterConstructor(luvio, getNavItems_ldsAdapter, getNavItemsMetadata),
43833
43890
  getObjectCreateActions: createWireAdapterConstructor(luvio, getObjectCreateActions_ldsAdapter, getObjectCreateActionsMetadata),
43834
- getObjectInfo: createWireAdapterConstructor(luvio, getObjectInfo_ldsAdapter, getObjectInfoMetadata),
43835
- getObjectInfos: createWireAdapterConstructor(luvio, getObjectInfos_ldsAdapter, getObjectInfosMetadata),
43836
43891
  getPathLayout: createWireAdapterConstructor(luvio, getPathLayout_ldsAdapter, getPathLayoutMetadata),
43837
43892
  getPicklistValues: createWireAdapterConstructor(luvio, getPicklistValues_ldsAdapter, getPicklistValuesMetadata),
43838
43893
  getPicklistValuesByRecordType: createWireAdapterConstructor(luvio, getPicklistValuesByRecordType_ldsAdapter, getPicklistValuesByRecordTypeMetadata),
@@ -43868,6 +43923,9 @@ function bindExportsTo$1(luvio) {
43868
43923
  updateListPreferences: createLDSAdapter(luvio, adapterName$z, updateListPreferencesAdapterFactory),
43869
43924
  updateRecord: unwrapSnapshotData(factory$2),
43870
43925
  updateRecordAvatar: unwrapSnapshotData(factory$8),
43926
+ // One Store Enabled Adapters
43927
+ getObjectInfo: getLuvioOrOneStoreAdapter(createWireAdapterConstructor(luvio, getObjectInfo_ldsAdapter, getObjectInfoMetadata), configurationForOneStoreEnabledAdapters$2.getGetObjectInfoAdapter()),
43928
+ getObjectInfos: getLuvioOrOneStoreAdapter(createWireAdapterConstructor(luvio, getObjectInfos_ldsAdapter, getObjectInfosMetadata), configurationForOneStoreEnabledAdapters$2.getGetObjectInfosAdapter()),
43871
43929
  // Imperative Adapters
43872
43930
  unstable_getActionOverrides_imperative: createImperativeAdapter(luvio, getActionOverrides_ldsAdapter, getActionOverridesMetadata),
43873
43931
  getAllApps_imperative: createImperativeAdapter(luvio, getAllApps_ldsAdapter, getAllAppsMetadata),
@@ -44093,7 +44151,7 @@ withDefaultLuvio((luvio) => {
44093
44151
  throttle(60, 60000, setupNotifyAllListRecordUpdateAvailable(luvio));
44094
44152
  throttle(60, 60000, setupNotifyAllListInfoSummaryUpdateAvailable(luvio));
44095
44153
  });
44096
- // version: 1.283.0-80ddb6c3c
44154
+ // version: 1.284.0-8b78b708e
44097
44155
 
44098
44156
  var ldsIdempotencyWriteDisabled = {
44099
44157
  isOpen: function (e) {
@@ -55524,7 +55582,7 @@ function injectParentRelationships(selections, parentNode, parentPath, ancestors
55524
55582
  * @param objectInfos
55525
55583
  * @returns
55526
55584
  */
55527
- function injectFieldsForDisplayValue(topNode, parentNode, objectInfos) {
55585
+ function injectFieldsForDisplayValue(topNode, apiName, objectInfos) {
55528
55586
  const { selectionSet } = topNode;
55529
55587
  if (selectionSet === undefined)
55530
55588
  return [];
@@ -55538,13 +55596,8 @@ function injectFieldsForDisplayValue(topNode, parentNode, objectInfos) {
55538
55596
  displayValue = node;
55539
55597
  break;
55540
55598
  }
55541
- if (isInlineFragmentNode(node)) {
55542
- const name = node.typeCondition !== undefined ? node.typeCondition.name : parentNode.name;
55543
- displayValueNameFields = injectFieldsForDisplayValue(node, { ...parentNode, name }, objectInfos);
55544
- }
55545
55599
  }
55546
55600
  if (displayValue !== undefined) {
55547
- const apiName = parentNode.name.value;
55548
55601
  const objectInfo = objectInfos[apiName];
55549
55602
  if (objectInfo !== undefined &&
55550
55603
  objectInfo.nameFields !== undefined &&
@@ -55611,19 +55664,24 @@ function injectFields(selections, parentNode, parentPath, ancestors, objectInfos
55611
55664
  // example: TimeSheetId { value }
55612
55665
  relatedIdForChildRelationship.push(createFieldNode(injectedParentFieldName, FieldValueNodeSelectionSet));
55613
55666
  }
55614
- displayValueNameFields.push(...injectFieldsForDisplayValue(parentNode, {
55615
- ...parent,
55616
- name: {
55617
- ...parent.name,
55618
- value: targetRelationship.childObjectApiName,
55619
- },
55620
- }, objectInfos));
55667
+ displayValueNameFields.push(...injectFieldsForDisplayValue(parentNode, targetRelationship.childObjectApiName, objectInfos));
55621
55668
  }
55622
55669
  }
55623
55670
  }
55624
- displayValueNameFields.push(...injectFieldsForDisplayValue(parentNode, parent, objectInfos));
55671
+ else {
55672
+ let apiName = parent.name.value;
55673
+ if (pathToObjectApiNamesMap[parentPath] !== undefined &&
55674
+ pathToObjectApiNamesMap[parentPath].length === 1) {
55675
+ apiName = pathToObjectApiNamesMap[parentPath][0];
55676
+ }
55677
+ displayValueNameFields.push(...injectFieldsForDisplayValue(parentNode, apiName, objectInfos));
55678
+ }
55625
55679
  }
55626
55680
  }
55681
+ else if (isInlineFragmentNode(parentNode) && parentNode.typeCondition !== undefined) {
55682
+ const { typeCondition: { name: { value: apiName }, }, } = parentNode;
55683
+ displayValueNameFields.push(...injectFieldsForDisplayValue(parentNode, apiName, objectInfos));
55684
+ }
55627
55685
  return [
55628
55686
  ...rootQueryIdField,
55629
55687
  ...flat(parentRelaltionships),
@@ -57308,6 +57366,9 @@ function normalizeRecordFields(key, entry) {
57308
57366
  * Transforms a record for storage in the durable store. The transformation involves denormalizing
57309
57367
  * scalar fields and persisting link metadata to transform back into a normalized representation
57310
57368
  *
57369
+ * If the record contains pending fields this will return undefined as pending records do not get persisted
57370
+ * to the durable store. There should be a refresh operation outbound that will bring in the updated record.
57371
+ *
57311
57372
  * @param normalizedRecord Record containing normalized field links
57312
57373
  * @param recordStore a store containing referenced record fields
57313
57374
  */
@@ -57322,7 +57383,9 @@ function buildDurableRecordRepresentation(normalizedRecord, records, pendingEntr
57322
57383
  // pending fields get filtered out of the durable store
57323
57384
  const { pending } = field;
57324
57385
  if (pending === true) {
57325
- continue;
57386
+ // do not write records with pending fields to the durable store
57387
+ // there should be a refresh operation outbound that will bring in the updated record
57388
+ return undefined;
57326
57389
  }
57327
57390
  const { __ref } = field;
57328
57391
  if (__ref !== undefined) {
@@ -57488,10 +57551,12 @@ function makeRecordDenormalizingDurableStore(luvio, durableStore, getStoreRecord
57488
57551
  };
57489
57552
  }
57490
57553
  const denormalizedRecord = buildDurableRecordRepresentation(record, storeRecords, recordEntries, store);
57491
- putEntries[recordKey] = {
57492
- data: denormalizedRecord,
57493
- metadata,
57494
- };
57554
+ if (denormalizedRecord !== undefined) {
57555
+ putEntries[recordKey] = {
57556
+ data: denormalizedRecord,
57557
+ metadata,
57558
+ };
57559
+ }
57495
57560
  }
57496
57561
  else {
57497
57562
  putEntries[key] = value;
@@ -60924,17 +60989,6 @@ const NimbusBinaryStore = {
60924
60989
  },
60925
60990
  };
60926
60991
 
60927
- function setupInspection(luvio) {
60928
- if (__nimbus.plugins.LdsInspectorPlugin !== undefined) {
60929
- // when inspection is enabled, make luvio available as a global
60930
- // eslint-disable-next-line no-undef
60931
- globalThis.luvio = luvio;
60932
- registerReportObserver((report) => {
60933
- __nimbus.plugins.LdsInspectorPlugin.sendAdapterReport(stringify$1$1(report));
60934
- });
60935
- }
60936
- }
60937
-
60938
60992
  /**
60939
60993
  * Copyright (c) 2022, Salesforce, Inc.,
60940
60994
  * All rights reserved.
@@ -62056,6 +62110,21 @@ function primingSessionFactory(config) {
62056
62110
  return instrumentPrimingSession(session);
62057
62111
  }
62058
62112
 
62113
+ // so eslint doesn't complain about nimbus
62114
+ /* global __nimbus */
62115
+ function setupObserver() {
62116
+ if (__nimbus.plugins.LdsObserverPlugin !== undefined) {
62117
+ registerReportObserver((report) => {
62118
+ __nimbus.plugins.LdsObserverPlugin.logAdapterExecution({
62119
+ name: report.adapterName,
62120
+ serializedConfig: stringify$1$1(report.config),
62121
+ status: report.result,
62122
+ duration: report.executionTime,
62123
+ });
62124
+ });
62125
+ }
62126
+ }
62127
+
62059
62128
  // so eslint doesn't complain about nimbus
62060
62129
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
62061
62130
  /* global __nimbus */
@@ -62150,8 +62219,8 @@ function getRuntime() {
62150
62219
  lazyGetRecords = getRecordsAdapterFactory(lazyLuvio);
62151
62220
  // Currently instruments store runtime perf
62152
62221
  setupMobileInstrumentation();
62153
- // If the inspection nimbus plugin is configured, inspection is enabled otherwise this is a no-op
62154
- setupInspection(lazyLuvio);
62222
+ // If the observer nimbus plugin is configured, observation is enabled otherwise this is a no-op
62223
+ setupObserver();
62155
62224
  // set storeEval function for lds-adapters-graghql to use
62156
62225
  withRegistration('@salesforce/lds-adapters-graphql', (registration) => {
62157
62226
  const { configuration: { setStoreEval, setDraftFunctions }, } = registration;
@@ -62221,7 +62290,7 @@ register$1({
62221
62290
  id: '@salesforce/lds-network-adapter',
62222
62291
  instrument: instrument$2,
62223
62292
  });
62224
- // version: 1.283.0-a330da944
62293
+ // version: 1.284.0-a7e8dc51c
62225
62294
 
62226
62295
  const { create: create$3, keys: keys$3 } = Object;
62227
62296
  const { stringify: stringify$1, parse: parse$1 } = JSON;
@@ -81153,6 +81222,32 @@ let trackedFieldDepthOnNotifyChange$1 = 5;
81153
81222
  * @defaultValue 'false', replicates the current behavior and fetches all fields in the store for the leaf relationship record
81154
81223
  */
81155
81224
  let trackedFieldLeafNodeIdAndNameOnly$1 = false;
81225
+ /**
81226
+ * One store enabled Get Object Info adapter
81227
+ */
81228
+ let oneStoreGetObjectInfoAdapter$1 = undefined;
81229
+ /**
81230
+ * One store enabled Get Object Infos adapter
81231
+ */
81232
+ let oneStoreGetObjectInfosAdapter$1 = undefined;
81233
+ /**
81234
+ * Defines the configuration API and is exposed internally as well as externally.
81235
+ * Configuration for one store enabled REST adapters only.
81236
+ */
81237
+ const configurationForOneStoreEnabledAdapters$1 = {
81238
+ setGetObjectInfoAdapter: function (adapter) {
81239
+ oneStoreGetObjectInfoAdapter$1 = adapter;
81240
+ },
81241
+ getGetObjectInfoAdapter: function () {
81242
+ return oneStoreGetObjectInfoAdapter$1;
81243
+ },
81244
+ setGetObjectInfosAdapter: function (adapter) {
81245
+ oneStoreGetObjectInfosAdapter$1 = adapter;
81246
+ },
81247
+ getGetObjectInfosAdapter: function () {
81248
+ return oneStoreGetObjectInfosAdapter$1;
81249
+ },
81250
+ };
81156
81251
  /**
81157
81252
  * Defines the configuration API and is exposed internally as well as externally.
81158
81253
  * Configuration for REST adapters only.
@@ -81217,6 +81312,7 @@ const configurationForRestAdapters$1 = {
81217
81312
  getDraftAwareCreateContentVersionAdapter: function () {
81218
81313
  return draftAwareCreateContentVersionAdapter$1;
81219
81314
  },
81315
+ ...configurationForOneStoreEnabledAdapters$1,
81220
81316
  };
81221
81317
  /**
81222
81318
  * Defines the configuration API and is exposed internally as well as externally.
@@ -81725,6 +81821,7 @@ function bindExportsTo(luvio) {
81725
81821
  // Wire Adapters
81726
81822
  graphql: createGraphQLWireAdapterConstructor(luvio, graphql_ldsAdapter, graphqlMetadata, astResolver),
81727
81823
  graphqlBatch: createGraphQLWireAdapterConstructor(luvio, graphqlBatch_ldsAdapter, graphqlBatchMetadata, astResolver),
81824
+ // One Store Enabled Adapters
81728
81825
  // Imperative Adapters
81729
81826
  graphql_imperative: createGraphQLImperativeAdapter(luvio, graphql_ldsAdapter, graphqlMetadata, astResolver),
81730
81827
  graphqlBatch_imperative: createGraphQLImperativeAdapter(luvio, graphqlBatch_ldsAdapter, graphqlBatchMetadata, astResolver),
@@ -81846,15 +81943,17 @@ function isFieldId$1(unknown) {
81846
81943
  /**
81847
81944
  * Returns the field API name, qualified with an object name if possible.
81848
81945
  * @param value The value from which to get the qualified field API name.
81946
+ * @param onlyQualifiedFieldNames - Whether or not this function should skip fieldApiName that do not include the delimiter '.'
81849
81947
  * @return The qualified field API name.
81850
81948
  */
81851
- function getFieldApiName$1(value) {
81949
+ function getFieldApiName$1(value, onlyQualifiedFieldNames = false) {
81852
81950
  // Note: tightening validation logic changes behavior from userland getting
81853
81951
  // a server-provided error to the adapter noop'ing. In 224 we decided to not
81854
- // change the behavior.
81952
+ // change the behavior. In 250 we decided to add the 'onlyQualifiedFieldName' flag to tighten the logic
81953
+ // optionally to avoid issues with persisted invalid field names.
81855
81954
  if (isString$1(value)) {
81856
81955
  const trimmed = value.trim();
81857
- if (trimmed.length > 0) {
81956
+ if (trimmed.length > 0 && (onlyQualifiedFieldNames ? trimmed.indexOf('.') > -1 : true)) {
81858
81957
  return trimmed;
81859
81958
  }
81860
81959
  }
@@ -81867,15 +81966,19 @@ function getFieldApiName$1(value) {
81867
81966
  /**
81868
81967
  * Returns the field API name.
81869
81968
  * @param value The value from which to get the field API name.
81969
+ * @param options Option bag. onlyQualifiedFieldNames is a boolean that allows this function to skip returning invalid FieldApiNames.
81870
81970
  * @returns The field API name.
81871
81971
  */
81872
- function getFieldApiNamesArray$1(value) {
81972
+ function getFieldApiNamesArray$1(value, options = { onlyQualifiedFieldNames: false }) {
81873
81973
  const valueArray = isArray$2(value) ? value : [value];
81874
81974
  const array = [];
81875
81975
  for (let i = 0, len = valueArray.length; i < len; i += 1) {
81876
81976
  const item = valueArray[i];
81877
- const apiName = getFieldApiName$1(item);
81977
+ const apiName = getFieldApiName$1(item, options.onlyQualifiedFieldNames);
81878
81978
  if (apiName === undefined) {
81979
+ if (options.onlyQualifiedFieldNames) {
81980
+ continue; // Just skips invalid field names rather than failing to return an array at all
81981
+ }
81879
81982
  return undefined;
81880
81983
  }
81881
81984
  push$1.call(array, apiName);
@@ -82222,7 +82325,11 @@ var DiscriminatorValues$6;
82222
82325
  })(DiscriminatorValues$6 || (DiscriminatorValues$6 = {}));
82223
82326
  ensureRegisteredOnce$1({
82224
82327
  id: '@salesforce/lds-adapters-uiapi',
82225
- configuration: { ...configurationForRestAdapters$1, ...configurationForGraphQLAdapters$1 },
82328
+ configuration: {
82329
+ ...configurationForRestAdapters$1,
82330
+ ...configurationForGraphQLAdapters$1,
82331
+ ...configurationForOneStoreEnabledAdapters$1,
82332
+ },
82226
82333
  instrument: instrument$1,
82227
82334
  });
82228
82335
 
@@ -82231,7 +82338,7 @@ register$1({
82231
82338
  configuration: { ...configurationForGraphQLAdapters$1 },
82232
82339
  instrument: instrument$1,
82233
82340
  });
82234
- // version: 1.283.0-80ddb6c3c
82341
+ // version: 1.284.0-8b78b708e
82235
82342
 
82236
82343
  // On core the unstable adapters are re-exported with different names,
82237
82344
  // we want to match them here.
@@ -84487,7 +84594,7 @@ withDefaultLuvio((luvio) => {
84487
84594
  unstable_graphQL_imperative = createImperativeAdapter(luvio, createInstrumentedAdapter(ldsAdapter, adapterMetadata), adapterMetadata);
84488
84595
  graphQLImperative = ldsAdapter;
84489
84596
  });
84490
- // version: 1.283.0-80ddb6c3c
84597
+ // version: 1.284.0-8b78b708e
84491
84598
 
84492
84599
  var gqlApi = /*#__PURE__*/Object.freeze({
84493
84600
  __proto__: null,
@@ -84789,63 +84896,75 @@ function invokeDmlAdapter(adapter, configObject, onResponse, nativeAdapterReques
84789
84896
  }
84790
84897
  }
84791
84898
  /**
84792
- * Executes the specified adapter with the given adapterId and config. Then
84793
- * it replaces the draft with the given id with the draft generated
84794
- * by the mutating adapter. Will call onResult callback once with data or error.
84899
+ * @deprecated There is no situation in which any consumer actually wants to replace the draft.
84900
+ * call {@link invokeAdapterWithDraftToMerge} instead`.
84901
+ * Keep it for now for app back compatibility.
84902
+ * Will be removed in future, ideally 2 releases later.
84903
+ */
84904
+ function invokeAdapterWithDraftToReplace(adapterId, config, draftIdToReplace, onResponse, nativeAdapterRequestContext) {
84905
+ invokeAdapterWithDraftToMerge(adapterId, config, draftIdToReplace, onResponse, nativeAdapterRequestContext);
84906
+ }
84907
+ /**
84908
+ * Executes the specified adapter with the given @param dapterId and @param config. Then
84909
+ * it merge the draft with the given id with the draft generated by
84910
+ * the mutating adapter. Will call onResult callback once with data or error.
84795
84911
  *
84796
84912
  * This function throws an error if the given adapterId cannot be found, or if the
84797
- * adapterId is not a mutating adapter, or if a draft isn't created, or if it
84798
- * fails to parse the given config string.
84913
+ * adapterId is not a mutating adapter if a draft isn't created, or
84914
+ * if it fails to parse the given config string.
84915
+ *
84916
+ * If the @param adapterId is deleteRecod, the invocation of it will generate a delele draft.
84917
+ * The newly generated delete draft will replace the draft specified by @param targetDraftId
84799
84918
  */
84800
- function invokeAdapterWithDraftToReplace(adapterId, config, draftIdToReplace, onResponse, nativeAdapterRequestContext) {
84919
+ function invokeAdapterWithDraftToMerge(adapterId, config, targetDraftId, onResponse, nativeAdapterRequestContext) {
84920
+ const adapter = getDMLAdapterFromName(adapterId);
84921
+ if (adapter === undefined) {
84922
+ // Check if the adapter is non-mutating adapter and create proper error message.
84923
+ const message = getImperativeAdapterFromName(imperativeAdapterKeyBuilder(adapterId)) !== undefined
84924
+ ? NON_MUTATING_ADAPTER_MESSAGE
84925
+ : `adapter ${adapterId} not recognized`;
84926
+ onResponse({
84927
+ data: undefined,
84928
+ error: createNativeFetchErrorResponse(message),
84929
+ });
84930
+ return;
84931
+ }
84932
+ // deleteRecord adapter call will generate a delete draft and
84933
+ // the newly generate draft will replace the target draft
84934
+ if (adapterId === 'deleteRecord') {
84935
+ invokeAdapterWithDraftToMergeDeleteRecord(adapter, config, targetDraftId, onResponse, nativeAdapterRequestContext);
84936
+ return;
84937
+ }
84801
84938
  draftManager.getQueue().then((draftInfo) => {
84802
84939
  const draftIds = draftInfo.items.map((draft) => draft.id);
84803
- if (draftIds.includes(draftIdToReplace) === false) {
84940
+ if (draftIds.includes(targetDraftId) === false) {
84804
84941
  onResponse({
84805
84942
  data: undefined,
84806
84943
  error: createNativeFetchErrorResponse(DRAFT_DOESNT_EXIST_MESSAGE),
84807
84944
  });
84808
84945
  return;
84809
84946
  }
84810
- const adapter = getDMLAdapterFromName(adapterId);
84811
- if (adapter === undefined) {
84812
- // This check is here for legacy purpose
84813
- // So the consumers still get the same errors
84814
- if (getImperativeAdapterFromName(imperativeAdapterKeyBuilder(adapterId)) !== undefined) {
84815
- onResponse({
84816
- data: undefined,
84817
- error: createNativeFetchErrorResponse(NON_MUTATING_ADAPTER_MESSAGE),
84947
+ invokeDmlAdapter(adapter, parse$1(config), (responseValue) => {
84948
+ const draftIds = draftIdsForResponseValue(responseValue);
84949
+ if (responseValue.error === undefined &&
84950
+ draftIds !== undefined &&
84951
+ draftIds.length > 0) {
84952
+ const draftId = draftIds[draftIds.length - 1];
84953
+ draftManager
84954
+ .mergeActions(targetDraftId, draftId)
84955
+ .then(() => {
84956
+ onResponse(responseValue);
84957
+ })
84958
+ .catch((error) => {
84959
+ onResponse(convertErrorIntoNativeFetchError(error, `Unknown error merging draft`));
84818
84960
  });
84819
- return;
84820
84961
  }
84821
- throw Error(`adapter ${adapterId} not recognized`);
84822
- }
84823
- if (adapterId === 'deleteRecord') {
84824
- invokeAdapterWithDraftToReplaceDeleteRecord(adapter, config, draftIdToReplace, onResponse, nativeAdapterRequestContext);
84825
- }
84826
- else {
84827
- invokeDmlAdapter(adapter, parse$1(config), (responseValue) => {
84828
- const draftIds = draftIdsForResponseValue(responseValue);
84829
- if (responseValue.error === undefined &&
84830
- draftIds !== undefined &&
84831
- draftIds.length > 0) {
84832
- const draftId = draftIds[draftIds.length - 1];
84833
- draftManager
84834
- .replaceAction(draftIdToReplace, draftId)
84835
- .then(() => {
84836
- onResponse(responseValue);
84837
- })
84838
- .catch((error) => {
84839
- onResponse(convertErrorIntoNativeFetchError(error, 'Unknown error replacing draft'));
84840
- });
84841
- }
84842
- else {
84843
- let response = responseValue;
84844
- response.error = createNativeFetchErrorResponse(NO_DRAFT_CREATED_MESSAGE);
84845
- onResponse(response);
84846
- }
84847
- }, nativeAdapterRequestContext);
84848
- }
84962
+ else {
84963
+ let response = responseValue;
84964
+ response.error = createNativeFetchErrorResponse(NO_DRAFT_CREATED_MESSAGE);
84965
+ onResponse(response);
84966
+ }
84967
+ }, nativeAdapterRequestContext);
84849
84968
  });
84850
84969
  }
84851
84970
  /**
@@ -84953,11 +85072,11 @@ function invokeAdapterWithMetadataDeleteRecord(adapter, config, metadata, onResp
84953
85072
  }
84954
85073
  /*
84955
85074
  //TODO W-10284305: Remove this function in 238
84956
- This is a special case version of the invokeAdapterWithDraftToReplace function
85075
+ This is a special case version of the invokeAdapterWithDraftToMerge function
84957
85076
  which should only be used for the deleteRecord wire adapter, since it does not
84958
85077
  contain record data in the result and has to do special querying of the draft queue
84959
85078
  */
84960
- function invokeAdapterWithDraftToReplaceDeleteRecord(adapter, config, draftIdToReplace, onResponse, nativeAdapterRequestContext) {
85079
+ function invokeAdapterWithDraftToMergeDeleteRecord(adapter, config, draftIdToReplace, onResponse, nativeAdapterRequestContext) {
84961
85080
  const targetedRecordId = parse$1(config);
84962
85081
  let priorDraftIds;
84963
85082
  draftManager.getQueue().then((draftState) => {
@@ -85213,7 +85332,7 @@ const callbacks$1 = [];
85213
85332
  function register(r) {
85214
85333
  callbacks$1.forEach((callback) => callback(r));
85215
85334
  }
85216
- // version: 1.283.0-a330da944
85335
+ // version: 1.284.0-a7e8dc51c
85217
85336
 
85218
85337
  /**
85219
85338
  * Returns true if the value acts like a Promise, i.e. has a "then" function,
@@ -89197,6 +89316,32 @@ let trackedFieldDepthOnNotifyChange = 5;
89197
89316
  * @defaultValue 'false', replicates the current behavior and fetches all fields in the store for the leaf relationship record
89198
89317
  */
89199
89318
  let trackedFieldLeafNodeIdAndNameOnly = false;
89319
+ /**
89320
+ * One store enabled Get Object Info adapter
89321
+ */
89322
+ let oneStoreGetObjectInfoAdapter = undefined;
89323
+ /**
89324
+ * One store enabled Get Object Infos adapter
89325
+ */
89326
+ let oneStoreGetObjectInfosAdapter = undefined;
89327
+ /**
89328
+ * Defines the configuration API and is exposed internally as well as externally.
89329
+ * Configuration for one store enabled REST adapters only.
89330
+ */
89331
+ const configurationForOneStoreEnabledAdapters = {
89332
+ setGetObjectInfoAdapter: function (adapter) {
89333
+ oneStoreGetObjectInfoAdapter = adapter;
89334
+ },
89335
+ getGetObjectInfoAdapter: function () {
89336
+ return oneStoreGetObjectInfoAdapter;
89337
+ },
89338
+ setGetObjectInfosAdapter: function (adapter) {
89339
+ oneStoreGetObjectInfosAdapter = adapter;
89340
+ },
89341
+ getGetObjectInfosAdapter: function () {
89342
+ return oneStoreGetObjectInfosAdapter;
89343
+ },
89344
+ };
89200
89345
  /**
89201
89346
  * Defines the configuration API and is exposed internally as well as externally.
89202
89347
  * Configuration for REST adapters only.
@@ -89261,6 +89406,7 @@ const configurationForRestAdapters = {
89261
89406
  getDraftAwareCreateContentVersionAdapter: function () {
89262
89407
  return draftAwareCreateContentVersionAdapter;
89263
89408
  },
89409
+ ...configurationForOneStoreEnabledAdapters,
89264
89410
  };
89265
89411
  /**
89266
89412
  * Defines the configuration API and is exposed internally as well as externally.
@@ -89433,15 +89579,17 @@ function isFieldId(unknown) {
89433
89579
  /**
89434
89580
  * Returns the field API name, qualified with an object name if possible.
89435
89581
  * @param value The value from which to get the qualified field API name.
89582
+ * @param onlyQualifiedFieldNames - Whether or not this function should skip fieldApiName that do not include the delimiter '.'
89436
89583
  * @return The qualified field API name.
89437
89584
  */
89438
- function getFieldApiName(value) {
89585
+ function getFieldApiName(value, onlyQualifiedFieldNames = false) {
89439
89586
  // Note: tightening validation logic changes behavior from userland getting
89440
89587
  // a server-provided error to the adapter noop'ing. In 224 we decided to not
89441
- // change the behavior.
89588
+ // change the behavior. In 250 we decided to add the 'onlyQualifiedFieldName' flag to tighten the logic
89589
+ // optionally to avoid issues with persisted invalid field names.
89442
89590
  if (isString(value)) {
89443
89591
  const trimmed = value.trim();
89444
- if (trimmed.length > 0) {
89592
+ if (trimmed.length > 0 && (onlyQualifiedFieldNames ? trimmed.indexOf('.') > -1 : true)) {
89445
89593
  return trimmed;
89446
89594
  }
89447
89595
  }
@@ -89454,15 +89602,19 @@ function getFieldApiName(value) {
89454
89602
  /**
89455
89603
  * Returns the field API name.
89456
89604
  * @param value The value from which to get the field API name.
89605
+ * @param options Option bag. onlyQualifiedFieldNames is a boolean that allows this function to skip returning invalid FieldApiNames.
89457
89606
  * @returns The field API name.
89458
89607
  */
89459
- function getFieldApiNamesArray(value) {
89608
+ function getFieldApiNamesArray(value, options = { onlyQualifiedFieldNames: false }) {
89460
89609
  const valueArray = isArray(value) ? value : [value];
89461
89610
  const array = [];
89462
89611
  for (let i = 0, len = valueArray.length; i < len; i += 1) {
89463
89612
  const item = valueArray[i];
89464
- const apiName = getFieldApiName(item);
89613
+ const apiName = getFieldApiName(item, options.onlyQualifiedFieldNames);
89465
89614
  if (apiName === undefined) {
89615
+ if (options.onlyQualifiedFieldNames) {
89616
+ continue; // Just skips invalid field names rather than failing to return an array at all
89617
+ }
89466
89618
  return undefined;
89467
89619
  }
89468
89620
  push.call(array, apiName);
@@ -89811,7 +89963,11 @@ var DiscriminatorValues;
89811
89963
  ObjectCreate$1(null);
89812
89964
  ensureRegisteredOnce({
89813
89965
  id: '@salesforce/lds-adapters-uiapi',
89814
- configuration: { ...configurationForRestAdapters, ...configurationForGraphQLAdapters },
89966
+ configuration: {
89967
+ ...configurationForRestAdapters,
89968
+ ...configurationForGraphQLAdapters,
89969
+ ...configurationForOneStoreEnabledAdapters,
89970
+ },
89815
89971
  instrument,
89816
89972
  });
89817
89973
 
@@ -90127,5 +90283,5 @@ function handleInstrumentation(activity, stat, progress) {
90127
90283
  const { luvio } = getRuntime();
90128
90284
  setDefaultLuvio({ luvio });
90129
90285
 
90130
- export { createPrimingSession, draftManager, draftQueue, evictCacheRecordsByIds, evictExpiredCacheEntries, executeAdapter, executeMutatingAdapter, getImperativeAdapterNames, invokeAdapter, invokeAdapterWithDraftToReplace, invokeAdapterWithMetadata, nimbusDraftQueue, registerReportObserver, setMetadataTTL, setUiApiRecordTTL, stopEviction, subscribeToAdapter };
90131
- // version: 1.283.0-a330da944
90286
+ export { createPrimingSession, draftManager, draftQueue, evictCacheRecordsByIds, evictExpiredCacheEntries, executeAdapter, executeMutatingAdapter, getImperativeAdapterNames, invokeAdapter, invokeAdapterWithDraftToMerge, invokeAdapterWithDraftToReplace, invokeAdapterWithMetadata, nimbusDraftQueue, registerReportObserver, setMetadataTTL, setUiApiRecordTTL, stopEviction, subscribeToAdapter };
90287
+ // version: 1.284.0-a7e8dc51c