@salesforce/lds-ads-bridge 1.322.0 → 1.324.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.322.0-6aa042602a
484
+ // version: 1.324.0-62e02d2ff9
485
485
 
486
486
  /**
487
487
  * Returns true if the value acts like a Promise, i.e. has a "then" function,
@@ -5012,8 +5012,8 @@ function toSortedStringArray(value) {
5012
5012
  return undefined;
5013
5013
  }
5014
5014
 
5015
- const VERSION$2H = "d1e589a127fb1060c89070cdb6f500b2";
5016
- function validate$1_(obj, path = 'RecordTypeInfoRepresentation') {
5015
+ const VERSION$2I = "d1e589a127fb1060c89070cdb6f500b2";
5016
+ function validate$20(obj, path = 'RecordTypeInfoRepresentation') {
5017
5017
  const v_error = (() => {
5018
5018
  if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
5019
5019
  return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
@@ -5046,10 +5046,10 @@ function validate$1_(obj, path = 'RecordTypeInfoRepresentation') {
5046
5046
  })();
5047
5047
  return v_error === undefined ? null : v_error;
5048
5048
  }
5049
- const select$3m = function RecordTypeInfoRepresentationSelect() {
5049
+ const select$3n = function RecordTypeInfoRepresentationSelect() {
5050
5050
  return {
5051
5051
  kind: 'Fragment',
5052
- version: VERSION$2H,
5052
+ version: VERSION$2I,
5053
5053
  private: [],
5054
5054
  selections: [
5055
5055
  {
@@ -5075,7 +5075,7 @@ const select$3m = function RecordTypeInfoRepresentationSelect() {
5075
5075
  ]
5076
5076
  };
5077
5077
  };
5078
- function equals$1a(existing, incoming) {
5078
+ function equals$1b(existing, incoming) {
5079
5079
  const existing_available = existing.available;
5080
5080
  const incoming_available = incoming.available;
5081
5081
  if (!(existing_available === incoming_available)) {
@@ -5104,8 +5104,8 @@ function equals$1a(existing, incoming) {
5104
5104
  return true;
5105
5105
  }
5106
5106
 
5107
- const VERSION$2G = "195d918987a35f45e1aa4dce9a11d8c5";
5108
- function validate$1Z(obj, path = 'FieldValueRepresentation') {
5107
+ const VERSION$2H = "195d918987a35f45e1aa4dce9a11d8c5";
5108
+ function validate$1$(obj, path = 'FieldValueRepresentation') {
5109
5109
  const v_error = (() => {
5110
5110
  if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
5111
5111
  return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
@@ -5196,10 +5196,10 @@ function validate$1Z(obj, path = 'FieldValueRepresentation') {
5196
5196
  return v_error === undefined ? null : v_error;
5197
5197
  }
5198
5198
  const RepresentationType$10 = 'FieldValueRepresentation';
5199
- const select$3l = function FieldValueRepresentationSelect() {
5199
+ const select$3m = function FieldValueRepresentationSelect() {
5200
5200
  return {
5201
5201
  kind: 'Fragment',
5202
- version: VERSION$2G,
5202
+ version: VERSION$2H,
5203
5203
  private: [],
5204
5204
  selections: [
5205
5205
  {
@@ -5210,12 +5210,12 @@ const select$3l = function FieldValueRepresentationSelect() {
5210
5210
  name: 'value',
5211
5211
  kind: 'Link',
5212
5212
  nullable: true,
5213
- fragment: select$3j()
5213
+ fragment: select$3k()
5214
5214
  }
5215
5215
  ]
5216
5216
  };
5217
5217
  };
5218
- function equals$19(existing, incoming) {
5218
+ function equals$1a(existing, incoming) {
5219
5219
  const existing_displayValue = existing.displayValue;
5220
5220
  const incoming_displayValue = incoming.displayValue;
5221
5221
  if (!(existing_displayValue === incoming_displayValue)) {
@@ -5273,8 +5273,8 @@ const getTypeCacheKeys$2h = (rootKeySet, luvio, input, _fullPathFactory) => {
5273
5273
  };
5274
5274
 
5275
5275
  const TTL$G = 120000;
5276
- const VERSION$2F = "79cb5ac9f44542f683d00245fdfe500d";
5277
- function validate$1Y(obj, path = 'RecordCollectionRepresentation') {
5276
+ const VERSION$2G = "79cb5ac9f44542f683d00245fdfe500d";
5277
+ function validate$1_(obj, path = 'RecordCollectionRepresentation') {
5278
5278
  const v_error = (() => {
5279
5279
  if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
5280
5280
  return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
@@ -5454,10 +5454,10 @@ function normalize$T(input, existing, path, luvio, store, timestamp) {
5454
5454
  }
5455
5455
  return input;
5456
5456
  }
5457
- const select$3k = function RecordCollectionRepresentationSelect() {
5457
+ const select$3l = function RecordCollectionRepresentationSelect() {
5458
5458
  return {
5459
5459
  kind: 'Fragment',
5460
- version: VERSION$2F,
5460
+ version: VERSION$2G,
5461
5461
  private: [],
5462
5462
  selections: [
5463
5463
  {
@@ -5492,12 +5492,12 @@ const select$3k = function RecordCollectionRepresentationSelect() {
5492
5492
  name: 'records',
5493
5493
  kind: 'Link',
5494
5494
  plural: true,
5495
- fragment: select$3j()
5495
+ fragment: select$3k()
5496
5496
  }
5497
5497
  ]
5498
5498
  };
5499
5499
  };
5500
- function equals$18(existing, incoming) {
5500
+ function equals$19(existing, incoming) {
5501
5501
  const existing_count = existing.count;
5502
5502
  const incoming_count = incoming.count;
5503
5503
  if (!(existing_count === incoming_count)) {
@@ -5547,14 +5547,14 @@ function equals$18(existing, incoming) {
5547
5547
  }
5548
5548
  const ingest$2d = function RecordCollectionRepresentationIngest(input, path, luvio, store, timestamp) {
5549
5549
  if (process.env.NODE_ENV !== 'production') {
5550
- const validateError = validate$1Y(input);
5550
+ const validateError = validate$1_(input);
5551
5551
  if (validateError !== null) {
5552
5552
  throw validateError;
5553
5553
  }
5554
5554
  }
5555
5555
  const key = path.fullPath;
5556
5556
  const ttlToUse = TTL$G;
5557
- ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$T, "UiApi", VERSION$2F, RepresentationType$$, equals$18);
5557
+ ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$T, "UiApi", VERSION$2G, RepresentationType$$, equals$19);
5558
5558
  return createLink$1(key);
5559
5559
  };
5560
5560
  function getTypeCacheKeys$2g(rootKeySet, luvio, input, fullPathFactory) {
@@ -5582,8 +5582,8 @@ const keyBuilderFromType$E = function RecordRepresentationKeyBuilderFromType(luv
5582
5582
  };
5583
5583
 
5584
5584
  const TTL$F = 30000;
5585
- const VERSION$2E = "98c5b18512e48ca8d28727549507e4ba";
5586
- function validate$1X(obj, path = 'RecordRepresentation') {
5585
+ const VERSION$2F = "98c5b18512e48ca8d28727549507e4ba";
5586
+ function validate$1Z(obj, path = 'RecordRepresentation') {
5587
5587
  const v_error = (() => {
5588
5588
  if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
5589
5589
  return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
@@ -5713,7 +5713,7 @@ function validate$1X(obj, path = 'RecordRepresentation') {
5713
5713
  const path_recordTypeInfo = path + '.recordTypeInfo';
5714
5714
  let obj_recordTypeInfo_union0 = null;
5715
5715
  const obj_recordTypeInfo_union0_error = (() => {
5716
- const referencepath_recordTypeInfoValidationError = validate$1_(obj_recordTypeInfo, path_recordTypeInfo);
5716
+ const referencepath_recordTypeInfoValidationError = validate$20(obj_recordTypeInfo, path_recordTypeInfo);
5717
5717
  if (referencepath_recordTypeInfoValidationError !== null) {
5718
5718
  let message = 'Object doesn\'t match RecordTypeInfoRepresentation (at "' + path_recordTypeInfo + '")\n';
5719
5719
  message += referencepath_recordTypeInfoValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
@@ -5825,11 +5825,11 @@ function dynamicNormalize$5(ingestParams) {
5825
5825
  return input;
5826
5826
  };
5827
5827
  }
5828
- const select$3j = function RecordRepresentationSelect() {
5829
- const { selections: RecordTypeInfoRepresentation__selections, opaque: RecordTypeInfoRepresentation__opaque, } = select$3m();
5828
+ const select$3k = function RecordRepresentationSelect() {
5829
+ const { selections: RecordTypeInfoRepresentation__selections, opaque: RecordTypeInfoRepresentation__opaque, } = select$3n();
5830
5830
  return {
5831
5831
  kind: 'Fragment',
5832
- version: VERSION$2E,
5832
+ version: VERSION$2F,
5833
5833
  private: [
5834
5834
  'eTag',
5835
5835
  'weakEtag'
@@ -5843,13 +5843,13 @@ const select$3j = function RecordRepresentationSelect() {
5843
5843
  name: 'childRelationships',
5844
5844
  kind: 'Link',
5845
5845
  map: true,
5846
- fragment: select$3k()
5846
+ fragment: select$3l()
5847
5847
  },
5848
5848
  {
5849
5849
  name: 'fields',
5850
5850
  kind: 'Link',
5851
5851
  map: true,
5852
- fragment: select$3l()
5852
+ fragment: select$3m()
5853
5853
  },
5854
5854
  {
5855
5855
  name: 'id',
@@ -5885,18 +5885,18 @@ const dynamicSelect$8 = function dynamicRecordRepresentationSelect(params) {
5885
5885
  name: 'childRelationships',
5886
5886
  kind: 'Link',
5887
5887
  map: true,
5888
- fragment: select$3k()
5888
+ fragment: select$3l()
5889
5889
  } : params.childRelationships;
5890
5890
  const fieldsPathSelection = params.fields === undefined ? {
5891
5891
  name: 'fields',
5892
5892
  kind: 'Link',
5893
5893
  map: true,
5894
- fragment: select$3l()
5894
+ fragment: select$3m()
5895
5895
  } : params.fields;
5896
- const { selections: RecordTypeInfoRepresentation__selections, opaque: RecordTypeInfoRepresentation__opaque, } = select$3m();
5896
+ const { selections: RecordTypeInfoRepresentation__selections, opaque: RecordTypeInfoRepresentation__opaque, } = select$3n();
5897
5897
  return {
5898
5898
  kind: 'Fragment',
5899
- version: VERSION$2E,
5899
+ version: VERSION$2F,
5900
5900
  private: [
5901
5901
  'eTag',
5902
5902
  'weakEtag'
@@ -5937,7 +5937,7 @@ const dynamicSelect$8 = function dynamicRecordRepresentationSelect(params) {
5937
5937
  ]
5938
5938
  };
5939
5939
  };
5940
- function equals$17(existing, incoming) {
5940
+ function equals$18(existing, incoming) {
5941
5941
  const existing_weakEtag = existing.weakEtag;
5942
5942
  const incoming_weakEtag = incoming.weakEtag;
5943
5943
  if (!(existing_weakEtag === incoming_weakEtag)) {
@@ -5998,7 +5998,7 @@ function equals$17(existing, incoming) {
5998
5998
  if (!(existing_recordTypeInfo === incoming_recordTypeInfo
5999
5999
  || (existing_recordTypeInfo != null &&
6000
6000
  incoming_recordTypeInfo != null &&
6001
- equals$1a(existing_recordTypeInfo, incoming_recordTypeInfo)))) {
6001
+ equals$1b(existing_recordTypeInfo, incoming_recordTypeInfo)))) {
6002
6002
  return false;
6003
6003
  }
6004
6004
  const existing_systemModstamp = existing.systemModstamp;
@@ -7640,7 +7640,7 @@ function createPathSelection(propertyName, fieldDefinition) {
7640
7640
  kind: 'Fragment',
7641
7641
  private: ['eTag', 'weakEtag'],
7642
7642
  selections: createRecordSelection(childFieldDefinition),
7643
- version: VERSION$2E,
7643
+ version: VERSION$2F,
7644
7644
  },
7645
7645
  };
7646
7646
  }
@@ -7650,7 +7650,7 @@ function createPathSelection(propertyName, fieldDefinition) {
7650
7650
  required: childFieldDefinition.optional === true ? false : undefined,
7651
7651
  fragment: {
7652
7652
  kind: 'Fragment',
7653
- version: VERSION$2G,
7653
+ version: VERSION$2H,
7654
7654
  private: [],
7655
7655
  selections: [DISPLAY_VALUE_SELECTION, fieldValueSelection],
7656
7656
  },
@@ -7883,17 +7883,19 @@ const BLANK_RECORD_FIELDS_TRIE = freeze({
7883
7883
  name: '',
7884
7884
  children: {},
7885
7885
  });
7886
- const convertFieldsToTrie = (fields = [], isOptional = false) => {
7886
+ const convertFieldsToTrie = (fields = [], isOptional = false, objectName // This should be a required field.
7887
+ ) => {
7887
7888
  if (fields.length === 0) {
7888
7889
  return BLANK_RECORD_FIELDS_TRIE;
7889
7890
  }
7890
- const name = getObjectNameFromField(fields[0]);
7891
+ const name = objectName || getObjectNameFromField(fields[0]); // Pulling object name from first field is not a safe or correct operation
7891
7892
  const fieldsTrie = {
7892
7893
  name,
7893
7894
  children: {},
7894
7895
  optional: isOptional,
7895
7896
  };
7896
- insertFieldsIntoTrie(fieldsTrie, fields, isOptional);
7897
+ const filteredFields = fields.filter((field) => objectName !== undefined && isOptional ? field.startsWith(`${objectName}.`) : true);
7898
+ insertFieldsIntoTrie(fieldsTrie, filteredFields, isOptional);
7897
7899
  return fieldsTrie;
7898
7900
  };
7899
7901
  const getObjectNameFromField = (field) => {
@@ -8335,7 +8337,7 @@ function normalize$S(input, existing, path, luvio, store, timestamp, fieldsTrie,
8335
8337
  function makeIngest(fieldsTrie, optionalFieldsTrie, recordConflictMap) {
8336
8338
  return (input, path, luvio, store, timestamp) => {
8337
8339
  if (process.env.NODE_ENV !== 'production') {
8338
- const validateError = validate$1Z(input);
8340
+ const validateError = validate$1$(input);
8339
8341
  if (validateError !== null) {
8340
8342
  throw validateError;
8341
8343
  }
@@ -8350,7 +8352,7 @@ function makeIngest(fieldsTrie, optionalFieldsTrie, recordConflictMap) {
8350
8352
  // read again after children ingested in case of a circular ref
8351
8353
  existingRecord = store.readEntry(key);
8352
8354
  incomingRecord = merge$2(existingRecord, incomingRecord, luvio, path);
8353
- if (existingRecord === undefined || equals$19(existingRecord, incomingRecord) === false) {
8355
+ if (existingRecord === undefined || equals$1a(existingRecord, incomingRecord) === false) {
8354
8356
  luvio.storePublish(key, incomingRecord);
8355
8357
  }
8356
8358
  return createLink$1(key);
@@ -8428,7 +8430,7 @@ const createRecordIngest = (fieldsTrie, optionalFieldsTrie, recordConflictMap) =
8428
8430
  const childNormalize = createChildRecordNormalize(fieldsTrie, optionalFieldsTrie, recordConflictMap);
8429
8431
  return (input, path, luvio, store, timestamp) => {
8430
8432
  if (process.env.NODE_ENV !== 'production') {
8431
- const validateError = validate$1X(input);
8433
+ const validateError = validate$1Z(input);
8432
8434
  if (validateError !== null) {
8433
8435
  throw validateError;
8434
8436
  }
@@ -8446,7 +8448,7 @@ const createRecordIngest = (fieldsTrie, optionalFieldsTrie, recordConflictMap) =
8446
8448
  existingRecord = store.readEntry(key);
8447
8449
  incomingRecord = merge$3(existingRecord, incomingRecord, luvio, path, recordConflictMap);
8448
8450
  if (existingRecord === undefined ||
8449
- equals$17(existingRecord, incomingRecord) === false ||
8451
+ equals$18(existingRecord, incomingRecord) === false ||
8450
8452
  // always publish if existing record has drafts
8451
8453
  existingRecord.drafts !==
8452
8454
  undefined) {
@@ -8456,7 +8458,7 @@ const createRecordIngest = (fieldsTrie, optionalFieldsTrie, recordConflictMap) =
8456
8458
  ttl: TTL$F,
8457
8459
  representationName: RepresentationType$_,
8458
8460
  namespace: keyPrefix,
8459
- version: VERSION$2E,
8461
+ version: VERSION$2F,
8460
8462
  ingestionTimestamp: timestamp,
8461
8463
  });
8462
8464
  return createLink$1(key);
@@ -8595,7 +8597,7 @@ function buildRecordSelector(luvio, recordId, fields, optionalFields) {
8595
8597
  kind: 'Fragment',
8596
8598
  private: ['eTag', 'weakEtag'],
8597
8599
  selections: buildSelectionFromFields(fields, optionalFields),
8598
- version: VERSION$2E,
8600
+ version: VERSION$2F,
8599
8601
  },
8600
8602
  variables: {},
8601
8603
  };
@@ -8682,7 +8684,7 @@ function isSingleBatchRecordResponse(response) {
8682
8684
  response.results.length === 1);
8683
8685
  }
8684
8686
 
8685
- const VERSION$2D = "98cce53b8d13b1883d001bbdaab24383";
8687
+ const VERSION$2E = "98cce53b8d13b1883d001bbdaab24383";
8686
8688
 
8687
8689
  const nonCachedErrors$8 = ObjectCreate$1(null);
8688
8690
  function ingestSuccessChildResourceParams$9(luvio, childResourceParamsArray, childEnvelopes, serverRequestCount = 0) {
@@ -8783,7 +8785,7 @@ function selectChildResourceParams$8(luvio, childResources, resourceParams) {
8783
8785
  node: {
8784
8786
  kind: 'Fragment',
8785
8787
  private: [],
8786
- version: VERSION$2D,
8788
+ version: VERSION$2E,
8787
8789
  },
8788
8790
  variables: {},
8789
8791
  });
package/dist/adsBridge.js CHANGED
@@ -367,4 +367,4 @@ function withAdsBridge(callback) {
367
367
  }
368
368
 
369
369
  export { instrument, withAdsBridge };
370
- // version: 1.322.0-6aa042602a
370
+ // version: 1.324.0-62e02d2ff9
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/lds-ads-bridge",
3
- "version": "1.322.0",
3
+ "version": "1.324.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,8 +30,8 @@
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.322.0",
34
- "@salesforce/lds-uiapi-record-utils-mobile": "^1.322.0"
33
+ "@salesforce/lds-adapters-uiapi": "^1.324.0",
34
+ "@salesforce/lds-uiapi-record-utils-mobile": "^1.324.0"
35
35
  },
36
36
  "volta": {
37
37
  "extends": "../../package.json"