@salesforce/lwc-adapters-uiapi 1.287.0-dev1 → 1.287.0-dev11

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.
Files changed (2) hide show
  1. package/dist/main.js +96 -58
  2. package/package.json +4 -4
package/dist/main.js CHANGED
@@ -572,7 +572,7 @@ function createResourceParamsImpl(config, configMetadata) {
572
572
  }
573
573
  return resourceParams;
574
574
  }
575
- // engine version: 0.154.16-5cc35392
575
+ // engine version: 0.154.17-dev2-5c176528
576
576
 
577
577
  /**
578
578
  * Returns true if the value acts like a Promise, i.e. has a "then" function,
@@ -7359,6 +7359,10 @@ let oneStoreGetObjectInfoAdapter = undefined;
7359
7359
  * One store enabled Get Object Infos adapter
7360
7360
  */
7361
7361
  let oneStoreGetObjectInfosAdapter = undefined;
7362
+ /**
7363
+ * Determines when to include PDL strategies for Related Lists
7364
+ */
7365
+ let relatedListsPredictionsEnabled = false;
7362
7366
  /**
7363
7367
  * Defines the configuration API and is exposed internally as well as externally.
7364
7368
  * Configuration for one store enabled REST adapters only.
@@ -7434,6 +7438,12 @@ const configurationForRestAdapters = {
7434
7438
  getDraftAwareCreateContentDocumentAndVersionAdapter: function () {
7435
7439
  return draftAwareCreateContentDocumentAndVersionAdapter;
7436
7440
  },
7441
+ setRelatedListsPredictionsEnabled: function (f) {
7442
+ relatedListsPredictionsEnabled = f;
7443
+ },
7444
+ areRelatedListsPredictionsEnabled: function () {
7445
+ return relatedListsPredictionsEnabled === true;
7446
+ },
7437
7447
  // createContentVersion
7438
7448
  setDraftAwareCreateContentVersionAdapter: function (adapter) {
7439
7449
  draftAwareCreateContentVersionAdapter = adapter;
@@ -8770,6 +8780,17 @@ function getTypeCacheKeys$27(rootKeySet, luvio, input, fullPathFactory) {
8770
8780
  });
8771
8781
  }
8772
8782
 
8783
+ const keyBuilderFromType$E = function ListInfoRepresentationKeyBuilderFromType(luvio, object) {
8784
+ const keyParams = {
8785
+ listViewApiName: object.listReference.listViewApiName
8786
+ ? object.listReference.listViewApiName.toLowerCase()
8787
+ : object.listReference.listViewApiName,
8788
+ objectApiName: object.listReference.objectApiName.toLowerCase(),
8789
+ type: object.listReference.type,
8790
+ };
8791
+ return keyBuilder$3o(luvio, keyParams);
8792
+ };
8793
+
8773
8794
  const TTL$G = 900000;
8774
8795
  const VERSION$2s = "c658fe1591386d570e214eaed0daadd1";
8775
8796
  function validate$1X(obj, path = 'ListInfoRepresentation') {
@@ -8998,14 +9019,6 @@ const RepresentationType$10 = 'ListInfoRepresentation';
8998
9019
  function keyBuilder$3o(luvio, config) {
8999
9020
  return keyPrefix + '::' + RepresentationType$10 + ':' + (config.listViewApiName === null ? '' : config.listViewApiName) + ':' + config.objectApiName + ':' + config.type;
9000
9021
  }
9001
- function keyBuilderFromType$E(luvio, object) {
9002
- const keyParams = {
9003
- listViewApiName: object.listReference.listViewApiName,
9004
- objectApiName: object.listReference.objectApiName,
9005
- type: object.listReference.type
9006
- };
9007
- return keyBuilder$3o(luvio, keyParams);
9008
- }
9009
9022
  function normalize$U(input, existing, path, luvio, store, timestamp) {
9010
9023
  const input_displayColumns = input.displayColumns;
9011
9024
  const input_displayColumns_id = path.fullPath + '__displayColumns';
@@ -13822,6 +13835,19 @@ function revertPaginationOptimization(variables) {
13822
13835
  }
13823
13836
  }
13824
13837
 
13838
+ const keyBuilderFromType$B = function ListRecordCollectionRepresentationKeyBuilderFromType(luvio, object) {
13839
+ const keyParams = {
13840
+ objectApiName: object.listReference.objectApiName.toLowerCase(),
13841
+ searchTerm: object.searchTerm,
13842
+ sortBy: object.sortBy,
13843
+ where: object.where,
13844
+ listViewApiName: object.listReference.listViewApiName
13845
+ ? object.listReference.listViewApiName.toLowerCase()
13846
+ : object.listReference.listViewApiName,
13847
+ };
13848
+ return keyBuilder$3k(luvio, keyParams);
13849
+ };
13850
+
13825
13851
  const TTL$D = 30000;
13826
13852
  const VERSION$2m = "e5c90c4081cd557f8ffec53028ede1e8";
13827
13853
  function validate$1S(obj, path = 'ListRecordCollectionRepresentation') {
@@ -14115,16 +14141,6 @@ const RepresentationType$Y = 'ListRecordCollectionRepresentation';
14115
14141
  function keyBuilder$3k(luvio, config) {
14116
14142
  return keyPrefix + '::' + RepresentationType$Y + ':' + config.objectApiName + ':' + (config.searchTerm === null ? '' : config.searchTerm) + ':' + (config.sortBy === null ? '' : '[' + config.sortBy.join(',') + ']') + ':' + (config.where === null ? '' : config.where) + ':' + (config.listViewApiName === null ? '' : config.listViewApiName);
14117
14143
  }
14118
- function keyBuilderFromType$B(luvio, object) {
14119
- const keyParams = {
14120
- objectApiName: object.listReference.objectApiName,
14121
- searchTerm: object.searchTerm,
14122
- sortBy: object.sortBy,
14123
- where: object.where,
14124
- listViewApiName: object.listReference.listViewApiName
14125
- };
14126
- return keyBuilder$3k(luvio, keyParams);
14127
- }
14128
14144
  function paginationKeyBuilder(luvio, config) {
14129
14145
  return keyBuilder$3k(luvio, config) + '__pagination';
14130
14146
  }
@@ -15416,7 +15432,7 @@ function buildListRefByIdContextKey(listViewId) {
15416
15432
  return `listReferenceById::${listViewId}`;
15417
15433
  }
15418
15434
  function buildListRefByApiNameContextKey(objectApiName, listViewApiName) {
15419
- return `listReferenceByApiName::${objectApiName}:${listViewApiName}`;
15435
+ return `listReferenceByApiName::${objectApiName.toLowerCase()}:${listViewApiName.toLowerCase()}`;
15420
15436
  }
15421
15437
  /**
15422
15438
  * Adds a list reference so it can be retrieved with #getListReference later.
@@ -15472,7 +15488,12 @@ const LIST_INFO_SELECTIONS_ETAG = [
15472
15488
  * @param luvio Luvio
15473
15489
  */
15474
15490
  function getListInfo(luvio, listRef, storeLookup) {
15475
- const key = keyBuilder$3o(luvio, { ...listRef });
15491
+ let mutatedListRef = { ...listRef };
15492
+ mutatedListRef.objectApiName = mutatedListRef.objectApiName.toLowerCase();
15493
+ mutatedListRef.listViewApiName = mutatedListRef.listViewApiName
15494
+ ? mutatedListRef.listViewApiName.toLowerCase()
15495
+ : mutatedListRef.listViewApiName;
15496
+ const key = keyBuilder$3o(luvio, { ...mutatedListRef });
15476
15497
  return storeLookup({
15477
15498
  recordId: key,
15478
15499
  node: {
@@ -15486,7 +15507,7 @@ function getListInfo(luvio, listRef, storeLookup) {
15486
15507
  }
15487
15508
  function buildDefaultsKey(listRef) {
15488
15509
  const { objectApiName, listViewApiName } = listRef;
15489
- return `defaults::${objectApiName}:${listViewApiName}`;
15510
+ return `defaults::${objectApiName.toLowerCase()}:${listViewApiName ? listViewApiName.toLowerCase() : listViewApiName}`;
15490
15511
  }
15491
15512
  /**
15492
15513
  * Update the default values based on a server response.
@@ -15647,9 +15668,11 @@ function setContext$1(adapterContext) {
15647
15668
  context$1 = adapterContext;
15648
15669
  }
15649
15670
  function keyBuilder$3c(luvio, params) {
15671
+ // lists data can now be fetched using case insensitive urlParams therefore
15672
+ // also changing contextStore to use lowercase caching
15650
15673
  const query = {
15651
- objectApiName: params.urlParams.objectApiName,
15652
- listViewApiName: params.urlParams.listViewApiName,
15674
+ objectApiName: params.urlParams.objectApiName.toLowerCase(),
15675
+ listViewApiName: params.urlParams.listViewApiName.toLowerCase(),
15653
15676
  };
15654
15677
  // Fetch listReference from internal store to better ensure a cache hit regardless of listViewApiName or listViewId
15655
15678
  const listReference = getListReference(query, context$1);
@@ -15659,8 +15682,10 @@ function keyBuilder$3c(luvio, params) {
15659
15682
  const defaults = getServerDefaults(config, context$1);
15660
15683
  // Use default values when sortBy is undefined or an empty Array []
15661
15684
  return keyBuilder$3k(luvio, {
15662
- objectApiName: listReference.objectApiName,
15663
- listViewApiName: listReference.listViewApiName,
15685
+ objectApiName: listReference.objectApiName.toLowerCase(),
15686
+ listViewApiName: listReference.listViewApiName
15687
+ ? listReference.listViewApiName.toLowerCase()
15688
+ : listReference.listViewApiName,
15664
15689
  // # removing listViewId from key only supporing getting records using api name
15665
15690
  // listViewId: listReference.id,
15666
15691
  searchTerm: params.body.searchTerm || null,
@@ -15673,8 +15698,8 @@ function keyBuilder$3c(luvio, params) {
15673
15698
  // If there are no matching entries in the store, then we haven't fetched any data for this list view yet.
15674
15699
  // Assuming that listViewId is empty and continue on
15675
15700
  return keyBuilder$3k(luvio, {
15676
- objectApiName: params.urlParams.objectApiName,
15677
- listViewApiName: params.urlParams.listViewApiName,
15701
+ objectApiName: params.urlParams.objectApiName.toLowerCase(),
15702
+ listViewApiName: params.urlParams.listViewApiName.toLowerCase(),
15678
15703
  // # removing listViewId from key only supporing getting records using api name
15679
15704
  // listViewId: '',
15680
15705
  searchTerm: params.body.searchTerm || null,
@@ -16878,8 +16903,10 @@ function prepareRequest_getMruListRecords(luvio, config, listInfo, snapshot) {
16878
16903
  searchTerm: null,
16879
16904
  where: null,
16880
16905
  sortBy: config.sortBy === undefined ? null : config.sortBy,
16881
- objectApiName: listInfo.listReference.objectApiName,
16882
- listViewApiName: listInfo.listReference.listViewApiName,
16906
+ objectApiName: listInfo.listReference.objectApiName.toLowerCase(),
16907
+ listViewApiName: listInfo.listReference.listViewApiName
16908
+ ? listInfo.listReference.listViewApiName.toLowerCase()
16909
+ : listInfo.listReference.listViewApiName,
16883
16910
  });
16884
16911
  const selector = {
16885
16912
  recordId: paginationKey,
@@ -16926,8 +16953,10 @@ function onResourceSuccess_getMruListRecords(luvio, config, listInfo, response)
16926
16953
  searchTerm: null,
16927
16954
  where: null,
16928
16955
  sortBy: body.sortBy,
16929
- objectApiName: listInfo.listReference.objectApiName,
16930
- listViewApiName: listInfo.listReference.listViewApiName,
16956
+ objectApiName: listInfo.listReference.objectApiName.toLowerCase(),
16957
+ listViewApiName: listInfo.listReference.listViewApiName
16958
+ ? listInfo.listReference.listViewApiName.toLowerCase()
16959
+ : listInfo.listReference.listViewApiName,
16931
16960
  }), ingest$1_, body);
16932
16961
  const snapshot = buildCachedSnapshot$8(luvio, luvio.storeLookup.bind(luvio), config, listInfo, fields);
16933
16962
  return luvio.storeBroadcast().then(() => snapshot);
@@ -16975,7 +17004,7 @@ function buildCachedListInfoSnapshot$1(context, storeLookup, luvio) {
16975
17004
  return getListInfo(luvio, {
16976
17005
  id: null,
16977
17006
  listViewApiName: null,
16978
- objectApiName: config.objectApiName,
17007
+ objectApiName: config.objectApiName.toLowerCase(),
16979
17008
  type: 'mru',
16980
17009
  }, storeLookup);
16981
17010
  }
@@ -17261,8 +17290,10 @@ function prepareRequest_getListRecords(luvio, context, config, listInfo, snapsho
17261
17290
  searchTerm: null,
17262
17291
  where: null,
17263
17292
  sortBy: getSortBy(config, context),
17264
- objectApiName: listInfo.listReference.objectApiName,
17265
- listViewApiName: listInfo.listReference.listViewApiName,
17293
+ objectApiName: listInfo.listReference.objectApiName.toLowerCase(),
17294
+ listViewApiName: listInfo.listReference.listViewApiName
17295
+ ? listInfo.listReference.listViewApiName.toLowerCase()
17296
+ : listInfo.listReference.listViewApiName,
17266
17297
  });
17267
17298
  const selector = {
17268
17299
  recordId: paginationKey,
@@ -17312,8 +17343,10 @@ function onResourceSuccess_getListRecords(luvio, context, config, listInfo, resp
17312
17343
  searchTerm: null,
17313
17344
  where: null,
17314
17345
  sortBy: body.sortBy,
17315
- objectApiName: listInfo.listReference.objectApiName,
17316
- listViewApiName: listInfo.listReference.listViewApiName,
17346
+ objectApiName: listInfo.listReference.objectApiName.toLowerCase(),
17347
+ listViewApiName: listInfo.listReference.listViewApiName
17348
+ ? listInfo.listReference.listViewApiName.toLowerCase()
17349
+ : listInfo.listReference.listViewApiName,
17317
17350
  }), ingest$1_, body);
17318
17351
  const snapshot = buildCachedSnapshot$7(luvio, luvio.storeLookup.bind(luvio), context, config, listInfo, fields);
17319
17352
  releaseKeys();
@@ -26569,9 +26602,9 @@ const getLayoutUserStateAdapterFactory = (luvio) => function UiApi__getLayoutUse
26569
26602
 
26570
26603
  function keyBuilder$2n(luvio, params) {
26571
26604
  return keyBuilder$3o(luvio, {
26572
- objectApiName: params.urlParams.objectApiName,
26573
- listViewApiName: params.urlParams.listViewApiName,
26574
- type: params.urlParams.listViewApiName === '__Recent' ? 'mru' : 'listView',
26605
+ objectApiName: params.urlParams.objectApiName.toLowerCase(),
26606
+ listViewApiName: params.urlParams.listViewApiName.toLowerCase(),
26607
+ type: params.urlParams.listViewApiName.toLowerCase() === '__recent' ? 'mru' : 'listView',
26575
26608
  });
26576
26609
  }
26577
26610
 
@@ -54478,6 +54511,29 @@ function getInContextFragmentType$d(fragment, fragmentMap) {
54478
54511
  return sharedGetFragmentType(fragment, fragmentMap);
54479
54512
  }
54480
54513
 
54514
+ function getFieldType$b(field) {
54515
+ const fieldName = field.name.value;
54516
+ switch (fieldName) {
54517
+ case '__typename': {
54518
+ return {
54519
+ isArray: false,
54520
+ typename: 'String',
54521
+ };
54522
+ }
54523
+ /*
54524
+ Probably should use metaschema like the RecordQuery graphql-artifact,
54525
+ but this type only has one generic type possible. Also, the most likely scenario for future schema additions,
54526
+ is UISDK adding the the parent of this type, Setup__Setup. Therefore, we will just default to SetupConnection so that
54527
+ query authors don't need to use metaschema when there's no real decision point in this type.
54528
+ */
54529
+ default:
54530
+ return {
54531
+ isArray: false,
54532
+ typename: 'Setup__SetupConnection',
54533
+ };
54534
+ }
54535
+ }
54536
+
54481
54537
  const name$2 = 'Setup__SetupQuery';
54482
54538
  const VERSION$e = 'b89cccb5fa5e458d89dc1137af3e5469';
54483
54539
  function keyBuilder$g(luvio, path, data) {
@@ -54595,24 +54651,6 @@ function getTypeCacheKeys$b(cacheKeySink, astNode, state) {
54595
54651
  }
54596
54652
  // Deal with mapped types' cache keys
54597
54653
  }
54598
- function getFieldType$b(field) {
54599
- switch (field.name.value) {
54600
- case '__typename': {
54601
- return {
54602
- isArray: false,
54603
- typename: 'String'
54604
- };
54605
- }
54606
- case 'recordQuery': {
54607
- return {
54608
- isArray: false,
54609
- typename: 'Setup__SetupConnection'
54610
- };
54611
- }
54612
- default:
54613
- return undefined;
54614
- }
54615
- }
54616
54654
  function ingestFieldByType$2(typename, parentKey, requestedField, sink, fieldKey, fieldData, state) {
54617
54655
  // TODO: add validation logic to only allow nullable fields to be null in the future
54618
54656
  if (fieldData === null) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/lwc-adapters-uiapi",
3
- "version": "1.287.0-dev1",
3
+ "version": "1.287.0-dev11",
4
4
  "license": "SEE LICENSE IN LICENSE.txt",
5
5
  "description": "UIAPI adapters with LWC bindings",
6
6
  "module": "dist/main.js",
@@ -31,10 +31,10 @@
31
31
  "clean": "rm -rf dist src/generated"
32
32
  },
33
33
  "devDependencies": {
34
- "@salesforce/lds-adapters-uiapi": "^1.287.0-dev1"
34
+ "@salesforce/lds-adapters-uiapi": "^1.287.0-dev11"
35
35
  },
36
36
  "dependencies": {
37
- "@luvio/lwc-luvio": "0.154.16",
38
- "@salesforce/lds-default-luvio": "^1.287.0-dev1"
37
+ "@luvio/lwc-luvio": "0.154.17-dev2",
38
+ "@salesforce/lds-default-luvio": "^1.287.0-dev11"
39
39
  }
40
40
  }