@salesforce/lwc-adapters-uiapi 1.126.0 → 1.128.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.
Files changed (2) hide show
  1. package/dist/main.js +135 -44
  2. package/package.json +1 -1
package/dist/main.js CHANGED
@@ -7842,7 +7842,7 @@ function assignMetadataLink(entry, metadataKey) {
7842
7842
  entry['__metadata'] = createLink$1(metadataKey);
7843
7843
  }
7844
7844
 
7845
- const VERSION$1_ = "3b339f50551a63986bb2aa52572d2953";
7845
+ const VERSION$1_ = "275ae22194003d1e53f548b81219c5cb";
7846
7846
  function validate$1E(obj, path = 'ListColumnRepresentation') {
7847
7847
  const v_error = (() => {
7848
7848
  if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
@@ -7858,6 +7858,32 @@ function validate$1E(obj, path = 'ListColumnRepresentation') {
7858
7858
  if (typeof obj_label !== 'string') {
7859
7859
  return new TypeError('Expected "string" but received "' + typeof obj_label + '" (at "' + path_label + '")');
7860
7860
  }
7861
+ const obj_lookupId = obj.lookupId;
7862
+ const path_lookupId = path + '.lookupId';
7863
+ let obj_lookupId_union0 = null;
7864
+ const obj_lookupId_union0_error = (() => {
7865
+ if (typeof obj_lookupId !== 'string') {
7866
+ return new TypeError('Expected "string" but received "' + typeof obj_lookupId + '" (at "' + path_lookupId + '")');
7867
+ }
7868
+ })();
7869
+ if (obj_lookupId_union0_error != null) {
7870
+ obj_lookupId_union0 = obj_lookupId_union0_error.message;
7871
+ }
7872
+ let obj_lookupId_union1 = null;
7873
+ const obj_lookupId_union1_error = (() => {
7874
+ if (obj_lookupId !== null) {
7875
+ return new TypeError('Expected "null" but received "' + typeof obj_lookupId + '" (at "' + path_lookupId + '")');
7876
+ }
7877
+ })();
7878
+ if (obj_lookupId_union1_error != null) {
7879
+ obj_lookupId_union1 = obj_lookupId_union1_error.message;
7880
+ }
7881
+ if (obj_lookupId_union0 && obj_lookupId_union1) {
7882
+ let message = 'Object doesn\'t match union (at "' + path_lookupId + '")';
7883
+ message += '\n' + obj_lookupId_union0.split('\n').map((line) => '\t' + line).join('\n');
7884
+ message += '\n' + obj_lookupId_union1.split('\n').map((line) => '\t' + line).join('\n');
7885
+ return new TypeError(message);
7886
+ }
7861
7887
  const obj_sortable = obj.sortable;
7862
7888
  const path_sortable = path + '.sortable';
7863
7889
  if (typeof obj_sortable !== 'boolean') {
@@ -7880,6 +7906,10 @@ const select$2u = function ListColumnRepresentationSelect() {
7880
7906
  name: 'label',
7881
7907
  kind: 'Scalar'
7882
7908
  },
7909
+ {
7910
+ name: 'lookupId',
7911
+ kind: 'Scalar'
7912
+ },
7883
7913
  {
7884
7914
  name: 'sortable',
7885
7915
  kind: 'Scalar'
@@ -12720,7 +12750,7 @@ function isSingleBatchRecordResponse(response) {
12720
12750
 
12721
12751
  const VERSION$1Q = "98cce53b8d13b1883d001bbdaab24383";
12722
12752
 
12723
- const nonCachedErrors$6 = ObjectCreate$1(null);
12753
+ const nonCachedErrors$7 = ObjectCreate$1(null);
12724
12754
  function ingestSuccessChildResourceParams$6(luvio, childResourceParamsArray, childEnvelopes, serverRequestCount = 0) {
12725
12755
  const childSnapshotDataResponses = [];
12726
12756
  let seenRecords = new StoreKeySet();
@@ -12785,14 +12815,14 @@ function ingestSuccessChildResourceParams$6(luvio, childResourceParamsArray, chi
12785
12815
  }
12786
12816
  // track non-cached responses so rebuilds work properly
12787
12817
  if (childStatusCode !== 404 && childStatusCode !== 200) {
12788
- nonCachedErrors$6[childKey] = {
12818
+ nonCachedErrors$7[childKey] = {
12789
12819
  expiration: now + TTL$A,
12790
12820
  response: childBody,
12791
12821
  status: childStatusCode,
12792
12822
  };
12793
12823
  }
12794
12824
  else {
12795
- delete nonCachedErrors$6[childKey];
12825
+ delete nonCachedErrors$7[childKey];
12796
12826
  }
12797
12827
  }
12798
12828
  ObjectFreeze$1(childSnapshotDataResponses);
@@ -12806,7 +12836,7 @@ function ingestSuccessChildResourceParams$6(luvio, childResourceParamsArray, chi
12806
12836
  };
12807
12837
  }
12808
12838
 
12809
- function selectChildResourceParams$6(luvio, childResources, resourceParams) {
12839
+ function selectChildResourceParams$7(luvio, childResources, resourceParams) {
12810
12840
  const envelopeBodyPath = 'result';
12811
12841
  const envelopeStatusCodePath = 'statusCode';
12812
12842
  const envelopePath = 'results';
@@ -12887,7 +12917,7 @@ function selectChildResourceParams$6(luvio, childResources, resourceParams) {
12887
12917
  // has non-cached errors (since the top-level composite
12888
12918
  // snapshot will look like an Unfulfilled snapshot
12889
12919
  // instead of an error snapshot).
12890
- const nonCachedError = nonCachedErrors$6[childKey];
12920
+ const nonCachedError = nonCachedErrors$7[childKey];
12891
12921
  if (nonCachedError === undefined ||
12892
12922
  nonCachedError.expiration < timestamp) {
12893
12923
  reader.markMissingLink(childKey);
@@ -13049,7 +13079,7 @@ function createChildResourceParams$8(config) {
13049
13079
  function adapterFragment$H(luvio, config) {
13050
13080
  const childResources = createChildResourceParams$8(config);
13051
13081
  const resourceParams = createResourceParams$V(config);
13052
- return selectChildResourceParams$6(luvio, childResources, resourceParams);
13082
+ return selectChildResourceParams$7(luvio, childResources, resourceParams);
13053
13083
  }
13054
13084
 
13055
13085
  function onFetchResponseSuccess$L(luvio, config, resourceParams, response, serverRequestCount = 0) {
@@ -19601,7 +19631,12 @@ function getLayoutMapAndObjectInfo(recordId, data) {
19601
19631
  const { apiName } = record;
19602
19632
  const objectInfo = objectInfos[apiName];
19603
19633
  const recordTypeId = getRecordTypeId$2(record);
19604
- const layoutMap = layouts[apiName][recordTypeId];
19634
+ // W-12697744 - Return an empty layoutMap if the entity does not have a layout.
19635
+ // Temp fix until we can mimic the server behavior for non-layoutable entities.
19636
+ let layoutMap = {};
19637
+ if (hasOwnProperty.call(layouts, apiName)) {
19638
+ layoutMap = layouts[apiName][recordTypeId];
19639
+ }
19605
19640
  return {
19606
19641
  layoutMap,
19607
19642
  objectInfo,
@@ -26853,7 +26888,7 @@ function createResourceRequest$D(config) {
26853
26888
 
26854
26889
  const VERSION$1r = "fb049a56cac04c6d0c0969a650749448";
26855
26890
 
26856
- const nonCachedErrors$5 = ObjectCreate$1(null);
26891
+ const nonCachedErrors$6 = ObjectCreate$1(null);
26857
26892
  function createChildResourceParams$6(resourceParams) {
26858
26893
  const childConfigs = [];
26859
26894
  const { queryParams } = resourceParams;
@@ -26869,7 +26904,7 @@ function createChildResourceParams$6(resourceParams) {
26869
26904
  }
26870
26905
  return childConfigs;
26871
26906
  }
26872
- function selectChildResourceParams$5(luvio, childResources, resourceParams) {
26907
+ function selectChildResourceParams$6(luvio, childResources, resourceParams) {
26873
26908
  const envelopeBodyPath = 'result';
26874
26909
  const envelopeStatusCodePath = 'statusCode';
26875
26910
  const envelopePath = 'results';
@@ -26952,7 +26987,7 @@ function selectChildResourceParams$5(luvio, childResources, resourceParams) {
26952
26987
  // has non-cached errors (since the top-level composite
26953
26988
  // snapshot will look like an Unfulfilled snapshot
26954
26989
  // instead of an error snapshot).
26955
- const nonCachedError = nonCachedErrors$5[childKey];
26990
+ const nonCachedError = nonCachedErrors$6[childKey];
26956
26991
  if (nonCachedError === undefined ||
26957
26992
  nonCachedError.expiration < reader.getTimeStamp()) {
26958
26993
  reader.markMissingLink(childKey);
@@ -26991,7 +27026,7 @@ function selectChildResourceParams$5(luvio, childResources, resourceParams) {
26991
27026
  }
26992
27027
  function select$1G(luvio, resourceParams) {
26993
27028
  const childResources = createChildResourceParams$6(resourceParams);
26994
- return selectChildResourceParams$5(luvio, childResources, resourceParams);
27029
+ return selectChildResourceParams$6(luvio, childResources, resourceParams);
26995
27030
  }
26996
27031
  function keyBuilder$1J(luvio, params) {
26997
27032
  return (keyPrefix +
@@ -27087,14 +27122,14 @@ function ingestSuccessChildResourceParams$5(luvio, childResourceParamsArray, chi
27087
27122
  }
27088
27123
  // track non-cached responses so rebuilds work properly
27089
27124
  if (childStatusCode !== 404 && childStatusCode !== 200) {
27090
- nonCachedErrors$5[childKey] = {
27125
+ nonCachedErrors$6[childKey] = {
27091
27126
  expiration: now + TTL$C,
27092
27127
  response: childBody,
27093
27128
  status: childStatusCode,
27094
27129
  };
27095
27130
  }
27096
27131
  else {
27097
- delete nonCachedErrors$5[childKey];
27132
+ delete nonCachedErrors$6[childKey];
27098
27133
  }
27099
27134
  }
27100
27135
  ObjectFreeze$1(childSnapshotDataResponses);
@@ -27763,7 +27798,7 @@ const getNavItemsAdapterFactory = (luvio) => function UiApi__getNavItems(untrust
27763
27798
  buildCachedSnapshotCachePolicy$q, buildNetworkSnapshotCachePolicy$r);
27764
27799
  };
27765
27800
 
27766
- const nonCachedErrors$4 = ObjectCreate$1(null);
27801
+ const nonCachedErrors$5 = ObjectCreate$1(null);
27767
27802
  function createChildResourceParams$5(resourceParams) {
27768
27803
  const childConfigs = [];
27769
27804
  for (let index = 0, len = resourceParams.urlParams.objectApiNames.length; index < len; index += 1) {
@@ -27776,7 +27811,7 @@ function createChildResourceParams$5(resourceParams) {
27776
27811
  }
27777
27812
  return childConfigs;
27778
27813
  }
27779
- function selectChildResourceParams$4(luvio, childResources, resourceParams) {
27814
+ function selectChildResourceParams$5(luvio, childResources, resourceParams) {
27780
27815
  const envelopeBodyPath = 'result';
27781
27816
  const envelopeStatusCodePath = 'statusCode';
27782
27817
  const envelopePath = 'results';
@@ -27847,7 +27882,7 @@ function selectChildResourceParams$4(luvio, childResources, resourceParams) {
27847
27882
  // has non-cached errors (since the top-level composite
27848
27883
  // snapshot will look like an Unfulfilled snapshot
27849
27884
  // instead of an error snapshot).
27850
- const nonCachedError = nonCachedErrors$4[childKey];
27885
+ const nonCachedError = nonCachedErrors$5[childKey];
27851
27886
  if (nonCachedError === undefined || nonCachedError.expiration < reader.getTimeStamp()) {
27852
27887
  reader.markMissingLink(childKey);
27853
27888
  }
@@ -27885,7 +27920,7 @@ function selectChildResourceParams$4(luvio, childResources, resourceParams) {
27885
27920
  }
27886
27921
  function select$1D(luvio, resourceParams) {
27887
27922
  const childResources = createChildResourceParams$5(resourceParams);
27888
- return selectChildResourceParams$4(luvio, childResources, resourceParams);
27923
+ return selectChildResourceParams$5(luvio, childResources, resourceParams);
27889
27924
  }
27890
27925
  function keyBuilder$1E(luvio, params) {
27891
27926
  return keyPrefix + '::SimplifiedBatchRepresentation:(' + 'objectApiNames:' + params.urlParams.objectApiNames + ')';
@@ -27971,10 +28006,10 @@ function ingestSuccessChildResourceParams$4(luvio, childResourceParamsArray, chi
27971
28006
  }
27972
28007
  // track non-cached responses so rebuilds work properly
27973
28008
  if (childStatusCode !== 404 && childStatusCode !== 200) {
27974
- nonCachedErrors$4[childKey] = { expiration: now + TTL$y, response: childBody, status: childStatusCode };
28009
+ nonCachedErrors$5[childKey] = { expiration: now + TTL$y, response: childBody, status: childStatusCode };
27975
28010
  }
27976
28011
  else {
27977
- delete nonCachedErrors$4[childKey];
28012
+ delete nonCachedErrors$5[childKey];
27978
28013
  }
27979
28014
  }
27980
28015
  ObjectFreeze$1(childSnapshotDataResponses);
@@ -31602,7 +31637,7 @@ function createResourceRequest$v(config) {
31602
31637
  };
31603
31638
  }
31604
31639
 
31605
- const nonCachedErrors$3 = ObjectCreate$1(null);
31640
+ const nonCachedErrors$4 = ObjectCreate$1(null);
31606
31641
  function createChildResourceParams$4(resourceParams) {
31607
31642
  const childConfigs = [];
31608
31643
  for (let index = 0, len = resourceParams.urlParams.relatedListNames.length; index < len; index += 1) {
@@ -31619,7 +31654,7 @@ function createChildResourceParams$4(resourceParams) {
31619
31654
  }
31620
31655
  return childConfigs;
31621
31656
  }
31622
- function selectChildResourceParams$3(luvio, childResources, resourceParams) {
31657
+ function selectChildResourceParams$4(luvio, childResources, resourceParams) {
31623
31658
  const envelopeBodyPath = 'result';
31624
31659
  const envelopeStatusCodePath = 'statusCode';
31625
31660
  const envelopePath = 'results';
@@ -31690,7 +31725,7 @@ function selectChildResourceParams$3(luvio, childResources, resourceParams) {
31690
31725
  // has non-cached errors (since the top-level composite
31691
31726
  // snapshot will look like an Unfulfilled snapshot
31692
31727
  // instead of an error snapshot).
31693
- const nonCachedError = nonCachedErrors$3[childKey];
31728
+ const nonCachedError = nonCachedErrors$4[childKey];
31694
31729
  if (nonCachedError === undefined) {
31695
31730
  reader.markMissingLink(childKey);
31696
31731
  }
@@ -31728,7 +31763,7 @@ function selectChildResourceParams$3(luvio, childResources, resourceParams) {
31728
31763
  }
31729
31764
  function select$1g(luvio, resourceParams) {
31730
31765
  const childResources = createChildResourceParams$4(resourceParams);
31731
- return selectChildResourceParams$3(luvio, childResources, resourceParams);
31766
+ return selectChildResourceParams$4(luvio, childResources, resourceParams);
31732
31767
  }
31733
31768
  function keyBuilder$1s(luvio, params) {
31734
31769
  return keyPrefix + '::BatchRelatedListCountRepresentation:(' + 'maxCount:' + params.queryParams.maxCount + ',' + 'parentRecordId:' + params.urlParams.parentRecordId + ',' + 'relatedListNames:' + params.urlParams.relatedListNames + ')';
@@ -31813,10 +31848,10 @@ function ingestSuccessChildResourceParams$3(luvio, childResourceParamsArray, chi
31813
31848
  }
31814
31849
  // track non-cached responses so rebuilds work properly
31815
31850
  if (childStatusCode !== 404 && childStatusCode !== 200) {
31816
- nonCachedErrors$3[childKey] = { response: childBody, status: childStatusCode };
31851
+ nonCachedErrors$4[childKey] = { response: childBody, status: childStatusCode };
31817
31852
  }
31818
31853
  else {
31819
- delete nonCachedErrors$3[childKey];
31854
+ delete nonCachedErrors$4[childKey];
31820
31855
  }
31821
31856
  }
31822
31857
  ObjectFreeze$1(childSnapshotDataResponses);
@@ -32735,8 +32770,8 @@ function createChildResourceParams$3(resourceParams) {
32735
32770
  return childConfigs;
32736
32771
  }
32737
32772
 
32738
- const nonCachedErrors$2 = ObjectCreate$1(null);
32739
- function selectChildResourceParams$2(luvio, childResources, resourceParams) {
32773
+ const nonCachedErrors$3 = ObjectCreate$1(null);
32774
+ function selectChildResourceParams$3(luvio, childResources, resourceParams) {
32740
32775
  const envelopeBodyPath = 'result';
32741
32776
  const envelopeStatusCodePath = 'statusCode';
32742
32777
  const envelopePath = 'results';
@@ -32807,7 +32842,7 @@ function selectChildResourceParams$2(luvio, childResources, resourceParams) {
32807
32842
  // has non-cached errors (since the top-level composite
32808
32843
  // snapshot will look like an Unfulfilled snapshot
32809
32844
  // instead of an error snapshot).
32810
- const nonCachedError = nonCachedErrors$2[childKey];
32845
+ const nonCachedError = nonCachedErrors$3[childKey];
32811
32846
  if (nonCachedError === undefined || nonCachedError.expiration < reader.getTimeStamp()) {
32812
32847
  reader.markMissingLink(childKey);
32813
32848
  }
@@ -32845,7 +32880,7 @@ function selectChildResourceParams$2(luvio, childResources, resourceParams) {
32845
32880
  }
32846
32881
  function select$1d(luvio, resourceParams) {
32847
32882
  const childResources = createChildResourceParams$3(resourceParams);
32848
- return selectChildResourceParams$2(luvio, childResources, resourceParams);
32883
+ return selectChildResourceParams$3(luvio, childResources, resourceParams);
32849
32884
  }
32850
32885
  function keyBuilder$1n(luvio, params) {
32851
32886
  return keyPrefix + '::RelatedListInfoBatchRepresentation:(' + 'recordTypeId:' + params.queryParams.recordTypeId + ',' + 'parentObjectApiName:' + params.urlParams.parentObjectApiName + ',' + 'relatedListNames:' + params.urlParams.relatedListNames + ')';
@@ -32931,10 +32966,10 @@ function ingestSuccessChildResourceParams$2(luvio, childResourceParamsArray, chi
32931
32966
  }
32932
32967
  // track non-cached responses so rebuilds work properly
32933
32968
  if (childStatusCode !== 404 && childStatusCode !== 200) {
32934
- nonCachedErrors$2[childKey] = { expiration: now + TTL$h, response: childBody, status: childStatusCode };
32969
+ nonCachedErrors$3[childKey] = { expiration: now + TTL$h, response: childBody, status: childStatusCode };
32935
32970
  }
32936
32971
  else {
32937
- delete nonCachedErrors$2[childKey];
32972
+ delete nonCachedErrors$3[childKey];
32938
32973
  }
32939
32974
  }
32940
32975
  ObjectFreeze$1(childSnapshotDataResponses);
@@ -33980,7 +34015,7 @@ function createResourceRequest$p(config) {
33980
34015
  };
33981
34016
  }
33982
34017
 
33983
- const nonCachedErrors$1 = ObjectCreate$1(null);
34018
+ const nonCachedErrors$2 = ObjectCreate$1(null);
33984
34019
  function createChildResourceParams$2(resourceParams) {
33985
34020
  const childConfigs = [];
33986
34021
  for (let index = 0, len = resourceParams.urlParams.preferencesIds.length; index < len; index += 1) {
@@ -33993,7 +34028,7 @@ function createChildResourceParams$2(resourceParams) {
33993
34028
  }
33994
34029
  return childConfigs;
33995
34030
  }
33996
- function selectChildResourceParams$1(luvio, childResources, resourceParams) {
34031
+ function selectChildResourceParams$2(luvio, childResources, resourceParams) {
33997
34032
  const envelopeBodyPath = 'result';
33998
34033
  const envelopeStatusCodePath = 'statusCode';
33999
34034
  const envelopePath = 'results';
@@ -34064,7 +34099,7 @@ function selectChildResourceParams$1(luvio, childResources, resourceParams) {
34064
34099
  // has non-cached errors (since the top-level composite
34065
34100
  // snapshot will look like an Unfulfilled snapshot
34066
34101
  // instead of an error snapshot).
34067
- const nonCachedError = nonCachedErrors$1[childKey];
34102
+ const nonCachedError = nonCachedErrors$2[childKey];
34068
34103
  if (nonCachedError === undefined || nonCachedError.expiration < reader.getTimeStamp()) {
34069
34104
  reader.markMissingLink(childKey);
34070
34105
  }
@@ -34102,7 +34137,7 @@ function selectChildResourceParams$1(luvio, childResources, resourceParams) {
34102
34137
  }
34103
34138
  function select$17(luvio, resourceParams) {
34104
34139
  const childResources = createChildResourceParams$2(resourceParams);
34105
- return selectChildResourceParams$1(luvio, childResources, resourceParams);
34140
+ return selectChildResourceParams$2(luvio, childResources, resourceParams);
34106
34141
  }
34107
34142
  function keyBuilder$1f(luvio, params) {
34108
34143
  return keyPrefix + '::RelatedListPreferencesBatchRepresentation:(' + 'preferencesIds:' + params.urlParams.preferencesIds + ')';
@@ -34188,10 +34223,10 @@ function ingestSuccessChildResourceParams$1(luvio, childResourceParamsArray, chi
34188
34223
  }
34189
34224
  // track non-cached responses so rebuilds work properly
34190
34225
  if (childStatusCode !== 404 && childStatusCode !== 200) {
34191
- nonCachedErrors$1[childKey] = { expiration: now + TTL$g, response: childBody, status: childStatusCode };
34226
+ nonCachedErrors$2[childKey] = { expiration: now + TTL$g, response: childBody, status: childStatusCode };
34192
34227
  }
34193
34228
  else {
34194
- delete nonCachedErrors$1[childKey];
34229
+ delete nonCachedErrors$2[childKey];
34195
34230
  }
34196
34231
  }
34197
34232
  ObjectFreeze$1(childSnapshotDataResponses);
@@ -35405,6 +35440,8 @@ function createResourceRequest$m(config) {
35405
35440
  };
35406
35441
  }
35407
35442
 
35443
+ // Copied from generated resource
35444
+ const nonCachedErrors$1 = ObjectCreate$1(null);
35408
35445
  const createChildResourceParams$1 = (resourceParams) => {
35409
35446
  const childConfigs = [];
35410
35447
  for (let index = 0, len = resourceParams.body.relatedListParameters.length; index < len; index += 1) {
@@ -35439,8 +35476,7 @@ const createChildResourceParams$1 = (resourceParams) => {
35439
35476
  // HUGE BLOCK OF COPY PASTED CODE:
35440
35477
  // WE NEED TO DO THIS SO THAT THE ADAPTER CAN USE ONLY OUR OVERRIDE FILE
35441
35478
  // PLEASE DO NOT CHANGE ANYTHING HERE...
35442
- function select$14(luvio, resourceParams) {
35443
- const childResources = createChildResourceParams$1(resourceParams);
35479
+ function selectChildResourceParams$1(luvio, childResources, resourceParams) {
35444
35480
  const envelopeBodyPath = 'result';
35445
35481
  const envelopeStatusCodePath = 'statusCode';
35446
35482
  const envelopePath = 'results';
@@ -35449,21 +35485,38 @@ function select$14(luvio, resourceParams) {
35449
35485
  reader: true,
35450
35486
  synthetic: true,
35451
35487
  read: (reader) => {
35488
+ // Top-level 404 lookup
35489
+ const result = reader.storeLookup(keyBuilder$1a(luvio, resourceParams));
35490
+ if (result.state === reader.StoreResolveResultState.Error &&
35491
+ result.value.status === 404) {
35492
+ return {
35493
+ state: 'Error',
35494
+ value: result.value,
35495
+ };
35496
+ }
35452
35497
  const sink = {};
35453
35498
  reader.enterPath(envelopePath);
35454
35499
  const results = [];
35455
35500
  for (let i = 0, len = childResources.length; i < len; i += 1) {
35456
35501
  reader.enterPath(i);
35502
+ reader.enterPath(envelopeBodyPath);
35457
35503
  const childResource = childResources[i];
35458
35504
  const childKey = keyBuilder$1b(luvio, childResource);
35459
35505
  const childFragment = select$15(luvio, childResource);
35506
+ const isMissingDataBeforeChildRead = reader.getIsDataMissing();
35460
35507
  const childSnapshot = reader.read({
35461
35508
  recordId: childKey,
35462
35509
  node: childFragment,
35463
35510
  variables: {},
35464
35511
  });
35512
+ reader.exitPath();
35465
35513
  const childSink = {};
35514
+ reader.markSeenId(childKey);
35466
35515
  switch (childSnapshot.state) {
35516
+ case 'Stale':
35517
+ reader.markStale();
35518
+ // Stale needs envelope bodies filled in so don't break
35519
+ // eslint-disable-next-line no-fallthrough
35467
35520
  case 'Fulfilled':
35468
35521
  reader.enterPath(envelopeStatusCodePath);
35469
35522
  reader.assignScalar(envelopeStatusCodePath, childSink, 200);
@@ -35483,14 +35536,45 @@ function select$14(luvio, resourceParams) {
35483
35536
  reader.exitPath();
35484
35537
  break;
35485
35538
  case 'Unfulfilled':
35486
- reader.markMissing();
35539
+ // if child snapshot doesn't have any data then
35540
+ // that means the child record key is missing
35541
+ if (childSnapshot.data === undefined) {
35542
+ if (reader.isRebuilding() === false) {
35543
+ // not a rebuild, mark as missing and move on
35544
+ reader.markMissingLink(childKey);
35545
+ break;
35546
+ }
35547
+ // On rebuilds we have to check if there is a non-cached
35548
+ // error that we know about. If we don't do this then
35549
+ // rebuilds will go into endless refresh loop if a child
35550
+ // has non-cached errors (since the top-level composite
35551
+ // snapshot will look like an Unfulfilled snapshot
35552
+ // instead of an error snapshot).
35553
+ const nonCachedError = nonCachedErrors$1[childKey];
35554
+ if (nonCachedError === undefined ||
35555
+ nonCachedError.expiration < reader.getTimeStamp()) {
35556
+ reader.markMissingLink(childKey);
35557
+ }
35558
+ else {
35559
+ // if this child error was the only reason the reader
35560
+ // is marked as missing then we want to undo that
35561
+ if (isMissingDataBeforeChildRead === false) {
35562
+ reader.unMarkMissing();
35563
+ }
35564
+ // put status code and body into reader path
35565
+ const { response: nonCachedBody, status: nonCachedStatus } = nonCachedError;
35566
+ reader.enterPath(envelopeStatusCodePath);
35567
+ reader.assignScalar(envelopeStatusCodePath, childSink, nonCachedStatus);
35568
+ reader.exitPath();
35569
+ reader.enterPath(envelopeBodyPath);
35570
+ reader.assignNonScalar(childSink, envelopeBodyPath, nonCachedBody);
35571
+ reader.exitPath();
35572
+ }
35573
+ }
35487
35574
  break;
35488
35575
  case 'Pending':
35489
35576
  reader.markPending();
35490
35577
  break;
35491
- case 'Stale':
35492
- reader.markStale();
35493
- break;
35494
35578
  }
35495
35579
  ObjectFreeze$1(childSink);
35496
35580
  ArrayPrototypePush.call(results, childSink);
@@ -35503,6 +35587,13 @@ function select$14(luvio, resourceParams) {
35503
35587
  },
35504
35588
  };
35505
35589
  }
35590
+ // HUGE BLOCK OF COPY PASTED CODE:
35591
+ // WE NEED TO DO THIS SO THAT THE ADAPTER CAN USE ONLY OUR OVERRIDE FILE
35592
+ // PLEASE DO NOT CHANGE ANYTHING HERE...
35593
+ function select$14(luvio, resourceParams) {
35594
+ const childResources = createChildResourceParams$1(resourceParams);
35595
+ return selectChildResourceParams$1(luvio, childResources, resourceParams);
35596
+ }
35506
35597
  function keyBuilder$1a(luvio, params) {
35507
35598
  return (keyPrefix +
35508
35599
  '::' +
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/lwc-adapters-uiapi",
3
- "version": "1.126.0",
3
+ "version": "1.128.0",
4
4
  "license": "SEE LICENSE IN LICENSE.txt",
5
5
  "description": "UIAPI adapters with LWC bindings",
6
6
  "module": "dist/main.js",