@salesforce/lds-worker-api 1.113.0 → 1.114.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.
@@ -747,4 +747,4 @@ if (process.env.NODE_ENV !== 'production') {
747
747
  }
748
748
 
749
749
  export { createPrimingSession, draftManager, draftQueue, executeAdapter, executeMutatingAdapter, getImperativeAdapterNames, invokeAdapter, invokeAdapterWithDraftToReplace, invokeAdapterWithMetadata, nimbusDraftQueue, setMetadataTTL, setUiApiRecordTTL, subscribeToAdapter };
750
- // version: 1.113.0-a8af103c9
750
+ // version: 1.114.1-f3347d8bf
@@ -3776,7 +3776,7 @@ function withDefaultLuvio(callback) {
3776
3776
  }
3777
3777
  callbacks.push(callback);
3778
3778
  }
3779
- // version: 1.113.0-a8af103c9
3779
+ // version: 1.114.1-f3347d8bf
3780
3780
 
3781
3781
  // TODO [TD-0081508]: once that TD is fulfilled we can probably change this file
3782
3782
  function instrumentAdapter$1(createFunction, _metadata) {
@@ -15200,7 +15200,7 @@ function parseAndVisit(source) {
15200
15200
  updateReferenceMapWithKnownKey(ast, luvioDocumentNode);
15201
15201
  return luvioDocumentNode;
15202
15202
  }
15203
- // version: 1.113.0-a8af103c9
15203
+ // version: 1.114.1-f3347d8bf
15204
15204
 
15205
15205
  function unwrap(data) {
15206
15206
  // The lwc-luvio bindings import a function from lwc called "unwrap".
@@ -16113,7 +16113,7 @@ function createGraphQLWireAdapterConstructor(luvio, adapter, metadata, astResolv
16113
16113
  const { apiFamily, name } = metadata;
16114
16114
  return createGraphQLWireAdapterConstructor$1(adapter, `${apiFamily}.${name}`, luvio, astResolver);
16115
16115
  }
16116
- // version: 1.113.0-a8af103c9
16116
+ // version: 1.114.1-f3347d8bf
16117
16117
 
16118
16118
  /**
16119
16119
  * Copyright (c) 2022, Salesforce, Inc.,
@@ -21793,14 +21793,15 @@ function buildDefaultsKey(listRef) {
21793
21793
  * @param config getListUi config
21794
21794
  * @param serverResponse ListUiRepresentation from the server
21795
21795
  */
21796
- function addServerDefaults(config, serverResponse, context) {
21797
- const { records: { sortBy }, info: { listReference }, } = serverResponse;
21798
- if (config.sortBy !== undefined || sortBy === null) {
21796
+ function addServerDefaults(config, records, listReference, context) {
21797
+ // If the request already contains the potential default information,
21798
+ // or the response does not come back with a default
21799
+ if (config.sortBy !== undefined || records.sortBy === null) {
21799
21800
  return;
21800
21801
  }
21801
21802
  const key = buildDefaultsKey(listReference);
21802
21803
  const currentDefaults = context.get(key) || {};
21803
- context.set(key, { ...currentDefaults, sortBy });
21804
+ context.set(key, { ...currentDefaults, sortBy: records.sortBy });
21804
21805
  }
21805
21806
  /**
21806
21807
  * Returns default values observed on previous requests for a list.
@@ -21950,11 +21951,14 @@ function keyBuilder$1L(luvio, params) {
21950
21951
  // Fetch listReference from internal store to better ensure a cache hit regardless of listViewApiName or listViewId
21951
21952
  const listReference = getListReference(query, context$1);
21952
21953
  if (listReference !== undefined) {
21954
+ // Check and use any default values returned from the server (i.e. sortBy)
21955
+ const config = { ...params.urlParams, ...params.queryParams };
21956
+ const defaults = getServerDefaults(config, context$1);
21953
21957
  return keyBuilder$1N(luvio, {
21954
21958
  objectApiName: listReference.objectApiName,
21955
21959
  listViewApiName: listReference.listViewApiName,
21956
21960
  listViewId: listReference.id,
21957
- sortBy: params.queryParams.sortBy || [],
21961
+ sortBy: params.queryParams.sortBy || defaults.sortBy || [],
21958
21962
  });
21959
21963
  }
21960
21964
  // If there are no matching entries in the store, then we haven't fetched any data for this list view yet.
@@ -23338,7 +23342,7 @@ function onResourceSuccess_getListUi(luvio, context, config, response) {
23338
23342
  // remember the id/name of this list
23339
23343
  addListReference(listReference, context);
23340
23344
  // remember any default values that the server filled in
23341
- addServerDefaults(config, body, context);
23345
+ addServerDefaults(config, body.records, listReference, context);
23342
23346
  // build the selector while the list info is still easily accessible
23343
23347
  const fragment = buildListUiFragment(config, context, fields);
23344
23348
  luvio.storeIngest(listUiKey, ingest$E$1, body);
@@ -40735,6 +40739,7 @@ function onFetchResponseSuccess$1$1(luvio, config, resourceParams, response) {
40735
40739
  // Note: The original listReference will remain unchanged in the response.
40736
40740
  mutatedListRef.id = body.listInfoETag;
40737
40741
  addListReferenceWithId(mutatedListRef, context, body.listReference.id);
40742
+ addServerDefaults(config, body, originalListRef, context);
40738
40743
  }
40739
40744
  return onFetchResponseSuccess$2$1(luvio, config, resourceParams, response);
40740
40745
  }
@@ -44301,7 +44306,7 @@ withDefaultLuvio((luvio) => {
44301
44306
  dropFunction: instrumentation$2.notifyRecordUpdateAvailableDropped,
44302
44307
  });
44303
44308
  });
44304
- // version: 1.113.0-a8af103c9
44309
+ // version: 1.114.1-f3347d8bf
44305
44310
 
44306
44311
  var caseSensitiveUserId = '005B0000000GR4OIAW';
44307
44312
 
@@ -49511,7 +49516,7 @@ class DurableDraftQueue {
49511
49516
  this.replacingAction = replacing;
49512
49517
  return replacing;
49513
49518
  }
49514
- mergeAction(targetActionId, sourceActionId) {
49519
+ mergeActions(targetActionId, sourceActionId) {
49515
49520
  // ids must be unique
49516
49521
  if (targetActionId === sourceActionId) {
49517
49522
  return Promise.reject(new Error('target and source action ids cannot be the same'));
@@ -50397,8 +50402,8 @@ class DraftManager {
50397
50402
  * @param sourceActionId The draft action id to merge onto the target. This
50398
50403
  * action will be removed after the merge.
50399
50404
  */
50400
- mergeAction(targetActionId, sourceActionId) {
50401
- return this.draftQueue.mergeAction(targetActionId, sourceActionId).then((merged) => {
50405
+ mergeActions(targetActionId, sourceActionId) {
50406
+ return this.draftQueue.mergeActions(targetActionId, sourceActionId).then((merged) => {
50402
50407
  return this.buildDraftQueueItem(merged);
50403
50408
  });
50404
50409
  }
@@ -58233,8 +58238,8 @@ class NimbusDraftQueue {
58233
58238
  replaceAction(_actionId, _withActionId) {
58234
58239
  return Promise.reject('Cannot call replaceAction from the NimbusDraftQueue');
58235
58240
  }
58236
- mergeAction(_targetActionId, _sourceActionId) {
58237
- return Promise.reject('Cannot call mergeAction from the NimbusDraftQueue');
58241
+ mergeActions(_targetActionId, _sourceActionId) {
58242
+ return Promise.reject('Cannot call mergeActions from the NimbusDraftQueue');
58238
58243
  }
58239
58244
  setMetadata(_actionId, _metadata) {
58240
58245
  return Promise.reject('Cannot call setMetadata from the NimbusDraftQueue');
@@ -59778,7 +59783,7 @@ register({
59778
59783
  id: '@salesforce/lds-network-adapter',
59779
59784
  instrument: instrument$1,
59780
59785
  });
59781
- // version: 1.113.0-a8af103c9
59786
+ // version: 1.114.1-f3347d8bf
59782
59787
 
59783
59788
  const { create: create$2, keys: keys$2 } = Object;
59784
59789
  const { stringify: stringify$1, parse: parse$1 } = JSON;
@@ -77504,7 +77509,7 @@ register({
77504
77509
  configuration: { ...configurationForGraphQLAdapters },
77505
77510
  instrument,
77506
77511
  });
77507
- // version: 1.113.0-a8af103c9
77512
+ // version: 1.114.1-f3347d8bf
77508
77513
 
77509
77514
  // On core the unstable adapters are re-exported with different names,
77510
77515
 
@@ -79633,7 +79638,7 @@ withDefaultLuvio((luvio) => {
79633
79638
  unstable_graphQL_imperative = createImperativeAdapter(luvio, createInstrumentedAdapter(ldsAdapter, adapterMetadata), adapterMetadata);
79634
79639
  graphQLImperative = ldsAdapter;
79635
79640
  });
79636
- // version: 1.113.0-a8af103c9
79641
+ // version: 1.114.1-f3347d8bf
79637
79642
 
79638
79643
  var gqlApi = /*#__PURE__*/Object.freeze({
79639
79644
  __proto__: null,
@@ -80311,4 +80316,4 @@ const { luvio } = getRuntime();
80311
80316
  setDefaultLuvio({ luvio });
80312
80317
 
80313
80318
  export { createPrimingSession, draftManager, draftQueue, executeAdapter, executeMutatingAdapter, getImperativeAdapterNames, invokeAdapter, invokeAdapterWithDraftToReplace, invokeAdapterWithMetadata, nimbusDraftQueue, registerReportObserver, setMetadataTTL, setUiApiRecordTTL, subscribeToAdapter };
80314
- // version: 1.113.0-a8af103c9
80319
+ // version: 1.114.1-f3347d8bf
@@ -3782,7 +3782,7 @@
3782
3782
  }
3783
3783
  callbacks.push(callback);
3784
3784
  }
3785
- // version: 1.113.0-a8af103c9
3785
+ // version: 1.114.1-f3347d8bf
3786
3786
 
3787
3787
  // TODO [TD-0081508]: once that TD is fulfilled we can probably change this file
3788
3788
  function instrumentAdapter$1(createFunction, _metadata) {
@@ -15206,7 +15206,7 @@
15206
15206
  updateReferenceMapWithKnownKey(ast, luvioDocumentNode);
15207
15207
  return luvioDocumentNode;
15208
15208
  }
15209
- // version: 1.113.0-a8af103c9
15209
+ // version: 1.114.1-f3347d8bf
15210
15210
 
15211
15211
  function unwrap(data) {
15212
15212
  // The lwc-luvio bindings import a function from lwc called "unwrap".
@@ -16119,7 +16119,7 @@
16119
16119
  const { apiFamily, name } = metadata;
16120
16120
  return createGraphQLWireAdapterConstructor$1(adapter, `${apiFamily}.${name}`, luvio, astResolver);
16121
16121
  }
16122
- // version: 1.113.0-a8af103c9
16122
+ // version: 1.114.1-f3347d8bf
16123
16123
 
16124
16124
  /**
16125
16125
  * Copyright (c) 2022, Salesforce, Inc.,
@@ -21799,14 +21799,15 @@
21799
21799
  * @param config getListUi config
21800
21800
  * @param serverResponse ListUiRepresentation from the server
21801
21801
  */
21802
- function addServerDefaults(config, serverResponse, context) {
21803
- const { records: { sortBy }, info: { listReference }, } = serverResponse;
21804
- if (config.sortBy !== undefined || sortBy === null) {
21802
+ function addServerDefaults(config, records, listReference, context) {
21803
+ // If the request already contains the potential default information,
21804
+ // or the response does not come back with a default
21805
+ if (config.sortBy !== undefined || records.sortBy === null) {
21805
21806
  return;
21806
21807
  }
21807
21808
  const key = buildDefaultsKey(listReference);
21808
21809
  const currentDefaults = context.get(key) || {};
21809
- context.set(key, { ...currentDefaults, sortBy });
21810
+ context.set(key, { ...currentDefaults, sortBy: records.sortBy });
21810
21811
  }
21811
21812
  /**
21812
21813
  * Returns default values observed on previous requests for a list.
@@ -21956,11 +21957,14 @@
21956
21957
  // Fetch listReference from internal store to better ensure a cache hit regardless of listViewApiName or listViewId
21957
21958
  const listReference = getListReference(query, context$1);
21958
21959
  if (listReference !== undefined) {
21960
+ // Check and use any default values returned from the server (i.e. sortBy)
21961
+ const config = { ...params.urlParams, ...params.queryParams };
21962
+ const defaults = getServerDefaults(config, context$1);
21959
21963
  return keyBuilder$1N(luvio, {
21960
21964
  objectApiName: listReference.objectApiName,
21961
21965
  listViewApiName: listReference.listViewApiName,
21962
21966
  listViewId: listReference.id,
21963
- sortBy: params.queryParams.sortBy || [],
21967
+ sortBy: params.queryParams.sortBy || defaults.sortBy || [],
21964
21968
  });
21965
21969
  }
21966
21970
  // If there are no matching entries in the store, then we haven't fetched any data for this list view yet.
@@ -23344,7 +23348,7 @@
23344
23348
  // remember the id/name of this list
23345
23349
  addListReference(listReference, context);
23346
23350
  // remember any default values that the server filled in
23347
- addServerDefaults(config, body, context);
23351
+ addServerDefaults(config, body.records, listReference, context);
23348
23352
  // build the selector while the list info is still easily accessible
23349
23353
  const fragment = buildListUiFragment(config, context, fields);
23350
23354
  luvio.storeIngest(listUiKey, ingest$E$1, body);
@@ -40741,6 +40745,7 @@
40741
40745
  // Note: The original listReference will remain unchanged in the response.
40742
40746
  mutatedListRef.id = body.listInfoETag;
40743
40747
  addListReferenceWithId(mutatedListRef, context, body.listReference.id);
40748
+ addServerDefaults(config, body, originalListRef, context);
40744
40749
  }
40745
40750
  return onFetchResponseSuccess$2$1(luvio, config, resourceParams, response);
40746
40751
  }
@@ -44307,7 +44312,7 @@
44307
44312
  dropFunction: instrumentation$2.notifyRecordUpdateAvailableDropped,
44308
44313
  });
44309
44314
  });
44310
- // version: 1.113.0-a8af103c9
44315
+ // version: 1.114.1-f3347d8bf
44311
44316
 
44312
44317
  var caseSensitiveUserId = '005B0000000GR4OIAW';
44313
44318
 
@@ -49517,7 +49522,7 @@
49517
49522
  this.replacingAction = replacing;
49518
49523
  return replacing;
49519
49524
  }
49520
- mergeAction(targetActionId, sourceActionId) {
49525
+ mergeActions(targetActionId, sourceActionId) {
49521
49526
  // ids must be unique
49522
49527
  if (targetActionId === sourceActionId) {
49523
49528
  return Promise.reject(new Error('target and source action ids cannot be the same'));
@@ -50403,8 +50408,8 @@
50403
50408
  * @param sourceActionId The draft action id to merge onto the target. This
50404
50409
  * action will be removed after the merge.
50405
50410
  */
50406
- mergeAction(targetActionId, sourceActionId) {
50407
- return this.draftQueue.mergeAction(targetActionId, sourceActionId).then((merged) => {
50411
+ mergeActions(targetActionId, sourceActionId) {
50412
+ return this.draftQueue.mergeActions(targetActionId, sourceActionId).then((merged) => {
50408
50413
  return this.buildDraftQueueItem(merged);
50409
50414
  });
50410
50415
  }
@@ -58239,8 +58244,8 @@
58239
58244
  replaceAction(_actionId, _withActionId) {
58240
58245
  return Promise.reject('Cannot call replaceAction from the NimbusDraftQueue');
58241
58246
  }
58242
- mergeAction(_targetActionId, _sourceActionId) {
58243
- return Promise.reject('Cannot call mergeAction from the NimbusDraftQueue');
58247
+ mergeActions(_targetActionId, _sourceActionId) {
58248
+ return Promise.reject('Cannot call mergeActions from the NimbusDraftQueue');
58244
58249
  }
58245
58250
  setMetadata(_actionId, _metadata) {
58246
58251
  return Promise.reject('Cannot call setMetadata from the NimbusDraftQueue');
@@ -59784,7 +59789,7 @@
59784
59789
  id: '@salesforce/lds-network-adapter',
59785
59790
  instrument: instrument$1,
59786
59791
  });
59787
- // version: 1.113.0-a8af103c9
59792
+ // version: 1.114.1-f3347d8bf
59788
59793
 
59789
59794
  const { create: create$2, keys: keys$2 } = Object;
59790
59795
  const { stringify: stringify$1, parse: parse$1 } = JSON;
@@ -77510,7 +77515,7 @@
77510
77515
  configuration: { ...configurationForGraphQLAdapters },
77511
77516
  instrument,
77512
77517
  });
77513
- // version: 1.113.0-a8af103c9
77518
+ // version: 1.114.1-f3347d8bf
77514
77519
 
77515
77520
  // On core the unstable adapters are re-exported with different names,
77516
77521
 
@@ -79639,7 +79644,7 @@
79639
79644
  unstable_graphQL_imperative = createImperativeAdapter(luvio, createInstrumentedAdapter(ldsAdapter, adapterMetadata), adapterMetadata);
79640
79645
  graphQLImperative = ldsAdapter;
79641
79646
  });
79642
- // version: 1.113.0-a8af103c9
79647
+ // version: 1.114.1-f3347d8bf
79643
79648
 
79644
79649
  var gqlApi = /*#__PURE__*/Object.freeze({
79645
79650
  __proto__: null,
@@ -80334,4 +80339,4 @@
80334
80339
  Object.defineProperty(exports, '__esModule', { value: true });
80335
80340
 
80336
80341
  }));
80337
- // version: 1.113.0-a8af103c9
80342
+ // version: 1.114.1-f3347d8bf
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/lds-worker-api",
3
- "version": "1.113.0",
3
+ "version": "1.114.1",
4
4
  "license": "SEE LICENSE IN LICENSE.txt",
5
5
  "description": "",
6
6
  "main": "dist/standalone/umd/lds-worker-api.js",
@@ -37,15 +37,15 @@
37
37
  "@luvio/engine": "0.137.1",
38
38
  "@luvio/environments": "0.137.1",
39
39
  "@oat-sa/rollup-plugin-wildcard-external": "^0.1.0",
40
- "@salesforce/lds-adapters-graphql": "^1.113.0",
41
- "@salesforce/lds-adapters-uiapi": "^1.113.0",
42
- "@salesforce/lds-default-luvio": "^1.113.0",
43
- "@salesforce/lds-drafts": "^1.113.0",
44
- "@salesforce/lds-graphql-parser": "^1.113.0",
45
- "@salesforce/lds-luvio-engine": "^1.113.0",
46
- "@salesforce/lds-priming": "^1.113.0",
47
- "@salesforce/lds-runtime-mobile": "^1.113.0",
48
- "@salesforce/nimbus-plugin-lds": "^1.113.0",
40
+ "@salesforce/lds-adapters-graphql": "^1.114.1",
41
+ "@salesforce/lds-adapters-uiapi": "^1.114.1",
42
+ "@salesforce/lds-default-luvio": "^1.114.1",
43
+ "@salesforce/lds-drafts": "^1.114.1",
44
+ "@salesforce/lds-graphql-parser": "^1.114.1",
45
+ "@salesforce/lds-luvio-engine": "^1.114.1",
46
+ "@salesforce/lds-priming": "^1.114.1",
47
+ "@salesforce/lds-runtime-mobile": "^1.114.1",
48
+ "@salesforce/nimbus-plugin-lds": "^1.114.1",
49
49
  "ajv": "^8.11.0",
50
50
  "glob": "^7.1.5",
51
51
  "nimbus-types": "^2.0.0-alpha1",