@salesforce/lds-worker-api 1.213.1 → 1.213.2

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.
@@ -795,4 +795,4 @@ if (process.env.NODE_ENV !== 'production') {
795
795
  }
796
796
 
797
797
  export { createPrimingSession, draftManager, draftQueue, executeAdapter, executeMutatingAdapter, getImperativeAdapterNames, invokeAdapter, invokeAdapterWithDraftToReplace, invokeAdapterWithMetadata, nimbusDraftQueue, setMetadataTTL, setUiApiRecordTTL, subscribeToAdapter };
798
- // version: 1.213.1-1ba9571c8
798
+ // version: 1.213.2-69d4eea1b
@@ -3898,7 +3898,7 @@ function withDefaultLuvio(callback) {
3898
3898
  }
3899
3899
  callbacks.push(callback);
3900
3900
  }
3901
- // version: 1.213.1-1ba9571c8
3901
+ // version: 1.213.2-69d4eea1b
3902
3902
 
3903
3903
  // TODO [TD-0081508]: once that TD is fulfilled we can probably change this file
3904
3904
  function instrumentAdapter$1(createFunction, _metadata) {
@@ -15331,7 +15331,7 @@ function parseAndVisit(source) {
15331
15331
  updateReferenceMapWithKnownKey(ast, luvioDocumentNode);
15332
15332
  return luvioDocumentNode;
15333
15333
  }
15334
- // version: 1.213.1-1ba9571c8
15334
+ // version: 1.213.2-69d4eea1b
15335
15335
 
15336
15336
  function unwrap(data) {
15337
15337
  // The lwc-luvio bindings import a function from lwc called "unwrap".
@@ -16254,7 +16254,7 @@ function createGraphQLWireAdapterConstructor(luvio, adapter, metadata, astResolv
16254
16254
  const { apiFamily, name } = metadata;
16255
16255
  return createGraphQLWireAdapterConstructor$1(adapter, `${apiFamily}.${name}`, luvio, astResolver);
16256
16256
  }
16257
- // version: 1.213.1-1ba9571c8
16257
+ // version: 1.213.2-69d4eea1b
16258
16258
 
16259
16259
  /**
16260
16260
  * Copyright (c) 2022, Salesforce, Inc.,
@@ -41931,7 +41931,7 @@ withDefaultLuvio((luvio) => {
41931
41931
  });
41932
41932
  throttle(60, 60000, createLDSAdapter(luvio, 'notifyListViewSummaryUpdateAvailable', notifyUpdateAvailableFactory));
41933
41933
  });
41934
- // version: 1.213.1-79de10fe1
41934
+ // version: 1.213.2-1eb996209
41935
41935
 
41936
41936
  var caseSensitiveUserId = '005B0000000GR4OIAW';
41937
41937
 
@@ -48555,32 +48555,32 @@ function makeEnvironmentDraftAware(luvio, env, durableStore, handlers, draftQueu
48555
48555
  * For full license text, see the LICENSE.txt file
48556
48556
  */
48557
48557
 
48558
- const API_NAMESPACE = 'UiApi';
48559
- const RECORD_REPRESENTATION_NAME$1 = 'RecordRepresentation';
48560
- const RECORD_VIEW_ENTITY_REPRESENTATION_NAME = 'RecordViewEntityRepresentation';
48561
- const RECORD_ID_PREFIX = `${API_NAMESPACE}::${RECORD_REPRESENTATION_NAME$1}:`;
48562
- const RECORD_VIEW_ENTITY_ID_PREFIX = `${API_NAMESPACE}::${RECORD_VIEW_ENTITY_REPRESENTATION_NAME}:Name:`;
48563
- const RECORD_FIELDS_KEY_JUNCTION = '__fields__';
48558
+ const API_NAMESPACE$1 = 'UiApi';
48559
+ const RECORD_REPRESENTATION_NAME$2 = 'RecordRepresentation';
48560
+ const RECORD_VIEW_ENTITY_REPRESENTATION_NAME$1 = 'RecordViewEntityRepresentation';
48561
+ const RECORD_ID_PREFIX$1 = `${API_NAMESPACE$1}::${RECORD_REPRESENTATION_NAME$2}:`;
48562
+ const RECORD_VIEW_ENTITY_ID_PREFIX$1 = `${API_NAMESPACE$1}::${RECORD_VIEW_ENTITY_REPRESENTATION_NAME$1}:Name:`;
48563
+ const RECORD_FIELDS_KEY_JUNCTION$1 = '__fields__';
48564
48564
  function isStoreKeyRecordId(key) {
48565
- return key.indexOf(RECORD_ID_PREFIX) > -1 && key.indexOf(RECORD_FIELDS_KEY_JUNCTION) === -1;
48565
+ return key.indexOf(RECORD_ID_PREFIX$1) > -1 && key.indexOf(RECORD_FIELDS_KEY_JUNCTION$1) === -1;
48566
48566
  }
48567
- function isStoreKeyRecordViewEntity(key) {
48568
- return (key.indexOf(RECORD_VIEW_ENTITY_ID_PREFIX) > -1 &&
48569
- key.indexOf(RECORD_FIELDS_KEY_JUNCTION) === -1);
48567
+ function isStoreKeyRecordViewEntity$1(key) {
48568
+ return (key.indexOf(RECORD_VIEW_ENTITY_ID_PREFIX$1) > -1 &&
48569
+ key.indexOf(RECORD_FIELDS_KEY_JUNCTION$1) === -1);
48570
48570
  }
48571
48571
  function isStoreKeyRecordField(key) {
48572
- return key.indexOf(RECORD_ID_PREFIX) > -1 && key.indexOf(RECORD_FIELDS_KEY_JUNCTION) > -1;
48572
+ return key.indexOf(RECORD_ID_PREFIX$1) > -1 && key.indexOf(RECORD_FIELDS_KEY_JUNCTION$1) > -1;
48573
48573
  }
48574
- function extractRecordIdFromStoreKey(key) {
48574
+ function extractRecordIdFromStoreKey$1(key) {
48575
48575
  if (key === undefined ||
48576
- (key.indexOf(RECORD_ID_PREFIX) === -1 && key.indexOf(RECORD_VIEW_ENTITY_ID_PREFIX) === -1)) {
48576
+ (key.indexOf(RECORD_ID_PREFIX$1) === -1 && key.indexOf(RECORD_VIEW_ENTITY_ID_PREFIX$1) === -1)) {
48577
48577
  return undefined;
48578
48578
  }
48579
48579
  const parts = key.split(':');
48580
48580
  return parts[parts.length - 1].split('_')[0];
48581
48581
  }
48582
48582
  function buildRecordFieldStoreKey(recordKey, fieldName) {
48583
- return `${recordKey}${RECORD_FIELDS_KEY_JUNCTION}${fieldName}`;
48583
+ return `${recordKey}${RECORD_FIELDS_KEY_JUNCTION$1}${fieldName}`;
48584
48584
  }
48585
48585
 
48586
48586
  function isStoreRecordError(storeRecord) {
@@ -48588,7 +48588,7 @@ function isStoreRecordError(storeRecord) {
48588
48588
  }
48589
48589
  function isEntryDurableRecordRepresentation(entry, key) {
48590
48590
  // Either a DurableRecordRepresentation or StoreRecordError can live at a record key
48591
- return ((isStoreKeyRecordId(key) || isStoreKeyRecordViewEntity(key)) &&
48591
+ return ((isStoreKeyRecordId(key) || isStoreKeyRecordViewEntity$1(key)) &&
48592
48592
  entry.data.__type === undefined);
48593
48593
  }
48594
48594
 
@@ -52953,7 +52953,7 @@ function resolveResourceRequestIds(luvio, request, canonicalRecordStoreKey) {
52953
52953
  // no mapping exists -- return the request un-modified
52954
52954
  return request;
52955
52955
  }
52956
- const canonicalId = extractRecordIdFromStoreKey(canonicalRecordStoreKey);
52956
+ const canonicalId = extractRecordIdFromStoreKey$1(canonicalRecordStoreKey);
52957
52957
  if (canonicalId === undefined) {
52958
52958
  // could not resolve id from request -- return the request un-modified
52959
52959
  return request;
@@ -53063,7 +53063,7 @@ function extractDraftAndCanonicalIdsFromRequest(luvio, resourceRequest, env, isD
53063
53063
  const canonicalKey = env.storeGetCanonicalKey(recordKey);
53064
53064
  if (recordKey !== canonicalKey) {
53065
53065
  // record is no longer a draft, include the canonical id in the request
53066
- const canonicalId = extractRecordIdFromStoreKey(canonicalKey);
53066
+ const canonicalId = extractRecordIdFromStoreKey$1(canonicalKey);
53067
53067
  if (canonicalId !== undefined) {
53068
53068
  canonicalIds.push(canonicalId);
53069
53069
  }
@@ -53706,10 +53706,10 @@ class UiApiActionHandler extends AbstractResourceRequestActionHandler {
53706
53706
  return undefined;
53707
53707
  }
53708
53708
  canRepresentationContainDraftMetadata(representationName) {
53709
- return representationName === RECORD_REPRESENTATION_NAME$1;
53709
+ return representationName === RECORD_REPRESENTATION_NAME$2;
53710
53710
  }
53711
53711
  canHandlePublish(key) {
53712
- return extractRecordIdFromStoreKey(key) !== undefined;
53712
+ return extractRecordIdFromStoreKey$1(key) !== undefined;
53713
53713
  }
53714
53714
  buildTagForTargetId(id) {
53715
53715
  return getRecordKeyForId(this.getLuvio(), id);
@@ -53765,7 +53765,7 @@ class UiApiActionHandler extends AbstractResourceRequestActionHandler {
53765
53765
  }
53766
53766
  }
53767
53767
  async getDraftMetadata(key) {
53768
- const recordId = extractRecordIdFromStoreKey(key);
53768
+ const recordId = extractRecordIdFromStoreKey$1(key);
53769
53769
  if (recordId === undefined) {
53770
53770
  return undefined;
53771
53771
  }
@@ -53794,7 +53794,7 @@ class UiApiActionHandler extends AbstractResourceRequestActionHandler {
53794
53794
  return undefined;
53795
53795
  }
53796
53796
  const key = action.tag;
53797
- const recordId = extractRecordIdFromStoreKey(key);
53797
+ const recordId = extractRecordIdFromStoreKey$1(key);
53798
53798
  if (recordId === undefined) {
53799
53799
  throw Error('could not determine record id');
53800
53800
  }
@@ -53918,7 +53918,7 @@ class UiApiActionHandler extends AbstractResourceRequestActionHandler {
53918
53918
  const draftKey = this.buildTagForTargetId(fieldValue);
53919
53919
  const canonicalKey = this.getLuvio().storeGetCanonicalKey(draftKey);
53920
53920
  if (draftKey !== canonicalKey) {
53921
- const canonicalId = extractRecordIdFromStoreKey(canonicalKey);
53921
+ const canonicalId = extractRecordIdFromStoreKey$1(canonicalKey);
53922
53922
  if (canonicalId !== undefined) {
53923
53923
  bodyFields[fieldName] = canonicalId;
53924
53924
  }
@@ -53938,7 +53938,7 @@ class UiApiActionHandler extends AbstractResourceRequestActionHandler {
53938
53938
  const recordKey = this.buildTagForTargetId(recordId);
53939
53939
  const canonicalKey = this.getLuvio().storeGetCanonicalKey(recordKey);
53940
53940
  if (recordKey !== canonicalKey) {
53941
- const canonicalId = extractRecordIdFromStoreKey(canonicalKey);
53941
+ const canonicalId = extractRecordIdFromStoreKey$1(canonicalKey);
53942
53942
  if (canonicalId === undefined) {
53943
53943
  // could not resolve id from request -- return the request un-modified
53944
53944
  return request;
@@ -54065,8 +54065,8 @@ function getDenormalizedKey(originalKey, recordId, luvio) {
54065
54065
  // this will likely need to be handled when moving to structured keys
54066
54066
  // note record view entities dont have an associated keybuilder. They get ingested as records to a different key format
54067
54067
  // see the override for how they are handled packages/lds-adapters-uiapi/src/raml-artifacts/types/RecordRepresentation/keyBuilderFromType.ts
54068
- if (originalKey.startsWith(RECORD_VIEW_ENTITY_ID_PREFIX)) {
54069
- return RECORD_VIEW_ENTITY_ID_PREFIX + recordId;
54068
+ if (originalKey.startsWith(RECORD_VIEW_ENTITY_ID_PREFIX$1)) {
54069
+ return RECORD_VIEW_ENTITY_ID_PREFIX$1 + recordId;
54070
54070
  }
54071
54071
  return keyBuilder$1U(luvio, { recordId });
54072
54072
  }
@@ -54087,9 +54087,9 @@ function makeRecordDenormalizingDurableStore(luvio, durableStore, getStoreRecord
54087
54087
  const recordViewEntries = {};
54088
54088
  for (let i = 0, len = entriesLength; i < len; i++) {
54089
54089
  const id = entries[i];
54090
- const recordId = extractRecordIdFromStoreKey(id);
54090
+ const recordId = extractRecordIdFromStoreKey$1(id);
54091
54091
  if (recordId !== undefined) {
54092
- if (id.startsWith(RECORD_VIEW_ENTITY_ID_PREFIX)) {
54092
+ if (id.startsWith(RECORD_VIEW_ENTITY_ID_PREFIX$1)) {
54093
54093
  if (recordViewEntries[recordId] === undefined) {
54094
54094
  const key = getDenormalizedKey(id, recordId, luvio);
54095
54095
  recordViewEntries[recordId] = true;
@@ -54141,10 +54141,10 @@ function makeRecordDenormalizingDurableStore(luvio, durableStore, getStoreRecord
54141
54141
  for (let i = 0, len = keys$1.length; i < len; i++) {
54142
54142
  const key = keys$1[i];
54143
54143
  let value = entries[key];
54144
- const recordId = extractRecordIdFromStoreKey(key);
54144
+ const recordId = extractRecordIdFromStoreKey$1(key);
54145
54145
  // do not put normalized field values
54146
54146
  if (recordId !== undefined) {
54147
- const isRecordView = key.startsWith(RECORD_VIEW_ENTITY_ID_PREFIX);
54147
+ const isRecordView = key.startsWith(RECORD_VIEW_ENTITY_ID_PREFIX$1);
54148
54148
  if (isRecordView) {
54149
54149
  if (putRecordViews[recordId] === true) {
54150
54150
  continue;
@@ -54659,7 +54659,7 @@ const replaceDraftIdsInVariables$1 = (variables, draftFunctions, unmappedDraftID
54659
54659
  function draftAwareGraphQLAdapterFactory(userId, objectInfoService, store, luvio, isDraftId) {
54660
54660
  const getCanonicalId = (id) => {
54661
54661
  var _a;
54662
- return ((_a = extractRecordIdFromStoreKey(luvio.storeGetCanonicalKey(RECORD_ID_PREFIX + id))) !== null && _a !== void 0 ? _a : id);
54662
+ return ((_a = extractRecordIdFromStoreKey$1(luvio.storeGetCanonicalKey(RECORD_ID_PREFIX$1 + id))) !== null && _a !== void 0 ? _a : id);
54663
54663
  };
54664
54664
  return async function draftAwareGraphQLAdapter(config, buildCachedSnapshotCachePolicy, buildNetworkSnapshotCachePolicy, requestContext = {}) {
54665
54665
  //create a copy to not accidentally modify the AST in the astResolver map of luvio
@@ -54842,7 +54842,7 @@ function createContentDocumentAndVersionDraftAdapterFactory(luvio, binaryStore,
54842
54842
  return key.replace(ContentDocumentCompositeKeyPrefix, '');
54843
54843
  }
54844
54844
  // else it's a record rep
54845
- return extractRecordIdFromStoreKey(key);
54845
+ return extractRecordIdFromStoreKey$1(key);
54846
54846
  });
54847
54847
  return async function createContentDocumentAndVersionDraftAdapter(config, buildNetworkSnapshot, requestContext) {
54848
54848
  const context = requestContext || {};
@@ -55301,7 +55301,7 @@ function getDescriptionFromResourceRequest(request) {
55301
55301
  * register it with the DraftQueue, runtime should set that up
55302
55302
  */
55303
55303
  function createRecordDraftAdapterFactory(luvio, actionHandler) {
55304
- const luvioWithDraftOverrides = buildLuvioOverrideForDraftAdapters(luvio, actionHandler, extractRecordIdFromStoreKey);
55304
+ const luvioWithDraftOverrides = buildLuvioOverrideForDraftAdapters(luvio, actionHandler, extractRecordIdFromStoreKey$1);
55305
55305
  return function createRecordDraftAdapter(config, buildNetworkSnapshot) {
55306
55306
  return buildNetworkSnapshot(luvioWithDraftOverrides, config);
55307
55307
  };
@@ -55314,7 +55314,7 @@ function createRecordDraftAdapterFactory(luvio, actionHandler) {
55314
55314
  * register it with the DraftQueue, runtime should set that up
55315
55315
  */
55316
55316
  function updateRecordDraftAdapterFactory(luvio, actionHandler) {
55317
- const luvioWithDraftOverrides = buildLuvioOverrideForDraftAdapters(luvio, actionHandler, extractRecordIdFromStoreKey);
55317
+ const luvioWithDraftOverrides = buildLuvioOverrideForDraftAdapters(luvio, actionHandler, extractRecordIdFromStoreKey$1);
55318
55318
  return function updateRecordDraftAdapter(config, buildNetworkSnapshot) {
55319
55319
  return buildNetworkSnapshot(luvioWithDraftOverrides, config);
55320
55320
  };
@@ -55327,7 +55327,7 @@ function updateRecordDraftAdapterFactory(luvio, actionHandler) {
55327
55327
  * register it with the DraftQueue, runtime should set that up
55328
55328
  */
55329
55329
  function deleteRecordDraftAdapterFactory(luvio, actionHandler) {
55330
- const luvioWithDraftOverrides = buildLuvioOverrideForDraftAdapters(luvio, actionHandler, extractRecordIdFromStoreKey, { forDeleteAdapter: true });
55330
+ const luvioWithDraftOverrides = buildLuvioOverrideForDraftAdapters(luvio, actionHandler, extractRecordIdFromStoreKey$1, { forDeleteAdapter: true });
55331
55331
  return function deleteRecordDraftAdapter(config, buildNetworkSnapshot) {
55332
55332
  return buildNetworkSnapshot(luvioWithDraftOverrides, config);
55333
55333
  };
@@ -58278,7 +58278,7 @@ class SqlitePrimingStore {
58278
58278
  try {
58279
58279
  const result = await this.store.query(statement, params);
58280
58280
  for (const row of result.rows) {
58281
- const id = extractRecordIdFromStoreKey(row[0]);
58281
+ const id = extractRecordIdFromStoreKey$1(row[0]);
58282
58282
  if (id) {
58283
58283
  written.push(id);
58284
58284
  idsToPrime.delete(id);
@@ -58468,7 +58468,7 @@ function getRuntime() {
58468
58468
  const { configuration: { setStoreEval, setDraftFunctions }, } = registration;
58469
58469
  const getCanonicalId = (id) => {
58470
58470
  var _a;
58471
- return ((_a = extractRecordIdFromStoreKey(lazyLuvio.storeGetCanonicalKey(RECORD_ID_PREFIX + id))) !== null && _a !== void 0 ? _a : id);
58471
+ return ((_a = extractRecordIdFromStoreKey$1(lazyLuvio.storeGetCanonicalKey(RECORD_ID_PREFIX$1 + id))) !== null && _a !== void 0 ? _a : id);
58472
58472
  };
58473
58473
  const draftFuncs = {
58474
58474
  isDraftId: isGenerated,
@@ -58529,7 +58529,7 @@ register({
58529
58529
  id: '@salesforce/lds-network-adapter',
58530
58530
  instrument: instrument$1,
58531
58531
  });
58532
- // version: 1.213.1-1ba9571c8
58532
+ // version: 1.213.2-69d4eea1b
58533
58533
 
58534
58534
  const { create: create$2, keys: keys$2 } = Object;
58535
58535
  const { stringify: stringify$1, parse: parse$1 } = JSON;
@@ -73789,9 +73789,54 @@ function selectType$6(typename, sel, fieldData, reader, key, sink, variables, fr
73789
73789
  return sink;
73790
73790
  }
73791
73791
 
73792
+ /**
73793
+ * Copyright (c) 2022, Salesforce, Inc.,
73794
+ * All rights reserved.
73795
+ * For full license text, see the LICENSE.txt file
73796
+ */
73797
+
73798
+ const API_NAMESPACE = 'UiApi';
73799
+ const RECORD_REPRESENTATION_NAME$1 = 'RecordRepresentation';
73800
+ const RECORD_VIEW_ENTITY_REPRESENTATION_NAME = 'RecordViewEntityRepresentation';
73801
+ const RECORD_ID_PREFIX = `${API_NAMESPACE}::${RECORD_REPRESENTATION_NAME$1}:`;
73802
+ const RECORD_VIEW_ENTITY_ID_PREFIX = `${API_NAMESPACE}::${RECORD_VIEW_ENTITY_REPRESENTATION_NAME}:Name:`;
73803
+ const RECORD_FIELDS_KEY_JUNCTION = '__fields__';
73804
+ function isStoreKeyRecordViewEntity(key) {
73805
+ return (key.indexOf(RECORD_VIEW_ENTITY_ID_PREFIX) > -1 &&
73806
+ key.indexOf(RECORD_FIELDS_KEY_JUNCTION) === -1);
73807
+ }
73808
+ function extractRecordIdFromStoreKey(key) {
73809
+ if (key === undefined ||
73810
+ (key.indexOf(RECORD_ID_PREFIX) === -1 && key.indexOf(RECORD_VIEW_ENTITY_ID_PREFIX) === -1)) {
73811
+ return undefined;
73812
+ }
73813
+ const parts = key.split(':');
73814
+ return parts[parts.length - 1].split('_')[0];
73815
+ }
73816
+ function buildRecordRepKeyFromId(recordId) {
73817
+ return `${API_NAMESPACE}::${RECORD_REPRESENTATION_NAME$1}:${recordId}`;
73818
+ }
73819
+
73792
73820
  function attachMappedData(source, reader) {
73793
- const linkedRecordId = source.__link && source.__link.__ref;
73821
+ let linkedRecordId = source.__link && source.__link.__ref;
73794
73822
  if (linkedRecordId !== undefined) {
73823
+ // Discovered with: W-13612372
73824
+ // We get wrong apiName for polymorphic parents when using getRecord
73825
+ // this breaks store links as it essentially creates wrong keys
73826
+ // also worth noting that polymorphic parents from REST are stored in RecordViewEntityRepresentation
73827
+ // while polymorphic parents from graphql are just another RecordRepresentation
73828
+ // Here, if we see a RecordViewEntityRepresentation key then we point it to
73829
+ // corresponding RecordRepresentation key that graphql adapter can understand
73830
+ // this essentially also means that polymorphic parent Records can be inconsistent
73831
+ // across graphql and getRecord snapshots and subsequent requests from getRecord
73832
+ // to fetch the referenced parent record directly
73833
+ // This behavior is at parity with getRecord wire adapter
73834
+ if (isStoreKeyRecordViewEntity(linkedRecordId)) {
73835
+ const recordId = extractRecordIdFromStoreKey(linkedRecordId);
73836
+ if (recordId) {
73837
+ linkedRecordId = buildRecordRepKeyFromId(recordId);
73838
+ }
73839
+ }
73795
73840
  reader.markSeenId(linkedRecordId);
73796
73841
  const linkedData = reader.read({
73797
73842
  recordId: linkedRecordId,
@@ -76759,7 +76804,7 @@ register({
76759
76804
  configuration: { ...configurationForGraphQLAdapters },
76760
76805
  instrument,
76761
76806
  });
76762
- // version: 1.213.1-79de10fe1
76807
+ // version: 1.213.2-1eb996209
76763
76808
 
76764
76809
  // On core the unstable adapters are re-exported with different names,
76765
76810
 
@@ -79006,7 +79051,7 @@ withDefaultLuvio((luvio) => {
79006
79051
  unstable_graphQL_imperative = createImperativeAdapter(luvio, createInstrumentedAdapter(ldsAdapter, adapterMetadata), adapterMetadata);
79007
79052
  graphQLImperative = ldsAdapter;
79008
79053
  });
79009
- // version: 1.213.1-79de10fe1
79054
+ // version: 1.213.2-1eb996209
79010
79055
 
79011
79056
  var gqlApi = /*#__PURE__*/Object.freeze({
79012
79057
  __proto__: null,
@@ -79720,4 +79765,4 @@ const { luvio } = getRuntime();
79720
79765
  setDefaultLuvio({ luvio });
79721
79766
 
79722
79767
  export { createPrimingSession, draftManager, draftQueue, executeAdapter, executeMutatingAdapter, getImperativeAdapterNames, invokeAdapter, invokeAdapterWithDraftToReplace, invokeAdapterWithMetadata, nimbusDraftQueue, registerReportObserver, setMetadataTTL, setUiApiRecordTTL, subscribeToAdapter };
79723
- // version: 1.213.1-1ba9571c8
79768
+ // version: 1.213.2-69d4eea1b
@@ -3904,7 +3904,7 @@
3904
3904
  }
3905
3905
  callbacks.push(callback);
3906
3906
  }
3907
- // version: 1.213.1-1ba9571c8
3907
+ // version: 1.213.2-69d4eea1b
3908
3908
 
3909
3909
  // TODO [TD-0081508]: once that TD is fulfilled we can probably change this file
3910
3910
  function instrumentAdapter$1(createFunction, _metadata) {
@@ -15337,7 +15337,7 @@
15337
15337
  updateReferenceMapWithKnownKey(ast, luvioDocumentNode);
15338
15338
  return luvioDocumentNode;
15339
15339
  }
15340
- // version: 1.213.1-1ba9571c8
15340
+ // version: 1.213.2-69d4eea1b
15341
15341
 
15342
15342
  function unwrap(data) {
15343
15343
  // The lwc-luvio bindings import a function from lwc called "unwrap".
@@ -16260,7 +16260,7 @@
16260
16260
  const { apiFamily, name } = metadata;
16261
16261
  return createGraphQLWireAdapterConstructor$1(adapter, `${apiFamily}.${name}`, luvio, astResolver);
16262
16262
  }
16263
- // version: 1.213.1-1ba9571c8
16263
+ // version: 1.213.2-69d4eea1b
16264
16264
 
16265
16265
  /**
16266
16266
  * Copyright (c) 2022, Salesforce, Inc.,
@@ -41937,7 +41937,7 @@
41937
41937
  });
41938
41938
  throttle(60, 60000, createLDSAdapter(luvio, 'notifyListViewSummaryUpdateAvailable', notifyUpdateAvailableFactory));
41939
41939
  });
41940
- // version: 1.213.1-79de10fe1
41940
+ // version: 1.213.2-1eb996209
41941
41941
 
41942
41942
  var caseSensitiveUserId = '005B0000000GR4OIAW';
41943
41943
 
@@ -48561,32 +48561,32 @@
48561
48561
  * For full license text, see the LICENSE.txt file
48562
48562
  */
48563
48563
 
48564
- const API_NAMESPACE = 'UiApi';
48565
- const RECORD_REPRESENTATION_NAME$1 = 'RecordRepresentation';
48566
- const RECORD_VIEW_ENTITY_REPRESENTATION_NAME = 'RecordViewEntityRepresentation';
48567
- const RECORD_ID_PREFIX = `${API_NAMESPACE}::${RECORD_REPRESENTATION_NAME$1}:`;
48568
- const RECORD_VIEW_ENTITY_ID_PREFIX = `${API_NAMESPACE}::${RECORD_VIEW_ENTITY_REPRESENTATION_NAME}:Name:`;
48569
- const RECORD_FIELDS_KEY_JUNCTION = '__fields__';
48564
+ const API_NAMESPACE$1 = 'UiApi';
48565
+ const RECORD_REPRESENTATION_NAME$2 = 'RecordRepresentation';
48566
+ const RECORD_VIEW_ENTITY_REPRESENTATION_NAME$1 = 'RecordViewEntityRepresentation';
48567
+ const RECORD_ID_PREFIX$1 = `${API_NAMESPACE$1}::${RECORD_REPRESENTATION_NAME$2}:`;
48568
+ const RECORD_VIEW_ENTITY_ID_PREFIX$1 = `${API_NAMESPACE$1}::${RECORD_VIEW_ENTITY_REPRESENTATION_NAME$1}:Name:`;
48569
+ const RECORD_FIELDS_KEY_JUNCTION$1 = '__fields__';
48570
48570
  function isStoreKeyRecordId(key) {
48571
- return key.indexOf(RECORD_ID_PREFIX) > -1 && key.indexOf(RECORD_FIELDS_KEY_JUNCTION) === -1;
48571
+ return key.indexOf(RECORD_ID_PREFIX$1) > -1 && key.indexOf(RECORD_FIELDS_KEY_JUNCTION$1) === -1;
48572
48572
  }
48573
- function isStoreKeyRecordViewEntity(key) {
48574
- return (key.indexOf(RECORD_VIEW_ENTITY_ID_PREFIX) > -1 &&
48575
- key.indexOf(RECORD_FIELDS_KEY_JUNCTION) === -1);
48573
+ function isStoreKeyRecordViewEntity$1(key) {
48574
+ return (key.indexOf(RECORD_VIEW_ENTITY_ID_PREFIX$1) > -1 &&
48575
+ key.indexOf(RECORD_FIELDS_KEY_JUNCTION$1) === -1);
48576
48576
  }
48577
48577
  function isStoreKeyRecordField(key) {
48578
- return key.indexOf(RECORD_ID_PREFIX) > -1 && key.indexOf(RECORD_FIELDS_KEY_JUNCTION) > -1;
48578
+ return key.indexOf(RECORD_ID_PREFIX$1) > -1 && key.indexOf(RECORD_FIELDS_KEY_JUNCTION$1) > -1;
48579
48579
  }
48580
- function extractRecordIdFromStoreKey(key) {
48580
+ function extractRecordIdFromStoreKey$1(key) {
48581
48581
  if (key === undefined ||
48582
- (key.indexOf(RECORD_ID_PREFIX) === -1 && key.indexOf(RECORD_VIEW_ENTITY_ID_PREFIX) === -1)) {
48582
+ (key.indexOf(RECORD_ID_PREFIX$1) === -1 && key.indexOf(RECORD_VIEW_ENTITY_ID_PREFIX$1) === -1)) {
48583
48583
  return undefined;
48584
48584
  }
48585
48585
  const parts = key.split(':');
48586
48586
  return parts[parts.length - 1].split('_')[0];
48587
48587
  }
48588
48588
  function buildRecordFieldStoreKey(recordKey, fieldName) {
48589
- return `${recordKey}${RECORD_FIELDS_KEY_JUNCTION}${fieldName}`;
48589
+ return `${recordKey}${RECORD_FIELDS_KEY_JUNCTION$1}${fieldName}`;
48590
48590
  }
48591
48591
 
48592
48592
  function isStoreRecordError(storeRecord) {
@@ -48594,7 +48594,7 @@
48594
48594
  }
48595
48595
  function isEntryDurableRecordRepresentation(entry, key) {
48596
48596
  // Either a DurableRecordRepresentation or StoreRecordError can live at a record key
48597
- return ((isStoreKeyRecordId(key) || isStoreKeyRecordViewEntity(key)) &&
48597
+ return ((isStoreKeyRecordId(key) || isStoreKeyRecordViewEntity$1(key)) &&
48598
48598
  entry.data.__type === undefined);
48599
48599
  }
48600
48600
 
@@ -52959,7 +52959,7 @@
52959
52959
  // no mapping exists -- return the request un-modified
52960
52960
  return request;
52961
52961
  }
52962
- const canonicalId = extractRecordIdFromStoreKey(canonicalRecordStoreKey);
52962
+ const canonicalId = extractRecordIdFromStoreKey$1(canonicalRecordStoreKey);
52963
52963
  if (canonicalId === undefined) {
52964
52964
  // could not resolve id from request -- return the request un-modified
52965
52965
  return request;
@@ -53069,7 +53069,7 @@
53069
53069
  const canonicalKey = env.storeGetCanonicalKey(recordKey);
53070
53070
  if (recordKey !== canonicalKey) {
53071
53071
  // record is no longer a draft, include the canonical id in the request
53072
- const canonicalId = extractRecordIdFromStoreKey(canonicalKey);
53072
+ const canonicalId = extractRecordIdFromStoreKey$1(canonicalKey);
53073
53073
  if (canonicalId !== undefined) {
53074
53074
  canonicalIds.push(canonicalId);
53075
53075
  }
@@ -53712,10 +53712,10 @@
53712
53712
  return undefined;
53713
53713
  }
53714
53714
  canRepresentationContainDraftMetadata(representationName) {
53715
- return representationName === RECORD_REPRESENTATION_NAME$1;
53715
+ return representationName === RECORD_REPRESENTATION_NAME$2;
53716
53716
  }
53717
53717
  canHandlePublish(key) {
53718
- return extractRecordIdFromStoreKey(key) !== undefined;
53718
+ return extractRecordIdFromStoreKey$1(key) !== undefined;
53719
53719
  }
53720
53720
  buildTagForTargetId(id) {
53721
53721
  return getRecordKeyForId(this.getLuvio(), id);
@@ -53771,7 +53771,7 @@
53771
53771
  }
53772
53772
  }
53773
53773
  async getDraftMetadata(key) {
53774
- const recordId = extractRecordIdFromStoreKey(key);
53774
+ const recordId = extractRecordIdFromStoreKey$1(key);
53775
53775
  if (recordId === undefined) {
53776
53776
  return undefined;
53777
53777
  }
@@ -53800,7 +53800,7 @@
53800
53800
  return undefined;
53801
53801
  }
53802
53802
  const key = action.tag;
53803
- const recordId = extractRecordIdFromStoreKey(key);
53803
+ const recordId = extractRecordIdFromStoreKey$1(key);
53804
53804
  if (recordId === undefined) {
53805
53805
  throw Error('could not determine record id');
53806
53806
  }
@@ -53924,7 +53924,7 @@
53924
53924
  const draftKey = this.buildTagForTargetId(fieldValue);
53925
53925
  const canonicalKey = this.getLuvio().storeGetCanonicalKey(draftKey);
53926
53926
  if (draftKey !== canonicalKey) {
53927
- const canonicalId = extractRecordIdFromStoreKey(canonicalKey);
53927
+ const canonicalId = extractRecordIdFromStoreKey$1(canonicalKey);
53928
53928
  if (canonicalId !== undefined) {
53929
53929
  bodyFields[fieldName] = canonicalId;
53930
53930
  }
@@ -53944,7 +53944,7 @@
53944
53944
  const recordKey = this.buildTagForTargetId(recordId);
53945
53945
  const canonicalKey = this.getLuvio().storeGetCanonicalKey(recordKey);
53946
53946
  if (recordKey !== canonicalKey) {
53947
- const canonicalId = extractRecordIdFromStoreKey(canonicalKey);
53947
+ const canonicalId = extractRecordIdFromStoreKey$1(canonicalKey);
53948
53948
  if (canonicalId === undefined) {
53949
53949
  // could not resolve id from request -- return the request un-modified
53950
53950
  return request;
@@ -54071,8 +54071,8 @@
54071
54071
  // this will likely need to be handled when moving to structured keys
54072
54072
  // note record view entities dont have an associated keybuilder. They get ingested as records to a different key format
54073
54073
  // see the override for how they are handled packages/lds-adapters-uiapi/src/raml-artifacts/types/RecordRepresentation/keyBuilderFromType.ts
54074
- if (originalKey.startsWith(RECORD_VIEW_ENTITY_ID_PREFIX)) {
54075
- return RECORD_VIEW_ENTITY_ID_PREFIX + recordId;
54074
+ if (originalKey.startsWith(RECORD_VIEW_ENTITY_ID_PREFIX$1)) {
54075
+ return RECORD_VIEW_ENTITY_ID_PREFIX$1 + recordId;
54076
54076
  }
54077
54077
  return keyBuilder$1U(luvio, { recordId });
54078
54078
  }
@@ -54093,9 +54093,9 @@
54093
54093
  const recordViewEntries = {};
54094
54094
  for (let i = 0, len = entriesLength; i < len; i++) {
54095
54095
  const id = entries[i];
54096
- const recordId = extractRecordIdFromStoreKey(id);
54096
+ const recordId = extractRecordIdFromStoreKey$1(id);
54097
54097
  if (recordId !== undefined) {
54098
- if (id.startsWith(RECORD_VIEW_ENTITY_ID_PREFIX)) {
54098
+ if (id.startsWith(RECORD_VIEW_ENTITY_ID_PREFIX$1)) {
54099
54099
  if (recordViewEntries[recordId] === undefined) {
54100
54100
  const key = getDenormalizedKey(id, recordId, luvio);
54101
54101
  recordViewEntries[recordId] = true;
@@ -54147,10 +54147,10 @@
54147
54147
  for (let i = 0, len = keys$1.length; i < len; i++) {
54148
54148
  const key = keys$1[i];
54149
54149
  let value = entries[key];
54150
- const recordId = extractRecordIdFromStoreKey(key);
54150
+ const recordId = extractRecordIdFromStoreKey$1(key);
54151
54151
  // do not put normalized field values
54152
54152
  if (recordId !== undefined) {
54153
- const isRecordView = key.startsWith(RECORD_VIEW_ENTITY_ID_PREFIX);
54153
+ const isRecordView = key.startsWith(RECORD_VIEW_ENTITY_ID_PREFIX$1);
54154
54154
  if (isRecordView) {
54155
54155
  if (putRecordViews[recordId] === true) {
54156
54156
  continue;
@@ -54665,7 +54665,7 @@
54665
54665
  function draftAwareGraphQLAdapterFactory(userId, objectInfoService, store, luvio, isDraftId) {
54666
54666
  const getCanonicalId = (id) => {
54667
54667
  var _a;
54668
- return ((_a = extractRecordIdFromStoreKey(luvio.storeGetCanonicalKey(RECORD_ID_PREFIX + id))) !== null && _a !== void 0 ? _a : id);
54668
+ return ((_a = extractRecordIdFromStoreKey$1(luvio.storeGetCanonicalKey(RECORD_ID_PREFIX$1 + id))) !== null && _a !== void 0 ? _a : id);
54669
54669
  };
54670
54670
  return async function draftAwareGraphQLAdapter(config, buildCachedSnapshotCachePolicy, buildNetworkSnapshotCachePolicy, requestContext = {}) {
54671
54671
  //create a copy to not accidentally modify the AST in the astResolver map of luvio
@@ -54848,7 +54848,7 @@
54848
54848
  return key.replace(ContentDocumentCompositeKeyPrefix, '');
54849
54849
  }
54850
54850
  // else it's a record rep
54851
- return extractRecordIdFromStoreKey(key);
54851
+ return extractRecordIdFromStoreKey$1(key);
54852
54852
  });
54853
54853
  return async function createContentDocumentAndVersionDraftAdapter(config, buildNetworkSnapshot, requestContext) {
54854
54854
  const context = requestContext || {};
@@ -55307,7 +55307,7 @@
55307
55307
  * register it with the DraftQueue, runtime should set that up
55308
55308
  */
55309
55309
  function createRecordDraftAdapterFactory(luvio, actionHandler) {
55310
- const luvioWithDraftOverrides = buildLuvioOverrideForDraftAdapters(luvio, actionHandler, extractRecordIdFromStoreKey);
55310
+ const luvioWithDraftOverrides = buildLuvioOverrideForDraftAdapters(luvio, actionHandler, extractRecordIdFromStoreKey$1);
55311
55311
  return function createRecordDraftAdapter(config, buildNetworkSnapshot) {
55312
55312
  return buildNetworkSnapshot(luvioWithDraftOverrides, config);
55313
55313
  };
@@ -55320,7 +55320,7 @@
55320
55320
  * register it with the DraftQueue, runtime should set that up
55321
55321
  */
55322
55322
  function updateRecordDraftAdapterFactory(luvio, actionHandler) {
55323
- const luvioWithDraftOverrides = buildLuvioOverrideForDraftAdapters(luvio, actionHandler, extractRecordIdFromStoreKey);
55323
+ const luvioWithDraftOverrides = buildLuvioOverrideForDraftAdapters(luvio, actionHandler, extractRecordIdFromStoreKey$1);
55324
55324
  return function updateRecordDraftAdapter(config, buildNetworkSnapshot) {
55325
55325
  return buildNetworkSnapshot(luvioWithDraftOverrides, config);
55326
55326
  };
@@ -55333,7 +55333,7 @@
55333
55333
  * register it with the DraftQueue, runtime should set that up
55334
55334
  */
55335
55335
  function deleteRecordDraftAdapterFactory(luvio, actionHandler) {
55336
- const luvioWithDraftOverrides = buildLuvioOverrideForDraftAdapters(luvio, actionHandler, extractRecordIdFromStoreKey, { forDeleteAdapter: true });
55336
+ const luvioWithDraftOverrides = buildLuvioOverrideForDraftAdapters(luvio, actionHandler, extractRecordIdFromStoreKey$1, { forDeleteAdapter: true });
55337
55337
  return function deleteRecordDraftAdapter(config, buildNetworkSnapshot) {
55338
55338
  return buildNetworkSnapshot(luvioWithDraftOverrides, config);
55339
55339
  };
@@ -58284,7 +58284,7 @@
58284
58284
  try {
58285
58285
  const result = await this.store.query(statement, params);
58286
58286
  for (const row of result.rows) {
58287
- const id = extractRecordIdFromStoreKey(row[0]);
58287
+ const id = extractRecordIdFromStoreKey$1(row[0]);
58288
58288
  if (id) {
58289
58289
  written.push(id);
58290
58290
  idsToPrime.delete(id);
@@ -58474,7 +58474,7 @@
58474
58474
  const { configuration: { setStoreEval, setDraftFunctions }, } = registration;
58475
58475
  const getCanonicalId = (id) => {
58476
58476
  var _a;
58477
- return ((_a = extractRecordIdFromStoreKey(lazyLuvio.storeGetCanonicalKey(RECORD_ID_PREFIX + id))) !== null && _a !== void 0 ? _a : id);
58477
+ return ((_a = extractRecordIdFromStoreKey$1(lazyLuvio.storeGetCanonicalKey(RECORD_ID_PREFIX$1 + id))) !== null && _a !== void 0 ? _a : id);
58478
58478
  };
58479
58479
  const draftFuncs = {
58480
58480
  isDraftId: isGenerated,
@@ -58535,7 +58535,7 @@
58535
58535
  id: '@salesforce/lds-network-adapter',
58536
58536
  instrument: instrument$1,
58537
58537
  });
58538
- // version: 1.213.1-1ba9571c8
58538
+ // version: 1.213.2-69d4eea1b
58539
58539
 
58540
58540
  const { create: create$2, keys: keys$2 } = Object;
58541
58541
  const { stringify: stringify$1, parse: parse$1 } = JSON;
@@ -73795,9 +73795,54 @@
73795
73795
  return sink;
73796
73796
  }
73797
73797
 
73798
+ /**
73799
+ * Copyright (c) 2022, Salesforce, Inc.,
73800
+ * All rights reserved.
73801
+ * For full license text, see the LICENSE.txt file
73802
+ */
73803
+
73804
+ const API_NAMESPACE = 'UiApi';
73805
+ const RECORD_REPRESENTATION_NAME$1 = 'RecordRepresentation';
73806
+ const RECORD_VIEW_ENTITY_REPRESENTATION_NAME = 'RecordViewEntityRepresentation';
73807
+ const RECORD_ID_PREFIX = `${API_NAMESPACE}::${RECORD_REPRESENTATION_NAME$1}:`;
73808
+ const RECORD_VIEW_ENTITY_ID_PREFIX = `${API_NAMESPACE}::${RECORD_VIEW_ENTITY_REPRESENTATION_NAME}:Name:`;
73809
+ const RECORD_FIELDS_KEY_JUNCTION = '__fields__';
73810
+ function isStoreKeyRecordViewEntity(key) {
73811
+ return (key.indexOf(RECORD_VIEW_ENTITY_ID_PREFIX) > -1 &&
73812
+ key.indexOf(RECORD_FIELDS_KEY_JUNCTION) === -1);
73813
+ }
73814
+ function extractRecordIdFromStoreKey(key) {
73815
+ if (key === undefined ||
73816
+ (key.indexOf(RECORD_ID_PREFIX) === -1 && key.indexOf(RECORD_VIEW_ENTITY_ID_PREFIX) === -1)) {
73817
+ return undefined;
73818
+ }
73819
+ const parts = key.split(':');
73820
+ return parts[parts.length - 1].split('_')[0];
73821
+ }
73822
+ function buildRecordRepKeyFromId(recordId) {
73823
+ return `${API_NAMESPACE}::${RECORD_REPRESENTATION_NAME$1}:${recordId}`;
73824
+ }
73825
+
73798
73826
  function attachMappedData(source, reader) {
73799
- const linkedRecordId = source.__link && source.__link.__ref;
73827
+ let linkedRecordId = source.__link && source.__link.__ref;
73800
73828
  if (linkedRecordId !== undefined) {
73829
+ // Discovered with: W-13612372
73830
+ // We get wrong apiName for polymorphic parents when using getRecord
73831
+ // this breaks store links as it essentially creates wrong keys
73832
+ // also worth noting that polymorphic parents from REST are stored in RecordViewEntityRepresentation
73833
+ // while polymorphic parents from graphql are just another RecordRepresentation
73834
+ // Here, if we see a RecordViewEntityRepresentation key then we point it to
73835
+ // corresponding RecordRepresentation key that graphql adapter can understand
73836
+ // this essentially also means that polymorphic parent Records can be inconsistent
73837
+ // across graphql and getRecord snapshots and subsequent requests from getRecord
73838
+ // to fetch the referenced parent record directly
73839
+ // This behavior is at parity with getRecord wire adapter
73840
+ if (isStoreKeyRecordViewEntity(linkedRecordId)) {
73841
+ const recordId = extractRecordIdFromStoreKey(linkedRecordId);
73842
+ if (recordId) {
73843
+ linkedRecordId = buildRecordRepKeyFromId(recordId);
73844
+ }
73845
+ }
73801
73846
  reader.markSeenId(linkedRecordId);
73802
73847
  const linkedData = reader.read({
73803
73848
  recordId: linkedRecordId,
@@ -76765,7 +76810,7 @@
76765
76810
  configuration: { ...configurationForGraphQLAdapters },
76766
76811
  instrument,
76767
76812
  });
76768
- // version: 1.213.1-79de10fe1
76813
+ // version: 1.213.2-1eb996209
76769
76814
 
76770
76815
  // On core the unstable adapters are re-exported with different names,
76771
76816
 
@@ -79012,7 +79057,7 @@
79012
79057
  unstable_graphQL_imperative = createImperativeAdapter(luvio, createInstrumentedAdapter(ldsAdapter, adapterMetadata), adapterMetadata);
79013
79058
  graphQLImperative = ldsAdapter;
79014
79059
  });
79015
- // version: 1.213.1-79de10fe1
79060
+ // version: 1.213.2-1eb996209
79016
79061
 
79017
79062
  var gqlApi = /*#__PURE__*/Object.freeze({
79018
79063
  __proto__: null,
@@ -79743,4 +79788,4 @@
79743
79788
  Object.defineProperty(exports, '__esModule', { value: true });
79744
79789
 
79745
79790
  }));
79746
- // version: 1.213.1-1ba9571c8
79791
+ // version: 1.213.2-69d4eea1b
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/lds-worker-api",
3
- "version": "1.213.1",
3
+ "version": "1.213.2",
4
4
  "license": "SEE LICENSE IN LICENSE.txt",
5
5
  "description": "",
6
6
  "main": "dist/standalone/es/lds-worker-api.js",