@salesforce/lds-worker-api 1.347.0 → 1.348.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.
@@ -1128,4 +1128,4 @@ if (process.env.NODE_ENV !== 'production') {
1128
1128
  }
1129
1129
 
1130
1130
  export { createPrimingSession, draftManager, draftQueue, evictCacheRecordsByIds, evictExpiredCacheEntries, executeAdapter, executeMutatingAdapter, getImperativeAdapterNames, invokeAdapter, invokeAdapterWithDraftToMerge, invokeAdapterWithDraftToReplace, invokeAdapterWithMetadata, nimbusDraftQueue, setMetadataTTL, setUiApiRecordTTL, stopEviction, subscribeToAdapter };
1131
- // version: 1.347.0-ef72dda80d
1131
+ // version: 1.348.0-09ae8e3e37
@@ -2157,7 +2157,8 @@ function buildValidAtImplementation(basePolicyImplementation, timestamp) {
2157
2157
  function isNodeLink(node) {
2158
2158
  return (typeof node === 'object' &&
2159
2159
  node !== null &&
2160
- hasOwnProperty$4.call(node, '__ref'));
2160
+ (hasOwnProperty$4.call(node, '__ref') ||
2161
+ hasOwnProperty$4.call(node, 'isMissing')));
2161
2162
  }
2162
2163
  function isGraphNode$2(node) {
2163
2164
  return node !== null && node.type === GraphNodeType$1.Node;
@@ -4137,7 +4138,7 @@ function createResourceParamsImpl(config, configMetadata) {
4137
4138
  }
4138
4139
  return resourceParams;
4139
4140
  }
4140
- // engine version: 0.156.6-042d5d87
4141
+ // engine version: 0.156.7-d2b9c7ef
4141
4142
 
4142
4143
  /**
4143
4144
  * Copyright (c) 2022, Salesforce, Inc.,
@@ -4265,7 +4266,7 @@ function withDefaultLuvio(callback) {
4265
4266
  }
4266
4267
  callbacks.push(callback);
4267
4268
  }
4268
- // version: 1.347.0-ef72dda80d
4269
+ // version: 1.348.0-09ae8e3e37
4269
4270
 
4270
4271
  // TODO [TD-0081508]: once that TD is fulfilled we can probably change this file
4271
4272
  function instrumentAdapter$1(createFunction, _metadata) {
@@ -5213,7 +5214,7 @@ function createGraphQLWireAdapterConstructor(luvio, adapter, metadata, astResolv
5213
5214
  const { apiFamily, name } = metadata;
5214
5215
  return createGraphQLWireAdapterConstructor$1(adapter, `${apiFamily}.${name}`, luvio, astResolver);
5215
5216
  }
5216
- // version: 1.347.0-ef72dda80d
5217
+ // version: 1.348.0-09ae8e3e37
5217
5218
 
5218
5219
  /**
5219
5220
  * Copyright (c) 2022, Salesforce, Inc.,
@@ -5312,7 +5313,7 @@ var TypeCheckShapes;
5312
5313
  TypeCheckShapes[TypeCheckShapes["Integer"] = 3] = "Integer";
5313
5314
  TypeCheckShapes[TypeCheckShapes["Unsupported"] = 4] = "Unsupported";
5314
5315
  })(TypeCheckShapes || (TypeCheckShapes = {}));
5315
- // engine version: 0.156.6-042d5d87
5316
+ // engine version: 0.156.7-d2b9c7ef
5316
5317
 
5317
5318
  const { keys: ObjectKeys$4, create: ObjectCreate$4 } = Object;
5318
5319
 
@@ -30362,7 +30363,7 @@ function ingestAndBroadcast(luvio, key, config, body) {
30362
30363
  return buildCachedSnapshot$5$1(luvio, config);
30363
30364
  });
30364
30365
  }
30365
- function clone$1(userLayoutState) {
30366
+ function clone$2(userLayoutState) {
30366
30367
  return parse$7(stringify$6(userLayoutState));
30367
30368
  }
30368
30369
  // Applies optimisticUpdate to layoutUserState
@@ -30385,7 +30386,7 @@ function optimisticUpdate(cachedLayoutUserState, layoutUserStateInput) {
30385
30386
  if (clonedLayoutUserState === undefined) {
30386
30387
  // We have to clone cachedLayoutUserState because this object is coming from
30387
30388
  // a snapshot, where it is frozen
30388
- clonedLayoutUserState = clone$1(cachedLayoutUserState);
30389
+ clonedLayoutUserState = clone$2(cachedLayoutUserState);
30389
30390
  // hold onto sectionUserStates from clonedLayoutUserState
30390
30391
  clonedLayoutUserStateSections = clonedLayoutUserState.sectionUserStates;
30391
30392
  }
@@ -33970,7 +33971,7 @@ withDefaultLuvio((luvio) => {
33970
33971
  throttle(60, 60000, setupNotifyAllListRecordUpdateAvailable(luvio));
33971
33972
  throttle(60, 60000, setupNotifyAllListInfoSummaryUpdateAvailable(luvio));
33972
33973
  });
33973
- // version: 1.347.0-31679f40fc
33974
+ // version: 1.348.0-4aa8c0c0cb
33974
33975
 
33975
33976
  /**
33976
33977
  * Returns true if the value acts like a Promise, i.e. has a "then" function,
@@ -48063,7 +48064,7 @@ class DurableDraftQueue {
48063
48064
  }
48064
48065
  }
48065
48066
 
48066
- function clone(obj) {
48067
+ function clone$1(obj) {
48067
48068
  return parse$3(stringify$3(obj));
48068
48069
  }
48069
48070
 
@@ -48110,7 +48111,7 @@ class DurableDraftStore {
48110
48111
  for (let i = 0, len = keys$1.length; i < len; i++) {
48111
48112
  const key = keys$1[i];
48112
48113
  // clone draft so we don't expose the internal draft store
48113
- actionArray.push(clone(draftStore[key]));
48114
+ actionArray.push(clone$1(draftStore[key]));
48114
48115
  }
48115
48116
  return actionArray;
48116
48117
  });
@@ -79471,9 +79472,15 @@ class AbstractResourceRequestActionHandler {
79471
79472
  await this.recordService.reapplyRecordSideEffects(impactedKeys);
79472
79473
  }
79473
79474
  async handleActionReplaced(target, source) {
79475
+ // remove both the siden effects from the actions being merged before we
79476
+ // recalculate the new side effect value needed
79474
79477
  const impactedKeysFromRemove = await this.recordService.removeSideEffectsForAction(source);
79478
+ const removedSideEffectFromSet = await this.recordService.removeSideEffectsForAction(target);
79479
+ // revert the values in the DEFAULT store back to what it was before the removed side effects
79480
+ await this.recordService.reapplyRecordSideEffects(new Set([...impactedKeysFromRemove, ...removedSideEffectFromSet]));
79481
+ // set the new side effect values for the merged action
79475
79482
  const impactedKeysFromSet = await this.recordService.setSideEffectsForActions([target]);
79476
- await this.recordService.reapplyRecordSideEffects(new Set([...impactedKeysFromRemove, ...impactedKeysFromSet]));
79483
+ await this.recordService.reapplyRecordSideEffects(new Set([...impactedKeysFromSet]));
79477
79484
  }
79478
79485
  async handleActionCompleted(action, queueOperations) {
79479
79486
  const { data: request, tag } = action;
@@ -92266,6 +92273,10 @@ class SideEffectService {
92266
92273
  }
92267
92274
  }
92268
92275
 
92276
+ function clone(obj) {
92277
+ return parse$2(stringify$2(obj));
92278
+ }
92279
+
92269
92280
  /* global __nimbus */
92270
92281
  class CreateRecordEffectHandler {
92271
92282
  apply(entry, effect) {
@@ -92273,7 +92284,9 @@ class CreateRecordEffectHandler {
92273
92284
  // log that we can't apply a draft-create to an existing record
92274
92285
  throw Error('cannot apply a record-create side effect to an existing record');
92275
92286
  }
92276
- return { ...effect.record };
92287
+ // return a copy of the record to not modify
92288
+ // what is saved in the side effect store
92289
+ return { ...clone(effect.record) };
92277
92290
  }
92278
92291
  }
92279
92292
  class UpdateRecordEffectHandler {
@@ -92759,7 +92772,7 @@ register$1({
92759
92772
  id: '@salesforce/lds-network-adapter',
92760
92773
  instrument: instrument$2,
92761
92774
  });
92762
- // version: 1.347.0-ef72dda80d
92775
+ // version: 1.348.0-09ae8e3e37
92763
92776
 
92764
92777
  const { create: create$2, keys: keys$2 } = Object;
92765
92778
  const { stringify, parse } = JSON;
@@ -116654,7 +116667,7 @@ register$1({
116654
116667
  configuration: { ...configurationForGraphQLAdapters$1 },
116655
116668
  instrument: instrument$1,
116656
116669
  });
116657
- // version: 1.347.0-31679f40fc
116670
+ // version: 1.348.0-4aa8c0c0cb
116658
116671
 
116659
116672
  // On core the unstable adapters are re-exported with different names,
116660
116673
  // we want to match them here.
@@ -116806,7 +116819,7 @@ withDefaultLuvio((luvio) => {
116806
116819
  unstable_graphQL_imperative = createImperativeAdapter(luvio, createInstrumentedAdapter(ldsAdapter, adapterMetadata), adapterMetadata);
116807
116820
  graphQLImperative = ldsAdapter;
116808
116821
  });
116809
- // version: 1.347.0-31679f40fc
116822
+ // version: 1.348.0-4aa8c0c0cb
116810
116823
 
116811
116824
  var gqlApi = /*#__PURE__*/Object.freeze({
116812
116825
  __proto__: null,
@@ -117598,7 +117611,7 @@ const callbacks$1 = [];
117598
117611
  function register(r) {
117599
117612
  callbacks$1.forEach((callback) => callback(r));
117600
117613
  }
117601
- // version: 1.347.0-ef72dda80d
117614
+ // version: 1.348.0-09ae8e3e37
117602
117615
 
117603
117616
  /**
117604
117617
  * Copyright (c) 2022, Salesforce, Inc.,
@@ -118678,4 +118691,4 @@ const { luvio } = getRuntime();
118678
118691
  setDefaultLuvio({ luvio });
118679
118692
 
118680
118693
  export { createPrimingSession, draftManager, draftQueue, evictCacheRecordsByIds, evictExpiredCacheEntries, executeAdapter, executeMutatingAdapter, getImperativeAdapterNames, invokeAdapter, invokeAdapterWithDraftToMerge, invokeAdapterWithDraftToReplace, invokeAdapterWithMetadata, nimbusDraftQueue, registerReportObserver, setMetadataTTL, setUiApiRecordTTL, stopEviction, subscribeToAdapter };
118681
- // version: 1.347.0-ef72dda80d
118694
+ // version: 1.348.0-09ae8e3e37
@@ -2163,7 +2163,8 @@
2163
2163
  function isNodeLink(node) {
2164
2164
  return (typeof node === 'object' &&
2165
2165
  node !== null &&
2166
- hasOwnProperty$4.call(node, '__ref'));
2166
+ (hasOwnProperty$4.call(node, '__ref') ||
2167
+ hasOwnProperty$4.call(node, 'isMissing')));
2167
2168
  }
2168
2169
  function isGraphNode$2(node) {
2169
2170
  return node !== null && node.type === GraphNodeType$1.Node;
@@ -4143,7 +4144,7 @@
4143
4144
  }
4144
4145
  return resourceParams;
4145
4146
  }
4146
- // engine version: 0.156.6-042d5d87
4147
+ // engine version: 0.156.7-d2b9c7ef
4147
4148
 
4148
4149
  /**
4149
4150
  * Copyright (c) 2022, Salesforce, Inc.,
@@ -4271,7 +4272,7 @@
4271
4272
  }
4272
4273
  callbacks.push(callback);
4273
4274
  }
4274
- // version: 1.347.0-ef72dda80d
4275
+ // version: 1.348.0-09ae8e3e37
4275
4276
 
4276
4277
  // TODO [TD-0081508]: once that TD is fulfilled we can probably change this file
4277
4278
  function instrumentAdapter$1(createFunction, _metadata) {
@@ -5219,7 +5220,7 @@
5219
5220
  const { apiFamily, name } = metadata;
5220
5221
  return createGraphQLWireAdapterConstructor$1(adapter, `${apiFamily}.${name}`, luvio, astResolver);
5221
5222
  }
5222
- // version: 1.347.0-ef72dda80d
5223
+ // version: 1.348.0-09ae8e3e37
5223
5224
 
5224
5225
  /**
5225
5226
  * Copyright (c) 2022, Salesforce, Inc.,
@@ -5318,7 +5319,7 @@
5318
5319
  TypeCheckShapes[TypeCheckShapes["Integer"] = 3] = "Integer";
5319
5320
  TypeCheckShapes[TypeCheckShapes["Unsupported"] = 4] = "Unsupported";
5320
5321
  })(TypeCheckShapes || (TypeCheckShapes = {}));
5321
- // engine version: 0.156.6-042d5d87
5322
+ // engine version: 0.156.7-d2b9c7ef
5322
5323
 
5323
5324
  const { keys: ObjectKeys$4, create: ObjectCreate$4 } = Object;
5324
5325
 
@@ -30368,7 +30369,7 @@
30368
30369
  return buildCachedSnapshot$5$1(luvio, config);
30369
30370
  });
30370
30371
  }
30371
- function clone$1(userLayoutState) {
30372
+ function clone$2(userLayoutState) {
30372
30373
  return parse$7(stringify$6(userLayoutState));
30373
30374
  }
30374
30375
  // Applies optimisticUpdate to layoutUserState
@@ -30391,7 +30392,7 @@
30391
30392
  if (clonedLayoutUserState === undefined) {
30392
30393
  // We have to clone cachedLayoutUserState because this object is coming from
30393
30394
  // a snapshot, where it is frozen
30394
- clonedLayoutUserState = clone$1(cachedLayoutUserState);
30395
+ clonedLayoutUserState = clone$2(cachedLayoutUserState);
30395
30396
  // hold onto sectionUserStates from clonedLayoutUserState
30396
30397
  clonedLayoutUserStateSections = clonedLayoutUserState.sectionUserStates;
30397
30398
  }
@@ -33976,7 +33977,7 @@
33976
33977
  throttle(60, 60000, setupNotifyAllListRecordUpdateAvailable(luvio));
33977
33978
  throttle(60, 60000, setupNotifyAllListInfoSummaryUpdateAvailable(luvio));
33978
33979
  });
33979
- // version: 1.347.0-31679f40fc
33980
+ // version: 1.348.0-4aa8c0c0cb
33980
33981
 
33981
33982
  /**
33982
33983
  * Returns true if the value acts like a Promise, i.e. has a "then" function,
@@ -48069,7 +48070,7 @@
48069
48070
  }
48070
48071
  }
48071
48072
 
48072
- function clone(obj) {
48073
+ function clone$1(obj) {
48073
48074
  return parse$3(stringify$3(obj));
48074
48075
  }
48075
48076
 
@@ -48116,7 +48117,7 @@
48116
48117
  for (let i = 0, len = keys$1.length; i < len; i++) {
48117
48118
  const key = keys$1[i];
48118
48119
  // clone draft so we don't expose the internal draft store
48119
- actionArray.push(clone(draftStore[key]));
48120
+ actionArray.push(clone$1(draftStore[key]));
48120
48121
  }
48121
48122
  return actionArray;
48122
48123
  });
@@ -79477,9 +79478,15 @@
79477
79478
  await this.recordService.reapplyRecordSideEffects(impactedKeys);
79478
79479
  }
79479
79480
  async handleActionReplaced(target, source) {
79481
+ // remove both the siden effects from the actions being merged before we
79482
+ // recalculate the new side effect value needed
79480
79483
  const impactedKeysFromRemove = await this.recordService.removeSideEffectsForAction(source);
79484
+ const removedSideEffectFromSet = await this.recordService.removeSideEffectsForAction(target);
79485
+ // revert the values in the DEFAULT store back to what it was before the removed side effects
79486
+ await this.recordService.reapplyRecordSideEffects(new Set([...impactedKeysFromRemove, ...removedSideEffectFromSet]));
79487
+ // set the new side effect values for the merged action
79481
79488
  const impactedKeysFromSet = await this.recordService.setSideEffectsForActions([target]);
79482
- await this.recordService.reapplyRecordSideEffects(new Set([...impactedKeysFromRemove, ...impactedKeysFromSet]));
79489
+ await this.recordService.reapplyRecordSideEffects(new Set([...impactedKeysFromSet]));
79483
79490
  }
79484
79491
  async handleActionCompleted(action, queueOperations) {
79485
79492
  const { data: request, tag } = action;
@@ -92272,6 +92279,10 @@
92272
92279
  }
92273
92280
  }
92274
92281
 
92282
+ function clone(obj) {
92283
+ return parse$2(stringify$2(obj));
92284
+ }
92285
+
92275
92286
  /* global __nimbus */
92276
92287
  class CreateRecordEffectHandler {
92277
92288
  apply(entry, effect) {
@@ -92279,7 +92290,9 @@
92279
92290
  // log that we can't apply a draft-create to an existing record
92280
92291
  throw Error('cannot apply a record-create side effect to an existing record');
92281
92292
  }
92282
- return { ...effect.record };
92293
+ // return a copy of the record to not modify
92294
+ // what is saved in the side effect store
92295
+ return { ...clone(effect.record) };
92283
92296
  }
92284
92297
  }
92285
92298
  class UpdateRecordEffectHandler {
@@ -92765,7 +92778,7 @@
92765
92778
  id: '@salesforce/lds-network-adapter',
92766
92779
  instrument: instrument$2,
92767
92780
  });
92768
- // version: 1.347.0-ef72dda80d
92781
+ // version: 1.348.0-09ae8e3e37
92769
92782
 
92770
92783
  const { create: create$2, keys: keys$2 } = Object;
92771
92784
  const { stringify, parse } = JSON;
@@ -116660,7 +116673,7 @@
116660
116673
  configuration: { ...configurationForGraphQLAdapters$1 },
116661
116674
  instrument: instrument$1,
116662
116675
  });
116663
- // version: 1.347.0-31679f40fc
116676
+ // version: 1.348.0-4aa8c0c0cb
116664
116677
 
116665
116678
  // On core the unstable adapters are re-exported with different names,
116666
116679
  // we want to match them here.
@@ -116812,7 +116825,7 @@
116812
116825
  unstable_graphQL_imperative = createImperativeAdapter(luvio, createInstrumentedAdapter(ldsAdapter, adapterMetadata), adapterMetadata);
116813
116826
  graphQLImperative = ldsAdapter;
116814
116827
  });
116815
- // version: 1.347.0-31679f40fc
116828
+ // version: 1.348.0-4aa8c0c0cb
116816
116829
 
116817
116830
  var gqlApi = /*#__PURE__*/Object.freeze({
116818
116831
  __proto__: null,
@@ -117604,7 +117617,7 @@
117604
117617
  function register(r) {
117605
117618
  callbacks$1.forEach((callback) => callback(r));
117606
117619
  }
117607
- // version: 1.347.0-ef72dda80d
117620
+ // version: 1.348.0-09ae8e3e37
117608
117621
 
117609
117622
  /**
117610
117623
  * Copyright (c) 2022, Salesforce, Inc.,
@@ -118703,4 +118716,4 @@
118703
118716
  exports.subscribeToAdapter = subscribeToAdapter;
118704
118717
 
118705
118718
  }));
118706
- // version: 1.347.0-ef72dda80d
118719
+ // version: 1.348.0-09ae8e3e37
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/lds-worker-api",
3
- "version": "1.347.0",
3
+ "version": "1.348.0",
4
4
  "license": "SEE LICENSE IN LICENSE.txt",
5
5
  "description": "",
6
6
  "main": "dist/standalone/es/lds-worker-api.js",
@@ -35,14 +35,14 @@
35
35
  },
36
36
  "devDependencies": {
37
37
  "@oat-sa/rollup-plugin-wildcard-external": "^1.0.0",
38
- "@salesforce/lds-adapters-graphql": "^1.347.0",
39
- "@salesforce/lds-adapters-uiapi": "^1.347.0",
40
- "@salesforce/lds-default-luvio": "^1.347.0",
41
- "@salesforce/lds-drafts": "^1.347.0",
42
- "@salesforce/lds-graphql-parser": "^1.347.0",
43
- "@salesforce/lds-luvio-engine": "^1.347.0",
44
- "@salesforce/lds-runtime-mobile": "^1.347.0",
45
- "@salesforce/nimbus-plugin-lds": "^1.347.0",
38
+ "@salesforce/lds-adapters-graphql": "^1.348.0",
39
+ "@salesforce/lds-adapters-uiapi": "^1.348.0",
40
+ "@salesforce/lds-default-luvio": "^1.348.0",
41
+ "@salesforce/lds-drafts": "^1.348.0",
42
+ "@salesforce/lds-graphql-parser": "^1.348.0",
43
+ "@salesforce/lds-luvio-engine": "^1.348.0",
44
+ "@salesforce/lds-runtime-mobile": "^1.348.0",
45
+ "@salesforce/nimbus-plugin-lds": "^1.348.0",
46
46
  "ajv": "^8.11.0",
47
47
  "glob": "^7.1.5",
48
48
  "nimbus-types": "^2.0.0-alpha1",