@salesforce/lds-worker-api 1.127.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.
@@ -761,4 +761,4 @@ if (process.env.NODE_ENV !== 'production') {
761
761
  }
762
762
 
763
763
  export { createPrimingSession, draftManager, draftQueue, executeAdapter, executeMutatingAdapter, getImperativeAdapterNames, invokeAdapter, invokeAdapterWithDraftToReplace, invokeAdapterWithMetadata, nimbusDraftQueue, setMetadataTTL, setUiApiRecordTTL, subscribeToAdapter };
764
- // version: 1.127.0-48f9732df
764
+ // version: 1.128.0-7bdcf55d3
@@ -3776,7 +3776,7 @@ function withDefaultLuvio(callback) {
3776
3776
  }
3777
3777
  callbacks.push(callback);
3778
3778
  }
3779
- // version: 1.127.0-48f9732df
3779
+ // version: 1.128.0-7bdcf55d3
3780
3780
 
3781
3781
  // TODO [TD-0081508]: once that TD is fulfilled we can probably change this file
3782
3782
  function instrumentAdapter$1(createFunction, _metadata) {
@@ -15200,7 +15200,7 @@ function parseAndVisit(source) {
15200
15200
  updateReferenceMapWithKnownKey(ast, luvioDocumentNode);
15201
15201
  return luvioDocumentNode;
15202
15202
  }
15203
- // version: 1.127.0-48f9732df
15203
+ // version: 1.128.0-7bdcf55d3
15204
15204
 
15205
15205
  function unwrap(data) {
15206
15206
  // The lwc-luvio bindings import a function from lwc called "unwrap".
@@ -16113,7 +16113,7 @@ function createGraphQLWireAdapterConstructor(luvio, adapter, metadata, astResolv
16113
16113
  const { apiFamily, name } = metadata;
16114
16114
  return createGraphQLWireAdapterConstructor$1(adapter, `${apiFamily}.${name}`, luvio, astResolver);
16115
16115
  }
16116
- // version: 1.127.0-48f9732df
16116
+ // version: 1.128.0-7bdcf55d3
16117
16117
 
16118
16118
  /**
16119
16119
  * Copyright (c) 2022, Salesforce, Inc.,
@@ -16609,7 +16609,7 @@ function assignMetadataLink$1(entry, metadataKey) {
16609
16609
  entry['__metadata'] = createLink$3(metadataKey);
16610
16610
  }
16611
16611
 
16612
- const VERSION$1d = "3b339f50551a63986bb2aa52572d2953";
16612
+ const VERSION$1d = "275ae22194003d1e53f548b81219c5cb";
16613
16613
  const select$1H = function ListColumnRepresentationSelect() {
16614
16614
  return {
16615
16615
  kind: 'Fragment',
@@ -16624,6 +16624,10 @@ const select$1H = function ListColumnRepresentationSelect() {
16624
16624
  name: 'label',
16625
16625
  kind: 'Scalar'
16626
16626
  },
16627
+ {
16628
+ name: 'lookupId',
16629
+ kind: 'Scalar'
16630
+ },
16627
16631
  {
16628
16632
  name: 'sortable',
16629
16633
  kind: 'Scalar'
@@ -20399,7 +20403,7 @@ function isSingleBatchRecordResponse(response) {
20399
20403
 
20400
20404
  const VERSION$13 = "98cce53b8d13b1883d001bbdaab24383";
20401
20405
 
20402
- const nonCachedErrors$5 = ObjectCreate$1$1(null);
20406
+ const nonCachedErrors$6 = ObjectCreate$1$1(null);
20403
20407
  function ingestSuccessChildResourceParams$5(luvio, childResourceParamsArray, childEnvelopes, serverRequestCount = 0) {
20404
20408
  const childSnapshotDataResponses = [];
20405
20409
  let seenRecords = new StoreKeySet();
@@ -20464,14 +20468,14 @@ function ingestSuccessChildResourceParams$5(luvio, childResourceParamsArray, chi
20464
20468
  }
20465
20469
  // track non-cached responses so rebuilds work properly
20466
20470
  if (childStatusCode !== 404 && childStatusCode !== 200) {
20467
- nonCachedErrors$5[childKey] = {
20471
+ nonCachedErrors$6[childKey] = {
20468
20472
  expiration: now + TTL$v,
20469
20473
  response: childBody,
20470
20474
  status: childStatusCode,
20471
20475
  };
20472
20476
  }
20473
20477
  else {
20474
- delete nonCachedErrors$5[childKey];
20478
+ delete nonCachedErrors$6[childKey];
20475
20479
  }
20476
20480
  }
20477
20481
  ObjectFreeze$1$1(childSnapshotDataResponses);
@@ -20485,7 +20489,7 @@ function ingestSuccessChildResourceParams$5(luvio, childResourceParamsArray, chi
20485
20489
  };
20486
20490
  }
20487
20491
 
20488
- function selectChildResourceParams$5(luvio, childResources, resourceParams) {
20492
+ function selectChildResourceParams$6(luvio, childResources, resourceParams) {
20489
20493
  const envelopeBodyPath = 'result';
20490
20494
  const envelopeStatusCodePath = 'statusCode';
20491
20495
  const envelopePath = 'results';
@@ -20566,7 +20570,7 @@ function selectChildResourceParams$5(luvio, childResources, resourceParams) {
20566
20570
  // has non-cached errors (since the top-level composite
20567
20571
  // snapshot will look like an Unfulfilled snapshot
20568
20572
  // instead of an error snapshot).
20569
- const nonCachedError = nonCachedErrors$5[childKey];
20573
+ const nonCachedError = nonCachedErrors$6[childKey];
20570
20574
  if (nonCachedError === undefined ||
20571
20575
  nonCachedError.expiration < timestamp) {
20572
20576
  reader.markMissingLink(childKey);
@@ -20723,7 +20727,7 @@ function createChildResourceParams$7(config) {
20723
20727
  function adapterFragment$C(luvio, config) {
20724
20728
  const childResources = createChildResourceParams$7(config);
20725
20729
  const resourceParams = createResourceParams$S(config);
20726
- return selectChildResourceParams$5(luvio, childResources, resourceParams);
20730
+ return selectChildResourceParams$6(luvio, childResources, resourceParams);
20727
20731
  }
20728
20732
 
20729
20733
  function onFetchResponseSuccess$G(luvio, config, resourceParams, response, serverRequestCount = 0) {
@@ -25255,7 +25259,12 @@ function getLayoutMapAndObjectInfo(recordId, data) {
25255
25259
  const { apiName } = record;
25256
25260
  const objectInfo = objectInfos[apiName];
25257
25261
  const recordTypeId = getRecordTypeId$2(record);
25258
- const layoutMap = layouts[apiName][recordTypeId];
25262
+ // W-12697744 - Return an empty layoutMap if the entity does not have a layout.
25263
+ // Temp fix until we can mimic the server behavior for non-layoutable entities.
25264
+ let layoutMap = {};
25265
+ if (hasOwnProperty$1.call(layouts, apiName)) {
25266
+ layoutMap = layouts[apiName][recordTypeId];
25267
+ }
25259
25268
  return {
25260
25269
  layoutMap,
25261
25270
  objectInfo,
@@ -31056,7 +31065,7 @@ function createResourceRequest$A(config) {
31056
31065
 
31057
31066
  const VERSION$G$1 = "fb049a56cac04c6d0c0969a650749448";
31058
31067
 
31059
- const nonCachedErrors$4 = ObjectCreate$1$1(null);
31068
+ const nonCachedErrors$5 = ObjectCreate$1$1(null);
31060
31069
  function createChildResourceParams$5(resourceParams) {
31061
31070
  const childConfigs = [];
31062
31071
  const { queryParams } = resourceParams;
@@ -31072,7 +31081,7 @@ function createChildResourceParams$5(resourceParams) {
31072
31081
  }
31073
31082
  return childConfigs;
31074
31083
  }
31075
- function selectChildResourceParams$4(luvio, childResources, resourceParams) {
31084
+ function selectChildResourceParams$5(luvio, childResources, resourceParams) {
31076
31085
  const envelopeBodyPath = 'result';
31077
31086
  const envelopeStatusCodePath = 'statusCode';
31078
31087
  const envelopePath = 'results';
@@ -31155,7 +31164,7 @@ function selectChildResourceParams$4(luvio, childResources, resourceParams) {
31155
31164
  // has non-cached errors (since the top-level composite
31156
31165
  // snapshot will look like an Unfulfilled snapshot
31157
31166
  // instead of an error snapshot).
31158
- const nonCachedError = nonCachedErrors$4[childKey];
31167
+ const nonCachedError = nonCachedErrors$5[childKey];
31159
31168
  if (nonCachedError === undefined ||
31160
31169
  nonCachedError.expiration < reader.getTimeStamp()) {
31161
31170
  reader.markMissingLink(childKey);
@@ -31194,7 +31203,7 @@ function selectChildResourceParams$4(luvio, childResources, resourceParams) {
31194
31203
  }
31195
31204
  function select$X(luvio, resourceParams) {
31196
31205
  const childResources = createChildResourceParams$5(resourceParams);
31197
- return selectChildResourceParams$4(luvio, childResources, resourceParams);
31206
+ return selectChildResourceParams$5(luvio, childResources, resourceParams);
31198
31207
  }
31199
31208
  function keyBuilder$_(luvio, params) {
31200
31209
  return (keyPrefix$1 +
@@ -31282,14 +31291,14 @@ function ingestSuccessChildResourceParams$4(luvio, childResourceParamsArray, chi
31282
31291
  }
31283
31292
  // track non-cached responses so rebuilds work properly
31284
31293
  if (childStatusCode !== 404 && childStatusCode !== 200) {
31285
- nonCachedErrors$4[childKey] = {
31294
+ nonCachedErrors$5[childKey] = {
31286
31295
  expiration: now + TTL$x,
31287
31296
  response: childBody,
31288
31297
  status: childStatusCode,
31289
31298
  };
31290
31299
  }
31291
31300
  else {
31292
- delete nonCachedErrors$4[childKey];
31301
+ delete nonCachedErrors$5[childKey];
31293
31302
  }
31294
31303
  }
31295
31304
  ObjectFreeze$1$1(childSnapshotDataResponses);
@@ -31877,7 +31886,7 @@ const getNavItemsAdapterFactory = (luvio) => function UiApi__getNavItems(untrust
31877
31886
  buildCachedSnapshotCachePolicy$o, buildNetworkSnapshotCachePolicy$p);
31878
31887
  };
31879
31888
 
31880
- const nonCachedErrors$3 = ObjectCreate$1$1(null);
31889
+ const nonCachedErrors$4 = ObjectCreate$1$1(null);
31881
31890
  function createChildResourceParams$4(resourceParams) {
31882
31891
  const childConfigs = [];
31883
31892
  for (let index = 0, len = resourceParams.urlParams.objectApiNames.length; index < len; index += 1) {
@@ -31890,7 +31899,7 @@ function createChildResourceParams$4(resourceParams) {
31890
31899
  }
31891
31900
  return childConfigs;
31892
31901
  }
31893
- function selectChildResourceParams$3(luvio, childResources, resourceParams) {
31902
+ function selectChildResourceParams$4(luvio, childResources, resourceParams) {
31894
31903
  const envelopeBodyPath = 'result';
31895
31904
  const envelopeStatusCodePath = 'statusCode';
31896
31905
  const envelopePath = 'results';
@@ -31961,7 +31970,7 @@ function selectChildResourceParams$3(luvio, childResources, resourceParams) {
31961
31970
  // has non-cached errors (since the top-level composite
31962
31971
  // snapshot will look like an Unfulfilled snapshot
31963
31972
  // instead of an error snapshot).
31964
- const nonCachedError = nonCachedErrors$3[childKey];
31973
+ const nonCachedError = nonCachedErrors$4[childKey];
31965
31974
  if (nonCachedError === undefined || nonCachedError.expiration < reader.getTimeStamp()) {
31966
31975
  reader.markMissingLink(childKey);
31967
31976
  }
@@ -31999,7 +32008,7 @@ function selectChildResourceParams$3(luvio, childResources, resourceParams) {
31999
32008
  }
32000
32009
  function select$U(luvio, resourceParams) {
32001
32010
  const childResources = createChildResourceParams$4(resourceParams);
32002
- return selectChildResourceParams$3(luvio, childResources, resourceParams);
32011
+ return selectChildResourceParams$4(luvio, childResources, resourceParams);
32003
32012
  }
32004
32013
  function keyBuilder$V(luvio, params) {
32005
32014
  return keyPrefix$1 + '::SimplifiedBatchRepresentation:(' + 'objectApiNames:' + params.urlParams.objectApiNames + ')';
@@ -32080,10 +32089,10 @@ function ingestSuccessChildResourceParams$3(luvio, childResourceParamsArray, chi
32080
32089
  }
32081
32090
  // track non-cached responses so rebuilds work properly
32082
32091
  if (childStatusCode !== 404 && childStatusCode !== 200) {
32083
- nonCachedErrors$3[childKey] = { expiration: now + TTL$t, response: childBody, status: childStatusCode };
32092
+ nonCachedErrors$4[childKey] = { expiration: now + TTL$t, response: childBody, status: childStatusCode };
32084
32093
  }
32085
32094
  else {
32086
- delete nonCachedErrors$3[childKey];
32095
+ delete nonCachedErrors$4[childKey];
32087
32096
  }
32088
32097
  }
32089
32098
  ObjectFreeze$1$1(childSnapshotDataResponses);
@@ -34665,7 +34674,7 @@ function createResourceRequest$s(config) {
34665
34674
  };
34666
34675
  }
34667
34676
 
34668
- const nonCachedErrors$2 = ObjectCreate$1$1(null);
34677
+ const nonCachedErrors$3 = ObjectCreate$1$1(null);
34669
34678
  function createChildResourceParams$3(resourceParams) {
34670
34679
  const childConfigs = [];
34671
34680
  for (let index = 0, len = resourceParams.urlParams.relatedListNames.length; index < len; index += 1) {
@@ -34682,7 +34691,7 @@ function createChildResourceParams$3(resourceParams) {
34682
34691
  }
34683
34692
  return childConfigs;
34684
34693
  }
34685
- function selectChildResourceParams$2(luvio, childResources, resourceParams) {
34694
+ function selectChildResourceParams$3(luvio, childResources, resourceParams) {
34686
34695
  const envelopeBodyPath = 'result';
34687
34696
  const envelopeStatusCodePath = 'statusCode';
34688
34697
  const envelopePath = 'results';
@@ -34753,7 +34762,7 @@ function selectChildResourceParams$2(luvio, childResources, resourceParams) {
34753
34762
  // has non-cached errors (since the top-level composite
34754
34763
  // snapshot will look like an Unfulfilled snapshot
34755
34764
  // instead of an error snapshot).
34756
- const nonCachedError = nonCachedErrors$2[childKey];
34765
+ const nonCachedError = nonCachedErrors$3[childKey];
34757
34766
  if (nonCachedError === undefined) {
34758
34767
  reader.markMissingLink(childKey);
34759
34768
  }
@@ -34791,7 +34800,7 @@ function selectChildResourceParams$2(luvio, childResources, resourceParams) {
34791
34800
  }
34792
34801
  function select$x$1(luvio, resourceParams) {
34793
34802
  const childResources = createChildResourceParams$3(resourceParams);
34794
- return selectChildResourceParams$2(luvio, childResources, resourceParams);
34803
+ return selectChildResourceParams$3(luvio, childResources, resourceParams);
34795
34804
  }
34796
34805
  function keyBuilder$J$1(luvio, params) {
34797
34806
  return keyPrefix$1 + '::BatchRelatedListCountRepresentation:(' + 'maxCount:' + params.queryParams.maxCount + ',' + 'parentRecordId:' + params.urlParams.parentRecordId + ',' + 'relatedListNames:' + params.urlParams.relatedListNames + ')';
@@ -34871,10 +34880,10 @@ function ingestSuccessChildResourceParams$2(luvio, childResourceParamsArray, chi
34871
34880
  }
34872
34881
  // track non-cached responses so rebuilds work properly
34873
34882
  if (childStatusCode !== 404 && childStatusCode !== 200) {
34874
- nonCachedErrors$2[childKey] = { response: childBody, status: childStatusCode };
34883
+ nonCachedErrors$3[childKey] = { response: childBody, status: childStatusCode };
34875
34884
  }
34876
34885
  else {
34877
- delete nonCachedErrors$2[childKey];
34886
+ delete nonCachedErrors$3[childKey];
34878
34887
  }
34879
34888
  }
34880
34889
  ObjectFreeze$1$1(childSnapshotDataResponses);
@@ -35459,8 +35468,8 @@ function createChildResourceParams$2(resourceParams) {
35459
35468
  return childConfigs;
35460
35469
  }
35461
35470
 
35462
- const nonCachedErrors$1 = ObjectCreate$1$1(null);
35463
- function selectChildResourceParams$1(luvio, childResources, resourceParams) {
35471
+ const nonCachedErrors$2 = ObjectCreate$1$1(null);
35472
+ function selectChildResourceParams$2(luvio, childResources, resourceParams) {
35464
35473
  const envelopeBodyPath = 'result';
35465
35474
  const envelopeStatusCodePath = 'statusCode';
35466
35475
  const envelopePath = 'results';
@@ -35531,7 +35540,7 @@ function selectChildResourceParams$1(luvio, childResources, resourceParams) {
35531
35540
  // has non-cached errors (since the top-level composite
35532
35541
  // snapshot will look like an Unfulfilled snapshot
35533
35542
  // instead of an error snapshot).
35534
- const nonCachedError = nonCachedErrors$1[childKey];
35543
+ const nonCachedError = nonCachedErrors$2[childKey];
35535
35544
  if (nonCachedError === undefined || nonCachedError.expiration < reader.getTimeStamp()) {
35536
35545
  reader.markMissingLink(childKey);
35537
35546
  }
@@ -35569,7 +35578,7 @@ function selectChildResourceParams$1(luvio, childResources, resourceParams) {
35569
35578
  }
35570
35579
  function select$u$1(luvio, resourceParams) {
35571
35580
  const childResources = createChildResourceParams$2(resourceParams);
35572
- return selectChildResourceParams$1(luvio, childResources, resourceParams);
35581
+ return selectChildResourceParams$2(luvio, childResources, resourceParams);
35573
35582
  }
35574
35583
  function keyBuilder$E$1(luvio, params) {
35575
35584
  return keyPrefix$1 + '::RelatedListInfoBatchRepresentation:(' + 'recordTypeId:' + params.queryParams.recordTypeId + ',' + 'parentObjectApiName:' + params.urlParams.parentObjectApiName + ',' + 'relatedListNames:' + params.urlParams.relatedListNames + ')';
@@ -35650,10 +35659,10 @@ function ingestSuccessChildResourceParams$1(luvio, childResourceParamsArray, chi
35650
35659
  }
35651
35660
  // track non-cached responses so rebuilds work properly
35652
35661
  if (childStatusCode !== 404 && childStatusCode !== 200) {
35653
- nonCachedErrors$1[childKey] = { expiration: now + TTL$c, response: childBody, status: childStatusCode };
35662
+ nonCachedErrors$2[childKey] = { expiration: now + TTL$c, response: childBody, status: childStatusCode };
35654
35663
  }
35655
35664
  else {
35656
- delete nonCachedErrors$1[childKey];
35665
+ delete nonCachedErrors$2[childKey];
35657
35666
  }
35658
35667
  }
35659
35668
  ObjectFreeze$1$1(childSnapshotDataResponses);
@@ -36622,7 +36631,7 @@ function createResourceRequest$m(config) {
36622
36631
  };
36623
36632
  }
36624
36633
 
36625
- const nonCachedErrors$6 = ObjectCreate$1$1(null);
36634
+ const nonCachedErrors$1 = ObjectCreate$1$1(null);
36626
36635
  function createChildResourceParams$1(resourceParams) {
36627
36636
  const childConfigs = [];
36628
36637
  for (let index = 0, len = resourceParams.urlParams.preferencesIds.length; index < len; index += 1) {
@@ -36635,7 +36644,7 @@ function createChildResourceParams$1(resourceParams) {
36635
36644
  }
36636
36645
  return childConfigs;
36637
36646
  }
36638
- function selectChildResourceParams$6(luvio, childResources, resourceParams) {
36647
+ function selectChildResourceParams$1(luvio, childResources, resourceParams) {
36639
36648
  const envelopeBodyPath = 'result';
36640
36649
  const envelopeStatusCodePath = 'statusCode';
36641
36650
  const envelopePath = 'results';
@@ -36706,7 +36715,7 @@ function selectChildResourceParams$6(luvio, childResources, resourceParams) {
36706
36715
  // has non-cached errors (since the top-level composite
36707
36716
  // snapshot will look like an Unfulfilled snapshot
36708
36717
  // instead of an error snapshot).
36709
- const nonCachedError = nonCachedErrors$6[childKey];
36718
+ const nonCachedError = nonCachedErrors$1[childKey];
36710
36719
  if (nonCachedError === undefined || nonCachedError.expiration < reader.getTimeStamp()) {
36711
36720
  reader.markMissingLink(childKey);
36712
36721
  }
@@ -36744,7 +36753,7 @@ function selectChildResourceParams$6(luvio, childResources, resourceParams) {
36744
36753
  }
36745
36754
  function select$o$1(luvio, resourceParams) {
36746
36755
  const childResources = createChildResourceParams$1(resourceParams);
36747
- return selectChildResourceParams$6(luvio, childResources, resourceParams);
36756
+ return selectChildResourceParams$1(luvio, childResources, resourceParams);
36748
36757
  }
36749
36758
  function keyBuilder$w$1(luvio, params) {
36750
36759
  return keyPrefix$1 + '::RelatedListPreferencesBatchRepresentation:(' + 'preferencesIds:' + params.urlParams.preferencesIds + ')';
@@ -36825,10 +36834,10 @@ function ingestSuccessChildResourceParams$6(luvio, childResourceParamsArray, chi
36825
36834
  }
36826
36835
  // track non-cached responses so rebuilds work properly
36827
36836
  if (childStatusCode !== 404 && childStatusCode !== 200) {
36828
- nonCachedErrors$6[childKey] = { expiration: now + TTL$b, response: childBody, status: childStatusCode };
36837
+ nonCachedErrors$1[childKey] = { expiration: now + TTL$b, response: childBody, status: childStatusCode };
36829
36838
  }
36830
36839
  else {
36831
- delete nonCachedErrors$6[childKey];
36840
+ delete nonCachedErrors$1[childKey];
36832
36841
  }
36833
36842
  }
36834
36843
  ObjectFreeze$1$1(childSnapshotDataResponses);
@@ -37905,6 +37914,8 @@ function createResourceRequest$j(config) {
37905
37914
  };
37906
37915
  }
37907
37916
 
37917
+ // Copied from generated resource
37918
+ const nonCachedErrors$7 = ObjectCreate$1$1(null);
37908
37919
  const createChildResourceParams$9 = (resourceParams) => {
37909
37920
  const childConfigs = [];
37910
37921
  for (let index = 0, len = resourceParams.body.relatedListParameters.length; index < len; index += 1) {
@@ -37939,8 +37950,7 @@ const createChildResourceParams$9 = (resourceParams) => {
37939
37950
  // HUGE BLOCK OF COPY PASTED CODE:
37940
37951
  // WE NEED TO DO THIS SO THAT THE ADAPTER CAN USE ONLY OUR OVERRIDE FILE
37941
37952
  // PLEASE DO NOT CHANGE ANYTHING HERE...
37942
- function select$l$1(luvio, resourceParams) {
37943
- const childResources = createChildResourceParams$9(resourceParams);
37953
+ function selectChildResourceParams$7(luvio, childResources, resourceParams) {
37944
37954
  const envelopeBodyPath = 'result';
37945
37955
  const envelopeStatusCodePath = 'statusCode';
37946
37956
  const envelopePath = 'results';
@@ -37949,21 +37959,38 @@ function select$l$1(luvio, resourceParams) {
37949
37959
  reader: true,
37950
37960
  synthetic: true,
37951
37961
  read: (reader) => {
37962
+ // Top-level 404 lookup
37963
+ const result = reader.storeLookup(keyBuilder$r$1(luvio, resourceParams));
37964
+ if (result.state === reader.StoreResolveResultState.Error &&
37965
+ result.value.status === 404) {
37966
+ return {
37967
+ state: 'Error',
37968
+ value: result.value,
37969
+ };
37970
+ }
37952
37971
  const sink = {};
37953
37972
  reader.enterPath(envelopePath);
37954
37973
  const results = [];
37955
37974
  for (let i = 0, len = childResources.length; i < len; i += 1) {
37956
37975
  reader.enterPath(i);
37976
+ reader.enterPath(envelopeBodyPath);
37957
37977
  const childResource = childResources[i];
37958
37978
  const childKey = keyBuilder$s$1(luvio, childResource);
37959
37979
  const childFragment = select$m$1(luvio, childResource);
37980
+ const isMissingDataBeforeChildRead = reader.getIsDataMissing();
37960
37981
  const childSnapshot = reader.read({
37961
37982
  recordId: childKey,
37962
37983
  node: childFragment,
37963
37984
  variables: {},
37964
37985
  });
37986
+ reader.exitPath();
37965
37987
  const childSink = {};
37988
+ reader.markSeenId(childKey);
37966
37989
  switch (childSnapshot.state) {
37990
+ case 'Stale':
37991
+ reader.markStale();
37992
+ // Stale needs envelope bodies filled in so don't break
37993
+ // eslint-disable-next-line no-fallthrough
37967
37994
  case 'Fulfilled':
37968
37995
  reader.enterPath(envelopeStatusCodePath);
37969
37996
  reader.assignScalar(envelopeStatusCodePath, childSink, 200);
@@ -37983,14 +38010,45 @@ function select$l$1(luvio, resourceParams) {
37983
38010
  reader.exitPath();
37984
38011
  break;
37985
38012
  case 'Unfulfilled':
37986
- reader.markMissing();
38013
+ // if child snapshot doesn't have any data then
38014
+ // that means the child record key is missing
38015
+ if (childSnapshot.data === undefined) {
38016
+ if (reader.isRebuilding() === false) {
38017
+ // not a rebuild, mark as missing and move on
38018
+ reader.markMissingLink(childKey);
38019
+ break;
38020
+ }
38021
+ // On rebuilds we have to check if there is a non-cached
38022
+ // error that we know about. If we don't do this then
38023
+ // rebuilds will go into endless refresh loop if a child
38024
+ // has non-cached errors (since the top-level composite
38025
+ // snapshot will look like an Unfulfilled snapshot
38026
+ // instead of an error snapshot).
38027
+ const nonCachedError = nonCachedErrors$7[childKey];
38028
+ if (nonCachedError === undefined ||
38029
+ nonCachedError.expiration < reader.getTimeStamp()) {
38030
+ reader.markMissingLink(childKey);
38031
+ }
38032
+ else {
38033
+ // if this child error was the only reason the reader
38034
+ // is marked as missing then we want to undo that
38035
+ if (isMissingDataBeforeChildRead === false) {
38036
+ reader.unMarkMissing();
38037
+ }
38038
+ // put status code and body into reader path
38039
+ const { response: nonCachedBody, status: nonCachedStatus } = nonCachedError;
38040
+ reader.enterPath(envelopeStatusCodePath);
38041
+ reader.assignScalar(envelopeStatusCodePath, childSink, nonCachedStatus);
38042
+ reader.exitPath();
38043
+ reader.enterPath(envelopeBodyPath);
38044
+ reader.assignNonScalar(childSink, envelopeBodyPath, nonCachedBody);
38045
+ reader.exitPath();
38046
+ }
38047
+ }
37987
38048
  break;
37988
38049
  case 'Pending':
37989
38050
  reader.markPending();
37990
38051
  break;
37991
- case 'Stale':
37992
- reader.markStale();
37993
- break;
37994
38052
  }
37995
38053
  ObjectFreeze$1$1(childSink);
37996
38054
  ArrayPrototypePush$1.call(results, childSink);
@@ -38003,6 +38061,13 @@ function select$l$1(luvio, resourceParams) {
38003
38061
  },
38004
38062
  };
38005
38063
  }
38064
+ // HUGE BLOCK OF COPY PASTED CODE:
38065
+ // WE NEED TO DO THIS SO THAT THE ADAPTER CAN USE ONLY OUR OVERRIDE FILE
38066
+ // PLEASE DO NOT CHANGE ANYTHING HERE...
38067
+ function select$l$1(luvio, resourceParams) {
38068
+ const childResources = createChildResourceParams$9(resourceParams);
38069
+ return selectChildResourceParams$7(luvio, childResources, resourceParams);
38070
+ }
38006
38071
  function keyBuilder$r$1(luvio, params) {
38007
38072
  return (keyPrefix$1 +
38008
38073
  '::' +
@@ -44347,7 +44412,7 @@ withDefaultLuvio((luvio) => {
44347
44412
  dropFunction: instrumentation$2.notifyRecordUpdateAvailableDropped,
44348
44413
  });
44349
44414
  });
44350
- // version: 1.127.0-0b8563139
44415
+ // version: 1.128.0-b5d8ac468
44351
44416
 
44352
44417
  var caseSensitiveUserId = '005B0000000GR4OIAW';
44353
44418
 
@@ -59858,7 +59923,7 @@ register({
59858
59923
  id: '@salesforce/lds-network-adapter',
59859
59924
  instrument: instrument$1,
59860
59925
  });
59861
- // version: 1.127.0-48f9732df
59926
+ // version: 1.128.0-7bdcf55d3
59862
59927
 
59863
59928
  const { create: create$2, keys: keys$2 } = Object;
59864
59929
  const { stringify: stringify$1, parse: parse$1 } = JSON;
@@ -74107,6 +74172,9 @@ ObjectCreate$1(null);
74107
74172
 
74108
74173
  ObjectCreate$1(null);
74109
74174
 
74175
+ // Copied from generated resource
74176
+ ObjectCreate$1(null);
74177
+
74110
74178
  var DiscriminatorValues;
74111
74179
  (function (DiscriminatorValues) {
74112
74180
  DiscriminatorValues["Select"] = "Select";
@@ -74123,7 +74191,7 @@ register({
74123
74191
  configuration: { ...configurationForGraphQLAdapters },
74124
74192
  instrument,
74125
74193
  });
74126
- // version: 1.127.0-0b8563139
74194
+ // version: 1.128.0-b5d8ac468
74127
74195
 
74128
74196
  // On core the unstable adapters are re-exported with different names,
74129
74197
 
@@ -76252,7 +76320,7 @@ withDefaultLuvio((luvio) => {
76252
76320
  unstable_graphQL_imperative = createImperativeAdapter(luvio, createInstrumentedAdapter(ldsAdapter, adapterMetadata), adapterMetadata);
76253
76321
  graphQLImperative = ldsAdapter;
76254
76322
  });
76255
- // version: 1.127.0-0b8563139
76323
+ // version: 1.128.0-b5d8ac468
76256
76324
 
76257
76325
  var gqlApi = /*#__PURE__*/Object.freeze({
76258
76326
  __proto__: null,
@@ -76944,4 +77012,4 @@ const { luvio } = getRuntime();
76944
77012
  setDefaultLuvio({ luvio });
76945
77013
 
76946
77014
  export { createPrimingSession, draftManager, draftQueue, executeAdapter, executeMutatingAdapter, getImperativeAdapterNames, invokeAdapter, invokeAdapterWithDraftToReplace, invokeAdapterWithMetadata, nimbusDraftQueue, registerReportObserver, setMetadataTTL, setUiApiRecordTTL, subscribeToAdapter };
76947
- // version: 1.127.0-48f9732df
77015
+ // version: 1.128.0-7bdcf55d3
@@ -3782,7 +3782,7 @@
3782
3782
  }
3783
3783
  callbacks.push(callback);
3784
3784
  }
3785
- // version: 1.127.0-48f9732df
3785
+ // version: 1.128.0-7bdcf55d3
3786
3786
 
3787
3787
  // TODO [TD-0081508]: once that TD is fulfilled we can probably change this file
3788
3788
  function instrumentAdapter$1(createFunction, _metadata) {
@@ -15206,7 +15206,7 @@
15206
15206
  updateReferenceMapWithKnownKey(ast, luvioDocumentNode);
15207
15207
  return luvioDocumentNode;
15208
15208
  }
15209
- // version: 1.127.0-48f9732df
15209
+ // version: 1.128.0-7bdcf55d3
15210
15210
 
15211
15211
  function unwrap(data) {
15212
15212
  // The lwc-luvio bindings import a function from lwc called "unwrap".
@@ -16119,7 +16119,7 @@
16119
16119
  const { apiFamily, name } = metadata;
16120
16120
  return createGraphQLWireAdapterConstructor$1(adapter, `${apiFamily}.${name}`, luvio, astResolver);
16121
16121
  }
16122
- // version: 1.127.0-48f9732df
16122
+ // version: 1.128.0-7bdcf55d3
16123
16123
 
16124
16124
  /**
16125
16125
  * Copyright (c) 2022, Salesforce, Inc.,
@@ -16615,7 +16615,7 @@
16615
16615
  entry['__metadata'] = createLink$3(metadataKey);
16616
16616
  }
16617
16617
 
16618
- const VERSION$1d = "3b339f50551a63986bb2aa52572d2953";
16618
+ const VERSION$1d = "275ae22194003d1e53f548b81219c5cb";
16619
16619
  const select$1H = function ListColumnRepresentationSelect() {
16620
16620
  return {
16621
16621
  kind: 'Fragment',
@@ -16630,6 +16630,10 @@
16630
16630
  name: 'label',
16631
16631
  kind: 'Scalar'
16632
16632
  },
16633
+ {
16634
+ name: 'lookupId',
16635
+ kind: 'Scalar'
16636
+ },
16633
16637
  {
16634
16638
  name: 'sortable',
16635
16639
  kind: 'Scalar'
@@ -20405,7 +20409,7 @@
20405
20409
 
20406
20410
  const VERSION$13 = "98cce53b8d13b1883d001bbdaab24383";
20407
20411
 
20408
- const nonCachedErrors$5 = ObjectCreate$1$1(null);
20412
+ const nonCachedErrors$6 = ObjectCreate$1$1(null);
20409
20413
  function ingestSuccessChildResourceParams$5(luvio, childResourceParamsArray, childEnvelopes, serverRequestCount = 0) {
20410
20414
  const childSnapshotDataResponses = [];
20411
20415
  let seenRecords = new StoreKeySet();
@@ -20470,14 +20474,14 @@
20470
20474
  }
20471
20475
  // track non-cached responses so rebuilds work properly
20472
20476
  if (childStatusCode !== 404 && childStatusCode !== 200) {
20473
- nonCachedErrors$5[childKey] = {
20477
+ nonCachedErrors$6[childKey] = {
20474
20478
  expiration: now + TTL$v,
20475
20479
  response: childBody,
20476
20480
  status: childStatusCode,
20477
20481
  };
20478
20482
  }
20479
20483
  else {
20480
- delete nonCachedErrors$5[childKey];
20484
+ delete nonCachedErrors$6[childKey];
20481
20485
  }
20482
20486
  }
20483
20487
  ObjectFreeze$1$1(childSnapshotDataResponses);
@@ -20491,7 +20495,7 @@
20491
20495
  };
20492
20496
  }
20493
20497
 
20494
- function selectChildResourceParams$5(luvio, childResources, resourceParams) {
20498
+ function selectChildResourceParams$6(luvio, childResources, resourceParams) {
20495
20499
  const envelopeBodyPath = 'result';
20496
20500
  const envelopeStatusCodePath = 'statusCode';
20497
20501
  const envelopePath = 'results';
@@ -20572,7 +20576,7 @@
20572
20576
  // has non-cached errors (since the top-level composite
20573
20577
  // snapshot will look like an Unfulfilled snapshot
20574
20578
  // instead of an error snapshot).
20575
- const nonCachedError = nonCachedErrors$5[childKey];
20579
+ const nonCachedError = nonCachedErrors$6[childKey];
20576
20580
  if (nonCachedError === undefined ||
20577
20581
  nonCachedError.expiration < timestamp) {
20578
20582
  reader.markMissingLink(childKey);
@@ -20729,7 +20733,7 @@
20729
20733
  function adapterFragment$C(luvio, config) {
20730
20734
  const childResources = createChildResourceParams$7(config);
20731
20735
  const resourceParams = createResourceParams$S(config);
20732
- return selectChildResourceParams$5(luvio, childResources, resourceParams);
20736
+ return selectChildResourceParams$6(luvio, childResources, resourceParams);
20733
20737
  }
20734
20738
 
20735
20739
  function onFetchResponseSuccess$G(luvio, config, resourceParams, response, serverRequestCount = 0) {
@@ -25261,7 +25265,12 @@
25261
25265
  const { apiName } = record;
25262
25266
  const objectInfo = objectInfos[apiName];
25263
25267
  const recordTypeId = getRecordTypeId$2(record);
25264
- const layoutMap = layouts[apiName][recordTypeId];
25268
+ // W-12697744 - Return an empty layoutMap if the entity does not have a layout.
25269
+ // Temp fix until we can mimic the server behavior for non-layoutable entities.
25270
+ let layoutMap = {};
25271
+ if (hasOwnProperty$1.call(layouts, apiName)) {
25272
+ layoutMap = layouts[apiName][recordTypeId];
25273
+ }
25265
25274
  return {
25266
25275
  layoutMap,
25267
25276
  objectInfo,
@@ -31062,7 +31071,7 @@
31062
31071
 
31063
31072
  const VERSION$G$1 = "fb049a56cac04c6d0c0969a650749448";
31064
31073
 
31065
- const nonCachedErrors$4 = ObjectCreate$1$1(null);
31074
+ const nonCachedErrors$5 = ObjectCreate$1$1(null);
31066
31075
  function createChildResourceParams$5(resourceParams) {
31067
31076
  const childConfigs = [];
31068
31077
  const { queryParams } = resourceParams;
@@ -31078,7 +31087,7 @@
31078
31087
  }
31079
31088
  return childConfigs;
31080
31089
  }
31081
- function selectChildResourceParams$4(luvio, childResources, resourceParams) {
31090
+ function selectChildResourceParams$5(luvio, childResources, resourceParams) {
31082
31091
  const envelopeBodyPath = 'result';
31083
31092
  const envelopeStatusCodePath = 'statusCode';
31084
31093
  const envelopePath = 'results';
@@ -31161,7 +31170,7 @@
31161
31170
  // has non-cached errors (since the top-level composite
31162
31171
  // snapshot will look like an Unfulfilled snapshot
31163
31172
  // instead of an error snapshot).
31164
- const nonCachedError = nonCachedErrors$4[childKey];
31173
+ const nonCachedError = nonCachedErrors$5[childKey];
31165
31174
  if (nonCachedError === undefined ||
31166
31175
  nonCachedError.expiration < reader.getTimeStamp()) {
31167
31176
  reader.markMissingLink(childKey);
@@ -31200,7 +31209,7 @@
31200
31209
  }
31201
31210
  function select$X(luvio, resourceParams) {
31202
31211
  const childResources = createChildResourceParams$5(resourceParams);
31203
- return selectChildResourceParams$4(luvio, childResources, resourceParams);
31212
+ return selectChildResourceParams$5(luvio, childResources, resourceParams);
31204
31213
  }
31205
31214
  function keyBuilder$_(luvio, params) {
31206
31215
  return (keyPrefix$1 +
@@ -31288,14 +31297,14 @@
31288
31297
  }
31289
31298
  // track non-cached responses so rebuilds work properly
31290
31299
  if (childStatusCode !== 404 && childStatusCode !== 200) {
31291
- nonCachedErrors$4[childKey] = {
31300
+ nonCachedErrors$5[childKey] = {
31292
31301
  expiration: now + TTL$x,
31293
31302
  response: childBody,
31294
31303
  status: childStatusCode,
31295
31304
  };
31296
31305
  }
31297
31306
  else {
31298
- delete nonCachedErrors$4[childKey];
31307
+ delete nonCachedErrors$5[childKey];
31299
31308
  }
31300
31309
  }
31301
31310
  ObjectFreeze$1$1(childSnapshotDataResponses);
@@ -31883,7 +31892,7 @@
31883
31892
  buildCachedSnapshotCachePolicy$o, buildNetworkSnapshotCachePolicy$p);
31884
31893
  };
31885
31894
 
31886
- const nonCachedErrors$3 = ObjectCreate$1$1(null);
31895
+ const nonCachedErrors$4 = ObjectCreate$1$1(null);
31887
31896
  function createChildResourceParams$4(resourceParams) {
31888
31897
  const childConfigs = [];
31889
31898
  for (let index = 0, len = resourceParams.urlParams.objectApiNames.length; index < len; index += 1) {
@@ -31896,7 +31905,7 @@
31896
31905
  }
31897
31906
  return childConfigs;
31898
31907
  }
31899
- function selectChildResourceParams$3(luvio, childResources, resourceParams) {
31908
+ function selectChildResourceParams$4(luvio, childResources, resourceParams) {
31900
31909
  const envelopeBodyPath = 'result';
31901
31910
  const envelopeStatusCodePath = 'statusCode';
31902
31911
  const envelopePath = 'results';
@@ -31967,7 +31976,7 @@
31967
31976
  // has non-cached errors (since the top-level composite
31968
31977
  // snapshot will look like an Unfulfilled snapshot
31969
31978
  // instead of an error snapshot).
31970
- const nonCachedError = nonCachedErrors$3[childKey];
31979
+ const nonCachedError = nonCachedErrors$4[childKey];
31971
31980
  if (nonCachedError === undefined || nonCachedError.expiration < reader.getTimeStamp()) {
31972
31981
  reader.markMissingLink(childKey);
31973
31982
  }
@@ -32005,7 +32014,7 @@
32005
32014
  }
32006
32015
  function select$U(luvio, resourceParams) {
32007
32016
  const childResources = createChildResourceParams$4(resourceParams);
32008
- return selectChildResourceParams$3(luvio, childResources, resourceParams);
32017
+ return selectChildResourceParams$4(luvio, childResources, resourceParams);
32009
32018
  }
32010
32019
  function keyBuilder$V(luvio, params) {
32011
32020
  return keyPrefix$1 + '::SimplifiedBatchRepresentation:(' + 'objectApiNames:' + params.urlParams.objectApiNames + ')';
@@ -32086,10 +32095,10 @@
32086
32095
  }
32087
32096
  // track non-cached responses so rebuilds work properly
32088
32097
  if (childStatusCode !== 404 && childStatusCode !== 200) {
32089
- nonCachedErrors$3[childKey] = { expiration: now + TTL$t, response: childBody, status: childStatusCode };
32098
+ nonCachedErrors$4[childKey] = { expiration: now + TTL$t, response: childBody, status: childStatusCode };
32090
32099
  }
32091
32100
  else {
32092
- delete nonCachedErrors$3[childKey];
32101
+ delete nonCachedErrors$4[childKey];
32093
32102
  }
32094
32103
  }
32095
32104
  ObjectFreeze$1$1(childSnapshotDataResponses);
@@ -34671,7 +34680,7 @@
34671
34680
  };
34672
34681
  }
34673
34682
 
34674
- const nonCachedErrors$2 = ObjectCreate$1$1(null);
34683
+ const nonCachedErrors$3 = ObjectCreate$1$1(null);
34675
34684
  function createChildResourceParams$3(resourceParams) {
34676
34685
  const childConfigs = [];
34677
34686
  for (let index = 0, len = resourceParams.urlParams.relatedListNames.length; index < len; index += 1) {
@@ -34688,7 +34697,7 @@
34688
34697
  }
34689
34698
  return childConfigs;
34690
34699
  }
34691
- function selectChildResourceParams$2(luvio, childResources, resourceParams) {
34700
+ function selectChildResourceParams$3(luvio, childResources, resourceParams) {
34692
34701
  const envelopeBodyPath = 'result';
34693
34702
  const envelopeStatusCodePath = 'statusCode';
34694
34703
  const envelopePath = 'results';
@@ -34759,7 +34768,7 @@
34759
34768
  // has non-cached errors (since the top-level composite
34760
34769
  // snapshot will look like an Unfulfilled snapshot
34761
34770
  // instead of an error snapshot).
34762
- const nonCachedError = nonCachedErrors$2[childKey];
34771
+ const nonCachedError = nonCachedErrors$3[childKey];
34763
34772
  if (nonCachedError === undefined) {
34764
34773
  reader.markMissingLink(childKey);
34765
34774
  }
@@ -34797,7 +34806,7 @@
34797
34806
  }
34798
34807
  function select$x$1(luvio, resourceParams) {
34799
34808
  const childResources = createChildResourceParams$3(resourceParams);
34800
- return selectChildResourceParams$2(luvio, childResources, resourceParams);
34809
+ return selectChildResourceParams$3(luvio, childResources, resourceParams);
34801
34810
  }
34802
34811
  function keyBuilder$J$1(luvio, params) {
34803
34812
  return keyPrefix$1 + '::BatchRelatedListCountRepresentation:(' + 'maxCount:' + params.queryParams.maxCount + ',' + 'parentRecordId:' + params.urlParams.parentRecordId + ',' + 'relatedListNames:' + params.urlParams.relatedListNames + ')';
@@ -34877,10 +34886,10 @@
34877
34886
  }
34878
34887
  // track non-cached responses so rebuilds work properly
34879
34888
  if (childStatusCode !== 404 && childStatusCode !== 200) {
34880
- nonCachedErrors$2[childKey] = { response: childBody, status: childStatusCode };
34889
+ nonCachedErrors$3[childKey] = { response: childBody, status: childStatusCode };
34881
34890
  }
34882
34891
  else {
34883
- delete nonCachedErrors$2[childKey];
34892
+ delete nonCachedErrors$3[childKey];
34884
34893
  }
34885
34894
  }
34886
34895
  ObjectFreeze$1$1(childSnapshotDataResponses);
@@ -35465,8 +35474,8 @@
35465
35474
  return childConfigs;
35466
35475
  }
35467
35476
 
35468
- const nonCachedErrors$1 = ObjectCreate$1$1(null);
35469
- function selectChildResourceParams$1(luvio, childResources, resourceParams) {
35477
+ const nonCachedErrors$2 = ObjectCreate$1$1(null);
35478
+ function selectChildResourceParams$2(luvio, childResources, resourceParams) {
35470
35479
  const envelopeBodyPath = 'result';
35471
35480
  const envelopeStatusCodePath = 'statusCode';
35472
35481
  const envelopePath = 'results';
@@ -35537,7 +35546,7 @@
35537
35546
  // has non-cached errors (since the top-level composite
35538
35547
  // snapshot will look like an Unfulfilled snapshot
35539
35548
  // instead of an error snapshot).
35540
- const nonCachedError = nonCachedErrors$1[childKey];
35549
+ const nonCachedError = nonCachedErrors$2[childKey];
35541
35550
  if (nonCachedError === undefined || nonCachedError.expiration < reader.getTimeStamp()) {
35542
35551
  reader.markMissingLink(childKey);
35543
35552
  }
@@ -35575,7 +35584,7 @@
35575
35584
  }
35576
35585
  function select$u$1(luvio, resourceParams) {
35577
35586
  const childResources = createChildResourceParams$2(resourceParams);
35578
- return selectChildResourceParams$1(luvio, childResources, resourceParams);
35587
+ return selectChildResourceParams$2(luvio, childResources, resourceParams);
35579
35588
  }
35580
35589
  function keyBuilder$E$1(luvio, params) {
35581
35590
  return keyPrefix$1 + '::RelatedListInfoBatchRepresentation:(' + 'recordTypeId:' + params.queryParams.recordTypeId + ',' + 'parentObjectApiName:' + params.urlParams.parentObjectApiName + ',' + 'relatedListNames:' + params.urlParams.relatedListNames + ')';
@@ -35656,10 +35665,10 @@
35656
35665
  }
35657
35666
  // track non-cached responses so rebuilds work properly
35658
35667
  if (childStatusCode !== 404 && childStatusCode !== 200) {
35659
- nonCachedErrors$1[childKey] = { expiration: now + TTL$c, response: childBody, status: childStatusCode };
35668
+ nonCachedErrors$2[childKey] = { expiration: now + TTL$c, response: childBody, status: childStatusCode };
35660
35669
  }
35661
35670
  else {
35662
- delete nonCachedErrors$1[childKey];
35671
+ delete nonCachedErrors$2[childKey];
35663
35672
  }
35664
35673
  }
35665
35674
  ObjectFreeze$1$1(childSnapshotDataResponses);
@@ -36628,7 +36637,7 @@
36628
36637
  };
36629
36638
  }
36630
36639
 
36631
- const nonCachedErrors$6 = ObjectCreate$1$1(null);
36640
+ const nonCachedErrors$1 = ObjectCreate$1$1(null);
36632
36641
  function createChildResourceParams$1(resourceParams) {
36633
36642
  const childConfigs = [];
36634
36643
  for (let index = 0, len = resourceParams.urlParams.preferencesIds.length; index < len; index += 1) {
@@ -36641,7 +36650,7 @@
36641
36650
  }
36642
36651
  return childConfigs;
36643
36652
  }
36644
- function selectChildResourceParams$6(luvio, childResources, resourceParams) {
36653
+ function selectChildResourceParams$1(luvio, childResources, resourceParams) {
36645
36654
  const envelopeBodyPath = 'result';
36646
36655
  const envelopeStatusCodePath = 'statusCode';
36647
36656
  const envelopePath = 'results';
@@ -36712,7 +36721,7 @@
36712
36721
  // has non-cached errors (since the top-level composite
36713
36722
  // snapshot will look like an Unfulfilled snapshot
36714
36723
  // instead of an error snapshot).
36715
- const nonCachedError = nonCachedErrors$6[childKey];
36724
+ const nonCachedError = nonCachedErrors$1[childKey];
36716
36725
  if (nonCachedError === undefined || nonCachedError.expiration < reader.getTimeStamp()) {
36717
36726
  reader.markMissingLink(childKey);
36718
36727
  }
@@ -36750,7 +36759,7 @@
36750
36759
  }
36751
36760
  function select$o$1(luvio, resourceParams) {
36752
36761
  const childResources = createChildResourceParams$1(resourceParams);
36753
- return selectChildResourceParams$6(luvio, childResources, resourceParams);
36762
+ return selectChildResourceParams$1(luvio, childResources, resourceParams);
36754
36763
  }
36755
36764
  function keyBuilder$w$1(luvio, params) {
36756
36765
  return keyPrefix$1 + '::RelatedListPreferencesBatchRepresentation:(' + 'preferencesIds:' + params.urlParams.preferencesIds + ')';
@@ -36831,10 +36840,10 @@
36831
36840
  }
36832
36841
  // track non-cached responses so rebuilds work properly
36833
36842
  if (childStatusCode !== 404 && childStatusCode !== 200) {
36834
- nonCachedErrors$6[childKey] = { expiration: now + TTL$b, response: childBody, status: childStatusCode };
36843
+ nonCachedErrors$1[childKey] = { expiration: now + TTL$b, response: childBody, status: childStatusCode };
36835
36844
  }
36836
36845
  else {
36837
- delete nonCachedErrors$6[childKey];
36846
+ delete nonCachedErrors$1[childKey];
36838
36847
  }
36839
36848
  }
36840
36849
  ObjectFreeze$1$1(childSnapshotDataResponses);
@@ -37911,6 +37920,8 @@
37911
37920
  };
37912
37921
  }
37913
37922
 
37923
+ // Copied from generated resource
37924
+ const nonCachedErrors$7 = ObjectCreate$1$1(null);
37914
37925
  const createChildResourceParams$9 = (resourceParams) => {
37915
37926
  const childConfigs = [];
37916
37927
  for (let index = 0, len = resourceParams.body.relatedListParameters.length; index < len; index += 1) {
@@ -37945,8 +37956,7 @@
37945
37956
  // HUGE BLOCK OF COPY PASTED CODE:
37946
37957
  // WE NEED TO DO THIS SO THAT THE ADAPTER CAN USE ONLY OUR OVERRIDE FILE
37947
37958
  // PLEASE DO NOT CHANGE ANYTHING HERE...
37948
- function select$l$1(luvio, resourceParams) {
37949
- const childResources = createChildResourceParams$9(resourceParams);
37959
+ function selectChildResourceParams$7(luvio, childResources, resourceParams) {
37950
37960
  const envelopeBodyPath = 'result';
37951
37961
  const envelopeStatusCodePath = 'statusCode';
37952
37962
  const envelopePath = 'results';
@@ -37955,21 +37965,38 @@
37955
37965
  reader: true,
37956
37966
  synthetic: true,
37957
37967
  read: (reader) => {
37968
+ // Top-level 404 lookup
37969
+ const result = reader.storeLookup(keyBuilder$r$1(luvio, resourceParams));
37970
+ if (result.state === reader.StoreResolveResultState.Error &&
37971
+ result.value.status === 404) {
37972
+ return {
37973
+ state: 'Error',
37974
+ value: result.value,
37975
+ };
37976
+ }
37958
37977
  const sink = {};
37959
37978
  reader.enterPath(envelopePath);
37960
37979
  const results = [];
37961
37980
  for (let i = 0, len = childResources.length; i < len; i += 1) {
37962
37981
  reader.enterPath(i);
37982
+ reader.enterPath(envelopeBodyPath);
37963
37983
  const childResource = childResources[i];
37964
37984
  const childKey = keyBuilder$s$1(luvio, childResource);
37965
37985
  const childFragment = select$m$1(luvio, childResource);
37986
+ const isMissingDataBeforeChildRead = reader.getIsDataMissing();
37966
37987
  const childSnapshot = reader.read({
37967
37988
  recordId: childKey,
37968
37989
  node: childFragment,
37969
37990
  variables: {},
37970
37991
  });
37992
+ reader.exitPath();
37971
37993
  const childSink = {};
37994
+ reader.markSeenId(childKey);
37972
37995
  switch (childSnapshot.state) {
37996
+ case 'Stale':
37997
+ reader.markStale();
37998
+ // Stale needs envelope bodies filled in so don't break
37999
+ // eslint-disable-next-line no-fallthrough
37973
38000
  case 'Fulfilled':
37974
38001
  reader.enterPath(envelopeStatusCodePath);
37975
38002
  reader.assignScalar(envelopeStatusCodePath, childSink, 200);
@@ -37989,14 +38016,45 @@
37989
38016
  reader.exitPath();
37990
38017
  break;
37991
38018
  case 'Unfulfilled':
37992
- reader.markMissing();
38019
+ // if child snapshot doesn't have any data then
38020
+ // that means the child record key is missing
38021
+ if (childSnapshot.data === undefined) {
38022
+ if (reader.isRebuilding() === false) {
38023
+ // not a rebuild, mark as missing and move on
38024
+ reader.markMissingLink(childKey);
38025
+ break;
38026
+ }
38027
+ // On rebuilds we have to check if there is a non-cached
38028
+ // error that we know about. If we don't do this then
38029
+ // rebuilds will go into endless refresh loop if a child
38030
+ // has non-cached errors (since the top-level composite
38031
+ // snapshot will look like an Unfulfilled snapshot
38032
+ // instead of an error snapshot).
38033
+ const nonCachedError = nonCachedErrors$7[childKey];
38034
+ if (nonCachedError === undefined ||
38035
+ nonCachedError.expiration < reader.getTimeStamp()) {
38036
+ reader.markMissingLink(childKey);
38037
+ }
38038
+ else {
38039
+ // if this child error was the only reason the reader
38040
+ // is marked as missing then we want to undo that
38041
+ if (isMissingDataBeforeChildRead === false) {
38042
+ reader.unMarkMissing();
38043
+ }
38044
+ // put status code and body into reader path
38045
+ const { response: nonCachedBody, status: nonCachedStatus } = nonCachedError;
38046
+ reader.enterPath(envelopeStatusCodePath);
38047
+ reader.assignScalar(envelopeStatusCodePath, childSink, nonCachedStatus);
38048
+ reader.exitPath();
38049
+ reader.enterPath(envelopeBodyPath);
38050
+ reader.assignNonScalar(childSink, envelopeBodyPath, nonCachedBody);
38051
+ reader.exitPath();
38052
+ }
38053
+ }
37993
38054
  break;
37994
38055
  case 'Pending':
37995
38056
  reader.markPending();
37996
38057
  break;
37997
- case 'Stale':
37998
- reader.markStale();
37999
- break;
38000
38058
  }
38001
38059
  ObjectFreeze$1$1(childSink);
38002
38060
  ArrayPrototypePush$1.call(results, childSink);
@@ -38009,6 +38067,13 @@
38009
38067
  },
38010
38068
  };
38011
38069
  }
38070
+ // HUGE BLOCK OF COPY PASTED CODE:
38071
+ // WE NEED TO DO THIS SO THAT THE ADAPTER CAN USE ONLY OUR OVERRIDE FILE
38072
+ // PLEASE DO NOT CHANGE ANYTHING HERE...
38073
+ function select$l$1(luvio, resourceParams) {
38074
+ const childResources = createChildResourceParams$9(resourceParams);
38075
+ return selectChildResourceParams$7(luvio, childResources, resourceParams);
38076
+ }
38012
38077
  function keyBuilder$r$1(luvio, params) {
38013
38078
  return (keyPrefix$1 +
38014
38079
  '::' +
@@ -44353,7 +44418,7 @@
44353
44418
  dropFunction: instrumentation$2.notifyRecordUpdateAvailableDropped,
44354
44419
  });
44355
44420
  });
44356
- // version: 1.127.0-0b8563139
44421
+ // version: 1.128.0-b5d8ac468
44357
44422
 
44358
44423
  var caseSensitiveUserId = '005B0000000GR4OIAW';
44359
44424
 
@@ -59864,7 +59929,7 @@
59864
59929
  id: '@salesforce/lds-network-adapter',
59865
59930
  instrument: instrument$1,
59866
59931
  });
59867
- // version: 1.127.0-48f9732df
59932
+ // version: 1.128.0-7bdcf55d3
59868
59933
 
59869
59934
  const { create: create$2, keys: keys$2 } = Object;
59870
59935
  const { stringify: stringify$1, parse: parse$1 } = JSON;
@@ -74113,6 +74178,9 @@
74113
74178
 
74114
74179
  ObjectCreate$1(null);
74115
74180
 
74181
+ // Copied from generated resource
74182
+ ObjectCreate$1(null);
74183
+
74116
74184
  var DiscriminatorValues;
74117
74185
  (function (DiscriminatorValues) {
74118
74186
  DiscriminatorValues["Select"] = "Select";
@@ -74129,7 +74197,7 @@
74129
74197
  configuration: { ...configurationForGraphQLAdapters },
74130
74198
  instrument,
74131
74199
  });
74132
- // version: 1.127.0-0b8563139
74200
+ // version: 1.128.0-b5d8ac468
74133
74201
 
74134
74202
  // On core the unstable adapters are re-exported with different names,
74135
74203
 
@@ -76258,7 +76326,7 @@
76258
76326
  unstable_graphQL_imperative = createImperativeAdapter(luvio, createInstrumentedAdapter(ldsAdapter, adapterMetadata), adapterMetadata);
76259
76327
  graphQLImperative = ldsAdapter;
76260
76328
  });
76261
- // version: 1.127.0-0b8563139
76329
+ // version: 1.128.0-b5d8ac468
76262
76330
 
76263
76331
  var gqlApi = /*#__PURE__*/Object.freeze({
76264
76332
  __proto__: null,
@@ -76967,4 +77035,4 @@
76967
77035
  Object.defineProperty(exports, '__esModule', { value: true });
76968
77036
 
76969
77037
  }));
76970
- // version: 1.127.0-48f9732df
77038
+ // version: 1.128.0-7bdcf55d3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/lds-worker-api",
3
- "version": "1.127.0",
3
+ "version": "1.128.0",
4
4
  "license": "SEE LICENSE IN LICENSE.txt",
5
5
  "description": "",
6
6
  "main": "dist/standalone/es/lds-worker-api.js",