@salesforce/lds-worker-api 1.227.0 → 1.227.1

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.227.0-f636c0f4c
798
+ // version: 1.227.1-9eac9f138
@@ -3841,7 +3841,7 @@ function createResourceParamsImpl(config, configMetadata) {
3841
3841
  }
3842
3842
  return resourceParams;
3843
3843
  }
3844
- // engine version: 0.144.8-6b791a2d
3844
+ // engine version: 0.145.0-a2297ae0
3845
3845
 
3846
3846
  /**
3847
3847
  * Copyright (c) 2022, Salesforce, Inc.,
@@ -3968,7 +3968,7 @@ function withDefaultLuvio(callback) {
3968
3968
  }
3969
3969
  callbacks.push(callback);
3970
3970
  }
3971
- // version: 1.227.0-f636c0f4c
3971
+ // version: 1.227.1-9eac9f138
3972
3972
 
3973
3973
  // TODO [TD-0081508]: once that TD is fulfilled we can probably change this file
3974
3974
  function instrumentAdapter$1(createFunction, _metadata) {
@@ -15429,7 +15429,7 @@ function gql(literals, ...subs) {
15429
15429
  }
15430
15430
  return superResult;
15431
15431
  }
15432
- // version: 1.227.0-f636c0f4c
15432
+ // version: 1.227.1-9eac9f138
15433
15433
 
15434
15434
  function unwrap(data) {
15435
15435
  // The lwc-luvio bindings import a function from lwc called "unwrap".
@@ -16352,7 +16352,7 @@ function createGraphQLWireAdapterConstructor(luvio, adapter, metadata, astResolv
16352
16352
  const { apiFamily, name } = metadata;
16353
16353
  return createGraphQLWireAdapterConstructor$1(adapter, `${apiFamily}.${name}`, luvio, astResolver);
16354
16354
  }
16355
- // version: 1.227.0-f636c0f4c
16355
+ // version: 1.227.1-9eac9f138
16356
16356
 
16357
16357
  /**
16358
16358
  * Copyright (c) 2022, Salesforce, Inc.,
@@ -16451,7 +16451,7 @@ var TypeCheckShapes;
16451
16451
  TypeCheckShapes[TypeCheckShapes["Integer"] = 3] = "Integer";
16452
16452
  TypeCheckShapes[TypeCheckShapes["Unsupported"] = 4] = "Unsupported";
16453
16453
  })(TypeCheckShapes || (TypeCheckShapes = {}));
16454
- // engine version: 0.144.8-6b791a2d
16454
+ // engine version: 0.145.0-a2297ae0
16455
16455
 
16456
16456
  const { keys: ObjectKeys$3, create: ObjectCreate$3 } = Object;
16457
16457
 
@@ -41145,7 +41145,7 @@ withDefaultLuvio((luvio) => {
41145
41145
  throttle(60, 60000, createLDSAdapter(luvio, 'notifyListViewSummaryUpdateAvailable', notifyUpdateAvailableFactory$1));
41146
41146
  throttle(60, 60000, createLDSAdapter(luvio, 'notifyListInfoUpdateAvailable', notifyUpdateAvailableFactory));
41147
41147
  });
41148
- // version: 1.227.0-267d3ea17
41148
+ // version: 1.227.1-a3108f583
41149
41149
 
41150
41150
  var caseSensitiveUserId = '005B0000000GR4OIAW';
41151
41151
 
@@ -41749,6 +41749,8 @@ function isDeprecatedDurableStoreEntry(durableRecord) {
41749
41749
  }
41750
41750
  const DefaultDurableSegment = 'DEFAULT';
41751
41751
  const RedirectDurableSegment = 'REDIRECT_KEYS';
41752
+ const MessagingDurableSegment = 'MESSAGING';
41753
+ const MessageNotifyStoreUpdateAvailable = 'notifyStoreUpdateAvailable';
41752
41754
 
41753
41755
  const { keys: keys$7, create: create$6, assign: assign$6, freeze: freeze$1$1 } = Object;
41754
41756
 
@@ -42184,6 +42186,7 @@ function makeDurable(environment, { durableStore, instrumentation }) {
42184
42186
  const defaultSegmentKeys = [];
42185
42187
  const adapterContextSegmentKeys = [];
42186
42188
  const redirectSegmentKeys = [];
42189
+ const messagingSegmentKeys = [];
42187
42190
  let shouldBroadcast = false;
42188
42191
  for (let i = 0, len = changes.length; i < len; i++) {
42189
42192
  const change = changes[i];
@@ -42198,6 +42201,9 @@ function makeDurable(environment, { durableStore, instrumentation }) {
42198
42201
  else if (change.segment === RedirectDurableSegment) {
42199
42202
  redirectSegmentKeys.push(...change.ids);
42200
42203
  }
42204
+ else if (change.segment === MessagingDurableSegment) {
42205
+ messagingSegmentKeys.push(...change.ids);
42206
+ }
42201
42207
  }
42202
42208
  if (redirectSegmentKeys.length > 0) {
42203
42209
  const redirectEntries = await durableStore.getEntries(redirectSegmentKeys, RedirectDurableSegment);
@@ -42257,6 +42263,20 @@ function makeDurable(environment, { durableStore, instrumentation }) {
42257
42263
  if (shouldBroadcast) {
42258
42264
  await environment.storeBroadcast(rebuildSnapshot, environment.snapshotAvailable);
42259
42265
  }
42266
+ // if having notifyStoreUpdateAvailable msg, then pull the message body out from store
42267
+ // and call environment.notifyStoreUpdateAvailable
42268
+ if (messagingSegmentKeys.includes(MessageNotifyStoreUpdateAvailable)) {
42269
+ const entries = await durableStore.getEntries([MessageNotifyStoreUpdateAvailable], MessagingDurableSegment);
42270
+ if (entries !== undefined) {
42271
+ const notifyEntry = entries[MessageNotifyStoreUpdateAvailable];
42272
+ if (notifyEntry !== undefined) {
42273
+ const keys = notifyEntry.data;
42274
+ if (keys.length > 0) {
42275
+ environment.notifyStoreUpdateAvailable(keys);
42276
+ }
42277
+ }
42278
+ }
42279
+ }
42260
42280
  });
42261
42281
  const dispose = function () {
42262
42282
  validateNotDisposed();
@@ -42592,6 +42612,39 @@ function makeDurable(environment, { durableStore, instrumentation }) {
42592
42612
  return entries;
42593
42613
  });
42594
42614
  };
42615
+ // flag entries specified by keys in durable store as expired.
42616
+ // send a notifyStoreUpdateAvailable message through durable store set entries to
42617
+ // indirectly triggers all js environments to refresh snapshots if overlapping with keys.
42618
+ const notifyStoreUpdateAvailable = async function (keys$1) {
42619
+ validateNotDisposed();
42620
+ const entryKeys = keys$1.map(serializeStructuredKey);
42621
+ const entries = await durableStore.getEntries(entryKeys, DefaultDurableSegment);
42622
+ if (entries === undefined || keys$7(entries).length === 0) {
42623
+ return environment.notifyStoreUpdateAvailable(keys$1);
42624
+ }
42625
+ const now = Date.now();
42626
+ let needWriteBack = false;
42627
+ for (let i = 0; i < entryKeys.length; i++) {
42628
+ const key = entryKeys[i];
42629
+ const entry = entries[key];
42630
+ if (entry !== undefined) {
42631
+ const storeEntry = entry;
42632
+ if (storeEntry.metadata !== undefined) {
42633
+ storeEntry.metadata = {
42634
+ ...storeEntry.metadata,
42635
+ expirationTimestamp: now,
42636
+ };
42637
+ }
42638
+ needWriteBack = true;
42639
+ }
42640
+ }
42641
+ if (needWriteBack) {
42642
+ await durableStore.setEntries(entries, DefaultDurableSegment);
42643
+ }
42644
+ // push a notifyStoreUpdateAvailable message with entryKeys as data into messaging segment
42645
+ await durableStore.setEntries({ notifyStoreUpdateAvailable: { data: entryKeys } }, MessagingDurableSegment);
42646
+ return Promise.resolve(undefined);
42647
+ };
42595
42648
  // set the default cache policy of the base environment
42596
42649
  environment.setDefaultCachePolicy({
42597
42650
  type: 'stale-while-revalidate',
@@ -42622,6 +42675,7 @@ function makeDurable(environment, { durableStore, instrumentation }) {
42622
42675
  handleSuccessResponse: { value: handleSuccessResponse },
42623
42676
  handleErrorResponse: { value: handleErrorResponse },
42624
42677
  getNotifyChangeStoreEntries: { value: getNotifyChangeStoreEntries },
42678
+ notifyStoreUpdateAvailable: { value: notifyStoreUpdateAvailable },
42625
42679
  });
42626
42680
  }
42627
42681
 
@@ -57743,7 +57797,7 @@ register({
57743
57797
  id: '@salesforce/lds-network-adapter',
57744
57798
  instrument: instrument$1,
57745
57799
  });
57746
- // version: 1.227.0-f636c0f4c
57800
+ // version: 1.227.1-9eac9f138
57747
57801
 
57748
57802
  const { create: create$2, keys: keys$2 } = Object;
57749
57803
  const { stringify: stringify$1, parse: parse$1 } = JSON;
@@ -76021,7 +76075,7 @@ register({
76021
76075
  configuration: { ...configurationForGraphQLAdapters },
76022
76076
  instrument,
76023
76077
  });
76024
- // version: 1.227.0-267d3ea17
76078
+ // version: 1.227.1-a3108f583
76025
76079
 
76026
76080
  // On core the unstable adapters are re-exported with different names,
76027
76081
 
@@ -78268,7 +78322,7 @@ withDefaultLuvio((luvio) => {
78268
78322
  unstable_graphQL_imperative = createImperativeAdapter(luvio, createInstrumentedAdapter(ldsAdapter, adapterMetadata), adapterMetadata);
78269
78323
  graphQLImperative = ldsAdapter;
78270
78324
  });
78271
- // version: 1.227.0-267d3ea17
78325
+ // version: 1.227.1-a3108f583
78272
78326
 
78273
78327
  var gqlApi = /*#__PURE__*/Object.freeze({
78274
78328
  __proto__: null,
@@ -78982,4 +79036,4 @@ const { luvio } = getRuntime();
78982
79036
  setDefaultLuvio({ luvio });
78983
79037
 
78984
79038
  export { createPrimingSession, draftManager, draftQueue, executeAdapter, executeMutatingAdapter, getImperativeAdapterNames, invokeAdapter, invokeAdapterWithDraftToReplace, invokeAdapterWithMetadata, nimbusDraftQueue, registerReportObserver, setMetadataTTL, setUiApiRecordTTL, subscribeToAdapter };
78985
- // version: 1.227.0-f636c0f4c
79039
+ // version: 1.227.1-9eac9f138
@@ -3847,7 +3847,7 @@
3847
3847
  }
3848
3848
  return resourceParams;
3849
3849
  }
3850
- // engine version: 0.144.8-6b791a2d
3850
+ // engine version: 0.145.0-a2297ae0
3851
3851
 
3852
3852
  /**
3853
3853
  * Copyright (c) 2022, Salesforce, Inc.,
@@ -3974,7 +3974,7 @@
3974
3974
  }
3975
3975
  callbacks.push(callback);
3976
3976
  }
3977
- // version: 1.227.0-f636c0f4c
3977
+ // version: 1.227.1-9eac9f138
3978
3978
 
3979
3979
  // TODO [TD-0081508]: once that TD is fulfilled we can probably change this file
3980
3980
  function instrumentAdapter$1(createFunction, _metadata) {
@@ -15435,7 +15435,7 @@
15435
15435
  }
15436
15436
  return superResult;
15437
15437
  }
15438
- // version: 1.227.0-f636c0f4c
15438
+ // version: 1.227.1-9eac9f138
15439
15439
 
15440
15440
  function unwrap(data) {
15441
15441
  // The lwc-luvio bindings import a function from lwc called "unwrap".
@@ -16358,7 +16358,7 @@
16358
16358
  const { apiFamily, name } = metadata;
16359
16359
  return createGraphQLWireAdapterConstructor$1(adapter, `${apiFamily}.${name}`, luvio, astResolver);
16360
16360
  }
16361
- // version: 1.227.0-f636c0f4c
16361
+ // version: 1.227.1-9eac9f138
16362
16362
 
16363
16363
  /**
16364
16364
  * Copyright (c) 2022, Salesforce, Inc.,
@@ -16457,7 +16457,7 @@
16457
16457
  TypeCheckShapes[TypeCheckShapes["Integer"] = 3] = "Integer";
16458
16458
  TypeCheckShapes[TypeCheckShapes["Unsupported"] = 4] = "Unsupported";
16459
16459
  })(TypeCheckShapes || (TypeCheckShapes = {}));
16460
- // engine version: 0.144.8-6b791a2d
16460
+ // engine version: 0.145.0-a2297ae0
16461
16461
 
16462
16462
  const { keys: ObjectKeys$3, create: ObjectCreate$3 } = Object;
16463
16463
 
@@ -41151,7 +41151,7 @@
41151
41151
  throttle(60, 60000, createLDSAdapter(luvio, 'notifyListViewSummaryUpdateAvailable', notifyUpdateAvailableFactory$1));
41152
41152
  throttle(60, 60000, createLDSAdapter(luvio, 'notifyListInfoUpdateAvailable', notifyUpdateAvailableFactory));
41153
41153
  });
41154
- // version: 1.227.0-267d3ea17
41154
+ // version: 1.227.1-a3108f583
41155
41155
 
41156
41156
  var caseSensitiveUserId = '005B0000000GR4OIAW';
41157
41157
 
@@ -41755,6 +41755,8 @@
41755
41755
  }
41756
41756
  const DefaultDurableSegment = 'DEFAULT';
41757
41757
  const RedirectDurableSegment = 'REDIRECT_KEYS';
41758
+ const MessagingDurableSegment = 'MESSAGING';
41759
+ const MessageNotifyStoreUpdateAvailable = 'notifyStoreUpdateAvailable';
41758
41760
 
41759
41761
  const { keys: keys$7, create: create$6, assign: assign$6, freeze: freeze$1$1 } = Object;
41760
41762
 
@@ -42190,6 +42192,7 @@
42190
42192
  const defaultSegmentKeys = [];
42191
42193
  const adapterContextSegmentKeys = [];
42192
42194
  const redirectSegmentKeys = [];
42195
+ const messagingSegmentKeys = [];
42193
42196
  let shouldBroadcast = false;
42194
42197
  for (let i = 0, len = changes.length; i < len; i++) {
42195
42198
  const change = changes[i];
@@ -42204,6 +42207,9 @@
42204
42207
  else if (change.segment === RedirectDurableSegment) {
42205
42208
  redirectSegmentKeys.push(...change.ids);
42206
42209
  }
42210
+ else if (change.segment === MessagingDurableSegment) {
42211
+ messagingSegmentKeys.push(...change.ids);
42212
+ }
42207
42213
  }
42208
42214
  if (redirectSegmentKeys.length > 0) {
42209
42215
  const redirectEntries = await durableStore.getEntries(redirectSegmentKeys, RedirectDurableSegment);
@@ -42263,6 +42269,20 @@
42263
42269
  if (shouldBroadcast) {
42264
42270
  await environment.storeBroadcast(rebuildSnapshot, environment.snapshotAvailable);
42265
42271
  }
42272
+ // if having notifyStoreUpdateAvailable msg, then pull the message body out from store
42273
+ // and call environment.notifyStoreUpdateAvailable
42274
+ if (messagingSegmentKeys.includes(MessageNotifyStoreUpdateAvailable)) {
42275
+ const entries = await durableStore.getEntries([MessageNotifyStoreUpdateAvailable], MessagingDurableSegment);
42276
+ if (entries !== undefined) {
42277
+ const notifyEntry = entries[MessageNotifyStoreUpdateAvailable];
42278
+ if (notifyEntry !== undefined) {
42279
+ const keys = notifyEntry.data;
42280
+ if (keys.length > 0) {
42281
+ environment.notifyStoreUpdateAvailable(keys);
42282
+ }
42283
+ }
42284
+ }
42285
+ }
42266
42286
  });
42267
42287
  const dispose = function () {
42268
42288
  validateNotDisposed();
@@ -42598,6 +42618,39 @@
42598
42618
  return entries;
42599
42619
  });
42600
42620
  };
42621
+ // flag entries specified by keys in durable store as expired.
42622
+ // send a notifyStoreUpdateAvailable message through durable store set entries to
42623
+ // indirectly triggers all js environments to refresh snapshots if overlapping with keys.
42624
+ const notifyStoreUpdateAvailable = async function (keys$1) {
42625
+ validateNotDisposed();
42626
+ const entryKeys = keys$1.map(serializeStructuredKey);
42627
+ const entries = await durableStore.getEntries(entryKeys, DefaultDurableSegment);
42628
+ if (entries === undefined || keys$7(entries).length === 0) {
42629
+ return environment.notifyStoreUpdateAvailable(keys$1);
42630
+ }
42631
+ const now = Date.now();
42632
+ let needWriteBack = false;
42633
+ for (let i = 0; i < entryKeys.length; i++) {
42634
+ const key = entryKeys[i];
42635
+ const entry = entries[key];
42636
+ if (entry !== undefined) {
42637
+ const storeEntry = entry;
42638
+ if (storeEntry.metadata !== undefined) {
42639
+ storeEntry.metadata = {
42640
+ ...storeEntry.metadata,
42641
+ expirationTimestamp: now,
42642
+ };
42643
+ }
42644
+ needWriteBack = true;
42645
+ }
42646
+ }
42647
+ if (needWriteBack) {
42648
+ await durableStore.setEntries(entries, DefaultDurableSegment);
42649
+ }
42650
+ // push a notifyStoreUpdateAvailable message with entryKeys as data into messaging segment
42651
+ await durableStore.setEntries({ notifyStoreUpdateAvailable: { data: entryKeys } }, MessagingDurableSegment);
42652
+ return Promise.resolve(undefined);
42653
+ };
42601
42654
  // set the default cache policy of the base environment
42602
42655
  environment.setDefaultCachePolicy({
42603
42656
  type: 'stale-while-revalidate',
@@ -42628,6 +42681,7 @@
42628
42681
  handleSuccessResponse: { value: handleSuccessResponse },
42629
42682
  handleErrorResponse: { value: handleErrorResponse },
42630
42683
  getNotifyChangeStoreEntries: { value: getNotifyChangeStoreEntries },
42684
+ notifyStoreUpdateAvailable: { value: notifyStoreUpdateAvailable },
42631
42685
  });
42632
42686
  }
42633
42687
 
@@ -57749,7 +57803,7 @@
57749
57803
  id: '@salesforce/lds-network-adapter',
57750
57804
  instrument: instrument$1,
57751
57805
  });
57752
- // version: 1.227.0-f636c0f4c
57806
+ // version: 1.227.1-9eac9f138
57753
57807
 
57754
57808
  const { create: create$2, keys: keys$2 } = Object;
57755
57809
  const { stringify: stringify$1, parse: parse$1 } = JSON;
@@ -76027,7 +76081,7 @@
76027
76081
  configuration: { ...configurationForGraphQLAdapters },
76028
76082
  instrument,
76029
76083
  });
76030
- // version: 1.227.0-267d3ea17
76084
+ // version: 1.227.1-a3108f583
76031
76085
 
76032
76086
  // On core the unstable adapters are re-exported with different names,
76033
76087
 
@@ -78274,7 +78328,7 @@
78274
78328
  unstable_graphQL_imperative = createImperativeAdapter(luvio, createInstrumentedAdapter(ldsAdapter, adapterMetadata), adapterMetadata);
78275
78329
  graphQLImperative = ldsAdapter;
78276
78330
  });
78277
- // version: 1.227.0-267d3ea17
78331
+ // version: 1.227.1-a3108f583
78278
78332
 
78279
78333
  var gqlApi = /*#__PURE__*/Object.freeze({
78280
78334
  __proto__: null,
@@ -79005,4 +79059,4 @@
79005
79059
  Object.defineProperty(exports, '__esModule', { value: true });
79006
79060
 
79007
79061
  }));
79008
- // version: 1.227.0-f636c0f4c
79062
+ // version: 1.227.1-9eac9f138
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/lds-worker-api",
3
- "version": "1.227.0",
3
+ "version": "1.227.1",
4
4
  "license": "SEE LICENSE IN LICENSE.txt",
5
5
  "description": "",
6
6
  "main": "dist/standalone/es/lds-worker-api.js",