@salesforce/lds-ads-bridge 1.283.0 → 1.285.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.285.0-67d4d6869
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);
@@ -5192,7 +5225,7 @@ const getTypeCacheKeys$24 = (rootKeySet, luvio, input, _fullPathFactory) => {
5192
5225
  return rootKeySet;
5193
5226
  };
5194
5227
 
5195
- const TTL$E = 120000;
5228
+ const TTL$F = 120000;
5196
5229
  const VERSION$2p = "79cb5ac9f44542f683d00245fdfe500d";
5197
5230
  function validate$1U(obj, path = 'RecordCollectionRepresentation') {
5198
5231
  const v_error = (() => {
@@ -5473,7 +5506,7 @@ const ingest$20 = function RecordCollectionRepresentationIngest(input, path, luv
5473
5506
  }
5474
5507
  }
5475
5508
  const key = path.fullPath;
5476
- const ttlToUse = TTL$E;
5509
+ const ttlToUse = TTL$F;
5477
5510
  ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$S, "UiApi", VERSION$2p, RepresentationType$_, equals$14);
5478
5511
  return createLink$1(key);
5479
5512
  };
@@ -5501,7 +5534,7 @@ const keyBuilderFromType$D = function RecordRepresentationKeyBuilderFromType(luv
5501
5534
  return keyBuilderFromType$C(luvio, object);
5502
5535
  };
5503
5536
 
5504
- const TTL$D = 30000;
5537
+ const TTL$E = 30000;
5505
5538
  const VERSION$2o = "98c5b18512e48ca8d28727549507e4ba";
5506
5539
  function validate$1T(obj, path = 'RecordRepresentation') {
5507
5540
  const v_error = (() => {
@@ -7526,7 +7559,7 @@ const RECORD_REPRESENTATION_ERROR_VERSION = 'RECORD_REPRESENTATION_ERROR_VERSION
7526
7559
  const RECORD_REPRESENTATION_ERROR_STORE_METADATA_PARAMS = {
7527
7560
  representationName: '',
7528
7561
  namespace: keyPrefix,
7529
- ttl: TTL$D,
7562
+ ttl: TTL$E,
7530
7563
  version: RECORD_REPRESENTATION_ERROR_VERSION,
7531
7564
  };
7532
7565
  function isGraphNode$1(node) {
@@ -8209,7 +8242,7 @@ const createRecordIngest = (fieldsTrie, optionalFieldsTrie, recordConflictMap) =
8209
8242
  luvio.storePublish(key, incomingRecord);
8210
8243
  }
8211
8244
  luvio.publishStoreMetadata(key, {
8212
- ttl: TTL$D,
8245
+ ttl: TTL$E,
8213
8246
  representationName: RepresentationType$Z,
8214
8247
  namespace: keyPrefix,
8215
8248
  version: VERSION$2o,
@@ -8504,7 +8537,7 @@ function ingestSuccessChildResourceParams$9(luvio, childResourceParamsArray, chi
8504
8537
  // track non-cached responses so rebuilds work properly
8505
8538
  if (childStatusCode !== 404 && childStatusCode !== 200) {
8506
8539
  nonCachedErrors$8[childKey] = {
8507
- expiration: now + TTL$D,
8540
+ expiration: now + TTL$E,
8508
8541
  response: childBody,
8509
8542
  status: childStatusCode,
8510
8543
  };
@@ -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.285.0-67d4d6869
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.285.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.285.0",
33
+ "@salesforce/lds-uiapi-record-utils": "^1.285.0"
34
34
  }
35
35
  }