@salesforce/lds-ads-bridge 1.433.0 → 1.434.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.
@@ -483,7 +483,7 @@ const callbacks$1 = [];
483
483
  function register(r) {
484
484
  callbacks$1.forEach((callback) => callback(r));
485
485
  }
486
- // version: 1.433.0-8a15a98f24
486
+ // version: 1.434.0-d8deb0d4ea
487
487
 
488
488
  /**
489
489
  * Returns true if the value acts like a Promise, i.e. has a "then" function,
@@ -4459,28 +4459,23 @@ let configurableCreateContentVersion = new Configurable();
4459
4459
  * Depth to which tracked fields will be added to a request that results from a cache miss.
4460
4460
  * A value of 0 inhibits the addition of tracked fields, 1 will add tracked fields that can
4461
4461
  * be reached by following 1 relationship from the root record, etc.
4462
- * @defaultValue '5', replicates the current behavior
4462
+ * @defaultValue '1'
4463
4463
  */
4464
- let trackedFieldDepthOnCacheMiss = 5;
4464
+ let trackedFieldDepthOnCacheMiss = 1;
4465
4465
  /**
4466
4466
  * Depth to which tracked fields will be added to a request that results from a merge conflict
4467
4467
  * A value of 0 inhibits the addition of tracked fields, 1 will add tracked fields that can
4468
4468
  * be reached by following 1 relationship from the root record, etc.
4469
- * @defaultValue '5', replicates the current behavior
4469
+ * @defaultValue '1'
4470
4470
  */
4471
- let trackedFieldDepthOnCacheMergeConflict = 5;
4471
+ let trackedFieldDepthOnCacheMergeConflict = 1;
4472
4472
  /**
4473
4473
  * Depth to which tracked fields will be added to a request that results from a notify change invocation by the consumer
4474
4474
  * A value of 0 inhibits the addition of tracked fields, 1 will add tracked fields that can
4475
4475
  * be reached by following 1 relationship from the root record, etc.
4476
- * @defaultValue '5', replicates the current behavior
4476
+ * @defaultValue '1'
4477
4477
  */
4478
- let trackedFieldDepthOnNotifyChange = 5;
4479
- /**
4480
- * Determines if we will only fetch the 'Id' field for the leaf relationship record
4481
- * @defaultValue 'false', replicates the current behavior and fetches all fields in the store for the leaf relationship record
4482
- */
4483
- let trackedFieldLeafNodeIdAndNameOnly = false;
4478
+ let trackedFieldDepthOnNotifyChange = 1;
4484
4479
  /**
4485
4480
  * One store enabled Get Object Info adapter
4486
4481
  */
@@ -4577,12 +4572,6 @@ const configurationForRestAdapters = {
4577
4572
  getTrackedFieldDepthOnNotifyChange: function () {
4578
4573
  return trackedFieldDepthOnNotifyChange;
4579
4574
  },
4580
- setTrackedFieldLeafNodeIdAndNameOnly: function (trackedFieldLeafNodeIdAndNameOnlyParam) {
4581
- trackedFieldLeafNodeIdAndNameOnly = trackedFieldLeafNodeIdAndNameOnlyParam;
4582
- },
4583
- getTrackedFieldLeafNodeIdAndNameOnly: function () {
4584
- return trackedFieldLeafNodeIdAndNameOnly;
4585
- },
4586
4575
  setRecordRepresentationIngestionOverride: function (ingest) {
4587
4576
  recordRepresentationIngestionOverride = ingest;
4588
4577
  },
@@ -6171,6 +6160,9 @@ function buildSelectionFromFields(fields, optionalFields = []) {
6171
6160
  return createRecordSelection(convertRecordFieldsArrayToTrie(fields, optionalFields));
6172
6161
  }
6173
6162
 
6163
+ // Unused suffixes, but leaving in as comments to avoid eslint errors
6164
+ // const CUSTOM_API_NAME_SUFFIX = '__c';
6165
+ // const DMO_API_NAME_SUFFIX = '__dlm';
6174
6166
  const CUSTOM_EXTERNAL_OBJECT_FIELD_SUFFIX = '__x';
6175
6167
  const RECORD_REPRESENTATION_ERROR_VERSION = 'RECORD_REPRESENTATION_ERROR_VERSION_1';
6176
6168
  const RECORD_REPRESENTATION_ERROR_STORE_METADATA_PARAMS = {
@@ -6197,7 +6189,7 @@ function addScalarField(current, leafNodeFieldKey) {
6197
6189
  }
6198
6190
  }
6199
6191
  function extractTrackedFieldsToTrie(recordId, node, root, config, visitedRecordIds = {}, depth = 0) {
6200
- var _a, _b;
6192
+ var _a;
6201
6193
  // Filter Error and null nodes
6202
6194
  if (!isGraphNode$1(node)) {
6203
6195
  return;
@@ -6235,13 +6227,11 @@ function extractTrackedFieldsToTrie(recordId, node, root, config, visitedRecordI
6235
6227
  if (!isGraphNode$1(field)) {
6236
6228
  continue;
6237
6229
  }
6238
- const { maxDepth, onlyFetchLeafNodeIdAndName } = config;
6230
+ const { maxDepth } = config;
6239
6231
  if (field.isScalar('value') === false && !Array.isArray((_a = field.data) === null || _a === void 0 ? void 0 : _a.value)) {
6240
6232
  if (depth + 1 > maxDepth) {
6241
- if (onlyFetchLeafNodeIdAndName === true) {
6242
- addScalarFieldId(current);
6243
- addScalarFieldName(current);
6244
- }
6233
+ addScalarFieldId(current);
6234
+ addScalarFieldName(current);
6245
6235
  continue;
6246
6236
  }
6247
6237
  const spanningLink = field.link('value');
@@ -6263,19 +6253,10 @@ function extractTrackedFieldsToTrie(recordId, node, root, config, visitedRecordI
6263
6253
  current.children[key] = next;
6264
6254
  }
6265
6255
  else {
6266
- // Skip the field, if its value is null at the max level depth.
6267
- // Ideally, it should only skip relationship field. However,
6268
- // on the client, there is not a reliable way to determine the
6269
- // the field type.
6270
6256
  if (depth === maxDepth) {
6271
- if (onlyFetchLeafNodeIdAndName === true) {
6272
- addScalarFieldId(current);
6273
- addScalarFieldName(current);
6274
- continue;
6275
- }
6276
- if (field.scalar('value') === null && !Array.isArray((_b = field.data) === null || _b === void 0 ? void 0 : _b.value)) {
6277
- continue;
6278
- }
6257
+ addScalarFieldId(current);
6258
+ addScalarFieldName(current);
6259
+ continue;
6279
6260
  }
6280
6261
  const state = fieldValueRep.linkData();
6281
6262
  if (state !== undefined) {
@@ -6610,7 +6591,6 @@ function mergeRecordConflict(luvio, incoming, existing, recordConflictMap) {
6610
6591
  };
6611
6592
  const trackedFieldsConfig = {
6612
6593
  maxDepth: configurationForRestAdapters.getTrackedFieldDepthOnCacheMergeConflict(),
6613
- onlyFetchLeafNodeIdAndName: configurationForRestAdapters.getTrackedFieldLeafNodeIdAndNameOnly(),
6614
6594
  };
6615
6595
  extractTrackedFieldsToTrie(recordKey, incomingNode, incomingTrackedFieldsTrieRoot, trackedFieldsConfig);
6616
6596
  extractTrackedFieldsToTrie(recordKey, existingNode, existingTrackedFieldsTrieRoot, trackedFieldsConfig);
@@ -7048,7 +7028,6 @@ function prepareRequest$7(luvio, config) {
7048
7028
  const key = keyBuilder$3T(luvio, createResourceParams$15(config));
7049
7029
  const allTrackedFields = getTrackedFields(key, luvio.getNode(key), {
7050
7030
  maxDepth: configurationForRestAdapters.getTrackedFieldDepthOnCacheMiss(),
7051
- onlyFetchLeafNodeIdAndName: configurationForRestAdapters.getTrackedFieldLeafNodeIdAndNameOnly(),
7052
7031
  }, config.optionalFields);
7053
7032
  const optionalFields = fields === undefined ? allTrackedFields : difference(allTrackedFields, fields);
7054
7033
  const resourceParams = createResourceParams$15({
@@ -7141,7 +7120,6 @@ function ingestSuccessChildResourceParams$9(luvio, childResourceParamsArray, chi
7141
7120
  };
7142
7121
  const childTrackedFields = getTrackedFields(childKey, luvio.getNode(childKey), {
7143
7122
  maxDepth: configurationForRestAdapters.getTrackedFieldDepthOnCacheMiss(),
7144
- onlyFetchLeafNodeIdAndName: configurationForRestAdapters.getTrackedFieldLeafNodeIdAndNameOnly(),
7145
7123
  }, childResourceParams.queryParams.optionalFields);
7146
7124
  const childSnapshot = ingestSuccess$X(luvio, {
7147
7125
  recordId: childResourceParams.urlParams.recordId,
@@ -8234,8 +8212,7 @@ class AdsBridge {
8234
8212
  let shouldEmit = false;
8235
8213
  const adsRecordMap = {};
8236
8214
  const adsObjectMap = {};
8237
- // W-21715343
8238
- // Context for change: https://docs.google.com/document/d/1iF6M9jldEX_K9FOpdttLqVwO9uESUUrlyWi2mWnXtAQ/edit?usp=sharing
8215
+ // Context for change: W-21715343
8239
8216
  const filteredUpdatedEntries = this.filterAndSynthesizeBaseIds(updatedEntries);
8240
8217
  for (let i = 0; i < filteredUpdatedEntries.length; i++) {
8241
8218
  const storeRecordId = filteredUpdatedEntries[i].id;
package/dist/adsBridge.js CHANGED
@@ -397,8 +397,7 @@ class AdsBridge {
397
397
  let shouldEmit = false;
398
398
  const adsRecordMap = {};
399
399
  const adsObjectMap = {};
400
- // W-21715343
401
- // Context for change: https://docs.google.com/document/d/1iF6M9jldEX_K9FOpdttLqVwO9uESUUrlyWi2mWnXtAQ/edit?usp=sharing
400
+ // Context for change: W-21715343
402
401
  const filteredUpdatedEntries = this.filterAndSynthesizeBaseIds(updatedEntries);
403
402
  for (let i = 0; i < filteredUpdatedEntries.length; i++) {
404
403
  const storeRecordId = filteredUpdatedEntries[i].id;
@@ -462,4 +461,4 @@ function withAdsBridge(callback) {
462
461
  }
463
462
 
464
463
  export { instrument, withAdsBridge };
465
- // version: 1.433.0-8a15a98f24
464
+ // version: 1.434.0-d8deb0d4ea
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/lds-ads-bridge",
3
- "version": "1.433.0",
3
+ "version": "1.434.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",
@@ -30,9 +30,9 @@
30
30
  "release:corejar": "yarn build && ../core-build/scripts/core.js --name=lds-ads-bridge"
31
31
  },
32
32
  "devDependencies": {
33
- "@salesforce/lds-adapters-uiapi": "^1.433.0",
34
- "@salesforce/lds-runtime-mobile": "^1.433.0",
35
- "@salesforce/lds-uiapi-record-utils-mobile": "^1.433.0"
33
+ "@salesforce/lds-adapters-uiapi": "^1.434.0",
34
+ "@salesforce/lds-runtime-mobile": "^1.434.0",
35
+ "@salesforce/lds-uiapi-record-utils-mobile": "^1.434.0"
36
36
  },
37
37
  "volta": {
38
38
  "extends": "../../package.json"
@@ -422,8 +422,7 @@ describe('AdsBridge', () => {
422
422
  });
423
423
  });
424
424
 
425
- // W-21715343
426
- // Context for change: https://docs.google.com/document/d/1iF6M9jldEX_K9FOpdttLqVwO9uESUUrlyWi2mWnXtAQ/edit?usp=sharing
425
+ // Context for change: W-21715343
427
426
  it('correctly emits the updated Case record to ADS when refreshSnapshot is called, and the Case record was updated via spanning record updates on the Task record', async () => {
428
427
  const initialLdsState = JSON.parse(JSON.stringify(require('./initial_record.json')));
429
428
  const addRecordsGet = JSON.parse(JSON.stringify(require('./task_record_gvp_get.json')));
package/src/ads-bridge.ts CHANGED
@@ -539,8 +539,7 @@ export default class AdsBridge {
539
539
  const adsRecordMap: AdsRecordMap = {};
540
540
  const adsObjectMap: AdsObjectMetadataMap = {};
541
541
 
542
- // W-21715343
543
- // Context for change: https://docs.google.com/document/d/1iF6M9jldEX_K9FOpdttLqVwO9uESUUrlyWi2mWnXtAQ/edit?usp=sharing
542
+ // Context for change: W-21715343
544
543
  const filteredUpdatedEntries = this.filterAndSynthesizeBaseIds(updatedEntries);
545
544
  for (let i = 0; i < filteredUpdatedEntries.length; i++) {
546
545
  const storeRecordId = filteredUpdatedEntries[i].id;