@salesforce/lds-worker-api 1.377.1 → 1.378.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.
|
@@ -4274,7 +4274,7 @@ function withDefaultLuvio(callback) {
|
|
|
4274
4274
|
}
|
|
4275
4275
|
callbacks.push(callback);
|
|
4276
4276
|
}
|
|
4277
|
-
// version: 1.
|
|
4277
|
+
// version: 1.378.0-0ab3d40d29
|
|
4278
4278
|
|
|
4279
4279
|
// TODO [TD-0081508]: once that TD is fulfilled we can probably change this file
|
|
4280
4280
|
function instrumentAdapter$1(createFunction, _metadata) {
|
|
@@ -5318,7 +5318,7 @@ function createGraphQLWireAdapterConstructor(luvio, adapter, metadata, astResolv
|
|
|
5318
5318
|
const { apiFamily, name } = metadata;
|
|
5319
5319
|
return createGraphQLWireAdapterConstructor$1(adapter, `${apiFamily}.${name}`, luvio, astResolver);
|
|
5320
5320
|
}
|
|
5321
|
-
// version: 1.
|
|
5321
|
+
// version: 1.378.0-0ab3d40d29
|
|
5322
5322
|
|
|
5323
5323
|
/**
|
|
5324
5324
|
* Copyright (c) 2022, Salesforce, Inc.,
|
|
@@ -34154,7 +34154,7 @@ withDefaultLuvio((luvio) => {
|
|
|
34154
34154
|
throttle(60, 60000, setupNotifyAllListRecordUpdateAvailable(luvio));
|
|
34155
34155
|
throttle(60, 60000, setupNotifyAllListInfoSummaryUpdateAvailable(luvio));
|
|
34156
34156
|
});
|
|
34157
|
-
// version: 1.
|
|
34157
|
+
// version: 1.378.0-63d7c07562
|
|
34158
34158
|
|
|
34159
34159
|
function requestIdleDetectedCallback(_callback) { }
|
|
34160
34160
|
function declareNotifierTaskSingle(_name) {
|
|
@@ -87029,9 +87029,9 @@ function injectFilter(filterNode, idState, parentPath, isParentPolymorphic, obje
|
|
|
87029
87029
|
}
|
|
87030
87030
|
// spanning field needs to have the directive with 'parentRelationship'
|
|
87031
87031
|
const directives = isSpanning && !isInlineFragment ? [parentRelationshipDirective] : [];
|
|
87032
|
-
let idField = isSpanning && !isPolymorphicField ? [createFieldNode
|
|
87032
|
+
let idField = isSpanning && !isPolymorphicField ? [createFieldNode('Id')] : [];
|
|
87033
87033
|
// This variable change to InlineFragment if 'isInlineFragment' is true
|
|
87034
|
-
let sel = createFieldNode
|
|
87034
|
+
let sel = createFieldNode(fieldName);
|
|
87035
87035
|
// Check if fields is valid
|
|
87036
87036
|
if (apiNames.length === 1 && !isInlineFragment) {
|
|
87037
87037
|
const objectInfo = objectInfos[apiNames[0]];
|
|
@@ -87077,7 +87077,7 @@ function injectFilter(filterNode, idState, parentPath, isParentPolymorphic, obje
|
|
|
87077
87077
|
idField = [];
|
|
87078
87078
|
}
|
|
87079
87079
|
if (isInlineFragment && !isTypeNameExisting) {
|
|
87080
|
-
idField.push(createFieldNode
|
|
87080
|
+
idField.push(createFieldNode('__typename'));
|
|
87081
87081
|
}
|
|
87082
87082
|
//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
|
|
87083
87083
|
if (!existingFields ||
|
|
@@ -87144,7 +87144,7 @@ function injectFilter(filterNode, idState, parentPath, isParentPolymorphic, obje
|
|
|
87144
87144
|
.filter(isFieldNode)
|
|
87145
87145
|
.filter((subNode) => subNode.name.value === relationField);
|
|
87146
87146
|
if (!existingRelationFields || existingRelationFields.length === 0) {
|
|
87147
|
-
injectedSelections.push(createFieldNode
|
|
87147
|
+
injectedSelections.push(createFieldNode(relationField, FieldValueNodeSelectionSet));
|
|
87148
87148
|
}
|
|
87149
87149
|
}
|
|
87150
87150
|
}
|
|
@@ -87235,7 +87235,7 @@ function produceValueFieldLeaves(queryNode) {
|
|
|
87235
87235
|
.filter(isFieldNode)
|
|
87236
87236
|
.filter((subNode) => subNode.name.value === 'value');
|
|
87237
87237
|
return !existingValueFields || existingValueFields.length === 0
|
|
87238
|
-
? [createFieldNode
|
|
87238
|
+
? [createFieldNode('value')]
|
|
87239
87239
|
: [];
|
|
87240
87240
|
}
|
|
87241
87241
|
function updateIDInfo(fieldNode, idState, draftFunctions) {
|
|
@@ -87316,20 +87316,20 @@ function injectParentRelationships(selections, parentNode, parentPath, ancestors
|
|
|
87316
87316
|
.filter(isFieldNode)
|
|
87317
87317
|
.filter((subNode) => subNode.name.value === relationshipId);
|
|
87318
87318
|
if (existingRelationFields.length === 0) {
|
|
87319
|
-
parentInjectedNodes.push(createFieldNode
|
|
87319
|
+
parentInjectedNodes.push(createFieldNode(relationshipId, FieldValueNodeSelectionSet));
|
|
87320
87320
|
}
|
|
87321
87321
|
}
|
|
87322
87322
|
// For polymorphic fields, the Id field is excluded.
|
|
87323
87323
|
const excludeId = isPolymorphicFieldPath(curPath, pathToObjectApiNamesMap, objectInfos);
|
|
87324
87324
|
const idSelection = [];
|
|
87325
87325
|
if (!excludeId && hasIdNode === false) {
|
|
87326
|
-
idSelection.push(createFieldNode
|
|
87326
|
+
idSelection.push(createFieldNode('Id'));
|
|
87327
87327
|
}
|
|
87328
87328
|
// 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
|
|
87329
87329
|
// `typedCondition` of the InlineFragment in the query AST. It is used to match JSON response with AST node. For more detail, please reference 'removeSyntheticFields'.
|
|
87330
87330
|
if (isInlineFragmentNode(selection) &&
|
|
87331
87331
|
!selection.selectionSet.selections.find((selection) => isFieldNode(selection) && selection.name.value === '__typename')) {
|
|
87332
|
-
idSelection.push(createFieldNode
|
|
87332
|
+
idSelection.push(createFieldNode('__typename'));
|
|
87333
87333
|
}
|
|
87334
87334
|
// 'ServiceAppointment' --> 'Contact' --> 'Id', Inject 'Contact' with Id. 'Id' field is at the sub level.
|
|
87335
87335
|
if (idSelection.length > 0 || subInjectedSelections.length > 0) {
|
|
@@ -87373,7 +87373,7 @@ function injectFieldsForDisplayValue(topNode, apiName, objectInfos) {
|
|
|
87373
87373
|
objectInfo.nameFields !== undefined &&
|
|
87374
87374
|
objectInfo.nameFields.length > 0) {
|
|
87375
87375
|
displayValueNameFields = objectInfo.nameFields.map((fieldName) => {
|
|
87376
|
-
return createFieldNode
|
|
87376
|
+
return createFieldNode(fieldName, FieldValueNodeSelectionSet);
|
|
87377
87377
|
});
|
|
87378
87378
|
}
|
|
87379
87379
|
}
|
|
@@ -87404,7 +87404,7 @@ function injectFields(selections, parentNode, parentPath, ancestors, objectInfos
|
|
|
87404
87404
|
if (parentNode.name.value === 'node') {
|
|
87405
87405
|
const idNode = findIdFieldNode(parentNode);
|
|
87406
87406
|
if (idNode === false) {
|
|
87407
|
-
rootQueryIdField.push(createFieldNode
|
|
87407
|
+
rootQueryIdField.push(createFieldNode('Id'));
|
|
87408
87408
|
}
|
|
87409
87409
|
}
|
|
87410
87410
|
// example { node { Id } }. The operation happens at the 'edges' -> 'node' level of the 'childRelationship' field
|
|
@@ -87432,7 +87432,7 @@ function injectFields(selections, parentNode, parentPath, ancestors, objectInfos
|
|
|
87432
87432
|
.filter(isFieldNode)
|
|
87433
87433
|
.some((sibling) => sibling.name.value === injectedParentFieldName)) {
|
|
87434
87434
|
// example: TimeSheetId { value }
|
|
87435
|
-
relatedIdForChildRelationship.push(createFieldNode
|
|
87435
|
+
relatedIdForChildRelationship.push(createFieldNode(injectedParentFieldName, FieldValueNodeSelectionSet));
|
|
87436
87436
|
}
|
|
87437
87437
|
displayValueNameFields.push(...injectFieldsForDisplayValue(parentNode, targetRelationship.childObjectApiName, objectInfos));
|
|
87438
87438
|
}
|
|
@@ -87884,7 +87884,7 @@ function referenceIdFieldForRelationship(relationshipName) {
|
|
|
87884
87884
|
* @param selectionSet
|
|
87885
87885
|
* @returns
|
|
87886
87886
|
*/
|
|
87887
|
-
function createFieldNode
|
|
87887
|
+
function createFieldNode(nameValue, selectionSet) {
|
|
87888
87888
|
return {
|
|
87889
87889
|
kind: Kind$3.FIELD,
|
|
87890
87890
|
name: {
|
|
@@ -95881,7 +95881,7 @@ function buildServiceDescriptor$5(luvio) {
|
|
|
95881
95881
|
},
|
|
95882
95882
|
};
|
|
95883
95883
|
}
|
|
95884
|
-
// version: 1.
|
|
95884
|
+
// version: 1.378.0-63d7c07562
|
|
95885
95885
|
|
|
95886
95886
|
/**
|
|
95887
95887
|
* Copyright (c) 2022, Salesforce, Inc.,
|
|
@@ -95907,7 +95907,7 @@ function buildServiceDescriptor$4(notifyRecordUpdateAvailable, getNormalizedLuvi
|
|
|
95907
95907
|
},
|
|
95908
95908
|
};
|
|
95909
95909
|
}
|
|
95910
|
-
// version: 1.
|
|
95910
|
+
// version: 1.378.0-63d7c07562
|
|
95911
95911
|
|
|
95912
95912
|
/*!
|
|
95913
95913
|
* Copyright (c) 2022, Salesforce, Inc.,
|
|
@@ -98023,7 +98023,7 @@ register$1({
|
|
|
98023
98023
|
id: '@salesforce/lds-network-adapter',
|
|
98024
98024
|
instrument: instrument$2,
|
|
98025
98025
|
});
|
|
98026
|
-
// version: 1.
|
|
98026
|
+
// version: 1.378.0-0ab3d40d29
|
|
98027
98027
|
|
|
98028
98028
|
const { create: create$3, keys: keys$3 } = Object;
|
|
98029
98029
|
const { stringify: stringify$1, parse } = JSON;
|
|
@@ -98887,11 +98887,7 @@ function extractVariableValue(variableName, variableDefinitions) {
|
|
|
98887
98887
|
if (variable.definition.defaultValue) {
|
|
98888
98888
|
return extractValue(variable.definition.defaultValue, variableDefinitions);
|
|
98889
98889
|
}
|
|
98890
|
-
return
|
|
98891
|
-
new Error(
|
|
98892
|
-
`Variable '${variableName}' was defined but no value was provided and no default value exists`
|
|
98893
|
-
)
|
|
98894
|
-
);
|
|
98890
|
+
return ok$4(void 0);
|
|
98895
98891
|
}
|
|
98896
98892
|
function validateExpectedType(value, expectedType) {
|
|
98897
98893
|
if (!expectedType) {
|
|
@@ -99101,6 +99097,243 @@ function shouldSkip(selection, variables) {
|
|
|
99101
99097
|
}
|
|
99102
99098
|
return ok$4(false);
|
|
99103
99099
|
}
|
|
99100
|
+
class BaseScalarFieldDef {
|
|
99101
|
+
constructor(nullable) {
|
|
99102
|
+
this.nullable = nullable;
|
|
99103
|
+
}
|
|
99104
|
+
write(_cache, input) {
|
|
99105
|
+
if (input.data === void 0) {
|
|
99106
|
+
return ok$4({ type: "missing" });
|
|
99107
|
+
}
|
|
99108
|
+
if (input.data === null) {
|
|
99109
|
+
if (!this.nullable) {
|
|
99110
|
+
return err$4([
|
|
99111
|
+
{
|
|
99112
|
+
type: "unknown",
|
|
99113
|
+
error: new Error(
|
|
99114
|
+
`Got a null value for non-nullable field "${input.selection.name.value}"`
|
|
99115
|
+
)
|
|
99116
|
+
}
|
|
99117
|
+
]);
|
|
99118
|
+
}
|
|
99119
|
+
}
|
|
99120
|
+
return ok$4({ type: "data", data: input.data });
|
|
99121
|
+
}
|
|
99122
|
+
read(_cache, input) {
|
|
99123
|
+
const normalizedData = input.normalizedData;
|
|
99124
|
+
if (normalizedData.type === "missing") {
|
|
99125
|
+
return ok$4(void 0);
|
|
99126
|
+
}
|
|
99127
|
+
return ok$4(normalizedData.data);
|
|
99128
|
+
}
|
|
99129
|
+
augmentSelections(input) {
|
|
99130
|
+
return input;
|
|
99131
|
+
}
|
|
99132
|
+
buildFieldKey(selection, variables) {
|
|
99133
|
+
return buildFieldKey(selection.name.value, selection.arguments, variables);
|
|
99134
|
+
}
|
|
99135
|
+
}
|
|
99136
|
+
class BaseArrayFieldDef {
|
|
99137
|
+
constructor(items, nullable) {
|
|
99138
|
+
this.items = items;
|
|
99139
|
+
this.nullable = nullable;
|
|
99140
|
+
}
|
|
99141
|
+
augmentSelections(input) {
|
|
99142
|
+
return this.items.augmentSelections(input);
|
|
99143
|
+
}
|
|
99144
|
+
buildFieldKey(selection, variables) {
|
|
99145
|
+
return this.items.buildFieldKey(selection, variables);
|
|
99146
|
+
}
|
|
99147
|
+
write(cache, input) {
|
|
99148
|
+
if (input.data === void 0) {
|
|
99149
|
+
return ok$4({ type: "missing" });
|
|
99150
|
+
}
|
|
99151
|
+
if (input.data === null) {
|
|
99152
|
+
if (!this.nullable) {
|
|
99153
|
+
return err$4([
|
|
99154
|
+
{
|
|
99155
|
+
type: "unknown",
|
|
99156
|
+
error: new Error(
|
|
99157
|
+
`Got a null value for non-nullable field "${input.selection.name.value}"`
|
|
99158
|
+
)
|
|
99159
|
+
}
|
|
99160
|
+
]);
|
|
99161
|
+
}
|
|
99162
|
+
return ok$4({ type: "data", data: input.data });
|
|
99163
|
+
}
|
|
99164
|
+
if (!Array.isArray(input.data)) {
|
|
99165
|
+
return err$4([
|
|
99166
|
+
{
|
|
99167
|
+
type: "unknown",
|
|
99168
|
+
error: new Error(
|
|
99169
|
+
`Got a non array value for array field "${input.selection.name.value}"`
|
|
99170
|
+
)
|
|
99171
|
+
}
|
|
99172
|
+
]);
|
|
99173
|
+
}
|
|
99174
|
+
const arrayNormalizationErrors = [];
|
|
99175
|
+
const normalizedArray = [];
|
|
99176
|
+
input.data.forEach((item, index) => {
|
|
99177
|
+
var _a;
|
|
99178
|
+
const existingItemData = (_a = input.existingNormalizedData) == null ? void 0 : _a[index];
|
|
99179
|
+
const normalizedItemResult = this.items.write(cache, {
|
|
99180
|
+
...input,
|
|
99181
|
+
data: item,
|
|
99182
|
+
existingNormalizedData: existingItemData,
|
|
99183
|
+
request: input.request,
|
|
99184
|
+
selection: input.selection
|
|
99185
|
+
});
|
|
99186
|
+
if (normalizedItemResult.isOk()) {
|
|
99187
|
+
normalizedArray.push(normalizedItemResult.value);
|
|
99188
|
+
} else {
|
|
99189
|
+
arrayNormalizationErrors.push(...normalizedItemResult.error);
|
|
99190
|
+
}
|
|
99191
|
+
});
|
|
99192
|
+
if (arrayNormalizationErrors.length > 0) {
|
|
99193
|
+
return err$4(arrayNormalizationErrors);
|
|
99194
|
+
}
|
|
99195
|
+
return ok$4({ type: "data", data: normalizedArray });
|
|
99196
|
+
}
|
|
99197
|
+
read(cache, input) {
|
|
99198
|
+
const normalizedData = input.normalizedData;
|
|
99199
|
+
if (normalizedData.type === "missing") {
|
|
99200
|
+
return ok$4(void 0);
|
|
99201
|
+
}
|
|
99202
|
+
if (normalizedData.data === null) {
|
|
99203
|
+
if (!this.nullable) {
|
|
99204
|
+
return err$4([
|
|
99205
|
+
{
|
|
99206
|
+
type: "unknown",
|
|
99207
|
+
error: new Error(
|
|
99208
|
+
`Got a null value for non-nullable field "${input.selection.name.value}"`
|
|
99209
|
+
)
|
|
99210
|
+
}
|
|
99211
|
+
]);
|
|
99212
|
+
}
|
|
99213
|
+
return ok$4({ type: "data", data: null });
|
|
99214
|
+
}
|
|
99215
|
+
if (!Array.isArray(normalizedData.data)) {
|
|
99216
|
+
return err$4([
|
|
99217
|
+
{
|
|
99218
|
+
type: "unknown",
|
|
99219
|
+
error: new Error(
|
|
99220
|
+
`Got a non array value for array field "${input.selection.name.value}"`
|
|
99221
|
+
)
|
|
99222
|
+
}
|
|
99223
|
+
]);
|
|
99224
|
+
}
|
|
99225
|
+
const arrayDenormalizationErrors = [];
|
|
99226
|
+
const denormalizedArray = [];
|
|
99227
|
+
normalizedData.data.forEach((item) => {
|
|
99228
|
+
const denormalizedItemResult = this.items.read(cache, {
|
|
99229
|
+
...input,
|
|
99230
|
+
normalizedData: item,
|
|
99231
|
+
request: input.request,
|
|
99232
|
+
selection: input.selection
|
|
99233
|
+
});
|
|
99234
|
+
if (denormalizedItemResult.isOk()) {
|
|
99235
|
+
denormalizedArray.push(denormalizedItemResult.value);
|
|
99236
|
+
} else {
|
|
99237
|
+
arrayDenormalizationErrors.push(...denormalizedItemResult.error);
|
|
99238
|
+
}
|
|
99239
|
+
});
|
|
99240
|
+
if (arrayDenormalizationErrors.length > 0) {
|
|
99241
|
+
return err$4(arrayDenormalizationErrors);
|
|
99242
|
+
}
|
|
99243
|
+
return ok$4(denormalizedArray);
|
|
99244
|
+
}
|
|
99245
|
+
}
|
|
99246
|
+
class BaseObjectFieldDef {
|
|
99247
|
+
constructor(repository, nullable) {
|
|
99248
|
+
this.repository = repository;
|
|
99249
|
+
this.nullable = nullable;
|
|
99250
|
+
}
|
|
99251
|
+
augmentSelections(input) {
|
|
99252
|
+
return this.repository.augmentSelections(input);
|
|
99253
|
+
}
|
|
99254
|
+
buildFieldKey(selection, variables) {
|
|
99255
|
+
return this.repository.buildFieldKey(selection, variables);
|
|
99256
|
+
}
|
|
99257
|
+
write(cache, input) {
|
|
99258
|
+
var _a;
|
|
99259
|
+
if (!input.selection.selectionSet) {
|
|
99260
|
+
return err$4([
|
|
99261
|
+
{
|
|
99262
|
+
type: "unknown",
|
|
99263
|
+
error: new Error(
|
|
99264
|
+
`Selection set required for object type found on field "${input.selection.name.value}" in type ${this.repository.typeName}`
|
|
99265
|
+
)
|
|
99266
|
+
}
|
|
99267
|
+
]);
|
|
99268
|
+
}
|
|
99269
|
+
if (input.data === void 0) {
|
|
99270
|
+
return ok$4({ type: "missing" });
|
|
99271
|
+
}
|
|
99272
|
+
if (input.data === null) {
|
|
99273
|
+
if (!this.nullable) {
|
|
99274
|
+
return err$4([
|
|
99275
|
+
{
|
|
99276
|
+
type: "unknown",
|
|
99277
|
+
error: new Error(
|
|
99278
|
+
`Got a null value for non-nullable field "${input.selection.name.value}"`
|
|
99279
|
+
)
|
|
99280
|
+
}
|
|
99281
|
+
]);
|
|
99282
|
+
}
|
|
99283
|
+
return ok$4({ type: "data", data: null });
|
|
99284
|
+
}
|
|
99285
|
+
const writeResult = this.repository.write(cache, {
|
|
99286
|
+
...input,
|
|
99287
|
+
data: input.data,
|
|
99288
|
+
existingNormalizedData: (_a = input.existingNormalizedData) == null ? void 0 : _a.data,
|
|
99289
|
+
request: input.request,
|
|
99290
|
+
selections: input.selection.selectionSet.selections,
|
|
99291
|
+
parentFieldSelection: input.selection
|
|
99292
|
+
});
|
|
99293
|
+
if (writeResult.isErr()) {
|
|
99294
|
+
return writeResult;
|
|
99295
|
+
}
|
|
99296
|
+
return ok$4({ type: "data", data: writeResult.value });
|
|
99297
|
+
}
|
|
99298
|
+
read(cache, input) {
|
|
99299
|
+
var _a;
|
|
99300
|
+
if (!input.selection.selectionSet) {
|
|
99301
|
+
return err$4([
|
|
99302
|
+
{
|
|
99303
|
+
type: "unknown",
|
|
99304
|
+
error: new Error(
|
|
99305
|
+
`Selection set required for object type found on field "${input.selection.name.value}" in type ${this.repository.typeName}`
|
|
99306
|
+
)
|
|
99307
|
+
}
|
|
99308
|
+
]);
|
|
99309
|
+
}
|
|
99310
|
+
const normalizedData = input.normalizedData;
|
|
99311
|
+
if (normalizedData.type === "missing") {
|
|
99312
|
+
return ok$4(void 0);
|
|
99313
|
+
}
|
|
99314
|
+
if (normalizedData.data === null) {
|
|
99315
|
+
if (!this.nullable) {
|
|
99316
|
+
return err$4([
|
|
99317
|
+
{
|
|
99318
|
+
type: "unknown",
|
|
99319
|
+
error: new Error(
|
|
99320
|
+
`Got a null value for non-nullable field "${input.selection.name.value}"`
|
|
99321
|
+
)
|
|
99322
|
+
}
|
|
99323
|
+
]);
|
|
99324
|
+
}
|
|
99325
|
+
return ok$4(null);
|
|
99326
|
+
}
|
|
99327
|
+
return this.repository.read(cache, {
|
|
99328
|
+
...input,
|
|
99329
|
+
normalizedData: normalizedData.data,
|
|
99330
|
+
request: input.request,
|
|
99331
|
+
selections: (_a = input.selection.selectionSet) == null ? void 0 : _a.selections,
|
|
99332
|
+
parentFieldSelection: input.selection
|
|
99333
|
+
});
|
|
99334
|
+
}
|
|
99335
|
+
}
|
|
99336
|
+
const missingFieldDef = new BaseScalarFieldDef(false);
|
|
99104
99337
|
class BaseGraphQLTypeRepository {
|
|
99105
99338
|
equals(x, y) {
|
|
99106
99339
|
return deepEquals$2(x, y);
|
|
@@ -99465,9 +99698,23 @@ class BaseGraphQLTypeRepository {
|
|
|
99465
99698
|
}
|
|
99466
99699
|
return {};
|
|
99467
99700
|
}
|
|
99468
|
-
getFieldDef(
|
|
99701
|
+
getFieldDef(input, selection) {
|
|
99702
|
+
var _a, _b, _c;
|
|
99469
99703
|
const canonicalFieldName = selection.name.value;
|
|
99470
|
-
|
|
99704
|
+
const fieldDef = this.fields[canonicalFieldName];
|
|
99705
|
+
if (fieldDef) {
|
|
99706
|
+
return fieldDef;
|
|
99707
|
+
}
|
|
99708
|
+
const dataInstanceFieldName = ((_a = selection.alias) == null ? void 0 : _a.value) ?? selection.name.value;
|
|
99709
|
+
if (input === void 0) {
|
|
99710
|
+
return void 0;
|
|
99711
|
+
}
|
|
99712
|
+
if ("data" in input && input.data[dataInstanceFieldName] === void 0) {
|
|
99713
|
+
return missingFieldDef;
|
|
99714
|
+
} else if ("normalizedData" in input && ((_c = (_b = input.normalizedData) == null ? void 0 : _b[dataInstanceFieldName]) == null ? void 0 : _c.type) === "missing") {
|
|
99715
|
+
return missingFieldDef;
|
|
99716
|
+
}
|
|
99717
|
+
return void 0;
|
|
99471
99718
|
}
|
|
99472
99719
|
shouldProcessFragment(fragment, variables) {
|
|
99473
99720
|
const shouldSkipResult = shouldSkip(fragment, variables);
|
|
@@ -99849,245 +100096,6 @@ function augmentUnionLikeSelections(input, possibleTypes) {
|
|
|
99849
100096
|
});
|
|
99850
100097
|
return { selections: augmentedSelections, fragments: augmentedFragments };
|
|
99851
100098
|
}
|
|
99852
|
-
class BaseScalarFieldDef {
|
|
99853
|
-
constructor(nullable) {
|
|
99854
|
-
this.nullable = nullable;
|
|
99855
|
-
this.type = "scalar";
|
|
99856
|
-
}
|
|
99857
|
-
write(_cache, input) {
|
|
99858
|
-
if (input.data === void 0) {
|
|
99859
|
-
return ok$4({ type: "missing" });
|
|
99860
|
-
}
|
|
99861
|
-
if (input.data === null) {
|
|
99862
|
-
if (!this.nullable) {
|
|
99863
|
-
return err$4([
|
|
99864
|
-
{
|
|
99865
|
-
type: "unknown",
|
|
99866
|
-
error: new Error(
|
|
99867
|
-
`Got a null value for non-nullable field "${input.selection.name.value}"`
|
|
99868
|
-
)
|
|
99869
|
-
}
|
|
99870
|
-
]);
|
|
99871
|
-
}
|
|
99872
|
-
}
|
|
99873
|
-
return ok$4({ type: "data", data: input.data });
|
|
99874
|
-
}
|
|
99875
|
-
read(_cache, input) {
|
|
99876
|
-
const normalizedData = input.normalizedData;
|
|
99877
|
-
if (normalizedData.type === "missing") {
|
|
99878
|
-
return ok$4(void 0);
|
|
99879
|
-
}
|
|
99880
|
-
return ok$4(normalizedData.data);
|
|
99881
|
-
}
|
|
99882
|
-
augmentSelections(input) {
|
|
99883
|
-
return input;
|
|
99884
|
-
}
|
|
99885
|
-
buildFieldKey(selection, variables) {
|
|
99886
|
-
return buildFieldKey(selection.name.value, selection.arguments, variables);
|
|
99887
|
-
}
|
|
99888
|
-
}
|
|
99889
|
-
class BaseArrayFieldDef {
|
|
99890
|
-
constructor(items, nullable) {
|
|
99891
|
-
this.items = items;
|
|
99892
|
-
this.nullable = nullable;
|
|
99893
|
-
this.type = "array";
|
|
99894
|
-
}
|
|
99895
|
-
augmentSelections(input) {
|
|
99896
|
-
return this.items.augmentSelections(input);
|
|
99897
|
-
}
|
|
99898
|
-
buildFieldKey(selection, variables) {
|
|
99899
|
-
return this.items.buildFieldKey(selection, variables);
|
|
99900
|
-
}
|
|
99901
|
-
write(cache, input) {
|
|
99902
|
-
if (input.data === void 0) {
|
|
99903
|
-
return ok$4({ type: "missing" });
|
|
99904
|
-
}
|
|
99905
|
-
if (input.data === null) {
|
|
99906
|
-
if (!this.nullable) {
|
|
99907
|
-
return err$4([
|
|
99908
|
-
{
|
|
99909
|
-
type: "unknown",
|
|
99910
|
-
error: new Error(
|
|
99911
|
-
`Got a null value for non-nullable field "${input.selection.name.value}"`
|
|
99912
|
-
)
|
|
99913
|
-
}
|
|
99914
|
-
]);
|
|
99915
|
-
}
|
|
99916
|
-
return ok$4({ type: "data", data: input.data });
|
|
99917
|
-
}
|
|
99918
|
-
if (!Array.isArray(input.data)) {
|
|
99919
|
-
return err$4([
|
|
99920
|
-
{
|
|
99921
|
-
type: "unknown",
|
|
99922
|
-
error: new Error(
|
|
99923
|
-
`Got a non array value for array field "${input.selection.name.value}"`
|
|
99924
|
-
)
|
|
99925
|
-
}
|
|
99926
|
-
]);
|
|
99927
|
-
}
|
|
99928
|
-
const arrayNormalizationErrors = [];
|
|
99929
|
-
const normalizedArray = [];
|
|
99930
|
-
input.data.forEach((item, index) => {
|
|
99931
|
-
var _a;
|
|
99932
|
-
const existingItemData = (_a = input.existingNormalizedData) == null ? void 0 : _a[index];
|
|
99933
|
-
const normalizedItemResult = this.items.write(cache, {
|
|
99934
|
-
...input,
|
|
99935
|
-
data: item,
|
|
99936
|
-
existingNormalizedData: existingItemData,
|
|
99937
|
-
request: input.request,
|
|
99938
|
-
selection: input.selection
|
|
99939
|
-
});
|
|
99940
|
-
if (normalizedItemResult.isOk()) {
|
|
99941
|
-
normalizedArray.push(normalizedItemResult.value);
|
|
99942
|
-
} else {
|
|
99943
|
-
arrayNormalizationErrors.push(...normalizedItemResult.error);
|
|
99944
|
-
}
|
|
99945
|
-
});
|
|
99946
|
-
if (arrayNormalizationErrors.length > 0) {
|
|
99947
|
-
return err$4(arrayNormalizationErrors);
|
|
99948
|
-
}
|
|
99949
|
-
return ok$4({ type: "data", data: normalizedArray });
|
|
99950
|
-
}
|
|
99951
|
-
read(cache, input) {
|
|
99952
|
-
const normalizedData = input.normalizedData;
|
|
99953
|
-
if (normalizedData.type === "missing") {
|
|
99954
|
-
return ok$4(void 0);
|
|
99955
|
-
}
|
|
99956
|
-
if (normalizedData.data === null) {
|
|
99957
|
-
if (!this.nullable) {
|
|
99958
|
-
return err$4([
|
|
99959
|
-
{
|
|
99960
|
-
type: "unknown",
|
|
99961
|
-
error: new Error(
|
|
99962
|
-
`Got a null value for non-nullable field "${input.selection.name.value}"`
|
|
99963
|
-
)
|
|
99964
|
-
}
|
|
99965
|
-
]);
|
|
99966
|
-
}
|
|
99967
|
-
return ok$4({ type: "data", data: null });
|
|
99968
|
-
}
|
|
99969
|
-
if (!Array.isArray(normalizedData.data)) {
|
|
99970
|
-
return err$4([
|
|
99971
|
-
{
|
|
99972
|
-
type: "unknown",
|
|
99973
|
-
error: new Error(
|
|
99974
|
-
`Got a non array value for array field "${input.selection.name.value}"`
|
|
99975
|
-
)
|
|
99976
|
-
}
|
|
99977
|
-
]);
|
|
99978
|
-
}
|
|
99979
|
-
const arrayDenormalizationErrors = [];
|
|
99980
|
-
const denormalizedArray = [];
|
|
99981
|
-
normalizedData.data.forEach((item) => {
|
|
99982
|
-
const denormalizedItemResult = this.items.read(cache, {
|
|
99983
|
-
...input,
|
|
99984
|
-
normalizedData: item,
|
|
99985
|
-
request: input.request,
|
|
99986
|
-
selection: input.selection
|
|
99987
|
-
});
|
|
99988
|
-
if (denormalizedItemResult.isOk()) {
|
|
99989
|
-
denormalizedArray.push(denormalizedItemResult.value);
|
|
99990
|
-
} else {
|
|
99991
|
-
arrayDenormalizationErrors.push(...denormalizedItemResult.error);
|
|
99992
|
-
}
|
|
99993
|
-
});
|
|
99994
|
-
if (arrayDenormalizationErrors.length > 0) {
|
|
99995
|
-
return err$4(arrayDenormalizationErrors);
|
|
99996
|
-
}
|
|
99997
|
-
return ok$4(denormalizedArray);
|
|
99998
|
-
}
|
|
99999
|
-
}
|
|
100000
|
-
class BaseObjectFieldDef {
|
|
100001
|
-
constructor(repository, nullable) {
|
|
100002
|
-
this.repository = repository;
|
|
100003
|
-
this.nullable = nullable;
|
|
100004
|
-
this.type = "object";
|
|
100005
|
-
}
|
|
100006
|
-
augmentSelections(input) {
|
|
100007
|
-
return this.repository.augmentSelections(input);
|
|
100008
|
-
}
|
|
100009
|
-
buildFieldKey(selection, variables) {
|
|
100010
|
-
return this.repository.buildFieldKey(selection, variables);
|
|
100011
|
-
}
|
|
100012
|
-
write(cache, input) {
|
|
100013
|
-
var _a;
|
|
100014
|
-
if (!input.selection.selectionSet) {
|
|
100015
|
-
return err$4([
|
|
100016
|
-
{
|
|
100017
|
-
type: "unknown",
|
|
100018
|
-
error: new Error(
|
|
100019
|
-
`Selection set required for object type found on field "${input.selection.name.value}" in type ${this.repository.typeName}`
|
|
100020
|
-
)
|
|
100021
|
-
}
|
|
100022
|
-
]);
|
|
100023
|
-
}
|
|
100024
|
-
if (input.data === void 0) {
|
|
100025
|
-
return ok$4({ type: "missing" });
|
|
100026
|
-
}
|
|
100027
|
-
if (input.data === null) {
|
|
100028
|
-
if (!this.nullable) {
|
|
100029
|
-
return err$4([
|
|
100030
|
-
{
|
|
100031
|
-
type: "unknown",
|
|
100032
|
-
error: new Error(
|
|
100033
|
-
`Got a null value for non-nullable field "${input.selection.name.value}"`
|
|
100034
|
-
)
|
|
100035
|
-
}
|
|
100036
|
-
]);
|
|
100037
|
-
}
|
|
100038
|
-
return ok$4({ type: "data", data: null });
|
|
100039
|
-
}
|
|
100040
|
-
const writeResult = this.repository.write(cache, {
|
|
100041
|
-
...input,
|
|
100042
|
-
data: input.data,
|
|
100043
|
-
existingNormalizedData: (_a = input.existingNormalizedData) == null ? void 0 : _a.data,
|
|
100044
|
-
request: input.request,
|
|
100045
|
-
selections: input.selection.selectionSet.selections,
|
|
100046
|
-
parentFieldSelection: input.selection
|
|
100047
|
-
});
|
|
100048
|
-
if (writeResult.isErr()) {
|
|
100049
|
-
return writeResult;
|
|
100050
|
-
}
|
|
100051
|
-
return ok$4({ type: "data", data: writeResult.value });
|
|
100052
|
-
}
|
|
100053
|
-
read(cache, input) {
|
|
100054
|
-
var _a;
|
|
100055
|
-
if (!input.selection.selectionSet) {
|
|
100056
|
-
return err$4([
|
|
100057
|
-
{
|
|
100058
|
-
type: "unknown",
|
|
100059
|
-
error: new Error(
|
|
100060
|
-
`Selection set required for object type found on field "${input.selection.name.value}" in type ${this.repository.typeName}`
|
|
100061
|
-
)
|
|
100062
|
-
}
|
|
100063
|
-
]);
|
|
100064
|
-
}
|
|
100065
|
-
const normalizedData = input.normalizedData;
|
|
100066
|
-
if (normalizedData.type === "missing") {
|
|
100067
|
-
return ok$4(void 0);
|
|
100068
|
-
}
|
|
100069
|
-
if (normalizedData.data === null) {
|
|
100070
|
-
if (!this.nullable) {
|
|
100071
|
-
return err$4([
|
|
100072
|
-
{
|
|
100073
|
-
type: "unknown",
|
|
100074
|
-
error: new Error(
|
|
100075
|
-
`Got a null value for non-nullable field "${input.selection.name.value}"`
|
|
100076
|
-
)
|
|
100077
|
-
}
|
|
100078
|
-
]);
|
|
100079
|
-
}
|
|
100080
|
-
return ok$4(null);
|
|
100081
|
-
}
|
|
100082
|
-
return this.repository.read(cache, {
|
|
100083
|
-
...input,
|
|
100084
|
-
normalizedData: normalizedData.data,
|
|
100085
|
-
request: input.request,
|
|
100086
|
-
selections: (_a = input.selection.selectionSet) == null ? void 0 : _a.selections,
|
|
100087
|
-
parentFieldSelection: input.selection
|
|
100088
|
-
});
|
|
100089
|
-
}
|
|
100090
|
-
}
|
|
100091
100099
|
const GraphQLQueryJsonSchema = {
|
|
100092
100100
|
type: "object",
|
|
100093
100101
|
properties: {
|
|
@@ -100388,10 +100396,10 @@ function emitGraphQLResult(callback, result) {
|
|
|
100388
100396
|
return;
|
|
100389
100397
|
}
|
|
100390
100398
|
if ("subscribe" in result.value) {
|
|
100391
|
-
callback(result.value.data);
|
|
100399
|
+
callback(formatGraphQLData(result.value.data));
|
|
100392
100400
|
return;
|
|
100393
100401
|
}
|
|
100394
|
-
callback(result.value);
|
|
100402
|
+
callback(formatGraphQLData(result.value));
|
|
100395
100403
|
}
|
|
100396
100404
|
function resolveAst(ast) {
|
|
100397
100405
|
const result = astResolver(ast);
|
|
@@ -100400,6 +100408,18 @@ function resolveAst(ast) {
|
|
|
100400
100408
|
}
|
|
100401
100409
|
return result;
|
|
100402
100410
|
}
|
|
100411
|
+
function formatGraphQLData(data) {
|
|
100412
|
+
if (data.errors === void 0 || data.errors.length === 0) {
|
|
100413
|
+
return {
|
|
100414
|
+
data: data.data,
|
|
100415
|
+
errors: void 0
|
|
100416
|
+
};
|
|
100417
|
+
}
|
|
100418
|
+
return {
|
|
100419
|
+
data: data.data,
|
|
100420
|
+
errors: data.errors
|
|
100421
|
+
};
|
|
100422
|
+
}
|
|
100403
100423
|
class GraphQLCommandWireAdapterConstructor extends CommandWireAdapterConstructor {
|
|
100404
100424
|
emit(result) {
|
|
100405
100425
|
try {
|
|
@@ -100478,7 +100498,7 @@ function buildAsyncGraphQLImperativeLegacyInvoker(getCommand) {
|
|
|
100478
100498
|
};
|
|
100479
100499
|
return { invoke, subscribe };
|
|
100480
100500
|
}
|
|
100481
|
-
// version: 1.
|
|
100501
|
+
// version: 1.378.0-63d7c07562
|
|
100482
100502
|
|
|
100483
100503
|
class Analytics__AnalyticsBrowseRepository extends UnidentifiableGraphQLTypeRepository {
|
|
100484
100504
|
constructor(services, typeRegistry) {
|
|
@@ -101654,7 +101674,7 @@ class PolymorphicAggregateParentRelationshipRepository extends BaseUnionReposito
|
|
|
101654
101674
|
}
|
|
101655
101675
|
}
|
|
101656
101676
|
|
|
101657
|
-
class PolymorphicParentRelationshipRepository extends BaseUnionRepository {
|
|
101677
|
+
let PolymorphicParentRelationshipRepository$1 = class PolymorphicParentRelationshipRepository extends BaseUnionRepository {
|
|
101658
101678
|
constructor(services, typeRegistry) {
|
|
101659
101679
|
super(services);
|
|
101660
101680
|
this.services = services;
|
|
@@ -101671,7 +101691,7 @@ class PolymorphicParentRelationshipRepository extends BaseUnionRepository {
|
|
|
101671
101691
|
__typename: new BaseScalarFieldDef(false),
|
|
101672
101692
|
};
|
|
101673
101693
|
}
|
|
101674
|
-
}
|
|
101694
|
+
};
|
|
101675
101695
|
|
|
101676
101696
|
class QueryRepository extends GraphQLDocumentRootTypeRepository {
|
|
101677
101697
|
constructor(services, typeRegistry) {
|
|
@@ -102709,7 +102729,7 @@ class GraphQLTypeRegistry {
|
|
|
102709
102729
|
this._Base64Value = new Base64ValueRepository(this.services, this);
|
|
102710
102730
|
this._JSONValue = new JSONValueRepository(this.services, this);
|
|
102711
102731
|
this._PolymorphicParentRelationship =
|
|
102712
|
-
new PolymorphicParentRelationshipRepository(this.services, this);
|
|
102732
|
+
new PolymorphicParentRelationshipRepository$1(this.services, this);
|
|
102713
102733
|
this._CompoundField = new CompoundFieldRepository$1(this.services, this);
|
|
102714
102734
|
this._AnyType = new AnyTypeRepository(this.services, this);
|
|
102715
102735
|
this._RecordRepresentation =
|
|
@@ -103213,8 +103233,6 @@ function buildGenericTypeFieldDef(selection, fields, staticFieldNames, typename)
|
|
|
103213
103233
|
return fields[selection.name.value];
|
|
103214
103234
|
}
|
|
103215
103235
|
return {
|
|
103216
|
-
type: 'object',
|
|
103217
|
-
nullable: true,
|
|
103218
103236
|
read: (cache, input) => {
|
|
103219
103237
|
if (!input.selection.selectionSet) {
|
|
103220
103238
|
return err([
|
|
@@ -103228,6 +103246,9 @@ function buildGenericTypeFieldDef(selection, fields, staticFieldNames, typename)
|
|
|
103228
103246
|
if (normalizedData.type === 'missing') {
|
|
103229
103247
|
return ok(undefined);
|
|
103230
103248
|
}
|
|
103249
|
+
if (normalizedData.data === null) {
|
|
103250
|
+
return ok(null);
|
|
103251
|
+
}
|
|
103231
103252
|
const fieldCategory = normalizedData.fieldCategory;
|
|
103232
103253
|
const fieldDef = fields[fieldCategory];
|
|
103233
103254
|
if (!fieldDef) {
|
|
@@ -103252,6 +103273,9 @@ function buildGenericTypeFieldDef(selection, fields, staticFieldNames, typename)
|
|
|
103252
103273
|
if (input.data === undefined) {
|
|
103253
103274
|
return ok({ type: 'missing' });
|
|
103254
103275
|
}
|
|
103276
|
+
if (input.data === null) {
|
|
103277
|
+
return ok({ type: 'data', data: null });
|
|
103278
|
+
}
|
|
103255
103279
|
const fieldCategory = getFieldCategoryFromData(input.data);
|
|
103256
103280
|
const fieldDef = fields[fieldCategory];
|
|
103257
103281
|
if (!fieldDef) {
|
|
@@ -103270,7 +103294,6 @@ function buildGenericTypeFieldDef(selection, fields, staticFieldNames, typename)
|
|
|
103270
103294
|
},
|
|
103271
103295
|
buildFieldKey: (selection, variables) => buildFieldKey(selection.name.value, selection.arguments, variables),
|
|
103272
103296
|
augmentSelections: (input) => input,
|
|
103273
|
-
repository: {}, // This shouldn't be part of the interface
|
|
103274
103297
|
};
|
|
103275
103298
|
}
|
|
103276
103299
|
function getFieldCategoryFromData(data) {
|
|
@@ -103322,7 +103345,19 @@ class RecordRepresentationRepository extends RecordRepresentationRepository$1 {
|
|
|
103322
103345
|
return this._graphqlRepositoryOverride;
|
|
103323
103346
|
}
|
|
103324
103347
|
write(cache, input) {
|
|
103325
|
-
|
|
103348
|
+
let overridenInput = input;
|
|
103349
|
+
// If ID exists in the data but wasn't asked for, its from the extensions, and we should normalize it
|
|
103350
|
+
if (input.data.Id !== undefined &&
|
|
103351
|
+
input.selections.find((selection) => selection.kind === 'Field' && selection.name.value === 'Id')) {
|
|
103352
|
+
overridenInput = {
|
|
103353
|
+
...input,
|
|
103354
|
+
selections: [
|
|
103355
|
+
...input.selections,
|
|
103356
|
+
{ kind: 'Field', name: { kind: 'Name', value: 'Id' } },
|
|
103357
|
+
],
|
|
103358
|
+
};
|
|
103359
|
+
}
|
|
103360
|
+
const result = super.write(cache, overridenInput);
|
|
103326
103361
|
const recordId = input.data.Id;
|
|
103327
103362
|
const luvioRecord = input.getNormalizedLuvioRecord(recordId, input.reader);
|
|
103328
103363
|
if (luvioRecord?.weakEtag &&
|
|
@@ -103469,8 +103504,6 @@ class RecordQueryAggregateRepository extends RecordQueryAggregateRepository$1 {
|
|
|
103469
103504
|
}
|
|
103470
103505
|
|
|
103471
103506
|
const blobTypeDef = {
|
|
103472
|
-
type: 'scalar',
|
|
103473
|
-
nullable: true,
|
|
103474
103507
|
read: (_cache, input) => {
|
|
103475
103508
|
return ok({
|
|
103476
103509
|
data: input.data,
|
|
@@ -103580,6 +103613,14 @@ class SetupRecordAggregateRepository extends Setup__SetupRecordAggregateReposito
|
|
|
103580
103613
|
}
|
|
103581
103614
|
}
|
|
103582
103615
|
|
|
103616
|
+
class PolymorphicParentRelationshipRepository extends PolymorphicParentRelationshipRepository$1 {
|
|
103617
|
+
getTypeDiscriminator(data, _selections) {
|
|
103618
|
+
// Hardcoded to record representation since that's the only type of parent
|
|
103619
|
+
// relationship possible
|
|
103620
|
+
return 'RecordRepresentation';
|
|
103621
|
+
}
|
|
103622
|
+
}
|
|
103623
|
+
|
|
103583
103624
|
class CustomGraphQLTypeRegistry extends GraphQLTypeRegistry {
|
|
103584
103625
|
constructor(services) {
|
|
103585
103626
|
super(services);
|
|
@@ -103592,6 +103633,7 @@ class CustomGraphQLTypeRegistry extends GraphQLTypeRegistry {
|
|
|
103592
103633
|
this._SetupQueryAggregate = new SetupQueryAggregateRepository(services, this);
|
|
103593
103634
|
this._SetupQuery = new SetupQueryRepository(services, this);
|
|
103594
103635
|
this._SetupRecordAggregate = new SetupRecordAggregateRepository(services, this);
|
|
103636
|
+
this._PolymorphicParentRelationship = new PolymorphicParentRelationshipRepository(services, this);
|
|
103595
103637
|
}
|
|
103596
103638
|
get CompoundField() {
|
|
103597
103639
|
return this._CompoundField;
|
|
@@ -103620,155 +103662,75 @@ class CustomGraphQLTypeRegistry extends GraphQLTypeRegistry {
|
|
|
103620
103662
|
get SetupRecordAggregate() {
|
|
103621
103663
|
return this._SetupRecordAggregate;
|
|
103622
103664
|
}
|
|
103665
|
+
get PolymorphicParentRelationship() {
|
|
103666
|
+
return this._PolymorphicParentRelationship;
|
|
103667
|
+
}
|
|
103623
103668
|
}
|
|
103624
103669
|
|
|
103625
103670
|
const CONFIG_SCHEMA = GraphQLQueryJsonSchema;
|
|
103626
103671
|
|
|
103627
|
-
|
|
103628
|
-
|
|
103629
|
-
|
|
103630
|
-
|
|
103631
|
-
|
|
103632
|
-
|
|
103633
|
-
|
|
103634
|
-
|
|
103635
|
-
|
|
103636
|
-
|
|
103637
|
-
|
|
103638
|
-
|
|
103639
|
-
|
|
103640
|
-
|
|
103641
|
-
|
|
103642
|
-
|
|
103643
|
-
|
|
103644
|
-
|
|
103645
|
-
|
|
103646
|
-
|
|
103647
|
-
|
|
103648
|
-
|
|
103649
|
-
|
|
103650
|
-
|
|
103651
|
-
|
|
103652
|
-
|
|
103653
|
-
|
|
103654
|
-
|
|
103655
|
-
|
|
103656
|
-
|
|
103657
|
-
|
|
103658
|
-
|
|
103659
|
-
|
|
103660
|
-
|
|
103661
|
-
|
|
103662
|
-
|
|
103663
|
-
|
|
103664
|
-
|
|
103665
|
-
|
|
103666
|
-
|
|
103667
|
-
|
|
103668
|
-
|
|
103669
|
-
|
|
103670
|
-
|
|
103671
|
-
|
|
103672
|
-
|
|
103673
|
-
|
|
103674
|
-
|
|
103675
|
-
|
|
103676
|
-
|
|
103677
|
-
|
|
103678
|
-
|
|
103679
|
-
|
|
103680
|
-
|
|
103681
|
-
|
|
103682
|
-
|
|
103683
|
-
|
|
103684
|
-
|
|
103685
|
-
|
|
103686
|
-
|
|
103687
|
-
|
|
103688
|
-
|
|
103689
|
-
name: {
|
|
103690
|
-
kind: Kind$1.NAME,
|
|
103691
|
-
value: name,
|
|
103692
|
-
},
|
|
103693
|
-
};
|
|
103694
|
-
if (typeof data === 'object' && data !== null && data !== undefined) {
|
|
103695
|
-
if (Array.isArray(data)) {
|
|
103696
|
-
// For arrays, we need to merge the structure from all non-null elements
|
|
103697
|
-
// to capture the full schema, not just the first element
|
|
103698
|
-
let mergedStructure = {};
|
|
103699
|
-
for (const item of data) {
|
|
103700
|
-
if (item !== null && typeof item === 'object' && !Array.isArray(item)) {
|
|
103701
|
-
mergedStructure = deepMerge$1(mergedStructure, item);
|
|
103702
|
-
}
|
|
103703
|
-
}
|
|
103704
|
-
if (Object.keys(mergedStructure).length > 0) {
|
|
103705
|
-
baseField.selectionSet = {
|
|
103706
|
-
kind: Kind$1.SELECTION_SET,
|
|
103707
|
-
selections: Object.entries(mergedStructure)
|
|
103708
|
-
.map(([key, value]) => createFieldNode(key, value))
|
|
103709
|
-
.filter((node) => node !== undefined),
|
|
103710
|
-
};
|
|
103711
|
-
}
|
|
103712
|
-
}
|
|
103713
|
-
else {
|
|
103714
|
-
baseField.selectionSet = {
|
|
103715
|
-
kind: Kind$1.SELECTION_SET,
|
|
103716
|
-
selections: Object.entries(data)
|
|
103717
|
-
.map(([key, value]) => createFieldNode(key, value))
|
|
103718
|
-
.filter((node) => node !== undefined),
|
|
103719
|
-
};
|
|
103720
|
-
}
|
|
103721
|
-
}
|
|
103722
|
-
return baseField;
|
|
103723
|
-
}
|
|
103724
|
-
function createASTFromExtensions(extensions) {
|
|
103725
|
-
const fieldNodes = Object.entries(extensions)
|
|
103726
|
-
.map(([field, value]) => createFieldNode(field, value))
|
|
103727
|
-
.filter((node) => node !== undefined);
|
|
103728
|
-
return {
|
|
103729
|
-
kind: Kind$1.SELECTION_SET,
|
|
103730
|
-
selections: fieldNodes,
|
|
103731
|
-
};
|
|
103732
|
-
}
|
|
103733
|
-
function mergeASTs(query, extensionsAST) {
|
|
103734
|
-
return {
|
|
103735
|
-
...query,
|
|
103736
|
-
definitions: query.definitions.map((def) => {
|
|
103737
|
-
if (def.kind === Kind$1.OPERATION_DEFINITION) {
|
|
103738
|
-
return {
|
|
103739
|
-
...def,
|
|
103740
|
-
selectionSet: {
|
|
103741
|
-
kind: Kind$1.SELECTION_SET,
|
|
103742
|
-
selections: [...def.selectionSet.selections, ...extensionsAST.selections],
|
|
103743
|
-
},
|
|
103744
|
-
};
|
|
103745
|
-
}
|
|
103746
|
-
return def;
|
|
103747
|
-
}),
|
|
103748
|
-
};
|
|
103749
|
-
}
|
|
103750
|
-
/**
|
|
103751
|
-
* Augments a query with the extensions from a response. The general algorithm is:
|
|
103752
|
-
* 1. Create an AST from just the extensions.
|
|
103753
|
-
* 2. Deep merge the extensions AST into the query AST.
|
|
103754
|
-
* 3. Deep merge the extensions into the response data.
|
|
103755
|
-
* 4. Return the augmented query and response.
|
|
103756
|
-
* @param query - The query to augment.
|
|
103757
|
-
* @param response - The response to augment the query with.
|
|
103758
|
-
* @returns The augmented query and response.
|
|
103759
|
-
*/
|
|
103760
|
-
function augmentQueryByResponse(query, response) {
|
|
103761
|
-
const extensions = response.extensions?.lds || {};
|
|
103762
|
-
const extensionsAST = createASTFromExtensions(extensions);
|
|
103763
|
-
const augmentedQuery = mergeASTs(query, extensionsAST);
|
|
103764
|
-
// Deep merge extensions into data, removing extensions key from result
|
|
103765
|
-
const mergedData = deepMerge$1(response.data, extensions);
|
|
103766
|
-
return {
|
|
103767
|
-
query: augmentedQuery,
|
|
103768
|
-
response: {
|
|
103769
|
-
data: mergedData,
|
|
103770
|
-
...(response.errors && { errors: response.errors }),
|
|
103771
|
-
},
|
|
103672
|
+
function mergeResponseWithExtensions(response) {
|
|
103673
|
+
return {
|
|
103674
|
+
data: deepMerge$1(response.data, response.extensions?.lds || {}),
|
|
103675
|
+
...(response.errors && { errors: response.errors }),
|
|
103676
|
+
};
|
|
103677
|
+
}
|
|
103678
|
+
function deepMerge$1(data, extensions) {
|
|
103679
|
+
const dataType = typeof data;
|
|
103680
|
+
const extensionsType = typeof extensions;
|
|
103681
|
+
if (dataType === 'function' || extensionsType === 'function') {
|
|
103682
|
+
throw new Error('Cannot merge functions');
|
|
103683
|
+
}
|
|
103684
|
+
if (dataType === 'undefined' || data === undefined) {
|
|
103685
|
+
return extensions;
|
|
103686
|
+
}
|
|
103687
|
+
if (extensionsType === 'undefined' || extensions === undefined) {
|
|
103688
|
+
return data;
|
|
103689
|
+
}
|
|
103690
|
+
if (dataType === 'string' ||
|
|
103691
|
+
dataType === 'number' ||
|
|
103692
|
+
dataType === 'boolean' ||
|
|
103693
|
+
dataType === 'bigint' ||
|
|
103694
|
+
dataType === 'symbol' ||
|
|
103695
|
+
extensionsType === 'string' ||
|
|
103696
|
+
extensionsType === 'number' ||
|
|
103697
|
+
extensionsType === 'boolean' ||
|
|
103698
|
+
extensionsType === 'bigint' ||
|
|
103699
|
+
extensionsType === 'symbol' ||
|
|
103700
|
+
data === null ||
|
|
103701
|
+
extensions === null) {
|
|
103702
|
+
// if either is a scalar, prefer data
|
|
103703
|
+
return data;
|
|
103704
|
+
}
|
|
103705
|
+
// data and extensions are both objects or arrays
|
|
103706
|
+
// if data is an array but extensions is not, prefer data
|
|
103707
|
+
const dataIsArray = Array.isArray(data);
|
|
103708
|
+
const extensionsIsArray = Array.isArray(extensions);
|
|
103709
|
+
// if one is an array and the other is not, prefer data
|
|
103710
|
+
if ((dataIsArray && !extensionsIsArray) || (!dataIsArray && extensionsIsArray)) {
|
|
103711
|
+
return data;
|
|
103712
|
+
}
|
|
103713
|
+
// if both are arrays, merge them, maintaining the length of data
|
|
103714
|
+
if (dataIsArray && extensionsIsArray) {
|
|
103715
|
+
return data.map((item, index) => deepMerge$1(item, extensions[index]));
|
|
103716
|
+
}
|
|
103717
|
+
// if both are objects, merge them
|
|
103718
|
+
// get the keys of both objects
|
|
103719
|
+
const dataKeys = Object.keys(data);
|
|
103720
|
+
const extensionsKeys = Object.keys(extensions);
|
|
103721
|
+
// get the keys that are in both objects
|
|
103722
|
+
const commonKeys = dataKeys.filter((key) => extensionsKeys.includes(key));
|
|
103723
|
+
// get the keys that are in data but not in extensions
|
|
103724
|
+
const dataKeysNotInExtensions = dataKeys.filter((key) => !extensionsKeys.includes(key));
|
|
103725
|
+
// get the keys that are in extensions but not in data
|
|
103726
|
+
const extensionsKeysNotInData = extensionsKeys.filter((key) => !dataKeys.includes(key));
|
|
103727
|
+
return {
|
|
103728
|
+
...Object.fromEntries(commonKeys.map((key) => [
|
|
103729
|
+
key,
|
|
103730
|
+
deepMerge$1(data[key], extensions[key]),
|
|
103731
|
+
])),
|
|
103732
|
+
...Object.fromEntries(dataKeysNotInExtensions.map((key) => [key, data[key]])),
|
|
103733
|
+
...Object.fromEntries(extensionsKeysNotInData.map((key) => [key, extensions[key]])),
|
|
103772
103734
|
};
|
|
103773
103735
|
}
|
|
103774
103736
|
|
|
@@ -103826,17 +103788,16 @@ function buildCommandClass(baseClass) {
|
|
|
103826
103788
|
}
|
|
103827
103789
|
buildWriteInput(data) {
|
|
103828
103790
|
this.latestLuvioRecordIdsToInvalidate = [];
|
|
103829
|
-
const
|
|
103830
|
-
const { query: augmentedQuery, response: augmentedData } = augmentQueryByResponse(baseQuery, data);
|
|
103791
|
+
const augmentedResponse = mergeResponseWithExtensions(data);
|
|
103831
103792
|
const extensionResult = buildGraphQLInputExtension({
|
|
103832
103793
|
...this.config,
|
|
103833
|
-
query:
|
|
103794
|
+
query: this.buildRequestQuery(),
|
|
103834
103795
|
});
|
|
103835
103796
|
if (extensionResult.isErr()) {
|
|
103836
103797
|
throw new InternalError(extensionResult.error);
|
|
103837
103798
|
}
|
|
103838
103799
|
return {
|
|
103839
|
-
data:
|
|
103800
|
+
data: augmentedResponse.data,
|
|
103840
103801
|
...extensionResult.value,
|
|
103841
103802
|
luvioRecordIdsToInvalidate: this.latestLuvioRecordIdsToInvalidate,
|
|
103842
103803
|
};
|
|
@@ -103892,7 +103853,7 @@ function buildCommandClass(baseClass) {
|
|
|
103892
103853
|
synthetic: true,
|
|
103893
103854
|
read: (reader) => {
|
|
103894
103855
|
if (networkResult.isOk()) {
|
|
103895
|
-
|
|
103856
|
+
return this.buildResultType().write(cache.buildFixedTimeWritableCache(Date.now() / 1000), {
|
|
103896
103857
|
...this.buildWriteInput(networkResult.value),
|
|
103897
103858
|
reader,
|
|
103898
103859
|
getNormalizedLuvioRecord: this.services.luvioUiapiRecords
|
|
@@ -103906,7 +103867,6 @@ function buildCommandClass(baseClass) {
|
|
|
103906
103867
|
}
|
|
103907
103868
|
catch (error) {
|
|
103908
103869
|
// swallow error
|
|
103909
|
-
console.error(error);
|
|
103910
103870
|
}
|
|
103911
103871
|
return resolvedPromiseLike(undefined);
|
|
103912
103872
|
}
|
|
@@ -104024,7 +103984,7 @@ function registerCallback(cb) {
|
|
|
104024
103984
|
cb(graphql$1, graphql_imperative$1, useOneStoreGraphQL);
|
|
104025
103985
|
}
|
|
104026
103986
|
}
|
|
104027
|
-
// version: 1.
|
|
103987
|
+
// version: 1.378.0-63d7c07562
|
|
104028
103988
|
|
|
104029
103989
|
function createFragmentMap(documentNode) {
|
|
104030
103990
|
const fragments = {};
|
|
@@ -130519,7 +130479,7 @@ function refreshGraphQL(data) {
|
|
|
130519
130479
|
}
|
|
130520
130480
|
return refresh$3(data, 'refreshUiApi');
|
|
130521
130481
|
}
|
|
130522
|
-
// version: 1.
|
|
130482
|
+
// version: 1.378.0-63d7c07562
|
|
130523
130483
|
|
|
130524
130484
|
// On core the unstable adapters are re-exported with different names,
|
|
130525
130485
|
// we want to match them here.
|
|
@@ -130671,7 +130631,7 @@ withDefaultLuvio((luvio) => {
|
|
|
130671
130631
|
unstable_graphQL_imperative = createImperativeAdapter(luvio, createInstrumentedAdapter(ldsAdapter, adapterMetadata), adapterMetadata);
|
|
130672
130632
|
graphQLImperative = ldsAdapter;
|
|
130673
130633
|
});
|
|
130674
|
-
// version: 1.
|
|
130634
|
+
// version: 1.378.0-63d7c07562
|
|
130675
130635
|
|
|
130676
130636
|
var gqlApi = /*#__PURE__*/Object.freeze({
|
|
130677
130637
|
__proto__: null,
|
|
@@ -131470,7 +131430,7 @@ const callbacks$1 = [];
|
|
|
131470
131430
|
function register(r) {
|
|
131471
131431
|
callbacks$1.forEach((callback) => callback(r));
|
|
131472
131432
|
}
|
|
131473
|
-
// version: 1.
|
|
131433
|
+
// version: 1.378.0-0ab3d40d29
|
|
131474
131434
|
|
|
131475
131435
|
/**
|
|
131476
131436
|
* Copyright (c) 2022, Salesforce, Inc.,
|
|
@@ -132786,4 +132746,4 @@ const { luvio } = getRuntime();
|
|
|
132786
132746
|
setDefaultLuvio({ luvio });
|
|
132787
132747
|
|
|
132788
132748
|
export { createPrimingSession, draftManager, draftQueue, evictCacheRecordsByIds, evictExpiredCacheEntries, executeAdapter, executeMutatingAdapter, getImperativeAdapterNames, importLuvioAdapterModule, importOneStoreAdapterModule, invokeAdapter, invokeAdapterWithDraftToMerge, invokeAdapterWithDraftToReplace, invokeAdapterWithMetadata, nimbusDraftQueue, registerReportObserver, setMetadataTTL, setUiApiRecordTTL, stopEviction, subscribeToAdapter };
|
|
132789
|
-
// version: 1.
|
|
132749
|
+
// version: 1.378.0-0ab3d40d29
|