@salesforce/lwc-adapters-uiapi 1.266.0-dev20 → 1.266.0-dev21

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 +11 -5
  2. package/package.json +3 -3
package/dist/main.js CHANGED
@@ -7775,15 +7775,17 @@ function splitQualifiedFieldApiName(fieldApiName) {
7775
7775
  /**
7776
7776
  * Returns the field API name, qualified with an object name if possible.
7777
7777
  * @param value The value from which to get the qualified field API name.
7778
+ * @param onlyQualifiedFieldNames - Whether or not this function should skip fieldApiName that do not include the delimiter '.'
7778
7779
  * @return The qualified field API name.
7779
7780
  */
7780
- function getFieldApiName(value) {
7781
+ function getFieldApiName(value, onlyQualifiedFieldNames = false) {
7781
7782
  // Note: tightening validation logic changes behavior from userland getting
7782
7783
  // a server-provided error to the adapter noop'ing. In 224 we decided to not
7783
- // change the behavior.
7784
+ // change the behavior. In 250 we decided to add the 'onlyQualifiedFieldName' flag to tighten the logic
7785
+ // optionally to avoid issues with persisted invalid field names.
7784
7786
  if (isString(value)) {
7785
7787
  const trimmed = value.trim();
7786
- if (trimmed.length > 0) {
7788
+ if (trimmed.length > 0 && (onlyQualifiedFieldNames ? trimmed.indexOf('.') > -1 : true)) {
7787
7789
  return trimmed;
7788
7790
  }
7789
7791
  }
@@ -7796,15 +7798,19 @@ function getFieldApiName(value) {
7796
7798
  /**
7797
7799
  * Returns the field API name.
7798
7800
  * @param value The value from which to get the field API name.
7801
+ * @param options Option bag. onlyQualifiedFieldNames is a boolean that allows this function to skip returning invalid FieldApiNames.
7799
7802
  * @returns The field API name.
7800
7803
  */
7801
- function getFieldApiNamesArray(value) {
7804
+ function getFieldApiNamesArray(value, options = { onlyQualifiedFieldNames: false }) {
7802
7805
  const valueArray = isArray(value) ? value : [value];
7803
7806
  const array = [];
7804
7807
  for (let i = 0, len = valueArray.length; i < len; i += 1) {
7805
7808
  const item = valueArray[i];
7806
- const apiName = getFieldApiName(item);
7809
+ const apiName = getFieldApiName(item, options.onlyQualifiedFieldNames);
7807
7810
  if (apiName === undefined) {
7811
+ if (options.onlyQualifiedFieldNames) {
7812
+ continue; // Just skips invalid field names rather than failing to return an array at all
7813
+ }
7808
7814
  return undefined;
7809
7815
  }
7810
7816
  push.call(array, apiName);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/lwc-adapters-uiapi",
3
- "version": "1.266.0-dev20",
3
+ "version": "1.266.0-dev21",
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.266.0-dev20"
34
+ "@salesforce/lds-adapters-uiapi": "^1.266.0-dev21"
35
35
  },
36
36
  "dependencies": {
37
37
  "@luvio/lwc-luvio": "0.154.7-dev8",
38
- "@salesforce/lds-default-luvio": "^1.266.0-dev20"
38
+ "@salesforce/lds-default-luvio": "^1.266.0-dev21"
39
39
  }
40
40
  }