@salesforce/lds-worker-api 1.287.1 → 1.289.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.
@@ -1074,4 +1074,4 @@ if (process.env.NODE_ENV !== 'production') {
1074
1074
  }
1075
1075
 
1076
1076
  export { createPrimingSession, draftManager, draftQueue, evictCacheRecordsByIds, evictExpiredCacheEntries, executeAdapter, executeMutatingAdapter, getImperativeAdapterNames, invokeAdapter, invokeAdapterWithDraftToMerge, invokeAdapterWithDraftToReplace, invokeAdapterWithMetadata, nimbusDraftQueue, setMetadataTTL, setUiApiRecordTTL, stopEviction, subscribeToAdapter };
1077
- // version: 1.287.1-2951538ee
1077
+ // version: 1.289.0-5ba45a0a4
@@ -4062,7 +4062,7 @@ function createResourceParamsImpl(config, configMetadata) {
4062
4062
  }
4063
4063
  return resourceParams;
4064
4064
  }
4065
- // engine version: 0.154.17-b8f04923
4065
+ // engine version: 0.154.18-b8141c42
4066
4066
 
4067
4067
  /**
4068
4068
  * Copyright (c) 2022, Salesforce, Inc.,
@@ -4190,7 +4190,7 @@ function withDefaultLuvio(callback) {
4190
4190
  }
4191
4191
  callbacks.push(callback);
4192
4192
  }
4193
- // version: 1.287.1-2951538ee
4193
+ // version: 1.289.0-5ba45a0a4
4194
4194
 
4195
4195
  // TODO [TD-0081508]: once that TD is fulfilled we can probably change this file
4196
4196
  function instrumentAdapter$1(createFunction, _metadata) {
@@ -15698,7 +15698,7 @@ function gql(literals, ...subs) {
15698
15698
  }
15699
15699
  return superResult;
15700
15700
  }
15701
- // version: 1.287.1-2951538ee
15701
+ // version: 1.289.0-5ba45a0a4
15702
15702
 
15703
15703
  function unwrap(data) {
15704
15704
  // The lwc-luvio bindings import a function from lwc called "unwrap".
@@ -16623,7 +16623,7 @@ function createGraphQLWireAdapterConstructor(luvio, adapter, metadata, astResolv
16623
16623
  const { apiFamily, name } = metadata;
16624
16624
  return createGraphQLWireAdapterConstructor$1(adapter, `${apiFamily}.${name}`, luvio, astResolver);
16625
16625
  }
16626
- // version: 1.287.1-2951538ee
16626
+ // version: 1.289.0-5ba45a0a4
16627
16627
 
16628
16628
  /**
16629
16629
  * Copyright (c) 2022, Salesforce, Inc.,
@@ -16722,7 +16722,7 @@ var TypeCheckShapes;
16722
16722
  TypeCheckShapes[TypeCheckShapes["Integer"] = 3] = "Integer";
16723
16723
  TypeCheckShapes[TypeCheckShapes["Unsupported"] = 4] = "Unsupported";
16724
16724
  })(TypeCheckShapes || (TypeCheckShapes = {}));
16725
- // engine version: 0.154.17-b8f04923
16725
+ // engine version: 0.154.18-b8141c42
16726
16726
 
16727
16727
  const { keys: ObjectKeys$3, create: ObjectCreate$3 } = Object;
16728
16728
 
@@ -16844,6 +16844,10 @@ let oneStoreGetObjectInfoAdapter$2 = undefined;
16844
16844
  * One store enabled Get Object Infos adapter
16845
16845
  */
16846
16846
  let oneStoreGetObjectInfosAdapter$2 = undefined;
16847
+ /**
16848
+ * Determines when to include PDL strategies for Related Lists
16849
+ */
16850
+ let relatedListsPredictionsEnabled$2 = false;
16847
16851
  /**
16848
16852
  * Defines the configuration API and is exposed internally as well as externally.
16849
16853
  * Configuration for one store enabled REST adapters only.
@@ -16928,6 +16932,12 @@ const configurationForRestAdapters$2 = {
16928
16932
  getDraftAwareCreateContentDocumentAndVersionAdapter: function () {
16929
16933
  return draftAwareCreateContentDocumentAndVersionAdapter$2;
16930
16934
  },
16935
+ setRelatedListsPredictionsEnabled: function (f) {
16936
+ relatedListsPredictionsEnabled$2 = f;
16937
+ },
16938
+ areRelatedListsPredictionsEnabled: function () {
16939
+ return relatedListsPredictionsEnabled$2 === true;
16940
+ },
16931
16941
  // createContentVersion
16932
16942
  setDraftAwareCreateContentVersionAdapter: function (adapter) {
16933
16943
  draftAwareCreateContentVersionAdapter$2 = adapter;
@@ -17044,6 +17054,16 @@ function createLDSAdapterWithPrediction(adapter, luvio, name) {
17044
17054
  return result;
17045
17055
  };
17046
17056
  }
17057
+ function createRelatedListAdapterWithPrediction(adapter, luvio, name) {
17058
+ if (configurationForRestAdapters$2.areRelatedListsPredictionsEnabled() /* gate is open */) {
17059
+ return createLDSAdapterWithPrediction(adapter, luvio, name);
17060
+ }
17061
+ else {
17062
+ return (config, requestContext) => {
17063
+ return adapter(config, requestContext);
17064
+ };
17065
+ }
17066
+ }
17047
17067
 
17048
17068
  const { hasOwnProperty: ObjectPrototypeHasOwnProperty$2 } = Object.prototype;
17049
17069
  const { keys: ObjectKeys$1$2, create: ObjectCreate$1$2 } = Object;
@@ -43854,13 +43874,13 @@ function bindExportsTo$1(luvio) {
43854
43874
  const getRelatedListActions_ldsAdapter = createInstrumentedAdapter(createLDSAdapter(luvio, 'getRelatedListActions', getRelatedListActionsAdapterFactory), getRelatedListActionsMetadata);
43855
43875
  const getRelatedListCount_ldsAdapter = createInstrumentedAdapter(createLDSAdapter(luvio, 'getRelatedListCount', getRelatedListCountAdapterFactory), getRelatedListCountMetadata);
43856
43876
  const getRelatedListInfo_ldsAdapter = createInstrumentedAdapter(createLDSAdapter(luvio, 'getRelatedListInfo', getRelatedListInfoAdapterFactory), getRelatedListInfoMetadata);
43857
- const getRelatedListInfoBatch_ldsAdapter = createInstrumentedAdapter(createLDSAdapterWithPrediction(createLDSAdapter(luvio, 'getRelatedListInfoBatch', getRelatedListInfoBatchAdapterFactory), luvio, 'getRelatedListInfoBatch'), getRelatedListInfoBatchMetadata);
43877
+ const getRelatedListInfoBatch_ldsAdapter = createInstrumentedAdapter(createRelatedListAdapterWithPrediction(createLDSAdapter(luvio, 'getRelatedListInfoBatch', getRelatedListInfoBatchAdapterFactory), luvio, 'getRelatedListInfoBatch'), getRelatedListInfoBatchMetadata);
43858
43878
  const getRelatedListPreferences_ldsAdapter = createInstrumentedAdapter(createLDSAdapter(luvio, 'getRelatedListPreferences', getRelatedListPreferencesAdapterFactory), getRelatedListPreferencesMetadata);
43859
43879
  const getRelatedListPreferencesBatch_ldsAdapter = createInstrumentedAdapter(createLDSAdapter(luvio, 'getRelatedListPreferencesBatch', getRelatedListPreferencesBatchAdapterFactory), getRelatedListPreferencesBatchMetadata);
43860
43880
  const getRelatedListRecordActions_ldsAdapter = createInstrumentedAdapter(createLDSAdapter(luvio, 'getRelatedListRecordActions', getRelatedListRecordActionsAdapterFactory), getRelatedListRecordActionsMetadata);
43861
- const getRelatedListRecords_ldsAdapter = createInstrumentedAdapter(createLDSAdapterWithPrediction(createLDSAdapter(luvio, 'getRelatedListRecords', getRelatedListRecordsAdapterFactory), luvio, 'getRelatedListRecords'), getRelatedListRecordsMetadata);
43862
- const getRelatedListRecordsBatch_ldsAdapter = createInstrumentedAdapter(createLDSAdapterWithPrediction(createLDSAdapter(luvio, 'getRelatedListRecordsBatch', getRelatedListRecordsBatchAdapterFactory), luvio, 'getRelatedListRecordsBatch'), getRelatedListRecordsBatchMetadata);
43863
- const getRelatedListsActions_ldsAdapter = createInstrumentedAdapter(createLDSAdapterWithPrediction(createLDSAdapter(luvio, 'getRelatedListsActions', getRelatedListsActionsAdapterFactory), luvio, 'getRelatedListsActions'), getRelatedListsActionsMetadata);
43881
+ const getRelatedListRecords_ldsAdapter = createInstrumentedAdapter(createRelatedListAdapterWithPrediction(createLDSAdapter(luvio, 'getRelatedListRecords', getRelatedListRecordsAdapterFactory), luvio, 'getRelatedListRecords'), getRelatedListRecordsMetadata);
43882
+ const getRelatedListRecordsBatch_ldsAdapter = createInstrumentedAdapter(createRelatedListAdapterWithPrediction(createLDSAdapter(luvio, 'getRelatedListRecordsBatch', getRelatedListRecordsBatchAdapterFactory), luvio, 'getRelatedListRecordsBatch'), getRelatedListRecordsBatchMetadata);
43883
+ const getRelatedListsActions_ldsAdapter = createInstrumentedAdapter(createRelatedListAdapterWithPrediction(createLDSAdapter(luvio, 'getRelatedListsActions', getRelatedListsActionsAdapterFactory), luvio, 'getRelatedListsActions'), getRelatedListsActionsMetadata);
43864
43884
  const getRelatedListsCount_ldsAdapter = createInstrumentedAdapter(createLDSAdapter(luvio, 'getRelatedListsCount', getRelatedListsCountAdapterFactory), getRelatedListsCountMetadata);
43865
43885
  const getRelatedListsInfo_ldsAdapter = createInstrumentedAdapter(createLDSAdapter(luvio, 'getRelatedListsInfo', getRelatedListsInfoAdapterFactory), getRelatedListsInfoMetadata);
43866
43886
  const getSearchFilterMetadata_ldsAdapter = createInstrumentedAdapter(createLDSAdapter(luvio, 'getSearchFilterMetadata', getSearchFilterMetadataAdapterFactory), getSearchFilterMetadataMetadata);
@@ -44164,7 +44184,7 @@ withDefaultLuvio((luvio) => {
44164
44184
  throttle(60, 60000, setupNotifyAllListRecordUpdateAvailable(luvio));
44165
44185
  throttle(60, 60000, setupNotifyAllListInfoSummaryUpdateAvailable(luvio));
44166
44186
  });
44167
- // version: 1.287.1-e437af73a
44187
+ // version: 1.289.0-72256e363
44168
44188
 
44169
44189
  var ldsIdempotencyWriteDisabled = {
44170
44190
  isOpen: function (e) {
@@ -45473,7 +45493,7 @@ function makeDurable(environment, { durableStore, instrumentation, useRevivingSt
45473
45493
  // because we do not want some other code attempting to use the
45474
45494
  // in-memory values before the durable store onChanged handler
45475
45495
  // calls back and revives the values to in-memory
45476
- environment.storeEvict(key);
45496
+ environment.storeDealloc(key);
45477
45497
  };
45478
45498
  const publishStoreMetadata = function (recordId, storeMetadata) {
45479
45499
  validateNotDisposed();
@@ -56847,7 +56867,7 @@ function applyReferenceLinksToDraft(record, draftMetadata) {
56847
56867
  const referencedRecord = referencedRecords.get(key);
56848
56868
  recordFields[relationshipName] = {
56849
56869
  displayValue: null,
56850
- value: createLink$2(key),
56870
+ value: createLink$1$1(key),
56851
56871
  };
56852
56872
  // for custom objects, we select the 'Name' field
56853
56873
  // otherwise we check the object info for name fields.
@@ -56875,7 +56895,7 @@ function applyReferenceLinksToDraft(record, draftMetadata) {
56875
56895
  }
56876
56896
  return { ...record, fields: recordFields };
56877
56897
  }
56878
- function createLink$2(key) {
56898
+ function createLink$1$1(key) {
56879
56899
  return { __ref: key };
56880
56900
  }
56881
56901
  function getReferenceInfoForKey(fieldName, field, luvio, objectInfo) {
@@ -56890,7 +56910,7 @@ function getReferenceInfoForKey(fieldName, field, luvio, objectInfo) {
56890
56910
  referenceFieldName: relationshipName,
56891
56911
  field: {
56892
56912
  displayValue: null,
56893
- value: createLink$2(key),
56913
+ value: createLink$1$1(key),
56894
56914
  },
56895
56915
  };
56896
56916
  }
@@ -57353,6 +57373,9 @@ function isBackdatingFieldEditable(objectInfo, backdatingFieldName, attributeNam
57353
57373
  !draftActionFieldNames.includes(backdatingFieldName));
57354
57374
  }
57355
57375
 
57376
+ function createLink$2(key) {
57377
+ return { __ref: key };
57378
+ }
57356
57379
  /**
57357
57380
  * Records are stored in the durable store with scalar fields denormalized. This function takes that denoramlized
57358
57381
  * durable store record representation and normalizes it back out into the format the the luvio store expects it
@@ -57363,26 +57386,25 @@ function isBackdatingFieldEditable(objectInfo, backdatingFieldName, attributeNam
57363
57386
  function normalizeRecordFields(key, entry) {
57364
57387
  const { data: record } = entry;
57365
57388
  const { fields, links } = record;
57366
- const linkNames = keys$3$1(links);
57389
+ const missingFieldLinks = keys$3$1(links);
57390
+ const fieldNames = keys$3$1(fields);
57367
57391
  const normalizedFields = {};
57368
57392
  const returnEntries = {};
57369
- for (let i = 0, len = linkNames.length; i < len; i++) {
57370
- const fieldName = linkNames[i];
57393
+ // restore fields
57394
+ for (let i = 0, len = fieldNames.length; i < len; i++) {
57395
+ const fieldName = fieldNames[i];
57371
57396
  const field = fields[fieldName];
57397
+ const fieldKey = buildRecordFieldStoreKey(key, fieldName);
57398
+ returnEntries[fieldKey] = { data: field };
57399
+ normalizedFields[fieldName] = createLink$2(fieldKey);
57400
+ }
57401
+ // restore missing fields
57402
+ for (let i = 0, len = missingFieldLinks.length; i < len; i++) {
57403
+ const fieldName = missingFieldLinks[i];
57372
57404
  const link = links[fieldName];
57373
- // field is undefined for missing links
57374
- if (field !== undefined) {
57375
- const fieldKey = buildRecordFieldStoreKey(key, fieldName);
57376
- returnEntries[fieldKey] = { data: field };
57377
- }
57378
- // we need to restore the undefined __ref node as it is
57379
- // lost during serialization
57380
57405
  if (link.isMissing === true) {
57381
57406
  normalizedFields[fieldName] = { ...link, __ref: undefined };
57382
57407
  }
57383
- else {
57384
- normalizedFields[fieldName] = link;
57385
- }
57386
57408
  }
57387
57409
  returnEntries[key] = {
57388
57410
  data: assign$3(record, { fields: normalizedFields }),
@@ -57444,7 +57466,7 @@ function buildDurableRecordRepresentation(normalizedRecord, records, pendingEntr
57444
57466
  }
57445
57467
  }
57446
57468
  // we want to preserve fields that are missing nodes
57447
- if (filteredFields[fieldName] !== undefined || field.isMissing === true) {
57469
+ if (field.isMissing === true) {
57448
57470
  links[fieldName] = field;
57449
57471
  }
57450
57472
  }
@@ -60099,9 +60121,11 @@ function enableObjectInfoCaching(env, ensureObjectInfoCached) {
60099
60121
  let apiName = null;
60100
60122
  let objectInfo;
60101
60123
  if (dataIsRecord(key)) {
60124
+ incomingRecords.delete(key);
60102
60125
  apiName = data.apiName;
60103
60126
  }
60104
60127
  else if (dataIsObjectInfo(key)) {
60128
+ incomingObjectInfos.delete(key);
60105
60129
  apiName = data.apiName;
60106
60130
  objectInfo = data;
60107
60131
  }
@@ -61776,7 +61800,6 @@ class RecordLoaderGraphQL {
61776
61800
  }, {});
61777
61801
  fields['Id'] = { value: id, displayValue: null };
61778
61802
  fields['RecordTypeId'] = { value: recordTypeId, displayValue: null };
61779
- const links = this.generateFieldLinks(id, [...requestedFields, 'Id', 'RecordTypeId']);
61780
61803
  return {
61781
61804
  apiName: node[`${requiredPrefix}ApiName`],
61782
61805
  childRelationships: {},
@@ -61798,18 +61821,9 @@ class RecordLoaderGraphQL {
61798
61821
  : null,
61799
61822
  weakEtag: node[`${requiredPrefix}WeakEtag`],
61800
61823
  fields,
61801
- links,
61824
+ links: {},
61802
61825
  };
61803
61826
  }
61804
- generateFieldLinks(id, fields) {
61805
- const links = {};
61806
- for (const field of fields) {
61807
- links[field] = {
61808
- __ref: `UiApi::RecordRepresentation:${id}__fields__${field}`,
61809
- };
61810
- }
61811
- return links;
61812
- }
61813
61827
  }
61814
61828
 
61815
61829
  class RecordIngestor {
@@ -62403,7 +62417,7 @@ register$1({
62403
62417
  id: '@salesforce/lds-network-adapter',
62404
62418
  instrument: instrument$2,
62405
62419
  });
62406
- // version: 1.287.1-2951538ee
62420
+ // version: 1.289.0-5ba45a0a4
62407
62421
 
62408
62422
  const { create: create$3, keys: keys$3 } = Object;
62409
62423
  const { stringify: stringify$1, parse: parse$1 } = JSON;
@@ -78805,6 +78819,29 @@ function getInContextFragmentType$d(fragment, fragmentMap) {
78805
78819
  return sharedGetFragmentType(fragment, fragmentMap);
78806
78820
  }
78807
78821
 
78822
+ function getFieldType$b(field) {
78823
+ const fieldName = field.name.value;
78824
+ switch (fieldName) {
78825
+ case '__typename': {
78826
+ return {
78827
+ isArray: false,
78828
+ typename: 'String',
78829
+ };
78830
+ }
78831
+ /*
78832
+ Probably should use metaschema like the RecordQuery graphql-artifact,
78833
+ but this type only has one generic type possible. Also, the most likely scenario for future schema additions,
78834
+ is UISDK adding the the parent of this type, Setup__Setup. Therefore, we will just default to SetupConnection so that
78835
+ query authors don't need to use metaschema when there's no real decision point in this type.
78836
+ */
78837
+ default:
78838
+ return {
78839
+ isArray: false,
78840
+ typename: 'Setup__SetupConnection',
78841
+ };
78842
+ }
78843
+ }
78844
+
78808
78845
  const name$2 = 'Setup__SetupQuery';
78809
78846
  const VERSION$a = 'b89cccb5fa5e458d89dc1137af3e5469';
78810
78847
  function keyBuilder$6(luvio, path, data) {
@@ -78922,24 +78959,6 @@ function getTypeCacheKeys$3(cacheKeySink, astNode, state) {
78922
78959
  }
78923
78960
  // Deal with mapped types' cache keys
78924
78961
  }
78925
- function getFieldType$b(field) {
78926
- switch (field.name.value) {
78927
- case '__typename': {
78928
- return {
78929
- isArray: false,
78930
- typename: 'String'
78931
- };
78932
- }
78933
- case 'recordQuery': {
78934
- return {
78935
- isArray: false,
78936
- typename: 'Setup__SetupConnection'
78937
- };
78938
- }
78939
- default:
78940
- return undefined;
78941
- }
78942
- }
78943
78962
  function ingestFieldByType$2(typename, parentKey, requestedField, sink, fieldKey, fieldData, state) {
78944
78963
  // TODO: add validation logic to only allow nullable fields to be null in the future
78945
78964
  if (fieldData === null) {
@@ -81344,6 +81363,10 @@ let oneStoreGetObjectInfoAdapter$1 = undefined;
81344
81363
  * One store enabled Get Object Infos adapter
81345
81364
  */
81346
81365
  let oneStoreGetObjectInfosAdapter$1 = undefined;
81366
+ /**
81367
+ * Determines when to include PDL strategies for Related Lists
81368
+ */
81369
+ let relatedListsPredictionsEnabled$1 = false;
81347
81370
  /**
81348
81371
  * Defines the configuration API and is exposed internally as well as externally.
81349
81372
  * Configuration for one store enabled REST adapters only.
@@ -81419,6 +81442,12 @@ const configurationForRestAdapters$1 = {
81419
81442
  getDraftAwareCreateContentDocumentAndVersionAdapter: function () {
81420
81443
  return draftAwareCreateContentDocumentAndVersionAdapter$1;
81421
81444
  },
81445
+ setRelatedListsPredictionsEnabled: function (f) {
81446
+ relatedListsPredictionsEnabled$1 = f;
81447
+ },
81448
+ areRelatedListsPredictionsEnabled: function () {
81449
+ return relatedListsPredictionsEnabled$1 === true;
81450
+ },
81422
81451
  // createContentVersion
81423
81452
  setDraftAwareCreateContentVersionAdapter: function (adapter) {
81424
81453
  draftAwareCreateContentVersionAdapter$1 = adapter;
@@ -82452,7 +82481,7 @@ register$1({
82452
82481
  configuration: { ...configurationForGraphQLAdapters$1 },
82453
82482
  instrument: instrument$1,
82454
82483
  });
82455
- // version: 1.287.1-e437af73a
82484
+ // version: 1.289.0-72256e363
82456
82485
 
82457
82486
  // On core the unstable adapters are re-exported with different names,
82458
82487
  // we want to match them here.
@@ -84708,7 +84737,7 @@ withDefaultLuvio((luvio) => {
84708
84737
  unstable_graphQL_imperative = createImperativeAdapter(luvio, createInstrumentedAdapter(ldsAdapter, adapterMetadata), adapterMetadata);
84709
84738
  graphQLImperative = ldsAdapter;
84710
84739
  });
84711
- // version: 1.287.1-e437af73a
84740
+ // version: 1.289.0-72256e363
84712
84741
 
84713
84742
  var gqlApi = /*#__PURE__*/Object.freeze({
84714
84743
  __proto__: null,
@@ -85446,7 +85475,7 @@ const callbacks$1 = [];
85446
85475
  function register(r) {
85447
85476
  callbacks$1.forEach((callback) => callback(r));
85448
85477
  }
85449
- // version: 1.287.1-2951538ee
85478
+ // version: 1.289.0-5ba45a0a4
85450
85479
 
85451
85480
  /**
85452
85481
  * Returns true if the value acts like a Promise, i.e. has a "then" function,
@@ -89438,6 +89467,10 @@ let oneStoreGetObjectInfoAdapter = undefined;
89438
89467
  * One store enabled Get Object Infos adapter
89439
89468
  */
89440
89469
  let oneStoreGetObjectInfosAdapter = undefined;
89470
+ /**
89471
+ * Determines when to include PDL strategies for Related Lists
89472
+ */
89473
+ let relatedListsPredictionsEnabled = false;
89441
89474
  /**
89442
89475
  * Defines the configuration API and is exposed internally as well as externally.
89443
89476
  * Configuration for one store enabled REST adapters only.
@@ -89513,6 +89546,12 @@ const configurationForRestAdapters = {
89513
89546
  getDraftAwareCreateContentDocumentAndVersionAdapter: function () {
89514
89547
  return draftAwareCreateContentDocumentAndVersionAdapter;
89515
89548
  },
89549
+ setRelatedListsPredictionsEnabled: function (f) {
89550
+ relatedListsPredictionsEnabled = f;
89551
+ },
89552
+ areRelatedListsPredictionsEnabled: function () {
89553
+ return relatedListsPredictionsEnabled === true;
89554
+ },
89516
89555
  // createContentVersion
89517
89556
  setDraftAwareCreateContentVersionAdapter: function (adapter) {
89518
89557
  draftAwareCreateContentVersionAdapter = adapter;
@@ -90398,4 +90437,4 @@ const { luvio } = getRuntime();
90398
90437
  setDefaultLuvio({ luvio });
90399
90438
 
90400
90439
  export { createPrimingSession, draftManager, draftQueue, evictCacheRecordsByIds, evictExpiredCacheEntries, executeAdapter, executeMutatingAdapter, getImperativeAdapterNames, invokeAdapter, invokeAdapterWithDraftToMerge, invokeAdapterWithDraftToReplace, invokeAdapterWithMetadata, nimbusDraftQueue, registerReportObserver, setMetadataTTL, setUiApiRecordTTL, stopEviction, subscribeToAdapter };
90401
- // version: 1.287.1-2951538ee
90440
+ // version: 1.289.0-5ba45a0a4
@@ -4068,7 +4068,7 @@
4068
4068
  }
4069
4069
  return resourceParams;
4070
4070
  }
4071
- // engine version: 0.154.17-b8f04923
4071
+ // engine version: 0.154.18-b8141c42
4072
4072
 
4073
4073
  /**
4074
4074
  * Copyright (c) 2022, Salesforce, Inc.,
@@ -4196,7 +4196,7 @@
4196
4196
  }
4197
4197
  callbacks.push(callback);
4198
4198
  }
4199
- // version: 1.287.1-2951538ee
4199
+ // version: 1.289.0-5ba45a0a4
4200
4200
 
4201
4201
  // TODO [TD-0081508]: once that TD is fulfilled we can probably change this file
4202
4202
  function instrumentAdapter$1(createFunction, _metadata) {
@@ -15704,7 +15704,7 @@
15704
15704
  }
15705
15705
  return superResult;
15706
15706
  }
15707
- // version: 1.287.1-2951538ee
15707
+ // version: 1.289.0-5ba45a0a4
15708
15708
 
15709
15709
  function unwrap(data) {
15710
15710
  // The lwc-luvio bindings import a function from lwc called "unwrap".
@@ -16629,7 +16629,7 @@
16629
16629
  const { apiFamily, name } = metadata;
16630
16630
  return createGraphQLWireAdapterConstructor$1(adapter, `${apiFamily}.${name}`, luvio, astResolver);
16631
16631
  }
16632
- // version: 1.287.1-2951538ee
16632
+ // version: 1.289.0-5ba45a0a4
16633
16633
 
16634
16634
  /**
16635
16635
  * Copyright (c) 2022, Salesforce, Inc.,
@@ -16728,7 +16728,7 @@
16728
16728
  TypeCheckShapes[TypeCheckShapes["Integer"] = 3] = "Integer";
16729
16729
  TypeCheckShapes[TypeCheckShapes["Unsupported"] = 4] = "Unsupported";
16730
16730
  })(TypeCheckShapes || (TypeCheckShapes = {}));
16731
- // engine version: 0.154.17-b8f04923
16731
+ // engine version: 0.154.18-b8141c42
16732
16732
 
16733
16733
  const { keys: ObjectKeys$3, create: ObjectCreate$3 } = Object;
16734
16734
 
@@ -16850,6 +16850,10 @@
16850
16850
  * One store enabled Get Object Infos adapter
16851
16851
  */
16852
16852
  let oneStoreGetObjectInfosAdapter$2 = undefined;
16853
+ /**
16854
+ * Determines when to include PDL strategies for Related Lists
16855
+ */
16856
+ let relatedListsPredictionsEnabled$2 = false;
16853
16857
  /**
16854
16858
  * Defines the configuration API and is exposed internally as well as externally.
16855
16859
  * Configuration for one store enabled REST adapters only.
@@ -16934,6 +16938,12 @@
16934
16938
  getDraftAwareCreateContentDocumentAndVersionAdapter: function () {
16935
16939
  return draftAwareCreateContentDocumentAndVersionAdapter$2;
16936
16940
  },
16941
+ setRelatedListsPredictionsEnabled: function (f) {
16942
+ relatedListsPredictionsEnabled$2 = f;
16943
+ },
16944
+ areRelatedListsPredictionsEnabled: function () {
16945
+ return relatedListsPredictionsEnabled$2 === true;
16946
+ },
16937
16947
  // createContentVersion
16938
16948
  setDraftAwareCreateContentVersionAdapter: function (adapter) {
16939
16949
  draftAwareCreateContentVersionAdapter$2 = adapter;
@@ -17050,6 +17060,16 @@
17050
17060
  return result;
17051
17061
  };
17052
17062
  }
17063
+ function createRelatedListAdapterWithPrediction(adapter, luvio, name) {
17064
+ if (configurationForRestAdapters$2.areRelatedListsPredictionsEnabled() /* gate is open */) {
17065
+ return createLDSAdapterWithPrediction(adapter, luvio, name);
17066
+ }
17067
+ else {
17068
+ return (config, requestContext) => {
17069
+ return adapter(config, requestContext);
17070
+ };
17071
+ }
17072
+ }
17053
17073
 
17054
17074
  const { hasOwnProperty: ObjectPrototypeHasOwnProperty$2 } = Object.prototype;
17055
17075
  const { keys: ObjectKeys$1$2, create: ObjectCreate$1$2 } = Object;
@@ -43860,13 +43880,13 @@
43860
43880
  const getRelatedListActions_ldsAdapter = createInstrumentedAdapter(createLDSAdapter(luvio, 'getRelatedListActions', getRelatedListActionsAdapterFactory), getRelatedListActionsMetadata);
43861
43881
  const getRelatedListCount_ldsAdapter = createInstrumentedAdapter(createLDSAdapter(luvio, 'getRelatedListCount', getRelatedListCountAdapterFactory), getRelatedListCountMetadata);
43862
43882
  const getRelatedListInfo_ldsAdapter = createInstrumentedAdapter(createLDSAdapter(luvio, 'getRelatedListInfo', getRelatedListInfoAdapterFactory), getRelatedListInfoMetadata);
43863
- const getRelatedListInfoBatch_ldsAdapter = createInstrumentedAdapter(createLDSAdapterWithPrediction(createLDSAdapter(luvio, 'getRelatedListInfoBatch', getRelatedListInfoBatchAdapterFactory), luvio, 'getRelatedListInfoBatch'), getRelatedListInfoBatchMetadata);
43883
+ const getRelatedListInfoBatch_ldsAdapter = createInstrumentedAdapter(createRelatedListAdapterWithPrediction(createLDSAdapter(luvio, 'getRelatedListInfoBatch', getRelatedListInfoBatchAdapterFactory), luvio, 'getRelatedListInfoBatch'), getRelatedListInfoBatchMetadata);
43864
43884
  const getRelatedListPreferences_ldsAdapter = createInstrumentedAdapter(createLDSAdapter(luvio, 'getRelatedListPreferences', getRelatedListPreferencesAdapterFactory), getRelatedListPreferencesMetadata);
43865
43885
  const getRelatedListPreferencesBatch_ldsAdapter = createInstrumentedAdapter(createLDSAdapter(luvio, 'getRelatedListPreferencesBatch', getRelatedListPreferencesBatchAdapterFactory), getRelatedListPreferencesBatchMetadata);
43866
43886
  const getRelatedListRecordActions_ldsAdapter = createInstrumentedAdapter(createLDSAdapter(luvio, 'getRelatedListRecordActions', getRelatedListRecordActionsAdapterFactory), getRelatedListRecordActionsMetadata);
43867
- const getRelatedListRecords_ldsAdapter = createInstrumentedAdapter(createLDSAdapterWithPrediction(createLDSAdapter(luvio, 'getRelatedListRecords', getRelatedListRecordsAdapterFactory), luvio, 'getRelatedListRecords'), getRelatedListRecordsMetadata);
43868
- const getRelatedListRecordsBatch_ldsAdapter = createInstrumentedAdapter(createLDSAdapterWithPrediction(createLDSAdapter(luvio, 'getRelatedListRecordsBatch', getRelatedListRecordsBatchAdapterFactory), luvio, 'getRelatedListRecordsBatch'), getRelatedListRecordsBatchMetadata);
43869
- const getRelatedListsActions_ldsAdapter = createInstrumentedAdapter(createLDSAdapterWithPrediction(createLDSAdapter(luvio, 'getRelatedListsActions', getRelatedListsActionsAdapterFactory), luvio, 'getRelatedListsActions'), getRelatedListsActionsMetadata);
43887
+ const getRelatedListRecords_ldsAdapter = createInstrumentedAdapter(createRelatedListAdapterWithPrediction(createLDSAdapter(luvio, 'getRelatedListRecords', getRelatedListRecordsAdapterFactory), luvio, 'getRelatedListRecords'), getRelatedListRecordsMetadata);
43888
+ const getRelatedListRecordsBatch_ldsAdapter = createInstrumentedAdapter(createRelatedListAdapterWithPrediction(createLDSAdapter(luvio, 'getRelatedListRecordsBatch', getRelatedListRecordsBatchAdapterFactory), luvio, 'getRelatedListRecordsBatch'), getRelatedListRecordsBatchMetadata);
43889
+ const getRelatedListsActions_ldsAdapter = createInstrumentedAdapter(createRelatedListAdapterWithPrediction(createLDSAdapter(luvio, 'getRelatedListsActions', getRelatedListsActionsAdapterFactory), luvio, 'getRelatedListsActions'), getRelatedListsActionsMetadata);
43870
43890
  const getRelatedListsCount_ldsAdapter = createInstrumentedAdapter(createLDSAdapter(luvio, 'getRelatedListsCount', getRelatedListsCountAdapterFactory), getRelatedListsCountMetadata);
43871
43891
  const getRelatedListsInfo_ldsAdapter = createInstrumentedAdapter(createLDSAdapter(luvio, 'getRelatedListsInfo', getRelatedListsInfoAdapterFactory), getRelatedListsInfoMetadata);
43872
43892
  const getSearchFilterMetadata_ldsAdapter = createInstrumentedAdapter(createLDSAdapter(luvio, 'getSearchFilterMetadata', getSearchFilterMetadataAdapterFactory), getSearchFilterMetadataMetadata);
@@ -44170,7 +44190,7 @@
44170
44190
  throttle(60, 60000, setupNotifyAllListRecordUpdateAvailable(luvio));
44171
44191
  throttle(60, 60000, setupNotifyAllListInfoSummaryUpdateAvailable(luvio));
44172
44192
  });
44173
- // version: 1.287.1-e437af73a
44193
+ // version: 1.289.0-72256e363
44174
44194
 
44175
44195
  var ldsIdempotencyWriteDisabled = {
44176
44196
  isOpen: function (e) {
@@ -45479,7 +45499,7 @@
45479
45499
  // because we do not want some other code attempting to use the
45480
45500
  // in-memory values before the durable store onChanged handler
45481
45501
  // calls back and revives the values to in-memory
45482
- environment.storeEvict(key);
45502
+ environment.storeDealloc(key);
45483
45503
  };
45484
45504
  const publishStoreMetadata = function (recordId, storeMetadata) {
45485
45505
  validateNotDisposed();
@@ -56853,7 +56873,7 @@
56853
56873
  const referencedRecord = referencedRecords.get(key);
56854
56874
  recordFields[relationshipName] = {
56855
56875
  displayValue: null,
56856
- value: createLink$2(key),
56876
+ value: createLink$1$1(key),
56857
56877
  };
56858
56878
  // for custom objects, we select the 'Name' field
56859
56879
  // otherwise we check the object info for name fields.
@@ -56881,7 +56901,7 @@
56881
56901
  }
56882
56902
  return { ...record, fields: recordFields };
56883
56903
  }
56884
- function createLink$2(key) {
56904
+ function createLink$1$1(key) {
56885
56905
  return { __ref: key };
56886
56906
  }
56887
56907
  function getReferenceInfoForKey(fieldName, field, luvio, objectInfo) {
@@ -56896,7 +56916,7 @@
56896
56916
  referenceFieldName: relationshipName,
56897
56917
  field: {
56898
56918
  displayValue: null,
56899
- value: createLink$2(key),
56919
+ value: createLink$1$1(key),
56900
56920
  },
56901
56921
  };
56902
56922
  }
@@ -57359,6 +57379,9 @@
57359
57379
  !draftActionFieldNames.includes(backdatingFieldName));
57360
57380
  }
57361
57381
 
57382
+ function createLink$2(key) {
57383
+ return { __ref: key };
57384
+ }
57362
57385
  /**
57363
57386
  * Records are stored in the durable store with scalar fields denormalized. This function takes that denoramlized
57364
57387
  * durable store record representation and normalizes it back out into the format the the luvio store expects it
@@ -57369,26 +57392,25 @@
57369
57392
  function normalizeRecordFields(key, entry) {
57370
57393
  const { data: record } = entry;
57371
57394
  const { fields, links } = record;
57372
- const linkNames = keys$3$1(links);
57395
+ const missingFieldLinks = keys$3$1(links);
57396
+ const fieldNames = keys$3$1(fields);
57373
57397
  const normalizedFields = {};
57374
57398
  const returnEntries = {};
57375
- for (let i = 0, len = linkNames.length; i < len; i++) {
57376
- const fieldName = linkNames[i];
57399
+ // restore fields
57400
+ for (let i = 0, len = fieldNames.length; i < len; i++) {
57401
+ const fieldName = fieldNames[i];
57377
57402
  const field = fields[fieldName];
57403
+ const fieldKey = buildRecordFieldStoreKey(key, fieldName);
57404
+ returnEntries[fieldKey] = { data: field };
57405
+ normalizedFields[fieldName] = createLink$2(fieldKey);
57406
+ }
57407
+ // restore missing fields
57408
+ for (let i = 0, len = missingFieldLinks.length; i < len; i++) {
57409
+ const fieldName = missingFieldLinks[i];
57378
57410
  const link = links[fieldName];
57379
- // field is undefined for missing links
57380
- if (field !== undefined) {
57381
- const fieldKey = buildRecordFieldStoreKey(key, fieldName);
57382
- returnEntries[fieldKey] = { data: field };
57383
- }
57384
- // we need to restore the undefined __ref node as it is
57385
- // lost during serialization
57386
57411
  if (link.isMissing === true) {
57387
57412
  normalizedFields[fieldName] = { ...link, __ref: undefined };
57388
57413
  }
57389
- else {
57390
- normalizedFields[fieldName] = link;
57391
- }
57392
57414
  }
57393
57415
  returnEntries[key] = {
57394
57416
  data: assign$3(record, { fields: normalizedFields }),
@@ -57450,7 +57472,7 @@
57450
57472
  }
57451
57473
  }
57452
57474
  // we want to preserve fields that are missing nodes
57453
- if (filteredFields[fieldName] !== undefined || field.isMissing === true) {
57475
+ if (field.isMissing === true) {
57454
57476
  links[fieldName] = field;
57455
57477
  }
57456
57478
  }
@@ -60105,9 +60127,11 @@
60105
60127
  let apiName = null;
60106
60128
  let objectInfo;
60107
60129
  if (dataIsRecord(key)) {
60130
+ incomingRecords.delete(key);
60108
60131
  apiName = data.apiName;
60109
60132
  }
60110
60133
  else if (dataIsObjectInfo(key)) {
60134
+ incomingObjectInfos.delete(key);
60111
60135
  apiName = data.apiName;
60112
60136
  objectInfo = data;
60113
60137
  }
@@ -61782,7 +61806,6 @@
61782
61806
  }, {});
61783
61807
  fields['Id'] = { value: id, displayValue: null };
61784
61808
  fields['RecordTypeId'] = { value: recordTypeId, displayValue: null };
61785
- const links = this.generateFieldLinks(id, [...requestedFields, 'Id', 'RecordTypeId']);
61786
61809
  return {
61787
61810
  apiName: node[`${requiredPrefix}ApiName`],
61788
61811
  childRelationships: {},
@@ -61804,18 +61827,9 @@
61804
61827
  : null,
61805
61828
  weakEtag: node[`${requiredPrefix}WeakEtag`],
61806
61829
  fields,
61807
- links,
61830
+ links: {},
61808
61831
  };
61809
61832
  }
61810
- generateFieldLinks(id, fields) {
61811
- const links = {};
61812
- for (const field of fields) {
61813
- links[field] = {
61814
- __ref: `UiApi::RecordRepresentation:${id}__fields__${field}`,
61815
- };
61816
- }
61817
- return links;
61818
- }
61819
61833
  }
61820
61834
 
61821
61835
  class RecordIngestor {
@@ -62409,7 +62423,7 @@
62409
62423
  id: '@salesforce/lds-network-adapter',
62410
62424
  instrument: instrument$2,
62411
62425
  });
62412
- // version: 1.287.1-2951538ee
62426
+ // version: 1.289.0-5ba45a0a4
62413
62427
 
62414
62428
  const { create: create$3, keys: keys$3 } = Object;
62415
62429
  const { stringify: stringify$1, parse: parse$1 } = JSON;
@@ -78811,6 +78825,29 @@
78811
78825
  return sharedGetFragmentType(fragment, fragmentMap);
78812
78826
  }
78813
78827
 
78828
+ function getFieldType$b(field) {
78829
+ const fieldName = field.name.value;
78830
+ switch (fieldName) {
78831
+ case '__typename': {
78832
+ return {
78833
+ isArray: false,
78834
+ typename: 'String',
78835
+ };
78836
+ }
78837
+ /*
78838
+ Probably should use metaschema like the RecordQuery graphql-artifact,
78839
+ but this type only has one generic type possible. Also, the most likely scenario for future schema additions,
78840
+ is UISDK adding the the parent of this type, Setup__Setup. Therefore, we will just default to SetupConnection so that
78841
+ query authors don't need to use metaschema when there's no real decision point in this type.
78842
+ */
78843
+ default:
78844
+ return {
78845
+ isArray: false,
78846
+ typename: 'Setup__SetupConnection',
78847
+ };
78848
+ }
78849
+ }
78850
+
78814
78851
  const name$2 = 'Setup__SetupQuery';
78815
78852
  const VERSION$a = 'b89cccb5fa5e458d89dc1137af3e5469';
78816
78853
  function keyBuilder$6(luvio, path, data) {
@@ -78928,24 +78965,6 @@
78928
78965
  }
78929
78966
  // Deal with mapped types' cache keys
78930
78967
  }
78931
- function getFieldType$b(field) {
78932
- switch (field.name.value) {
78933
- case '__typename': {
78934
- return {
78935
- isArray: false,
78936
- typename: 'String'
78937
- };
78938
- }
78939
- case 'recordQuery': {
78940
- return {
78941
- isArray: false,
78942
- typename: 'Setup__SetupConnection'
78943
- };
78944
- }
78945
- default:
78946
- return undefined;
78947
- }
78948
- }
78949
78968
  function ingestFieldByType$2(typename, parentKey, requestedField, sink, fieldKey, fieldData, state) {
78950
78969
  // TODO: add validation logic to only allow nullable fields to be null in the future
78951
78970
  if (fieldData === null) {
@@ -81350,6 +81369,10 @@
81350
81369
  * One store enabled Get Object Infos adapter
81351
81370
  */
81352
81371
  let oneStoreGetObjectInfosAdapter$1 = undefined;
81372
+ /**
81373
+ * Determines when to include PDL strategies for Related Lists
81374
+ */
81375
+ let relatedListsPredictionsEnabled$1 = false;
81353
81376
  /**
81354
81377
  * Defines the configuration API and is exposed internally as well as externally.
81355
81378
  * Configuration for one store enabled REST adapters only.
@@ -81425,6 +81448,12 @@
81425
81448
  getDraftAwareCreateContentDocumentAndVersionAdapter: function () {
81426
81449
  return draftAwareCreateContentDocumentAndVersionAdapter$1;
81427
81450
  },
81451
+ setRelatedListsPredictionsEnabled: function (f) {
81452
+ relatedListsPredictionsEnabled$1 = f;
81453
+ },
81454
+ areRelatedListsPredictionsEnabled: function () {
81455
+ return relatedListsPredictionsEnabled$1 === true;
81456
+ },
81428
81457
  // createContentVersion
81429
81458
  setDraftAwareCreateContentVersionAdapter: function (adapter) {
81430
81459
  draftAwareCreateContentVersionAdapter$1 = adapter;
@@ -82458,7 +82487,7 @@
82458
82487
  configuration: { ...configurationForGraphQLAdapters$1 },
82459
82488
  instrument: instrument$1,
82460
82489
  });
82461
- // version: 1.287.1-e437af73a
82490
+ // version: 1.289.0-72256e363
82462
82491
 
82463
82492
  // On core the unstable adapters are re-exported with different names,
82464
82493
  // we want to match them here.
@@ -84714,7 +84743,7 @@
84714
84743
  unstable_graphQL_imperative = createImperativeAdapter(luvio, createInstrumentedAdapter(ldsAdapter, adapterMetadata), adapterMetadata);
84715
84744
  graphQLImperative = ldsAdapter;
84716
84745
  });
84717
- // version: 1.287.1-e437af73a
84746
+ // version: 1.289.0-72256e363
84718
84747
 
84719
84748
  var gqlApi = /*#__PURE__*/Object.freeze({
84720
84749
  __proto__: null,
@@ -85452,7 +85481,7 @@
85452
85481
  function register(r) {
85453
85482
  callbacks$1.forEach((callback) => callback(r));
85454
85483
  }
85455
- // version: 1.287.1-2951538ee
85484
+ // version: 1.289.0-5ba45a0a4
85456
85485
 
85457
85486
  /**
85458
85487
  * Returns true if the value acts like a Promise, i.e. has a "then" function,
@@ -89444,6 +89473,10 @@
89444
89473
  * One store enabled Get Object Infos adapter
89445
89474
  */
89446
89475
  let oneStoreGetObjectInfosAdapter = undefined;
89476
+ /**
89477
+ * Determines when to include PDL strategies for Related Lists
89478
+ */
89479
+ let relatedListsPredictionsEnabled = false;
89447
89480
  /**
89448
89481
  * Defines the configuration API and is exposed internally as well as externally.
89449
89482
  * Configuration for one store enabled REST adapters only.
@@ -89519,6 +89552,12 @@
89519
89552
  getDraftAwareCreateContentDocumentAndVersionAdapter: function () {
89520
89553
  return draftAwareCreateContentDocumentAndVersionAdapter;
89521
89554
  },
89555
+ setRelatedListsPredictionsEnabled: function (f) {
89556
+ relatedListsPredictionsEnabled = f;
89557
+ },
89558
+ areRelatedListsPredictionsEnabled: function () {
89559
+ return relatedListsPredictionsEnabled === true;
89560
+ },
89522
89561
  // createContentVersion
89523
89562
  setDraftAwareCreateContentVersionAdapter: function (adapter) {
89524
89563
  draftAwareCreateContentVersionAdapter = adapter;
@@ -90423,4 +90462,4 @@
90423
90462
  exports.subscribeToAdapter = subscribeToAdapter;
90424
90463
 
90425
90464
  }));
90426
- // version: 1.287.1-2951538ee
90465
+ // version: 1.289.0-5ba45a0a4
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/lds-worker-api",
3
- "version": "1.287.1",
3
+ "version": "1.289.0",
4
4
  "license": "SEE LICENSE IN LICENSE.txt",
5
5
  "description": "",
6
6
  "main": "dist/standalone/es/lds-worker-api.js",
@@ -35,15 +35,15 @@
35
35
  },
36
36
  "devDependencies": {
37
37
  "@oat-sa/rollup-plugin-wildcard-external": "^1.0.0",
38
- "@salesforce/lds-adapters-graphql": "^1.287.1",
39
- "@salesforce/lds-adapters-uiapi": "^1.287.1",
40
- "@salesforce/lds-default-luvio": "^1.287.1",
41
- "@salesforce/lds-drafts": "^1.287.1",
42
- "@salesforce/lds-graphql-parser": "^1.287.1",
43
- "@salesforce/lds-luvio-engine": "^1.287.1",
44
- "@salesforce/lds-priming": "^1.287.1",
45
- "@salesforce/lds-runtime-mobile": "^1.287.1",
46
- "@salesforce/nimbus-plugin-lds": "^1.287.1",
38
+ "@salesforce/lds-adapters-graphql": "^1.289.0",
39
+ "@salesforce/lds-adapters-uiapi": "^1.289.0",
40
+ "@salesforce/lds-default-luvio": "^1.289.0",
41
+ "@salesforce/lds-drafts": "^1.289.0",
42
+ "@salesforce/lds-graphql-parser": "^1.289.0",
43
+ "@salesforce/lds-luvio-engine": "^1.289.0",
44
+ "@salesforce/lds-priming": "^1.289.0",
45
+ "@salesforce/lds-runtime-mobile": "^1.289.0",
46
+ "@salesforce/nimbus-plugin-lds": "^1.289.0",
47
47
  "ajv": "^8.11.0",
48
48
  "glob": "^7.1.5",
49
49
  "nimbus-types": "^2.0.0-alpha1",