@salesforce/lds-worker-api 1.228.0 → 1.228.1
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.
|
@@ -795,4 +795,4 @@ if (process.env.NODE_ENV !== 'production') {
|
|
|
795
795
|
}
|
|
796
796
|
|
|
797
797
|
export { createPrimingSession, draftManager, draftQueue, executeAdapter, executeMutatingAdapter, getImperativeAdapterNames, invokeAdapter, invokeAdapterWithDraftToReplace, invokeAdapterWithMetadata, nimbusDraftQueue, setMetadataTTL, setUiApiRecordTTL, subscribeToAdapter };
|
|
798
|
-
// version: 1.228.
|
|
798
|
+
// version: 1.228.1-4e6356f71
|
|
@@ -3841,7 +3841,7 @@ function createResourceParamsImpl(config, configMetadata) {
|
|
|
3841
3841
|
}
|
|
3842
3842
|
return resourceParams;
|
|
3843
3843
|
}
|
|
3844
|
-
// engine version: 0.145.
|
|
3844
|
+
// engine version: 0.145.2-6a13677c
|
|
3845
3845
|
|
|
3846
3846
|
/**
|
|
3847
3847
|
* Copyright (c) 2022, Salesforce, Inc.,
|
|
@@ -3968,7 +3968,7 @@ function withDefaultLuvio(callback) {
|
|
|
3968
3968
|
}
|
|
3969
3969
|
callbacks.push(callback);
|
|
3970
3970
|
}
|
|
3971
|
-
// version: 1.228.
|
|
3971
|
+
// version: 1.228.1-4e6356f71
|
|
3972
3972
|
|
|
3973
3973
|
// TODO [TD-0081508]: once that TD is fulfilled we can probably change this file
|
|
3974
3974
|
function instrumentAdapter$1(createFunction, _metadata) {
|
|
@@ -15429,7 +15429,7 @@ function gql(literals, ...subs) {
|
|
|
15429
15429
|
}
|
|
15430
15430
|
return superResult;
|
|
15431
15431
|
}
|
|
15432
|
-
// version: 1.228.
|
|
15432
|
+
// version: 1.228.1-4e6356f71
|
|
15433
15433
|
|
|
15434
15434
|
function unwrap(data) {
|
|
15435
15435
|
// The lwc-luvio bindings import a function from lwc called "unwrap".
|
|
@@ -16352,7 +16352,7 @@ function createGraphQLWireAdapterConstructor(luvio, adapter, metadata, astResolv
|
|
|
16352
16352
|
const { apiFamily, name } = metadata;
|
|
16353
16353
|
return createGraphQLWireAdapterConstructor$1(adapter, `${apiFamily}.${name}`, luvio, astResolver);
|
|
16354
16354
|
}
|
|
16355
|
-
// version: 1.228.
|
|
16355
|
+
// version: 1.228.1-4e6356f71
|
|
16356
16356
|
|
|
16357
16357
|
/**
|
|
16358
16358
|
* Copyright (c) 2022, Salesforce, Inc.,
|
|
@@ -16451,7 +16451,7 @@ var TypeCheckShapes;
|
|
|
16451
16451
|
TypeCheckShapes[TypeCheckShapes["Integer"] = 3] = "Integer";
|
|
16452
16452
|
TypeCheckShapes[TypeCheckShapes["Unsupported"] = 4] = "Unsupported";
|
|
16453
16453
|
})(TypeCheckShapes || (TypeCheckShapes = {}));
|
|
16454
|
-
// engine version: 0.145.
|
|
16454
|
+
// engine version: 0.145.2-6a13677c
|
|
16455
16455
|
|
|
16456
16456
|
const { keys: ObjectKeys$3, create: ObjectCreate$3 } = Object;
|
|
16457
16457
|
|
|
@@ -41152,7 +41152,7 @@ withDefaultLuvio((luvio) => {
|
|
|
41152
41152
|
throttle(60, 60000, createLDSAdapter(luvio, 'notifyListInfoUpdateAvailable', notifyUpdateAvailableFactory$1));
|
|
41153
41153
|
throttle(60, 60000, createLDSAdapter(luvio, 'notifyQuickActionDefaultsUpdateAvailable', notifyUpdateAvailableFactory));
|
|
41154
41154
|
});
|
|
41155
|
-
// version: 1.228.
|
|
41155
|
+
// version: 1.228.1-0cb6f94f1
|
|
41156
41156
|
|
|
41157
41157
|
var caseSensitiveUserId = '005B0000000GR4OIAW';
|
|
41158
41158
|
|
|
@@ -57810,7 +57810,7 @@ register({
|
|
|
57810
57810
|
id: '@salesforce/lds-network-adapter',
|
|
57811
57811
|
instrument: instrument$1,
|
|
57812
57812
|
});
|
|
57813
|
-
// version: 1.228.
|
|
57813
|
+
// version: 1.228.1-4e6356f71
|
|
57814
57814
|
|
|
57815
57815
|
const { create: create$2, keys: keys$2 } = Object;
|
|
57816
57816
|
const { stringify: stringify$1, parse: parse$1 } = JSON;
|
|
@@ -57825,6 +57825,21 @@ function createFragmentMap(documentNode) {
|
|
|
57825
57825
|
});
|
|
57826
57826
|
return fragments;
|
|
57827
57827
|
}
|
|
57828
|
+
function mergeFragmentWithExistingSelections(fragmentFieldSelection, existingSelections) {
|
|
57829
|
+
// Check if there is an existing selection for this field we can merge with
|
|
57830
|
+
const existingField = getRequestedField(fragmentFieldSelection.name.value, existingSelections);
|
|
57831
|
+
if (existingField === undefined) {
|
|
57832
|
+
existingSelections.push(fragmentFieldSelection);
|
|
57833
|
+
}
|
|
57834
|
+
else {
|
|
57835
|
+
if (existingField.selectionSet) {
|
|
57836
|
+
const mergedSelections = mergeSelectionSets(existingField.selectionSet, fragmentFieldSelection.selectionSet);
|
|
57837
|
+
existingField.selectionSet.selections = mergedSelections
|
|
57838
|
+
? mergedSelections.selections
|
|
57839
|
+
: [];
|
|
57840
|
+
}
|
|
57841
|
+
}
|
|
57842
|
+
}
|
|
57828
57843
|
|
|
57829
57844
|
function buildFieldState(state, fullPath, data) {
|
|
57830
57845
|
return {
|
|
@@ -57893,6 +57908,220 @@ function serializeValueNode$1(valueNode, variables) {
|
|
|
57893
57908
|
}
|
|
57894
57909
|
}
|
|
57895
57910
|
}
|
|
57911
|
+
let selectionSetRequestedFieldsWeakMap = new WeakMap();
|
|
57912
|
+
function getRequestedFieldsForType(typename, selectionSet, namedFragmentsMap, isFragmentApplicable) {
|
|
57913
|
+
let cachedRequestedFieldsConfigurations = selectionSetRequestedFieldsWeakMap.get(selectionSet);
|
|
57914
|
+
if (cachedRequestedFieldsConfigurations === undefined) {
|
|
57915
|
+
cachedRequestedFieldsConfigurations = new Map();
|
|
57916
|
+
selectionSetRequestedFieldsWeakMap.set(selectionSet, cachedRequestedFieldsConfigurations);
|
|
57917
|
+
}
|
|
57918
|
+
const cachedRequestedFieldsForType = cachedRequestedFieldsConfigurations.get(typename);
|
|
57919
|
+
if (cachedRequestedFieldsForType !== undefined) {
|
|
57920
|
+
return cachedRequestedFieldsForType;
|
|
57921
|
+
}
|
|
57922
|
+
const selections = calculateRequestedFieldsForType(typename, selectionSet, namedFragmentsMap, isFragmentApplicable);
|
|
57923
|
+
cachedRequestedFieldsConfigurations.set(typename, selections);
|
|
57924
|
+
return selections;
|
|
57925
|
+
}
|
|
57926
|
+
function getRequestedField(responseDataFieldName, requestedFields) {
|
|
57927
|
+
return requestedFields.find((fieldNode) => (fieldNode.alias && fieldNode.alias.value === responseDataFieldName) ||
|
|
57928
|
+
(!fieldNode.alias && fieldNode.name.value === responseDataFieldName));
|
|
57929
|
+
}
|
|
57930
|
+
function calculateRequestedFieldsForType(typename, selectionSet, namedFragmentsMap, isFragmentApplicable) {
|
|
57931
|
+
const selections = [];
|
|
57932
|
+
selectionSet.selections.forEach((selection) => {
|
|
57933
|
+
if (selection.kind === 'Field') {
|
|
57934
|
+
selections.push(selection);
|
|
57935
|
+
}
|
|
57936
|
+
if (selection.kind === 'InlineFragment' && isFragmentApplicable(selection, typename)) {
|
|
57937
|
+
// loops over the map to get the values.
|
|
57938
|
+
getRequestedFieldsForType(typename, selection.selectionSet, namedFragmentsMap, isFragmentApplicable).forEach((fragmentFieldSelection) => {
|
|
57939
|
+
mergeFragmentWithExistingSelections(fragmentFieldSelection, selections);
|
|
57940
|
+
});
|
|
57941
|
+
}
|
|
57942
|
+
if (selection.kind === 'FragmentSpread') {
|
|
57943
|
+
const namedFragment = namedFragmentsMap[selection.name.value];
|
|
57944
|
+
if (namedFragment && isFragmentApplicable(namedFragment, typename)) {
|
|
57945
|
+
// loops over the map to get the values.
|
|
57946
|
+
getRequestedFieldsForType(typename, namedFragment.selectionSet, namedFragmentsMap, isFragmentApplicable).forEach((fragmentFieldSelection) => {
|
|
57947
|
+
mergeFragmentWithExistingSelections(fragmentFieldSelection, selections);
|
|
57948
|
+
});
|
|
57949
|
+
}
|
|
57950
|
+
}
|
|
57951
|
+
});
|
|
57952
|
+
// Needs to happen after the selections are merged.
|
|
57953
|
+
return selections.reduce((acc, fieldNode) => {
|
|
57954
|
+
const fieldName = fieldNode.alias ? fieldNode.alias.value : fieldNode.name.value;
|
|
57955
|
+
// TODO: W-13485835. Some fields are not being merged, and this logic reproduces the current behavior in which the first field with name is being used.
|
|
57956
|
+
if (!acc.has(fieldName)) {
|
|
57957
|
+
acc.set(fieldName, fieldNode);
|
|
57958
|
+
}
|
|
57959
|
+
else {
|
|
57960
|
+
const existingFieldNode = acc.get(fieldName);
|
|
57961
|
+
acc.set(fieldName, {
|
|
57962
|
+
...existingFieldNode,
|
|
57963
|
+
selectionSet: mergeSelectionSets(existingFieldNode === null || existingFieldNode === void 0 ? void 0 : existingFieldNode.selectionSet, fieldNode.selectionSet),
|
|
57964
|
+
});
|
|
57965
|
+
}
|
|
57966
|
+
return acc;
|
|
57967
|
+
}, new Map());
|
|
57968
|
+
}
|
|
57969
|
+
function mergeSelectionSets(set1, set2) {
|
|
57970
|
+
if (!set2) {
|
|
57971
|
+
return set1;
|
|
57972
|
+
}
|
|
57973
|
+
const set1Selections = !set1 ? [] : set1.selections;
|
|
57974
|
+
const mergedSelections = [...set1Selections];
|
|
57975
|
+
for (const selection of set2.selections) {
|
|
57976
|
+
if (selection.kind === 'Field') {
|
|
57977
|
+
const existingFieldIndex = mergedSelections.findIndex((sel) => {
|
|
57978
|
+
return sel.kind === 'Field' && isExactSameField(sel, selection);
|
|
57979
|
+
});
|
|
57980
|
+
if (existingFieldIndex > -1) {
|
|
57981
|
+
const existingField = mergedSelections[existingFieldIndex];
|
|
57982
|
+
const mergedSelectionSet = mergeSelectionSets(existingField.selectionSet, selection.selectionSet);
|
|
57983
|
+
if (mergedSelectionSet) {
|
|
57984
|
+
mergedSelections[existingFieldIndex] = {
|
|
57985
|
+
...existingField,
|
|
57986
|
+
selectionSet: mergedSelectionSet,
|
|
57987
|
+
};
|
|
57988
|
+
}
|
|
57989
|
+
}
|
|
57990
|
+
else {
|
|
57991
|
+
mergedSelections.push(selection);
|
|
57992
|
+
}
|
|
57993
|
+
}
|
|
57994
|
+
else if (selection.kind === 'FragmentSpread') {
|
|
57995
|
+
if (!mergedSelections.some((sel) => sel.kind === 'FragmentSpread' &&
|
|
57996
|
+
sel.name.value === selection.name.value &&
|
|
57997
|
+
areDirectivesEqual(sel.directives, selection.directives))) {
|
|
57998
|
+
mergedSelections.push(selection);
|
|
57999
|
+
}
|
|
58000
|
+
}
|
|
58001
|
+
else if (selection.kind === 'InlineFragment') {
|
|
58002
|
+
const existingFragmentIndex = mergedSelections.findIndex((sel) => {
|
|
58003
|
+
return (sel.kind === 'InlineFragment' &&
|
|
58004
|
+
areTypeConditionsEqual(sel.typeCondition, selection.typeCondition) &&
|
|
58005
|
+
areDirectivesEqual(sel.directives, selection.directives));
|
|
58006
|
+
});
|
|
58007
|
+
if (existingFragmentIndex > -1) {
|
|
58008
|
+
const existingFragment = mergedSelections[existingFragmentIndex];
|
|
58009
|
+
const mergedSelectionSet = mergeSelectionSets(existingFragment.selectionSet, selection.selectionSet);
|
|
58010
|
+
if (mergedSelectionSet) {
|
|
58011
|
+
mergedSelections[existingFragmentIndex] = {
|
|
58012
|
+
...existingFragment,
|
|
58013
|
+
selectionSet: mergedSelectionSet,
|
|
58014
|
+
};
|
|
58015
|
+
}
|
|
58016
|
+
}
|
|
58017
|
+
else {
|
|
58018
|
+
mergedSelections.push(selection);
|
|
58019
|
+
}
|
|
58020
|
+
}
|
|
58021
|
+
}
|
|
58022
|
+
return { kind: 'SelectionSet', selections: mergedSelections };
|
|
58023
|
+
}
|
|
58024
|
+
function areArgumentsEqual(args1, args2) {
|
|
58025
|
+
if (!args1 && !args2) {
|
|
58026
|
+
return true;
|
|
58027
|
+
}
|
|
58028
|
+
// length 0 arguments is semantically equivalent to falsy arguments.
|
|
58029
|
+
if ((!args1 || args1.length === 0) && (!args2 || args2.length === 0)) {
|
|
58030
|
+
return true;
|
|
58031
|
+
}
|
|
58032
|
+
if ((!args1 && args2) || (args1 && !args2)) {
|
|
58033
|
+
return false;
|
|
58034
|
+
}
|
|
58035
|
+
if (args1.length !== args2.length) {
|
|
58036
|
+
return false;
|
|
58037
|
+
}
|
|
58038
|
+
for (const arg of args1) {
|
|
58039
|
+
const matchingArg = args2.find((a) => a.name.value === arg.name.value && areValuesEqual(a.value, arg.value));
|
|
58040
|
+
if (!matchingArg) {
|
|
58041
|
+
return false;
|
|
58042
|
+
}
|
|
58043
|
+
}
|
|
58044
|
+
return true;
|
|
58045
|
+
}
|
|
58046
|
+
function areDirectivesEqual(dirs1, dirs2) {
|
|
58047
|
+
if (!dirs1 && !dirs2) {
|
|
58048
|
+
return true;
|
|
58049
|
+
}
|
|
58050
|
+
if ((!dirs1 || dirs1.length === 0) && (!dirs2 || dirs2.length === 0)) {
|
|
58051
|
+
return true;
|
|
58052
|
+
}
|
|
58053
|
+
if ((!dirs1 && dirs2) || (dirs1 && !dirs2)) {
|
|
58054
|
+
return false;
|
|
58055
|
+
}
|
|
58056
|
+
if (dirs1.length !== dirs2.length) {
|
|
58057
|
+
return false;
|
|
58058
|
+
}
|
|
58059
|
+
for (const dir of dirs1) {
|
|
58060
|
+
const matchingDir = dirs2.find((d) => d.name.value === dir.name.value && areArgumentsEqual(d.arguments, dir.arguments));
|
|
58061
|
+
if (!matchingDir) {
|
|
58062
|
+
return false;
|
|
58063
|
+
}
|
|
58064
|
+
}
|
|
58065
|
+
return true;
|
|
58066
|
+
}
|
|
58067
|
+
function areValuesEqual(valueNode1, valueNode2) {
|
|
58068
|
+
if (valueNode1.kind !== valueNode2.kind) {
|
|
58069
|
+
return false;
|
|
58070
|
+
}
|
|
58071
|
+
// Typescript doesn't understand that the above check means that the switch applies to both values. So there will be casts here.
|
|
58072
|
+
switch (valueNode1.kind) {
|
|
58073
|
+
case 'StringValue':
|
|
58074
|
+
case 'IntValue':
|
|
58075
|
+
case 'FloatValue':
|
|
58076
|
+
case 'BooleanValue':
|
|
58077
|
+
case 'EnumValue':
|
|
58078
|
+
return valueNode1.value === valueNode2.value;
|
|
58079
|
+
case 'NullValue':
|
|
58080
|
+
return true; // Both Null value nodes? Always true.
|
|
58081
|
+
case 'ListValue':
|
|
58082
|
+
if (valueNode1.values.length !== valueNode2.values.length) {
|
|
58083
|
+
return false;
|
|
58084
|
+
}
|
|
58085
|
+
for (let i = 0; i < valueNode1.values.length; i++) {
|
|
58086
|
+
if (!areValuesEqual(valueNode1.values[i], valueNode2.values[i])) {
|
|
58087
|
+
return false;
|
|
58088
|
+
}
|
|
58089
|
+
}
|
|
58090
|
+
return true;
|
|
58091
|
+
case 'ObjectValue':
|
|
58092
|
+
if (valueNode1.fields.length !== valueNode2.fields.length) {
|
|
58093
|
+
return false;
|
|
58094
|
+
}
|
|
58095
|
+
for (let i = 0; i < valueNode1.fields.length; i++) {
|
|
58096
|
+
const field1 = valueNode1.fields[i];
|
|
58097
|
+
const field2 = valueNode2.fields.find((f) => f.name.value === field1.name.value);
|
|
58098
|
+
if (!field2 || !areValuesEqual(field1.value, field2.value)) {
|
|
58099
|
+
return false;
|
|
58100
|
+
}
|
|
58101
|
+
}
|
|
58102
|
+
return true;
|
|
58103
|
+
case 'Variable':
|
|
58104
|
+
return valueNode1.name.value === valueNode2.name.value;
|
|
58105
|
+
default:
|
|
58106
|
+
return false;
|
|
58107
|
+
}
|
|
58108
|
+
}
|
|
58109
|
+
function areTypeConditionsEqual(typeCondition1, typeCondition2) {
|
|
58110
|
+
if (typeCondition1 === undefined && typeCondition2 === undefined) {
|
|
58111
|
+
return true;
|
|
58112
|
+
}
|
|
58113
|
+
if ((!typeCondition1 && typeCondition2) || (typeCondition1 && !typeCondition2)) {
|
|
58114
|
+
return false;
|
|
58115
|
+
}
|
|
58116
|
+
return typeCondition1.name.value === typeCondition2.name.value;
|
|
58117
|
+
}
|
|
58118
|
+
function isExactSameField(field1, field2) {
|
|
58119
|
+
var _a, _b;
|
|
58120
|
+
return (field1.name.value === field2.name.value &&
|
|
58121
|
+
((_a = field1.alias) === null || _a === void 0 ? void 0 : _a.value) === ((_b = field2.alias) === null || _b === void 0 ? void 0 : _b.value) &&
|
|
58122
|
+
areArgumentsEqual(field1.arguments, field2.arguments) &&
|
|
58123
|
+
areDirectivesEqual(field1.directives, field2.directives));
|
|
58124
|
+
}
|
|
57896
58125
|
|
|
57897
58126
|
function serializeOperationNode$1(operationNode, variables, fragmentMap) {
|
|
57898
58127
|
return `${serializeSelectionSet(operationNode.selectionSet, variables, fragmentMap)}`;
|
|
@@ -57949,6 +58178,53 @@ function getOperationFromDocument(document, operationName) {
|
|
|
57949
58178
|
return operations[0]; // If a named operation is not provided, we return the first one
|
|
57950
58179
|
}
|
|
57951
58180
|
|
|
58181
|
+
const { hasOwnProperty: ObjectPrototypeHasOwnProperty$1 } = Object.prototype;
|
|
58182
|
+
// Deep merge that works on GraphQL data. It:
|
|
58183
|
+
// - recursively merges any Object properties that are present in both
|
|
58184
|
+
// - recursively merges arrays by deepMerging each Object item in the array (by index).
|
|
58185
|
+
function deepMerge(target, ...sources) {
|
|
58186
|
+
for (const source of sources) {
|
|
58187
|
+
for (const key in source) {
|
|
58188
|
+
if (ObjectPrototypeHasOwnProperty$1.call(source, key)) {
|
|
58189
|
+
const targetValue = target[key];
|
|
58190
|
+
const sourceValue = source[key];
|
|
58191
|
+
if (Array.isArray(targetValue) && Array.isArray(sourceValue)) {
|
|
58192
|
+
const maxLength = Math.max(targetValue.length, sourceValue.length);
|
|
58193
|
+
target[key] = Array.from({ length: maxLength }, (_, index) => {
|
|
58194
|
+
const targetItem = targetValue[index];
|
|
58195
|
+
const sourceItem = sourceValue[index];
|
|
58196
|
+
if (targetItem === undefined) {
|
|
58197
|
+
return sourceItem;
|
|
58198
|
+
}
|
|
58199
|
+
else if (sourceItem === undefined) {
|
|
58200
|
+
return targetItem;
|
|
58201
|
+
}
|
|
58202
|
+
else if (targetItem instanceof Object &&
|
|
58203
|
+
!Array.isArray(targetItem) &&
|
|
58204
|
+
sourceItem instanceof Object &&
|
|
58205
|
+
!Array.isArray(sourceItem)) {
|
|
58206
|
+
return deepMerge({}, targetItem, sourceItem);
|
|
58207
|
+
}
|
|
58208
|
+
else {
|
|
58209
|
+
return sourceItem;
|
|
58210
|
+
}
|
|
58211
|
+
});
|
|
58212
|
+
}
|
|
58213
|
+
else if (targetValue instanceof Object &&
|
|
58214
|
+
!Array.isArray(targetValue) &&
|
|
58215
|
+
sourceValue instanceof Object &&
|
|
58216
|
+
!Array.isArray(sourceValue)) {
|
|
58217
|
+
deepMerge(targetValue, sourceValue);
|
|
58218
|
+
}
|
|
58219
|
+
else {
|
|
58220
|
+
target[key] = sourceValue;
|
|
58221
|
+
}
|
|
58222
|
+
}
|
|
58223
|
+
}
|
|
58224
|
+
}
|
|
58225
|
+
return target;
|
|
58226
|
+
}
|
|
58227
|
+
|
|
57952
58228
|
/**
|
|
57953
58229
|
* Copyright (c) 2022, Salesforce, Inc.,
|
|
57954
58230
|
* All rights reserved.
|
|
@@ -71672,13 +71948,12 @@ function injectSelectionSet(selectionSetNode, queryTransformHelper, fragmentMap)
|
|
|
71672
71948
|
selectionSetNode === undefined) {
|
|
71673
71949
|
return;
|
|
71674
71950
|
}
|
|
71675
|
-
const
|
|
71676
|
-
|
|
71677
|
-
selections
|
|
71678
|
-
|
|
71679
|
-
|
|
71680
|
-
|
|
71681
|
-
mergedSelections.forEach(selection => {
|
|
71951
|
+
const minimumSelectionSet = {
|
|
71952
|
+
kind: 'SelectionSet',
|
|
71953
|
+
selections: queryTransformHelper.getMinimumSelections()
|
|
71954
|
+
};
|
|
71955
|
+
const mergedSelections = mergeSelectionSets(selectionSetNode, minimumSelectionSet);
|
|
71956
|
+
mergedSelections === null || mergedSelections === void 0 ? void 0 : mergedSelections.selections.forEach(selection => {
|
|
71682
71957
|
if (selection.kind === 'Field') {
|
|
71683
71958
|
const fieldType = queryTransformHelper.getFieldType(selection);
|
|
71684
71959
|
const fieldTransformHelper = fieldType === undefined ? undefined : getQueryTransformerForType(fieldType.typename);
|
|
@@ -71707,42 +71982,7 @@ function injectSelectionSet(selectionSetNode, queryTransformHelper, fragmentMap)
|
|
|
71707
71982
|
}
|
|
71708
71983
|
}
|
|
71709
71984
|
});
|
|
71710
|
-
Object.assign(selectionSetNode,
|
|
71711
|
-
selections: mergedSelections.length > 0 ? mergedSelections : undefined
|
|
71712
|
-
});
|
|
71713
|
-
}
|
|
71714
|
-
function mergeSelections(minimumSelections, querySelections) {
|
|
71715
|
-
const mergedSelections = [...querySelections];
|
|
71716
|
-
for (let i = 0; i < minimumSelections.length; i++) {
|
|
71717
|
-
const minimumSelection = minimumSelections[i];
|
|
71718
|
-
if (minimumSelection.kind === 'Field') {
|
|
71719
|
-
const existingNode = mergedSelections.find(selection => {
|
|
71720
|
-
return selection.kind === 'Field' && selection.name.value === minimumSelection.name.value && (selection.directives === undefined || selection.directives.length === 0);
|
|
71721
|
-
});
|
|
71722
|
-
if (existingNode !== undefined && existingNode.kind === 'Field') { // Maybe do better type narrowing above
|
|
71723
|
-
const existingNodeHasSubselections = existingNode.selectionSet !== undefined && existingNode.selectionSet.selections.length > 0;
|
|
71724
|
-
const minimumFieldNodeHasSubselections = minimumSelection.selectionSet !== undefined && minimumSelection.selectionSet.selections.length > 0;
|
|
71725
|
-
// TODO(correctness enhancement): this doesn't handle arugments. Add alias if arguments disagree?
|
|
71726
|
-
if (existingNodeHasSubselections && minimumFieldNodeHasSubselections) {
|
|
71727
|
-
const mergedChildSelections = mergeSelections(minimumSelection.selectionSet.selections, existingNode.selectionSet.selections);
|
|
71728
|
-
Object.assign(existingNode.selectionSet, {
|
|
71729
|
-
selections: mergedChildSelections
|
|
71730
|
-
});
|
|
71731
|
-
}
|
|
71732
|
-
}
|
|
71733
|
-
else {
|
|
71734
|
-
mergedSelections.push(minimumSelection);
|
|
71735
|
-
}
|
|
71736
|
-
}
|
|
71737
|
-
if (minimumSelection.kind === 'InlineFragment') {
|
|
71738
|
-
mergedSelections.push(minimumSelection);
|
|
71739
|
-
}
|
|
71740
|
-
if (minimumSelection.kind === 'FragmentSpread') ;
|
|
71741
|
-
}
|
|
71742
|
-
return mergedSelections;
|
|
71743
|
-
}
|
|
71744
|
-
function getRequestedField(responseDataFieldName, requestedFields) {
|
|
71745
|
-
return requestedFields.find(fieldNode => (fieldNode.alias && fieldNode.alias.value === responseDataFieldName) || (!fieldNode.alias && fieldNode.name.value === responseDataFieldName));
|
|
71985
|
+
Object.assign(selectionSetNode, mergedSelections);
|
|
71746
71986
|
}
|
|
71747
71987
|
function getPageMetadata(paginationMetadata, paginationParams) {
|
|
71748
71988
|
const metadataProperties = {};
|
|
@@ -71788,67 +72028,6 @@ function getSerializedKeyForField(field, variables, fieldType) {
|
|
|
71788
72028
|
const argumentString = mutableArgumentNodes.length > 0 ? '__' + serializeFieldArguments(mutableArgumentNodes, variables) : '';
|
|
71789
72029
|
return field.name.value + argumentString; // It should be safe to always use the fieldName - If an alias is meaningful, there will be arguments on the key also.
|
|
71790
72030
|
}
|
|
71791
|
-
function mergeFragmentWithExistingSelections(fragmentFieldSelection, existingSelections) {
|
|
71792
|
-
// Check if there is an existing selection for this field we can merge with
|
|
71793
|
-
// If this isn't done, we will see issues such as W-12293630 & W-12236456 as examples
|
|
71794
|
-
const existingField = getRequestedField(fragmentFieldSelection.name.value, existingSelections);
|
|
71795
|
-
if (existingField === undefined) {
|
|
71796
|
-
existingSelections.push(fragmentFieldSelection);
|
|
71797
|
-
}
|
|
71798
|
-
else {
|
|
71799
|
-
if (existingField.selectionSet === undefined) {
|
|
71800
|
-
existingField.selectionSet === fragmentFieldSelection.selectionSet;
|
|
71801
|
-
}
|
|
71802
|
-
else if (fragmentFieldSelection.selectionSet !== undefined) {
|
|
71803
|
-
existingField.selectionSet.selections = mergeSelections(fragmentFieldSelection.selectionSet.selections, existingField.selectionSet.selections);
|
|
71804
|
-
}
|
|
71805
|
-
}
|
|
71806
|
-
}
|
|
71807
|
-
function calculateRequestedFieldsForType(typename, selectionSet, namedFragmentsMap, isFragmentApplicable) {
|
|
71808
|
-
const selections = [];
|
|
71809
|
-
selectionSet.selections.forEach(selection => {
|
|
71810
|
-
if (selection.kind === "Field") {
|
|
71811
|
-
selections.push(selection);
|
|
71812
|
-
}
|
|
71813
|
-
if (selection.kind === "InlineFragment" && isFragmentApplicable(selection, typename)) {
|
|
71814
|
-
// loops over the map to get the values.
|
|
71815
|
-
getRequestedFieldsForType(typename, selection.selectionSet, namedFragmentsMap, isFragmentApplicable)
|
|
71816
|
-
.forEach(fragmentFieldSelection => { mergeFragmentWithExistingSelections(fragmentFieldSelection, selections); });
|
|
71817
|
-
}
|
|
71818
|
-
if (selection.kind === "FragmentSpread") {
|
|
71819
|
-
const namedFragment = namedFragmentsMap[selection.name.value];
|
|
71820
|
-
if (namedFragment && isFragmentApplicable(namedFragment, typename)) {
|
|
71821
|
-
// loops over the map to get the values.
|
|
71822
|
-
getRequestedFieldsForType(typename, namedFragment.selectionSet, namedFragmentsMap, isFragmentApplicable)
|
|
71823
|
-
.forEach(fragmentFieldSelection => { mergeFragmentWithExistingSelections(fragmentFieldSelection, selections); });
|
|
71824
|
-
}
|
|
71825
|
-
}
|
|
71826
|
-
});
|
|
71827
|
-
// Needs to happen after the selections are merged.
|
|
71828
|
-
return selections.reduce((acc, fieldNode) => {
|
|
71829
|
-
const fieldName = fieldNode.alias ? fieldNode.alias.value : fieldNode.name.value;
|
|
71830
|
-
// TODO: W-13485835. Some fields are not being merged, and this logic reproduces the current behavior in which the first field with name is being used.
|
|
71831
|
-
if (!acc.has(fieldName)) {
|
|
71832
|
-
acc.set(fieldName, fieldNode);
|
|
71833
|
-
}
|
|
71834
|
-
return acc;
|
|
71835
|
-
}, new Map());
|
|
71836
|
-
}
|
|
71837
|
-
let selectionSetRequestedFieldsWeakMap = new WeakMap();
|
|
71838
|
-
function getRequestedFieldsForType(typename, selectionSet, namedFragmentsMap, isFragmentApplicable) {
|
|
71839
|
-
let cachedRequestedFieldsConfigurations = selectionSetRequestedFieldsWeakMap.get(selectionSet);
|
|
71840
|
-
if (cachedRequestedFieldsConfigurations === undefined) {
|
|
71841
|
-
cachedRequestedFieldsConfigurations = new Map();
|
|
71842
|
-
selectionSetRequestedFieldsWeakMap.set(selectionSet, cachedRequestedFieldsConfigurations);
|
|
71843
|
-
}
|
|
71844
|
-
const cachedRequestedFieldsForType = cachedRequestedFieldsConfigurations.get(typename);
|
|
71845
|
-
if (cachedRequestedFieldsForType !== undefined) {
|
|
71846
|
-
return cachedRequestedFieldsForType;
|
|
71847
|
-
}
|
|
71848
|
-
const selections = calculateRequestedFieldsForType(typename, selectionSet, namedFragmentsMap, isFragmentApplicable);
|
|
71849
|
-
cachedRequestedFieldsConfigurations.set(typename, selections);
|
|
71850
|
-
return selections;
|
|
71851
|
-
}
|
|
71852
72031
|
function getQueryTransformerForType(typename, fragmentMap) {
|
|
71853
72032
|
switch (typename) {
|
|
71854
72033
|
case "PercentAggregate": return {
|
|
@@ -72467,18 +72646,7 @@ function selectCalculateSink(sink, field, buildSelectionForNodeFn, source, reade
|
|
|
72467
72646
|
(_a = field.selectionSet) === null || _a === void 0 ? void 0 : _a.selections.forEach((sel) => {
|
|
72468
72647
|
const builtSelection = buildSelectionForNodeFn(source, reader, field, sel, variables, fragments, parentRecordId);
|
|
72469
72648
|
if (builtSelection !== undefined) {
|
|
72470
|
-
|
|
72471
|
-
Object.keys(builtSelection).forEach((key, value) => {
|
|
72472
|
-
// We only assign a field selection in the fragment if it doesn't already exist in sink
|
|
72473
|
-
// The non-fragment selection already got the merged selections in getRequestedFieldsForType
|
|
72474
|
-
if (sink[key] === undefined) {
|
|
72475
|
-
sink[key] = builtSelection[key];
|
|
72476
|
-
}
|
|
72477
|
-
});
|
|
72478
|
-
}
|
|
72479
|
-
else {
|
|
72480
|
-
Object.assign(sink, builtSelection);
|
|
72481
|
-
}
|
|
72649
|
+
deepMerge(sink, builtSelection);
|
|
72482
72650
|
}
|
|
72483
72651
|
});
|
|
72484
72652
|
return sink;
|
|
@@ -76088,7 +76256,7 @@ register({
|
|
|
76088
76256
|
configuration: { ...configurationForGraphQLAdapters },
|
|
76089
76257
|
instrument,
|
|
76090
76258
|
});
|
|
76091
|
-
// version: 1.228.
|
|
76259
|
+
// version: 1.228.1-0cb6f94f1
|
|
76092
76260
|
|
|
76093
76261
|
// On core the unstable adapters are re-exported with different names,
|
|
76094
76262
|
|
|
@@ -78335,7 +78503,7 @@ withDefaultLuvio((luvio) => {
|
|
|
78335
78503
|
unstable_graphQL_imperative = createImperativeAdapter(luvio, createInstrumentedAdapter(ldsAdapter, adapterMetadata), adapterMetadata);
|
|
78336
78504
|
graphQLImperative = ldsAdapter;
|
|
78337
78505
|
});
|
|
78338
|
-
// version: 1.228.
|
|
78506
|
+
// version: 1.228.1-0cb6f94f1
|
|
78339
78507
|
|
|
78340
78508
|
var gqlApi = /*#__PURE__*/Object.freeze({
|
|
78341
78509
|
__proto__: null,
|
|
@@ -79049,4 +79217,4 @@ const { luvio } = getRuntime();
|
|
|
79049
79217
|
setDefaultLuvio({ luvio });
|
|
79050
79218
|
|
|
79051
79219
|
export { createPrimingSession, draftManager, draftQueue, executeAdapter, executeMutatingAdapter, getImperativeAdapterNames, invokeAdapter, invokeAdapterWithDraftToReplace, invokeAdapterWithMetadata, nimbusDraftQueue, registerReportObserver, setMetadataTTL, setUiApiRecordTTL, subscribeToAdapter };
|
|
79052
|
-
// version: 1.228.
|
|
79220
|
+
// version: 1.228.1-4e6356f71
|
|
@@ -3847,7 +3847,7 @@
|
|
|
3847
3847
|
}
|
|
3848
3848
|
return resourceParams;
|
|
3849
3849
|
}
|
|
3850
|
-
// engine version: 0.145.
|
|
3850
|
+
// engine version: 0.145.2-6a13677c
|
|
3851
3851
|
|
|
3852
3852
|
/**
|
|
3853
3853
|
* Copyright (c) 2022, Salesforce, Inc.,
|
|
@@ -3974,7 +3974,7 @@
|
|
|
3974
3974
|
}
|
|
3975
3975
|
callbacks.push(callback);
|
|
3976
3976
|
}
|
|
3977
|
-
// version: 1.228.
|
|
3977
|
+
// version: 1.228.1-4e6356f71
|
|
3978
3978
|
|
|
3979
3979
|
// TODO [TD-0081508]: once that TD is fulfilled we can probably change this file
|
|
3980
3980
|
function instrumentAdapter$1(createFunction, _metadata) {
|
|
@@ -15435,7 +15435,7 @@
|
|
|
15435
15435
|
}
|
|
15436
15436
|
return superResult;
|
|
15437
15437
|
}
|
|
15438
|
-
// version: 1.228.
|
|
15438
|
+
// version: 1.228.1-4e6356f71
|
|
15439
15439
|
|
|
15440
15440
|
function unwrap(data) {
|
|
15441
15441
|
// The lwc-luvio bindings import a function from lwc called "unwrap".
|
|
@@ -16358,7 +16358,7 @@
|
|
|
16358
16358
|
const { apiFamily, name } = metadata;
|
|
16359
16359
|
return createGraphQLWireAdapterConstructor$1(adapter, `${apiFamily}.${name}`, luvio, astResolver);
|
|
16360
16360
|
}
|
|
16361
|
-
// version: 1.228.
|
|
16361
|
+
// version: 1.228.1-4e6356f71
|
|
16362
16362
|
|
|
16363
16363
|
/**
|
|
16364
16364
|
* Copyright (c) 2022, Salesforce, Inc.,
|
|
@@ -16457,7 +16457,7 @@
|
|
|
16457
16457
|
TypeCheckShapes[TypeCheckShapes["Integer"] = 3] = "Integer";
|
|
16458
16458
|
TypeCheckShapes[TypeCheckShapes["Unsupported"] = 4] = "Unsupported";
|
|
16459
16459
|
})(TypeCheckShapes || (TypeCheckShapes = {}));
|
|
16460
|
-
// engine version: 0.145.
|
|
16460
|
+
// engine version: 0.145.2-6a13677c
|
|
16461
16461
|
|
|
16462
16462
|
const { keys: ObjectKeys$3, create: ObjectCreate$3 } = Object;
|
|
16463
16463
|
|
|
@@ -41158,7 +41158,7 @@
|
|
|
41158
41158
|
throttle(60, 60000, createLDSAdapter(luvio, 'notifyListInfoUpdateAvailable', notifyUpdateAvailableFactory$1));
|
|
41159
41159
|
throttle(60, 60000, createLDSAdapter(luvio, 'notifyQuickActionDefaultsUpdateAvailable', notifyUpdateAvailableFactory));
|
|
41160
41160
|
});
|
|
41161
|
-
// version: 1.228.
|
|
41161
|
+
// version: 1.228.1-0cb6f94f1
|
|
41162
41162
|
|
|
41163
41163
|
var caseSensitiveUserId = '005B0000000GR4OIAW';
|
|
41164
41164
|
|
|
@@ -57816,7 +57816,7 @@
|
|
|
57816
57816
|
id: '@salesforce/lds-network-adapter',
|
|
57817
57817
|
instrument: instrument$1,
|
|
57818
57818
|
});
|
|
57819
|
-
// version: 1.228.
|
|
57819
|
+
// version: 1.228.1-4e6356f71
|
|
57820
57820
|
|
|
57821
57821
|
const { create: create$2, keys: keys$2 } = Object;
|
|
57822
57822
|
const { stringify: stringify$1, parse: parse$1 } = JSON;
|
|
@@ -57831,6 +57831,21 @@
|
|
|
57831
57831
|
});
|
|
57832
57832
|
return fragments;
|
|
57833
57833
|
}
|
|
57834
|
+
function mergeFragmentWithExistingSelections(fragmentFieldSelection, existingSelections) {
|
|
57835
|
+
// Check if there is an existing selection for this field we can merge with
|
|
57836
|
+
const existingField = getRequestedField(fragmentFieldSelection.name.value, existingSelections);
|
|
57837
|
+
if (existingField === undefined) {
|
|
57838
|
+
existingSelections.push(fragmentFieldSelection);
|
|
57839
|
+
}
|
|
57840
|
+
else {
|
|
57841
|
+
if (existingField.selectionSet) {
|
|
57842
|
+
const mergedSelections = mergeSelectionSets(existingField.selectionSet, fragmentFieldSelection.selectionSet);
|
|
57843
|
+
existingField.selectionSet.selections = mergedSelections
|
|
57844
|
+
? mergedSelections.selections
|
|
57845
|
+
: [];
|
|
57846
|
+
}
|
|
57847
|
+
}
|
|
57848
|
+
}
|
|
57834
57849
|
|
|
57835
57850
|
function buildFieldState(state, fullPath, data) {
|
|
57836
57851
|
return {
|
|
@@ -57899,6 +57914,220 @@
|
|
|
57899
57914
|
}
|
|
57900
57915
|
}
|
|
57901
57916
|
}
|
|
57917
|
+
let selectionSetRequestedFieldsWeakMap = new WeakMap();
|
|
57918
|
+
function getRequestedFieldsForType(typename, selectionSet, namedFragmentsMap, isFragmentApplicable) {
|
|
57919
|
+
let cachedRequestedFieldsConfigurations = selectionSetRequestedFieldsWeakMap.get(selectionSet);
|
|
57920
|
+
if (cachedRequestedFieldsConfigurations === undefined) {
|
|
57921
|
+
cachedRequestedFieldsConfigurations = new Map();
|
|
57922
|
+
selectionSetRequestedFieldsWeakMap.set(selectionSet, cachedRequestedFieldsConfigurations);
|
|
57923
|
+
}
|
|
57924
|
+
const cachedRequestedFieldsForType = cachedRequestedFieldsConfigurations.get(typename);
|
|
57925
|
+
if (cachedRequestedFieldsForType !== undefined) {
|
|
57926
|
+
return cachedRequestedFieldsForType;
|
|
57927
|
+
}
|
|
57928
|
+
const selections = calculateRequestedFieldsForType(typename, selectionSet, namedFragmentsMap, isFragmentApplicable);
|
|
57929
|
+
cachedRequestedFieldsConfigurations.set(typename, selections);
|
|
57930
|
+
return selections;
|
|
57931
|
+
}
|
|
57932
|
+
function getRequestedField(responseDataFieldName, requestedFields) {
|
|
57933
|
+
return requestedFields.find((fieldNode) => (fieldNode.alias && fieldNode.alias.value === responseDataFieldName) ||
|
|
57934
|
+
(!fieldNode.alias && fieldNode.name.value === responseDataFieldName));
|
|
57935
|
+
}
|
|
57936
|
+
function calculateRequestedFieldsForType(typename, selectionSet, namedFragmentsMap, isFragmentApplicable) {
|
|
57937
|
+
const selections = [];
|
|
57938
|
+
selectionSet.selections.forEach((selection) => {
|
|
57939
|
+
if (selection.kind === 'Field') {
|
|
57940
|
+
selections.push(selection);
|
|
57941
|
+
}
|
|
57942
|
+
if (selection.kind === 'InlineFragment' && isFragmentApplicable(selection, typename)) {
|
|
57943
|
+
// loops over the map to get the values.
|
|
57944
|
+
getRequestedFieldsForType(typename, selection.selectionSet, namedFragmentsMap, isFragmentApplicable).forEach((fragmentFieldSelection) => {
|
|
57945
|
+
mergeFragmentWithExistingSelections(fragmentFieldSelection, selections);
|
|
57946
|
+
});
|
|
57947
|
+
}
|
|
57948
|
+
if (selection.kind === 'FragmentSpread') {
|
|
57949
|
+
const namedFragment = namedFragmentsMap[selection.name.value];
|
|
57950
|
+
if (namedFragment && isFragmentApplicable(namedFragment, typename)) {
|
|
57951
|
+
// loops over the map to get the values.
|
|
57952
|
+
getRequestedFieldsForType(typename, namedFragment.selectionSet, namedFragmentsMap, isFragmentApplicable).forEach((fragmentFieldSelection) => {
|
|
57953
|
+
mergeFragmentWithExistingSelections(fragmentFieldSelection, selections);
|
|
57954
|
+
});
|
|
57955
|
+
}
|
|
57956
|
+
}
|
|
57957
|
+
});
|
|
57958
|
+
// Needs to happen after the selections are merged.
|
|
57959
|
+
return selections.reduce((acc, fieldNode) => {
|
|
57960
|
+
const fieldName = fieldNode.alias ? fieldNode.alias.value : fieldNode.name.value;
|
|
57961
|
+
// TODO: W-13485835. Some fields are not being merged, and this logic reproduces the current behavior in which the first field with name is being used.
|
|
57962
|
+
if (!acc.has(fieldName)) {
|
|
57963
|
+
acc.set(fieldName, fieldNode);
|
|
57964
|
+
}
|
|
57965
|
+
else {
|
|
57966
|
+
const existingFieldNode = acc.get(fieldName);
|
|
57967
|
+
acc.set(fieldName, {
|
|
57968
|
+
...existingFieldNode,
|
|
57969
|
+
selectionSet: mergeSelectionSets(existingFieldNode === null || existingFieldNode === void 0 ? void 0 : existingFieldNode.selectionSet, fieldNode.selectionSet),
|
|
57970
|
+
});
|
|
57971
|
+
}
|
|
57972
|
+
return acc;
|
|
57973
|
+
}, new Map());
|
|
57974
|
+
}
|
|
57975
|
+
function mergeSelectionSets(set1, set2) {
|
|
57976
|
+
if (!set2) {
|
|
57977
|
+
return set1;
|
|
57978
|
+
}
|
|
57979
|
+
const set1Selections = !set1 ? [] : set1.selections;
|
|
57980
|
+
const mergedSelections = [...set1Selections];
|
|
57981
|
+
for (const selection of set2.selections) {
|
|
57982
|
+
if (selection.kind === 'Field') {
|
|
57983
|
+
const existingFieldIndex = mergedSelections.findIndex((sel) => {
|
|
57984
|
+
return sel.kind === 'Field' && isExactSameField(sel, selection);
|
|
57985
|
+
});
|
|
57986
|
+
if (existingFieldIndex > -1) {
|
|
57987
|
+
const existingField = mergedSelections[existingFieldIndex];
|
|
57988
|
+
const mergedSelectionSet = mergeSelectionSets(existingField.selectionSet, selection.selectionSet);
|
|
57989
|
+
if (mergedSelectionSet) {
|
|
57990
|
+
mergedSelections[existingFieldIndex] = {
|
|
57991
|
+
...existingField,
|
|
57992
|
+
selectionSet: mergedSelectionSet,
|
|
57993
|
+
};
|
|
57994
|
+
}
|
|
57995
|
+
}
|
|
57996
|
+
else {
|
|
57997
|
+
mergedSelections.push(selection);
|
|
57998
|
+
}
|
|
57999
|
+
}
|
|
58000
|
+
else if (selection.kind === 'FragmentSpread') {
|
|
58001
|
+
if (!mergedSelections.some((sel) => sel.kind === 'FragmentSpread' &&
|
|
58002
|
+
sel.name.value === selection.name.value &&
|
|
58003
|
+
areDirectivesEqual(sel.directives, selection.directives))) {
|
|
58004
|
+
mergedSelections.push(selection);
|
|
58005
|
+
}
|
|
58006
|
+
}
|
|
58007
|
+
else if (selection.kind === 'InlineFragment') {
|
|
58008
|
+
const existingFragmentIndex = mergedSelections.findIndex((sel) => {
|
|
58009
|
+
return (sel.kind === 'InlineFragment' &&
|
|
58010
|
+
areTypeConditionsEqual(sel.typeCondition, selection.typeCondition) &&
|
|
58011
|
+
areDirectivesEqual(sel.directives, selection.directives));
|
|
58012
|
+
});
|
|
58013
|
+
if (existingFragmentIndex > -1) {
|
|
58014
|
+
const existingFragment = mergedSelections[existingFragmentIndex];
|
|
58015
|
+
const mergedSelectionSet = mergeSelectionSets(existingFragment.selectionSet, selection.selectionSet);
|
|
58016
|
+
if (mergedSelectionSet) {
|
|
58017
|
+
mergedSelections[existingFragmentIndex] = {
|
|
58018
|
+
...existingFragment,
|
|
58019
|
+
selectionSet: mergedSelectionSet,
|
|
58020
|
+
};
|
|
58021
|
+
}
|
|
58022
|
+
}
|
|
58023
|
+
else {
|
|
58024
|
+
mergedSelections.push(selection);
|
|
58025
|
+
}
|
|
58026
|
+
}
|
|
58027
|
+
}
|
|
58028
|
+
return { kind: 'SelectionSet', selections: mergedSelections };
|
|
58029
|
+
}
|
|
58030
|
+
function areArgumentsEqual(args1, args2) {
|
|
58031
|
+
if (!args1 && !args2) {
|
|
58032
|
+
return true;
|
|
58033
|
+
}
|
|
58034
|
+
// length 0 arguments is semantically equivalent to falsy arguments.
|
|
58035
|
+
if ((!args1 || args1.length === 0) && (!args2 || args2.length === 0)) {
|
|
58036
|
+
return true;
|
|
58037
|
+
}
|
|
58038
|
+
if ((!args1 && args2) || (args1 && !args2)) {
|
|
58039
|
+
return false;
|
|
58040
|
+
}
|
|
58041
|
+
if (args1.length !== args2.length) {
|
|
58042
|
+
return false;
|
|
58043
|
+
}
|
|
58044
|
+
for (const arg of args1) {
|
|
58045
|
+
const matchingArg = args2.find((a) => a.name.value === arg.name.value && areValuesEqual(a.value, arg.value));
|
|
58046
|
+
if (!matchingArg) {
|
|
58047
|
+
return false;
|
|
58048
|
+
}
|
|
58049
|
+
}
|
|
58050
|
+
return true;
|
|
58051
|
+
}
|
|
58052
|
+
function areDirectivesEqual(dirs1, dirs2) {
|
|
58053
|
+
if (!dirs1 && !dirs2) {
|
|
58054
|
+
return true;
|
|
58055
|
+
}
|
|
58056
|
+
if ((!dirs1 || dirs1.length === 0) && (!dirs2 || dirs2.length === 0)) {
|
|
58057
|
+
return true;
|
|
58058
|
+
}
|
|
58059
|
+
if ((!dirs1 && dirs2) || (dirs1 && !dirs2)) {
|
|
58060
|
+
return false;
|
|
58061
|
+
}
|
|
58062
|
+
if (dirs1.length !== dirs2.length) {
|
|
58063
|
+
return false;
|
|
58064
|
+
}
|
|
58065
|
+
for (const dir of dirs1) {
|
|
58066
|
+
const matchingDir = dirs2.find((d) => d.name.value === dir.name.value && areArgumentsEqual(d.arguments, dir.arguments));
|
|
58067
|
+
if (!matchingDir) {
|
|
58068
|
+
return false;
|
|
58069
|
+
}
|
|
58070
|
+
}
|
|
58071
|
+
return true;
|
|
58072
|
+
}
|
|
58073
|
+
function areValuesEqual(valueNode1, valueNode2) {
|
|
58074
|
+
if (valueNode1.kind !== valueNode2.kind) {
|
|
58075
|
+
return false;
|
|
58076
|
+
}
|
|
58077
|
+
// Typescript doesn't understand that the above check means that the switch applies to both values. So there will be casts here.
|
|
58078
|
+
switch (valueNode1.kind) {
|
|
58079
|
+
case 'StringValue':
|
|
58080
|
+
case 'IntValue':
|
|
58081
|
+
case 'FloatValue':
|
|
58082
|
+
case 'BooleanValue':
|
|
58083
|
+
case 'EnumValue':
|
|
58084
|
+
return valueNode1.value === valueNode2.value;
|
|
58085
|
+
case 'NullValue':
|
|
58086
|
+
return true; // Both Null value nodes? Always true.
|
|
58087
|
+
case 'ListValue':
|
|
58088
|
+
if (valueNode1.values.length !== valueNode2.values.length) {
|
|
58089
|
+
return false;
|
|
58090
|
+
}
|
|
58091
|
+
for (let i = 0; i < valueNode1.values.length; i++) {
|
|
58092
|
+
if (!areValuesEqual(valueNode1.values[i], valueNode2.values[i])) {
|
|
58093
|
+
return false;
|
|
58094
|
+
}
|
|
58095
|
+
}
|
|
58096
|
+
return true;
|
|
58097
|
+
case 'ObjectValue':
|
|
58098
|
+
if (valueNode1.fields.length !== valueNode2.fields.length) {
|
|
58099
|
+
return false;
|
|
58100
|
+
}
|
|
58101
|
+
for (let i = 0; i < valueNode1.fields.length; i++) {
|
|
58102
|
+
const field1 = valueNode1.fields[i];
|
|
58103
|
+
const field2 = valueNode2.fields.find((f) => f.name.value === field1.name.value);
|
|
58104
|
+
if (!field2 || !areValuesEqual(field1.value, field2.value)) {
|
|
58105
|
+
return false;
|
|
58106
|
+
}
|
|
58107
|
+
}
|
|
58108
|
+
return true;
|
|
58109
|
+
case 'Variable':
|
|
58110
|
+
return valueNode1.name.value === valueNode2.name.value;
|
|
58111
|
+
default:
|
|
58112
|
+
return false;
|
|
58113
|
+
}
|
|
58114
|
+
}
|
|
58115
|
+
function areTypeConditionsEqual(typeCondition1, typeCondition2) {
|
|
58116
|
+
if (typeCondition1 === undefined && typeCondition2 === undefined) {
|
|
58117
|
+
return true;
|
|
58118
|
+
}
|
|
58119
|
+
if ((!typeCondition1 && typeCondition2) || (typeCondition1 && !typeCondition2)) {
|
|
58120
|
+
return false;
|
|
58121
|
+
}
|
|
58122
|
+
return typeCondition1.name.value === typeCondition2.name.value;
|
|
58123
|
+
}
|
|
58124
|
+
function isExactSameField(field1, field2) {
|
|
58125
|
+
var _a, _b;
|
|
58126
|
+
return (field1.name.value === field2.name.value &&
|
|
58127
|
+
((_a = field1.alias) === null || _a === void 0 ? void 0 : _a.value) === ((_b = field2.alias) === null || _b === void 0 ? void 0 : _b.value) &&
|
|
58128
|
+
areArgumentsEqual(field1.arguments, field2.arguments) &&
|
|
58129
|
+
areDirectivesEqual(field1.directives, field2.directives));
|
|
58130
|
+
}
|
|
57902
58131
|
|
|
57903
58132
|
function serializeOperationNode$1(operationNode, variables, fragmentMap) {
|
|
57904
58133
|
return `${serializeSelectionSet(operationNode.selectionSet, variables, fragmentMap)}`;
|
|
@@ -57955,6 +58184,53 @@
|
|
|
57955
58184
|
return operations[0]; // If a named operation is not provided, we return the first one
|
|
57956
58185
|
}
|
|
57957
58186
|
|
|
58187
|
+
const { hasOwnProperty: ObjectPrototypeHasOwnProperty$1 } = Object.prototype;
|
|
58188
|
+
// Deep merge that works on GraphQL data. It:
|
|
58189
|
+
// - recursively merges any Object properties that are present in both
|
|
58190
|
+
// - recursively merges arrays by deepMerging each Object item in the array (by index).
|
|
58191
|
+
function deepMerge(target, ...sources) {
|
|
58192
|
+
for (const source of sources) {
|
|
58193
|
+
for (const key in source) {
|
|
58194
|
+
if (ObjectPrototypeHasOwnProperty$1.call(source, key)) {
|
|
58195
|
+
const targetValue = target[key];
|
|
58196
|
+
const sourceValue = source[key];
|
|
58197
|
+
if (Array.isArray(targetValue) && Array.isArray(sourceValue)) {
|
|
58198
|
+
const maxLength = Math.max(targetValue.length, sourceValue.length);
|
|
58199
|
+
target[key] = Array.from({ length: maxLength }, (_, index) => {
|
|
58200
|
+
const targetItem = targetValue[index];
|
|
58201
|
+
const sourceItem = sourceValue[index];
|
|
58202
|
+
if (targetItem === undefined) {
|
|
58203
|
+
return sourceItem;
|
|
58204
|
+
}
|
|
58205
|
+
else if (sourceItem === undefined) {
|
|
58206
|
+
return targetItem;
|
|
58207
|
+
}
|
|
58208
|
+
else if (targetItem instanceof Object &&
|
|
58209
|
+
!Array.isArray(targetItem) &&
|
|
58210
|
+
sourceItem instanceof Object &&
|
|
58211
|
+
!Array.isArray(sourceItem)) {
|
|
58212
|
+
return deepMerge({}, targetItem, sourceItem);
|
|
58213
|
+
}
|
|
58214
|
+
else {
|
|
58215
|
+
return sourceItem;
|
|
58216
|
+
}
|
|
58217
|
+
});
|
|
58218
|
+
}
|
|
58219
|
+
else if (targetValue instanceof Object &&
|
|
58220
|
+
!Array.isArray(targetValue) &&
|
|
58221
|
+
sourceValue instanceof Object &&
|
|
58222
|
+
!Array.isArray(sourceValue)) {
|
|
58223
|
+
deepMerge(targetValue, sourceValue);
|
|
58224
|
+
}
|
|
58225
|
+
else {
|
|
58226
|
+
target[key] = sourceValue;
|
|
58227
|
+
}
|
|
58228
|
+
}
|
|
58229
|
+
}
|
|
58230
|
+
}
|
|
58231
|
+
return target;
|
|
58232
|
+
}
|
|
58233
|
+
|
|
57958
58234
|
/**
|
|
57959
58235
|
* Copyright (c) 2022, Salesforce, Inc.,
|
|
57960
58236
|
* All rights reserved.
|
|
@@ -71678,13 +71954,12 @@
|
|
|
71678
71954
|
selectionSetNode === undefined) {
|
|
71679
71955
|
return;
|
|
71680
71956
|
}
|
|
71681
|
-
const
|
|
71682
|
-
|
|
71683
|
-
selections
|
|
71684
|
-
|
|
71685
|
-
|
|
71686
|
-
|
|
71687
|
-
mergedSelections.forEach(selection => {
|
|
71957
|
+
const minimumSelectionSet = {
|
|
71958
|
+
kind: 'SelectionSet',
|
|
71959
|
+
selections: queryTransformHelper.getMinimumSelections()
|
|
71960
|
+
};
|
|
71961
|
+
const mergedSelections = mergeSelectionSets(selectionSetNode, minimumSelectionSet);
|
|
71962
|
+
mergedSelections === null || mergedSelections === void 0 ? void 0 : mergedSelections.selections.forEach(selection => {
|
|
71688
71963
|
if (selection.kind === 'Field') {
|
|
71689
71964
|
const fieldType = queryTransformHelper.getFieldType(selection);
|
|
71690
71965
|
const fieldTransformHelper = fieldType === undefined ? undefined : getQueryTransformerForType(fieldType.typename);
|
|
@@ -71713,42 +71988,7 @@
|
|
|
71713
71988
|
}
|
|
71714
71989
|
}
|
|
71715
71990
|
});
|
|
71716
|
-
Object.assign(selectionSetNode,
|
|
71717
|
-
selections: mergedSelections.length > 0 ? mergedSelections : undefined
|
|
71718
|
-
});
|
|
71719
|
-
}
|
|
71720
|
-
function mergeSelections(minimumSelections, querySelections) {
|
|
71721
|
-
const mergedSelections = [...querySelections];
|
|
71722
|
-
for (let i = 0; i < minimumSelections.length; i++) {
|
|
71723
|
-
const minimumSelection = minimumSelections[i];
|
|
71724
|
-
if (minimumSelection.kind === 'Field') {
|
|
71725
|
-
const existingNode = mergedSelections.find(selection => {
|
|
71726
|
-
return selection.kind === 'Field' && selection.name.value === minimumSelection.name.value && (selection.directives === undefined || selection.directives.length === 0);
|
|
71727
|
-
});
|
|
71728
|
-
if (existingNode !== undefined && existingNode.kind === 'Field') { // Maybe do better type narrowing above
|
|
71729
|
-
const existingNodeHasSubselections = existingNode.selectionSet !== undefined && existingNode.selectionSet.selections.length > 0;
|
|
71730
|
-
const minimumFieldNodeHasSubselections = minimumSelection.selectionSet !== undefined && minimumSelection.selectionSet.selections.length > 0;
|
|
71731
|
-
// TODO(correctness enhancement): this doesn't handle arugments. Add alias if arguments disagree?
|
|
71732
|
-
if (existingNodeHasSubselections && minimumFieldNodeHasSubselections) {
|
|
71733
|
-
const mergedChildSelections = mergeSelections(minimumSelection.selectionSet.selections, existingNode.selectionSet.selections);
|
|
71734
|
-
Object.assign(existingNode.selectionSet, {
|
|
71735
|
-
selections: mergedChildSelections
|
|
71736
|
-
});
|
|
71737
|
-
}
|
|
71738
|
-
}
|
|
71739
|
-
else {
|
|
71740
|
-
mergedSelections.push(minimumSelection);
|
|
71741
|
-
}
|
|
71742
|
-
}
|
|
71743
|
-
if (minimumSelection.kind === 'InlineFragment') {
|
|
71744
|
-
mergedSelections.push(minimumSelection);
|
|
71745
|
-
}
|
|
71746
|
-
if (minimumSelection.kind === 'FragmentSpread') ;
|
|
71747
|
-
}
|
|
71748
|
-
return mergedSelections;
|
|
71749
|
-
}
|
|
71750
|
-
function getRequestedField(responseDataFieldName, requestedFields) {
|
|
71751
|
-
return requestedFields.find(fieldNode => (fieldNode.alias && fieldNode.alias.value === responseDataFieldName) || (!fieldNode.alias && fieldNode.name.value === responseDataFieldName));
|
|
71991
|
+
Object.assign(selectionSetNode, mergedSelections);
|
|
71752
71992
|
}
|
|
71753
71993
|
function getPageMetadata(paginationMetadata, paginationParams) {
|
|
71754
71994
|
const metadataProperties = {};
|
|
@@ -71794,67 +72034,6 @@
|
|
|
71794
72034
|
const argumentString = mutableArgumentNodes.length > 0 ? '__' + serializeFieldArguments(mutableArgumentNodes, variables) : '';
|
|
71795
72035
|
return field.name.value + argumentString; // It should be safe to always use the fieldName - If an alias is meaningful, there will be arguments on the key also.
|
|
71796
72036
|
}
|
|
71797
|
-
function mergeFragmentWithExistingSelections(fragmentFieldSelection, existingSelections) {
|
|
71798
|
-
// Check if there is an existing selection for this field we can merge with
|
|
71799
|
-
// If this isn't done, we will see issues such as W-12293630 & W-12236456 as examples
|
|
71800
|
-
const existingField = getRequestedField(fragmentFieldSelection.name.value, existingSelections);
|
|
71801
|
-
if (existingField === undefined) {
|
|
71802
|
-
existingSelections.push(fragmentFieldSelection);
|
|
71803
|
-
}
|
|
71804
|
-
else {
|
|
71805
|
-
if (existingField.selectionSet === undefined) {
|
|
71806
|
-
existingField.selectionSet === fragmentFieldSelection.selectionSet;
|
|
71807
|
-
}
|
|
71808
|
-
else if (fragmentFieldSelection.selectionSet !== undefined) {
|
|
71809
|
-
existingField.selectionSet.selections = mergeSelections(fragmentFieldSelection.selectionSet.selections, existingField.selectionSet.selections);
|
|
71810
|
-
}
|
|
71811
|
-
}
|
|
71812
|
-
}
|
|
71813
|
-
function calculateRequestedFieldsForType(typename, selectionSet, namedFragmentsMap, isFragmentApplicable) {
|
|
71814
|
-
const selections = [];
|
|
71815
|
-
selectionSet.selections.forEach(selection => {
|
|
71816
|
-
if (selection.kind === "Field") {
|
|
71817
|
-
selections.push(selection);
|
|
71818
|
-
}
|
|
71819
|
-
if (selection.kind === "InlineFragment" && isFragmentApplicable(selection, typename)) {
|
|
71820
|
-
// loops over the map to get the values.
|
|
71821
|
-
getRequestedFieldsForType(typename, selection.selectionSet, namedFragmentsMap, isFragmentApplicable)
|
|
71822
|
-
.forEach(fragmentFieldSelection => { mergeFragmentWithExistingSelections(fragmentFieldSelection, selections); });
|
|
71823
|
-
}
|
|
71824
|
-
if (selection.kind === "FragmentSpread") {
|
|
71825
|
-
const namedFragment = namedFragmentsMap[selection.name.value];
|
|
71826
|
-
if (namedFragment && isFragmentApplicable(namedFragment, typename)) {
|
|
71827
|
-
// loops over the map to get the values.
|
|
71828
|
-
getRequestedFieldsForType(typename, namedFragment.selectionSet, namedFragmentsMap, isFragmentApplicable)
|
|
71829
|
-
.forEach(fragmentFieldSelection => { mergeFragmentWithExistingSelections(fragmentFieldSelection, selections); });
|
|
71830
|
-
}
|
|
71831
|
-
}
|
|
71832
|
-
});
|
|
71833
|
-
// Needs to happen after the selections are merged.
|
|
71834
|
-
return selections.reduce((acc, fieldNode) => {
|
|
71835
|
-
const fieldName = fieldNode.alias ? fieldNode.alias.value : fieldNode.name.value;
|
|
71836
|
-
// TODO: W-13485835. Some fields are not being merged, and this logic reproduces the current behavior in which the first field with name is being used.
|
|
71837
|
-
if (!acc.has(fieldName)) {
|
|
71838
|
-
acc.set(fieldName, fieldNode);
|
|
71839
|
-
}
|
|
71840
|
-
return acc;
|
|
71841
|
-
}, new Map());
|
|
71842
|
-
}
|
|
71843
|
-
let selectionSetRequestedFieldsWeakMap = new WeakMap();
|
|
71844
|
-
function getRequestedFieldsForType(typename, selectionSet, namedFragmentsMap, isFragmentApplicable) {
|
|
71845
|
-
let cachedRequestedFieldsConfigurations = selectionSetRequestedFieldsWeakMap.get(selectionSet);
|
|
71846
|
-
if (cachedRequestedFieldsConfigurations === undefined) {
|
|
71847
|
-
cachedRequestedFieldsConfigurations = new Map();
|
|
71848
|
-
selectionSetRequestedFieldsWeakMap.set(selectionSet, cachedRequestedFieldsConfigurations);
|
|
71849
|
-
}
|
|
71850
|
-
const cachedRequestedFieldsForType = cachedRequestedFieldsConfigurations.get(typename);
|
|
71851
|
-
if (cachedRequestedFieldsForType !== undefined) {
|
|
71852
|
-
return cachedRequestedFieldsForType;
|
|
71853
|
-
}
|
|
71854
|
-
const selections = calculateRequestedFieldsForType(typename, selectionSet, namedFragmentsMap, isFragmentApplicable);
|
|
71855
|
-
cachedRequestedFieldsConfigurations.set(typename, selections);
|
|
71856
|
-
return selections;
|
|
71857
|
-
}
|
|
71858
72037
|
function getQueryTransformerForType(typename, fragmentMap) {
|
|
71859
72038
|
switch (typename) {
|
|
71860
72039
|
case "PercentAggregate": return {
|
|
@@ -72473,18 +72652,7 @@
|
|
|
72473
72652
|
(_a = field.selectionSet) === null || _a === void 0 ? void 0 : _a.selections.forEach((sel) => {
|
|
72474
72653
|
const builtSelection = buildSelectionForNodeFn(source, reader, field, sel, variables, fragments, parentRecordId);
|
|
72475
72654
|
if (builtSelection !== undefined) {
|
|
72476
|
-
|
|
72477
|
-
Object.keys(builtSelection).forEach((key, value) => {
|
|
72478
|
-
// We only assign a field selection in the fragment if it doesn't already exist in sink
|
|
72479
|
-
// The non-fragment selection already got the merged selections in getRequestedFieldsForType
|
|
72480
|
-
if (sink[key] === undefined) {
|
|
72481
|
-
sink[key] = builtSelection[key];
|
|
72482
|
-
}
|
|
72483
|
-
});
|
|
72484
|
-
}
|
|
72485
|
-
else {
|
|
72486
|
-
Object.assign(sink, builtSelection);
|
|
72487
|
-
}
|
|
72655
|
+
deepMerge(sink, builtSelection);
|
|
72488
72656
|
}
|
|
72489
72657
|
});
|
|
72490
72658
|
return sink;
|
|
@@ -76094,7 +76262,7 @@
|
|
|
76094
76262
|
configuration: { ...configurationForGraphQLAdapters },
|
|
76095
76263
|
instrument,
|
|
76096
76264
|
});
|
|
76097
|
-
// version: 1.228.
|
|
76265
|
+
// version: 1.228.1-0cb6f94f1
|
|
76098
76266
|
|
|
76099
76267
|
// On core the unstable adapters are re-exported with different names,
|
|
76100
76268
|
|
|
@@ -78341,7 +78509,7 @@
|
|
|
78341
78509
|
unstable_graphQL_imperative = createImperativeAdapter(luvio, createInstrumentedAdapter(ldsAdapter, adapterMetadata), adapterMetadata);
|
|
78342
78510
|
graphQLImperative = ldsAdapter;
|
|
78343
78511
|
});
|
|
78344
|
-
// version: 1.228.
|
|
78512
|
+
// version: 1.228.1-0cb6f94f1
|
|
78345
78513
|
|
|
78346
78514
|
var gqlApi = /*#__PURE__*/Object.freeze({
|
|
78347
78515
|
__proto__: null,
|
|
@@ -79072,4 +79240,4 @@
|
|
|
79072
79240
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
79073
79241
|
|
|
79074
79242
|
}));
|
|
79075
|
-
// version: 1.228.
|
|
79243
|
+
// version: 1.228.1-4e6356f71
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salesforce/lds-worker-api",
|
|
3
|
-
"version": "1.228.
|
|
3
|
+
"version": "1.228.1",
|
|
4
4
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
5
5
|
"description": "",
|
|
6
6
|
"main": "dist/standalone/es/lds-worker-api.js",
|
|
@@ -71,5 +71,8 @@
|
|
|
71
71
|
}
|
|
72
72
|
}
|
|
73
73
|
}
|
|
74
|
+
},
|
|
75
|
+
"volta": {
|
|
76
|
+
"extends": "../../package.json"
|
|
74
77
|
}
|
|
75
78
|
}
|