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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -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.229.0-dev8-6c36d664c
798
+ // version: 1.229.0-dev9-dd96b5901
@@ -25,12 +25,15 @@ const { hasOwnProperty: hasOwnProperty$3 } = Object.prototype;
25
25
  const { isArray: isArray$9 } = Array;
26
26
  const { push: push$5, indexOf, slice: slice$2 } = Array.prototype;
27
27
  const { parse: parse$a, stringify: stringify$a } = JSON;
28
+ const WeakSetCtor = WeakSet;
28
29
 
30
+ const deeplyFrozen = new WeakSetCtor();
29
31
  function deepFreeze(value) {
30
- // No need to freeze primitives
31
- if (typeof value !== 'object' || value === null) {
32
+ // No need to freeze primitives or already frozen stuff
33
+ if (typeof value !== 'object' || value === null || deeplyFrozen.has(value)) {
32
34
  return;
33
35
  }
36
+ deeplyFrozen.add(value);
34
37
  if (isArray$9(value)) {
35
38
  for (let i = 0, len = value.length; i < len; i += 1) {
36
39
  deepFreeze(value[i]);
@@ -1727,6 +1730,10 @@ class InMemoryStore {
1727
1730
  }
1728
1731
  }
1729
1732
  markVisited(canonicalKey) {
1733
+ if (typeof canonicalKey === 'string') {
1734
+ this.fallbackStringKeyInMemoryStore.markVisited(canonicalKey);
1735
+ return;
1736
+ }
1730
1737
  const { visitedIdsSet, reverseRedirectKeysMap } = this;
1731
1738
  let redirectKey = canonicalKey;
1732
1739
  // mark all redirects leading up to the canonical key as visited so
@@ -2038,7 +2045,7 @@ class GraphLink {
2038
2045
  if (isStoreRecordError$1(linked)) {
2039
2046
  return new GraphNodeError(this.store, linked);
2040
2047
  }
2041
- return new GraphNode(this.store, linked);
2048
+ return new GraphNode(this.store, linked, __ref);
2042
2049
  }
2043
2050
  linkData() {
2044
2051
  return this.data.data;
@@ -2048,10 +2055,11 @@ class GraphLink {
2048
2055
  }
2049
2056
  }
2050
2057
  class GraphNode {
2051
- constructor(store, data) {
2058
+ constructor(store, data, storeKey) {
2052
2059
  this.type = GraphNodeType$1.Node;
2053
2060
  this.store = store;
2054
2061
  this.data = data;
2062
+ this.storeKey = storeKey;
2055
2063
  }
2056
2064
  object(propertyName) {
2057
2065
  const value = this.data[propertyName];
@@ -2061,7 +2069,8 @@ class GraphNode {
2061
2069
  if (typeof value !== 'object' || value === null) {
2062
2070
  throw new Error(`Cannot walk to path ${String(propertyName)}. "${String(propertyName)}" is a scalar: "${value}"`);
2063
2071
  }
2064
- return new GraphNode(this.store, value);
2072
+ // We're walking to an object property on the current store record, pass the storeKey down.
2073
+ return new GraphNode(this.store, value, this.storeKey);
2065
2074
  }
2066
2075
  link(propertyName) {
2067
2076
  const value = this.data[propertyName];
@@ -2091,6 +2100,8 @@ class GraphNode {
2091
2100
  }
2092
2101
  write(propertyName, value) {
2093
2102
  this.data[propertyName] = value;
2103
+ const canonicalKey = this.store.getCanonicalRecordId(this.storeKey);
2104
+ this.store.markVisited(canonicalKey);
2094
2105
  }
2095
2106
  isUndefined(propertyName) {
2096
2107
  return this.data[propertyName] === undefined;
@@ -3253,9 +3264,9 @@ class Environment {
3253
3264
  if (value === undefined) {
3254
3265
  return null;
3255
3266
  }
3256
- return this.wrapNormalizedGraphNode(value, store);
3267
+ return this.wrapNormalizedGraphNode(value, key, store);
3257
3268
  }
3258
- wrapNormalizedGraphNode(normalized, storeOverride) {
3269
+ wrapNormalizedGraphNode(normalized, key, storeOverride) {
3259
3270
  if (normalized === null) {
3260
3271
  return null;
3261
3272
  }
@@ -3263,7 +3274,7 @@ class Environment {
3263
3274
  if (isStoreRecordError$1(normalized)) {
3264
3275
  return new GraphNodeError(store, normalized);
3265
3276
  }
3266
- return new GraphNode(store, normalized);
3277
+ return new GraphNode(store, normalized, key);
3267
3278
  }
3268
3279
  withContext(adapter, options) {
3269
3280
  const { contextId, onContextLoaded } = options;
@@ -3558,8 +3569,8 @@ class Luvio {
3558
3569
  getNode(key) {
3559
3570
  return this.environment.getNode(key);
3560
3571
  }
3561
- wrapNormalizedGraphNode(normalized) {
3562
- return this.environment.wrapNormalizedGraphNode(normalized);
3572
+ wrapNormalizedGraphNode(normalized, key) {
3573
+ return this.environment.wrapNormalizedGraphNode(normalized, key);
3563
3574
  }
3564
3575
  instrument(paramsBuilder) {
3565
3576
  const { instrument } = this.options;
@@ -3869,7 +3880,7 @@ function createResourceParamsImpl(config, configMetadata) {
3869
3880
  }
3870
3881
  return resourceParams;
3871
3882
  }
3872
- // engine version: 0.146.0-dev4-c265089a
3883
+ // engine version: 0.146.0-dev5-a2ec6e3f
3873
3884
 
3874
3885
  /**
3875
3886
  * Copyright (c) 2022, Salesforce, Inc.,
@@ -3996,7 +4007,7 @@ function withDefaultLuvio(callback) {
3996
4007
  }
3997
4008
  callbacks.push(callback);
3998
4009
  }
3999
- // version: 1.229.0-dev8-6c36d664c
4010
+ // version: 1.229.0-dev9-dd96b5901
4000
4011
 
4001
4012
  // TODO [TD-0081508]: once that TD is fulfilled we can probably change this file
4002
4013
  function instrumentAdapter$1(createFunction, _metadata) {
@@ -15457,7 +15468,7 @@ function gql(literals, ...subs) {
15457
15468
  }
15458
15469
  return superResult;
15459
15470
  }
15460
- // version: 1.229.0-dev8-6c36d664c
15471
+ // version: 1.229.0-dev9-dd96b5901
15461
15472
 
15462
15473
  function unwrap(data) {
15463
15474
  // The lwc-luvio bindings import a function from lwc called "unwrap".
@@ -16381,7 +16392,7 @@ function createGraphQLWireAdapterConstructor(luvio, adapter, metadata, astResolv
16381
16392
  const { apiFamily, name } = metadata;
16382
16393
  return createGraphQLWireAdapterConstructor$1(adapter, `${apiFamily}.${name}`, luvio, astResolver);
16383
16394
  }
16384
- // version: 1.229.0-dev8-6c36d664c
16395
+ // version: 1.229.0-dev9-dd96b5901
16385
16396
 
16386
16397
  /**
16387
16398
  * Copyright (c) 2022, Salesforce, Inc.,
@@ -16480,7 +16491,7 @@ var TypeCheckShapes;
16480
16491
  TypeCheckShapes[TypeCheckShapes["Integer"] = 3] = "Integer";
16481
16492
  TypeCheckShapes[TypeCheckShapes["Unsupported"] = 4] = "Unsupported";
16482
16493
  })(TypeCheckShapes || (TypeCheckShapes = {}));
16483
- // engine version: 0.146.0-dev4-c265089a
16494
+ // engine version: 0.146.0-dev5-a2ec6e3f
16484
16495
 
16485
16496
  const { keys: ObjectKeys$3, create: ObjectCreate$3 } = Object;
16486
16497
 
@@ -20008,22 +20019,12 @@ function _markMissingPath(record, path) {
20008
20019
  const fieldValueRepresentation = record.object('fields');
20009
20020
  const fieldName = path.shift();
20010
20021
  if (fieldValueRepresentation.isUndefined(fieldName) === true) {
20011
- // TODO [W-6900046]: remove cast, make RecordRepresentationNormalized['fields'] accept
20012
- // an undefined/non-present __ref if isMissing is present
20013
- fieldValueRepresentation.write(fieldName, {
20014
- __ref: undefined,
20015
- isMissing: true,
20016
- });
20022
+ writeMissingFieldToStore(fieldValueRepresentation, fieldName);
20017
20023
  return;
20018
20024
  }
20019
20025
  const link = fieldValueRepresentation.link(fieldName);
20020
20026
  if (link.isPending()) {
20021
- // TODO [W-6900046]: remove cast, make RecordRepresentationNormalized['fields'] accept
20022
- // an undefined/non-present __ref if isMissing is present
20023
- fieldValueRepresentation.write(fieldName, {
20024
- __ref: undefined,
20025
- isMissing: true,
20026
- });
20027
+ writeMissingFieldToStore(fieldValueRepresentation, fieldName);
20027
20028
  }
20028
20029
  else if (path.length > 0 && link.isMissing() === false) {
20029
20030
  const fieldValue = link.follow();
@@ -20039,6 +20040,19 @@ function _markMissingPath(record, path) {
20039
20040
  }
20040
20041
  }
20041
20042
  }
20043
+ /**
20044
+ * Graph Node Directly modifies store entries, which is generally a non-starter.
20045
+ * Until we can refactor this mess, you need to use this function to safely mark the RecordRepresentation
20046
+ * as a seenId in the store when you perform this mutation.
20047
+ */
20048
+ function writeMissingFieldToStore(field, fieldName) {
20049
+ // TODO [W-6900046]: remove cast, make RecordRepresentationNormalized['fields'] accept
20050
+ // an undefined/non-present __ref if isMissing is present
20051
+ field.write(fieldName, {
20052
+ __ref: undefined,
20053
+ isMissing: true,
20054
+ });
20055
+ }
20042
20056
  /**
20043
20057
  * Tells you if an objectApiName is supported by UI API or not.
20044
20058
  * Note: Luvio does not currently support all the entities, the list is limited to UI API supported entities
@@ -20170,8 +20184,11 @@ function mergeAndRefreshLowerVersionRecord(luvio, incoming, existing, incomingTr
20170
20184
  return existing;
20171
20185
  }
20172
20186
  function mergeRecordConflict(luvio, incoming, existing, recordConflictMap) {
20173
- const incomingNode = luvio.wrapNormalizedGraphNode(incoming);
20174
- const existingNode = luvio.wrapNormalizedGraphNode(existing);
20187
+ const recordKey = keyBuilder$1U(luvio, {
20188
+ recordId: incoming.id,
20189
+ });
20190
+ const incomingNode = luvio.wrapNormalizedGraphNode(incoming, recordKey);
20191
+ const existingNode = luvio.wrapNormalizedGraphNode(existing, recordKey);
20175
20192
  const incomingTrackedFieldsTrieRoot = {
20176
20193
  name: incoming.apiName,
20177
20194
  children: {},
@@ -20180,9 +20197,6 @@ function mergeRecordConflict(luvio, incoming, existing, recordConflictMap) {
20180
20197
  name: existing.apiName,
20181
20198
  children: {},
20182
20199
  };
20183
- const recordKey = keyBuilder$1U(luvio, {
20184
- recordId: incoming.id,
20185
- });
20186
20200
  const trackedFieldsConfig = {
20187
20201
  maxDepth: configurationForRestAdapters$1.getTrackedFieldDepthOnCacheMergeConflict(),
20188
20202
  onlyFetchLeafNodeIdAndName: configurationForRestAdapters$1.getTrackedFieldLeafNodeIdAndNameOnly(),
@@ -25303,7 +25317,7 @@ const notifyChangeFactory = (luvio) => {
25303
25317
  const responsePromises = [];
25304
25318
  for (let i = 0, len = entries.length; i < len; i++) {
25305
25319
  const { key, record } = entries[i];
25306
- const node = luvio.wrapNormalizedGraphNode(record);
25320
+ const node = luvio.wrapNormalizedGraphNode(record, key);
25307
25321
  const optionalFields = getTrackedFields(key, node, {
25308
25322
  maxDepth: configurationForRestAdapters$1.getTrackedFieldDepthOnNotifyChange(),
25309
25323
  onlyFetchLeafNodeIdAndName: configurationForRestAdapters$1.getTrackedFieldLeafNodeIdAndNameOnly(),
@@ -41201,7 +41215,7 @@ withDefaultLuvio((luvio) => {
41201
41215
  throttle(60, 60000, createLDSAdapter(luvio, 'notifyListInfoUpdateAvailable', notifyUpdateAvailableFactory$1));
41202
41216
  throttle(60, 60000, createLDSAdapter(luvio, 'notifyQuickActionDefaultsUpdateAvailable', notifyUpdateAvailableFactory));
41203
41217
  });
41204
- // version: 1.229.0-dev8-26b9af754
41218
+ // version: 1.229.0-dev9-939b09095
41205
41219
 
41206
41220
  var ldsIdempotencyWriteDisabled = {
41207
41221
  isOpen: function (e) {
@@ -42428,12 +42442,12 @@ function makeDurable(environment, { durableStore, instrumentation }) {
42428
42442
  }
42429
42443
  return environment.getNode(key, ingestStagingStore);
42430
42444
  };
42431
- const wrapNormalizedGraphNode = function (normalized) {
42445
+ const wrapNormalizedGraphNode = function (normalized, key) {
42432
42446
  validateNotDisposed();
42433
42447
  if (ingestStagingStore === null) {
42434
42448
  ingestStagingStore = buildIngestStagingStore(environment);
42435
42449
  }
42436
- return environment.wrapNormalizedGraphNode(normalized, ingestStagingStore);
42450
+ return environment.wrapNormalizedGraphNode(normalized, key, ingestStagingStore);
42437
42451
  };
42438
42452
  const rebuildSnapshot = function (snapshot, onRebuild) {
42439
42453
  validateNotDisposed();
@@ -58062,7 +58076,7 @@ register({
58062
58076
  id: '@salesforce/lds-network-adapter',
58063
58077
  instrument: instrument$1,
58064
58078
  });
58065
- // version: 1.229.0-dev8-6c36d664c
58079
+ // version: 1.229.0-dev9-dd96b5901
58066
58080
 
58067
58081
  const { create: create$2, keys: keys$2 } = Object;
58068
58082
  const { stringify: stringify$1, parse: parse$1 } = JSON;
@@ -76494,7 +76508,7 @@ register({
76494
76508
  configuration: { ...configurationForGraphQLAdapters },
76495
76509
  instrument,
76496
76510
  });
76497
- // version: 1.229.0-dev8-26b9af754
76511
+ // version: 1.229.0-dev9-939b09095
76498
76512
 
76499
76513
  // On core the unstable adapters are re-exported with different names,
76500
76514
 
@@ -78741,7 +78755,7 @@ withDefaultLuvio((luvio) => {
78741
78755
  unstable_graphQL_imperative = createImperativeAdapter(luvio, createInstrumentedAdapter(ldsAdapter, adapterMetadata), adapterMetadata);
78742
78756
  graphQLImperative = ldsAdapter;
78743
78757
  });
78744
- // version: 1.229.0-dev8-26b9af754
78758
+ // version: 1.229.0-dev9-939b09095
78745
78759
 
78746
78760
  var gqlApi = /*#__PURE__*/Object.freeze({
78747
78761
  __proto__: null,
@@ -79455,4 +79469,4 @@ const { luvio } = getRuntime();
79455
79469
  setDefaultLuvio({ luvio });
79456
79470
 
79457
79471
  export { createPrimingSession, draftManager, draftQueue, executeAdapter, executeMutatingAdapter, getImperativeAdapterNames, invokeAdapter, invokeAdapterWithDraftToReplace, invokeAdapterWithMetadata, nimbusDraftQueue, registerReportObserver, setMetadataTTL, setUiApiRecordTTL, subscribeToAdapter };
79458
- // version: 1.229.0-dev8-6c36d664c
79472
+ // version: 1.229.0-dev9-dd96b5901
@@ -31,12 +31,15 @@
31
31
  const { isArray: isArray$9 } = Array;
32
32
  const { push: push$5, indexOf, slice: slice$2 } = Array.prototype;
33
33
  const { parse: parse$a, stringify: stringify$a } = JSON;
34
+ const WeakSetCtor = WeakSet;
34
35
 
36
+ const deeplyFrozen = new WeakSetCtor();
35
37
  function deepFreeze(value) {
36
- // No need to freeze primitives
37
- if (typeof value !== 'object' || value === null) {
38
+ // No need to freeze primitives or already frozen stuff
39
+ if (typeof value !== 'object' || value === null || deeplyFrozen.has(value)) {
38
40
  return;
39
41
  }
42
+ deeplyFrozen.add(value);
40
43
  if (isArray$9(value)) {
41
44
  for (let i = 0, len = value.length; i < len; i += 1) {
42
45
  deepFreeze(value[i]);
@@ -1733,6 +1736,10 @@
1733
1736
  }
1734
1737
  }
1735
1738
  markVisited(canonicalKey) {
1739
+ if (typeof canonicalKey === 'string') {
1740
+ this.fallbackStringKeyInMemoryStore.markVisited(canonicalKey);
1741
+ return;
1742
+ }
1736
1743
  const { visitedIdsSet, reverseRedirectKeysMap } = this;
1737
1744
  let redirectKey = canonicalKey;
1738
1745
  // mark all redirects leading up to the canonical key as visited so
@@ -2044,7 +2051,7 @@
2044
2051
  if (isStoreRecordError$1(linked)) {
2045
2052
  return new GraphNodeError(this.store, linked);
2046
2053
  }
2047
- return new GraphNode(this.store, linked);
2054
+ return new GraphNode(this.store, linked, __ref);
2048
2055
  }
2049
2056
  linkData() {
2050
2057
  return this.data.data;
@@ -2054,10 +2061,11 @@
2054
2061
  }
2055
2062
  }
2056
2063
  class GraphNode {
2057
- constructor(store, data) {
2064
+ constructor(store, data, storeKey) {
2058
2065
  this.type = GraphNodeType$1.Node;
2059
2066
  this.store = store;
2060
2067
  this.data = data;
2068
+ this.storeKey = storeKey;
2061
2069
  }
2062
2070
  object(propertyName) {
2063
2071
  const value = this.data[propertyName];
@@ -2067,7 +2075,8 @@
2067
2075
  if (typeof value !== 'object' || value === null) {
2068
2076
  throw new Error(`Cannot walk to path ${String(propertyName)}. "${String(propertyName)}" is a scalar: "${value}"`);
2069
2077
  }
2070
- return new GraphNode(this.store, value);
2078
+ // We're walking to an object property on the current store record, pass the storeKey down.
2079
+ return new GraphNode(this.store, value, this.storeKey);
2071
2080
  }
2072
2081
  link(propertyName) {
2073
2082
  const value = this.data[propertyName];
@@ -2097,6 +2106,8 @@
2097
2106
  }
2098
2107
  write(propertyName, value) {
2099
2108
  this.data[propertyName] = value;
2109
+ const canonicalKey = this.store.getCanonicalRecordId(this.storeKey);
2110
+ this.store.markVisited(canonicalKey);
2100
2111
  }
2101
2112
  isUndefined(propertyName) {
2102
2113
  return this.data[propertyName] === undefined;
@@ -3259,9 +3270,9 @@
3259
3270
  if (value === undefined) {
3260
3271
  return null;
3261
3272
  }
3262
- return this.wrapNormalizedGraphNode(value, store);
3273
+ return this.wrapNormalizedGraphNode(value, key, store);
3263
3274
  }
3264
- wrapNormalizedGraphNode(normalized, storeOverride) {
3275
+ wrapNormalizedGraphNode(normalized, key, storeOverride) {
3265
3276
  if (normalized === null) {
3266
3277
  return null;
3267
3278
  }
@@ -3269,7 +3280,7 @@
3269
3280
  if (isStoreRecordError$1(normalized)) {
3270
3281
  return new GraphNodeError(store, normalized);
3271
3282
  }
3272
- return new GraphNode(store, normalized);
3283
+ return new GraphNode(store, normalized, key);
3273
3284
  }
3274
3285
  withContext(adapter, options) {
3275
3286
  const { contextId, onContextLoaded } = options;
@@ -3564,8 +3575,8 @@
3564
3575
  getNode(key) {
3565
3576
  return this.environment.getNode(key);
3566
3577
  }
3567
- wrapNormalizedGraphNode(normalized) {
3568
- return this.environment.wrapNormalizedGraphNode(normalized);
3578
+ wrapNormalizedGraphNode(normalized, key) {
3579
+ return this.environment.wrapNormalizedGraphNode(normalized, key);
3569
3580
  }
3570
3581
  instrument(paramsBuilder) {
3571
3582
  const { instrument } = this.options;
@@ -3875,7 +3886,7 @@
3875
3886
  }
3876
3887
  return resourceParams;
3877
3888
  }
3878
- // engine version: 0.146.0-dev4-c265089a
3889
+ // engine version: 0.146.0-dev5-a2ec6e3f
3879
3890
 
3880
3891
  /**
3881
3892
  * Copyright (c) 2022, Salesforce, Inc.,
@@ -4002,7 +4013,7 @@
4002
4013
  }
4003
4014
  callbacks.push(callback);
4004
4015
  }
4005
- // version: 1.229.0-dev8-6c36d664c
4016
+ // version: 1.229.0-dev9-dd96b5901
4006
4017
 
4007
4018
  // TODO [TD-0081508]: once that TD is fulfilled we can probably change this file
4008
4019
  function instrumentAdapter$1(createFunction, _metadata) {
@@ -15463,7 +15474,7 @@
15463
15474
  }
15464
15475
  return superResult;
15465
15476
  }
15466
- // version: 1.229.0-dev8-6c36d664c
15477
+ // version: 1.229.0-dev9-dd96b5901
15467
15478
 
15468
15479
  function unwrap(data) {
15469
15480
  // The lwc-luvio bindings import a function from lwc called "unwrap".
@@ -16387,7 +16398,7 @@
16387
16398
  const { apiFamily, name } = metadata;
16388
16399
  return createGraphQLWireAdapterConstructor$1(adapter, `${apiFamily}.${name}`, luvio, astResolver);
16389
16400
  }
16390
- // version: 1.229.0-dev8-6c36d664c
16401
+ // version: 1.229.0-dev9-dd96b5901
16391
16402
 
16392
16403
  /**
16393
16404
  * Copyright (c) 2022, Salesforce, Inc.,
@@ -16486,7 +16497,7 @@
16486
16497
  TypeCheckShapes[TypeCheckShapes["Integer"] = 3] = "Integer";
16487
16498
  TypeCheckShapes[TypeCheckShapes["Unsupported"] = 4] = "Unsupported";
16488
16499
  })(TypeCheckShapes || (TypeCheckShapes = {}));
16489
- // engine version: 0.146.0-dev4-c265089a
16500
+ // engine version: 0.146.0-dev5-a2ec6e3f
16490
16501
 
16491
16502
  const { keys: ObjectKeys$3, create: ObjectCreate$3 } = Object;
16492
16503
 
@@ -20014,22 +20025,12 @@
20014
20025
  const fieldValueRepresentation = record.object('fields');
20015
20026
  const fieldName = path.shift();
20016
20027
  if (fieldValueRepresentation.isUndefined(fieldName) === true) {
20017
- // TODO [W-6900046]: remove cast, make RecordRepresentationNormalized['fields'] accept
20018
- // an undefined/non-present __ref if isMissing is present
20019
- fieldValueRepresentation.write(fieldName, {
20020
- __ref: undefined,
20021
- isMissing: true,
20022
- });
20028
+ writeMissingFieldToStore(fieldValueRepresentation, fieldName);
20023
20029
  return;
20024
20030
  }
20025
20031
  const link = fieldValueRepresentation.link(fieldName);
20026
20032
  if (link.isPending()) {
20027
- // TODO [W-6900046]: remove cast, make RecordRepresentationNormalized['fields'] accept
20028
- // an undefined/non-present __ref if isMissing is present
20029
- fieldValueRepresentation.write(fieldName, {
20030
- __ref: undefined,
20031
- isMissing: true,
20032
- });
20033
+ writeMissingFieldToStore(fieldValueRepresentation, fieldName);
20033
20034
  }
20034
20035
  else if (path.length > 0 && link.isMissing() === false) {
20035
20036
  const fieldValue = link.follow();
@@ -20045,6 +20046,19 @@
20045
20046
  }
20046
20047
  }
20047
20048
  }
20049
+ /**
20050
+ * Graph Node Directly modifies store entries, which is generally a non-starter.
20051
+ * Until we can refactor this mess, you need to use this function to safely mark the RecordRepresentation
20052
+ * as a seenId in the store when you perform this mutation.
20053
+ */
20054
+ function writeMissingFieldToStore(field, fieldName) {
20055
+ // TODO [W-6900046]: remove cast, make RecordRepresentationNormalized['fields'] accept
20056
+ // an undefined/non-present __ref if isMissing is present
20057
+ field.write(fieldName, {
20058
+ __ref: undefined,
20059
+ isMissing: true,
20060
+ });
20061
+ }
20048
20062
  /**
20049
20063
  * Tells you if an objectApiName is supported by UI API or not.
20050
20064
  * Note: Luvio does not currently support all the entities, the list is limited to UI API supported entities
@@ -20176,8 +20190,11 @@
20176
20190
  return existing;
20177
20191
  }
20178
20192
  function mergeRecordConflict(luvio, incoming, existing, recordConflictMap) {
20179
- const incomingNode = luvio.wrapNormalizedGraphNode(incoming);
20180
- const existingNode = luvio.wrapNormalizedGraphNode(existing);
20193
+ const recordKey = keyBuilder$1U(luvio, {
20194
+ recordId: incoming.id,
20195
+ });
20196
+ const incomingNode = luvio.wrapNormalizedGraphNode(incoming, recordKey);
20197
+ const existingNode = luvio.wrapNormalizedGraphNode(existing, recordKey);
20181
20198
  const incomingTrackedFieldsTrieRoot = {
20182
20199
  name: incoming.apiName,
20183
20200
  children: {},
@@ -20186,9 +20203,6 @@
20186
20203
  name: existing.apiName,
20187
20204
  children: {},
20188
20205
  };
20189
- const recordKey = keyBuilder$1U(luvio, {
20190
- recordId: incoming.id,
20191
- });
20192
20206
  const trackedFieldsConfig = {
20193
20207
  maxDepth: configurationForRestAdapters$1.getTrackedFieldDepthOnCacheMergeConflict(),
20194
20208
  onlyFetchLeafNodeIdAndName: configurationForRestAdapters$1.getTrackedFieldLeafNodeIdAndNameOnly(),
@@ -25309,7 +25323,7 @@
25309
25323
  const responsePromises = [];
25310
25324
  for (let i = 0, len = entries.length; i < len; i++) {
25311
25325
  const { key, record } = entries[i];
25312
- const node = luvio.wrapNormalizedGraphNode(record);
25326
+ const node = luvio.wrapNormalizedGraphNode(record, key);
25313
25327
  const optionalFields = getTrackedFields(key, node, {
25314
25328
  maxDepth: configurationForRestAdapters$1.getTrackedFieldDepthOnNotifyChange(),
25315
25329
  onlyFetchLeafNodeIdAndName: configurationForRestAdapters$1.getTrackedFieldLeafNodeIdAndNameOnly(),
@@ -41207,7 +41221,7 @@
41207
41221
  throttle(60, 60000, createLDSAdapter(luvio, 'notifyListInfoUpdateAvailable', notifyUpdateAvailableFactory$1));
41208
41222
  throttle(60, 60000, createLDSAdapter(luvio, 'notifyQuickActionDefaultsUpdateAvailable', notifyUpdateAvailableFactory));
41209
41223
  });
41210
- // version: 1.229.0-dev8-26b9af754
41224
+ // version: 1.229.0-dev9-939b09095
41211
41225
 
41212
41226
  var ldsIdempotencyWriteDisabled = {
41213
41227
  isOpen: function (e) {
@@ -42434,12 +42448,12 @@
42434
42448
  }
42435
42449
  return environment.getNode(key, ingestStagingStore);
42436
42450
  };
42437
- const wrapNormalizedGraphNode = function (normalized) {
42451
+ const wrapNormalizedGraphNode = function (normalized, key) {
42438
42452
  validateNotDisposed();
42439
42453
  if (ingestStagingStore === null) {
42440
42454
  ingestStagingStore = buildIngestStagingStore(environment);
42441
42455
  }
42442
- return environment.wrapNormalizedGraphNode(normalized, ingestStagingStore);
42456
+ return environment.wrapNormalizedGraphNode(normalized, key, ingestStagingStore);
42443
42457
  };
42444
42458
  const rebuildSnapshot = function (snapshot, onRebuild) {
42445
42459
  validateNotDisposed();
@@ -58068,7 +58082,7 @@
58068
58082
  id: '@salesforce/lds-network-adapter',
58069
58083
  instrument: instrument$1,
58070
58084
  });
58071
- // version: 1.229.0-dev8-6c36d664c
58085
+ // version: 1.229.0-dev9-dd96b5901
58072
58086
 
58073
58087
  const { create: create$2, keys: keys$2 } = Object;
58074
58088
  const { stringify: stringify$1, parse: parse$1 } = JSON;
@@ -76500,7 +76514,7 @@
76500
76514
  configuration: { ...configurationForGraphQLAdapters },
76501
76515
  instrument,
76502
76516
  });
76503
- // version: 1.229.0-dev8-26b9af754
76517
+ // version: 1.229.0-dev9-939b09095
76504
76518
 
76505
76519
  // On core the unstable adapters are re-exported with different names,
76506
76520
 
@@ -78747,7 +78761,7 @@
78747
78761
  unstable_graphQL_imperative = createImperativeAdapter(luvio, createInstrumentedAdapter(ldsAdapter, adapterMetadata), adapterMetadata);
78748
78762
  graphQLImperative = ldsAdapter;
78749
78763
  });
78750
- // version: 1.229.0-dev8-26b9af754
78764
+ // version: 1.229.0-dev9-939b09095
78751
78765
 
78752
78766
  var gqlApi = /*#__PURE__*/Object.freeze({
78753
78767
  __proto__: null,
@@ -79478,4 +79492,4 @@
79478
79492
  Object.defineProperty(exports, '__esModule', { value: true });
79479
79493
 
79480
79494
  }));
79481
- // version: 1.229.0-dev8-6c36d664c
79495
+ // version: 1.229.0-dev9-dd96b5901
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/lds-worker-api",
3
- "version": "1.229.0-dev8",
3
+ "version": "1.229.0-dev9",
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.229.0-dev8",
39
- "@salesforce/lds-adapters-uiapi": "1.229.0-dev8",
40
- "@salesforce/lds-default-luvio": "1.229.0-dev8",
41
- "@salesforce/lds-drafts": "1.229.0-dev8",
42
- "@salesforce/lds-graphql-parser": "1.229.0-dev8",
43
- "@salesforce/lds-luvio-engine": "1.229.0-dev8",
44
- "@salesforce/lds-priming": "1.229.0-dev8",
45
- "@salesforce/lds-runtime-mobile": "1.229.0-dev8",
46
- "@salesforce/nimbus-plugin-lds": "1.229.0-dev8",
38
+ "@salesforce/lds-adapters-graphql": "1.229.0-dev9",
39
+ "@salesforce/lds-adapters-uiapi": "1.229.0-dev9",
40
+ "@salesforce/lds-default-luvio": "1.229.0-dev9",
41
+ "@salesforce/lds-drafts": "1.229.0-dev9",
42
+ "@salesforce/lds-graphql-parser": "1.229.0-dev9",
43
+ "@salesforce/lds-luvio-engine": "1.229.0-dev9",
44
+ "@salesforce/lds-priming": "1.229.0-dev9",
45
+ "@salesforce/lds-runtime-mobile": "1.229.0-dev9",
46
+ "@salesforce/nimbus-plugin-lds": "1.229.0-dev9",
47
47
  "ajv": "^8.11.0",
48
48
  "glob": "^7.1.5",
49
49
  "nimbus-types": "^2.0.0-alpha1",