@salesforce/lds-worker-api 1.278.0 → 1.279.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.
@@ -4,7 +4,7 @@
4
4
  * For full license text, see the LICENSE.txt file
5
5
  */
6
6
 
7
- /* *******************************************************************************************
7
+ /*
8
8
  * ATTENTION!
9
9
  * THIS IS A GENERATED FILE FROM https://github.com/salesforce-experience-platform-emu/lds-lightning-platform
10
10
  * If you would like to contribute to LDS, please follow the steps outlined in the git repo.
@@ -1034,4 +1034,4 @@ if (process.env.NODE_ENV !== 'production') {
1034
1034
  }
1035
1035
 
1036
1036
  export { createPrimingSession, draftManager, draftQueue, evictCacheRecordsByIds, evictExpiredCacheEntries, executeAdapter, executeMutatingAdapter, getImperativeAdapterNames, invokeAdapter, invokeAdapterWithDraftToReplace, invokeAdapterWithMetadata, nimbusDraftQueue, setMetadataTTL, setUiApiRecordTTL, stopEviction, subscribeToAdapter };
1037
- // version: 1.278.0-f0e8ebcd6
1037
+ // version: 1.279.0-21eae5cb0
@@ -4,7 +4,7 @@
4
4
  * For full license text, see the LICENSE.txt file
5
5
  */
6
6
 
7
- /* *******************************************************************************************
7
+ /*
8
8
  * ATTENTION!
9
9
  * THIS IS A GENERATED FILE FROM https://github.com/salesforce-experience-platform-emu/lds-lightning-platform
10
10
  * If you would like to contribute to LDS, please follow the steps outlined in the git repo.
@@ -2287,6 +2287,13 @@ function isDefined$1(value) {
2287
2287
  return value !== undefined && value !== null;
2288
2288
  }
2289
2289
 
2290
+ /**
2291
+ * Checks if the given variable is an object
2292
+ */
2293
+ function isObject$1(value) {
2294
+ return typeof value === 'object' && value !== null;
2295
+ }
2296
+
2290
2297
  var StoreLinkStateValues$2;
2291
2298
  (function (StoreLinkStateValues) {
2292
2299
  StoreLinkStateValues[StoreLinkStateValues["NotPresent"] = 0] = "NotPresent";
@@ -2437,6 +2444,7 @@ function resolveLink$1(reader, storeLink, version) {
2437
2444
  variables: {},
2438
2445
  });
2439
2446
  }
2447
+ const readerOpaqueReferenceMap = new WeakMap();
2440
2448
  class Reader {
2441
2449
  constructor(store, variables, refresh, baseSnapshot, ttlStrategy) {
2442
2450
  this.store = store;
@@ -2901,7 +2909,12 @@ class Reader {
2901
2909
  }
2902
2910
  if (fragment.opaque) {
2903
2911
  this.checkIfChanged(result.value, { useDeepEquals: true });
2904
- const opaqueValue = this.opaqueCopy(result.value);
2912
+ if (isObject$1(result.value) && !readerOpaqueReferenceMap.has(result.value)) {
2913
+ readerOpaqueReferenceMap.set(result.value, this.opaqueCopy(result.value));
2914
+ }
2915
+ const opaqueValue = isObject$1(result.value)
2916
+ ? readerOpaqueReferenceMap.get(result.value)
2917
+ : result.value;
2905
2918
  return {
2906
2919
  state: FragmentReadResultState$1.Success,
2907
2920
  value: opaqueValue,
@@ -4028,7 +4041,7 @@ function createResourceParamsImpl(config, configMetadata) {
4028
4041
  }
4029
4042
  return resourceParams;
4030
4043
  }
4031
- // engine version: 0.154.12-43ac02c6
4044
+ // engine version: 0.154.14-2fbbff64
4032
4045
 
4033
4046
  /**
4034
4047
  * Copyright (c) 2022, Salesforce, Inc.,
@@ -4156,7 +4169,7 @@ function withDefaultLuvio(callback) {
4156
4169
  }
4157
4170
  callbacks.push(callback);
4158
4171
  }
4159
- // version: 1.278.0-f0e8ebcd6
4172
+ // version: 1.279.0-21eae5cb0
4160
4173
 
4161
4174
  // TODO [TD-0081508]: once that TD is fulfilled we can probably change this file
4162
4175
  function instrumentAdapter$1(createFunction, _metadata) {
@@ -4180,7 +4193,7 @@ var excludeStaleRecordsGate = {
4180
4193
  * For full license text, see the LICENSE.txt file
4181
4194
  */
4182
4195
 
4183
- /* *******************************************************************************************
4196
+ /*
4184
4197
  * ATTENTION!
4185
4198
  * THIS IS A GENERATED FILE FROM https://github.com/salesforce-experience-platform-emu/lds-lightning-platform
4186
4199
  * If you would like to contribute to LDS, please follow the steps outlined in the git repo.
@@ -15664,7 +15677,7 @@ function gql(literals, ...subs) {
15664
15677
  }
15665
15678
  return superResult;
15666
15679
  }
15667
- // version: 1.278.0-f0e8ebcd6
15680
+ // version: 1.279.0-21eae5cb0
15668
15681
 
15669
15682
  function unwrap(data) {
15670
15683
  // The lwc-luvio bindings import a function from lwc called "unwrap".
@@ -16589,7 +16602,7 @@ function createGraphQLWireAdapterConstructor(luvio, adapter, metadata, astResolv
16589
16602
  const { apiFamily, name } = metadata;
16590
16603
  return createGraphQLWireAdapterConstructor$1(adapter, `${apiFamily}.${name}`, luvio, astResolver);
16591
16604
  }
16592
- // version: 1.278.0-f0e8ebcd6
16605
+ // version: 1.279.0-21eae5cb0
16593
16606
 
16594
16607
  /**
16595
16608
  * Copyright (c) 2022, Salesforce, Inc.,
@@ -16688,7 +16701,7 @@ var TypeCheckShapes;
16688
16701
  TypeCheckShapes[TypeCheckShapes["Integer"] = 3] = "Integer";
16689
16702
  TypeCheckShapes[TypeCheckShapes["Unsupported"] = 4] = "Unsupported";
16690
16703
  })(TypeCheckShapes || (TypeCheckShapes = {}));
16691
- // engine version: 0.154.12-43ac02c6
16704
+ // engine version: 0.154.14-2fbbff64
16692
16705
 
16693
16706
  const { keys: ObjectKeys$3, create: ObjectCreate$3 } = Object;
16694
16707
 
@@ -28557,7 +28570,7 @@ const getRecordEditActionsAdapterFactory = (luvio) => function UiApi__getRecordE
28557
28570
  buildCachedSnapshotCachePolicy$E, buildNetworkSnapshotCachePolicy$F);
28558
28571
  };
28559
28572
 
28560
- function validate$1f(obj, path = 'ActionRelatedListSingleBatchInputRepresentation') {
28573
+ function validate$1i(obj, path = 'ActionRelatedListSingleBatchInputRepresentation') {
28561
28574
  const v_error = (() => {
28562
28575
  if (typeof obj !== 'object' || ArrayIsArray$2(obj) || obj === null) {
28563
28576
  return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
@@ -28968,7 +28981,7 @@ function typeCheckConfig$T(untrustedConfig) {
28968
28981
  const untrustedConfig_relatedListsActionParameters_array = [];
28969
28982
  for (let i = 0, arrayLength = untrustedConfig_relatedListsActionParameters.length; i < arrayLength; i++) {
28970
28983
  const untrustedConfig_relatedListsActionParameters_item = untrustedConfig_relatedListsActionParameters[i];
28971
- const referenceActionRelatedListSingleBatchInputRepresentationValidationError = validate$1f(untrustedConfig_relatedListsActionParameters_item);
28984
+ const referenceActionRelatedListSingleBatchInputRepresentationValidationError = validate$1i(untrustedConfig_relatedListsActionParameters_item);
28972
28985
  if (referenceActionRelatedListSingleBatchInputRepresentationValidationError === null) {
28973
28986
  untrustedConfig_relatedListsActionParameters_array.push(untrustedConfig_relatedListsActionParameters_item);
28974
28987
  }
@@ -31425,7 +31438,7 @@ const getListInfosByObjectNameAdapterFactory = (luvio) => function UiApi__getLis
31425
31438
  buildCachedSnapshotCachePolicy$u, buildNetworkSnapshotCachePolicy$v);
31426
31439
  };
31427
31440
 
31428
- function validate$15(obj, path = 'ListFilterByInfoInputRepresentation') {
31441
+ function validate$18(obj, path = 'ListFilterByInfoInputRepresentation') {
31429
31442
  const v_error = (() => {
31430
31443
  if (typeof obj !== 'object' || ArrayIsArray$2(obj) || obj === null) {
31431
31444
  return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
@@ -31456,7 +31469,7 @@ function validate$15(obj, path = 'ListFilterByInfoInputRepresentation') {
31456
31469
  return v_error === undefined ? null : v_error;
31457
31470
  }
31458
31471
 
31459
- function validate$14(obj, path = 'ListScopeInputRepresentation') {
31472
+ function validate$17(obj, path = 'ListScopeInputRepresentation') {
31460
31473
  const v_error = (() => {
31461
31474
  if (typeof obj !== 'object' || ArrayIsArray$2(obj) || obj === null) {
31462
31475
  return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
@@ -31580,7 +31593,7 @@ function typeCheckConfig$J(untrustedConfig) {
31580
31593
  const untrustedConfig_filteredByInfo_array = [];
31581
31594
  for (let i = 0, arrayLength = untrustedConfig_filteredByInfo.length; i < arrayLength; i++) {
31582
31595
  const untrustedConfig_filteredByInfo_item = untrustedConfig_filteredByInfo[i];
31583
- const referenceListFilterByInfoInputRepresentationValidationError = validate$15(untrustedConfig_filteredByInfo_item);
31596
+ const referenceListFilterByInfoInputRepresentationValidationError = validate$18(untrustedConfig_filteredByInfo_item);
31584
31597
  if (referenceListFilterByInfoInputRepresentationValidationError === null) {
31585
31598
  untrustedConfig_filteredByInfo_array.push(untrustedConfig_filteredByInfo_item);
31586
31599
  }
@@ -31588,7 +31601,7 @@ function typeCheckConfig$J(untrustedConfig) {
31588
31601
  config.filteredByInfo = untrustedConfig_filteredByInfo_array;
31589
31602
  }
31590
31603
  const untrustedConfig_scope = untrustedConfig.scope;
31591
- const referenceListScopeInputRepresentationValidationError = validate$14(untrustedConfig_scope);
31604
+ const referenceListScopeInputRepresentationValidationError = validate$17(untrustedConfig_scope);
31592
31605
  if (referenceListScopeInputRepresentationValidationError === null) {
31593
31606
  config.scope = untrustedConfig_scope;
31594
31607
  }
@@ -31856,7 +31869,7 @@ function typeCheckConfig$G(untrustedConfig) {
31856
31869
  const untrustedConfig_filteredByInfo_array = [];
31857
31870
  for (let i = 0, arrayLength = untrustedConfig_filteredByInfo.length; i < arrayLength; i++) {
31858
31871
  const untrustedConfig_filteredByInfo_item = untrustedConfig_filteredByInfo[i];
31859
- const referenceListFilterByInfoInputRepresentationValidationError = validate$15(untrustedConfig_filteredByInfo_item);
31872
+ const referenceListFilterByInfoInputRepresentationValidationError = validate$18(untrustedConfig_filteredByInfo_item);
31860
31873
  if (referenceListFilterByInfoInputRepresentationValidationError === null) {
31861
31874
  untrustedConfig_filteredByInfo_array.push(untrustedConfig_filteredByInfo_item);
31862
31875
  }
@@ -31864,7 +31877,7 @@ function typeCheckConfig$G(untrustedConfig) {
31864
31877
  config.filteredByInfo = untrustedConfig_filteredByInfo_array;
31865
31878
  }
31866
31879
  const untrustedConfig_scope = untrustedConfig.scope;
31867
- const referenceListScopeInputRepresentationValidationError = validate$14(untrustedConfig_scope);
31880
+ const referenceListScopeInputRepresentationValidationError = validate$17(untrustedConfig_scope);
31868
31881
  if (referenceListScopeInputRepresentationValidationError === null) {
31869
31882
  config.scope = untrustedConfig_scope;
31870
31883
  }
@@ -32615,7 +32628,7 @@ const getListPreferencesAdapterFactory = (luvio) => function UiApi__getListPrefe
32615
32628
  buildCachedSnapshotCachePolicy$r, buildNetworkSnapshotCachePolicy$s);
32616
32629
  };
32617
32630
 
32618
- function validate$Z(obj, path = 'ListOrderedByInfoInputRepresentation') {
32631
+ function validate$10(obj, path = 'ListOrderedByInfoInputRepresentation') {
32619
32632
  const v_error = (() => {
32620
32633
  if (typeof obj !== 'object' || ArrayIsArray$2(obj) || obj === null) {
32621
32634
  return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
@@ -32718,7 +32731,7 @@ function typeCheckConfig$D(untrustedConfig) {
32718
32731
  const untrustedConfig_orderedBy_array = [];
32719
32732
  for (let i = 0, arrayLength = untrustedConfig_orderedBy.length; i < arrayLength; i++) {
32720
32733
  const untrustedConfig_orderedBy_item = untrustedConfig_orderedBy[i];
32721
- const referenceListOrderedByInfoInputRepresentationValidationError = validate$Z(untrustedConfig_orderedBy_item);
32734
+ const referenceListOrderedByInfoInputRepresentationValidationError = validate$10(untrustedConfig_orderedBy_item);
32722
32735
  if (referenceListOrderedByInfoInputRepresentationValidationError === null) {
32723
32736
  untrustedConfig_orderedBy_array.push(untrustedConfig_orderedBy_item);
32724
32737
  }
@@ -36922,7 +36935,7 @@ const getRelatedListInfoAdapterFactory = (luvio) => function UiApi__getRelatedLi
36922
36935
  buildCachedSnapshotCachePolicy$d, buildNetworkSnapshotCachePolicy$e);
36923
36936
  };
36924
36937
 
36925
- function validate$z(obj, path = 'ListUserPreferenceInputRepresentation') {
36938
+ function validate$C(obj, path = 'ListUserPreferenceInputRepresentation') {
36926
36939
  const v_error = (() => {
36927
36940
  if (typeof obj !== 'object' || ArrayIsArray$2(obj) || obj === null) {
36928
36941
  return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
@@ -36999,7 +37012,7 @@ function typeCheckConfig$o(untrustedConfig) {
36999
37012
  const untrustedConfig_orderedByInfo_array = [];
37000
37013
  for (let i = 0, arrayLength = untrustedConfig_orderedByInfo.length; i < arrayLength; i++) {
37001
37014
  const untrustedConfig_orderedByInfo_item = untrustedConfig_orderedByInfo[i];
37002
- const referenceListOrderedByInfoInputRepresentationValidationError = validate$Z(untrustedConfig_orderedByInfo_item);
37015
+ const referenceListOrderedByInfoInputRepresentationValidationError = validate$10(untrustedConfig_orderedByInfo_item);
37003
37016
  if (referenceListOrderedByInfoInputRepresentationValidationError === null) {
37004
37017
  untrustedConfig_orderedByInfo_array.push(untrustedConfig_orderedByInfo_item);
37005
37018
  }
@@ -37007,7 +37020,7 @@ function typeCheckConfig$o(untrustedConfig) {
37007
37020
  config.orderedByInfo = untrustedConfig_orderedByInfo_array;
37008
37021
  }
37009
37022
  const untrustedConfig_userPreferences = untrustedConfig.userPreferences;
37010
- const referenceListUserPreferenceInputRepresentationValidationError = validate$z(untrustedConfig_userPreferences);
37023
+ const referenceListUserPreferenceInputRepresentationValidationError = validate$C(untrustedConfig_userPreferences);
37011
37024
  if (referenceListUserPreferenceInputRepresentationValidationError === null) {
37012
37025
  config.userPreferences = untrustedConfig_userPreferences;
37013
37026
  }
@@ -37662,7 +37675,7 @@ function typeCheckConfig$l(untrustedConfig) {
37662
37675
  const untrustedConfig_orderedBy_array = [];
37663
37676
  for (let i = 0, arrayLength = untrustedConfig_orderedBy.length; i < arrayLength; i++) {
37664
37677
  const untrustedConfig_orderedBy_item = untrustedConfig_orderedBy[i];
37665
- const referenceListOrderedByInfoInputRepresentationValidationError = validate$Z(untrustedConfig_orderedBy_item);
37678
+ const referenceListOrderedByInfoInputRepresentationValidationError = validate$10(untrustedConfig_orderedBy_item);
37666
37679
  if (referenceListOrderedByInfoInputRepresentationValidationError === null) {
37667
37680
  untrustedConfig_orderedBy_array.push(untrustedConfig_orderedBy_item);
37668
37681
  }
@@ -37710,7 +37723,7 @@ const updateRelatedListPreferencesAdapterFactory = (luvio) => {
37710
37723
  };
37711
37724
  };
37712
37725
 
37713
- function validate$x(obj, path = 'RelatedListRecordsSingleBatchInputRepresentation') {
37726
+ function validate$A(obj, path = 'RelatedListRecordsSingleBatchInputRepresentation') {
37714
37727
  const v_error = (() => {
37715
37728
  if (typeof obj !== 'object' || ArrayIsArray$2(obj) || obj === null) {
37716
37729
  return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
@@ -38664,7 +38677,7 @@ function typeCheckConfig$k(untrustedConfig) {
38664
38677
  const untrustedConfig_relatedListParameters_array = [];
38665
38678
  for (let i = 0, arrayLength = untrustedConfig_relatedListParameters.length; i < arrayLength; i++) {
38666
38679
  const untrustedConfig_relatedListParameters_item = untrustedConfig_relatedListParameters[i];
38667
- const referenceRelatedListRecordsSingleBatchInputRepresentationValidationError = validate$x(untrustedConfig_relatedListParameters_item);
38680
+ const referenceRelatedListRecordsSingleBatchInputRepresentationValidationError = validate$A(untrustedConfig_relatedListParameters_item);
38668
38681
  if (referenceRelatedListRecordsSingleBatchInputRepresentationValidationError === null) {
38669
38682
  untrustedConfig_relatedListParameters_array.push(untrustedConfig_relatedListParameters_item);
38670
38683
  }
@@ -44041,7 +44054,7 @@ withDefaultLuvio((luvio) => {
44041
44054
  throttle(60, 60000, setupNotifyAllListRecordUpdateAvailable(luvio));
44042
44055
  throttle(60, 60000, setupNotifyAllListInfoSummaryUpdateAvailable(luvio));
44043
44056
  });
44044
- // version: 1.278.0-a388a38f0
44057
+ // version: 1.279.0-5933c6c0c
44045
44058
 
44046
44059
  var ldsIdempotencyWriteDisabled = {
44047
44060
  isOpen: function (e) {
@@ -51645,9 +51658,25 @@ function dateTimePredicate(input, operator, field, alias) {
51645
51658
  isCaseSensitive: false,
51646
51659
  };
51647
51660
  if (value !== undefined) {
51648
- const dateFn = field.dataType === 'Date' ? 'date' : 'datetime';
51649
- predicate.value = `${dateFn}(?)`;
51650
- predicate.bindings = [value];
51661
+ if (value === null) {
51662
+ switch (predicate.operator) {
51663
+ case '=':
51664
+ predicate.operator = 'IS';
51665
+ break;
51666
+ case '!=':
51667
+ predicate.operator = 'IS NOT';
51668
+ break;
51669
+ default:
51670
+ // eslint-disable-next-line @salesforce/lds/no-error-in-production
51671
+ throw new Error(`Unsupported operator ${predicate.operator} with null value operand`);
51672
+ }
51673
+ predicate.value = 'NULL';
51674
+ }
51675
+ else {
51676
+ const dateFn = field.dataType === 'Date' ? 'date' : 'datetime';
51677
+ predicate.value = `${dateFn}(?)`;
51678
+ predicate.bindings = [value];
51679
+ }
51651
51680
  return predicate;
51652
51681
  }
51653
51682
  else if (literal !== undefined) {
@@ -54292,6 +54321,18 @@ const parentRelationshipDirective = {
54292
54321
  },
54293
54322
  ],
54294
54323
  };
54324
+ const FieldValueNodeSelectionSet = {
54325
+ kind: Kind$1.SELECTION_SET,
54326
+ selections: [
54327
+ {
54328
+ kind: Kind$1.FIELD,
54329
+ name: {
54330
+ kind: Kind$1.NAME,
54331
+ value: 'value',
54332
+ },
54333
+ },
54334
+ ],
54335
+ };
54295
54336
  async function injectSyntheticFields(originalAST, objectInfoService, draftFunctions, variables) {
54296
54337
  const inlineFragmentSelections = {};
54297
54338
  // read pass; generate ObjectInfo
@@ -54445,20 +54486,19 @@ async function injectSyntheticFields(originalAST, objectInfoService, draftFuncti
54445
54486
  },
54446
54487
  },
54447
54488
  Field: {
54448
- leave(node, key, parent, path, ancestors) {
54449
- if (node.name.value !== `node`)
54450
- return;
54451
- if (!node.selectionSet)
54489
+ leave(node, _key, _parent, _path, ancestors) {
54490
+ if (node.name.value !== 'node')
54452
54491
  return;
54453
54492
  // it could be 'recordQuery' or 'childRelationship'
54454
- const recordQueryField = findNearestConnection(ancestors);
54455
- if (!recordQueryField)
54493
+ const recordConnection = findNearestConnection(ancestors);
54494
+ if (recordConnection === undefined)
54456
54495
  return;
54457
54496
  const ancestorPath = findAncesterPath(ancestors);
54497
+ if (node.selectionSet === undefined)
54498
+ return;
54458
54499
  // spanning fields of the 'parentRelationship'. 'childRelationship' is handled by 'node' parent.
54459
54500
  const spanningSelections = [];
54460
54501
  for (const selection of node.selectionSet.selections) {
54461
- //
54462
54502
  if (isFieldSpanning(selection) || isInlineFragmentFieldSpanning(selection)) {
54463
54503
  spanningSelections.push(selection);
54464
54504
  }
@@ -55075,25 +55115,9 @@ function injectFilter(filterNode, idState, parentPath, isParentPolymorphic, obje
55075
55115
  }
55076
55116
  // spanning field needs to have the directive with 'parentRelationship'
55077
55117
  const directives = isSpanning && !isInlineFragment ? [parentRelationshipDirective] : [];
55078
- let idField = isSpanning && !isPolymorphicField
55079
- ? [
55080
- {
55081
- kind: Kind$1.FIELD,
55082
- name: {
55083
- kind: Kind$1.NAME,
55084
- value: 'Id',
55085
- },
55086
- },
55087
- ]
55088
- : [];
55118
+ let idField = isSpanning && !isPolymorphicField ? [createFieldNode('Id')] : [];
55089
55119
  // This variable change to InlineFragment if 'isInlineFragment' is true
55090
- let sel = {
55091
- kind: Kind$1.FIELD,
55092
- name: {
55093
- kind: Kind$1.NAME,
55094
- value: fieldName,
55095
- },
55096
- };
55120
+ let sel = createFieldNode(fieldName);
55097
55121
  // Check if fields is valid
55098
55122
  if (apiNames.length === 1 && !isInlineFragment) {
55099
55123
  const objectInfo = objectInfos[apiNames[0]];
@@ -55139,13 +55163,7 @@ function injectFilter(filterNode, idState, parentPath, isParentPolymorphic, obje
55139
55163
  idField = [];
55140
55164
  }
55141
55165
  if (isInlineFragment && !isTypeNameExisting) {
55142
- idField.push({
55143
- kind: Kind$1.FIELD,
55144
- name: {
55145
- kind: Kind$1.NAME,
55146
- value: '__typename',
55147
- },
55148
- });
55166
+ idField.push(createFieldNode('__typename'));
55149
55167
  }
55150
55168
  //Inject Conditions: 1. Same field does not exist 2. Same fields has different children. 3. Filter spanning field does not have Id. 4. InLineFragment does not have the '__typename' field
55151
55169
  if (!existingFields ||
@@ -55191,18 +55209,7 @@ function injectFilter(filterNode, idState, parentPath, isParentPolymorphic, obje
55191
55209
  if (!isSpanning) {
55192
55210
  sel = {
55193
55211
  ...sel,
55194
- selectionSet: {
55195
- kind: Kind$1.SELECTION_SET,
55196
- selections: [
55197
- {
55198
- kind: Kind$1.FIELD,
55199
- name: {
55200
- kind: Kind$1.NAME,
55201
- value: 'value',
55202
- },
55203
- },
55204
- ],
55205
- },
55212
+ selectionSet: FieldValueNodeSelectionSet,
55206
55213
  };
55207
55214
  }
55208
55215
  }
@@ -55223,25 +55230,7 @@ function injectFilter(filterNode, idState, parentPath, isParentPolymorphic, obje
55223
55230
  .filter(isFieldNode)
55224
55231
  .filter((subNode) => subNode.name.value === relationField);
55225
55232
  if (!existingRelationFields || existingRelationFields.length === 0) {
55226
- injectedSelections.push({
55227
- kind: Kind$1.FIELD,
55228
- name: {
55229
- kind: Kind$1.NAME,
55230
- value: relationField,
55231
- },
55232
- selectionSet: {
55233
- kind: Kind$1.SELECTION_SET,
55234
- selections: [
55235
- {
55236
- kind: Kind$1.FIELD,
55237
- name: {
55238
- kind: Kind$1.NAME,
55239
- value: 'value',
55240
- },
55241
- },
55242
- ],
55243
- },
55244
- });
55233
+ injectedSelections.push(createFieldNode(relationField, FieldValueNodeSelectionSet));
55245
55234
  }
55246
55235
  }
55247
55236
  }
@@ -55332,15 +55321,7 @@ function produceValueFieldLeaves(queryNode) {
55332
55321
  .filter(isFieldNode)
55333
55322
  .filter((subNode) => subNode.name.value === 'value');
55334
55323
  return !existingValueFields || existingValueFields.length === 0
55335
- ? [
55336
- {
55337
- kind: Kind$1.FIELD,
55338
- name: {
55339
- kind: Kind$1.NAME,
55340
- value: 'value',
55341
- },
55342
- },
55343
- ]
55324
+ ? [createFieldNode('value')]
55344
55325
  : [];
55345
55326
  }
55346
55327
  function updateIDInfo(fieldNode, idState, draftFunctions) {
@@ -55422,25 +55403,7 @@ function injectFields(selections, parentNode, parentPath, ancestors, objectInfos
55422
55403
  .filter((subNode) => subNode.name.value === relationshipId);
55423
55404
  if (existingRelationFields.length === 0) {
55424
55405
  injectedRelationshipField = [
55425
- {
55426
- kind: Kind$1.FIELD,
55427
- name: {
55428
- kind: Kind$1.NAME,
55429
- value: relationshipId,
55430
- },
55431
- selectionSet: {
55432
- kind: Kind$1.SELECTION_SET,
55433
- selections: [
55434
- {
55435
- kind: Kind$1.FIELD,
55436
- name: {
55437
- kind: Kind$1.NAME,
55438
- value: 'value',
55439
- },
55440
- },
55441
- ],
55442
- },
55443
- },
55406
+ createFieldNode(relationshipId, FieldValueNodeSelectionSet),
55444
55407
  ];
55445
55408
  }
55446
55409
  }
@@ -55448,25 +55411,13 @@ function injectFields(selections, parentNode, parentPath, ancestors, objectInfos
55448
55411
  const excludeId = isPolymorphicFieldPath(curPath, pathToObjectApiNamesMap, objectInfos);
55449
55412
  const idSelection = [];
55450
55413
  if (!excludeId && !hasIdAlready) {
55451
- idSelection.push({
55452
- kind: Kind$1.FIELD,
55453
- name: {
55454
- kind: Kind$1.NAME,
55455
- value: 'Id',
55456
- },
55457
- });
55414
+ idSelection.push(createFieldNode('Id'));
55458
55415
  }
55459
55416
  // Inject '__typename' for InlineFragment. '__typename' field acts as a reference to concrete type of a polymorphic field or a standard field in the returned GQL response, which equals to
55460
55417
  // `typedCondition` of the InlineFragment in the query AST. It is used to match JSON response with AST node. For more detail, please reference 'removeSyntheticFields'.
55461
55418
  if (isInlineFragmentNode(selection) &&
55462
55419
  !selection.selectionSet.selections.find((selection) => isFieldNode(selection) && selection.name.value === '__typename')) {
55463
- idSelection.push({
55464
- kind: Kind$1.FIELD,
55465
- name: {
55466
- kind: Kind$1.NAME,
55467
- value: '__typename',
55468
- },
55469
- });
55420
+ idSelection.push(createFieldNode('__typename'));
55470
55421
  }
55471
55422
  // 'ServiceAppointment' --> 'Contact' --> 'Id', Inject 'Contact' with Id. 'Id' field is at the sub level.
55472
55423
  const injectedSelectionIdField = idSelection.length > 0 || subInjectedSelections.length > 0
@@ -55486,6 +55437,8 @@ function injectFields(selections, parentNode, parentPath, ancestors, objectInfos
55486
55437
  const idForChildRelationship = [];
55487
55438
  // inject related field for the parent of the 'childRelationship'.
55488
55439
  const relatedIdForChildRelationship = [];
55440
+ // injected fields for DisplayValue
55441
+ let displayValueNameFields = [];
55489
55442
  // injects 'childRelatiship' at the 'node' level, it does not matter if the 'selections' is empty or not.
55490
55443
  // the operation happens at the same level as the 'childRelationship' field.
55491
55444
  if (isFieldNode(parentNode) && parentNode.selectionSet && parentNode.name.value === 'node') {
@@ -55495,13 +55448,7 @@ function injectFields(selections, parentNode, parentPath, ancestors, objectInfos
55495
55448
  if (!parentNode.selectionSet.selections
55496
55449
  .filter(isFieldNode)
55497
55450
  .some((sibling) => sibling.name.value === 'Id')) {
55498
- idForChildRelationship.push({
55499
- kind: Kind$1.FIELD,
55500
- name: {
55501
- kind: Kind$1.NAME,
55502
- value: 'Id',
55503
- },
55504
- });
55451
+ idForChildRelationship.push(createFieldNode('Id'));
55505
55452
  }
55506
55453
  }
55507
55454
  else {
@@ -55530,29 +55477,32 @@ function injectFields(selections, parentNode, parentPath, ancestors, objectInfos
55530
55477
  .filter(isFieldNode)
55531
55478
  .some((sibling) => sibling.name.value === injectedParentFieldName)) {
55532
55479
  // example: TimeSheetId { value }
55533
- relatedIdForChildRelationship.push({
55534
- kind: Kind$1.FIELD,
55535
- name: {
55536
- kind: Kind$1.NAME,
55537
- value: injectedParentFieldName,
55538
- },
55539
- selectionSet: {
55540
- kind: Kind$1.SELECTION_SET,
55541
- selections: [
55542
- {
55543
- kind: Kind$1.FIELD,
55544
- name: {
55545
- kind: Kind$1.NAME,
55546
- value: 'value',
55547
- },
55548
- },
55549
- ],
55550
- },
55551
- });
55480
+ relatedIdForChildRelationship.push(createFieldNode(injectedParentFieldName, FieldValueNodeSelectionSet));
55552
55481
  }
55553
55482
  }
55554
55483
  }
55555
55484
  }
55485
+ const { selectionSet: { selections }, } = parentNode;
55486
+ // see if node selection has DisplayValue and needs to inject
55487
+ let displayValue;
55488
+ for (let i = 0, len = selections.length; i < len; i++) {
55489
+ const node = selections[i];
55490
+ if (isFieldNode(node) && node.name.value === 'DisplayValue') {
55491
+ displayValue = node;
55492
+ break;
55493
+ }
55494
+ }
55495
+ if (displayValue !== undefined) {
55496
+ const apiName = parent.name.value;
55497
+ const objectInfo = objectInfos[apiName];
55498
+ if (objectInfo !== undefined &&
55499
+ objectInfo.nameFields !== undefined &&
55500
+ objectInfo.nameFields.length > 0) {
55501
+ displayValueNameFields = objectInfo.nameFields.map((fieldName) => {
55502
+ return createFieldNode(fieldName, FieldValueNodeSelectionSet);
55503
+ });
55504
+ }
55505
+ }
55556
55506
  }
55557
55507
  }
55558
55508
  }
@@ -55560,6 +55510,7 @@ function injectFields(selections, parentNode, parentPath, ancestors, objectInfos
55560
55510
  ...flat(parentRelaltionships),
55561
55511
  ...idForChildRelationship,
55562
55512
  ...relatedIdForChildRelationship,
55513
+ ...displayValueNameFields,
55563
55514
  ];
55564
55515
  }
55565
55516
  function dedupeFieldOrInlineFragmentNodes(duped) {
@@ -55890,6 +55841,22 @@ function referenceIdFieldForRelationship(relationshipName) {
55890
55841
  ? relationshipName.replace('__r', '__c')
55891
55842
  : `${relationshipName}Id`;
55892
55843
  }
55844
+ /**
55845
+ * Creates a FieldNode with the passed name value and optional selection set node
55846
+ * @param nameValue
55847
+ * @param selectionSet
55848
+ * @returns
55849
+ */
55850
+ function createFieldNode(nameValue, selectionSet) {
55851
+ return {
55852
+ kind: Kind$1.FIELD,
55853
+ name: {
55854
+ kind: Kind$1.NAME,
55855
+ value: nameValue,
55856
+ },
55857
+ selectionSet,
55858
+ };
55859
+ }
55893
55860
 
55894
55861
  /**
55895
55862
  * Copyright (c) 2022, Salesforce, Inc.,
@@ -62004,7 +61971,7 @@ register$1({
62004
61971
  id: '@salesforce/lds-network-adapter',
62005
61972
  instrument: instrument$2,
62006
61973
  });
62007
- // version: 1.278.0-f0e8ebcd6
61974
+ // version: 1.279.0-21eae5cb0
62008
61975
 
62009
61976
  const { create: create$3, keys: keys$3 } = Object;
62010
61977
  const { stringify: stringify$1, parse: parse$1 } = JSON;
@@ -80398,7 +80365,7 @@ register$1({
80398
80365
  configuration: { ...configurationForGraphQLAdapters$1 },
80399
80366
  instrument: instrument$1,
80400
80367
  });
80401
- // version: 1.278.0-a388a38f0
80368
+ // version: 1.279.0-5933c6c0c
80402
80369
 
80403
80370
  // On core the unstable adapters are re-exported with different names,
80404
80371
  // we want to match them here.
@@ -82652,7 +82619,7 @@ withDefaultLuvio((luvio) => {
82652
82619
  unstable_graphQL_imperative = createImperativeAdapter(luvio, createInstrumentedAdapter(ldsAdapter, adapterMetadata), adapterMetadata);
82653
82620
  graphQLImperative = ldsAdapter;
82654
82621
  });
82655
- // version: 1.278.0-a388a38f0
82622
+ // version: 1.279.0-5933c6c0c
82656
82623
 
82657
82624
  var gqlApi = /*#__PURE__*/Object.freeze({
82658
82625
  __proto__: null,
@@ -83350,7 +83317,7 @@ const callbacks$1 = [];
83350
83317
  function register(r) {
83351
83318
  callbacks$1.forEach((callback) => callback(r));
83352
83319
  }
83353
- // version: 1.278.0-f0e8ebcd6
83320
+ // version: 1.279.0-21eae5cb0
83354
83321
 
83355
83322
  /**
83356
83323
  * Returns true if the value acts like a Promise, i.e. has a "then" function,
@@ -88255,4 +88222,4 @@ const { luvio } = getRuntime();
88255
88222
  setDefaultLuvio({ luvio });
88256
88223
 
88257
88224
  export { createPrimingSession, draftManager, draftQueue, evictCacheRecordsByIds, evictExpiredCacheEntries, executeAdapter, executeMutatingAdapter, getImperativeAdapterNames, invokeAdapter, invokeAdapterWithDraftToReplace, invokeAdapterWithMetadata, nimbusDraftQueue, registerReportObserver, setMetadataTTL, setUiApiRecordTTL, stopEviction, subscribeToAdapter };
88258
- // version: 1.278.0-f0e8ebcd6
88225
+ // version: 1.279.0-21eae5cb0
@@ -4,7 +4,7 @@
4
4
  * For full license text, see the LICENSE.txt file
5
5
  */
6
6
 
7
- /* *******************************************************************************************
7
+ /*
8
8
  * ATTENTION!
9
9
  * THIS IS A GENERATED FILE FROM https://github.com/salesforce-experience-platform-emu/lds-lightning-platform
10
10
  * If you would like to contribute to LDS, please follow the steps outlined in the git repo.
@@ -2293,6 +2293,13 @@
2293
2293
  return value !== undefined && value !== null;
2294
2294
  }
2295
2295
 
2296
+ /**
2297
+ * Checks if the given variable is an object
2298
+ */
2299
+ function isObject$1(value) {
2300
+ return typeof value === 'object' && value !== null;
2301
+ }
2302
+
2296
2303
  var StoreLinkStateValues$2;
2297
2304
  (function (StoreLinkStateValues) {
2298
2305
  StoreLinkStateValues[StoreLinkStateValues["NotPresent"] = 0] = "NotPresent";
@@ -2443,6 +2450,7 @@
2443
2450
  variables: {},
2444
2451
  });
2445
2452
  }
2453
+ const readerOpaqueReferenceMap = new WeakMap();
2446
2454
  class Reader {
2447
2455
  constructor(store, variables, refresh, baseSnapshot, ttlStrategy) {
2448
2456
  this.store = store;
@@ -2907,7 +2915,12 @@
2907
2915
  }
2908
2916
  if (fragment.opaque) {
2909
2917
  this.checkIfChanged(result.value, { useDeepEquals: true });
2910
- const opaqueValue = this.opaqueCopy(result.value);
2918
+ if (isObject$1(result.value) && !readerOpaqueReferenceMap.has(result.value)) {
2919
+ readerOpaqueReferenceMap.set(result.value, this.opaqueCopy(result.value));
2920
+ }
2921
+ const opaqueValue = isObject$1(result.value)
2922
+ ? readerOpaqueReferenceMap.get(result.value)
2923
+ : result.value;
2911
2924
  return {
2912
2925
  state: FragmentReadResultState$1.Success,
2913
2926
  value: opaqueValue,
@@ -4034,7 +4047,7 @@
4034
4047
  }
4035
4048
  return resourceParams;
4036
4049
  }
4037
- // engine version: 0.154.12-43ac02c6
4050
+ // engine version: 0.154.14-2fbbff64
4038
4051
 
4039
4052
  /**
4040
4053
  * Copyright (c) 2022, Salesforce, Inc.,
@@ -4162,7 +4175,7 @@
4162
4175
  }
4163
4176
  callbacks.push(callback);
4164
4177
  }
4165
- // version: 1.278.0-f0e8ebcd6
4178
+ // version: 1.279.0-21eae5cb0
4166
4179
 
4167
4180
  // TODO [TD-0081508]: once that TD is fulfilled we can probably change this file
4168
4181
  function instrumentAdapter$1(createFunction, _metadata) {
@@ -4186,7 +4199,7 @@
4186
4199
  * For full license text, see the LICENSE.txt file
4187
4200
  */
4188
4201
 
4189
- /* *******************************************************************************************
4202
+ /*
4190
4203
  * ATTENTION!
4191
4204
  * THIS IS A GENERATED FILE FROM https://github.com/salesforce-experience-platform-emu/lds-lightning-platform
4192
4205
  * If you would like to contribute to LDS, please follow the steps outlined in the git repo.
@@ -15670,7 +15683,7 @@
15670
15683
  }
15671
15684
  return superResult;
15672
15685
  }
15673
- // version: 1.278.0-f0e8ebcd6
15686
+ // version: 1.279.0-21eae5cb0
15674
15687
 
15675
15688
  function unwrap(data) {
15676
15689
  // The lwc-luvio bindings import a function from lwc called "unwrap".
@@ -16595,7 +16608,7 @@
16595
16608
  const { apiFamily, name } = metadata;
16596
16609
  return createGraphQLWireAdapterConstructor$1(adapter, `${apiFamily}.${name}`, luvio, astResolver);
16597
16610
  }
16598
- // version: 1.278.0-f0e8ebcd6
16611
+ // version: 1.279.0-21eae5cb0
16599
16612
 
16600
16613
  /**
16601
16614
  * Copyright (c) 2022, Salesforce, Inc.,
@@ -16694,7 +16707,7 @@
16694
16707
  TypeCheckShapes[TypeCheckShapes["Integer"] = 3] = "Integer";
16695
16708
  TypeCheckShapes[TypeCheckShapes["Unsupported"] = 4] = "Unsupported";
16696
16709
  })(TypeCheckShapes || (TypeCheckShapes = {}));
16697
- // engine version: 0.154.12-43ac02c6
16710
+ // engine version: 0.154.14-2fbbff64
16698
16711
 
16699
16712
  const { keys: ObjectKeys$3, create: ObjectCreate$3 } = Object;
16700
16713
 
@@ -28563,7 +28576,7 @@
28563
28576
  buildCachedSnapshotCachePolicy$E, buildNetworkSnapshotCachePolicy$F);
28564
28577
  };
28565
28578
 
28566
- function validate$1f(obj, path = 'ActionRelatedListSingleBatchInputRepresentation') {
28579
+ function validate$1i(obj, path = 'ActionRelatedListSingleBatchInputRepresentation') {
28567
28580
  const v_error = (() => {
28568
28581
  if (typeof obj !== 'object' || ArrayIsArray$2(obj) || obj === null) {
28569
28582
  return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
@@ -28974,7 +28987,7 @@
28974
28987
  const untrustedConfig_relatedListsActionParameters_array = [];
28975
28988
  for (let i = 0, arrayLength = untrustedConfig_relatedListsActionParameters.length; i < arrayLength; i++) {
28976
28989
  const untrustedConfig_relatedListsActionParameters_item = untrustedConfig_relatedListsActionParameters[i];
28977
- const referenceActionRelatedListSingleBatchInputRepresentationValidationError = validate$1f(untrustedConfig_relatedListsActionParameters_item);
28990
+ const referenceActionRelatedListSingleBatchInputRepresentationValidationError = validate$1i(untrustedConfig_relatedListsActionParameters_item);
28978
28991
  if (referenceActionRelatedListSingleBatchInputRepresentationValidationError === null) {
28979
28992
  untrustedConfig_relatedListsActionParameters_array.push(untrustedConfig_relatedListsActionParameters_item);
28980
28993
  }
@@ -31431,7 +31444,7 @@
31431
31444
  buildCachedSnapshotCachePolicy$u, buildNetworkSnapshotCachePolicy$v);
31432
31445
  };
31433
31446
 
31434
- function validate$15(obj, path = 'ListFilterByInfoInputRepresentation') {
31447
+ function validate$18(obj, path = 'ListFilterByInfoInputRepresentation') {
31435
31448
  const v_error = (() => {
31436
31449
  if (typeof obj !== 'object' || ArrayIsArray$2(obj) || obj === null) {
31437
31450
  return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
@@ -31462,7 +31475,7 @@
31462
31475
  return v_error === undefined ? null : v_error;
31463
31476
  }
31464
31477
 
31465
- function validate$14(obj, path = 'ListScopeInputRepresentation') {
31478
+ function validate$17(obj, path = 'ListScopeInputRepresentation') {
31466
31479
  const v_error = (() => {
31467
31480
  if (typeof obj !== 'object' || ArrayIsArray$2(obj) || obj === null) {
31468
31481
  return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
@@ -31586,7 +31599,7 @@
31586
31599
  const untrustedConfig_filteredByInfo_array = [];
31587
31600
  for (let i = 0, arrayLength = untrustedConfig_filteredByInfo.length; i < arrayLength; i++) {
31588
31601
  const untrustedConfig_filteredByInfo_item = untrustedConfig_filteredByInfo[i];
31589
- const referenceListFilterByInfoInputRepresentationValidationError = validate$15(untrustedConfig_filteredByInfo_item);
31602
+ const referenceListFilterByInfoInputRepresentationValidationError = validate$18(untrustedConfig_filteredByInfo_item);
31590
31603
  if (referenceListFilterByInfoInputRepresentationValidationError === null) {
31591
31604
  untrustedConfig_filteredByInfo_array.push(untrustedConfig_filteredByInfo_item);
31592
31605
  }
@@ -31594,7 +31607,7 @@
31594
31607
  config.filteredByInfo = untrustedConfig_filteredByInfo_array;
31595
31608
  }
31596
31609
  const untrustedConfig_scope = untrustedConfig.scope;
31597
- const referenceListScopeInputRepresentationValidationError = validate$14(untrustedConfig_scope);
31610
+ const referenceListScopeInputRepresentationValidationError = validate$17(untrustedConfig_scope);
31598
31611
  if (referenceListScopeInputRepresentationValidationError === null) {
31599
31612
  config.scope = untrustedConfig_scope;
31600
31613
  }
@@ -31862,7 +31875,7 @@
31862
31875
  const untrustedConfig_filteredByInfo_array = [];
31863
31876
  for (let i = 0, arrayLength = untrustedConfig_filteredByInfo.length; i < arrayLength; i++) {
31864
31877
  const untrustedConfig_filteredByInfo_item = untrustedConfig_filteredByInfo[i];
31865
- const referenceListFilterByInfoInputRepresentationValidationError = validate$15(untrustedConfig_filteredByInfo_item);
31878
+ const referenceListFilterByInfoInputRepresentationValidationError = validate$18(untrustedConfig_filteredByInfo_item);
31866
31879
  if (referenceListFilterByInfoInputRepresentationValidationError === null) {
31867
31880
  untrustedConfig_filteredByInfo_array.push(untrustedConfig_filteredByInfo_item);
31868
31881
  }
@@ -31870,7 +31883,7 @@
31870
31883
  config.filteredByInfo = untrustedConfig_filteredByInfo_array;
31871
31884
  }
31872
31885
  const untrustedConfig_scope = untrustedConfig.scope;
31873
- const referenceListScopeInputRepresentationValidationError = validate$14(untrustedConfig_scope);
31886
+ const referenceListScopeInputRepresentationValidationError = validate$17(untrustedConfig_scope);
31874
31887
  if (referenceListScopeInputRepresentationValidationError === null) {
31875
31888
  config.scope = untrustedConfig_scope;
31876
31889
  }
@@ -32621,7 +32634,7 @@
32621
32634
  buildCachedSnapshotCachePolicy$r, buildNetworkSnapshotCachePolicy$s);
32622
32635
  };
32623
32636
 
32624
- function validate$Z(obj, path = 'ListOrderedByInfoInputRepresentation') {
32637
+ function validate$10(obj, path = 'ListOrderedByInfoInputRepresentation') {
32625
32638
  const v_error = (() => {
32626
32639
  if (typeof obj !== 'object' || ArrayIsArray$2(obj) || obj === null) {
32627
32640
  return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
@@ -32724,7 +32737,7 @@
32724
32737
  const untrustedConfig_orderedBy_array = [];
32725
32738
  for (let i = 0, arrayLength = untrustedConfig_orderedBy.length; i < arrayLength; i++) {
32726
32739
  const untrustedConfig_orderedBy_item = untrustedConfig_orderedBy[i];
32727
- const referenceListOrderedByInfoInputRepresentationValidationError = validate$Z(untrustedConfig_orderedBy_item);
32740
+ const referenceListOrderedByInfoInputRepresentationValidationError = validate$10(untrustedConfig_orderedBy_item);
32728
32741
  if (referenceListOrderedByInfoInputRepresentationValidationError === null) {
32729
32742
  untrustedConfig_orderedBy_array.push(untrustedConfig_orderedBy_item);
32730
32743
  }
@@ -36928,7 +36941,7 @@
36928
36941
  buildCachedSnapshotCachePolicy$d, buildNetworkSnapshotCachePolicy$e);
36929
36942
  };
36930
36943
 
36931
- function validate$z(obj, path = 'ListUserPreferenceInputRepresentation') {
36944
+ function validate$C(obj, path = 'ListUserPreferenceInputRepresentation') {
36932
36945
  const v_error = (() => {
36933
36946
  if (typeof obj !== 'object' || ArrayIsArray$2(obj) || obj === null) {
36934
36947
  return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
@@ -37005,7 +37018,7 @@
37005
37018
  const untrustedConfig_orderedByInfo_array = [];
37006
37019
  for (let i = 0, arrayLength = untrustedConfig_orderedByInfo.length; i < arrayLength; i++) {
37007
37020
  const untrustedConfig_orderedByInfo_item = untrustedConfig_orderedByInfo[i];
37008
- const referenceListOrderedByInfoInputRepresentationValidationError = validate$Z(untrustedConfig_orderedByInfo_item);
37021
+ const referenceListOrderedByInfoInputRepresentationValidationError = validate$10(untrustedConfig_orderedByInfo_item);
37009
37022
  if (referenceListOrderedByInfoInputRepresentationValidationError === null) {
37010
37023
  untrustedConfig_orderedByInfo_array.push(untrustedConfig_orderedByInfo_item);
37011
37024
  }
@@ -37013,7 +37026,7 @@
37013
37026
  config.orderedByInfo = untrustedConfig_orderedByInfo_array;
37014
37027
  }
37015
37028
  const untrustedConfig_userPreferences = untrustedConfig.userPreferences;
37016
- const referenceListUserPreferenceInputRepresentationValidationError = validate$z(untrustedConfig_userPreferences);
37029
+ const referenceListUserPreferenceInputRepresentationValidationError = validate$C(untrustedConfig_userPreferences);
37017
37030
  if (referenceListUserPreferenceInputRepresentationValidationError === null) {
37018
37031
  config.userPreferences = untrustedConfig_userPreferences;
37019
37032
  }
@@ -37668,7 +37681,7 @@
37668
37681
  const untrustedConfig_orderedBy_array = [];
37669
37682
  for (let i = 0, arrayLength = untrustedConfig_orderedBy.length; i < arrayLength; i++) {
37670
37683
  const untrustedConfig_orderedBy_item = untrustedConfig_orderedBy[i];
37671
- const referenceListOrderedByInfoInputRepresentationValidationError = validate$Z(untrustedConfig_orderedBy_item);
37684
+ const referenceListOrderedByInfoInputRepresentationValidationError = validate$10(untrustedConfig_orderedBy_item);
37672
37685
  if (referenceListOrderedByInfoInputRepresentationValidationError === null) {
37673
37686
  untrustedConfig_orderedBy_array.push(untrustedConfig_orderedBy_item);
37674
37687
  }
@@ -37716,7 +37729,7 @@
37716
37729
  };
37717
37730
  };
37718
37731
 
37719
- function validate$x(obj, path = 'RelatedListRecordsSingleBatchInputRepresentation') {
37732
+ function validate$A(obj, path = 'RelatedListRecordsSingleBatchInputRepresentation') {
37720
37733
  const v_error = (() => {
37721
37734
  if (typeof obj !== 'object' || ArrayIsArray$2(obj) || obj === null) {
37722
37735
  return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
@@ -38670,7 +38683,7 @@
38670
38683
  const untrustedConfig_relatedListParameters_array = [];
38671
38684
  for (let i = 0, arrayLength = untrustedConfig_relatedListParameters.length; i < arrayLength; i++) {
38672
38685
  const untrustedConfig_relatedListParameters_item = untrustedConfig_relatedListParameters[i];
38673
- const referenceRelatedListRecordsSingleBatchInputRepresentationValidationError = validate$x(untrustedConfig_relatedListParameters_item);
38686
+ const referenceRelatedListRecordsSingleBatchInputRepresentationValidationError = validate$A(untrustedConfig_relatedListParameters_item);
38674
38687
  if (referenceRelatedListRecordsSingleBatchInputRepresentationValidationError === null) {
38675
38688
  untrustedConfig_relatedListParameters_array.push(untrustedConfig_relatedListParameters_item);
38676
38689
  }
@@ -44047,7 +44060,7 @@
44047
44060
  throttle(60, 60000, setupNotifyAllListRecordUpdateAvailable(luvio));
44048
44061
  throttle(60, 60000, setupNotifyAllListInfoSummaryUpdateAvailable(luvio));
44049
44062
  });
44050
- // version: 1.278.0-a388a38f0
44063
+ // version: 1.279.0-5933c6c0c
44051
44064
 
44052
44065
  var ldsIdempotencyWriteDisabled = {
44053
44066
  isOpen: function (e) {
@@ -51651,9 +51664,25 @@
51651
51664
  isCaseSensitive: false,
51652
51665
  };
51653
51666
  if (value !== undefined) {
51654
- const dateFn = field.dataType === 'Date' ? 'date' : 'datetime';
51655
- predicate.value = `${dateFn}(?)`;
51656
- predicate.bindings = [value];
51667
+ if (value === null) {
51668
+ switch (predicate.operator) {
51669
+ case '=':
51670
+ predicate.operator = 'IS';
51671
+ break;
51672
+ case '!=':
51673
+ predicate.operator = 'IS NOT';
51674
+ break;
51675
+ default:
51676
+ // eslint-disable-next-line @salesforce/lds/no-error-in-production
51677
+ throw new Error(`Unsupported operator ${predicate.operator} with null value operand`);
51678
+ }
51679
+ predicate.value = 'NULL';
51680
+ }
51681
+ else {
51682
+ const dateFn = field.dataType === 'Date' ? 'date' : 'datetime';
51683
+ predicate.value = `${dateFn}(?)`;
51684
+ predicate.bindings = [value];
51685
+ }
51657
51686
  return predicate;
51658
51687
  }
51659
51688
  else if (literal !== undefined) {
@@ -54298,6 +54327,18 @@
54298
54327
  },
54299
54328
  ],
54300
54329
  };
54330
+ const FieldValueNodeSelectionSet = {
54331
+ kind: Kind$1.SELECTION_SET,
54332
+ selections: [
54333
+ {
54334
+ kind: Kind$1.FIELD,
54335
+ name: {
54336
+ kind: Kind$1.NAME,
54337
+ value: 'value',
54338
+ },
54339
+ },
54340
+ ],
54341
+ };
54301
54342
  async function injectSyntheticFields(originalAST, objectInfoService, draftFunctions, variables) {
54302
54343
  const inlineFragmentSelections = {};
54303
54344
  // read pass; generate ObjectInfo
@@ -54451,20 +54492,19 @@
54451
54492
  },
54452
54493
  },
54453
54494
  Field: {
54454
- leave(node, key, parent, path, ancestors) {
54455
- if (node.name.value !== `node`)
54456
- return;
54457
- if (!node.selectionSet)
54495
+ leave(node, _key, _parent, _path, ancestors) {
54496
+ if (node.name.value !== 'node')
54458
54497
  return;
54459
54498
  // it could be 'recordQuery' or 'childRelationship'
54460
- const recordQueryField = findNearestConnection(ancestors);
54461
- if (!recordQueryField)
54499
+ const recordConnection = findNearestConnection(ancestors);
54500
+ if (recordConnection === undefined)
54462
54501
  return;
54463
54502
  const ancestorPath = findAncesterPath(ancestors);
54503
+ if (node.selectionSet === undefined)
54504
+ return;
54464
54505
  // spanning fields of the 'parentRelationship'. 'childRelationship' is handled by 'node' parent.
54465
54506
  const spanningSelections = [];
54466
54507
  for (const selection of node.selectionSet.selections) {
54467
- //
54468
54508
  if (isFieldSpanning(selection) || isInlineFragmentFieldSpanning(selection)) {
54469
54509
  spanningSelections.push(selection);
54470
54510
  }
@@ -55081,25 +55121,9 @@
55081
55121
  }
55082
55122
  // spanning field needs to have the directive with 'parentRelationship'
55083
55123
  const directives = isSpanning && !isInlineFragment ? [parentRelationshipDirective] : [];
55084
- let idField = isSpanning && !isPolymorphicField
55085
- ? [
55086
- {
55087
- kind: Kind$1.FIELD,
55088
- name: {
55089
- kind: Kind$1.NAME,
55090
- value: 'Id',
55091
- },
55092
- },
55093
- ]
55094
- : [];
55124
+ let idField = isSpanning && !isPolymorphicField ? [createFieldNode('Id')] : [];
55095
55125
  // This variable change to InlineFragment if 'isInlineFragment' is true
55096
- let sel = {
55097
- kind: Kind$1.FIELD,
55098
- name: {
55099
- kind: Kind$1.NAME,
55100
- value: fieldName,
55101
- },
55102
- };
55126
+ let sel = createFieldNode(fieldName);
55103
55127
  // Check if fields is valid
55104
55128
  if (apiNames.length === 1 && !isInlineFragment) {
55105
55129
  const objectInfo = objectInfos[apiNames[0]];
@@ -55145,13 +55169,7 @@
55145
55169
  idField = [];
55146
55170
  }
55147
55171
  if (isInlineFragment && !isTypeNameExisting) {
55148
- idField.push({
55149
- kind: Kind$1.FIELD,
55150
- name: {
55151
- kind: Kind$1.NAME,
55152
- value: '__typename',
55153
- },
55154
- });
55172
+ idField.push(createFieldNode('__typename'));
55155
55173
  }
55156
55174
  //Inject Conditions: 1. Same field does not exist 2. Same fields has different children. 3. Filter spanning field does not have Id. 4. InLineFragment does not have the '__typename' field
55157
55175
  if (!existingFields ||
@@ -55197,18 +55215,7 @@
55197
55215
  if (!isSpanning) {
55198
55216
  sel = {
55199
55217
  ...sel,
55200
- selectionSet: {
55201
- kind: Kind$1.SELECTION_SET,
55202
- selections: [
55203
- {
55204
- kind: Kind$1.FIELD,
55205
- name: {
55206
- kind: Kind$1.NAME,
55207
- value: 'value',
55208
- },
55209
- },
55210
- ],
55211
- },
55218
+ selectionSet: FieldValueNodeSelectionSet,
55212
55219
  };
55213
55220
  }
55214
55221
  }
@@ -55229,25 +55236,7 @@
55229
55236
  .filter(isFieldNode)
55230
55237
  .filter((subNode) => subNode.name.value === relationField);
55231
55238
  if (!existingRelationFields || existingRelationFields.length === 0) {
55232
- injectedSelections.push({
55233
- kind: Kind$1.FIELD,
55234
- name: {
55235
- kind: Kind$1.NAME,
55236
- value: relationField,
55237
- },
55238
- selectionSet: {
55239
- kind: Kind$1.SELECTION_SET,
55240
- selections: [
55241
- {
55242
- kind: Kind$1.FIELD,
55243
- name: {
55244
- kind: Kind$1.NAME,
55245
- value: 'value',
55246
- },
55247
- },
55248
- ],
55249
- },
55250
- });
55239
+ injectedSelections.push(createFieldNode(relationField, FieldValueNodeSelectionSet));
55251
55240
  }
55252
55241
  }
55253
55242
  }
@@ -55338,15 +55327,7 @@
55338
55327
  .filter(isFieldNode)
55339
55328
  .filter((subNode) => subNode.name.value === 'value');
55340
55329
  return !existingValueFields || existingValueFields.length === 0
55341
- ? [
55342
- {
55343
- kind: Kind$1.FIELD,
55344
- name: {
55345
- kind: Kind$1.NAME,
55346
- value: 'value',
55347
- },
55348
- },
55349
- ]
55330
+ ? [createFieldNode('value')]
55350
55331
  : [];
55351
55332
  }
55352
55333
  function updateIDInfo(fieldNode, idState, draftFunctions) {
@@ -55428,25 +55409,7 @@
55428
55409
  .filter((subNode) => subNode.name.value === relationshipId);
55429
55410
  if (existingRelationFields.length === 0) {
55430
55411
  injectedRelationshipField = [
55431
- {
55432
- kind: Kind$1.FIELD,
55433
- name: {
55434
- kind: Kind$1.NAME,
55435
- value: relationshipId,
55436
- },
55437
- selectionSet: {
55438
- kind: Kind$1.SELECTION_SET,
55439
- selections: [
55440
- {
55441
- kind: Kind$1.FIELD,
55442
- name: {
55443
- kind: Kind$1.NAME,
55444
- value: 'value',
55445
- },
55446
- },
55447
- ],
55448
- },
55449
- },
55412
+ createFieldNode(relationshipId, FieldValueNodeSelectionSet),
55450
55413
  ];
55451
55414
  }
55452
55415
  }
@@ -55454,25 +55417,13 @@
55454
55417
  const excludeId = isPolymorphicFieldPath(curPath, pathToObjectApiNamesMap, objectInfos);
55455
55418
  const idSelection = [];
55456
55419
  if (!excludeId && !hasIdAlready) {
55457
- idSelection.push({
55458
- kind: Kind$1.FIELD,
55459
- name: {
55460
- kind: Kind$1.NAME,
55461
- value: 'Id',
55462
- },
55463
- });
55420
+ idSelection.push(createFieldNode('Id'));
55464
55421
  }
55465
55422
  // Inject '__typename' for InlineFragment. '__typename' field acts as a reference to concrete type of a polymorphic field or a standard field in the returned GQL response, which equals to
55466
55423
  // `typedCondition` of the InlineFragment in the query AST. It is used to match JSON response with AST node. For more detail, please reference 'removeSyntheticFields'.
55467
55424
  if (isInlineFragmentNode(selection) &&
55468
55425
  !selection.selectionSet.selections.find((selection) => isFieldNode(selection) && selection.name.value === '__typename')) {
55469
- idSelection.push({
55470
- kind: Kind$1.FIELD,
55471
- name: {
55472
- kind: Kind$1.NAME,
55473
- value: '__typename',
55474
- },
55475
- });
55426
+ idSelection.push(createFieldNode('__typename'));
55476
55427
  }
55477
55428
  // 'ServiceAppointment' --> 'Contact' --> 'Id', Inject 'Contact' with Id. 'Id' field is at the sub level.
55478
55429
  const injectedSelectionIdField = idSelection.length > 0 || subInjectedSelections.length > 0
@@ -55492,6 +55443,8 @@
55492
55443
  const idForChildRelationship = [];
55493
55444
  // inject related field for the parent of the 'childRelationship'.
55494
55445
  const relatedIdForChildRelationship = [];
55446
+ // injected fields for DisplayValue
55447
+ let displayValueNameFields = [];
55495
55448
  // injects 'childRelatiship' at the 'node' level, it does not matter if the 'selections' is empty or not.
55496
55449
  // the operation happens at the same level as the 'childRelationship' field.
55497
55450
  if (isFieldNode(parentNode) && parentNode.selectionSet && parentNode.name.value === 'node') {
@@ -55501,13 +55454,7 @@
55501
55454
  if (!parentNode.selectionSet.selections
55502
55455
  .filter(isFieldNode)
55503
55456
  .some((sibling) => sibling.name.value === 'Id')) {
55504
- idForChildRelationship.push({
55505
- kind: Kind$1.FIELD,
55506
- name: {
55507
- kind: Kind$1.NAME,
55508
- value: 'Id',
55509
- },
55510
- });
55457
+ idForChildRelationship.push(createFieldNode('Id'));
55511
55458
  }
55512
55459
  }
55513
55460
  else {
@@ -55536,29 +55483,32 @@
55536
55483
  .filter(isFieldNode)
55537
55484
  .some((sibling) => sibling.name.value === injectedParentFieldName)) {
55538
55485
  // example: TimeSheetId { value }
55539
- relatedIdForChildRelationship.push({
55540
- kind: Kind$1.FIELD,
55541
- name: {
55542
- kind: Kind$1.NAME,
55543
- value: injectedParentFieldName,
55544
- },
55545
- selectionSet: {
55546
- kind: Kind$1.SELECTION_SET,
55547
- selections: [
55548
- {
55549
- kind: Kind$1.FIELD,
55550
- name: {
55551
- kind: Kind$1.NAME,
55552
- value: 'value',
55553
- },
55554
- },
55555
- ],
55556
- },
55557
- });
55486
+ relatedIdForChildRelationship.push(createFieldNode(injectedParentFieldName, FieldValueNodeSelectionSet));
55558
55487
  }
55559
55488
  }
55560
55489
  }
55561
55490
  }
55491
+ const { selectionSet: { selections }, } = parentNode;
55492
+ // see if node selection has DisplayValue and needs to inject
55493
+ let displayValue;
55494
+ for (let i = 0, len = selections.length; i < len; i++) {
55495
+ const node = selections[i];
55496
+ if (isFieldNode(node) && node.name.value === 'DisplayValue') {
55497
+ displayValue = node;
55498
+ break;
55499
+ }
55500
+ }
55501
+ if (displayValue !== undefined) {
55502
+ const apiName = parent.name.value;
55503
+ const objectInfo = objectInfos[apiName];
55504
+ if (objectInfo !== undefined &&
55505
+ objectInfo.nameFields !== undefined &&
55506
+ objectInfo.nameFields.length > 0) {
55507
+ displayValueNameFields = objectInfo.nameFields.map((fieldName) => {
55508
+ return createFieldNode(fieldName, FieldValueNodeSelectionSet);
55509
+ });
55510
+ }
55511
+ }
55562
55512
  }
55563
55513
  }
55564
55514
  }
@@ -55566,6 +55516,7 @@
55566
55516
  ...flat(parentRelaltionships),
55567
55517
  ...idForChildRelationship,
55568
55518
  ...relatedIdForChildRelationship,
55519
+ ...displayValueNameFields,
55569
55520
  ];
55570
55521
  }
55571
55522
  function dedupeFieldOrInlineFragmentNodes(duped) {
@@ -55896,6 +55847,22 @@
55896
55847
  ? relationshipName.replace('__r', '__c')
55897
55848
  : `${relationshipName}Id`;
55898
55849
  }
55850
+ /**
55851
+ * Creates a FieldNode with the passed name value and optional selection set node
55852
+ * @param nameValue
55853
+ * @param selectionSet
55854
+ * @returns
55855
+ */
55856
+ function createFieldNode(nameValue, selectionSet) {
55857
+ return {
55858
+ kind: Kind$1.FIELD,
55859
+ name: {
55860
+ kind: Kind$1.NAME,
55861
+ value: nameValue,
55862
+ },
55863
+ selectionSet,
55864
+ };
55865
+ }
55899
55866
 
55900
55867
  /**
55901
55868
  * Copyright (c) 2022, Salesforce, Inc.,
@@ -62010,7 +61977,7 @@
62010
61977
  id: '@salesforce/lds-network-adapter',
62011
61978
  instrument: instrument$2,
62012
61979
  });
62013
- // version: 1.278.0-f0e8ebcd6
61980
+ // version: 1.279.0-21eae5cb0
62014
61981
 
62015
61982
  const { create: create$3, keys: keys$3 } = Object;
62016
61983
  const { stringify: stringify$1, parse: parse$1 } = JSON;
@@ -80404,7 +80371,7 @@
80404
80371
  configuration: { ...configurationForGraphQLAdapters$1 },
80405
80372
  instrument: instrument$1,
80406
80373
  });
80407
- // version: 1.278.0-a388a38f0
80374
+ // version: 1.279.0-5933c6c0c
80408
80375
 
80409
80376
  // On core the unstable adapters are re-exported with different names,
80410
80377
  // we want to match them here.
@@ -82658,7 +82625,7 @@
82658
82625
  unstable_graphQL_imperative = createImperativeAdapter(luvio, createInstrumentedAdapter(ldsAdapter, adapterMetadata), adapterMetadata);
82659
82626
  graphQLImperative = ldsAdapter;
82660
82627
  });
82661
- // version: 1.278.0-a388a38f0
82628
+ // version: 1.279.0-5933c6c0c
82662
82629
 
82663
82630
  var gqlApi = /*#__PURE__*/Object.freeze({
82664
82631
  __proto__: null,
@@ -83356,7 +83323,7 @@
83356
83323
  function register(r) {
83357
83324
  callbacks$1.forEach((callback) => callback(r));
83358
83325
  }
83359
- // version: 1.278.0-f0e8ebcd6
83326
+ // version: 1.279.0-21eae5cb0
83360
83327
 
83361
83328
  /**
83362
83329
  * Returns true if the value acts like a Promise, i.e. has a "then" function,
@@ -88279,4 +88246,4 @@
88279
88246
  exports.subscribeToAdapter = subscribeToAdapter;
88280
88247
 
88281
88248
  }));
88282
- // version: 1.278.0-f0e8ebcd6
88249
+ // version: 1.279.0-21eae5cb0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/lds-worker-api",
3
- "version": "1.278.0",
3
+ "version": "1.279.0",
4
4
  "license": "SEE LICENSE IN LICENSE.txt",
5
5
  "description": "",
6
6
  "main": "dist/standalone/es/lds-worker-api.js",
@@ -35,15 +35,15 @@
35
35
  },
36
36
  "devDependencies": {
37
37
  "@oat-sa/rollup-plugin-wildcard-external": "^1.0.0",
38
- "@salesforce/lds-adapters-graphql": "^1.278.0",
39
- "@salesforce/lds-adapters-uiapi": "^1.278.0",
40
- "@salesforce/lds-default-luvio": "^1.278.0",
41
- "@salesforce/lds-drafts": "^1.278.0",
42
- "@salesforce/lds-graphql-parser": "^1.278.0",
43
- "@salesforce/lds-luvio-engine": "^1.278.0",
44
- "@salesforce/lds-priming": "^1.278.0",
45
- "@salesforce/lds-runtime-mobile": "^1.278.0",
46
- "@salesforce/nimbus-plugin-lds": "^1.278.0",
38
+ "@salesforce/lds-adapters-graphql": "^1.279.0",
39
+ "@salesforce/lds-adapters-uiapi": "^1.279.0",
40
+ "@salesforce/lds-default-luvio": "^1.279.0",
41
+ "@salesforce/lds-drafts": "^1.279.0",
42
+ "@salesforce/lds-graphql-parser": "^1.279.0",
43
+ "@salesforce/lds-luvio-engine": "^1.279.0",
44
+ "@salesforce/lds-priming": "^1.279.0",
45
+ "@salesforce/lds-runtime-mobile": "^1.279.0",
46
+ "@salesforce/nimbus-plugin-lds": "^1.279.0",
47
47
  "ajv": "^8.11.0",
48
48
  "glob": "^7.1.5",
49
49
  "nimbus-types": "^2.0.0-alpha1",