@salesforce/lds-ads-bridge 1.360.1 → 1.362.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.
@@ -433,7 +433,7 @@ function createResourceParamsImpl(config, configMetadata) {
433
433
  }
434
434
  return resourceParams;
435
435
  }
436
- // engine version: 0.157.4-1c316582
436
+ // engine version: 0.158.1-2546b2c0
437
437
 
438
438
  /**
439
439
  * Copyright (c) 2022, Salesforce, Inc.,
@@ -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.360.1-509ca55373
484
+ // version: 1.362.0-5d2767de00
485
485
 
486
486
  /**
487
487
  * Returns true if the value acts like a Promise, i.e. has a "then" function,
@@ -5029,7 +5029,7 @@ function toSortedStringArray(value) {
5029
5029
  return undefined;
5030
5030
  }
5031
5031
 
5032
- const VERSION$2W = "d1e589a127fb1060c89070cdb6f500b2";
5032
+ const VERSION$2X = "d1e589a127fb1060c89070cdb6f500b2";
5033
5033
  function validate$21(obj, path = 'RecordTypeInfoRepresentation') {
5034
5034
  const v_error = (() => {
5035
5035
  if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
@@ -5063,10 +5063,10 @@ function validate$21(obj, path = 'RecordTypeInfoRepresentation') {
5063
5063
  })();
5064
5064
  return v_error === undefined ? null : v_error;
5065
5065
  }
5066
- const select$3B = function RecordTypeInfoRepresentationSelect() {
5066
+ const select$3C = function RecordTypeInfoRepresentationSelect() {
5067
5067
  return {
5068
5068
  kind: 'Fragment',
5069
- version: VERSION$2W,
5069
+ version: VERSION$2X,
5070
5070
  private: [],
5071
5071
  selections: [
5072
5072
  {
@@ -5121,7 +5121,7 @@ function equals$1c(existing, incoming) {
5121
5121
  return true;
5122
5122
  }
5123
5123
 
5124
- const VERSION$2V = "195d918987a35f45e1aa4dce9a11d8c5";
5124
+ const VERSION$2W = "2738fe8faf98ecd076d7c4df86fd5bf0";
5125
5125
  function validate$20(obj, path = 'FieldValueRepresentation') {
5126
5126
  const v_error = (() => {
5127
5127
  if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
@@ -5157,7 +5157,7 @@ function validate$20(obj, path = 'FieldValueRepresentation') {
5157
5157
  const path_value = path + '.value';
5158
5158
  let obj_value_union0 = null;
5159
5159
  const obj_value_union0_error = (() => {
5160
- if (typeof obj_value !== 'object') {
5160
+ if (typeof obj_value !== 'object' || Array.isArray(obj_value)) {
5161
5161
  return new TypeError('Expected "object" but received "' + typeof obj_value + '" (at "' + path_value + '")');
5162
5162
  }
5163
5163
  })();
@@ -5193,30 +5193,47 @@ function validate$20(obj, path = 'FieldValueRepresentation') {
5193
5193
  }
5194
5194
  let obj_value_union4 = null;
5195
5195
  const obj_value_union4_error = (() => {
5196
- if (obj_value !== null) {
5197
- return new TypeError('Expected "null" but received "' + typeof obj_value + '" (at "' + path_value + '")');
5196
+ if (!ArrayIsArray(obj_value)) {
5197
+ return new TypeError('Expected "array" but received "' + typeof obj_value + '" (at "' + path_value + '")');
5198
+ }
5199
+ for (let i = 0; i < obj_value.length; i++) {
5200
+ const obj_value_item = obj_value[i];
5201
+ const path_value_item = path_value + '[' + i + ']';
5202
+ if (typeof obj_value_item !== 'string') {
5203
+ return new TypeError('Expected "string" but received "' + typeof obj_value_item + '" (at "' + path_value_item + '")');
5204
+ }
5198
5205
  }
5199
5206
  })();
5200
5207
  if (obj_value_union4_error != null) {
5201
5208
  obj_value_union4 = obj_value_union4_error.message;
5202
5209
  }
5203
- if (obj_value_union0 && obj_value_union1 && obj_value_union2 && obj_value_union3 && obj_value_union4) {
5210
+ let obj_value_union5 = null;
5211
+ const obj_value_union5_error = (() => {
5212
+ if (obj_value !== null) {
5213
+ return new TypeError('Expected "null" but received "' + typeof obj_value + '" (at "' + path_value + '")');
5214
+ }
5215
+ })();
5216
+ if (obj_value_union5_error != null) {
5217
+ obj_value_union5 = obj_value_union5_error.message;
5218
+ }
5219
+ if (obj_value_union0 && obj_value_union1 && obj_value_union2 && obj_value_union3 && obj_value_union4 && obj_value_union5) {
5204
5220
  let message = 'Object doesn\'t match union (at "' + path_value + '")';
5205
5221
  message += '\n' + obj_value_union0.split('\n').map((line) => '\t' + line).join('\n');
5206
5222
  message += '\n' + obj_value_union1.split('\n').map((line) => '\t' + line).join('\n');
5207
5223
  message += '\n' + obj_value_union2.split('\n').map((line) => '\t' + line).join('\n');
5208
5224
  message += '\n' + obj_value_union3.split('\n').map((line) => '\t' + line).join('\n');
5209
5225
  message += '\n' + obj_value_union4.split('\n').map((line) => '\t' + line).join('\n');
5226
+ message += '\n' + obj_value_union5.split('\n').map((line) => '\t' + line).join('\n');
5210
5227
  return new TypeError(message);
5211
5228
  }
5212
5229
  })();
5213
5230
  return v_error === undefined ? null : v_error;
5214
5231
  }
5215
5232
  const RepresentationType$10 = 'FieldValueRepresentation';
5216
- const select$3A = function FieldValueRepresentationSelect() {
5233
+ const select$3B = function FieldValueRepresentationSelect() {
5217
5234
  return {
5218
5235
  kind: 'Fragment',
5219
- version: VERSION$2V,
5236
+ version: VERSION$2W,
5220
5237
  private: [],
5221
5238
  selections: [
5222
5239
  {
@@ -5224,10 +5241,10 @@ const select$3A = function FieldValueRepresentationSelect() {
5224
5241
  kind: 'Scalar'
5225
5242
  },
5226
5243
  {
5244
+ kind: 'Object',
5227
5245
  name: 'value',
5228
- kind: 'Link',
5229
5246
  nullable: true,
5230
- fragment: select$3y()
5247
+ // Complex union deep
5231
5248
  }
5232
5249
  ]
5233
5250
  };
@@ -5240,17 +5257,37 @@ function equals$1b(existing, incoming) {
5240
5257
  }
5241
5258
  const existing_value = existing.value;
5242
5259
  const incoming_value = incoming.value;
5243
- if (!(existing_value === incoming_value
5244
- || (existing_value != null &&
5245
- incoming_value != null &&
5246
- existing_value.__ref != null &&
5247
- incoming_value.__ref != null &&
5248
- existing_value.__ref === incoming_value.__ref))) {
5260
+ if (!((() => {
5261
+ if (existing_value === null || incoming_value === null) {
5262
+ return existing_value === incoming_value;
5263
+ }
5264
+ if (Array.isArray(existing_value) && Array.isArray(incoming_value)) {
5265
+ const equals_value_items = equalsArray(existing_value, incoming_value, (existing_value_item, incoming_value_item) => {
5266
+ if (!(existing_value_item === incoming_value_item)) {
5267
+ return false;
5268
+ }
5269
+ });
5270
+ if (equals_value_items === false) {
5271
+ return false;
5272
+ }
5273
+ }
5274
+ else {
5275
+ if (!(existing_value === incoming_value
5276
+ || (existing_value != null &&
5277
+ incoming_value != null &&
5278
+ existing_value.__ref != null &&
5279
+ incoming_value.__ref != null &&
5280
+ existing_value.__ref === incoming_value.__ref))) {
5281
+ return false;
5282
+ }
5283
+ }
5284
+ return true;
5285
+ })())) {
5249
5286
  return false;
5250
5287
  }
5251
5288
  return true;
5252
5289
  }
5253
- function getTypeCacheKeys$2v(rootKeySet, luvio, input, fullPathFactory) {
5290
+ function getTypeCacheKeys$2w(rootKeySet, luvio, input, fullPathFactory) {
5254
5291
  // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
5255
5292
  const rootKey = fullPathFactory();
5256
5293
  rootKeySet.set(rootKey, {
@@ -5258,13 +5295,13 @@ function getTypeCacheKeys$2v(rootKeySet, luvio, input, fullPathFactory) {
5258
5295
  representationName: RepresentationType$10,
5259
5296
  mergeable: false
5260
5297
  });
5261
- if (input.value !== null && typeof input.value === 'object') {
5262
- getTypeCacheKeys$2u(rootKeySet, luvio, input.value);
5298
+ if (!Array.isArray(input.value) && input.value !== null && typeof input.value === 'object') {
5299
+ getTypeCacheKeys$2v(rootKeySet, luvio, input.value);
5263
5300
  }
5264
5301
  }
5265
5302
 
5266
5303
  // we override the generated so we can set "mergeable: true" on the root key
5267
- const getTypeCacheKeys$2u = (rootKeySet, luvio, input, _fullPathFactory) => {
5304
+ const getTypeCacheKeys$2v = (rootKeySet, luvio, input, _fullPathFactory) => {
5268
5305
  // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
5269
5306
  const rootKey = keyBuilderFromType$D(luvio, input);
5270
5307
  rootKeySet.set(rootKey, {
@@ -5277,20 +5314,20 @@ const getTypeCacheKeys$2u = (rootKeySet, luvio, input, _fullPathFactory) => {
5277
5314
  const input_childRelationships_length = input_childRelationships_keys.length;
5278
5315
  for (let i = 0; i < input_childRelationships_length; i++) {
5279
5316
  const key = input_childRelationships_keys[i];
5280
- getTypeCacheKeys$2t(rootKeySet, luvio, input_childRelationships[key], () => rootKey + '__childRelationships' + '__' + key);
5317
+ getTypeCacheKeys$2u(rootKeySet, luvio, input_childRelationships[key], () => rootKey + '__childRelationships' + '__' + key);
5281
5318
  }
5282
5319
  const input_fields = input.fields;
5283
5320
  const input_fields_keys = keys$1(input_fields);
5284
5321
  const input_fields_length = input_fields_keys.length;
5285
5322
  for (let i = 0; i < input_fields_length; i++) {
5286
5323
  const key = input_fields_keys[i];
5287
- getTypeCacheKeys$2v(rootKeySet, luvio, input_fields[key], () => rootKey + '__fields__' + key);
5324
+ getTypeCacheKeys$2w(rootKeySet, luvio, input_fields[key], () => rootKey + '__fields__' + key);
5288
5325
  }
5289
5326
  return rootKeySet;
5290
5327
  };
5291
5328
 
5292
5329
  const TTL$G = 120000;
5293
- const VERSION$2U = "79cb5ac9f44542f683d00245fdfe500d";
5330
+ const VERSION$2V = "79cb5ac9f44542f683d00245fdfe500d";
5294
5331
  function validate$1$(obj, path = 'RecordCollectionRepresentation') {
5295
5332
  const v_error = (() => {
5296
5333
  if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
@@ -5444,7 +5481,7 @@ function validate$1$(obj, path = 'RecordCollectionRepresentation') {
5444
5481
  for (let i = 0; i < obj_records.length; i++) {
5445
5482
  const obj_records_item = obj_records[i];
5446
5483
  const path_records_item = path_records + '[' + i + ']';
5447
- if (typeof obj_records_item !== 'object') {
5484
+ if (typeof obj_records_item !== 'object' || Array.isArray(obj_records_item)) {
5448
5485
  return new TypeError('Expected "object" but received "' + typeof obj_records_item + '" (at "' + path_records_item + '")');
5449
5486
  }
5450
5487
  }
@@ -5458,7 +5495,7 @@ function normalize$T(input, existing, path, luvio, store, timestamp) {
5458
5495
  for (let i = 0; i < input_records.length; i++) {
5459
5496
  const input_records_item = input_records[i];
5460
5497
  let input_records_item_id = input_records_id + '__' + i;
5461
- input_records[i] = ingest$2p(input_records_item, {
5498
+ input_records[i] = ingest$2q(input_records_item, {
5462
5499
  fullPath: input_records_item_id,
5463
5500
  propertyName: i,
5464
5501
  parent: {
@@ -5471,10 +5508,10 @@ function normalize$T(input, existing, path, luvio, store, timestamp) {
5471
5508
  }
5472
5509
  return input;
5473
5510
  }
5474
- const select$3z = function RecordCollectionRepresentationSelect() {
5511
+ const select$3A = function RecordCollectionRepresentationSelect() {
5475
5512
  return {
5476
5513
  kind: 'Fragment',
5477
- version: VERSION$2U,
5514
+ version: VERSION$2V,
5478
5515
  private: [],
5479
5516
  selections: [
5480
5517
  {
@@ -5509,7 +5546,7 @@ const select$3z = function RecordCollectionRepresentationSelect() {
5509
5546
  name: 'records',
5510
5547
  kind: 'Link',
5511
5548
  plural: true,
5512
- fragment: select$3y()
5549
+ fragment: select$3z()
5513
5550
  }
5514
5551
  ]
5515
5552
  };
@@ -5562,7 +5599,7 @@ function equals$1a(existing, incoming) {
5562
5599
  }
5563
5600
  return true;
5564
5601
  }
5565
- const ingest$2q = function RecordCollectionRepresentationIngest(input, path, luvio, store, timestamp) {
5602
+ const ingest$2r = function RecordCollectionRepresentationIngest(input, path, luvio, store, timestamp) {
5566
5603
  if (process.env.NODE_ENV !== 'production') {
5567
5604
  const validateError = validate$1$(input);
5568
5605
  if (validateError !== null) {
@@ -5571,10 +5608,10 @@ const ingest$2q = function RecordCollectionRepresentationIngest(input, path, luv
5571
5608
  }
5572
5609
  const key = path.fullPath;
5573
5610
  const ttlToUse = TTL$G;
5574
- ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$T, "UiApi", VERSION$2U, RepresentationType$$, equals$1a);
5611
+ ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$T, "UiApi", VERSION$2V, RepresentationType$$, equals$1a);
5575
5612
  return createLink$1(key);
5576
5613
  };
5577
- function getTypeCacheKeys$2t(rootKeySet, luvio, input, fullPathFactory) {
5614
+ function getTypeCacheKeys$2u(rootKeySet, luvio, input, fullPathFactory) {
5578
5615
  // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
5579
5616
  const rootKey = fullPathFactory();
5580
5617
  rootKeySet.set(rootKey, {
@@ -5584,7 +5621,7 @@ function getTypeCacheKeys$2t(rootKeySet, luvio, input, fullPathFactory) {
5584
5621
  });
5585
5622
  const input_records_length = input.records.length;
5586
5623
  for (let i = 0; i < input_records_length; i++) {
5587
- getTypeCacheKeys$2u(rootKeySet, luvio, input.records[i]);
5624
+ getTypeCacheKeys$2v(rootKeySet, luvio, input.records[i]);
5588
5625
  }
5589
5626
  }
5590
5627
 
@@ -5599,7 +5636,7 @@ const keyBuilderFromType$E = function RecordRepresentationKeyBuilderFromType(luv
5599
5636
  };
5600
5637
 
5601
5638
  const TTL$F = 30000;
5602
- const VERSION$2T = "98c5b18512e48ca8d28727549507e4ba";
5639
+ const VERSION$2U = "98c5b18512e48ca8d28727549507e4ba";
5603
5640
  function validate$1_(obj, path = 'RecordRepresentation') {
5604
5641
  const v_error = (() => {
5605
5642
  if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
@@ -5620,7 +5657,7 @@ function validate$1_(obj, path = 'RecordRepresentation') {
5620
5657
  const key = obj_childRelationships_keys[i];
5621
5658
  const obj_childRelationships_prop = obj_childRelationships[key];
5622
5659
  const path_childRelationships_prop = path_childRelationships + '["' + key + '"]';
5623
- if (typeof obj_childRelationships_prop !== 'object') {
5660
+ if (typeof obj_childRelationships_prop !== 'object' || Array.isArray(obj_childRelationships_prop)) {
5624
5661
  return new TypeError('Expected "object" but received "' + typeof obj_childRelationships_prop + '" (at "' + path_childRelationships_prop + '")');
5625
5662
  }
5626
5663
  }
@@ -5639,7 +5676,7 @@ function validate$1_(obj, path = 'RecordRepresentation') {
5639
5676
  const key = obj_fields_keys[i];
5640
5677
  const obj_fields_prop = obj_fields[key];
5641
5678
  const path_fields_prop = path_fields + '["' + key + '"]';
5642
- if (typeof obj_fields_prop !== 'object') {
5679
+ if (typeof obj_fields_prop !== 'object' || Array.isArray(obj_fields_prop)) {
5643
5680
  return new TypeError('Expected "object" but received "' + typeof obj_fields_prop + '" (at "' + path_fields_prop + '")');
5644
5681
  }
5645
5682
  }
@@ -5790,14 +5827,14 @@ function validate$1_(obj, path = 'RecordRepresentation') {
5790
5827
  return v_error === undefined ? null : v_error;
5791
5828
  }
5792
5829
  const RepresentationType$_ = 'RecordRepresentation';
5793
- function keyBuilder$3M(luvio, config) {
5830
+ function keyBuilder$3N(luvio, config) {
5794
5831
  return keyPrefix + '::' + RepresentationType$_ + ':' + config.recordId;
5795
5832
  }
5796
5833
  function keyBuilderFromType$D(luvio, object) {
5797
5834
  const keyParams = {
5798
5835
  recordId: object.id
5799
5836
  };
5800
- return keyBuilder$3M(luvio, keyParams);
5837
+ return keyBuilder$3N(luvio, keyParams);
5801
5838
  }
5802
5839
  function dynamicNormalize$5(ingestParams) {
5803
5840
  return function normalize_dynamic(input, existing, path, luvio, store, timestamp) {
@@ -5842,11 +5879,11 @@ function dynamicNormalize$5(ingestParams) {
5842
5879
  return input;
5843
5880
  };
5844
5881
  }
5845
- const select$3y = function RecordRepresentationSelect() {
5846
- const { selections: RecordTypeInfoRepresentation__selections, opaque: RecordTypeInfoRepresentation__opaque, } = select$3B();
5882
+ const select$3z = function RecordRepresentationSelect() {
5883
+ const { selections: RecordTypeInfoRepresentation__selections, opaque: RecordTypeInfoRepresentation__opaque, } = select$3C();
5847
5884
  return {
5848
5885
  kind: 'Fragment',
5849
- version: VERSION$2T,
5886
+ version: VERSION$2U,
5850
5887
  private: [
5851
5888
  'eTag',
5852
5889
  'weakEtag'
@@ -5860,13 +5897,13 @@ const select$3y = function RecordRepresentationSelect() {
5860
5897
  name: 'childRelationships',
5861
5898
  kind: 'Link',
5862
5899
  map: true,
5863
- fragment: select$3z()
5900
+ fragment: select$3A()
5864
5901
  },
5865
5902
  {
5866
5903
  name: 'fields',
5867
5904
  kind: 'Link',
5868
5905
  map: true,
5869
- fragment: select$3A()
5906
+ fragment: select$3B()
5870
5907
  },
5871
5908
  {
5872
5909
  name: 'id',
@@ -5902,18 +5939,18 @@ const dynamicSelect$8 = function dynamicRecordRepresentationSelect(params) {
5902
5939
  name: 'childRelationships',
5903
5940
  kind: 'Link',
5904
5941
  map: true,
5905
- fragment: select$3z()
5942
+ fragment: select$3A()
5906
5943
  } : params.childRelationships;
5907
5944
  const fieldsPathSelection = params.fields === undefined ? {
5908
5945
  name: 'fields',
5909
5946
  kind: 'Link',
5910
5947
  map: true,
5911
- fragment: select$3A()
5948
+ fragment: select$3B()
5912
5949
  } : params.fields;
5913
- const { selections: RecordTypeInfoRepresentation__selections, opaque: RecordTypeInfoRepresentation__opaque, } = select$3B();
5950
+ const { selections: RecordTypeInfoRepresentation__selections, opaque: RecordTypeInfoRepresentation__opaque, } = select$3C();
5914
5951
  return {
5915
5952
  kind: 'Fragment',
5916
- version: VERSION$2T,
5953
+ version: VERSION$2U,
5917
5954
  private: [
5918
5955
  'eTag',
5919
5956
  'weakEtag'
@@ -7657,7 +7694,7 @@ function createPathSelection(propertyName, fieldDefinition) {
7657
7694
  kind: 'Fragment',
7658
7695
  private: ['eTag', 'weakEtag'],
7659
7696
  selections: createRecordSelection(childFieldDefinition),
7660
- version: VERSION$2T,
7697
+ version: VERSION$2U,
7661
7698
  },
7662
7699
  };
7663
7700
  }
@@ -7667,7 +7704,7 @@ function createPathSelection(propertyName, fieldDefinition) {
7667
7704
  required: childFieldDefinition.optional === true ? false : undefined,
7668
7705
  fragment: {
7669
7706
  kind: 'Fragment',
7670
- version: VERSION$2V,
7707
+ version: VERSION$2W,
7671
7708
  private: [],
7672
7709
  selections: [DISPLAY_VALUE_SELECTION, fieldValueSelection],
7673
7710
  },
@@ -7770,6 +7807,7 @@ function addScalarField(current, leafNodeFieldKey) {
7770
7807
  }
7771
7808
  }
7772
7809
  function extractTrackedFieldsToTrie(recordId, node, root, config, visitedRecordIds = {}, depth = 0) {
7810
+ var _a, _b;
7773
7811
  // Filter Error and null nodes
7774
7812
  if (!isGraphNode$1(node)) {
7775
7813
  return;
@@ -7808,7 +7846,7 @@ function extractTrackedFieldsToTrie(recordId, node, root, config, visitedRecordI
7808
7846
  continue;
7809
7847
  }
7810
7848
  const { maxDepth, onlyFetchLeafNodeIdAndName } = config;
7811
- if (field.isScalar('value') === false) {
7849
+ if (field.isScalar('value') === false && !Array.isArray((_a = field.data) === null || _a === void 0 ? void 0 : _a.value)) {
7812
7850
  if (depth + 1 > maxDepth) {
7813
7851
  if (onlyFetchLeafNodeIdAndName === true) {
7814
7852
  addScalarFieldId(current);
@@ -7845,7 +7883,7 @@ function extractTrackedFieldsToTrie(recordId, node, root, config, visitedRecordI
7845
7883
  addScalarFieldName(current);
7846
7884
  continue;
7847
7885
  }
7848
- if (field.scalar('value') === null) {
7886
+ if (field.scalar('value') === null && !Array.isArray((_b = field.data) === null || _b === void 0 ? void 0 : _b.value)) {
7849
7887
  continue;
7850
7888
  }
7851
7889
  }
@@ -7971,6 +8009,7 @@ function markMissingOptionalFields(record, optionalFields) {
7971
8009
  }
7972
8010
  }
7973
8011
  function _markMissingPath(record, path) {
8012
+ var _a;
7974
8013
  // Filter out Error and null nodes
7975
8014
  if (!isGraphNode$1(record)) {
7976
8015
  return;
@@ -7992,7 +8031,7 @@ function _markMissingPath(record, path) {
7992
8031
  return;
7993
8032
  }
7994
8033
  // if value is not a scalar, follow the link and mark it as missing
7995
- if (fieldValue.isScalar('value') === false) {
8034
+ if (fieldValue.isScalar('value') === false && !Array.isArray((_a = fieldValue.data) === null || _a === void 0 ? void 0 : _a.value)) {
7996
8035
  _markMissingPath(fieldValue
7997
8036
  .link('value')
7998
8037
  .follow(), path);
@@ -8070,6 +8109,7 @@ function isSuperRecordFieldTrie(a, b) {
8070
8109
  // This function sets fields that we are refreshing to pending
8071
8110
  // These values will go into the store
8072
8111
  function mergePendingFields(newRecord, oldRecord, existingNode) {
8112
+ var _a;
8073
8113
  const mergedFields = { ...newRecord.fields };
8074
8114
  const merged = { ...newRecord, fields: mergedFields };
8075
8115
  const existingFields = keys$1(oldRecord.fields);
@@ -8093,7 +8133,7 @@ function mergePendingFields(newRecord, oldRecord, existingNode) {
8093
8133
  .link(spanningFieldName);
8094
8134
  const field = fieldValueRep.follow();
8095
8135
  if (isGraphNode$1(field)) {
8096
- if (field.isScalar('value') === false) {
8136
+ if (field.isScalar('value') === false && !Array.isArray((_a = field.data) === null || _a === void 0 ? void 0 : _a.value)) {
8097
8137
  const record = field
8098
8138
  .link('value')
8099
8139
  .follow();
@@ -8177,7 +8217,7 @@ function mergeAndRefreshLowerVersionRecord(luvio, incoming, existing, incomingTr
8177
8217
  return existing;
8178
8218
  }
8179
8219
  function mergeRecordConflict(luvio, incoming, existing, recordConflictMap) {
8180
- const recordKey = keyBuilder$3M(luvio, {
8220
+ const recordKey = keyBuilder$3N(luvio, {
8181
8221
  recordId: incoming.id,
8182
8222
  });
8183
8223
  const incomingNode = luvio.wrapNormalizedGraphNode(incoming, recordKey);
@@ -8335,7 +8375,7 @@ function fixDisplayValue(existing, incoming, path) {
8335
8375
  function normalize$S(input, existing, path, luvio, store, timestamp, fieldsTrie, optionalFieldsTrie, recordConflictMap) {
8336
8376
  const input_value = input.value;
8337
8377
  const input_value_id = path.fullPath + '__value';
8338
- if (input_value !== null && typeof input_value === 'object') {
8378
+ if (input_value !== null && typeof input_value === 'object' && !Array.isArray(input_value)) {
8339
8379
  const ingest = createRecordIngest(fieldsTrie, optionalFieldsTrie, recordConflictMap);
8340
8380
  input.value = ingest(input_value, {
8341
8381
  fullPath: input_value_id,
@@ -8438,7 +8478,7 @@ function createFieldsIngestion(fieldsTrie, optionalFieldsTrie, recordConflictMap
8438
8478
  }
8439
8479
  function createChildRecordNormalize(fieldsTrie, optionalFieldsTrie, recordConflictMap) {
8440
8480
  return dynamicNormalize$5({
8441
- childRelationships: ingest$2q,
8481
+ childRelationships: ingest$2r,
8442
8482
  fields: createFieldsIngestion(fieldsTrie, optionalFieldsTrie, recordConflictMap),
8443
8483
  });
8444
8484
  }
@@ -8474,7 +8514,7 @@ const createRecordIngest = (fieldsTrie, optionalFieldsTrie, recordConflictMap) =
8474
8514
  ttl: TTL$F,
8475
8515
  representationName: RepresentationType$_,
8476
8516
  namespace: keyPrefix,
8477
- version: VERSION$2T,
8517
+ version: VERSION$2U,
8478
8518
  ingestionTimestamp: timestamp,
8479
8519
  });
8480
8520
  return createLink$1(key);
@@ -8571,13 +8611,13 @@ const createResourceRequest$1h = function getUiApiRecordsByRecordIdCreateResourc
8571
8611
  };
8572
8612
  };
8573
8613
 
8574
- function keyBuilder$3L(luvio, params) {
8575
- return keyBuilder$3M(luvio, {
8614
+ function keyBuilder$3M(luvio, params) {
8615
+ return keyBuilder$3N(luvio, {
8576
8616
  recordId: params.urlParams.recordId
8577
8617
  });
8578
8618
  }
8579
8619
  function getResponseCacheKeys$17(storeKeyMap, luvio, resourceParams, response) {
8580
- getTypeCacheKeys$2u(storeKeyMap, luvio, response);
8620
+ getTypeCacheKeys$2v(storeKeyMap, luvio, response);
8581
8621
  }
8582
8622
  function createResourceRequest$1g(config) {
8583
8623
  const headers = {};
@@ -8608,12 +8648,12 @@ const createResourceParams$15 = /*#__PURE__*/ createResourceParams(getRecord_Con
8608
8648
  // used by getUiApiRecordsBatchByRecordIds#selectChildResourceParams
8609
8649
  function buildRecordSelector(luvio, recordId, fields, optionalFields) {
8610
8650
  return {
8611
- recordId: keyBuilder$3M(luvio, { recordId }),
8651
+ recordId: keyBuilder$3N(luvio, { recordId }),
8612
8652
  node: {
8613
8653
  kind: 'Fragment',
8614
8654
  private: ['eTag', 'weakEtag'],
8615
8655
  selections: buildSelectionFromFields(fields, optionalFields),
8616
- version: VERSION$2T,
8656
+ version: VERSION$2U,
8617
8657
  },
8618
8658
  variables: {},
8619
8659
  };
@@ -8627,7 +8667,7 @@ function buildSnapshotRefresh$5(luvio, config) {
8627
8667
  function prepareRequest$7(luvio, config) {
8628
8668
  const { recordId, fields } = config;
8629
8669
  // Should this go into the coersion logic?
8630
- const key = keyBuilder$3L(luvio, createResourceParams$15(config));
8670
+ const key = keyBuilder$3M(luvio, createResourceParams$15(config));
8631
8671
  const allTrackedFields = getTrackedFields(key, luvio.getNode(key), {
8632
8672
  maxDepth: configurationForRestAdapters.getTrackedFieldDepthOnCacheMiss(),
8633
8673
  onlyFetchLeafNodeIdAndName: configurationForRestAdapters.getTrackedFieldLeafNodeIdAndNameOnly(),
@@ -8700,7 +8740,7 @@ function isSingleBatchRecordResponse(response) {
8700
8740
  response.results.length === 1);
8701
8741
  }
8702
8742
 
8703
- const VERSION$2S = "98cce53b8d13b1883d001bbdaab24383";
8743
+ const VERSION$2T = "98cce53b8d13b1883d001bbdaab24383";
8704
8744
 
8705
8745
  const nonCachedErrors$8 = ObjectCreate$1(null);
8706
8746
  function ingestSuccessChildResourceParams$9(luvio, childResourceParamsArray, childEnvelopes, serverRequestCount = 0) {
@@ -8710,7 +8750,7 @@ function ingestSuccessChildResourceParams$9(luvio, childResourceParamsArray, chi
8710
8750
  const now = Date.now();
8711
8751
  for (let index = 0, len = childResourceParamsArray.length; index < len; index += 1) {
8712
8752
  const childResourceParams = childResourceParamsArray[index];
8713
- const childKey = keyBuilder$3L(luvio, childResourceParams);
8753
+ const childKey = keyBuilder$3M(luvio, childResourceParams);
8714
8754
  const result = childEnvelopes[index];
8715
8755
  const { statusCode: childStatusCode, result: childBody } = result;
8716
8756
  if (childStatusCode === 200) {
@@ -8797,11 +8837,11 @@ function selectChildResourceParams$8(luvio, childResources, resourceParams) {
8797
8837
  read: (reader) => {
8798
8838
  // Top-level 404 lookup
8799
8839
  const compositeSnapshot = luvio.storeLookup({
8800
- recordId: keyBuilder$3K(luvio, resourceParams),
8840
+ recordId: keyBuilder$3L(luvio, resourceParams),
8801
8841
  node: {
8802
8842
  kind: 'Fragment',
8803
8843
  private: [],
8804
- version: VERSION$2S,
8844
+ version: VERSION$2T,
8805
8845
  },
8806
8846
  variables: {},
8807
8847
  });
@@ -8821,7 +8861,7 @@ function selectChildResourceParams$8(luvio, childResources, resourceParams) {
8821
8861
  reader.enterPath(i);
8822
8862
  reader.enterPath(envelopeBodyPath);
8823
8863
  const childResource = childResources[i];
8824
- const childKey = keyBuilder$3L(luvio, childResource);
8864
+ const childKey = keyBuilder$3M(luvio, childResource);
8825
8865
  const isMissingDataBeforeChildRead = reader.getIsDataMissing();
8826
8866
  const childSnapshot = reader.read(buildRecordSelector(luvio, childResource.urlParams.recordId, childResource.queryParams.fields || [], childResource.queryParams.optionalFields || []));
8827
8867
  reader.exitPath();
@@ -8921,7 +8961,7 @@ function createChildResourceParams$c(resourceParams) {
8921
8961
  }
8922
8962
  return childConfigs;
8923
8963
  }
8924
- function keyBuilder$3K(luvio, params) {
8964
+ function keyBuilder$3L(luvio, params) {
8925
8965
  return keyPrefix + '::BatchRepresentation:(' + 'childRelationships:' + params.queryParams.childRelationships + ',' + 'fields:' + params.queryParams.fields + ',' + 'layoutTypes:' + params.queryParams.layoutTypes + ',' + 'modes:' + params.queryParams.modes + ',' + 'optionalFields:' + params.queryParams.optionalFields + ',' + 'pageSize:' + params.queryParams.pageSize + ',' + 'updateMru:' + params.queryParams.updateMru + ',' + 'recordIds:' + params.urlParams.recordIds + ')';
8926
8966
  }
8927
8967
  function getResponseCacheKeys$16(keys, luvio, resourceParams, response) {
@@ -8941,7 +8981,7 @@ function getResponseCacheKeys$16(keys, luvio, resourceParams, response) {
8941
8981
  getResponseCacheKeys$17(keys, luvio, childResourceParams, childBody);
8942
8982
  }
8943
8983
  else if (childStatusCode === 404) {
8944
- const childKey = keyBuilder$3L(luvio, childResourceParams);
8984
+ const childKey = keyBuilder$3M(luvio, childResourceParams);
8945
8985
  keys.set(childKey, {
8946
8986
  namespace: keyPrefix,
8947
8987
  representationName: RepresentationType$_,
@@ -8951,7 +8991,7 @@ function getResponseCacheKeys$16(keys, luvio, resourceParams, response) {
8951
8991
  }
8952
8992
  }
8953
8993
  function ingestError$Q(luvio, params, error, snapshotRefresh) {
8954
- const key = keyBuilder$3K(luvio, params);
8994
+ const key = keyBuilder$3L(luvio, params);
8955
8995
  const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
8956
8996
  luvio.storeIngestError(key, errorSnapshot);
8957
8997
  return errorSnapshot;
@@ -9040,7 +9080,7 @@ function onFetchResponseSuccess$S(luvio, config, resourceParams, response, serve
9040
9080
  }
9041
9081
  }
9042
9082
  const snapshotStateFulfilled = 'Fulfilled';
9043
- const key = keyBuilder$3K(luvio, resourceParams);
9083
+ const key = keyBuilder$3L(luvio, resourceParams);
9044
9084
  const { childSnapshotData, seenRecords } = ingestSuccessChildResourceParams$9(luvio, childResourceParamsArray, childEnvelopes, serverRequestCount);
9045
9085
  const snapshot = {
9046
9086
  recordId: key,
@@ -9110,7 +9150,7 @@ function resolveConflict(luvio, map) {
9110
9150
  buildNetworkSnapshot$1a(luvio, config, map.serverRequestCount);
9111
9151
  }
9112
9152
  }
9113
- const ingest$2p = (input, path, luvio, store, timestamp) => {
9153
+ const ingest$2q = (input, path, luvio, store, timestamp) => {
9114
9154
  const conflictMap = {
9115
9155
  conflicts: {},
9116
9156
  serverRequestCount: 0,
@@ -9188,7 +9228,7 @@ const getMruListUi_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationCon
9188
9228
  },
9189
9229
  });
9190
9230
  const RepresentationType$T = 'ObjectInfoRepresentation';
9191
- function keyBuilder$3v(luvio, config) {
9231
+ function keyBuilder$3w(luvio, config) {
9192
9232
  return keyPrefix + '::' + RepresentationType$T + ':' + config.apiName;
9193
9233
  }
9194
9234
 
@@ -9230,12 +9270,12 @@ ObjectCreate$1(null);
9230
9270
 
9231
9271
  ObjectCreate$1(null);
9232
9272
 
9233
- const VERSION$2b = "8d2032474fb4fabdf5cf4042be9042d9";
9234
- const select$2p = function WorkStepPicklistValueAttributeRepresentationSelect() {
9235
- const { selections: AbstractPicklistValueAttributesRepresentationSelections } = select$2l();
9273
+ const VERSION$2c = "8d2032474fb4fabdf5cf4042be9042d9";
9274
+ const select$2q = function WorkStepPicklistValueAttributeRepresentationSelect() {
9275
+ const { selections: AbstractPicklistValueAttributesRepresentationSelections } = select$2m();
9236
9276
  return {
9237
9277
  kind: 'Fragment',
9238
- version: VERSION$2b,
9278
+ version: VERSION$2c,
9239
9279
  private: [],
9240
9280
  selections: [
9241
9281
  ...AbstractPicklistValueAttributesRepresentationSelections,
@@ -9251,12 +9291,12 @@ const select$2p = function WorkStepPicklistValueAttributeRepresentationSelect()
9251
9291
  };
9252
9292
  };
9253
9293
 
9254
- const VERSION$2a = "53893a219bc0888951863f2c44317cac";
9255
- const select$2o = function LeadStatusPicklistValueAttributesRepresentationSelect() {
9256
- const { selections: AbstractPicklistValueAttributesRepresentationSelections } = select$2l();
9294
+ const VERSION$2b = "53893a219bc0888951863f2c44317cac";
9295
+ const select$2p = function LeadStatusPicklistValueAttributesRepresentationSelect() {
9296
+ const { selections: AbstractPicklistValueAttributesRepresentationSelections } = select$2m();
9257
9297
  return {
9258
9298
  kind: 'Fragment',
9259
- version: VERSION$2a,
9299
+ version: VERSION$2b,
9260
9300
  private: [],
9261
9301
  selections: [
9262
9302
  ...AbstractPicklistValueAttributesRepresentationSelections,
@@ -9268,12 +9308,12 @@ const select$2o = function LeadStatusPicklistValueAttributesRepresentationSelect
9268
9308
  };
9269
9309
  };
9270
9310
 
9271
- const VERSION$29 = "4818ec07c499784571c1012ead048c88";
9272
- const select$2n = function CaseStatusPicklistValueAttributesRepresentationSelect() {
9273
- const { selections: AbstractPicklistValueAttributesRepresentationSelections } = select$2l();
9311
+ const VERSION$2a = "4818ec07c499784571c1012ead048c88";
9312
+ const select$2o = function CaseStatusPicklistValueAttributesRepresentationSelect() {
9313
+ const { selections: AbstractPicklistValueAttributesRepresentationSelections } = select$2m();
9274
9314
  return {
9275
9315
  kind: 'Fragment',
9276
- version: VERSION$29,
9316
+ version: VERSION$2a,
9277
9317
  private: [],
9278
9318
  selections: [
9279
9319
  ...AbstractPicklistValueAttributesRepresentationSelections,
@@ -9285,12 +9325,12 @@ const select$2n = function CaseStatusPicklistValueAttributesRepresentationSelect
9285
9325
  };
9286
9326
  };
9287
9327
 
9288
- const VERSION$28 = "950a3a962acbd2b128f937d4c055a9d6";
9289
- const select$2m = function OpportunityStagePicklistValueAttributesRepresentationSelect() {
9290
- const { selections: AbstractPicklistValueAttributesRepresentationSelections } = select$2l();
9328
+ const VERSION$29 = "950a3a962acbd2b128f937d4c055a9d6";
9329
+ const select$2n = function OpportunityStagePicklistValueAttributesRepresentationSelect() {
9330
+ const { selections: AbstractPicklistValueAttributesRepresentationSelections } = select$2m();
9291
9331
  return {
9292
9332
  kind: 'Fragment',
9293
- version: VERSION$28,
9333
+ version: VERSION$29,
9294
9334
  private: [],
9295
9335
  selections: [
9296
9336
  ...AbstractPicklistValueAttributesRepresentationSelections,
@@ -9321,12 +9361,12 @@ var DiscriminatorValues$4;
9321
9361
  DiscriminatorValues["CaseStatus"] = "CaseStatus";
9322
9362
  DiscriminatorValues["OpportunityStage"] = "OpportunityStage";
9323
9363
  })(DiscriminatorValues$4 || (DiscriminatorValues$4 = {}));
9324
- const VERSION$27 = "bd523b2343366edfc25a2dbee2c4e986";
9364
+ const VERSION$28 = "bd523b2343366edfc25a2dbee2c4e986";
9325
9365
  const selectChildren$2 = function AbstractPicklistValueAttributesRepresentationSelectChildren() {
9326
- const workStepPicklistValueAttributeRepresentationSelections = select$2p();
9327
- const leadStatusPicklistValueAttributesRepresentationSelections = select$2o();
9328
- const caseStatusPicklistValueAttributesRepresentationSelections = select$2n();
9329
- const opportunityStagePicklistValueAttributesRepresentationSelections = select$2m();
9366
+ const workStepPicklistValueAttributeRepresentationSelections = select$2q();
9367
+ const leadStatusPicklistValueAttributesRepresentationSelections = select$2p();
9368
+ const caseStatusPicklistValueAttributesRepresentationSelections = select$2o();
9369
+ const opportunityStagePicklistValueAttributesRepresentationSelections = select$2n();
9330
9370
  return {
9331
9371
  kind: 'Fragment',
9332
9372
  union: true,
@@ -9339,10 +9379,10 @@ const selectChildren$2 = function AbstractPicklistValueAttributesRepresentationS
9339
9379
  }
9340
9380
  };
9341
9381
  };
9342
- const select$2l = function AbstractPicklistValueAttributesRepresentationSelect() {
9382
+ const select$2m = function AbstractPicklistValueAttributesRepresentationSelect() {
9343
9383
  return {
9344
9384
  kind: 'Fragment',
9345
- version: VERSION$27,
9385
+ version: VERSION$28,
9346
9386
  private: [],
9347
9387
  selections: [
9348
9388
  {
@@ -9353,12 +9393,12 @@ const select$2l = function AbstractPicklistValueAttributesRepresentationSelect()
9353
9393
  };
9354
9394
  };
9355
9395
 
9356
- const VERSION$26 = "9e2a16a80378487f557124c771201cf9";
9357
- const select$2k = function PicklistValueRepresentationSelect() {
9396
+ const VERSION$27 = "9e2a16a80378487f557124c771201cf9";
9397
+ const select$2l = function PicklistValueRepresentationSelect() {
9358
9398
  const AbstractPicklistValueAttributesRepresentation__unionSelections = selectChildren$2();
9359
9399
  return {
9360
9400
  kind: 'Fragment',
9361
- version: VERSION$26,
9401
+ version: VERSION$27,
9362
9402
  private: [],
9363
9403
  selections: [
9364
9404
  {
@@ -9385,12 +9425,12 @@ const select$2k = function PicklistValueRepresentationSelect() {
9385
9425
  ]
9386
9426
  };
9387
9427
  };
9388
- const VERSION$25 = "0a361a49370acb4c6a31721a2057649a";
9389
- const select$2j = function PicklistValuesRepresentationSelect() {
9390
- const { selections: PicklistValueRepresentation__selections, opaque: PicklistValueRepresentation__opaque, } = select$2k();
9428
+ const VERSION$26 = "0a361a49370acb4c6a31721a2057649a";
9429
+ const select$2k = function PicklistValuesRepresentationSelect() {
9430
+ const { selections: PicklistValueRepresentation__selections, opaque: PicklistValueRepresentation__opaque, } = select$2l();
9391
9431
  return {
9392
9432
  kind: 'Fragment',
9393
- version: VERSION$25,
9433
+ version: VERSION$26,
9394
9434
  private: [
9395
9435
  'eTag'
9396
9436
  ],
@@ -9420,7 +9460,7 @@ const select$2j = function PicklistValuesRepresentationSelect() {
9420
9460
  };
9421
9461
  };
9422
9462
 
9423
- select$2j().selections;
9463
+ select$2k().selections;
9424
9464
 
9425
9465
  var DiscriminatorValues$3;
9426
9466
  (function (DiscriminatorValues) {
@@ -9477,7 +9517,7 @@ function isGraphNode(node) {
9477
9517
  return node !== null && node.type === 'Node';
9478
9518
  }
9479
9519
  function isSpanningRecord(fieldValue) {
9480
- return fieldValue !== null && typeof fieldValue === 'object';
9520
+ return fieldValue !== null && typeof fieldValue === 'object' && !Array.isArray(fieldValue);
9481
9521
  }
9482
9522
  function isStoreKeyRecordId(key) {
9483
9523
  return key.indexOf(RECORD_ID_PREFIX) > -1 && key.indexOf(RECORD_FIELDS_KEY_JUNCTION) === -1;
@@ -9511,7 +9551,7 @@ function getShallowRecordDenormalized(luvio, storeRecordId) {
9511
9551
  }
9512
9552
  const fieldObject = fieldsNode.object(fieldName);
9513
9553
  const { displayValue, value } = fieldObject.retrieve();
9514
- if (fieldObject.isScalar('value')) {
9554
+ if (fieldObject.isScalar('value') || Array.isArray(fieldObject.data?.value)) {
9515
9555
  fieldCopy = {
9516
9556
  displayValue: displayValue,
9517
9557
  value: value,
@@ -9569,7 +9609,7 @@ function getShallowRecord(luvio, storeRecordId) {
9569
9609
  continue;
9570
9610
  }
9571
9611
  const { displayValue, value } = fieldNode.retrieve();
9572
- if (fieldNode.isScalar('value')) {
9612
+ if (fieldNode.isScalar('value') || Array.isArray(fieldNode.data?.value)) {
9573
9613
  fieldCopy = {
9574
9614
  displayValue: displayValue,
9575
9615
  value: value,
@@ -9602,7 +9642,7 @@ function getShallowRecord(luvio, storeRecordId) {
9602
9642
  */
9603
9643
  function getObjectMetadata(luvio, record) {
9604
9644
  const { data: objectInfo } = luvio.storeLookup({
9605
- recordId: keyBuilder$3v(luvio, { apiName: record.apiName }),
9645
+ recordId: keyBuilder$3w(luvio, { apiName: record.apiName }),
9606
9646
  node: {
9607
9647
  kind: 'Fragment',
9608
9648
  private: ['eTag'],
@@ -9643,7 +9683,7 @@ function getObjectMetadata(luvio, record) {
9643
9683
  function fixRecordTypes(luvio, record) {
9644
9684
  // non-master record types should always be correct
9645
9685
  if (record.recordTypeId === MAIN_RECORD_TYPE_ID) {
9646
- const key = keyBuilder$3M(luvio, { recordId: record.id });
9686
+ const key = keyBuilder$3N(luvio, { recordId: record.id });
9647
9687
  const recordNode = luvio.getNode(key);
9648
9688
  if (isGraphNode(recordNode) && recordNode.scalar('recordTypeId') !== MAIN_RECORD_TYPE_ID) {
9649
9689
  // ignore bogus incoming record type information & keep what we have
@@ -9719,7 +9759,7 @@ class AdsBridge {
9719
9759
  fixRecordTypes(luvio, recordCopy);
9720
9760
  const recordIngest = this.recordRepresentationIngestOverride !== undefined
9721
9761
  ? this.recordRepresentationIngestOverride
9722
- : ingest$2p;
9762
+ : ingest$2q;
9723
9763
  luvio.storeIngest(INGEST_KEY, recordIngest, recordCopy);
9724
9764
  }
9725
9765
  }
@@ -9733,7 +9773,7 @@ class AdsBridge {
9733
9773
  */
9734
9774
  evict(recordId) {
9735
9775
  const { luvio } = this;
9736
- const key = keyBuilder$3M(luvio, { recordId });
9776
+ const key = keyBuilder$3N(luvio, { recordId });
9737
9777
  return this.lockLdsRecordEmit(() => {
9738
9778
  luvio.storeEvict(key);
9739
9779
  luvio.storeBroadcast();
@@ -9748,7 +9788,7 @@ class AdsBridge {
9748
9788
  */
9749
9789
  getTrackedFieldsForRecord(recordId) {
9750
9790
  const { luvio } = this;
9751
- const storeRecordId = keyBuilder$3M(luvio, { recordId });
9791
+ const storeRecordId = keyBuilder$3N(luvio, { recordId });
9752
9792
  const recordNode = luvio.getNode(storeRecordId);
9753
9793
  if (!isGraphNode(recordNode)) {
9754
9794
  return Promise.resolve([]);
package/dist/adsBridge.js CHANGED
@@ -53,7 +53,7 @@ function isGraphNode(node) {
53
53
  return node !== null && node.type === 'Node';
54
54
  }
55
55
  function isSpanningRecord(fieldValue) {
56
- return fieldValue !== null && typeof fieldValue === 'object';
56
+ return fieldValue !== null && typeof fieldValue === 'object' && !Array.isArray(fieldValue);
57
57
  }
58
58
  function isStoreKeyRecordId(key) {
59
59
  return key.indexOf(RECORD_ID_PREFIX) > -1 && key.indexOf(RECORD_FIELDS_KEY_JUNCTION) === -1;
@@ -87,7 +87,7 @@ function getShallowRecordDenormalized(luvio, storeRecordId) {
87
87
  }
88
88
  const fieldObject = fieldsNode.object(fieldName);
89
89
  const { displayValue, value } = fieldObject.retrieve();
90
- if (fieldObject.isScalar('value')) {
90
+ if (fieldObject.isScalar('value') || Array.isArray(fieldObject.data?.value)) {
91
91
  fieldCopy = {
92
92
  displayValue: displayValue,
93
93
  value: value,
@@ -145,7 +145,7 @@ function getShallowRecord(luvio, storeRecordId) {
145
145
  continue;
146
146
  }
147
147
  const { displayValue, value } = fieldNode.retrieve();
148
- if (fieldNode.isScalar('value')) {
148
+ if (fieldNode.isScalar('value') || Array.isArray(fieldNode.data?.value)) {
149
149
  fieldCopy = {
150
150
  displayValue: displayValue,
151
151
  value: value,
@@ -435,4 +435,4 @@ function withAdsBridge(callback) {
435
435
  }
436
436
 
437
437
  export { instrument, withAdsBridge };
438
- // version: 1.360.1-509ca55373
438
+ // version: 1.362.0-5d2767de00
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/lds-ads-bridge",
3
- "version": "1.360.1",
3
+ "version": "1.362.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.360.1",
34
- "@salesforce/lds-runtime-mobile": "^1.360.1",
35
- "@salesforce/lds-uiapi-record-utils-mobile": "^1.360.1"
33
+ "@salesforce/lds-adapters-uiapi": "^1.362.0",
34
+ "@salesforce/lds-runtime-mobile": "^1.362.0",
35
+ "@salesforce/lds-uiapi-record-utils-mobile": "^1.362.0"
36
36
  },
37
37
  "volta": {
38
38
  "extends": "../../package.json"
@@ -42,7 +42,7 @@
42
42
  "path": "./dist/adsBridge.js",
43
43
  "maxSize": {
44
44
  "none": "17 kB",
45
- "min": "5.5 kB",
45
+ "min": "5.51 kB",
46
46
  "compressed": "4 kB"
47
47
  }
48
48
  }
@@ -725,6 +725,44 @@ describe('AdsBridge', () => {
725
725
  expect(timerMetricAddDurationSpy).toHaveBeenCalledTimes(1);
726
726
  });
727
727
 
728
+ it('emits when a record is ingested with array values', () => {
729
+ const { bridge, luvio } = createBridge();
730
+
731
+ const fn = jest.fn();
732
+ bridge.receiveFromLdsCallback = fn;
733
+
734
+ addRecord(
735
+ luvio,
736
+ createRecord({
737
+ id: '123456',
738
+ apiName: 'Test__c',
739
+ fields: {
740
+ Id: { displayValue: null, value: ['123456'] },
741
+ },
742
+ })
743
+ );
744
+
745
+ expect(fn).toHaveBeenCalledTimes(1);
746
+ expect(fn).toHaveBeenCalledWith(
747
+ {
748
+ '123456': {
749
+ Test__c: {
750
+ isPrimary: true,
751
+ record: expect.objectContaining({
752
+ id: '123456',
753
+ apiName: 'Test__c',
754
+ fields: {
755
+ Id: { displayValue: null, value: ['123456'] },
756
+ },
757
+ }),
758
+ },
759
+ },
760
+ },
761
+ expect.any(Object)
762
+ );
763
+ expect(timerMetricAddDurationSpy).toHaveBeenCalledTimes(1);
764
+ });
765
+
728
766
  it('does not emit when a record is evicted from luvio', () => {
729
767
  const { bridge, luvio } = createBridge();
730
768
 
package/src/ads-bridge.ts CHANGED
@@ -98,9 +98,9 @@ function isGraphNode<T, U>(node: ProxyGraphNode<T, U>): node is GraphNode<T, U>
98
98
  }
99
99
 
100
100
  function isSpanningRecord(
101
- fieldValue: null | string | number | boolean | RecordRepresentation
101
+ fieldValue: null | string | string[] | number | boolean | RecordRepresentation
102
102
  ): fieldValue is RecordRepresentation {
103
- return fieldValue !== null && typeof fieldValue === 'object';
103
+ return fieldValue !== null && typeof fieldValue === 'object' && !Array.isArray(fieldValue);
104
104
  }
105
105
 
106
106
  function isStoreKeyRecordId(key: string) {
@@ -149,10 +149,10 @@ function getShallowRecordDenormalized(
149
149
 
150
150
  const fieldObject = fieldsNode.object(fieldName);
151
151
  const { displayValue, value } = fieldObject.retrieve();
152
- if (fieldObject.isScalar('value')) {
152
+ if (fieldObject.isScalar('value') || Array.isArray(fieldObject.data?.value)) {
153
153
  fieldCopy = {
154
154
  displayValue: displayValue,
155
- value: value as string | number | boolean | null,
155
+ value: value as string | number | boolean | string[] | null,
156
156
  };
157
157
  } else {
158
158
  const spanningRecordLink = fieldObject.link<
@@ -225,10 +225,10 @@ function getShallowRecord(luvio: Luvio, storeRecordId: string): RecordRepresenta
225
225
  }
226
226
 
227
227
  const { displayValue, value } = fieldNode.retrieve();
228
- if (fieldNode.isScalar('value')) {
228
+ if (fieldNode.isScalar('value') || Array.isArray(fieldNode.data?.value)) {
229
229
  fieldCopy = {
230
230
  displayValue: displayValue,
231
- value: value as string | number | boolean | null,
231
+ value: value as string | number | boolean | string[] | null,
232
232
  };
233
233
  } else {
234
234
  const spanningRecordLink = fieldNode.link<