@salesforce/lds-runtime-mobile 1.405.0 → 1.410.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.
package/dist/main.js
CHANGED
|
@@ -22,7 +22,8 @@ import { isSupportedEntity, configuration, getObjectInfoAdapterFactory, RECORD_I
|
|
|
22
22
|
import allowUpdatesForNonCachedRecords from '@salesforce/gate/lmr.allowUpdatesForNonCachedRecords';
|
|
23
23
|
import { getInstrumentation, idleDetector } from 'o11y/client';
|
|
24
24
|
import caseSensitiveUserId from '@salesforce/user/Id';
|
|
25
|
-
import { Kind as Kind$
|
|
25
|
+
import { Kind as Kind$1, visit as visit$1, isObjectType, defaultFieldResolver, buildSchema, parse as parse$8, extendSchema, isScalarType, execute, print } from '@luvio/graphql-parser';
|
|
26
|
+
import graphqlRelationshipFieldsPerf from '@salesforce/gate/lds.graphqlRelationshipFieldsPerf';
|
|
26
27
|
import FIRST_DAY_OF_WEEK from '@salesforce/i18n/firstDayOfWeek';
|
|
27
28
|
import graphqQueryFieldLimit from '@salesforce/gate/lmr.graphqQueryFieldLimit';
|
|
28
29
|
import graphqlPartialEmitParity from '@salesforce/gate/lmr.graphqlPartialEmitParity';
|
|
@@ -43,6 +44,7 @@ import graphqlL2AdapterGate from '@salesforce/gate/lmr.graphqlL2Adapter';
|
|
|
43
44
|
import useOneStore from '@salesforce/gate/lmr.useOneStore';
|
|
44
45
|
import { setServices } from '@conduit-client/service-provisioner/v1';
|
|
45
46
|
import '@conduit-client/type-normalization/v1';
|
|
47
|
+
import { Kind as Kind$2, visit as visit$2, print as print$1, wrapConfigAndVerify, resolveAst, validateGraphQLOperations } from '@conduit-client/onestore-graphql-parser/v1';
|
|
46
48
|
import productConsumedSideEffects from '@salesforce/gate/com.salesforce.fieldservice.vanStockLDSBypass256';
|
|
47
49
|
|
|
48
50
|
/**
|
|
@@ -53,7 +55,7 @@ import productConsumedSideEffects from '@salesforce/gate/com.salesforce.fieldser
|
|
|
53
55
|
|
|
54
56
|
|
|
55
57
|
const { parse: parse$7, stringify: stringify$7 } = JSON;
|
|
56
|
-
const { join: join$
|
|
58
|
+
const { join: join$1, push: push$2, unshift } = Array.prototype;
|
|
57
59
|
const { isArray: isArray$5 } = Array;
|
|
58
60
|
const { entries: entries$4, keys: keys$6 } = Object;
|
|
59
61
|
|
|
@@ -187,14 +189,14 @@ function buildAggregateUiUrl$1(params, resourceRequest) {
|
|
|
187
189
|
const { fields, optionalFields } = params;
|
|
188
190
|
const queryString = [];
|
|
189
191
|
if (fields !== undefined && fields.length > 0) {
|
|
190
|
-
const fieldString = join$
|
|
192
|
+
const fieldString = join$1.call(fields, ',');
|
|
191
193
|
push$2.call(queryString, `fields=${encodeURIComponent(fieldString)}`);
|
|
192
194
|
}
|
|
193
195
|
if (optionalFields !== undefined && optionalFields.length > 0) {
|
|
194
|
-
const optionalFieldString = join$
|
|
196
|
+
const optionalFieldString = join$1.call(optionalFields, ',');
|
|
195
197
|
push$2.call(queryString, `optionalFields=${encodeURIComponent(optionalFieldString)}`);
|
|
196
198
|
}
|
|
197
|
-
return `${resourceRequest.baseUri}${resourceRequest.basePath}?${join$
|
|
199
|
+
return `${resourceRequest.baseUri}${resourceRequest.basePath}?${join$1.call(queryString, '&')}`;
|
|
198
200
|
}
|
|
199
201
|
function buildGetRecordByFieldsCompositeRequest(resourceRequest, recordsCompositeRequest) {
|
|
200
202
|
const { fieldsArray, optionalFieldsArray, fieldsLength, optionalFieldsLength } = recordsCompositeRequest;
|
|
@@ -20376,10 +20378,36 @@ function validate$7(obj, path = 'RecordInputRepresentation') {
|
|
|
20376
20378
|
if (obj_fields_prop_union3_error != null) {
|
|
20377
20379
|
obj_fields_prop_union3 = obj_fields_prop_union3_error.message;
|
|
20378
20380
|
}
|
|
20381
|
+
let obj_fields_prop_union4 = null;
|
|
20382
|
+
const obj_fields_prop_union4_error = (() => {
|
|
20383
|
+
if (!ArrayIsArray(obj_fields_prop)) {
|
|
20384
|
+
return new TypeError('Expected "array" but received "' +
|
|
20385
|
+
typeof obj_fields_prop +
|
|
20386
|
+
'" (at "' +
|
|
20387
|
+
path_fields_prop +
|
|
20388
|
+
'")');
|
|
20389
|
+
}
|
|
20390
|
+
for (let j = 0; j < obj_fields_prop.length; j++) {
|
|
20391
|
+
const obj_fields_prop_item = obj_fields_prop[j];
|
|
20392
|
+
const path_fields_prop_item = path_fields_prop + '[' + j + ']';
|
|
20393
|
+
if (typeof obj_fields_prop_item !== 'string') {
|
|
20394
|
+
return new TypeError('Expected "string" but received "' +
|
|
20395
|
+
typeof obj_fields_prop_item +
|
|
20396
|
+
'" (at "' +
|
|
20397
|
+
path_fields_prop_item +
|
|
20398
|
+
'")');
|
|
20399
|
+
}
|
|
20400
|
+
}
|
|
20401
|
+
})();
|
|
20402
|
+
// eslint-disable-next-line eqeqeq
|
|
20403
|
+
if (obj_fields_prop_union4_error != null) {
|
|
20404
|
+
obj_fields_prop_union4 = obj_fields_prop_union4_error.message;
|
|
20405
|
+
}
|
|
20379
20406
|
if (obj_fields_prop_union0 &&
|
|
20380
20407
|
obj_fields_prop_union1 &&
|
|
20381
20408
|
obj_fields_prop_union2 &&
|
|
20382
|
-
obj_fields_prop_union3
|
|
20409
|
+
obj_fields_prop_union3 &&
|
|
20410
|
+
obj_fields_prop_union4) {
|
|
20383
20411
|
let message = 'Object doesn\'t match union (at "' + path_fields_prop + '")';
|
|
20384
20412
|
message +=
|
|
20385
20413
|
'\n' +
|
|
@@ -20405,6 +20433,12 @@ function validate$7(obj, path = 'RecordInputRepresentation') {
|
|
|
20405
20433
|
.split('\n')
|
|
20406
20434
|
.map((line) => '\t' + line)
|
|
20407
20435
|
.join('\n');
|
|
20436
|
+
message +=
|
|
20437
|
+
'\n' +
|
|
20438
|
+
obj_fields_prop_union4
|
|
20439
|
+
.split('\n')
|
|
20440
|
+
.map((line) => '\t' + line)
|
|
20441
|
+
.join('\n');
|
|
20408
20442
|
return new TypeError(message);
|
|
20409
20443
|
}
|
|
20410
20444
|
}
|
|
@@ -43957,18 +43991,34 @@ function recordLoaderFactory(query) {
|
|
|
43957
43991
|
async function batchRecordQuery(ids) {
|
|
43958
43992
|
const varbinds = Array(ids.length).fill('?').join(',');
|
|
43959
43993
|
const { rows } = await query(`select data from lds_data where key like 'UiApi::RecordRepresentation:%' and json_extract(data,'$.id') in (${varbinds})`, ids);
|
|
43960
|
-
|
|
43961
|
-
|
|
43994
|
+
if (graphqlRelationshipFieldsPerf.isOpen({ fallback: false })) {
|
|
43995
|
+
// old, non-performant logic fallback
|
|
43996
|
+
return ids.map((id) => {
|
|
43997
|
+
let foundRow = null;
|
|
43998
|
+
rows.forEach((row) => {
|
|
43999
|
+
if (!row[0])
|
|
44000
|
+
return null;
|
|
44001
|
+
const record = parse$5(row[0]);
|
|
44002
|
+
if (record.id === id) {
|
|
44003
|
+
foundRow = record;
|
|
44004
|
+
}
|
|
44005
|
+
});
|
|
44006
|
+
return foundRow;
|
|
44007
|
+
});
|
|
44008
|
+
}
|
|
44009
|
+
else {
|
|
44010
|
+
// DEFAULT PERFORMANT LOGIC - Use kill switch gate to revert
|
|
44011
|
+
// Build a map of id -> record (O(m) with single parse per record)
|
|
44012
|
+
const recordMap = new Map();
|
|
43962
44013
|
rows.forEach((row) => {
|
|
43963
44014
|
if (!row[0])
|
|
43964
|
-
return
|
|
44015
|
+
return;
|
|
43965
44016
|
const record = parse$5(row[0]);
|
|
43966
|
-
|
|
43967
|
-
foundRow = record;
|
|
43968
|
-
}
|
|
44017
|
+
recordMap.set(record.id, record);
|
|
43969
44018
|
});
|
|
43970
|
-
|
|
43971
|
-
|
|
44019
|
+
// Map ids to records (O(n) lookup)
|
|
44020
|
+
return ids.map((id) => recordMap.get(id) || null);
|
|
44021
|
+
}
|
|
43972
44022
|
}
|
|
43973
44023
|
return new DataLoader(batchRecordQuery);
|
|
43974
44024
|
}
|
|
@@ -45375,25 +45425,25 @@ function isObjectValueNode(node) {
|
|
|
45375
45425
|
return node.kind === 'ObjectValue';
|
|
45376
45426
|
}
|
|
45377
45427
|
function isStringValueNode(node) {
|
|
45378
|
-
return node.kind === Kind$
|
|
45428
|
+
return node.kind === Kind$1.STRING;
|
|
45379
45429
|
}
|
|
45380
45430
|
function isIntValueNode(node) {
|
|
45381
|
-
return node.kind === Kind$
|
|
45431
|
+
return node.kind === Kind$1.INT;
|
|
45382
45432
|
}
|
|
45383
45433
|
function isVariableNode(node) {
|
|
45384
|
-
return node.kind === Kind$
|
|
45434
|
+
return node.kind === Kind$1.VARIABLE;
|
|
45385
45435
|
}
|
|
45386
45436
|
function isFieldNode(node) {
|
|
45387
45437
|
return node !== undefined && node.kind !== undefined ? node.kind === 'Field' : false;
|
|
45388
45438
|
}
|
|
45389
45439
|
function isFieldOrInlineFragmentNode(node) {
|
|
45390
45440
|
return node !== undefined && node.kind !== undefined
|
|
45391
|
-
? node.kind === 'Field' || node.kind === Kind$
|
|
45441
|
+
? node.kind === 'Field' || node.kind === Kind$1.INLINE_FRAGMENT
|
|
45392
45442
|
: false;
|
|
45393
45443
|
}
|
|
45394
45444
|
function isInlineFragmentNode(node) {
|
|
45395
45445
|
return node !== undefined && node.kind !== undefined
|
|
45396
|
-
? node.kind === Kind$
|
|
45446
|
+
? node.kind === Kind$1.INLINE_FRAGMENT
|
|
45397
45447
|
: false;
|
|
45398
45448
|
}
|
|
45399
45449
|
function isCompoundPredicate(predicate) {
|
|
@@ -45602,9 +45652,9 @@ function isCapableRelationship(node) {
|
|
|
45602
45652
|
function isScopeArgumentNodeWithType(node, scopeType, variables) {
|
|
45603
45653
|
if (node.name.value !== 'scope')
|
|
45604
45654
|
return false;
|
|
45605
|
-
if (node.value.kind !== Kind$
|
|
45655
|
+
if (node.value.kind !== Kind$1.ENUM && node.value.kind !== Kind$1.VARIABLE)
|
|
45606
45656
|
return false;
|
|
45607
|
-
if (node.value.kind === Kind$
|
|
45657
|
+
if (node.value.kind === Kind$1.ENUM) {
|
|
45608
45658
|
if (node.value.value === scopeType) {
|
|
45609
45659
|
return true;
|
|
45610
45660
|
}
|
|
@@ -45711,7 +45761,7 @@ function isInlineFragmentFieldSpanning(node) {
|
|
|
45711
45761
|
if (!node.selectionSet)
|
|
45712
45762
|
return false;
|
|
45713
45763
|
return node.selectionSet.selections.some((selection) => {
|
|
45714
|
-
if (selection.kind !== Kind$
|
|
45764
|
+
if (selection.kind !== Kind$1.INLINE_FRAGMENT)
|
|
45715
45765
|
return false;
|
|
45716
45766
|
return isFieldSpanning(selection, node);
|
|
45717
45767
|
});
|
|
@@ -46251,7 +46301,7 @@ const base64decode = typeof atob === 'function' ? atob : atobPolyfill;
|
|
|
46251
46301
|
/**
|
|
46252
46302
|
* The set of allowed kind values for AST nodes.
|
|
46253
46303
|
*/
|
|
46254
|
-
var Kind
|
|
46304
|
+
var Kind = Object.freeze({
|
|
46255
46305
|
// Name
|
|
46256
46306
|
NAME: 'Name',
|
|
46257
46307
|
// Document
|
|
@@ -46447,7 +46497,7 @@ defineInspect(Token);
|
|
|
46447
46497
|
* @internal
|
|
46448
46498
|
*/
|
|
46449
46499
|
|
|
46450
|
-
function isNode
|
|
46500
|
+
function isNode(maybeNode) {
|
|
46451
46501
|
return maybeNode != null && typeof maybeNode.kind === 'string';
|
|
46452
46502
|
}
|
|
46453
46503
|
/**
|
|
@@ -46455,17 +46505,17 @@ function isNode$1(maybeNode) {
|
|
|
46455
46505
|
*/
|
|
46456
46506
|
|
|
46457
46507
|
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
46458
|
-
var MAX_ARRAY_LENGTH
|
|
46459
|
-
var MAX_RECURSIVE_DEPTH
|
|
46508
|
+
var MAX_ARRAY_LENGTH = 10;
|
|
46509
|
+
var MAX_RECURSIVE_DEPTH = 2;
|
|
46460
46510
|
/**
|
|
46461
46511
|
* Used to print values in error messages.
|
|
46462
46512
|
*/
|
|
46463
46513
|
|
|
46464
|
-
function inspect
|
|
46465
|
-
return formatValue
|
|
46514
|
+
function inspect(value) {
|
|
46515
|
+
return formatValue(value, []);
|
|
46466
46516
|
}
|
|
46467
46517
|
|
|
46468
|
-
function formatValue
|
|
46518
|
+
function formatValue(value, seenValues) {
|
|
46469
46519
|
switch (_typeof(value)) {
|
|
46470
46520
|
case 'string':
|
|
46471
46521
|
return JSON.stringify(value);
|
|
@@ -46478,14 +46528,14 @@ function formatValue$1(value, seenValues) {
|
|
|
46478
46528
|
return 'null';
|
|
46479
46529
|
}
|
|
46480
46530
|
|
|
46481
|
-
return formatObjectValue
|
|
46531
|
+
return formatObjectValue(value, seenValues);
|
|
46482
46532
|
|
|
46483
46533
|
default:
|
|
46484
46534
|
return String(value);
|
|
46485
46535
|
}
|
|
46486
46536
|
}
|
|
46487
46537
|
|
|
46488
|
-
function formatObjectValue
|
|
46538
|
+
function formatObjectValue(value, previouslySeenValues) {
|
|
46489
46539
|
if (previouslySeenValues.indexOf(value) !== -1) {
|
|
46490
46540
|
return '[Circular]';
|
|
46491
46541
|
}
|
|
@@ -46497,48 +46547,48 @@ function formatObjectValue$1(value, previouslySeenValues) {
|
|
|
46497
46547
|
var customValue = customInspectFn.call(value); // check for infinite recursion
|
|
46498
46548
|
|
|
46499
46549
|
if (customValue !== value) {
|
|
46500
|
-
return typeof customValue === 'string' ? customValue : formatValue
|
|
46550
|
+
return typeof customValue === 'string' ? customValue : formatValue(customValue, seenValues);
|
|
46501
46551
|
}
|
|
46502
46552
|
} else if (Array.isArray(value)) {
|
|
46503
|
-
return formatArray
|
|
46553
|
+
return formatArray(value, seenValues);
|
|
46504
46554
|
}
|
|
46505
46555
|
|
|
46506
|
-
return formatObject
|
|
46556
|
+
return formatObject(value, seenValues);
|
|
46507
46557
|
}
|
|
46508
46558
|
|
|
46509
|
-
function formatObject
|
|
46559
|
+
function formatObject(object, seenValues) {
|
|
46510
46560
|
var keys = Object.keys(object);
|
|
46511
46561
|
|
|
46512
46562
|
if (keys.length === 0) {
|
|
46513
46563
|
return '{}';
|
|
46514
46564
|
}
|
|
46515
46565
|
|
|
46516
|
-
if (seenValues.length > MAX_RECURSIVE_DEPTH
|
|
46517
|
-
return '[' + getObjectTag
|
|
46566
|
+
if (seenValues.length > MAX_RECURSIVE_DEPTH) {
|
|
46567
|
+
return '[' + getObjectTag(object) + ']';
|
|
46518
46568
|
}
|
|
46519
46569
|
|
|
46520
46570
|
var properties = keys.map(function (key) {
|
|
46521
|
-
var value = formatValue
|
|
46571
|
+
var value = formatValue(object[key], seenValues);
|
|
46522
46572
|
return key + ': ' + value;
|
|
46523
46573
|
});
|
|
46524
46574
|
return '{ ' + properties.join(', ') + ' }';
|
|
46525
46575
|
}
|
|
46526
46576
|
|
|
46527
|
-
function formatArray
|
|
46577
|
+
function formatArray(array, seenValues) {
|
|
46528
46578
|
if (array.length === 0) {
|
|
46529
46579
|
return '[]';
|
|
46530
46580
|
}
|
|
46531
46581
|
|
|
46532
|
-
if (seenValues.length > MAX_RECURSIVE_DEPTH
|
|
46582
|
+
if (seenValues.length > MAX_RECURSIVE_DEPTH) {
|
|
46533
46583
|
return '[Array]';
|
|
46534
46584
|
}
|
|
46535
46585
|
|
|
46536
|
-
var len = Math.min(MAX_ARRAY_LENGTH
|
|
46586
|
+
var len = Math.min(MAX_ARRAY_LENGTH, array.length);
|
|
46537
46587
|
var remaining = array.length - len;
|
|
46538
46588
|
var items = [];
|
|
46539
46589
|
|
|
46540
46590
|
for (var i = 0; i < len; ++i) {
|
|
46541
|
-
items.push(formatValue
|
|
46591
|
+
items.push(formatValue(array[i], seenValues));
|
|
46542
46592
|
}
|
|
46543
46593
|
|
|
46544
46594
|
if (remaining === 1) {
|
|
@@ -46562,7 +46612,7 @@ function getCustomFn(object) {
|
|
|
46562
46612
|
}
|
|
46563
46613
|
}
|
|
46564
46614
|
|
|
46565
|
-
function getObjectTag
|
|
46615
|
+
function getObjectTag(object) {
|
|
46566
46616
|
var tag = Object.prototype.toString.call(object).replace(/^\[object /, '').replace(/]$/, '');
|
|
46567
46617
|
|
|
46568
46618
|
if (tag === 'Object' && typeof object.constructor === 'function') {
|
|
@@ -46581,7 +46631,7 @@ function getObjectTag$1(object) {
|
|
|
46581
46631
|
* relevant functions to be called during the visitor's traversal.
|
|
46582
46632
|
*/
|
|
46583
46633
|
|
|
46584
|
-
var QueryDocumentKeys
|
|
46634
|
+
var QueryDocumentKeys = {
|
|
46585
46635
|
Name: [],
|
|
46586
46636
|
Document: ['definitions'],
|
|
46587
46637
|
OperationDefinition: ['name', 'variableDefinitions', 'directives', 'selectionSet'],
|
|
@@ -46628,7 +46678,7 @@ var QueryDocumentKeys$1 = {
|
|
|
46628
46678
|
EnumTypeExtension: ['name', 'directives', 'values'],
|
|
46629
46679
|
InputObjectTypeExtension: ['name', 'directives', 'fields']
|
|
46630
46680
|
};
|
|
46631
|
-
var BREAK
|
|
46681
|
+
var BREAK = Object.freeze({});
|
|
46632
46682
|
/**
|
|
46633
46683
|
* visit() will walk through an AST using a depth-first traversal, calling
|
|
46634
46684
|
* the visitor's enter function at each node in the traversal, and calling the
|
|
@@ -46716,8 +46766,8 @@ var BREAK$1 = Object.freeze({});
|
|
|
46716
46766
|
* })
|
|
46717
46767
|
*/
|
|
46718
46768
|
|
|
46719
|
-
function visit
|
|
46720
|
-
var visitorKeys = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : QueryDocumentKeys
|
|
46769
|
+
function visit(root, visitor) {
|
|
46770
|
+
var visitorKeys = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : QueryDocumentKeys;
|
|
46721
46771
|
|
|
46722
46772
|
/* eslint-disable no-undef-init */
|
|
46723
46773
|
var stack = undefined;
|
|
@@ -46797,8 +46847,8 @@ function visit$1(root, visitor) {
|
|
|
46797
46847
|
var result = void 0;
|
|
46798
46848
|
|
|
46799
46849
|
if (!Array.isArray(node)) {
|
|
46800
|
-
if (!isNode
|
|
46801
|
-
throw new Error("Invalid AST Node: ".concat(inspect
|
|
46850
|
+
if (!isNode(node)) {
|
|
46851
|
+
throw new Error("Invalid AST Node: ".concat(inspect(node), "."));
|
|
46802
46852
|
}
|
|
46803
46853
|
|
|
46804
46854
|
var visitFn = getVisitFn(visitor, node.kind, isLeaving);
|
|
@@ -46806,7 +46856,7 @@ function visit$1(root, visitor) {
|
|
|
46806
46856
|
if (visitFn) {
|
|
46807
46857
|
result = visitFn.call(visitor, node, key, parent, path, ancestors);
|
|
46808
46858
|
|
|
46809
|
-
if (result === BREAK
|
|
46859
|
+
if (result === BREAK) {
|
|
46810
46860
|
break;
|
|
46811
46861
|
}
|
|
46812
46862
|
|
|
@@ -46819,7 +46869,7 @@ function visit$1(root, visitor) {
|
|
|
46819
46869
|
edits.push([key, result]);
|
|
46820
46870
|
|
|
46821
46871
|
if (!isLeaving) {
|
|
46822
|
-
if (isNode
|
|
46872
|
+
if (isNode(result)) {
|
|
46823
46873
|
node = result;
|
|
46824
46874
|
} else {
|
|
46825
46875
|
path.pop();
|
|
@@ -46995,7 +47045,7 @@ function decodeV1Cursor(base64cursor) {
|
|
|
46995
47045
|
function selectionIncludesHasNextPage(selections, fragments) {
|
|
46996
47046
|
for (let selection of selections) {
|
|
46997
47047
|
switch (selection.kind) {
|
|
46998
|
-
case Kind
|
|
47048
|
+
case Kind.FIELD: {
|
|
46999
47049
|
if (selection.name.value === 'pageInfo') {
|
|
47000
47050
|
if (!selection.selectionSet)
|
|
47001
47051
|
continue;
|
|
@@ -47006,7 +47056,7 @@ function selectionIncludesHasNextPage(selections, fragments) {
|
|
|
47006
47056
|
}
|
|
47007
47057
|
break;
|
|
47008
47058
|
}
|
|
47009
|
-
case Kind
|
|
47059
|
+
case Kind.FRAGMENT_SPREAD: {
|
|
47010
47060
|
let fragment = fragments[selection.name.value];
|
|
47011
47061
|
if (!fragment)
|
|
47012
47062
|
return false;
|
|
@@ -47015,7 +47065,7 @@ function selectionIncludesHasNextPage(selections, fragments) {
|
|
|
47015
47065
|
}
|
|
47016
47066
|
break;
|
|
47017
47067
|
}
|
|
47018
|
-
case Kind
|
|
47068
|
+
case Kind.INLINE_FRAGMENT:
|
|
47019
47069
|
if (selectionIncludesHasNextPage(selection.selectionSet.selections, fragments)) {
|
|
47020
47070
|
return true;
|
|
47021
47071
|
}
|
|
@@ -47071,7 +47121,7 @@ function mapCursorValue(originalValue, paginationMetadata) {
|
|
|
47071
47121
|
async function mapPaginationCursors(originalAST, variables, store) {
|
|
47072
47122
|
// first pass, identify record query cache keys for reading pagination metadata
|
|
47073
47123
|
let requiredPaginationMetadataKeys = [];
|
|
47074
|
-
visit$
|
|
47124
|
+
visit$1(originalAST, {
|
|
47075
47125
|
Field(node, _key, _parent, _path, ancestors) {
|
|
47076
47126
|
// is it a record query?
|
|
47077
47127
|
if (!isRecordQuery(node)) {
|
|
@@ -47099,7 +47149,7 @@ async function mapPaginationCursors(originalAST, variables, store) {
|
|
|
47099
47149
|
// holds the original cursor values that were mapped back to server cursors
|
|
47100
47150
|
let mappedCursors = new Map();
|
|
47101
47151
|
// rewrite nodes/variables with mapped cursors now that we read the pagination metadata
|
|
47102
|
-
let ast = visit$
|
|
47152
|
+
let ast = visit$1(originalAST, {
|
|
47103
47153
|
Field(node, _key, _parent, _path, ancestors) {
|
|
47104
47154
|
// is it a record query?
|
|
47105
47155
|
if (!isRecordQuery(node)) {
|
|
@@ -48155,7 +48205,7 @@ async function evaluate(config, observers, settings, objectInfos, store, snapsho
|
|
|
48155
48205
|
const operationNode = getOperationFromDocument(config.query);
|
|
48156
48206
|
let topLevelQueries = [];
|
|
48157
48207
|
// assume that 'config.query' has required injected fields.
|
|
48158
|
-
const modifiedAST = visit$
|
|
48208
|
+
const modifiedAST = visit$1(config.query, {
|
|
48159
48209
|
Field: {
|
|
48160
48210
|
leave(node) {
|
|
48161
48211
|
if (node.name.value !== `node`)
|
|
@@ -48244,20 +48294,20 @@ async function evaluate(config, observers, settings, objectInfos, store, snapsho
|
|
|
48244
48294
|
}
|
|
48245
48295
|
|
|
48246
48296
|
const parentRelationshipDirective = {
|
|
48247
|
-
kind: Kind$
|
|
48297
|
+
kind: Kind$1.DIRECTIVE,
|
|
48248
48298
|
name: {
|
|
48249
|
-
kind: Kind$
|
|
48299
|
+
kind: Kind$1.NAME,
|
|
48250
48300
|
value: 'category',
|
|
48251
48301
|
},
|
|
48252
48302
|
arguments: [
|
|
48253
48303
|
{
|
|
48254
|
-
kind: Kind$
|
|
48304
|
+
kind: Kind$1.ARGUMENT,
|
|
48255
48305
|
name: {
|
|
48256
|
-
kind: Kind$
|
|
48306
|
+
kind: Kind$1.NAME,
|
|
48257
48307
|
value: 'name',
|
|
48258
48308
|
},
|
|
48259
48309
|
value: {
|
|
48260
|
-
kind: Kind$
|
|
48310
|
+
kind: Kind$1.STRING,
|
|
48261
48311
|
value: PARENT_RELATIONSHIP,
|
|
48262
48312
|
block: false,
|
|
48263
48313
|
},
|
|
@@ -48265,12 +48315,12 @@ const parentRelationshipDirective = {
|
|
|
48265
48315
|
],
|
|
48266
48316
|
};
|
|
48267
48317
|
const FieldValueNodeSelectionSet = {
|
|
48268
|
-
kind: Kind$
|
|
48318
|
+
kind: Kind$1.SELECTION_SET,
|
|
48269
48319
|
selections: [
|
|
48270
48320
|
{
|
|
48271
|
-
kind: Kind$
|
|
48321
|
+
kind: Kind$1.FIELD,
|
|
48272
48322
|
name: {
|
|
48273
|
-
kind: Kind$
|
|
48323
|
+
kind: Kind$1.NAME,
|
|
48274
48324
|
value: 'value',
|
|
48275
48325
|
},
|
|
48276
48326
|
},
|
|
@@ -48296,7 +48346,7 @@ async function injectSyntheticFields(originalAST, objectInfoService, draftFuncti
|
|
|
48296
48346
|
unmappedDraftIDs: new Set(),
|
|
48297
48347
|
};
|
|
48298
48348
|
let assignedtomeQueryFieldNode = undefined;
|
|
48299
|
-
visit$
|
|
48349
|
+
visit$1(originalAST, {
|
|
48300
48350
|
Argument: {
|
|
48301
48351
|
enter(node, key, parent, path, ancestors) {
|
|
48302
48352
|
const { connection: recordConnectionNode, path: ancesterPath } = findNearestConnectionWithPath(ancestors);
|
|
@@ -48368,7 +48418,7 @@ async function injectSyntheticFields(originalAST, objectInfoService, draftFuncti
|
|
|
48368
48418
|
objectInfos = await resolveObjectInfos(objectNodeInfoTree, pathToObjectApiNamesMap, startNodes, objectInfoService);
|
|
48369
48419
|
}
|
|
48370
48420
|
// read pass; gather whats needed
|
|
48371
|
-
visit$
|
|
48421
|
+
visit$1(originalAST, {
|
|
48372
48422
|
Argument: {
|
|
48373
48423
|
leave(node, key, parent, path, ancestors) {
|
|
48374
48424
|
const recordQueryField = findNearestConnection(ancestors);
|
|
@@ -48455,7 +48505,7 @@ async function injectSyntheticFields(originalAST, objectInfoService, draftFuncti
|
|
|
48455
48505
|
},
|
|
48456
48506
|
});
|
|
48457
48507
|
// write pass; inject whats needed
|
|
48458
|
-
const modifiedAST = visit$
|
|
48508
|
+
const modifiedAST = visit$1(originalAST, {
|
|
48459
48509
|
Field: {
|
|
48460
48510
|
leave(node, key, parent, path, ancestors) {
|
|
48461
48511
|
// removes 'ServicesResources' query field node if 'assignedtome' scope shows up
|
|
@@ -48533,7 +48583,7 @@ async function injectSyntheticFields(originalAST, objectInfoService, draftFuncti
|
|
|
48533
48583
|
}
|
|
48534
48584
|
function swapIdField(filterFields, objectInfo, swapped, idState, draftFunctions) {
|
|
48535
48585
|
switch (filterFields.kind) {
|
|
48536
|
-
case Kind$
|
|
48586
|
+
case Kind$1.OBJECT: {
|
|
48537
48587
|
const fieldNodes = filterFields.fields.map((fieldNode) => {
|
|
48538
48588
|
// check at the object value node level if the node's name is an Id/Reference
|
|
48539
48589
|
// if not then just pass the current swapped state
|
|
@@ -48551,7 +48601,7 @@ function swapIdField(filterFields, objectInfo, swapped, idState, draftFunctions)
|
|
|
48551
48601
|
fields: fieldNodes,
|
|
48552
48602
|
};
|
|
48553
48603
|
}
|
|
48554
|
-
case Kind$
|
|
48604
|
+
case Kind$1.STRING: {
|
|
48555
48605
|
if (!swapped) {
|
|
48556
48606
|
return filterFields;
|
|
48557
48607
|
}
|
|
@@ -48570,7 +48620,7 @@ function swapIdField(filterFields, objectInfo, swapped, idState, draftFunctions)
|
|
|
48570
48620
|
block: false,
|
|
48571
48621
|
};
|
|
48572
48622
|
}
|
|
48573
|
-
case Kind$
|
|
48623
|
+
case Kind$1.LIST: {
|
|
48574
48624
|
const values = filterFields.values.map((valueNode) => swapIdField(valueNode, objectInfo, swapped, idState, draftFunctions));
|
|
48575
48625
|
return {
|
|
48576
48626
|
kind: 'ListValue',
|
|
@@ -48656,14 +48706,14 @@ function mergeSelectionNodes(group1, group2) {
|
|
|
48656
48706
|
function growObjectFieldTree(tree, parentNode, entryNode, totalNodes, startNodes) {
|
|
48657
48707
|
entryNode.fields.forEach((objectFieldNode) => {
|
|
48658
48708
|
// objectFieldNode: {Account: { Name : { eq: "xxyyzz"}}}; objectFieldNode.value: { Name : { eq: "xxyyzz"}}
|
|
48659
|
-
if (objectFieldNode.value.kind === Kind$
|
|
48709
|
+
if (objectFieldNode.value.kind === Kind$1.OBJECT) {
|
|
48660
48710
|
if (objectFieldNode.name.value === 'not') {
|
|
48661
48711
|
// recursively go to deeper level of filter.
|
|
48662
48712
|
growObjectFieldTree(tree, parentNode, objectFieldNode.value, totalNodes, startNodes);
|
|
48663
48713
|
}
|
|
48664
48714
|
else {
|
|
48665
48715
|
// Spanning Field 'Account'
|
|
48666
|
-
if (objectFieldNode.value.fields.some((childObjectFieldNode) => childObjectFieldNode.value.kind === Kind$
|
|
48716
|
+
if (objectFieldNode.value.fields.some((childObjectFieldNode) => childObjectFieldNode.value.kind === Kind$1.OBJECT)) {
|
|
48667
48717
|
if (!totalNodes.has(parentNode)) {
|
|
48668
48718
|
totalNodes.add(parentNode);
|
|
48669
48719
|
startNodes.add(parentNode);
|
|
@@ -48686,7 +48736,7 @@ function growObjectFieldTree(tree, parentNode, entryNode, totalNodes, startNodes
|
|
|
48686
48736
|
}
|
|
48687
48737
|
}
|
|
48688
48738
|
}
|
|
48689
|
-
else if (objectFieldNode.value.kind === Kind$
|
|
48739
|
+
else if (objectFieldNode.value.kind === Kind$1.LIST) {
|
|
48690
48740
|
objectFieldNode.value.values.filter(isObjectValueNode).forEach((childNode) => {
|
|
48691
48741
|
growObjectFieldTree(tree, parentNode, childNode, totalNodes, startNodes);
|
|
48692
48742
|
});
|
|
@@ -48968,7 +49018,7 @@ function injectFilter(filterNode, idState, parentPath, isParentPolymorphic, obje
|
|
|
48968
49018
|
const injectedSelections = [];
|
|
48969
49019
|
let isPolymorphicField = false;
|
|
48970
49020
|
switch (filterNode.kind) {
|
|
48971
|
-
case Kind$
|
|
49021
|
+
case Kind$1.ARGUMENT:
|
|
48972
49022
|
if (filterNode.value.kind !== 'ObjectValue')
|
|
48973
49023
|
return [];
|
|
48974
49024
|
filterNode.value.fields.forEach((objectFieldNode) => {
|
|
@@ -48982,9 +49032,9 @@ function injectFilter(filterNode, idState, parentPath, isParentPolymorphic, obje
|
|
|
48982
49032
|
}
|
|
48983
49033
|
});
|
|
48984
49034
|
return injectedSelections;
|
|
48985
|
-
case Kind$
|
|
49035
|
+
case Kind$1.OBJECT_FIELD:
|
|
48986
49036
|
switch (filterNode.value.kind) {
|
|
48987
|
-
case Kind$
|
|
49037
|
+
case Kind$1.LIST: {
|
|
48988
49038
|
filterNode.value.values.filter(isObjectValueNode).forEach((objectValueNode) => {
|
|
48989
49039
|
objectValueNode.fields.forEach((objectFieldNode) => {
|
|
48990
49040
|
const subResults = injectFilter(objectFieldNode, idState, parentPath, isParentPolymorphic, objectInfos, pathToObjectApiNamesMap, draftFunctions, queryNode);
|
|
@@ -48995,7 +49045,7 @@ function injectFilter(filterNode, idState, parentPath, isParentPolymorphic, obje
|
|
|
48995
49045
|
});
|
|
48996
49046
|
return injectedSelections;
|
|
48997
49047
|
}
|
|
48998
|
-
case Kind$
|
|
49048
|
+
case Kind$1.OBJECT: {
|
|
48999
49049
|
if (filterNode.name.value === 'not') {
|
|
49000
49050
|
filterNode.value.fields.forEach((objectFieldNode) => {
|
|
49001
49051
|
const subResults = injectFilter(objectFieldNode, idState, parentPath, isParentPolymorphic, objectInfos, pathToObjectApiNamesMap, draftFunctions, queryNode);
|
|
@@ -49125,9 +49175,9 @@ function injectFilter(filterNode, idState, parentPath, isParentPolymorphic, obje
|
|
|
49125
49175
|
(isInlineFragment && !isTypeNameExisting)) {
|
|
49126
49176
|
if (isInlineFragment) {
|
|
49127
49177
|
sel = {
|
|
49128
|
-
kind: Kind$
|
|
49178
|
+
kind: Kind$1.INLINE_FRAGMENT,
|
|
49129
49179
|
typeCondition: {
|
|
49130
|
-
kind: Kind$
|
|
49180
|
+
kind: Kind$1.NAMED_TYPE,
|
|
49131
49181
|
name: {
|
|
49132
49182
|
kind: 'Name',
|
|
49133
49183
|
value: filterNode.name.value,
|
|
@@ -49146,14 +49196,14 @@ function injectFilter(filterNode, idState, parentPath, isParentPolymorphic, obje
|
|
|
49146
49196
|
...sel,
|
|
49147
49197
|
directives,
|
|
49148
49198
|
selectionSet: {
|
|
49149
|
-
kind: Kind$
|
|
49199
|
+
kind: Kind$1.SELECTION_SET,
|
|
49150
49200
|
selections: idField.concat(...subSelectionNodes),
|
|
49151
49201
|
},
|
|
49152
49202
|
}
|
|
49153
49203
|
: {
|
|
49154
49204
|
...sel,
|
|
49155
49205
|
selectionSet: {
|
|
49156
|
-
kind: Kind$
|
|
49206
|
+
kind: Kind$1.SELECTION_SET,
|
|
49157
49207
|
selections: idField.concat(...subSelectionNodes),
|
|
49158
49208
|
},
|
|
49159
49209
|
};
|
|
@@ -49286,12 +49336,12 @@ function updateIDInfo(fieldNode, idState, draftFunctions) {
|
|
|
49286
49336
|
if (isObjectValueNode(fieldNode.value)) {
|
|
49287
49337
|
const idOpValueNode = fieldNode.value.fields[0];
|
|
49288
49338
|
switch (idOpValueNode.value.kind) {
|
|
49289
|
-
case Kind$
|
|
49339
|
+
case Kind$1.STRING: {
|
|
49290
49340
|
const id = idOpValueNode.value.value;
|
|
49291
49341
|
idState.swapNeeded = draftFunctions.isDraftId(id);
|
|
49292
49342
|
break;
|
|
49293
49343
|
}
|
|
49294
|
-
case Kind$
|
|
49344
|
+
case Kind$1.LIST: {
|
|
49295
49345
|
const listValues = idOpValueNode.value.values;
|
|
49296
49346
|
idState.swapNeeded = listValues
|
|
49297
49347
|
.filter(isStringValueNode)
|
|
@@ -49378,7 +49428,7 @@ function injectParentRelationships(selections, parentNode, parentPath, ancestors
|
|
|
49378
49428
|
parentInjectedNodes.push({
|
|
49379
49429
|
...selection,
|
|
49380
49430
|
selectionSet: {
|
|
49381
|
-
kind: Kind$
|
|
49431
|
+
kind: Kind$1.SELECTION_SET,
|
|
49382
49432
|
selections: [...idSelection, ...subInjectedSelections],
|
|
49383
49433
|
},
|
|
49384
49434
|
});
|
|
@@ -49928,9 +49978,9 @@ function referenceIdFieldForRelationship(relationshipName) {
|
|
|
49928
49978
|
*/
|
|
49929
49979
|
function createFieldNode(nameValue, selectionSet) {
|
|
49930
49980
|
return {
|
|
49931
|
-
kind: Kind$
|
|
49981
|
+
kind: Kind$1.FIELD,
|
|
49932
49982
|
name: {
|
|
49933
|
-
kind: Kind$
|
|
49983
|
+
kind: Kind$1.NAME,
|
|
49934
49984
|
value: nameValue,
|
|
49935
49985
|
},
|
|
49936
49986
|
selectionSet,
|
|
@@ -50066,7 +50116,7 @@ function instrumentLimits(ast, variables) {
|
|
|
50066
50116
|
let currentChildRelationships = 0;
|
|
50067
50117
|
let currentRootRecordCount = 0;
|
|
50068
50118
|
let currentTotalRecordCount = 0;
|
|
50069
|
-
visit$
|
|
50119
|
+
visit$1(ast, {
|
|
50070
50120
|
Field: {
|
|
50071
50121
|
enter(node) {
|
|
50072
50122
|
if (isRecordQuery(node)) {
|
|
@@ -50130,7 +50180,7 @@ function enforceFieldLimitOnAST(ast, variables, objectInfos, enforcedLimits = {
|
|
|
50130
50180
|
}) {
|
|
50131
50181
|
const { maxFieldCount, maxRecordLimit, singleRecordField, maxFieldSize } = enforcedLimits;
|
|
50132
50182
|
const fieldsWithDataType = findFieldTypeInObjectInfo(objectInfos, singleRecordField);
|
|
50133
|
-
const documentNode = visit
|
|
50183
|
+
const documentNode = visit(ast, {
|
|
50134
50184
|
Field(node) {
|
|
50135
50185
|
// is it a record query?
|
|
50136
50186
|
if (!isRecordQuery(node)) {
|
|
@@ -50180,7 +50230,7 @@ function enforceFieldLimitOnAST(ast, variables, objectInfos, enforcedLimits = {
|
|
|
50180
50230
|
return {
|
|
50181
50231
|
...argument,
|
|
50182
50232
|
value: {
|
|
50183
|
-
kind: Kind
|
|
50233
|
+
kind: Kind.INT,
|
|
50184
50234
|
value: recordLimit,
|
|
50185
50235
|
},
|
|
50186
50236
|
};
|
|
@@ -50810,7 +50860,7 @@ const recordIdGenerator = (id) => {
|
|
|
50810
50860
|
|
|
50811
50861
|
const { keys: keys$2, create: create$2, assign: assign$1, entries: entries$2 } = Object;
|
|
50812
50862
|
const { stringify: stringify$4, parse: parse$4 } = JSON;
|
|
50813
|
-
const { push, join
|
|
50863
|
+
const { push, join, slice } = Array.prototype;
|
|
50814
50864
|
const { isArray: isArray$2, from } = Array;
|
|
50815
50865
|
|
|
50816
50866
|
function ldsParamsToString(params) {
|
|
@@ -50992,10 +51042,10 @@ class ScopedFields {
|
|
|
50992
51042
|
fields.forEach(this.addField, this);
|
|
50993
51043
|
}
|
|
50994
51044
|
toQueryParameterValue() {
|
|
50995
|
-
const joinedFields = join
|
|
51045
|
+
const joinedFields = join.call(Object.keys(this.fields), SEPARATOR_BETWEEN_FIELDS);
|
|
50996
51046
|
return this.isUnScoped()
|
|
50997
51047
|
? joinedFields
|
|
50998
|
-
: join
|
|
51048
|
+
: join.call([this.scope, joinedFields], SEPARATOR_BETWEEN_SCOPE_AND_FIELDS);
|
|
50999
51049
|
}
|
|
51000
51050
|
toQueryParams() {
|
|
51001
51051
|
return this.isUnScoped() ? Object.keys(this.fields) : this.toQueryParameterValue();
|
|
@@ -51063,7 +51113,7 @@ class ScopedFieldsCollection {
|
|
|
51063
51113
|
if (chunk !== undefined)
|
|
51064
51114
|
result.push(chunk);
|
|
51065
51115
|
}
|
|
51066
|
-
return join
|
|
51116
|
+
return join.call(result, SEPARATOR_BETWEEN_SCOPES);
|
|
51067
51117
|
}
|
|
51068
51118
|
/**
|
|
51069
51119
|
* split the ScopedFields into multiple ScopedFields
|
|
@@ -51240,7 +51290,7 @@ function buildAggregateUiUrl(params, resourceRequest) {
|
|
|
51240
51290
|
queryString.push(`${key}=${isArray$2(value) ? value.join(',') : value}`);
|
|
51241
51291
|
}
|
|
51242
51292
|
}
|
|
51243
|
-
return `${resourceRequest.baseUri}${resourceRequest.basePath}?${join
|
|
51293
|
+
return `${resourceRequest.baseUri}${resourceRequest.basePath}?${join.call(queryString, '&')}`;
|
|
51244
51294
|
}
|
|
51245
51295
|
function shouldUseAggregateUiForFields(fieldsArray, optionalFieldsArray, maxLengthPerChunk) {
|
|
51246
51296
|
return fieldsArray.length + optionalFieldsArray.length >= maxLengthPerChunk;
|
|
@@ -54456,7 +54506,7 @@ function createResourceRequest$2(config) {
|
|
|
54456
54506
|
baseUri: '/services/data/v66.0',
|
|
54457
54507
|
basePath: '/graphql',
|
|
54458
54508
|
method: 'post',
|
|
54459
|
-
body: { ...config.body, query: print
|
|
54509
|
+
body: { ...config.body, query: print(config.body.query) },
|
|
54460
54510
|
urlParams: {},
|
|
54461
54511
|
queryParams: {},
|
|
54462
54512
|
headers,
|
|
@@ -54480,7 +54530,7 @@ function stripMetaschemaFromFieldNode(fieldNode) {
|
|
|
54480
54530
|
return fieldNode;
|
|
54481
54531
|
}
|
|
54482
54532
|
function stripDocumentOfMetaschema(documentNode) {
|
|
54483
|
-
return visit$
|
|
54533
|
+
return visit$1(documentNode, {
|
|
54484
54534
|
Field(node) {
|
|
54485
54535
|
return stripMetaschemaFromFieldNode(node);
|
|
54486
54536
|
},
|
|
@@ -54512,7 +54562,7 @@ function transformConfiguration$1(config) {
|
|
|
54512
54562
|
// Make a copy of the config before running transform to avoid mutating the original config
|
|
54513
54563
|
const adapterConfigCopy = {
|
|
54514
54564
|
...config,
|
|
54515
|
-
query: parse$8(print
|
|
54565
|
+
query: parse$8(print(config.query))
|
|
54516
54566
|
};
|
|
54517
54567
|
return {
|
|
54518
54568
|
...adapterConfigCopy,
|
|
@@ -54594,7 +54644,7 @@ function stripDocumentsOfMetaschema(config) {
|
|
|
54594
54644
|
const batchQueryTransformed = config.body.batchQuery.map((singleConfig) => {
|
|
54595
54645
|
return {
|
|
54596
54646
|
...singleConfig,
|
|
54597
|
-
query: print
|
|
54647
|
+
query: print(stripDocumentOfMetaschema(singleConfig.query)),
|
|
54598
54648
|
};
|
|
54599
54649
|
});
|
|
54600
54650
|
return {
|
|
@@ -54890,7 +54940,7 @@ function transformConfiguration(config) {
|
|
|
54890
54940
|
const batchQueryTransformed = config.batchQuery.map((singleConfig) => {
|
|
54891
54941
|
return {
|
|
54892
54942
|
...singleConfig,
|
|
54893
|
-
query: applyMinimumFieldsToQuery(parse$8(print
|
|
54943
|
+
query: applyMinimumFieldsToQuery(parse$8(print(singleConfig.query))), // Stringifies and parses again to avoid mutating original. Should we just JSON.stringify to avoid the dependency on the parser?
|
|
54894
54944
|
};
|
|
54895
54945
|
});
|
|
54896
54946
|
return {
|
|
@@ -58329,7 +58379,7 @@ function buildServiceDescriptor$b(luvio) {
|
|
|
58329
58379
|
},
|
|
58330
58380
|
};
|
|
58331
58381
|
}
|
|
58332
|
-
// version: 1.
|
|
58382
|
+
// version: 1.410.0-7c228ee347
|
|
58333
58383
|
|
|
58334
58384
|
/**
|
|
58335
58385
|
* Copyright (c) 2022, Salesforce, Inc.,
|
|
@@ -58355,903 +58405,7 @@ function buildServiceDescriptor$a(notifyRecordUpdateAvailable, getNormalizedLuvi
|
|
|
58355
58405
|
},
|
|
58356
58406
|
};
|
|
58357
58407
|
}
|
|
58358
|
-
// version: 1.
|
|
58359
|
-
|
|
58360
|
-
/*!
|
|
58361
|
-
* Copyright (c) 2022, Salesforce, Inc.,
|
|
58362
|
-
* All rights reserved.
|
|
58363
|
-
* For full license text, see the LICENSE.txt file
|
|
58364
|
-
*/
|
|
58365
|
-
function devAssert(condition, message) {
|
|
58366
|
-
const booleanCondition = Boolean(condition);
|
|
58367
|
-
if (!booleanCondition) {
|
|
58368
|
-
throw new Error(message);
|
|
58369
|
-
}
|
|
58370
|
-
}
|
|
58371
|
-
const MAX_ARRAY_LENGTH = 10;
|
|
58372
|
-
const MAX_RECURSIVE_DEPTH = 2;
|
|
58373
|
-
function inspect(value) {
|
|
58374
|
-
return formatValue(value, []);
|
|
58375
|
-
}
|
|
58376
|
-
function formatValue(value, seenValues) {
|
|
58377
|
-
switch (typeof value) {
|
|
58378
|
-
case "string":
|
|
58379
|
-
return JSON.stringify(value);
|
|
58380
|
-
case "function":
|
|
58381
|
-
return value.name ? `[function ${value.name}]` : "[function]";
|
|
58382
|
-
case "object":
|
|
58383
|
-
return formatObjectValue(value, seenValues);
|
|
58384
|
-
default:
|
|
58385
|
-
return String(value);
|
|
58386
|
-
}
|
|
58387
|
-
}
|
|
58388
|
-
function formatObjectValue(value, previouslySeenValues) {
|
|
58389
|
-
if (value === null) {
|
|
58390
|
-
return "null";
|
|
58391
|
-
}
|
|
58392
|
-
if (previouslySeenValues.includes(value)) {
|
|
58393
|
-
return "[Circular]";
|
|
58394
|
-
}
|
|
58395
|
-
const seenValues = [...previouslySeenValues, value];
|
|
58396
|
-
if (isJSONable(value)) {
|
|
58397
|
-
const jsonValue = value.toJSON();
|
|
58398
|
-
if (jsonValue !== value) {
|
|
58399
|
-
return typeof jsonValue === "string" ? jsonValue : formatValue(jsonValue, seenValues);
|
|
58400
|
-
}
|
|
58401
|
-
} else if (Array.isArray(value)) {
|
|
58402
|
-
return formatArray(value, seenValues);
|
|
58403
|
-
}
|
|
58404
|
-
return formatObject(value, seenValues);
|
|
58405
|
-
}
|
|
58406
|
-
function isJSONable(value) {
|
|
58407
|
-
return typeof value.toJSON === "function";
|
|
58408
|
-
}
|
|
58409
|
-
function formatObject(object, seenValues) {
|
|
58410
|
-
const entries = Object.entries(object);
|
|
58411
|
-
if (entries.length === 0) {
|
|
58412
|
-
return "{}";
|
|
58413
|
-
}
|
|
58414
|
-
if (seenValues.length > MAX_RECURSIVE_DEPTH) {
|
|
58415
|
-
return "[" + getObjectTag(object) + "]";
|
|
58416
|
-
}
|
|
58417
|
-
const properties = entries.map(
|
|
58418
|
-
([key, value]) => key + ": " + formatValue(value, seenValues)
|
|
58419
|
-
);
|
|
58420
|
-
return "{ " + properties.join(", ") + " }";
|
|
58421
|
-
}
|
|
58422
|
-
function formatArray(array, seenValues) {
|
|
58423
|
-
if (array.length === 0) {
|
|
58424
|
-
return "[]";
|
|
58425
|
-
}
|
|
58426
|
-
if (seenValues.length > MAX_RECURSIVE_DEPTH) {
|
|
58427
|
-
return "[Array]";
|
|
58428
|
-
}
|
|
58429
|
-
const len = Math.min(MAX_ARRAY_LENGTH, array.length);
|
|
58430
|
-
const remaining = array.length - len;
|
|
58431
|
-
const items = [];
|
|
58432
|
-
for (let i = 0; i < len; ++i) {
|
|
58433
|
-
items.push(formatValue(array[i], seenValues));
|
|
58434
|
-
}
|
|
58435
|
-
if (remaining === 1) {
|
|
58436
|
-
items.push("... 1 more item");
|
|
58437
|
-
} else if (remaining > 1) {
|
|
58438
|
-
items.push(`... ${remaining} more items`);
|
|
58439
|
-
}
|
|
58440
|
-
return "[" + items.join(", ") + "]";
|
|
58441
|
-
}
|
|
58442
|
-
function getObjectTag(object) {
|
|
58443
|
-
const tag = Object.prototype.toString.call(object).replace(/^\[object /, "").replace(/]$/, "");
|
|
58444
|
-
if (tag === "Object" && typeof object.constructor === "function") {
|
|
58445
|
-
const name = object.constructor.name;
|
|
58446
|
-
if (typeof name === "string" && name !== "") {
|
|
58447
|
-
return name;
|
|
58448
|
-
}
|
|
58449
|
-
}
|
|
58450
|
-
return tag;
|
|
58451
|
-
}
|
|
58452
|
-
globalThis.process && // eslint-disable-next-line no-undef
|
|
58453
|
-
process.env.NODE_ENV === "production";
|
|
58454
|
-
var Kind;
|
|
58455
|
-
(function(Kind2) {
|
|
58456
|
-
Kind2["NAME"] = "Name";
|
|
58457
|
-
Kind2["DOCUMENT"] = "Document";
|
|
58458
|
-
Kind2["OPERATION_DEFINITION"] = "OperationDefinition";
|
|
58459
|
-
Kind2["VARIABLE_DEFINITION"] = "VariableDefinition";
|
|
58460
|
-
Kind2["SELECTION_SET"] = "SelectionSet";
|
|
58461
|
-
Kind2["FIELD"] = "Field";
|
|
58462
|
-
Kind2["ARGUMENT"] = "Argument";
|
|
58463
|
-
Kind2["FRAGMENT_SPREAD"] = "FragmentSpread";
|
|
58464
|
-
Kind2["INLINE_FRAGMENT"] = "InlineFragment";
|
|
58465
|
-
Kind2["FRAGMENT_DEFINITION"] = "FragmentDefinition";
|
|
58466
|
-
Kind2["VARIABLE"] = "Variable";
|
|
58467
|
-
Kind2["INT"] = "IntValue";
|
|
58468
|
-
Kind2["FLOAT"] = "FloatValue";
|
|
58469
|
-
Kind2["STRING"] = "StringValue";
|
|
58470
|
-
Kind2["BOOLEAN"] = "BooleanValue";
|
|
58471
|
-
Kind2["NULL"] = "NullValue";
|
|
58472
|
-
Kind2["ENUM"] = "EnumValue";
|
|
58473
|
-
Kind2["LIST"] = "ListValue";
|
|
58474
|
-
Kind2["OBJECT"] = "ObjectValue";
|
|
58475
|
-
Kind2["OBJECT_FIELD"] = "ObjectField";
|
|
58476
|
-
Kind2["DIRECTIVE"] = "Directive";
|
|
58477
|
-
Kind2["NAMED_TYPE"] = "NamedType";
|
|
58478
|
-
Kind2["LIST_TYPE"] = "ListType";
|
|
58479
|
-
Kind2["NON_NULL_TYPE"] = "NonNullType";
|
|
58480
|
-
Kind2["SCHEMA_DEFINITION"] = "SchemaDefinition";
|
|
58481
|
-
Kind2["OPERATION_TYPE_DEFINITION"] = "OperationTypeDefinition";
|
|
58482
|
-
Kind2["SCALAR_TYPE_DEFINITION"] = "ScalarTypeDefinition";
|
|
58483
|
-
Kind2["OBJECT_TYPE_DEFINITION"] = "ObjectTypeDefinition";
|
|
58484
|
-
Kind2["FIELD_DEFINITION"] = "FieldDefinition";
|
|
58485
|
-
Kind2["INPUT_VALUE_DEFINITION"] = "InputValueDefinition";
|
|
58486
|
-
Kind2["INTERFACE_TYPE_DEFINITION"] = "InterfaceTypeDefinition";
|
|
58487
|
-
Kind2["UNION_TYPE_DEFINITION"] = "UnionTypeDefinition";
|
|
58488
|
-
Kind2["ENUM_TYPE_DEFINITION"] = "EnumTypeDefinition";
|
|
58489
|
-
Kind2["ENUM_VALUE_DEFINITION"] = "EnumValueDefinition";
|
|
58490
|
-
Kind2["INPUT_OBJECT_TYPE_DEFINITION"] = "InputObjectTypeDefinition";
|
|
58491
|
-
Kind2["DIRECTIVE_DEFINITION"] = "DirectiveDefinition";
|
|
58492
|
-
Kind2["SCHEMA_EXTENSION"] = "SchemaExtension";
|
|
58493
|
-
Kind2["SCALAR_TYPE_EXTENSION"] = "ScalarTypeExtension";
|
|
58494
|
-
Kind2["OBJECT_TYPE_EXTENSION"] = "ObjectTypeExtension";
|
|
58495
|
-
Kind2["INTERFACE_TYPE_EXTENSION"] = "InterfaceTypeExtension";
|
|
58496
|
-
Kind2["UNION_TYPE_EXTENSION"] = "UnionTypeExtension";
|
|
58497
|
-
Kind2["ENUM_TYPE_EXTENSION"] = "EnumTypeExtension";
|
|
58498
|
-
Kind2["INPUT_OBJECT_TYPE_EXTENSION"] = "InputObjectTypeExtension";
|
|
58499
|
-
})(Kind || (Kind = {}));
|
|
58500
|
-
var TokenKind;
|
|
58501
|
-
(function(TokenKind2) {
|
|
58502
|
-
TokenKind2["SOF"] = "<SOF>";
|
|
58503
|
-
TokenKind2["EOF"] = "<EOF>";
|
|
58504
|
-
TokenKind2["BANG"] = "!";
|
|
58505
|
-
TokenKind2["DOLLAR"] = "$";
|
|
58506
|
-
TokenKind2["AMP"] = "&";
|
|
58507
|
-
TokenKind2["PAREN_L"] = "(";
|
|
58508
|
-
TokenKind2["PAREN_R"] = ")";
|
|
58509
|
-
TokenKind2["SPREAD"] = "...";
|
|
58510
|
-
TokenKind2["COLON"] = ":";
|
|
58511
|
-
TokenKind2["EQUALS"] = "=";
|
|
58512
|
-
TokenKind2["AT"] = "@";
|
|
58513
|
-
TokenKind2["BRACKET_L"] = "[";
|
|
58514
|
-
TokenKind2["BRACKET_R"] = "]";
|
|
58515
|
-
TokenKind2["BRACE_L"] = "{";
|
|
58516
|
-
TokenKind2["PIPE"] = "|";
|
|
58517
|
-
TokenKind2["BRACE_R"] = "}";
|
|
58518
|
-
TokenKind2["NAME"] = "Name";
|
|
58519
|
-
TokenKind2["INT"] = "Int";
|
|
58520
|
-
TokenKind2["FLOAT"] = "Float";
|
|
58521
|
-
TokenKind2["STRING"] = "String";
|
|
58522
|
-
TokenKind2["BLOCK_STRING"] = "BlockString";
|
|
58523
|
-
TokenKind2["COMMENT"] = "Comment";
|
|
58524
|
-
})(TokenKind || (TokenKind = {}));
|
|
58525
|
-
const QueryDocumentKeys = {
|
|
58526
|
-
Name: [],
|
|
58527
|
-
Document: ["definitions"],
|
|
58528
|
-
OperationDefinition: [
|
|
58529
|
-
"name",
|
|
58530
|
-
"variableDefinitions",
|
|
58531
|
-
"directives",
|
|
58532
|
-
"selectionSet"
|
|
58533
|
-
],
|
|
58534
|
-
VariableDefinition: ["variable", "type", "defaultValue", "directives"],
|
|
58535
|
-
Variable: ["name"],
|
|
58536
|
-
SelectionSet: ["selections"],
|
|
58537
|
-
Field: ["alias", "name", "arguments", "directives", "selectionSet"],
|
|
58538
|
-
Argument: ["name", "value"],
|
|
58539
|
-
FragmentSpread: ["name", "directives"],
|
|
58540
|
-
InlineFragment: ["typeCondition", "directives", "selectionSet"],
|
|
58541
|
-
FragmentDefinition: [
|
|
58542
|
-
"name",
|
|
58543
|
-
// Note: fragment variable definitions are deprecated and will removed in v17.0.0
|
|
58544
|
-
"variableDefinitions",
|
|
58545
|
-
"typeCondition",
|
|
58546
|
-
"directives",
|
|
58547
|
-
"selectionSet"
|
|
58548
|
-
],
|
|
58549
|
-
IntValue: [],
|
|
58550
|
-
FloatValue: [],
|
|
58551
|
-
StringValue: [],
|
|
58552
|
-
BooleanValue: [],
|
|
58553
|
-
NullValue: [],
|
|
58554
|
-
EnumValue: [],
|
|
58555
|
-
ListValue: ["values"],
|
|
58556
|
-
ObjectValue: ["fields"],
|
|
58557
|
-
ObjectField: ["name", "value"],
|
|
58558
|
-
Directive: ["name", "arguments"],
|
|
58559
|
-
NamedType: ["name"],
|
|
58560
|
-
ListType: ["type"],
|
|
58561
|
-
NonNullType: ["type"],
|
|
58562
|
-
SchemaDefinition: ["description", "directives", "operationTypes"],
|
|
58563
|
-
OperationTypeDefinition: ["type"],
|
|
58564
|
-
ScalarTypeDefinition: ["description", "name", "directives"],
|
|
58565
|
-
ObjectTypeDefinition: [
|
|
58566
|
-
"description",
|
|
58567
|
-
"name",
|
|
58568
|
-
"interfaces",
|
|
58569
|
-
"directives",
|
|
58570
|
-
"fields"
|
|
58571
|
-
],
|
|
58572
|
-
FieldDefinition: ["description", "name", "arguments", "type", "directives"],
|
|
58573
|
-
InputValueDefinition: [
|
|
58574
|
-
"description",
|
|
58575
|
-
"name",
|
|
58576
|
-
"type",
|
|
58577
|
-
"defaultValue",
|
|
58578
|
-
"directives"
|
|
58579
|
-
],
|
|
58580
|
-
InterfaceTypeDefinition: [
|
|
58581
|
-
"description",
|
|
58582
|
-
"name",
|
|
58583
|
-
"interfaces",
|
|
58584
|
-
"directives",
|
|
58585
|
-
"fields"
|
|
58586
|
-
],
|
|
58587
|
-
UnionTypeDefinition: ["description", "name", "directives", "types"],
|
|
58588
|
-
EnumTypeDefinition: ["description", "name", "directives", "values"],
|
|
58589
|
-
EnumValueDefinition: ["description", "name", "directives"],
|
|
58590
|
-
InputObjectTypeDefinition: ["description", "name", "directives", "fields"],
|
|
58591
|
-
DirectiveDefinition: ["description", "name", "arguments", "locations"],
|
|
58592
|
-
SchemaExtension: ["directives", "operationTypes"],
|
|
58593
|
-
ScalarTypeExtension: ["name", "directives"],
|
|
58594
|
-
ObjectTypeExtension: ["name", "interfaces", "directives", "fields"],
|
|
58595
|
-
InterfaceTypeExtension: ["name", "interfaces", "directives", "fields"],
|
|
58596
|
-
UnionTypeExtension: ["name", "directives", "types"],
|
|
58597
|
-
EnumTypeExtension: ["name", "directives", "values"],
|
|
58598
|
-
InputObjectTypeExtension: ["name", "directives", "fields"]
|
|
58599
|
-
};
|
|
58600
|
-
const kindValues = new Set(Object.keys(QueryDocumentKeys));
|
|
58601
|
-
function isNode(maybeNode) {
|
|
58602
|
-
const maybeKind = maybeNode === null || maybeNode === void 0 ? void 0 : maybeNode.kind;
|
|
58603
|
-
return typeof maybeKind === "string" && kindValues.has(maybeKind);
|
|
58604
|
-
}
|
|
58605
|
-
var OperationTypeNode;
|
|
58606
|
-
(function(OperationTypeNode2) {
|
|
58607
|
-
OperationTypeNode2["QUERY"] = "query";
|
|
58608
|
-
OperationTypeNode2["MUTATION"] = "mutation";
|
|
58609
|
-
OperationTypeNode2["SUBSCRIPTION"] = "subscription";
|
|
58610
|
-
})(OperationTypeNode || (OperationTypeNode = {}));
|
|
58611
|
-
function isWhiteSpace(code) {
|
|
58612
|
-
return code === 9 || code === 32;
|
|
58613
|
-
}
|
|
58614
|
-
function printBlockString(value, options) {
|
|
58615
|
-
const escapedValue = value.replace(/"""/g, '\\"""');
|
|
58616
|
-
const lines = escapedValue.split(/\r\n|[\n\r]/g);
|
|
58617
|
-
const isSingleLine = lines.length === 1;
|
|
58618
|
-
const forceLeadingNewLine = lines.length > 1 && lines.slice(1).every((line) => line.length === 0 || isWhiteSpace(line.charCodeAt(0)));
|
|
58619
|
-
const hasTrailingTripleQuotes = escapedValue.endsWith('\\"""');
|
|
58620
|
-
const hasTrailingQuote = value.endsWith('"') && !hasTrailingTripleQuotes;
|
|
58621
|
-
const hasTrailingSlash = value.endsWith("\\");
|
|
58622
|
-
const forceTrailingNewline = hasTrailingQuote || hasTrailingSlash;
|
|
58623
|
-
const printAsMultipleLines = !(options !== null && options !== void 0 && options.minimize) && // add leading and trailing new lines only if it improves readability
|
|
58624
|
-
(!isSingleLine || value.length > 70 || forceTrailingNewline || forceLeadingNewLine || hasTrailingTripleQuotes);
|
|
58625
|
-
let result = "";
|
|
58626
|
-
const skipLeadingNewLine = isSingleLine && isWhiteSpace(value.charCodeAt(0));
|
|
58627
|
-
if (printAsMultipleLines && !skipLeadingNewLine || forceLeadingNewLine) {
|
|
58628
|
-
result += "\n";
|
|
58629
|
-
}
|
|
58630
|
-
result += escapedValue;
|
|
58631
|
-
if (printAsMultipleLines || forceTrailingNewline) {
|
|
58632
|
-
result += "\n";
|
|
58633
|
-
}
|
|
58634
|
-
return '"""' + result + '"""';
|
|
58635
|
-
}
|
|
58636
|
-
var DirectiveLocation;
|
|
58637
|
-
(function(DirectiveLocation2) {
|
|
58638
|
-
DirectiveLocation2["QUERY"] = "QUERY";
|
|
58639
|
-
DirectiveLocation2["MUTATION"] = "MUTATION";
|
|
58640
|
-
DirectiveLocation2["SUBSCRIPTION"] = "SUBSCRIPTION";
|
|
58641
|
-
DirectiveLocation2["FIELD"] = "FIELD";
|
|
58642
|
-
DirectiveLocation2["FRAGMENT_DEFINITION"] = "FRAGMENT_DEFINITION";
|
|
58643
|
-
DirectiveLocation2["FRAGMENT_SPREAD"] = "FRAGMENT_SPREAD";
|
|
58644
|
-
DirectiveLocation2["INLINE_FRAGMENT"] = "INLINE_FRAGMENT";
|
|
58645
|
-
DirectiveLocation2["VARIABLE_DEFINITION"] = "VARIABLE_DEFINITION";
|
|
58646
|
-
DirectiveLocation2["SCHEMA"] = "SCHEMA";
|
|
58647
|
-
DirectiveLocation2["SCALAR"] = "SCALAR";
|
|
58648
|
-
DirectiveLocation2["OBJECT"] = "OBJECT";
|
|
58649
|
-
DirectiveLocation2["FIELD_DEFINITION"] = "FIELD_DEFINITION";
|
|
58650
|
-
DirectiveLocation2["ARGUMENT_DEFINITION"] = "ARGUMENT_DEFINITION";
|
|
58651
|
-
DirectiveLocation2["INTERFACE"] = "INTERFACE";
|
|
58652
|
-
DirectiveLocation2["UNION"] = "UNION";
|
|
58653
|
-
DirectiveLocation2["ENUM"] = "ENUM";
|
|
58654
|
-
DirectiveLocation2["ENUM_VALUE"] = "ENUM_VALUE";
|
|
58655
|
-
DirectiveLocation2["INPUT_OBJECT"] = "INPUT_OBJECT";
|
|
58656
|
-
DirectiveLocation2["INPUT_FIELD_DEFINITION"] = "INPUT_FIELD_DEFINITION";
|
|
58657
|
-
})(DirectiveLocation || (DirectiveLocation = {}));
|
|
58658
|
-
function printString(str) {
|
|
58659
|
-
return `"${str.replace(escapedRegExp, escapedReplacer)}"`;
|
|
58660
|
-
}
|
|
58661
|
-
const escapedRegExp = /[\x00-\x1f\x22\x5c\x7f-\x9f]/g;
|
|
58662
|
-
function escapedReplacer(str) {
|
|
58663
|
-
return escapeSequences[str.charCodeAt(0)];
|
|
58664
|
-
}
|
|
58665
|
-
const escapeSequences = [
|
|
58666
|
-
"\\u0000",
|
|
58667
|
-
"\\u0001",
|
|
58668
|
-
"\\u0002",
|
|
58669
|
-
"\\u0003",
|
|
58670
|
-
"\\u0004",
|
|
58671
|
-
"\\u0005",
|
|
58672
|
-
"\\u0006",
|
|
58673
|
-
"\\u0007",
|
|
58674
|
-
"\\b",
|
|
58675
|
-
"\\t",
|
|
58676
|
-
"\\n",
|
|
58677
|
-
"\\u000B",
|
|
58678
|
-
"\\f",
|
|
58679
|
-
"\\r",
|
|
58680
|
-
"\\u000E",
|
|
58681
|
-
"\\u000F",
|
|
58682
|
-
"\\u0010",
|
|
58683
|
-
"\\u0011",
|
|
58684
|
-
"\\u0012",
|
|
58685
|
-
"\\u0013",
|
|
58686
|
-
"\\u0014",
|
|
58687
|
-
"\\u0015",
|
|
58688
|
-
"\\u0016",
|
|
58689
|
-
"\\u0017",
|
|
58690
|
-
"\\u0018",
|
|
58691
|
-
"\\u0019",
|
|
58692
|
-
"\\u001A",
|
|
58693
|
-
"\\u001B",
|
|
58694
|
-
"\\u001C",
|
|
58695
|
-
"\\u001D",
|
|
58696
|
-
"\\u001E",
|
|
58697
|
-
"\\u001F",
|
|
58698
|
-
"",
|
|
58699
|
-
"",
|
|
58700
|
-
'\\"',
|
|
58701
|
-
"",
|
|
58702
|
-
"",
|
|
58703
|
-
"",
|
|
58704
|
-
"",
|
|
58705
|
-
"",
|
|
58706
|
-
"",
|
|
58707
|
-
"",
|
|
58708
|
-
"",
|
|
58709
|
-
"",
|
|
58710
|
-
"",
|
|
58711
|
-
"",
|
|
58712
|
-
"",
|
|
58713
|
-
"",
|
|
58714
|
-
// 2F
|
|
58715
|
-
"",
|
|
58716
|
-
"",
|
|
58717
|
-
"",
|
|
58718
|
-
"",
|
|
58719
|
-
"",
|
|
58720
|
-
"",
|
|
58721
|
-
"",
|
|
58722
|
-
"",
|
|
58723
|
-
"",
|
|
58724
|
-
"",
|
|
58725
|
-
"",
|
|
58726
|
-
"",
|
|
58727
|
-
"",
|
|
58728
|
-
"",
|
|
58729
|
-
"",
|
|
58730
|
-
"",
|
|
58731
|
-
// 3F
|
|
58732
|
-
"",
|
|
58733
|
-
"",
|
|
58734
|
-
"",
|
|
58735
|
-
"",
|
|
58736
|
-
"",
|
|
58737
|
-
"",
|
|
58738
|
-
"",
|
|
58739
|
-
"",
|
|
58740
|
-
"",
|
|
58741
|
-
"",
|
|
58742
|
-
"",
|
|
58743
|
-
"",
|
|
58744
|
-
"",
|
|
58745
|
-
"",
|
|
58746
|
-
"",
|
|
58747
|
-
"",
|
|
58748
|
-
// 4F
|
|
58749
|
-
"",
|
|
58750
|
-
"",
|
|
58751
|
-
"",
|
|
58752
|
-
"",
|
|
58753
|
-
"",
|
|
58754
|
-
"",
|
|
58755
|
-
"",
|
|
58756
|
-
"",
|
|
58757
|
-
"",
|
|
58758
|
-
"",
|
|
58759
|
-
"",
|
|
58760
|
-
"",
|
|
58761
|
-
"\\\\",
|
|
58762
|
-
"",
|
|
58763
|
-
"",
|
|
58764
|
-
"",
|
|
58765
|
-
// 5F
|
|
58766
|
-
"",
|
|
58767
|
-
"",
|
|
58768
|
-
"",
|
|
58769
|
-
"",
|
|
58770
|
-
"",
|
|
58771
|
-
"",
|
|
58772
|
-
"",
|
|
58773
|
-
"",
|
|
58774
|
-
"",
|
|
58775
|
-
"",
|
|
58776
|
-
"",
|
|
58777
|
-
"",
|
|
58778
|
-
"",
|
|
58779
|
-
"",
|
|
58780
|
-
"",
|
|
58781
|
-
"",
|
|
58782
|
-
// 6F
|
|
58783
|
-
"",
|
|
58784
|
-
"",
|
|
58785
|
-
"",
|
|
58786
|
-
"",
|
|
58787
|
-
"",
|
|
58788
|
-
"",
|
|
58789
|
-
"",
|
|
58790
|
-
"",
|
|
58791
|
-
"",
|
|
58792
|
-
"",
|
|
58793
|
-
"",
|
|
58794
|
-
"",
|
|
58795
|
-
"",
|
|
58796
|
-
"",
|
|
58797
|
-
"",
|
|
58798
|
-
"\\u007F",
|
|
58799
|
-
"\\u0080",
|
|
58800
|
-
"\\u0081",
|
|
58801
|
-
"\\u0082",
|
|
58802
|
-
"\\u0083",
|
|
58803
|
-
"\\u0084",
|
|
58804
|
-
"\\u0085",
|
|
58805
|
-
"\\u0086",
|
|
58806
|
-
"\\u0087",
|
|
58807
|
-
"\\u0088",
|
|
58808
|
-
"\\u0089",
|
|
58809
|
-
"\\u008A",
|
|
58810
|
-
"\\u008B",
|
|
58811
|
-
"\\u008C",
|
|
58812
|
-
"\\u008D",
|
|
58813
|
-
"\\u008E",
|
|
58814
|
-
"\\u008F",
|
|
58815
|
-
"\\u0090",
|
|
58816
|
-
"\\u0091",
|
|
58817
|
-
"\\u0092",
|
|
58818
|
-
"\\u0093",
|
|
58819
|
-
"\\u0094",
|
|
58820
|
-
"\\u0095",
|
|
58821
|
-
"\\u0096",
|
|
58822
|
-
"\\u0097",
|
|
58823
|
-
"\\u0098",
|
|
58824
|
-
"\\u0099",
|
|
58825
|
-
"\\u009A",
|
|
58826
|
-
"\\u009B",
|
|
58827
|
-
"\\u009C",
|
|
58828
|
-
"\\u009D",
|
|
58829
|
-
"\\u009E",
|
|
58830
|
-
"\\u009F"
|
|
58831
|
-
];
|
|
58832
|
-
const BREAK = Object.freeze({});
|
|
58833
|
-
function visit(root, visitor, visitorKeys = QueryDocumentKeys) {
|
|
58834
|
-
const enterLeaveMap = /* @__PURE__ */ new Map();
|
|
58835
|
-
for (const kind of Object.values(Kind)) {
|
|
58836
|
-
enterLeaveMap.set(kind, getEnterLeaveForKind(visitor, kind));
|
|
58837
|
-
}
|
|
58838
|
-
let stack = void 0;
|
|
58839
|
-
let inArray = Array.isArray(root);
|
|
58840
|
-
let keys = [root];
|
|
58841
|
-
let index = -1;
|
|
58842
|
-
let edits = [];
|
|
58843
|
-
let node = root;
|
|
58844
|
-
let key = void 0;
|
|
58845
|
-
let parent = void 0;
|
|
58846
|
-
const path = [];
|
|
58847
|
-
const ancestors = [];
|
|
58848
|
-
do {
|
|
58849
|
-
index++;
|
|
58850
|
-
const isLeaving = index === keys.length;
|
|
58851
|
-
const isEdited = isLeaving && edits.length !== 0;
|
|
58852
|
-
if (isLeaving) {
|
|
58853
|
-
key = ancestors.length === 0 ? void 0 : path[path.length - 1];
|
|
58854
|
-
node = parent;
|
|
58855
|
-
parent = ancestors.pop();
|
|
58856
|
-
if (isEdited) {
|
|
58857
|
-
if (inArray) {
|
|
58858
|
-
node = node.slice();
|
|
58859
|
-
let editOffset = 0;
|
|
58860
|
-
for (const [editKey, editValue] of edits) {
|
|
58861
|
-
const arrayKey = editKey - editOffset;
|
|
58862
|
-
if (editValue === null) {
|
|
58863
|
-
node.splice(arrayKey, 1);
|
|
58864
|
-
editOffset++;
|
|
58865
|
-
} else {
|
|
58866
|
-
node[arrayKey] = editValue;
|
|
58867
|
-
}
|
|
58868
|
-
}
|
|
58869
|
-
} else {
|
|
58870
|
-
node = { ...node };
|
|
58871
|
-
for (const [editKey, editValue] of edits) {
|
|
58872
|
-
node[editKey] = editValue;
|
|
58873
|
-
}
|
|
58874
|
-
}
|
|
58875
|
-
}
|
|
58876
|
-
index = stack.index;
|
|
58877
|
-
keys = stack.keys;
|
|
58878
|
-
edits = stack.edits;
|
|
58879
|
-
inArray = stack.inArray;
|
|
58880
|
-
stack = stack.prev;
|
|
58881
|
-
} else if (parent) {
|
|
58882
|
-
key = inArray ? index : keys[index];
|
|
58883
|
-
node = parent[key];
|
|
58884
|
-
if (node === null || node === void 0) {
|
|
58885
|
-
continue;
|
|
58886
|
-
}
|
|
58887
|
-
path.push(key);
|
|
58888
|
-
}
|
|
58889
|
-
let result;
|
|
58890
|
-
if (!Array.isArray(node)) {
|
|
58891
|
-
var _enterLeaveMap$get, _enterLeaveMap$get2;
|
|
58892
|
-
isNode(node) || devAssert(false, `Invalid AST Node: ${inspect(node)}.`);
|
|
58893
|
-
const visitFn = isLeaving ? (_enterLeaveMap$get = enterLeaveMap.get(node.kind)) === null || _enterLeaveMap$get === void 0 ? void 0 : _enterLeaveMap$get.leave : (_enterLeaveMap$get2 = enterLeaveMap.get(node.kind)) === null || _enterLeaveMap$get2 === void 0 ? void 0 : _enterLeaveMap$get2.enter;
|
|
58894
|
-
result = visitFn === null || visitFn === void 0 ? void 0 : visitFn.call(visitor, node, key, parent, path, ancestors);
|
|
58895
|
-
if (result === BREAK) {
|
|
58896
|
-
break;
|
|
58897
|
-
}
|
|
58898
|
-
if (result === false) {
|
|
58899
|
-
if (!isLeaving) {
|
|
58900
|
-
path.pop();
|
|
58901
|
-
continue;
|
|
58902
|
-
}
|
|
58903
|
-
} else if (result !== void 0) {
|
|
58904
|
-
edits.push([key, result]);
|
|
58905
|
-
if (!isLeaving) {
|
|
58906
|
-
if (isNode(result)) {
|
|
58907
|
-
node = result;
|
|
58908
|
-
} else {
|
|
58909
|
-
path.pop();
|
|
58910
|
-
continue;
|
|
58911
|
-
}
|
|
58912
|
-
}
|
|
58913
|
-
}
|
|
58914
|
-
}
|
|
58915
|
-
if (result === void 0 && isEdited) {
|
|
58916
|
-
edits.push([key, node]);
|
|
58917
|
-
}
|
|
58918
|
-
if (isLeaving) {
|
|
58919
|
-
path.pop();
|
|
58920
|
-
} else {
|
|
58921
|
-
var _node$kind;
|
|
58922
|
-
stack = {
|
|
58923
|
-
inArray,
|
|
58924
|
-
index,
|
|
58925
|
-
keys,
|
|
58926
|
-
edits,
|
|
58927
|
-
prev: stack
|
|
58928
|
-
};
|
|
58929
|
-
inArray = Array.isArray(node);
|
|
58930
|
-
keys = inArray ? node : (_node$kind = visitorKeys[node.kind]) !== null && _node$kind !== void 0 ? _node$kind : [];
|
|
58931
|
-
index = -1;
|
|
58932
|
-
edits = [];
|
|
58933
|
-
if (parent) {
|
|
58934
|
-
ancestors.push(parent);
|
|
58935
|
-
}
|
|
58936
|
-
parent = node;
|
|
58937
|
-
}
|
|
58938
|
-
} while (stack !== void 0);
|
|
58939
|
-
if (edits.length !== 0) {
|
|
58940
|
-
return edits[edits.length - 1][1];
|
|
58941
|
-
}
|
|
58942
|
-
return root;
|
|
58943
|
-
}
|
|
58944
|
-
function getEnterLeaveForKind(visitor, kind) {
|
|
58945
|
-
const kindVisitor = visitor[kind];
|
|
58946
|
-
if (typeof kindVisitor === "object") {
|
|
58947
|
-
return kindVisitor;
|
|
58948
|
-
} else if (typeof kindVisitor === "function") {
|
|
58949
|
-
return {
|
|
58950
|
-
enter: kindVisitor,
|
|
58951
|
-
leave: void 0
|
|
58952
|
-
};
|
|
58953
|
-
}
|
|
58954
|
-
return {
|
|
58955
|
-
enter: visitor.enter,
|
|
58956
|
-
leave: visitor.leave
|
|
58957
|
-
};
|
|
58958
|
-
}
|
|
58959
|
-
function print(ast) {
|
|
58960
|
-
return visit(ast, printDocASTReducer);
|
|
58961
|
-
}
|
|
58962
|
-
const MAX_LINE_LENGTH = 80;
|
|
58963
|
-
const printDocASTReducer = {
|
|
58964
|
-
Name: {
|
|
58965
|
-
leave: (node) => node.value
|
|
58966
|
-
},
|
|
58967
|
-
Variable: {
|
|
58968
|
-
leave: (node) => "$" + node.name
|
|
58969
|
-
},
|
|
58970
|
-
// Document
|
|
58971
|
-
Document: {
|
|
58972
|
-
leave: (node) => join(node.definitions, "\n\n")
|
|
58973
|
-
},
|
|
58974
|
-
OperationDefinition: {
|
|
58975
|
-
leave(node) {
|
|
58976
|
-
const varDefs = wrap("(", join(node.variableDefinitions, ", "), ")");
|
|
58977
|
-
const prefix = join(
|
|
58978
|
-
[
|
|
58979
|
-
node.operation,
|
|
58980
|
-
join([node.name, varDefs]),
|
|
58981
|
-
join(node.directives, " ")
|
|
58982
|
-
],
|
|
58983
|
-
" "
|
|
58984
|
-
);
|
|
58985
|
-
return (prefix === "query" ? "" : prefix + " ") + node.selectionSet;
|
|
58986
|
-
}
|
|
58987
|
-
},
|
|
58988
|
-
VariableDefinition: {
|
|
58989
|
-
leave: ({ variable, type, defaultValue, directives }) => variable + ": " + type + wrap(" = ", defaultValue) + wrap(" ", join(directives, " "))
|
|
58990
|
-
},
|
|
58991
|
-
SelectionSet: {
|
|
58992
|
-
leave: ({ selections }) => block(selections)
|
|
58993
|
-
},
|
|
58994
|
-
Field: {
|
|
58995
|
-
leave({ alias, name, arguments: args, directives, selectionSet }) {
|
|
58996
|
-
const prefix = wrap("", alias, ": ") + name;
|
|
58997
|
-
let argsLine = prefix + wrap("(", join(args, ", "), ")");
|
|
58998
|
-
if (argsLine.length > MAX_LINE_LENGTH) {
|
|
58999
|
-
argsLine = prefix + wrap("(\n", indent(join(args, "\n")), "\n)");
|
|
59000
|
-
}
|
|
59001
|
-
return join([argsLine, join(directives, " "), selectionSet], " ");
|
|
59002
|
-
}
|
|
59003
|
-
},
|
|
59004
|
-
Argument: {
|
|
59005
|
-
leave: ({ name, value }) => name + ": " + value
|
|
59006
|
-
},
|
|
59007
|
-
// Fragments
|
|
59008
|
-
FragmentSpread: {
|
|
59009
|
-
leave: ({ name, directives }) => "..." + name + wrap(" ", join(directives, " "))
|
|
59010
|
-
},
|
|
59011
|
-
InlineFragment: {
|
|
59012
|
-
leave: ({ typeCondition, directives, selectionSet }) => join(
|
|
59013
|
-
[
|
|
59014
|
-
"...",
|
|
59015
|
-
wrap("on ", typeCondition),
|
|
59016
|
-
join(directives, " "),
|
|
59017
|
-
selectionSet
|
|
59018
|
-
],
|
|
59019
|
-
" "
|
|
59020
|
-
)
|
|
59021
|
-
},
|
|
59022
|
-
FragmentDefinition: {
|
|
59023
|
-
leave: ({ name, typeCondition, variableDefinitions, directives, selectionSet }) => (
|
|
59024
|
-
// or removed in the future.
|
|
59025
|
-
`fragment ${name}${wrap("(", join(variableDefinitions, ", "), ")")} on ${typeCondition} ${wrap("", join(directives, " "), " ")}` + selectionSet
|
|
59026
|
-
)
|
|
59027
|
-
},
|
|
59028
|
-
// Value
|
|
59029
|
-
IntValue: {
|
|
59030
|
-
leave: ({ value }) => value
|
|
59031
|
-
},
|
|
59032
|
-
FloatValue: {
|
|
59033
|
-
leave: ({ value }) => value
|
|
59034
|
-
},
|
|
59035
|
-
StringValue: {
|
|
59036
|
-
leave: ({ value, block: isBlockString }) => isBlockString ? printBlockString(value) : printString(value)
|
|
59037
|
-
},
|
|
59038
|
-
BooleanValue: {
|
|
59039
|
-
leave: ({ value }) => value ? "true" : "false"
|
|
59040
|
-
},
|
|
59041
|
-
NullValue: {
|
|
59042
|
-
leave: () => "null"
|
|
59043
|
-
},
|
|
59044
|
-
EnumValue: {
|
|
59045
|
-
leave: ({ value }) => value
|
|
59046
|
-
},
|
|
59047
|
-
ListValue: {
|
|
59048
|
-
leave: ({ values }) => "[" + join(values, ", ") + "]"
|
|
59049
|
-
},
|
|
59050
|
-
ObjectValue: {
|
|
59051
|
-
leave: ({ fields }) => "{" + join(fields, ", ") + "}"
|
|
59052
|
-
},
|
|
59053
|
-
ObjectField: {
|
|
59054
|
-
leave: ({ name, value }) => name + ": " + value
|
|
59055
|
-
},
|
|
59056
|
-
// Directive
|
|
59057
|
-
Directive: {
|
|
59058
|
-
leave: ({ name, arguments: args }) => "@" + name + wrap("(", join(args, ", "), ")")
|
|
59059
|
-
},
|
|
59060
|
-
// Type
|
|
59061
|
-
NamedType: {
|
|
59062
|
-
leave: ({ name }) => name
|
|
59063
|
-
},
|
|
59064
|
-
ListType: {
|
|
59065
|
-
leave: ({ type }) => "[" + type + "]"
|
|
59066
|
-
},
|
|
59067
|
-
NonNullType: {
|
|
59068
|
-
leave: ({ type }) => type + "!"
|
|
59069
|
-
},
|
|
59070
|
-
// Type System Definitions
|
|
59071
|
-
SchemaDefinition: {
|
|
59072
|
-
leave: ({ description, directives, operationTypes }) => wrap("", description, "\n") + join(["schema", join(directives, " "), block(operationTypes)], " ")
|
|
59073
|
-
},
|
|
59074
|
-
OperationTypeDefinition: {
|
|
59075
|
-
leave: ({ operation, type }) => operation + ": " + type
|
|
59076
|
-
},
|
|
59077
|
-
ScalarTypeDefinition: {
|
|
59078
|
-
leave: ({ description, name, directives }) => wrap("", description, "\n") + join(["scalar", name, join(directives, " ")], " ")
|
|
59079
|
-
},
|
|
59080
|
-
ObjectTypeDefinition: {
|
|
59081
|
-
leave: ({ description, name, interfaces, directives, fields }) => wrap("", description, "\n") + join(
|
|
59082
|
-
[
|
|
59083
|
-
"type",
|
|
59084
|
-
name,
|
|
59085
|
-
wrap("implements ", join(interfaces, " & ")),
|
|
59086
|
-
join(directives, " "),
|
|
59087
|
-
block(fields)
|
|
59088
|
-
],
|
|
59089
|
-
" "
|
|
59090
|
-
)
|
|
59091
|
-
},
|
|
59092
|
-
FieldDefinition: {
|
|
59093
|
-
leave: ({ description, name, arguments: args, type, directives }) => wrap("", description, "\n") + name + (hasMultilineItems(args) ? wrap("(\n", indent(join(args, "\n")), "\n)") : wrap("(", join(args, ", "), ")")) + ": " + type + wrap(" ", join(directives, " "))
|
|
59094
|
-
},
|
|
59095
|
-
InputValueDefinition: {
|
|
59096
|
-
leave: ({ description, name, type, defaultValue, directives }) => wrap("", description, "\n") + join(
|
|
59097
|
-
[name + ": " + type, wrap("= ", defaultValue), join(directives, " ")],
|
|
59098
|
-
" "
|
|
59099
|
-
)
|
|
59100
|
-
},
|
|
59101
|
-
InterfaceTypeDefinition: {
|
|
59102
|
-
leave: ({ description, name, interfaces, directives, fields }) => wrap("", description, "\n") + join(
|
|
59103
|
-
[
|
|
59104
|
-
"interface",
|
|
59105
|
-
name,
|
|
59106
|
-
wrap("implements ", join(interfaces, " & ")),
|
|
59107
|
-
join(directives, " "),
|
|
59108
|
-
block(fields)
|
|
59109
|
-
],
|
|
59110
|
-
" "
|
|
59111
|
-
)
|
|
59112
|
-
},
|
|
59113
|
-
UnionTypeDefinition: {
|
|
59114
|
-
leave: ({ description, name, directives, types }) => wrap("", description, "\n") + join(
|
|
59115
|
-
["union", name, join(directives, " "), wrap("= ", join(types, " | "))],
|
|
59116
|
-
" "
|
|
59117
|
-
)
|
|
59118
|
-
},
|
|
59119
|
-
EnumTypeDefinition: {
|
|
59120
|
-
leave: ({ description, name, directives, values }) => wrap("", description, "\n") + join(["enum", name, join(directives, " "), block(values)], " ")
|
|
59121
|
-
},
|
|
59122
|
-
EnumValueDefinition: {
|
|
59123
|
-
leave: ({ description, name, directives }) => wrap("", description, "\n") + join([name, join(directives, " ")], " ")
|
|
59124
|
-
},
|
|
59125
|
-
InputObjectTypeDefinition: {
|
|
59126
|
-
leave: ({ description, name, directives, fields }) => wrap("", description, "\n") + join(["input", name, join(directives, " "), block(fields)], " ")
|
|
59127
|
-
},
|
|
59128
|
-
DirectiveDefinition: {
|
|
59129
|
-
leave: ({ description, name, arguments: args, repeatable, locations }) => wrap("", description, "\n") + "directive @" + name + (hasMultilineItems(args) ? wrap("(\n", indent(join(args, "\n")), "\n)") : wrap("(", join(args, ", "), ")")) + (repeatable ? " repeatable" : "") + " on " + join(locations, " | ")
|
|
59130
|
-
},
|
|
59131
|
-
SchemaExtension: {
|
|
59132
|
-
leave: ({ directives, operationTypes }) => join(
|
|
59133
|
-
["extend schema", join(directives, " "), block(operationTypes)],
|
|
59134
|
-
" "
|
|
59135
|
-
)
|
|
59136
|
-
},
|
|
59137
|
-
ScalarTypeExtension: {
|
|
59138
|
-
leave: ({ name, directives }) => join(["extend scalar", name, join(directives, " ")], " ")
|
|
59139
|
-
},
|
|
59140
|
-
ObjectTypeExtension: {
|
|
59141
|
-
leave: ({ name, interfaces, directives, fields }) => join(
|
|
59142
|
-
[
|
|
59143
|
-
"extend type",
|
|
59144
|
-
name,
|
|
59145
|
-
wrap("implements ", join(interfaces, " & ")),
|
|
59146
|
-
join(directives, " "),
|
|
59147
|
-
block(fields)
|
|
59148
|
-
],
|
|
59149
|
-
" "
|
|
59150
|
-
)
|
|
59151
|
-
},
|
|
59152
|
-
InterfaceTypeExtension: {
|
|
59153
|
-
leave: ({ name, interfaces, directives, fields }) => join(
|
|
59154
|
-
[
|
|
59155
|
-
"extend interface",
|
|
59156
|
-
name,
|
|
59157
|
-
wrap("implements ", join(interfaces, " & ")),
|
|
59158
|
-
join(directives, " "),
|
|
59159
|
-
block(fields)
|
|
59160
|
-
],
|
|
59161
|
-
" "
|
|
59162
|
-
)
|
|
59163
|
-
},
|
|
59164
|
-
UnionTypeExtension: {
|
|
59165
|
-
leave: ({ name, directives, types }) => join(
|
|
59166
|
-
[
|
|
59167
|
-
"extend union",
|
|
59168
|
-
name,
|
|
59169
|
-
join(directives, " "),
|
|
59170
|
-
wrap("= ", join(types, " | "))
|
|
59171
|
-
],
|
|
59172
|
-
" "
|
|
59173
|
-
)
|
|
59174
|
-
},
|
|
59175
|
-
EnumTypeExtension: {
|
|
59176
|
-
leave: ({ name, directives, values }) => join(["extend enum", name, join(directives, " "), block(values)], " ")
|
|
59177
|
-
},
|
|
59178
|
-
InputObjectTypeExtension: {
|
|
59179
|
-
leave: ({ name, directives, fields }) => join(["extend input", name, join(directives, " "), block(fields)], " ")
|
|
59180
|
-
}
|
|
59181
|
-
};
|
|
59182
|
-
function join(maybeArray, separator = "") {
|
|
59183
|
-
var _maybeArray$filter$jo;
|
|
59184
|
-
return (_maybeArray$filter$jo = maybeArray === null || maybeArray === void 0 ? void 0 : maybeArray.filter((x) => x).join(separator)) !== null && _maybeArray$filter$jo !== void 0 ? _maybeArray$filter$jo : "";
|
|
59185
|
-
}
|
|
59186
|
-
function block(array) {
|
|
59187
|
-
return wrap("{\n", indent(join(array, "\n")), "\n}");
|
|
59188
|
-
}
|
|
59189
|
-
function wrap(start, maybeString, end = "") {
|
|
59190
|
-
return maybeString != null && maybeString !== "" ? start + maybeString + end : "";
|
|
59191
|
-
}
|
|
59192
|
-
function indent(str) {
|
|
59193
|
-
return wrap(" ", str.replace(/\n/g, "\n "));
|
|
59194
|
-
}
|
|
59195
|
-
function hasMultilineItems(maybeArray) {
|
|
59196
|
-
var _maybeArray$some;
|
|
59197
|
-
return (_maybeArray$some = maybeArray === null || maybeArray === void 0 ? void 0 : maybeArray.some((str) => str.includes("\n"))) !== null && _maybeArray$some !== void 0 ? _maybeArray$some : false;
|
|
59198
|
-
}
|
|
59199
|
-
const referenceMap = /* @__PURE__ */ new WeakMap();
|
|
59200
|
-
const astResolver = function(astReference) {
|
|
59201
|
-
return referenceMap.get(astReference);
|
|
59202
|
-
};
|
|
59203
|
-
function findExecutableOperation$1(document, operationName) {
|
|
59204
|
-
const operations = document.definitions.filter(
|
|
59205
|
-
(def) => def.kind === Kind.OPERATION_DEFINITION
|
|
59206
|
-
);
|
|
59207
|
-
if (operations.length === 0) {
|
|
59208
|
-
return void 0;
|
|
59209
|
-
}
|
|
59210
|
-
if (operations.length === 1 && !operationName) {
|
|
59211
|
-
return operations[0];
|
|
59212
|
-
}
|
|
59213
|
-
if (operationName) {
|
|
59214
|
-
return operations.find((op) => {
|
|
59215
|
-
var _a;
|
|
59216
|
-
return ((_a = op.name) == null ? void 0 : _a.value) === operationName;
|
|
59217
|
-
});
|
|
59218
|
-
}
|
|
59219
|
-
return void 0;
|
|
59220
|
-
}
|
|
59221
|
-
function validateGraphQLOperations(config, options) {
|
|
59222
|
-
const executableOperation = findExecutableOperation$1(config.query, config.operationName);
|
|
59223
|
-
if (executableOperation) {
|
|
59224
|
-
const operationType = executableOperation.operation;
|
|
59225
|
-
if (!options.acceptedOperations.includes(operationType)) {
|
|
59226
|
-
const operationTypeCapitalized = operationType.charAt(0).toUpperCase() + operationType.slice(1);
|
|
59227
|
-
throw new Error(
|
|
59228
|
-
`${operationTypeCapitalized} operations are not supported in this context`
|
|
59229
|
-
);
|
|
59230
|
-
}
|
|
59231
|
-
}
|
|
59232
|
-
}
|
|
59233
|
-
function resolveAst(ast) {
|
|
59234
|
-
if (ast === null || ast === void 0) {
|
|
59235
|
-
return;
|
|
59236
|
-
}
|
|
59237
|
-
const result = astResolver(ast);
|
|
59238
|
-
if (result === void 0) {
|
|
59239
|
-
throw new Error("Could not resolve AST. Did you parse the query with gql?");
|
|
59240
|
-
}
|
|
59241
|
-
return result;
|
|
59242
|
-
}
|
|
59243
|
-
function wrapConfigAndVerify(config, options) {
|
|
59244
|
-
if (config == null ? void 0 : config.query) {
|
|
59245
|
-
config = { ...config, query: resolveAst(config.query) };
|
|
59246
|
-
if (config.query === void 0) {
|
|
59247
|
-
throw new Error("Internal error in GraphQL adapter occurred: Unable to resolve query");
|
|
59248
|
-
}
|
|
59249
|
-
validateGraphQLOperations(config, {
|
|
59250
|
-
acceptedOperations: (options == null ? void 0 : options.acceptedOperations) ?? ["query"]
|
|
59251
|
-
});
|
|
59252
|
-
}
|
|
59253
|
-
return config;
|
|
59254
|
-
}
|
|
58408
|
+
// version: 1.410.0-7c228ee347
|
|
59255
58409
|
|
|
59256
58410
|
/*!
|
|
59257
58411
|
* Copyright (c) 2022, Salesforce, Inc.,
|
|
@@ -59260,7 +58414,7 @@ function wrapConfigAndVerify(config, options) {
|
|
|
59260
58414
|
*/
|
|
59261
58415
|
function findExecutableOperation(input) {
|
|
59262
58416
|
const operations = input.query.definitions.filter(
|
|
59263
|
-
(def) => def.kind === Kind.OPERATION_DEFINITION
|
|
58417
|
+
(def) => def.kind === Kind$2.OPERATION_DEFINITION
|
|
59264
58418
|
);
|
|
59265
58419
|
if (operations.length === 0) {
|
|
59266
58420
|
return err$1(new Error("No operations found in query"));
|
|
@@ -59307,14 +58461,14 @@ function buildGraphQLInputExtension(input) {
|
|
|
59307
58461
|
});
|
|
59308
58462
|
}
|
|
59309
58463
|
const TYPENAME_FIELD = {
|
|
59310
|
-
kind: Kind.FIELD,
|
|
58464
|
+
kind: Kind$2.FIELD,
|
|
59311
58465
|
name: {
|
|
59312
|
-
kind: Kind.NAME,
|
|
58466
|
+
kind: Kind$2.NAME,
|
|
59313
58467
|
value: "__typename"
|
|
59314
58468
|
}
|
|
59315
58469
|
};
|
|
59316
58470
|
function addTypenameToDocument(doc) {
|
|
59317
|
-
return visit(doc, {
|
|
58471
|
+
return visit$2(doc, {
|
|
59318
58472
|
SelectionSet: {
|
|
59319
58473
|
enter(node, _key, parent) {
|
|
59320
58474
|
if (isOperationDefinition(parent)) {
|
|
@@ -59339,13 +58493,13 @@ function addTypenameToDocument(doc) {
|
|
|
59339
58493
|
});
|
|
59340
58494
|
}
|
|
59341
58495
|
function isOperationDefinition(parent) {
|
|
59342
|
-
return !!parent && !Array.isArray(parent) && parent.kind === Kind.OPERATION_DEFINITION;
|
|
58496
|
+
return !!parent && !Array.isArray(parent) && parent.kind === Kind$2.OPERATION_DEFINITION;
|
|
59343
58497
|
}
|
|
59344
58498
|
function isField(node) {
|
|
59345
|
-
return node.kind === Kind.FIELD;
|
|
58499
|
+
return node.kind === Kind$2.FIELD;
|
|
59346
58500
|
}
|
|
59347
58501
|
function isFragmentDefinition(node) {
|
|
59348
|
-
return node.kind === Kind.FRAGMENT_DEFINITION;
|
|
58502
|
+
return node.kind === Kind$2.FRAGMENT_DEFINITION;
|
|
59349
58503
|
}
|
|
59350
58504
|
|
|
59351
58505
|
/*!
|
|
@@ -59409,14 +58563,14 @@ class AuraGraphQLNormalizedCacheControlCommand extends AuraNormalizedCacheContro
|
|
|
59409
58563
|
return void 0;
|
|
59410
58564
|
}
|
|
59411
58565
|
get auraParams() {
|
|
59412
|
-
const params = { ...this.config, query: print(this.buildRequestQuery()) };
|
|
58566
|
+
const params = { ...this.config, query: print$1(this.buildRequestQuery()) };
|
|
59413
58567
|
if (this.auraBodyWrapperName) {
|
|
59414
58568
|
return { [this.auraBodyWrapperName]: params };
|
|
59415
58569
|
}
|
|
59416
58570
|
return params;
|
|
59417
58571
|
}
|
|
59418
58572
|
get fetchParams() {
|
|
59419
|
-
const body = { ...this.config, query: print(this.buildRequestQuery()) };
|
|
58573
|
+
const body = { ...this.config, query: print$1(this.buildRequestQuery()) };
|
|
59420
58574
|
const headers = {
|
|
59421
58575
|
"Content-Type": "application/json"
|
|
59422
58576
|
};
|
|
@@ -59429,14 +58583,14 @@ class AuraGraphQLNormalizedCacheControlCommand extends AuraNormalizedCacheContro
|
|
|
59429
58583
|
return [this.url, params];
|
|
59430
58584
|
}
|
|
59431
58585
|
get originalAuraParams() {
|
|
59432
|
-
const params = { ...this.config, query: print(this.config.query) };
|
|
58586
|
+
const params = { ...this.config, query: print$1(this.config.query) };
|
|
59433
58587
|
if (this.auraBodyWrapperName) {
|
|
59434
58588
|
return { [this.auraBodyWrapperName]: params };
|
|
59435
58589
|
}
|
|
59436
58590
|
return params;
|
|
59437
58591
|
}
|
|
59438
58592
|
get originalFetchParams() {
|
|
59439
|
-
const body = { ...this.config, query: print(this.config.query) };
|
|
58593
|
+
const body = { ...this.config, query: print$1(this.config.query) };
|
|
59440
58594
|
const headers = {
|
|
59441
58595
|
"Content-Type": "application/json"
|
|
59442
58596
|
};
|
|
@@ -59556,7 +58710,7 @@ class HttpGraphQLNormalizedCacheControlCommand extends HttpNormalizedCacheContro
|
|
|
59556
58710
|
};
|
|
59557
58711
|
}
|
|
59558
58712
|
get fetchParams() {
|
|
59559
|
-
const body = { ...this.config, query: print(this.buildRequestQuery()) };
|
|
58713
|
+
const body = { ...this.config, query: print$1(this.buildRequestQuery()) };
|
|
59560
58714
|
const headers = {
|
|
59561
58715
|
"Content-Type": "application/json"
|
|
59562
58716
|
};
|
|
@@ -59569,7 +58723,7 @@ class HttpGraphQLNormalizedCacheControlCommand extends HttpNormalizedCacheContro
|
|
|
59569
58723
|
return [this.url, params];
|
|
59570
58724
|
}
|
|
59571
58725
|
get originalFetchParams() {
|
|
59572
|
-
const body = { ...this.config, query: print(this.config.query) };
|
|
58726
|
+
const body = { ...this.config, query: print$1(this.config.query) };
|
|
59573
58727
|
const headers = {
|
|
59574
58728
|
"Content-Type": "application/json"
|
|
59575
58729
|
};
|
|
@@ -60781,7 +59935,12 @@ function buildServiceDescriptor$2() {
|
|
|
60781
59935
|
* All rights reserved.
|
|
60782
59936
|
* For full license text, see the LICENSE.txt file
|
|
60783
59937
|
*/
|
|
60784
|
-
function buildServiceDescriptor$1(interceptors = {
|
|
59938
|
+
function buildServiceDescriptor$1(interceptors = {
|
|
59939
|
+
request: [],
|
|
59940
|
+
retry: void 0,
|
|
59941
|
+
response: [],
|
|
59942
|
+
finally: []
|
|
59943
|
+
}, retryService) {
|
|
60785
59944
|
return {
|
|
60786
59945
|
type: "fetch",
|
|
60787
59946
|
version: "1.0",
|
|
@@ -60790,6 +59949,7 @@ function buildServiceDescriptor$1(interceptors = { request: [], response: [], fi
|
|
|
60790
59949
|
const context = (_a = interceptors.createContext) == null ? void 0 : _a.call(interceptors);
|
|
60791
59950
|
const {
|
|
60792
59951
|
request: requestInterceptors = [],
|
|
59952
|
+
retry: retryInterceptor = void 0,
|
|
60793
59953
|
response: responseInterceptors = [],
|
|
60794
59954
|
finally: finallyInterceptors = []
|
|
60795
59955
|
} = interceptors;
|
|
@@ -60798,10 +59958,14 @@ function buildServiceDescriptor$1(interceptors = { request: [], response: [], fi
|
|
|
60798
59958
|
resolvedPromiseLike$2(args)
|
|
60799
59959
|
);
|
|
60800
59960
|
return Promise.resolve(pending).then((args2) => {
|
|
60801
|
-
if (
|
|
60802
|
-
return
|
|
59961
|
+
if (retryInterceptor) {
|
|
59962
|
+
return retryInterceptor(args2, retryService, context);
|
|
59963
|
+
} else {
|
|
59964
|
+
if (retryService) {
|
|
59965
|
+
return retryService.applyRetry(() => fetch(...args2));
|
|
59966
|
+
}
|
|
59967
|
+
return fetch(...args2);
|
|
60803
59968
|
}
|
|
60804
|
-
return fetch(...args2);
|
|
60805
59969
|
}).then((response) => {
|
|
60806
59970
|
return responseInterceptors.reduce(
|
|
60807
59971
|
(previousPromise, interceptor) => previousPromise.then((response2) => interceptor(response2, context)),
|
|
@@ -61814,4 +60978,4 @@ register({
|
|
|
61814
60978
|
});
|
|
61815
60979
|
|
|
61816
60980
|
export { O11Y_NAMESPACE_LDS_MOBILE, getRuntime, ingest$1o as ingestDenormalizedRecordRepresentation, initializeOneStore, registerReportObserver, reportGraphqlQueryParseError };
|
|
61817
|
-
// version: 1.
|
|
60981
|
+
// version: 1.410.0-19e0e5d352
|