@salesforce/lwc-adapters-uiapi 1.282.0 → 1.284.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.
Files changed (2) hide show
  1. package/dist/main.js +65 -12
  2. package/package.json +3 -3
package/dist/main.js CHANGED
@@ -7351,6 +7351,32 @@ let trackedFieldDepthOnNotifyChange = 5;
7351
7351
  * @defaultValue 'false', replicates the current behavior and fetches all fields in the store for the leaf relationship record
7352
7352
  */
7353
7353
  let trackedFieldLeafNodeIdAndNameOnly = false;
7354
+ /**
7355
+ * One store enabled Get Object Info adapter
7356
+ */
7357
+ let oneStoreGetObjectInfoAdapter = undefined;
7358
+ /**
7359
+ * One store enabled Get Object Infos adapter
7360
+ */
7361
+ let oneStoreGetObjectInfosAdapter = undefined;
7362
+ /**
7363
+ * Defines the configuration API and is exposed internally as well as externally.
7364
+ * Configuration for one store enabled REST adapters only.
7365
+ */
7366
+ const configurationForOneStoreEnabledAdapters = {
7367
+ setGetObjectInfoAdapter: function (adapter) {
7368
+ oneStoreGetObjectInfoAdapter = adapter;
7369
+ },
7370
+ getGetObjectInfoAdapter: function () {
7371
+ return oneStoreGetObjectInfoAdapter;
7372
+ },
7373
+ setGetObjectInfosAdapter: function (adapter) {
7374
+ oneStoreGetObjectInfosAdapter = adapter;
7375
+ },
7376
+ getGetObjectInfosAdapter: function () {
7377
+ return oneStoreGetObjectInfosAdapter;
7378
+ },
7379
+ };
7354
7380
  /**
7355
7381
  * Defines the configuration API and is exposed internally as well as externally.
7356
7382
  * Configuration for REST adapters only.
@@ -7415,6 +7441,7 @@ const configurationForRestAdapters = {
7415
7441
  getDraftAwareCreateContentVersionAdapter: function () {
7416
7442
  return draftAwareCreateContentVersionAdapter;
7417
7443
  },
7444
+ ...configurationForOneStoreEnabledAdapters,
7418
7445
  };
7419
7446
  /**
7420
7447
  * Defines the configuration API and is exposed internally as well as externally.
@@ -7785,15 +7812,17 @@ function splitQualifiedFieldApiName(fieldApiName) {
7785
7812
  /**
7786
7813
  * Returns the field API name, qualified with an object name if possible.
7787
7814
  * @param value The value from which to get the qualified field API name.
7815
+ * @param onlyQualifiedFieldNames - Whether or not this function should skip fieldApiName that do not include the delimiter '.'
7788
7816
  * @return The qualified field API name.
7789
7817
  */
7790
- function getFieldApiName(value) {
7818
+ function getFieldApiName(value, onlyQualifiedFieldNames = false) {
7791
7819
  // Note: tightening validation logic changes behavior from userland getting
7792
7820
  // a server-provided error to the adapter noop'ing. In 224 we decided to not
7793
- // change the behavior.
7821
+ // change the behavior. In 250 we decided to add the 'onlyQualifiedFieldName' flag to tighten the logic
7822
+ // optionally to avoid issues with persisted invalid field names.
7794
7823
  if (isString(value)) {
7795
7824
  const trimmed = value.trim();
7796
- if (trimmed.length > 0) {
7825
+ if (trimmed.length > 0 && (onlyQualifiedFieldNames ? trimmed.indexOf('.') > -1 : true)) {
7797
7826
  return trimmed;
7798
7827
  }
7799
7828
  }
@@ -7806,15 +7835,19 @@ function getFieldApiName(value) {
7806
7835
  /**
7807
7836
  * Returns the field API name.
7808
7837
  * @param value The value from which to get the field API name.
7838
+ * @param options Option bag. onlyQualifiedFieldNames is a boolean that allows this function to skip returning invalid FieldApiNames.
7809
7839
  * @returns The field API name.
7810
7840
  */
7811
- function getFieldApiNamesArray(value) {
7841
+ function getFieldApiNamesArray(value, options = { onlyQualifiedFieldNames: false }) {
7812
7842
  const valueArray = isArray(value) ? value : [value];
7813
7843
  const array = [];
7814
7844
  for (let i = 0, len = valueArray.length; i < len; i += 1) {
7815
7845
  const item = valueArray[i];
7816
- const apiName = getFieldApiName(item);
7846
+ const apiName = getFieldApiName(item, options.onlyQualifiedFieldNames);
7817
7847
  if (apiName === undefined) {
7848
+ if (options.onlyQualifiedFieldNames) {
7849
+ continue; // Just skips invalid field names rather than failing to return an array at all
7850
+ }
7818
7851
  return undefined;
7819
7852
  }
7820
7853
  push.call(array, apiName);
@@ -13790,7 +13823,7 @@ function revertPaginationOptimization(variables) {
13790
13823
  }
13791
13824
 
13792
13825
  const TTL$C = 30000;
13793
- const VERSION$2m = "e635ab62cb633d32aeeb183e568bb2c7";
13826
+ const VERSION$2m = "e5c90c4081cd557f8ffec53028ede1e8";
13794
13827
  function validate$1S(obj, path = 'ListRecordCollectionRepresentation') {
13795
13828
  const v_error = (() => {
13796
13829
  if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
@@ -14080,14 +14113,13 @@ function validate$1S(obj, path = 'ListRecordCollectionRepresentation') {
14080
14113
  }
14081
14114
  const RepresentationType$Y = 'ListRecordCollectionRepresentation';
14082
14115
  function keyBuilder$3k(luvio, config) {
14083
- return keyPrefix + '::' + RepresentationType$Y + ':' + config.objectApiName + ':' + (config.searchTerm === null ? '' : config.searchTerm) + ':' + (config.sortBy === null ? '' : '[' + config.sortBy.join(',') + ']') + ':' + (config.listViewId === null ? '' : config.listViewId) + ':' + (config.where === null ? '' : config.where) + ':' + (config.listViewApiName === null ? '' : config.listViewApiName);
14116
+ 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);
14084
14117
  }
14085
14118
  function keyBuilderFromType$B(luvio, object) {
14086
14119
  const keyParams = {
14087
14120
  objectApiName: object.listReference.objectApiName,
14088
14121
  searchTerm: object.searchTerm,
14089
14122
  sortBy: object.sortBy,
14090
- listViewId: object.listInfoETag,
14091
14123
  where: object.where,
14092
14124
  listViewApiName: object.listReference.listViewApiName
14093
14125
  };
@@ -15629,7 +15661,8 @@ function keyBuilder$3c(luvio, params) {
15629
15661
  return keyBuilder$3k(luvio, {
15630
15662
  objectApiName: listReference.objectApiName,
15631
15663
  listViewApiName: listReference.listViewApiName,
15632
- listViewId: listReference.id,
15664
+ // # removing listViewId from key only supporing getting records using api name
15665
+ // listViewId: listReference.id,
15633
15666
  searchTerm: params.body.searchTerm || null,
15634
15667
  where: params.body.where || null,
15635
15668
  sortBy: params.body.sortBy !== undefined && params.body.sortBy.length <= 0
@@ -15642,7 +15675,8 @@ function keyBuilder$3c(luvio, params) {
15642
15675
  return keyBuilder$3k(luvio, {
15643
15676
  objectApiName: params.urlParams.objectApiName,
15644
15677
  listViewApiName: params.urlParams.listViewApiName,
15645
- listViewId: '',
15678
+ // # removing listViewId from key only supporing getting records using api name
15679
+ // listViewId: '',
15646
15680
  searchTerm: params.body.searchTerm || null,
15647
15681
  where: params.body.where || null,
15648
15682
  sortBy: params.body.sortBy || [],
@@ -28076,7 +28110,7 @@ function equals$C(existing, incoming) {
28076
28110
  }
28077
28111
 
28078
28112
  const TTL$p = 900000;
28079
- const VERSION$1R = "84e1e3ffdfcb59f65d7b8906e33027ac";
28113
+ const VERSION$1R = "2405a0b25c2c00f82e88b600edc16387";
28080
28114
  function validate$16(obj, path = 'ListObjectInfoRepresentation') {
28081
28115
  const v_error = (() => {
28082
28116
  if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
@@ -28122,6 +28156,11 @@ function validate$16(obj, path = 'ListObjectInfoRepresentation') {
28122
28156
  if (typeof obj_objectApiName !== 'string') {
28123
28157
  return new TypeError('Expected "string" but received "' + typeof obj_objectApiName + '" (at "' + path_objectApiName + '")');
28124
28158
  }
28159
+ const obj_publicOrSharedCreateable = obj.publicOrSharedCreateable;
28160
+ const path_publicOrSharedCreateable = path + '.publicOrSharedCreateable';
28161
+ if (typeof obj_publicOrSharedCreateable !== 'boolean') {
28162
+ return new TypeError('Expected "boolean" but received "' + typeof obj_publicOrSharedCreateable + '" (at "' + path_publicOrSharedCreateable + '")');
28163
+ }
28125
28164
  const obj_relatedEntityApiName = obj.relatedEntityApiName;
28126
28165
  const path_relatedEntityApiName = path + '.relatedEntityApiName';
28127
28166
  let obj_relatedEntityApiName_union0 = null;
@@ -28192,6 +28231,10 @@ const select$29 = function ListObjectInfoRepresentationSelect() {
28192
28231
  name: 'objectApiName',
28193
28232
  kind: 'Scalar'
28194
28233
  },
28234
+ {
28235
+ name: 'publicOrSharedCreateable',
28236
+ kind: 'Scalar'
28237
+ },
28195
28238
  {
28196
28239
  name: 'relatedEntityApiName',
28197
28240
  kind: 'Scalar'
@@ -28205,6 +28248,11 @@ function equals$B(existing, incoming) {
28205
28248
  if (!(existing_createable === incoming_createable)) {
28206
28249
  return false;
28207
28250
  }
28251
+ const existing_publicOrSharedCreateable = existing.publicOrSharedCreateable;
28252
+ const incoming_publicOrSharedCreateable = incoming.publicOrSharedCreateable;
28253
+ if (!(existing_publicOrSharedCreateable === incoming_publicOrSharedCreateable)) {
28254
+ return false;
28255
+ }
28208
28256
  const existing_objectApiName = existing.objectApiName;
28209
28257
  const incoming_objectApiName = incoming.objectApiName;
28210
28258
  if (!(existing_objectApiName === incoming_objectApiName)) {
@@ -58041,6 +58089,7 @@ function onFetchResponseSuccess$1(luvio, config, resourceParams, response) {
58041
58089
  // Note: The original listReference will remain unchanged in the response.
58042
58090
  mutatedListRef.id = body.listInfoETag;
58043
58091
  addListReferenceWithId(mutatedListRef, context, body.listReference.id);
58092
+ // storing sortBy ensuring a cache hit when requesting records with no sortBy provided
58044
58093
  addServerDefaults(config, body, originalListRef, context);
58045
58094
  }
58046
58095
  return onFetchResponseSuccess$2(luvio, config, resourceParams, response);
@@ -61281,7 +61330,11 @@ function createDispatchResourceRequestContext(requestContext) {
61281
61330
  }
61282
61331
  ensureRegisteredOnce({
61283
61332
  id: '@salesforce/lds-adapters-uiapi',
61284
- configuration: { ...configurationForRestAdapters, ...configurationForGraphQLAdapters },
61333
+ configuration: {
61334
+ ...configurationForRestAdapters,
61335
+ ...configurationForGraphQLAdapters,
61336
+ ...configurationForOneStoreEnabledAdapters,
61337
+ },
61285
61338
  instrument,
61286
61339
  });
61287
61340
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/lwc-adapters-uiapi",
3
- "version": "1.282.0",
3
+ "version": "1.284.0",
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.282.0"
34
+ "@salesforce/lds-adapters-uiapi": "^1.284.0"
35
35
  },
36
36
  "dependencies": {
37
37
  "@luvio/lwc-luvio": "0.154.15",
38
- "@salesforce/lds-default-luvio": "^1.282.0"
38
+ "@salesforce/lds-default-luvio": "^1.284.0"
39
39
  }
40
40
  }