@salesforce/lds-runtime-mobile 1.403.0 → 1.404.0-dev10
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 +244 -1027
- package/dist/types/__mocks__/o11y_schema/sf_pdp.d.ts +1 -0
- package/dist/types/adapters/types/RecordInputRepresentation.d.ts +2 -2
- package/package.json +34 -32
- package/sfdc/main.js +244 -1027
- package/sfdc/types/__mocks__/o11y_schema/sf_pdp.d.ts +1 -0
- package/sfdc/types/adapters/types/RecordInputRepresentation.d.ts +2 -2
package/dist/main.js
CHANGED
|
@@ -22,10 +22,12 @@ 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';
|
|
30
|
+
import { pdpEventSchema } from 'o11y_schema/sf_pdp';
|
|
29
31
|
import { instrument as instrument$1 } from '@salesforce/lds-bindings';
|
|
30
32
|
import ldsAdapterO11yLoggingGate from '@salesforce/gate/lmr.ldsAdapterO11yLogging';
|
|
31
33
|
import LOCALE from '@salesforce/i18n/locale';
|
|
@@ -43,6 +45,7 @@ import graphqlL2AdapterGate from '@salesforce/gate/lmr.graphqlL2Adapter';
|
|
|
43
45
|
import useOneStore from '@salesforce/gate/lmr.useOneStore';
|
|
44
46
|
import { setServices } from '@conduit-client/service-provisioner/v1';
|
|
45
47
|
import '@conduit-client/type-normalization/v1';
|
|
48
|
+
import { Kind as Kind$2, visit as visit$2, print as print$1, wrapConfigAndVerify, resolveAst, validateGraphQLOperations } from '@conduit-client/onestore-graphql-parser/v1';
|
|
46
49
|
import productConsumedSideEffects from '@salesforce/gate/com.salesforce.fieldservice.vanStockLDSBypass256';
|
|
47
50
|
|
|
48
51
|
/**
|
|
@@ -53,7 +56,7 @@ import productConsumedSideEffects from '@salesforce/gate/com.salesforce.fieldser
|
|
|
53
56
|
|
|
54
57
|
|
|
55
58
|
const { parse: parse$7, stringify: stringify$7 } = JSON;
|
|
56
|
-
const { join: join$
|
|
59
|
+
const { join: join$1, push: push$2, unshift } = Array.prototype;
|
|
57
60
|
const { isArray: isArray$5 } = Array;
|
|
58
61
|
const { entries: entries$4, keys: keys$6 } = Object;
|
|
59
62
|
|
|
@@ -187,14 +190,14 @@ function buildAggregateUiUrl$1(params, resourceRequest) {
|
|
|
187
190
|
const { fields, optionalFields } = params;
|
|
188
191
|
const queryString = [];
|
|
189
192
|
if (fields !== undefined && fields.length > 0) {
|
|
190
|
-
const fieldString = join$
|
|
193
|
+
const fieldString = join$1.call(fields, ',');
|
|
191
194
|
push$2.call(queryString, `fields=${encodeURIComponent(fieldString)}`);
|
|
192
195
|
}
|
|
193
196
|
if (optionalFields !== undefined && optionalFields.length > 0) {
|
|
194
|
-
const optionalFieldString = join$
|
|
197
|
+
const optionalFieldString = join$1.call(optionalFields, ',');
|
|
195
198
|
push$2.call(queryString, `optionalFields=${encodeURIComponent(optionalFieldString)}`);
|
|
196
199
|
}
|
|
197
|
-
return `${resourceRequest.baseUri}${resourceRequest.basePath}?${join$
|
|
200
|
+
return `${resourceRequest.baseUri}${resourceRequest.basePath}?${join$1.call(queryString, '&')}`;
|
|
198
201
|
}
|
|
199
202
|
function buildGetRecordByFieldsCompositeRequest(resourceRequest, recordsCompositeRequest) {
|
|
200
203
|
const { fieldsArray, optionalFieldsArray, fieldsLength, optionalFieldsLength } = recordsCompositeRequest;
|
|
@@ -20376,10 +20379,36 @@ function validate$7(obj, path = 'RecordInputRepresentation') {
|
|
|
20376
20379
|
if (obj_fields_prop_union3_error != null) {
|
|
20377
20380
|
obj_fields_prop_union3 = obj_fields_prop_union3_error.message;
|
|
20378
20381
|
}
|
|
20382
|
+
let obj_fields_prop_union4 = null;
|
|
20383
|
+
const obj_fields_prop_union4_error = (() => {
|
|
20384
|
+
if (!ArrayIsArray(obj_fields_prop)) {
|
|
20385
|
+
return new TypeError('Expected "array" but received "' +
|
|
20386
|
+
typeof obj_fields_prop +
|
|
20387
|
+
'" (at "' +
|
|
20388
|
+
path_fields_prop +
|
|
20389
|
+
'")');
|
|
20390
|
+
}
|
|
20391
|
+
for (let j = 0; j < obj_fields_prop.length; j++) {
|
|
20392
|
+
const obj_fields_prop_item = obj_fields_prop[j];
|
|
20393
|
+
const path_fields_prop_item = path_fields_prop + '[' + j + ']';
|
|
20394
|
+
if (typeof obj_fields_prop_item !== 'string') {
|
|
20395
|
+
return new TypeError('Expected "string" but received "' +
|
|
20396
|
+
typeof obj_fields_prop_item +
|
|
20397
|
+
'" (at "' +
|
|
20398
|
+
path_fields_prop_item +
|
|
20399
|
+
'")');
|
|
20400
|
+
}
|
|
20401
|
+
}
|
|
20402
|
+
})();
|
|
20403
|
+
// eslint-disable-next-line eqeqeq
|
|
20404
|
+
if (obj_fields_prop_union4_error != null) {
|
|
20405
|
+
obj_fields_prop_union4 = obj_fields_prop_union4_error.message;
|
|
20406
|
+
}
|
|
20379
20407
|
if (obj_fields_prop_union0 &&
|
|
20380
20408
|
obj_fields_prop_union1 &&
|
|
20381
20409
|
obj_fields_prop_union2 &&
|
|
20382
|
-
obj_fields_prop_union3
|
|
20410
|
+
obj_fields_prop_union3 &&
|
|
20411
|
+
obj_fields_prop_union4) {
|
|
20383
20412
|
let message = 'Object doesn\'t match union (at "' + path_fields_prop + '")';
|
|
20384
20413
|
message +=
|
|
20385
20414
|
'\n' +
|
|
@@ -20405,6 +20434,12 @@ function validate$7(obj, path = 'RecordInputRepresentation') {
|
|
|
20405
20434
|
.split('\n')
|
|
20406
20435
|
.map((line) => '\t' + line)
|
|
20407
20436
|
.join('\n');
|
|
20437
|
+
message +=
|
|
20438
|
+
'\n' +
|
|
20439
|
+
obj_fields_prop_union4
|
|
20440
|
+
.split('\n')
|
|
20441
|
+
.map((line) => '\t' + line)
|
|
20442
|
+
.join('\n');
|
|
20408
20443
|
return new TypeError(message);
|
|
20409
20444
|
}
|
|
20410
20445
|
}
|
|
@@ -43957,18 +43992,34 @@ function recordLoaderFactory(query) {
|
|
|
43957
43992
|
async function batchRecordQuery(ids) {
|
|
43958
43993
|
const varbinds = Array(ids.length).fill('?').join(',');
|
|
43959
43994
|
const { rows } = await query(`select data from lds_data where key like 'UiApi::RecordRepresentation:%' and json_extract(data,'$.id') in (${varbinds})`, ids);
|
|
43960
|
-
|
|
43961
|
-
|
|
43995
|
+
if (graphqlRelationshipFieldsPerf.isOpen({ fallback: false })) {
|
|
43996
|
+
// old, non-performant logic fallback
|
|
43997
|
+
return ids.map((id) => {
|
|
43998
|
+
let foundRow = null;
|
|
43999
|
+
rows.forEach((row) => {
|
|
44000
|
+
if (!row[0])
|
|
44001
|
+
return null;
|
|
44002
|
+
const record = parse$5(row[0]);
|
|
44003
|
+
if (record.id === id) {
|
|
44004
|
+
foundRow = record;
|
|
44005
|
+
}
|
|
44006
|
+
});
|
|
44007
|
+
return foundRow;
|
|
44008
|
+
});
|
|
44009
|
+
}
|
|
44010
|
+
else {
|
|
44011
|
+
// DEFAULT PERFORMANT LOGIC - Use kill switch gate to revert
|
|
44012
|
+
// Build a map of id -> record (O(m) with single parse per record)
|
|
44013
|
+
const recordMap = new Map();
|
|
43962
44014
|
rows.forEach((row) => {
|
|
43963
44015
|
if (!row[0])
|
|
43964
|
-
return
|
|
44016
|
+
return;
|
|
43965
44017
|
const record = parse$5(row[0]);
|
|
43966
|
-
|
|
43967
|
-
foundRow = record;
|
|
43968
|
-
}
|
|
44018
|
+
recordMap.set(record.id, record);
|
|
43969
44019
|
});
|
|
43970
|
-
|
|
43971
|
-
|
|
44020
|
+
// Map ids to records (O(n) lookup)
|
|
44021
|
+
return ids.map((id) => recordMap.get(id) || null);
|
|
44022
|
+
}
|
|
43972
44023
|
}
|
|
43973
44024
|
return new DataLoader(batchRecordQuery);
|
|
43974
44025
|
}
|
|
@@ -45375,25 +45426,25 @@ function isObjectValueNode(node) {
|
|
|
45375
45426
|
return node.kind === 'ObjectValue';
|
|
45376
45427
|
}
|
|
45377
45428
|
function isStringValueNode(node) {
|
|
45378
|
-
return node.kind === Kind$
|
|
45429
|
+
return node.kind === Kind$1.STRING;
|
|
45379
45430
|
}
|
|
45380
45431
|
function isIntValueNode(node) {
|
|
45381
|
-
return node.kind === Kind$
|
|
45432
|
+
return node.kind === Kind$1.INT;
|
|
45382
45433
|
}
|
|
45383
45434
|
function isVariableNode(node) {
|
|
45384
|
-
return node.kind === Kind$
|
|
45435
|
+
return node.kind === Kind$1.VARIABLE;
|
|
45385
45436
|
}
|
|
45386
45437
|
function isFieldNode(node) {
|
|
45387
45438
|
return node !== undefined && node.kind !== undefined ? node.kind === 'Field' : false;
|
|
45388
45439
|
}
|
|
45389
45440
|
function isFieldOrInlineFragmentNode(node) {
|
|
45390
45441
|
return node !== undefined && node.kind !== undefined
|
|
45391
|
-
? node.kind === 'Field' || node.kind === Kind$
|
|
45442
|
+
? node.kind === 'Field' || node.kind === Kind$1.INLINE_FRAGMENT
|
|
45392
45443
|
: false;
|
|
45393
45444
|
}
|
|
45394
45445
|
function isInlineFragmentNode(node) {
|
|
45395
45446
|
return node !== undefined && node.kind !== undefined
|
|
45396
|
-
? node.kind === Kind$
|
|
45447
|
+
? node.kind === Kind$1.INLINE_FRAGMENT
|
|
45397
45448
|
: false;
|
|
45398
45449
|
}
|
|
45399
45450
|
function isCompoundPredicate(predicate) {
|
|
@@ -45602,9 +45653,9 @@ function isCapableRelationship(node) {
|
|
|
45602
45653
|
function isScopeArgumentNodeWithType(node, scopeType, variables) {
|
|
45603
45654
|
if (node.name.value !== 'scope')
|
|
45604
45655
|
return false;
|
|
45605
|
-
if (node.value.kind !== Kind$
|
|
45656
|
+
if (node.value.kind !== Kind$1.ENUM && node.value.kind !== Kind$1.VARIABLE)
|
|
45606
45657
|
return false;
|
|
45607
|
-
if (node.value.kind === Kind$
|
|
45658
|
+
if (node.value.kind === Kind$1.ENUM) {
|
|
45608
45659
|
if (node.value.value === scopeType) {
|
|
45609
45660
|
return true;
|
|
45610
45661
|
}
|
|
@@ -45711,7 +45762,7 @@ function isInlineFragmentFieldSpanning(node) {
|
|
|
45711
45762
|
if (!node.selectionSet)
|
|
45712
45763
|
return false;
|
|
45713
45764
|
return node.selectionSet.selections.some((selection) => {
|
|
45714
|
-
if (selection.kind !== Kind$
|
|
45765
|
+
if (selection.kind !== Kind$1.INLINE_FRAGMENT)
|
|
45715
45766
|
return false;
|
|
45716
45767
|
return isFieldSpanning(selection, node);
|
|
45717
45768
|
});
|
|
@@ -46251,7 +46302,7 @@ const base64decode = typeof atob === 'function' ? atob : atobPolyfill;
|
|
|
46251
46302
|
/**
|
|
46252
46303
|
* The set of allowed kind values for AST nodes.
|
|
46253
46304
|
*/
|
|
46254
|
-
var Kind
|
|
46305
|
+
var Kind = Object.freeze({
|
|
46255
46306
|
// Name
|
|
46256
46307
|
NAME: 'Name',
|
|
46257
46308
|
// Document
|
|
@@ -46447,7 +46498,7 @@ defineInspect(Token);
|
|
|
46447
46498
|
* @internal
|
|
46448
46499
|
*/
|
|
46449
46500
|
|
|
46450
|
-
function isNode
|
|
46501
|
+
function isNode(maybeNode) {
|
|
46451
46502
|
return maybeNode != null && typeof maybeNode.kind === 'string';
|
|
46452
46503
|
}
|
|
46453
46504
|
/**
|
|
@@ -46455,17 +46506,17 @@ function isNode$1(maybeNode) {
|
|
|
46455
46506
|
*/
|
|
46456
46507
|
|
|
46457
46508
|
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
|
|
46509
|
+
var MAX_ARRAY_LENGTH = 10;
|
|
46510
|
+
var MAX_RECURSIVE_DEPTH = 2;
|
|
46460
46511
|
/**
|
|
46461
46512
|
* Used to print values in error messages.
|
|
46462
46513
|
*/
|
|
46463
46514
|
|
|
46464
|
-
function inspect
|
|
46465
|
-
return formatValue
|
|
46515
|
+
function inspect(value) {
|
|
46516
|
+
return formatValue(value, []);
|
|
46466
46517
|
}
|
|
46467
46518
|
|
|
46468
|
-
function formatValue
|
|
46519
|
+
function formatValue(value, seenValues) {
|
|
46469
46520
|
switch (_typeof(value)) {
|
|
46470
46521
|
case 'string':
|
|
46471
46522
|
return JSON.stringify(value);
|
|
@@ -46478,14 +46529,14 @@ function formatValue$1(value, seenValues) {
|
|
|
46478
46529
|
return 'null';
|
|
46479
46530
|
}
|
|
46480
46531
|
|
|
46481
|
-
return formatObjectValue
|
|
46532
|
+
return formatObjectValue(value, seenValues);
|
|
46482
46533
|
|
|
46483
46534
|
default:
|
|
46484
46535
|
return String(value);
|
|
46485
46536
|
}
|
|
46486
46537
|
}
|
|
46487
46538
|
|
|
46488
|
-
function formatObjectValue
|
|
46539
|
+
function formatObjectValue(value, previouslySeenValues) {
|
|
46489
46540
|
if (previouslySeenValues.indexOf(value) !== -1) {
|
|
46490
46541
|
return '[Circular]';
|
|
46491
46542
|
}
|
|
@@ -46497,48 +46548,48 @@ function formatObjectValue$1(value, previouslySeenValues) {
|
|
|
46497
46548
|
var customValue = customInspectFn.call(value); // check for infinite recursion
|
|
46498
46549
|
|
|
46499
46550
|
if (customValue !== value) {
|
|
46500
|
-
return typeof customValue === 'string' ? customValue : formatValue
|
|
46551
|
+
return typeof customValue === 'string' ? customValue : formatValue(customValue, seenValues);
|
|
46501
46552
|
}
|
|
46502
46553
|
} else if (Array.isArray(value)) {
|
|
46503
|
-
return formatArray
|
|
46554
|
+
return formatArray(value, seenValues);
|
|
46504
46555
|
}
|
|
46505
46556
|
|
|
46506
|
-
return formatObject
|
|
46557
|
+
return formatObject(value, seenValues);
|
|
46507
46558
|
}
|
|
46508
46559
|
|
|
46509
|
-
function formatObject
|
|
46560
|
+
function formatObject(object, seenValues) {
|
|
46510
46561
|
var keys = Object.keys(object);
|
|
46511
46562
|
|
|
46512
46563
|
if (keys.length === 0) {
|
|
46513
46564
|
return '{}';
|
|
46514
46565
|
}
|
|
46515
46566
|
|
|
46516
|
-
if (seenValues.length > MAX_RECURSIVE_DEPTH
|
|
46517
|
-
return '[' + getObjectTag
|
|
46567
|
+
if (seenValues.length > MAX_RECURSIVE_DEPTH) {
|
|
46568
|
+
return '[' + getObjectTag(object) + ']';
|
|
46518
46569
|
}
|
|
46519
46570
|
|
|
46520
46571
|
var properties = keys.map(function (key) {
|
|
46521
|
-
var value = formatValue
|
|
46572
|
+
var value = formatValue(object[key], seenValues);
|
|
46522
46573
|
return key + ': ' + value;
|
|
46523
46574
|
});
|
|
46524
46575
|
return '{ ' + properties.join(', ') + ' }';
|
|
46525
46576
|
}
|
|
46526
46577
|
|
|
46527
|
-
function formatArray
|
|
46578
|
+
function formatArray(array, seenValues) {
|
|
46528
46579
|
if (array.length === 0) {
|
|
46529
46580
|
return '[]';
|
|
46530
46581
|
}
|
|
46531
46582
|
|
|
46532
|
-
if (seenValues.length > MAX_RECURSIVE_DEPTH
|
|
46583
|
+
if (seenValues.length > MAX_RECURSIVE_DEPTH) {
|
|
46533
46584
|
return '[Array]';
|
|
46534
46585
|
}
|
|
46535
46586
|
|
|
46536
|
-
var len = Math.min(MAX_ARRAY_LENGTH
|
|
46587
|
+
var len = Math.min(MAX_ARRAY_LENGTH, array.length);
|
|
46537
46588
|
var remaining = array.length - len;
|
|
46538
46589
|
var items = [];
|
|
46539
46590
|
|
|
46540
46591
|
for (var i = 0; i < len; ++i) {
|
|
46541
|
-
items.push(formatValue
|
|
46592
|
+
items.push(formatValue(array[i], seenValues));
|
|
46542
46593
|
}
|
|
46543
46594
|
|
|
46544
46595
|
if (remaining === 1) {
|
|
@@ -46562,7 +46613,7 @@ function getCustomFn(object) {
|
|
|
46562
46613
|
}
|
|
46563
46614
|
}
|
|
46564
46615
|
|
|
46565
|
-
function getObjectTag
|
|
46616
|
+
function getObjectTag(object) {
|
|
46566
46617
|
var tag = Object.prototype.toString.call(object).replace(/^\[object /, '').replace(/]$/, '');
|
|
46567
46618
|
|
|
46568
46619
|
if (tag === 'Object' && typeof object.constructor === 'function') {
|
|
@@ -46581,7 +46632,7 @@ function getObjectTag$1(object) {
|
|
|
46581
46632
|
* relevant functions to be called during the visitor's traversal.
|
|
46582
46633
|
*/
|
|
46583
46634
|
|
|
46584
|
-
var QueryDocumentKeys
|
|
46635
|
+
var QueryDocumentKeys = {
|
|
46585
46636
|
Name: [],
|
|
46586
46637
|
Document: ['definitions'],
|
|
46587
46638
|
OperationDefinition: ['name', 'variableDefinitions', 'directives', 'selectionSet'],
|
|
@@ -46628,7 +46679,7 @@ var QueryDocumentKeys$1 = {
|
|
|
46628
46679
|
EnumTypeExtension: ['name', 'directives', 'values'],
|
|
46629
46680
|
InputObjectTypeExtension: ['name', 'directives', 'fields']
|
|
46630
46681
|
};
|
|
46631
|
-
var BREAK
|
|
46682
|
+
var BREAK = Object.freeze({});
|
|
46632
46683
|
/**
|
|
46633
46684
|
* visit() will walk through an AST using a depth-first traversal, calling
|
|
46634
46685
|
* the visitor's enter function at each node in the traversal, and calling the
|
|
@@ -46716,8 +46767,8 @@ var BREAK$1 = Object.freeze({});
|
|
|
46716
46767
|
* })
|
|
46717
46768
|
*/
|
|
46718
46769
|
|
|
46719
|
-
function visit
|
|
46720
|
-
var visitorKeys = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : QueryDocumentKeys
|
|
46770
|
+
function visit(root, visitor) {
|
|
46771
|
+
var visitorKeys = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : QueryDocumentKeys;
|
|
46721
46772
|
|
|
46722
46773
|
/* eslint-disable no-undef-init */
|
|
46723
46774
|
var stack = undefined;
|
|
@@ -46797,8 +46848,8 @@ function visit$1(root, visitor) {
|
|
|
46797
46848
|
var result = void 0;
|
|
46798
46849
|
|
|
46799
46850
|
if (!Array.isArray(node)) {
|
|
46800
|
-
if (!isNode
|
|
46801
|
-
throw new Error("Invalid AST Node: ".concat(inspect
|
|
46851
|
+
if (!isNode(node)) {
|
|
46852
|
+
throw new Error("Invalid AST Node: ".concat(inspect(node), "."));
|
|
46802
46853
|
}
|
|
46803
46854
|
|
|
46804
46855
|
var visitFn = getVisitFn(visitor, node.kind, isLeaving);
|
|
@@ -46806,7 +46857,7 @@ function visit$1(root, visitor) {
|
|
|
46806
46857
|
if (visitFn) {
|
|
46807
46858
|
result = visitFn.call(visitor, node, key, parent, path, ancestors);
|
|
46808
46859
|
|
|
46809
|
-
if (result === BREAK
|
|
46860
|
+
if (result === BREAK) {
|
|
46810
46861
|
break;
|
|
46811
46862
|
}
|
|
46812
46863
|
|
|
@@ -46819,7 +46870,7 @@ function visit$1(root, visitor) {
|
|
|
46819
46870
|
edits.push([key, result]);
|
|
46820
46871
|
|
|
46821
46872
|
if (!isLeaving) {
|
|
46822
|
-
if (isNode
|
|
46873
|
+
if (isNode(result)) {
|
|
46823
46874
|
node = result;
|
|
46824
46875
|
} else {
|
|
46825
46876
|
path.pop();
|
|
@@ -46995,7 +47046,7 @@ function decodeV1Cursor(base64cursor) {
|
|
|
46995
47046
|
function selectionIncludesHasNextPage(selections, fragments) {
|
|
46996
47047
|
for (let selection of selections) {
|
|
46997
47048
|
switch (selection.kind) {
|
|
46998
|
-
case Kind
|
|
47049
|
+
case Kind.FIELD: {
|
|
46999
47050
|
if (selection.name.value === 'pageInfo') {
|
|
47000
47051
|
if (!selection.selectionSet)
|
|
47001
47052
|
continue;
|
|
@@ -47006,7 +47057,7 @@ function selectionIncludesHasNextPage(selections, fragments) {
|
|
|
47006
47057
|
}
|
|
47007
47058
|
break;
|
|
47008
47059
|
}
|
|
47009
|
-
case Kind
|
|
47060
|
+
case Kind.FRAGMENT_SPREAD: {
|
|
47010
47061
|
let fragment = fragments[selection.name.value];
|
|
47011
47062
|
if (!fragment)
|
|
47012
47063
|
return false;
|
|
@@ -47015,7 +47066,7 @@ function selectionIncludesHasNextPage(selections, fragments) {
|
|
|
47015
47066
|
}
|
|
47016
47067
|
break;
|
|
47017
47068
|
}
|
|
47018
|
-
case Kind
|
|
47069
|
+
case Kind.INLINE_FRAGMENT:
|
|
47019
47070
|
if (selectionIncludesHasNextPage(selection.selectionSet.selections, fragments)) {
|
|
47020
47071
|
return true;
|
|
47021
47072
|
}
|
|
@@ -47071,7 +47122,7 @@ function mapCursorValue(originalValue, paginationMetadata) {
|
|
|
47071
47122
|
async function mapPaginationCursors(originalAST, variables, store) {
|
|
47072
47123
|
// first pass, identify record query cache keys for reading pagination metadata
|
|
47073
47124
|
let requiredPaginationMetadataKeys = [];
|
|
47074
|
-
visit$
|
|
47125
|
+
visit$1(originalAST, {
|
|
47075
47126
|
Field(node, _key, _parent, _path, ancestors) {
|
|
47076
47127
|
// is it a record query?
|
|
47077
47128
|
if (!isRecordQuery(node)) {
|
|
@@ -47099,7 +47150,7 @@ async function mapPaginationCursors(originalAST, variables, store) {
|
|
|
47099
47150
|
// holds the original cursor values that were mapped back to server cursors
|
|
47100
47151
|
let mappedCursors = new Map();
|
|
47101
47152
|
// rewrite nodes/variables with mapped cursors now that we read the pagination metadata
|
|
47102
|
-
let ast = visit$
|
|
47153
|
+
let ast = visit$1(originalAST, {
|
|
47103
47154
|
Field(node, _key, _parent, _path, ancestors) {
|
|
47104
47155
|
// is it a record query?
|
|
47105
47156
|
if (!isRecordQuery(node)) {
|
|
@@ -48155,7 +48206,7 @@ async function evaluate(config, observers, settings, objectInfos, store, snapsho
|
|
|
48155
48206
|
const operationNode = getOperationFromDocument(config.query);
|
|
48156
48207
|
let topLevelQueries = [];
|
|
48157
48208
|
// assume that 'config.query' has required injected fields.
|
|
48158
|
-
const modifiedAST = visit$
|
|
48209
|
+
const modifiedAST = visit$1(config.query, {
|
|
48159
48210
|
Field: {
|
|
48160
48211
|
leave(node) {
|
|
48161
48212
|
if (node.name.value !== `node`)
|
|
@@ -48244,20 +48295,20 @@ async function evaluate(config, observers, settings, objectInfos, store, snapsho
|
|
|
48244
48295
|
}
|
|
48245
48296
|
|
|
48246
48297
|
const parentRelationshipDirective = {
|
|
48247
|
-
kind: Kind$
|
|
48298
|
+
kind: Kind$1.DIRECTIVE,
|
|
48248
48299
|
name: {
|
|
48249
|
-
kind: Kind$
|
|
48300
|
+
kind: Kind$1.NAME,
|
|
48250
48301
|
value: 'category',
|
|
48251
48302
|
},
|
|
48252
48303
|
arguments: [
|
|
48253
48304
|
{
|
|
48254
|
-
kind: Kind$
|
|
48305
|
+
kind: Kind$1.ARGUMENT,
|
|
48255
48306
|
name: {
|
|
48256
|
-
kind: Kind$
|
|
48307
|
+
kind: Kind$1.NAME,
|
|
48257
48308
|
value: 'name',
|
|
48258
48309
|
},
|
|
48259
48310
|
value: {
|
|
48260
|
-
kind: Kind$
|
|
48311
|
+
kind: Kind$1.STRING,
|
|
48261
48312
|
value: PARENT_RELATIONSHIP,
|
|
48262
48313
|
block: false,
|
|
48263
48314
|
},
|
|
@@ -48265,12 +48316,12 @@ const parentRelationshipDirective = {
|
|
|
48265
48316
|
],
|
|
48266
48317
|
};
|
|
48267
48318
|
const FieldValueNodeSelectionSet = {
|
|
48268
|
-
kind: Kind$
|
|
48319
|
+
kind: Kind$1.SELECTION_SET,
|
|
48269
48320
|
selections: [
|
|
48270
48321
|
{
|
|
48271
|
-
kind: Kind$
|
|
48322
|
+
kind: Kind$1.FIELD,
|
|
48272
48323
|
name: {
|
|
48273
|
-
kind: Kind$
|
|
48324
|
+
kind: Kind$1.NAME,
|
|
48274
48325
|
value: 'value',
|
|
48275
48326
|
},
|
|
48276
48327
|
},
|
|
@@ -48296,7 +48347,7 @@ async function injectSyntheticFields(originalAST, objectInfoService, draftFuncti
|
|
|
48296
48347
|
unmappedDraftIDs: new Set(),
|
|
48297
48348
|
};
|
|
48298
48349
|
let assignedtomeQueryFieldNode = undefined;
|
|
48299
|
-
visit$
|
|
48350
|
+
visit$1(originalAST, {
|
|
48300
48351
|
Argument: {
|
|
48301
48352
|
enter(node, key, parent, path, ancestors) {
|
|
48302
48353
|
const { connection: recordConnectionNode, path: ancesterPath } = findNearestConnectionWithPath(ancestors);
|
|
@@ -48368,7 +48419,7 @@ async function injectSyntheticFields(originalAST, objectInfoService, draftFuncti
|
|
|
48368
48419
|
objectInfos = await resolveObjectInfos(objectNodeInfoTree, pathToObjectApiNamesMap, startNodes, objectInfoService);
|
|
48369
48420
|
}
|
|
48370
48421
|
// read pass; gather whats needed
|
|
48371
|
-
visit$
|
|
48422
|
+
visit$1(originalAST, {
|
|
48372
48423
|
Argument: {
|
|
48373
48424
|
leave(node, key, parent, path, ancestors) {
|
|
48374
48425
|
const recordQueryField = findNearestConnection(ancestors);
|
|
@@ -48455,7 +48506,7 @@ async function injectSyntheticFields(originalAST, objectInfoService, draftFuncti
|
|
|
48455
48506
|
},
|
|
48456
48507
|
});
|
|
48457
48508
|
// write pass; inject whats needed
|
|
48458
|
-
const modifiedAST = visit$
|
|
48509
|
+
const modifiedAST = visit$1(originalAST, {
|
|
48459
48510
|
Field: {
|
|
48460
48511
|
leave(node, key, parent, path, ancestors) {
|
|
48461
48512
|
// removes 'ServicesResources' query field node if 'assignedtome' scope shows up
|
|
@@ -48533,7 +48584,7 @@ async function injectSyntheticFields(originalAST, objectInfoService, draftFuncti
|
|
|
48533
48584
|
}
|
|
48534
48585
|
function swapIdField(filterFields, objectInfo, swapped, idState, draftFunctions) {
|
|
48535
48586
|
switch (filterFields.kind) {
|
|
48536
|
-
case Kind$
|
|
48587
|
+
case Kind$1.OBJECT: {
|
|
48537
48588
|
const fieldNodes = filterFields.fields.map((fieldNode) => {
|
|
48538
48589
|
// check at the object value node level if the node's name is an Id/Reference
|
|
48539
48590
|
// if not then just pass the current swapped state
|
|
@@ -48551,7 +48602,7 @@ function swapIdField(filterFields, objectInfo, swapped, idState, draftFunctions)
|
|
|
48551
48602
|
fields: fieldNodes,
|
|
48552
48603
|
};
|
|
48553
48604
|
}
|
|
48554
|
-
case Kind$
|
|
48605
|
+
case Kind$1.STRING: {
|
|
48555
48606
|
if (!swapped) {
|
|
48556
48607
|
return filterFields;
|
|
48557
48608
|
}
|
|
@@ -48570,7 +48621,7 @@ function swapIdField(filterFields, objectInfo, swapped, idState, draftFunctions)
|
|
|
48570
48621
|
block: false,
|
|
48571
48622
|
};
|
|
48572
48623
|
}
|
|
48573
|
-
case Kind$
|
|
48624
|
+
case Kind$1.LIST: {
|
|
48574
48625
|
const values = filterFields.values.map((valueNode) => swapIdField(valueNode, objectInfo, swapped, idState, draftFunctions));
|
|
48575
48626
|
return {
|
|
48576
48627
|
kind: 'ListValue',
|
|
@@ -48656,14 +48707,14 @@ function mergeSelectionNodes(group1, group2) {
|
|
|
48656
48707
|
function growObjectFieldTree(tree, parentNode, entryNode, totalNodes, startNodes) {
|
|
48657
48708
|
entryNode.fields.forEach((objectFieldNode) => {
|
|
48658
48709
|
// objectFieldNode: {Account: { Name : { eq: "xxyyzz"}}}; objectFieldNode.value: { Name : { eq: "xxyyzz"}}
|
|
48659
|
-
if (objectFieldNode.value.kind === Kind$
|
|
48710
|
+
if (objectFieldNode.value.kind === Kind$1.OBJECT) {
|
|
48660
48711
|
if (objectFieldNode.name.value === 'not') {
|
|
48661
48712
|
// recursively go to deeper level of filter.
|
|
48662
48713
|
growObjectFieldTree(tree, parentNode, objectFieldNode.value, totalNodes, startNodes);
|
|
48663
48714
|
}
|
|
48664
48715
|
else {
|
|
48665
48716
|
// Spanning Field 'Account'
|
|
48666
|
-
if (objectFieldNode.value.fields.some((childObjectFieldNode) => childObjectFieldNode.value.kind === Kind$
|
|
48717
|
+
if (objectFieldNode.value.fields.some((childObjectFieldNode) => childObjectFieldNode.value.kind === Kind$1.OBJECT)) {
|
|
48667
48718
|
if (!totalNodes.has(parentNode)) {
|
|
48668
48719
|
totalNodes.add(parentNode);
|
|
48669
48720
|
startNodes.add(parentNode);
|
|
@@ -48686,7 +48737,7 @@ function growObjectFieldTree(tree, parentNode, entryNode, totalNodes, startNodes
|
|
|
48686
48737
|
}
|
|
48687
48738
|
}
|
|
48688
48739
|
}
|
|
48689
|
-
else if (objectFieldNode.value.kind === Kind$
|
|
48740
|
+
else if (objectFieldNode.value.kind === Kind$1.LIST) {
|
|
48690
48741
|
objectFieldNode.value.values.filter(isObjectValueNode).forEach((childNode) => {
|
|
48691
48742
|
growObjectFieldTree(tree, parentNode, childNode, totalNodes, startNodes);
|
|
48692
48743
|
});
|
|
@@ -48968,7 +49019,7 @@ function injectFilter(filterNode, idState, parentPath, isParentPolymorphic, obje
|
|
|
48968
49019
|
const injectedSelections = [];
|
|
48969
49020
|
let isPolymorphicField = false;
|
|
48970
49021
|
switch (filterNode.kind) {
|
|
48971
|
-
case Kind$
|
|
49022
|
+
case Kind$1.ARGUMENT:
|
|
48972
49023
|
if (filterNode.value.kind !== 'ObjectValue')
|
|
48973
49024
|
return [];
|
|
48974
49025
|
filterNode.value.fields.forEach((objectFieldNode) => {
|
|
@@ -48982,9 +49033,9 @@ function injectFilter(filterNode, idState, parentPath, isParentPolymorphic, obje
|
|
|
48982
49033
|
}
|
|
48983
49034
|
});
|
|
48984
49035
|
return injectedSelections;
|
|
48985
|
-
case Kind$
|
|
49036
|
+
case Kind$1.OBJECT_FIELD:
|
|
48986
49037
|
switch (filterNode.value.kind) {
|
|
48987
|
-
case Kind$
|
|
49038
|
+
case Kind$1.LIST: {
|
|
48988
49039
|
filterNode.value.values.filter(isObjectValueNode).forEach((objectValueNode) => {
|
|
48989
49040
|
objectValueNode.fields.forEach((objectFieldNode) => {
|
|
48990
49041
|
const subResults = injectFilter(objectFieldNode, idState, parentPath, isParentPolymorphic, objectInfos, pathToObjectApiNamesMap, draftFunctions, queryNode);
|
|
@@ -48995,7 +49046,7 @@ function injectFilter(filterNode, idState, parentPath, isParentPolymorphic, obje
|
|
|
48995
49046
|
});
|
|
48996
49047
|
return injectedSelections;
|
|
48997
49048
|
}
|
|
48998
|
-
case Kind$
|
|
49049
|
+
case Kind$1.OBJECT: {
|
|
48999
49050
|
if (filterNode.name.value === 'not') {
|
|
49000
49051
|
filterNode.value.fields.forEach((objectFieldNode) => {
|
|
49001
49052
|
const subResults = injectFilter(objectFieldNode, idState, parentPath, isParentPolymorphic, objectInfos, pathToObjectApiNamesMap, draftFunctions, queryNode);
|
|
@@ -49125,9 +49176,9 @@ function injectFilter(filterNode, idState, parentPath, isParentPolymorphic, obje
|
|
|
49125
49176
|
(isInlineFragment && !isTypeNameExisting)) {
|
|
49126
49177
|
if (isInlineFragment) {
|
|
49127
49178
|
sel = {
|
|
49128
|
-
kind: Kind$
|
|
49179
|
+
kind: Kind$1.INLINE_FRAGMENT,
|
|
49129
49180
|
typeCondition: {
|
|
49130
|
-
kind: Kind$
|
|
49181
|
+
kind: Kind$1.NAMED_TYPE,
|
|
49131
49182
|
name: {
|
|
49132
49183
|
kind: 'Name',
|
|
49133
49184
|
value: filterNode.name.value,
|
|
@@ -49146,14 +49197,14 @@ function injectFilter(filterNode, idState, parentPath, isParentPolymorphic, obje
|
|
|
49146
49197
|
...sel,
|
|
49147
49198
|
directives,
|
|
49148
49199
|
selectionSet: {
|
|
49149
|
-
kind: Kind$
|
|
49200
|
+
kind: Kind$1.SELECTION_SET,
|
|
49150
49201
|
selections: idField.concat(...subSelectionNodes),
|
|
49151
49202
|
},
|
|
49152
49203
|
}
|
|
49153
49204
|
: {
|
|
49154
49205
|
...sel,
|
|
49155
49206
|
selectionSet: {
|
|
49156
|
-
kind: Kind$
|
|
49207
|
+
kind: Kind$1.SELECTION_SET,
|
|
49157
49208
|
selections: idField.concat(...subSelectionNodes),
|
|
49158
49209
|
},
|
|
49159
49210
|
};
|
|
@@ -49286,12 +49337,12 @@ function updateIDInfo(fieldNode, idState, draftFunctions) {
|
|
|
49286
49337
|
if (isObjectValueNode(fieldNode.value)) {
|
|
49287
49338
|
const idOpValueNode = fieldNode.value.fields[0];
|
|
49288
49339
|
switch (idOpValueNode.value.kind) {
|
|
49289
|
-
case Kind$
|
|
49340
|
+
case Kind$1.STRING: {
|
|
49290
49341
|
const id = idOpValueNode.value.value;
|
|
49291
49342
|
idState.swapNeeded = draftFunctions.isDraftId(id);
|
|
49292
49343
|
break;
|
|
49293
49344
|
}
|
|
49294
|
-
case Kind$
|
|
49345
|
+
case Kind$1.LIST: {
|
|
49295
49346
|
const listValues = idOpValueNode.value.values;
|
|
49296
49347
|
idState.swapNeeded = listValues
|
|
49297
49348
|
.filter(isStringValueNode)
|
|
@@ -49378,7 +49429,7 @@ function injectParentRelationships(selections, parentNode, parentPath, ancestors
|
|
|
49378
49429
|
parentInjectedNodes.push({
|
|
49379
49430
|
...selection,
|
|
49380
49431
|
selectionSet: {
|
|
49381
|
-
kind: Kind$
|
|
49432
|
+
kind: Kind$1.SELECTION_SET,
|
|
49382
49433
|
selections: [...idSelection, ...subInjectedSelections],
|
|
49383
49434
|
},
|
|
49384
49435
|
});
|
|
@@ -49928,9 +49979,9 @@ function referenceIdFieldForRelationship(relationshipName) {
|
|
|
49928
49979
|
*/
|
|
49929
49980
|
function createFieldNode(nameValue, selectionSet) {
|
|
49930
49981
|
return {
|
|
49931
|
-
kind: Kind$
|
|
49982
|
+
kind: Kind$1.FIELD,
|
|
49932
49983
|
name: {
|
|
49933
|
-
kind: Kind$
|
|
49984
|
+
kind: Kind$1.NAME,
|
|
49934
49985
|
value: nameValue,
|
|
49935
49986
|
},
|
|
49936
49987
|
selectionSet,
|
|
@@ -50066,7 +50117,7 @@ function instrumentLimits(ast, variables) {
|
|
|
50066
50117
|
let currentChildRelationships = 0;
|
|
50067
50118
|
let currentRootRecordCount = 0;
|
|
50068
50119
|
let currentTotalRecordCount = 0;
|
|
50069
|
-
visit$
|
|
50120
|
+
visit$1(ast, {
|
|
50070
50121
|
Field: {
|
|
50071
50122
|
enter(node) {
|
|
50072
50123
|
if (isRecordQuery(node)) {
|
|
@@ -50130,7 +50181,7 @@ function enforceFieldLimitOnAST(ast, variables, objectInfos, enforcedLimits = {
|
|
|
50130
50181
|
}) {
|
|
50131
50182
|
const { maxFieldCount, maxRecordLimit, singleRecordField, maxFieldSize } = enforcedLimits;
|
|
50132
50183
|
const fieldsWithDataType = findFieldTypeInObjectInfo(objectInfos, singleRecordField);
|
|
50133
|
-
const documentNode = visit
|
|
50184
|
+
const documentNode = visit(ast, {
|
|
50134
50185
|
Field(node) {
|
|
50135
50186
|
// is it a record query?
|
|
50136
50187
|
if (!isRecordQuery(node)) {
|
|
@@ -50180,7 +50231,7 @@ function enforceFieldLimitOnAST(ast, variables, objectInfos, enforcedLimits = {
|
|
|
50180
50231
|
return {
|
|
50181
50232
|
...argument,
|
|
50182
50233
|
value: {
|
|
50183
|
-
kind: Kind
|
|
50234
|
+
kind: Kind.INT,
|
|
50184
50235
|
value: recordLimit,
|
|
50185
50236
|
},
|
|
50186
50237
|
};
|
|
@@ -50810,7 +50861,7 @@ const recordIdGenerator = (id) => {
|
|
|
50810
50861
|
|
|
50811
50862
|
const { keys: keys$2, create: create$2, assign: assign$1, entries: entries$2 } = Object;
|
|
50812
50863
|
const { stringify: stringify$4, parse: parse$4 } = JSON;
|
|
50813
|
-
const { push, join
|
|
50864
|
+
const { push, join, slice } = Array.prototype;
|
|
50814
50865
|
const { isArray: isArray$2, from } = Array;
|
|
50815
50866
|
|
|
50816
50867
|
function ldsParamsToString(params) {
|
|
@@ -50992,10 +51043,10 @@ class ScopedFields {
|
|
|
50992
51043
|
fields.forEach(this.addField, this);
|
|
50993
51044
|
}
|
|
50994
51045
|
toQueryParameterValue() {
|
|
50995
|
-
const joinedFields = join
|
|
51046
|
+
const joinedFields = join.call(Object.keys(this.fields), SEPARATOR_BETWEEN_FIELDS);
|
|
50996
51047
|
return this.isUnScoped()
|
|
50997
51048
|
? joinedFields
|
|
50998
|
-
: join
|
|
51049
|
+
: join.call([this.scope, joinedFields], SEPARATOR_BETWEEN_SCOPE_AND_FIELDS);
|
|
50999
51050
|
}
|
|
51000
51051
|
toQueryParams() {
|
|
51001
51052
|
return this.isUnScoped() ? Object.keys(this.fields) : this.toQueryParameterValue();
|
|
@@ -51063,7 +51114,7 @@ class ScopedFieldsCollection {
|
|
|
51063
51114
|
if (chunk !== undefined)
|
|
51064
51115
|
result.push(chunk);
|
|
51065
51116
|
}
|
|
51066
|
-
return join
|
|
51117
|
+
return join.call(result, SEPARATOR_BETWEEN_SCOPES);
|
|
51067
51118
|
}
|
|
51068
51119
|
/**
|
|
51069
51120
|
* split the ScopedFields into multiple ScopedFields
|
|
@@ -51240,7 +51291,7 @@ function buildAggregateUiUrl(params, resourceRequest) {
|
|
|
51240
51291
|
queryString.push(`${key}=${isArray$2(value) ? value.join(',') : value}`);
|
|
51241
51292
|
}
|
|
51242
51293
|
}
|
|
51243
|
-
return `${resourceRequest.baseUri}${resourceRequest.basePath}?${join
|
|
51294
|
+
return `${resourceRequest.baseUri}${resourceRequest.basePath}?${join.call(queryString, '&')}`;
|
|
51244
51295
|
}
|
|
51245
51296
|
function shouldUseAggregateUiForFields(fieldsArray, optionalFieldsArray, maxLengthPerChunk) {
|
|
51246
51297
|
return fieldsArray.length + optionalFieldsArray.length >= maxLengthPerChunk;
|
|
@@ -52002,6 +52053,9 @@ function instrumentContentDocumentVersionAdapter(adapter) {
|
|
|
52002
52053
|
const GRAPHQL_LEGACY_ADAPTER_NAME = 'graphQL';
|
|
52003
52054
|
const GRAPHQL_ADAPTER_NAME = 'graphql';
|
|
52004
52055
|
const CREATE_CONTENT_DOCUMENT_AND_VERSION_ADAPTER = 'createContentDocumentAndVersion';
|
|
52056
|
+
const VERTICAL_NAV_FEATURE_ID = 'aJCEE00000018px4AA'; // Product Feature ID for Lightning SDK
|
|
52057
|
+
const NAMESPACE = 'lds';
|
|
52058
|
+
const ldsInstrumentation = getInstrumentation(NAMESPACE);
|
|
52005
52059
|
let reportObservers = [];
|
|
52006
52060
|
function instrumentAdapter(adapter, metadata) {
|
|
52007
52061
|
let instrumentedMobileAdapter = adapter;
|
|
@@ -52025,6 +52079,13 @@ function instrumentAdapter(adapter, metadata) {
|
|
|
52025
52079
|
for (const observer of reportObservers) {
|
|
52026
52080
|
observer(report);
|
|
52027
52081
|
}
|
|
52082
|
+
if (pdpEventSchema) {
|
|
52083
|
+
ldsInstrumentation.log(pdpEventSchema, {
|
|
52084
|
+
eventName: 'lsdkLdsAdapter.invoked',
|
|
52085
|
+
productFeatureId: VERTICAL_NAV_FEATURE_ID,
|
|
52086
|
+
contextName: metadata.name,
|
|
52087
|
+
});
|
|
52088
|
+
}
|
|
52028
52089
|
},
|
|
52029
52090
|
});
|
|
52030
52091
|
}
|
|
@@ -54456,7 +54517,7 @@ function createResourceRequest$2(config) {
|
|
|
54456
54517
|
baseUri: '/services/data/v66.0',
|
|
54457
54518
|
basePath: '/graphql',
|
|
54458
54519
|
method: 'post',
|
|
54459
|
-
body: { ...config.body, query: print
|
|
54520
|
+
body: { ...config.body, query: print(config.body.query) },
|
|
54460
54521
|
urlParams: {},
|
|
54461
54522
|
queryParams: {},
|
|
54462
54523
|
headers,
|
|
@@ -54480,7 +54541,7 @@ function stripMetaschemaFromFieldNode(fieldNode) {
|
|
|
54480
54541
|
return fieldNode;
|
|
54481
54542
|
}
|
|
54482
54543
|
function stripDocumentOfMetaschema(documentNode) {
|
|
54483
|
-
return visit$
|
|
54544
|
+
return visit$1(documentNode, {
|
|
54484
54545
|
Field(node) {
|
|
54485
54546
|
return stripMetaschemaFromFieldNode(node);
|
|
54486
54547
|
},
|
|
@@ -54512,7 +54573,7 @@ function transformConfiguration$1(config) {
|
|
|
54512
54573
|
// Make a copy of the config before running transform to avoid mutating the original config
|
|
54513
54574
|
const adapterConfigCopy = {
|
|
54514
54575
|
...config,
|
|
54515
|
-
query: parse$8(print
|
|
54576
|
+
query: parse$8(print(config.query))
|
|
54516
54577
|
};
|
|
54517
54578
|
return {
|
|
54518
54579
|
...adapterConfigCopy,
|
|
@@ -54594,7 +54655,7 @@ function stripDocumentsOfMetaschema(config) {
|
|
|
54594
54655
|
const batchQueryTransformed = config.body.batchQuery.map((singleConfig) => {
|
|
54595
54656
|
return {
|
|
54596
54657
|
...singleConfig,
|
|
54597
|
-
query: print
|
|
54658
|
+
query: print(stripDocumentOfMetaschema(singleConfig.query)),
|
|
54598
54659
|
};
|
|
54599
54660
|
});
|
|
54600
54661
|
return {
|
|
@@ -54890,7 +54951,7 @@ function transformConfiguration(config) {
|
|
|
54890
54951
|
const batchQueryTransformed = config.batchQuery.map((singleConfig) => {
|
|
54891
54952
|
return {
|
|
54892
54953
|
...singleConfig,
|
|
54893
|
-
query: applyMinimumFieldsToQuery(parse$8(print
|
|
54954
|
+
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
54955
|
};
|
|
54895
54956
|
});
|
|
54896
54957
|
return {
|
|
@@ -56291,7 +56352,12 @@ class AuraNetworkCommand extends NetworkCommand$1 {
|
|
|
56291
56352
|
this.coerceAuraErrors
|
|
56292
56353
|
);
|
|
56293
56354
|
} else if (this.shouldUseFetch()) {
|
|
56294
|
-
|
|
56355
|
+
const params = this.fetchParams;
|
|
56356
|
+
try {
|
|
56357
|
+
return this.convertFetchResponseToData(this.services.fetch(...params));
|
|
56358
|
+
} catch (reason) {
|
|
56359
|
+
return resolvedPromiseLike$2(err$1(toError(reason)));
|
|
56360
|
+
}
|
|
56295
56361
|
}
|
|
56296
56362
|
return resolvedPromiseLike$2(err$1(toError("Aura/Fetch network services not found")));
|
|
56297
56363
|
}
|
|
@@ -56889,7 +56955,12 @@ let AuraCacheControlCommand$1 = class AuraCacheControlCommand extends CacheContr
|
|
|
56889
56955
|
(errs) => this.coerceAuraErrors(errs)
|
|
56890
56956
|
);
|
|
56891
56957
|
} else if (this.shouldUseFetch()) {
|
|
56892
|
-
|
|
56958
|
+
const params = this.fetchParams;
|
|
56959
|
+
try {
|
|
56960
|
+
return this.convertFetchResponseToData(this.services.fetch(...params));
|
|
56961
|
+
} catch (reason) {
|
|
56962
|
+
return resolvedPromiseLike$2(err$1(toError(reason)));
|
|
56963
|
+
}
|
|
56893
56964
|
}
|
|
56894
56965
|
return resolvedPromiseLike$2(err$1(toError("Aura/Fetch network services not found")));
|
|
56895
56966
|
}
|
|
@@ -57028,7 +57099,12 @@ class AuraCacheControlCommand extends CacheControlCommand {
|
|
|
57028
57099
|
(errs) => this.coerceAuraErrors(errs)
|
|
57029
57100
|
);
|
|
57030
57101
|
} else if (this.shouldUseFetch()) {
|
|
57031
|
-
|
|
57102
|
+
const params = this.fetchParams;
|
|
57103
|
+
try {
|
|
57104
|
+
return this.convertFetchResponseToData(this.services.fetch(...params));
|
|
57105
|
+
} catch (reason) {
|
|
57106
|
+
return resolvedPromiseLike$2(err$1(toError(reason)));
|
|
57107
|
+
}
|
|
57032
57108
|
}
|
|
57033
57109
|
return resolvedPromiseLike$2(err$1(toError("Aura/Fetch network services not found")));
|
|
57034
57110
|
}
|
|
@@ -57264,7 +57340,11 @@ const _FetchNetworkCommand = class _FetchNetworkCommand extends NetworkCommand {
|
|
|
57264
57340
|
this.services = services;
|
|
57265
57341
|
}
|
|
57266
57342
|
fetch() {
|
|
57267
|
-
|
|
57343
|
+
try {
|
|
57344
|
+
return this.convertFetchResponseToData(this.services.fetch(...this.fetchParams));
|
|
57345
|
+
} catch (reason) {
|
|
57346
|
+
return resolvedPromiseLike$2(err$1(toError(reason)));
|
|
57347
|
+
}
|
|
57268
57348
|
}
|
|
57269
57349
|
async coerceError(errorResponse) {
|
|
57270
57350
|
return toError(errorResponse.statusText);
|
|
@@ -57328,7 +57408,11 @@ class HttpCacheControlCommand extends CacheControlCommand {
|
|
|
57328
57408
|
return this.fetch();
|
|
57329
57409
|
}
|
|
57330
57410
|
fetch() {
|
|
57331
|
-
|
|
57411
|
+
try {
|
|
57412
|
+
return this.convertFetchResponseToData(this.services.fetch(...this.fetchParams));
|
|
57413
|
+
} catch (reason) {
|
|
57414
|
+
return resolvedPromiseLike$2(err$1(toError(reason)));
|
|
57415
|
+
}
|
|
57332
57416
|
}
|
|
57333
57417
|
async coerceError(errorResponse) {
|
|
57334
57418
|
return toError(errorResponse.statusText);
|
|
@@ -57805,9 +57889,13 @@ class OnlyIfCachedCacheControlStrategy extends CacheControlStrategy {
|
|
|
57805
57889
|
}
|
|
57806
57890
|
get expiredChecks() {
|
|
57807
57891
|
return [
|
|
57808
|
-
|
|
57892
|
+
...super.expiredChecks,
|
|
57893
|
+
(cacheControlMetadata) => cacheControlMetadata.type === "no-cache"
|
|
57809
57894
|
];
|
|
57810
57895
|
}
|
|
57896
|
+
// Note: If we add support for `stale-while-revalidate` in the future, we may
|
|
57897
|
+
// need to further override expiredChecks to allow stale entries that are within the
|
|
57898
|
+
// stale-while-revalidate window to be returned for only-if-cached requests.
|
|
57811
57899
|
collectCacheHitInstrumentation(startTime, instrumentationAttributes) {
|
|
57812
57900
|
if (this.services.instrumentation) {
|
|
57813
57901
|
const meter = this.services.instrumentation.metrics.getMeter("onestore");
|
|
@@ -58329,7 +58417,7 @@ function buildServiceDescriptor$b(luvio) {
|
|
|
58329
58417
|
},
|
|
58330
58418
|
};
|
|
58331
58419
|
}
|
|
58332
|
-
// version: 1.
|
|
58420
|
+
// version: 1.404.0-dev10-1e49deeb66
|
|
58333
58421
|
|
|
58334
58422
|
/**
|
|
58335
58423
|
* Copyright (c) 2022, Salesforce, Inc.,
|
|
@@ -58355,903 +58443,7 @@ function buildServiceDescriptor$a(notifyRecordUpdateAvailable, getNormalizedLuvi
|
|
|
58355
58443
|
},
|
|
58356
58444
|
};
|
|
58357
58445
|
}
|
|
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
|
-
}
|
|
58446
|
+
// version: 1.404.0-dev10-1e49deeb66
|
|
59255
58447
|
|
|
59256
58448
|
/*!
|
|
59257
58449
|
* Copyright (c) 2022, Salesforce, Inc.,
|
|
@@ -59260,7 +58452,7 @@ function wrapConfigAndVerify(config, options) {
|
|
|
59260
58452
|
*/
|
|
59261
58453
|
function findExecutableOperation(input) {
|
|
59262
58454
|
const operations = input.query.definitions.filter(
|
|
59263
|
-
(def) => def.kind === Kind.OPERATION_DEFINITION
|
|
58455
|
+
(def) => def.kind === Kind$2.OPERATION_DEFINITION
|
|
59264
58456
|
);
|
|
59265
58457
|
if (operations.length === 0) {
|
|
59266
58458
|
return err$1(new Error("No operations found in query"));
|
|
@@ -59307,14 +58499,14 @@ function buildGraphQLInputExtension(input) {
|
|
|
59307
58499
|
});
|
|
59308
58500
|
}
|
|
59309
58501
|
const TYPENAME_FIELD = {
|
|
59310
|
-
kind: Kind.FIELD,
|
|
58502
|
+
kind: Kind$2.FIELD,
|
|
59311
58503
|
name: {
|
|
59312
|
-
kind: Kind.NAME,
|
|
58504
|
+
kind: Kind$2.NAME,
|
|
59313
58505
|
value: "__typename"
|
|
59314
58506
|
}
|
|
59315
58507
|
};
|
|
59316
58508
|
function addTypenameToDocument(doc) {
|
|
59317
|
-
return visit(doc, {
|
|
58509
|
+
return visit$2(doc, {
|
|
59318
58510
|
SelectionSet: {
|
|
59319
58511
|
enter(node, _key, parent) {
|
|
59320
58512
|
if (isOperationDefinition(parent)) {
|
|
@@ -59339,13 +58531,13 @@ function addTypenameToDocument(doc) {
|
|
|
59339
58531
|
});
|
|
59340
58532
|
}
|
|
59341
58533
|
function isOperationDefinition(parent) {
|
|
59342
|
-
return !!parent && !Array.isArray(parent) && parent.kind === Kind.OPERATION_DEFINITION;
|
|
58534
|
+
return !!parent && !Array.isArray(parent) && parent.kind === Kind$2.OPERATION_DEFINITION;
|
|
59343
58535
|
}
|
|
59344
58536
|
function isField(node) {
|
|
59345
|
-
return node.kind === Kind.FIELD;
|
|
58537
|
+
return node.kind === Kind$2.FIELD;
|
|
59346
58538
|
}
|
|
59347
58539
|
function isFragmentDefinition(node) {
|
|
59348
|
-
return node.kind === Kind.FRAGMENT_DEFINITION;
|
|
58540
|
+
return node.kind === Kind$2.FRAGMENT_DEFINITION;
|
|
59349
58541
|
}
|
|
59350
58542
|
|
|
59351
58543
|
/*!
|
|
@@ -59409,14 +58601,14 @@ class AuraGraphQLNormalizedCacheControlCommand extends AuraNormalizedCacheContro
|
|
|
59409
58601
|
return void 0;
|
|
59410
58602
|
}
|
|
59411
58603
|
get auraParams() {
|
|
59412
|
-
const params = { ...this.config, query: print(this.buildRequestQuery()) };
|
|
58604
|
+
const params = { ...this.config, query: print$1(this.buildRequestQuery()) };
|
|
59413
58605
|
if (this.auraBodyWrapperName) {
|
|
59414
58606
|
return { [this.auraBodyWrapperName]: params };
|
|
59415
58607
|
}
|
|
59416
58608
|
return params;
|
|
59417
58609
|
}
|
|
59418
58610
|
get fetchParams() {
|
|
59419
|
-
const body = { ...this.config, query: print(this.buildRequestQuery()) };
|
|
58611
|
+
const body = { ...this.config, query: print$1(this.buildRequestQuery()) };
|
|
59420
58612
|
const headers = {
|
|
59421
58613
|
"Content-Type": "application/json"
|
|
59422
58614
|
};
|
|
@@ -59429,14 +58621,14 @@ class AuraGraphQLNormalizedCacheControlCommand extends AuraNormalizedCacheContro
|
|
|
59429
58621
|
return [this.url, params];
|
|
59430
58622
|
}
|
|
59431
58623
|
get originalAuraParams() {
|
|
59432
|
-
const params = { ...this.config, query: print(this.config.query) };
|
|
58624
|
+
const params = { ...this.config, query: print$1(this.config.query) };
|
|
59433
58625
|
if (this.auraBodyWrapperName) {
|
|
59434
58626
|
return { [this.auraBodyWrapperName]: params };
|
|
59435
58627
|
}
|
|
59436
58628
|
return params;
|
|
59437
58629
|
}
|
|
59438
58630
|
get originalFetchParams() {
|
|
59439
|
-
const body = { ...this.config, query: print(this.config.query) };
|
|
58631
|
+
const body = { ...this.config, query: print$1(this.config.query) };
|
|
59440
58632
|
const headers = {
|
|
59441
58633
|
"Content-Type": "application/json"
|
|
59442
58634
|
};
|
|
@@ -59462,11 +58654,26 @@ class AuraGraphQLNormalizedCacheControlCommand extends AuraNormalizedCacheContro
|
|
|
59462
58654
|
return buildSubscribableResult$1(result, this.buildSubscribe(), () => this.refresh());
|
|
59463
58655
|
});
|
|
59464
58656
|
} else if (this.shouldUseFetch()) {
|
|
59465
|
-
|
|
59466
|
-
|
|
59467
|
-
|
|
59468
|
-
|
|
59469
|
-
|
|
58657
|
+
const params = this.originalFetchParams;
|
|
58658
|
+
try {
|
|
58659
|
+
return this.convertFetchResponseToData(this.services.fetch(...params)).then(
|
|
58660
|
+
(result) => {
|
|
58661
|
+
return buildSubscribableResult$1(
|
|
58662
|
+
result,
|
|
58663
|
+
this.buildSubscribe(),
|
|
58664
|
+
() => this.refresh()
|
|
58665
|
+
);
|
|
58666
|
+
}
|
|
58667
|
+
);
|
|
58668
|
+
} catch (reason) {
|
|
58669
|
+
return resolvedPromiseLike$2(
|
|
58670
|
+
buildSubscribableResult$1(
|
|
58671
|
+
err$1(toError(reason)),
|
|
58672
|
+
this.buildSubscribe(),
|
|
58673
|
+
() => this.refresh()
|
|
58674
|
+
)
|
|
58675
|
+
);
|
|
58676
|
+
}
|
|
59470
58677
|
}
|
|
59471
58678
|
return resolvedPromiseLike$2(
|
|
59472
58679
|
buildSubscribableResult$1(
|
|
@@ -59556,7 +58763,7 @@ class HttpGraphQLNormalizedCacheControlCommand extends HttpNormalizedCacheContro
|
|
|
59556
58763
|
};
|
|
59557
58764
|
}
|
|
59558
58765
|
get fetchParams() {
|
|
59559
|
-
const body = { ...this.config, query: print(this.buildRequestQuery()) };
|
|
58766
|
+
const body = { ...this.config, query: print$1(this.buildRequestQuery()) };
|
|
59560
58767
|
const headers = {
|
|
59561
58768
|
"Content-Type": "application/json"
|
|
59562
58769
|
};
|
|
@@ -59569,7 +58776,7 @@ class HttpGraphQLNormalizedCacheControlCommand extends HttpNormalizedCacheContro
|
|
|
59569
58776
|
return [this.url, params];
|
|
59570
58777
|
}
|
|
59571
58778
|
get originalFetchParams() {
|
|
59572
|
-
const body = { ...this.config, query: print(this.config.query) };
|
|
58779
|
+
const body = { ...this.config, query: print$1(this.config.query) };
|
|
59573
58780
|
const headers = {
|
|
59574
58781
|
"Content-Type": "application/json"
|
|
59575
58782
|
};
|
|
@@ -60781,7 +59988,12 @@ function buildServiceDescriptor$2() {
|
|
|
60781
59988
|
* All rights reserved.
|
|
60782
59989
|
* For full license text, see the LICENSE.txt file
|
|
60783
59990
|
*/
|
|
60784
|
-
function buildServiceDescriptor$1(interceptors = {
|
|
59991
|
+
function buildServiceDescriptor$1(interceptors = {
|
|
59992
|
+
request: [],
|
|
59993
|
+
retry: void 0,
|
|
59994
|
+
response: [],
|
|
59995
|
+
finally: []
|
|
59996
|
+
}, retryService) {
|
|
60785
59997
|
return {
|
|
60786
59998
|
type: "fetch",
|
|
60787
59999
|
version: "1.0",
|
|
@@ -60790,6 +60002,7 @@ function buildServiceDescriptor$1(interceptors = { request: [], response: [], fi
|
|
|
60790
60002
|
const context = (_a = interceptors.createContext) == null ? void 0 : _a.call(interceptors);
|
|
60791
60003
|
const {
|
|
60792
60004
|
request: requestInterceptors = [],
|
|
60005
|
+
retry: retryInterceptor = void 0,
|
|
60793
60006
|
response: responseInterceptors = [],
|
|
60794
60007
|
finally: finallyInterceptors = []
|
|
60795
60008
|
} = interceptors;
|
|
@@ -60798,10 +60011,14 @@ function buildServiceDescriptor$1(interceptors = { request: [], response: [], fi
|
|
|
60798
60011
|
resolvedPromiseLike$2(args)
|
|
60799
60012
|
);
|
|
60800
60013
|
return Promise.resolve(pending).then((args2) => {
|
|
60801
|
-
if (
|
|
60802
|
-
return
|
|
60014
|
+
if (retryInterceptor) {
|
|
60015
|
+
return retryInterceptor(args2, retryService, context);
|
|
60016
|
+
} else {
|
|
60017
|
+
if (retryService) {
|
|
60018
|
+
return retryService.applyRetry(() => fetch(...args2));
|
|
60019
|
+
}
|
|
60020
|
+
return fetch(...args2);
|
|
60803
60021
|
}
|
|
60804
|
-
return fetch(...args2);
|
|
60805
60022
|
}).then((response) => {
|
|
60806
60023
|
return responseInterceptors.reduce(
|
|
60807
60024
|
(previousPromise, interceptor) => previousPromise.then((response2) => interceptor(response2, context)),
|
|
@@ -61814,4 +61031,4 @@ register({
|
|
|
61814
61031
|
});
|
|
61815
61032
|
|
|
61816
61033
|
export { O11Y_NAMESPACE_LDS_MOBILE, getRuntime, ingest$1o as ingestDenormalizedRecordRepresentation, initializeOneStore, registerReportObserver, reportGraphqlQueryParseError };
|
|
61817
|
-
// version: 1.
|
|
61034
|
+
// version: 1.404.0-dev10-5a5eea9232
|