@salesforce/lds-ads-bridge 1.283.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.
@@ -481,7 +481,7 @@ const callbacks$1 = [];
481
481
  function register(r) {
482
482
  callbacks$1.forEach((callback) => callback(r));
483
483
  }
484
- // version: 1.283.0-a330da944
484
+ // version: 1.284.0-a7e8dc51c
485
485
 
486
486
  /**
487
487
  * Returns true if the value acts like a Promise, i.e. has a "then" function,
@@ -4487,6 +4487,32 @@ let trackedFieldDepthOnNotifyChange = 5;
4487
4487
  * @defaultValue 'false', replicates the current behavior and fetches all fields in the store for the leaf relationship record
4488
4488
  */
4489
4489
  let trackedFieldLeafNodeIdAndNameOnly = false;
4490
+ /**
4491
+ * One store enabled Get Object Info adapter
4492
+ */
4493
+ let oneStoreGetObjectInfoAdapter = undefined;
4494
+ /**
4495
+ * One store enabled Get Object Infos adapter
4496
+ */
4497
+ let oneStoreGetObjectInfosAdapter = undefined;
4498
+ /**
4499
+ * Defines the configuration API and is exposed internally as well as externally.
4500
+ * Configuration for one store enabled REST adapters only.
4501
+ */
4502
+ const configurationForOneStoreEnabledAdapters = {
4503
+ setGetObjectInfoAdapter: function (adapter) {
4504
+ oneStoreGetObjectInfoAdapter = adapter;
4505
+ },
4506
+ getGetObjectInfoAdapter: function () {
4507
+ return oneStoreGetObjectInfoAdapter;
4508
+ },
4509
+ setGetObjectInfosAdapter: function (adapter) {
4510
+ oneStoreGetObjectInfosAdapter = adapter;
4511
+ },
4512
+ getGetObjectInfosAdapter: function () {
4513
+ return oneStoreGetObjectInfosAdapter;
4514
+ },
4515
+ };
4490
4516
  /**
4491
4517
  * Defines the configuration API and is exposed internally as well as externally.
4492
4518
  * Configuration for REST adapters only.
@@ -4551,6 +4577,7 @@ const configurationForRestAdapters = {
4551
4577
  getDraftAwareCreateContentVersionAdapter: function () {
4552
4578
  return draftAwareCreateContentVersionAdapter;
4553
4579
  },
4580
+ ...configurationForOneStoreEnabledAdapters,
4554
4581
  };
4555
4582
  /**
4556
4583
  * Defines the configuration API and is exposed internally as well as externally.
@@ -4807,15 +4834,17 @@ function splitQualifiedFieldApiName(fieldApiName) {
4807
4834
  /**
4808
4835
  * Returns the field API name, qualified with an object name if possible.
4809
4836
  * @param value The value from which to get the qualified field API name.
4837
+ * @param onlyQualifiedFieldNames - Whether or not this function should skip fieldApiName that do not include the delimiter '.'
4810
4838
  * @return The qualified field API name.
4811
4839
  */
4812
- function getFieldApiName(value) {
4840
+ function getFieldApiName(value, onlyQualifiedFieldNames = false) {
4813
4841
  // Note: tightening validation logic changes behavior from userland getting
4814
4842
  // a server-provided error to the adapter noop'ing. In 224 we decided to not
4815
- // change the behavior.
4843
+ // change the behavior. In 250 we decided to add the 'onlyQualifiedFieldName' flag to tighten the logic
4844
+ // optionally to avoid issues with persisted invalid field names.
4816
4845
  if (isString(value)) {
4817
4846
  const trimmed = value.trim();
4818
- if (trimmed.length > 0) {
4847
+ if (trimmed.length > 0 && (onlyQualifiedFieldNames ? trimmed.indexOf('.') > -1 : true)) {
4819
4848
  return trimmed;
4820
4849
  }
4821
4850
  }
@@ -4828,15 +4857,19 @@ function getFieldApiName(value) {
4828
4857
  /**
4829
4858
  * Returns the field API name.
4830
4859
  * @param value The value from which to get the field API name.
4860
+ * @param options Option bag. onlyQualifiedFieldNames is a boolean that allows this function to skip returning invalid FieldApiNames.
4831
4861
  * @returns The field API name.
4832
4862
  */
4833
- function getFieldApiNamesArray(value) {
4863
+ function getFieldApiNamesArray(value, options = { onlyQualifiedFieldNames: false }) {
4834
4864
  const valueArray = isArray(value) ? value : [value];
4835
4865
  const array = [];
4836
4866
  for (let i = 0, len = valueArray.length; i < len; i += 1) {
4837
4867
  const item = valueArray[i];
4838
- const apiName = getFieldApiName(item);
4868
+ const apiName = getFieldApiName(item, options.onlyQualifiedFieldNames);
4839
4869
  if (apiName === undefined) {
4870
+ if (options.onlyQualifiedFieldNames) {
4871
+ continue; // Just skips invalid field names rather than failing to return an array at all
4872
+ }
4840
4873
  return undefined;
4841
4874
  }
4842
4875
  push$1.call(array, apiName);
@@ -9194,7 +9227,11 @@ const RECORD_FIELDS_KEY_JUNCTION = '__fields__';
9194
9227
  ObjectCreate$1(null);
9195
9228
  ensureRegisteredOnce({
9196
9229
  id: '@salesforce/lds-adapters-uiapi',
9197
- configuration: { ...configurationForRestAdapters, ...configurationForGraphQLAdapters },
9230
+ configuration: {
9231
+ ...configurationForRestAdapters,
9232
+ ...configurationForGraphQLAdapters,
9233
+ ...configurationForOneStoreEnabledAdapters,
9234
+ },
9198
9235
  instrument,
9199
9236
  });
9200
9237
 
package/dist/adsBridge.js CHANGED
@@ -371,4 +371,4 @@ function withAdsBridge(callback) {
371
371
  }
372
372
 
373
373
  export { instrument, withAdsBridge };
374
- // version: 1.283.0-a330da944
374
+ // version: 1.284.0-a7e8dc51c
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/lds-ads-bridge",
3
- "version": "1.283.0",
3
+ "version": "1.284.0",
4
4
  "license": "SEE LICENSE IN LICENSE.txt",
5
5
  "description": "Bridge to sync data between LDS and ADS",
6
6
  "main": "dist/adsBridge.js",
@@ -29,7 +29,7 @@
29
29
  "release:corejar": "yarn build && ../core-build/scripts/core.js --name=lds-ads-bridge"
30
30
  },
31
31
  "devDependencies": {
32
- "@salesforce/lds-adapters-uiapi": "^1.283.0",
33
- "@salesforce/lds-uiapi-record-utils": "^1.283.0"
32
+ "@salesforce/lds-adapters-uiapi": "^1.284.0",
33
+ "@salesforce/lds-uiapi-record-utils": "^1.284.0"
34
34
  }
35
35
  }