@salesforce/lds-runtime-mobile 1.404.0-dev2 → 1.404.0-dev5

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.
Files changed (3) hide show
  1. package/dist/main.js +133 -1011
  2. package/package.json +18 -16
  3. package/sfdc/main.js +133 -1011
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$2, visit as visit$2, isObjectType, defaultFieldResolver, buildSchema, parse as parse$8, extendSchema, isScalarType, execute, print as print$1 } from '@luvio/graphql-parser';
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$2, push: push$2, unshift } = Array.prototype;
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$2.call(fields, ',');
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$2.call(optionalFields, ',');
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$2.call(queryString, '&')}`;
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;
@@ -43957,18 +43959,34 @@ function recordLoaderFactory(query) {
43957
43959
  async function batchRecordQuery(ids) {
43958
43960
  const varbinds = Array(ids.length).fill('?').join(',');
43959
43961
  const { rows } = await query(`select data from lds_data where key like 'UiApi::RecordRepresentation:%' and json_extract(data,'$.id') in (${varbinds})`, ids);
43960
- return ids.map((id) => {
43961
- let foundRow = null;
43962
+ if (graphqlRelationshipFieldsPerf.isOpen({ fallback: false })) {
43963
+ // old, non-performant logic fallback
43964
+ return ids.map((id) => {
43965
+ let foundRow = null;
43966
+ rows.forEach((row) => {
43967
+ if (!row[0])
43968
+ return null;
43969
+ const record = parse$5(row[0]);
43970
+ if (record.id === id) {
43971
+ foundRow = record;
43972
+ }
43973
+ });
43974
+ return foundRow;
43975
+ });
43976
+ }
43977
+ else {
43978
+ // DEFAULT PERFORMANT LOGIC - Use kill switch gate to revert
43979
+ // Build a map of id -> record (O(m) with single parse per record)
43980
+ const recordMap = new Map();
43962
43981
  rows.forEach((row) => {
43963
43982
  if (!row[0])
43964
- return null;
43983
+ return;
43965
43984
  const record = parse$5(row[0]);
43966
- if (record.id === id) {
43967
- foundRow = record;
43968
- }
43985
+ recordMap.set(record.id, record);
43969
43986
  });
43970
- return foundRow;
43971
- });
43987
+ // Map ids to records (O(n) lookup)
43988
+ return ids.map((id) => recordMap.get(id) || null);
43989
+ }
43972
43990
  }
43973
43991
  return new DataLoader(batchRecordQuery);
43974
43992
  }
@@ -45375,25 +45393,25 @@ function isObjectValueNode(node) {
45375
45393
  return node.kind === 'ObjectValue';
45376
45394
  }
45377
45395
  function isStringValueNode(node) {
45378
- return node.kind === Kind$2.STRING;
45396
+ return node.kind === Kind$1.STRING;
45379
45397
  }
45380
45398
  function isIntValueNode(node) {
45381
- return node.kind === Kind$2.INT;
45399
+ return node.kind === Kind$1.INT;
45382
45400
  }
45383
45401
  function isVariableNode(node) {
45384
- return node.kind === Kind$2.VARIABLE;
45402
+ return node.kind === Kind$1.VARIABLE;
45385
45403
  }
45386
45404
  function isFieldNode(node) {
45387
45405
  return node !== undefined && node.kind !== undefined ? node.kind === 'Field' : false;
45388
45406
  }
45389
45407
  function isFieldOrInlineFragmentNode(node) {
45390
45408
  return node !== undefined && node.kind !== undefined
45391
- ? node.kind === 'Field' || node.kind === Kind$2.INLINE_FRAGMENT
45409
+ ? node.kind === 'Field' || node.kind === Kind$1.INLINE_FRAGMENT
45392
45410
  : false;
45393
45411
  }
45394
45412
  function isInlineFragmentNode(node) {
45395
45413
  return node !== undefined && node.kind !== undefined
45396
- ? node.kind === Kind$2.INLINE_FRAGMENT
45414
+ ? node.kind === Kind$1.INLINE_FRAGMENT
45397
45415
  : false;
45398
45416
  }
45399
45417
  function isCompoundPredicate(predicate) {
@@ -45602,9 +45620,9 @@ function isCapableRelationship(node) {
45602
45620
  function isScopeArgumentNodeWithType(node, scopeType, variables) {
45603
45621
  if (node.name.value !== 'scope')
45604
45622
  return false;
45605
- if (node.value.kind !== Kind$2.ENUM && node.value.kind !== Kind$2.VARIABLE)
45623
+ if (node.value.kind !== Kind$1.ENUM && node.value.kind !== Kind$1.VARIABLE)
45606
45624
  return false;
45607
- if (node.value.kind === Kind$2.ENUM) {
45625
+ if (node.value.kind === Kind$1.ENUM) {
45608
45626
  if (node.value.value === scopeType) {
45609
45627
  return true;
45610
45628
  }
@@ -45711,7 +45729,7 @@ function isInlineFragmentFieldSpanning(node) {
45711
45729
  if (!node.selectionSet)
45712
45730
  return false;
45713
45731
  return node.selectionSet.selections.some((selection) => {
45714
- if (selection.kind !== Kind$2.INLINE_FRAGMENT)
45732
+ if (selection.kind !== Kind$1.INLINE_FRAGMENT)
45715
45733
  return false;
45716
45734
  return isFieldSpanning(selection, node);
45717
45735
  });
@@ -46251,7 +46269,7 @@ const base64decode = typeof atob === 'function' ? atob : atobPolyfill;
46251
46269
  /**
46252
46270
  * The set of allowed kind values for AST nodes.
46253
46271
  */
46254
- var Kind$1 = Object.freeze({
46272
+ var Kind = Object.freeze({
46255
46273
  // Name
46256
46274
  NAME: 'Name',
46257
46275
  // Document
@@ -46447,7 +46465,7 @@ defineInspect(Token);
46447
46465
  * @internal
46448
46466
  */
46449
46467
 
46450
- function isNode$1(maybeNode) {
46468
+ function isNode(maybeNode) {
46451
46469
  return maybeNode != null && typeof maybeNode.kind === 'string';
46452
46470
  }
46453
46471
  /**
@@ -46455,17 +46473,17 @@ function isNode$1(maybeNode) {
46455
46473
  */
46456
46474
 
46457
46475
  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$1 = 10;
46459
- var MAX_RECURSIVE_DEPTH$1 = 2;
46476
+ var MAX_ARRAY_LENGTH = 10;
46477
+ var MAX_RECURSIVE_DEPTH = 2;
46460
46478
  /**
46461
46479
  * Used to print values in error messages.
46462
46480
  */
46463
46481
 
46464
- function inspect$1(value) {
46465
- return formatValue$1(value, []);
46482
+ function inspect(value) {
46483
+ return formatValue(value, []);
46466
46484
  }
46467
46485
 
46468
- function formatValue$1(value, seenValues) {
46486
+ function formatValue(value, seenValues) {
46469
46487
  switch (_typeof(value)) {
46470
46488
  case 'string':
46471
46489
  return JSON.stringify(value);
@@ -46478,14 +46496,14 @@ function formatValue$1(value, seenValues) {
46478
46496
  return 'null';
46479
46497
  }
46480
46498
 
46481
- return formatObjectValue$1(value, seenValues);
46499
+ return formatObjectValue(value, seenValues);
46482
46500
 
46483
46501
  default:
46484
46502
  return String(value);
46485
46503
  }
46486
46504
  }
46487
46505
 
46488
- function formatObjectValue$1(value, previouslySeenValues) {
46506
+ function formatObjectValue(value, previouslySeenValues) {
46489
46507
  if (previouslySeenValues.indexOf(value) !== -1) {
46490
46508
  return '[Circular]';
46491
46509
  }
@@ -46497,48 +46515,48 @@ function formatObjectValue$1(value, previouslySeenValues) {
46497
46515
  var customValue = customInspectFn.call(value); // check for infinite recursion
46498
46516
 
46499
46517
  if (customValue !== value) {
46500
- return typeof customValue === 'string' ? customValue : formatValue$1(customValue, seenValues);
46518
+ return typeof customValue === 'string' ? customValue : formatValue(customValue, seenValues);
46501
46519
  }
46502
46520
  } else if (Array.isArray(value)) {
46503
- return formatArray$1(value, seenValues);
46521
+ return formatArray(value, seenValues);
46504
46522
  }
46505
46523
 
46506
- return formatObject$1(value, seenValues);
46524
+ return formatObject(value, seenValues);
46507
46525
  }
46508
46526
 
46509
- function formatObject$1(object, seenValues) {
46527
+ function formatObject(object, seenValues) {
46510
46528
  var keys = Object.keys(object);
46511
46529
 
46512
46530
  if (keys.length === 0) {
46513
46531
  return '{}';
46514
46532
  }
46515
46533
 
46516
- if (seenValues.length > MAX_RECURSIVE_DEPTH$1) {
46517
- return '[' + getObjectTag$1(object) + ']';
46534
+ if (seenValues.length > MAX_RECURSIVE_DEPTH) {
46535
+ return '[' + getObjectTag(object) + ']';
46518
46536
  }
46519
46537
 
46520
46538
  var properties = keys.map(function (key) {
46521
- var value = formatValue$1(object[key], seenValues);
46539
+ var value = formatValue(object[key], seenValues);
46522
46540
  return key + ': ' + value;
46523
46541
  });
46524
46542
  return '{ ' + properties.join(', ') + ' }';
46525
46543
  }
46526
46544
 
46527
- function formatArray$1(array, seenValues) {
46545
+ function formatArray(array, seenValues) {
46528
46546
  if (array.length === 0) {
46529
46547
  return '[]';
46530
46548
  }
46531
46549
 
46532
- if (seenValues.length > MAX_RECURSIVE_DEPTH$1) {
46550
+ if (seenValues.length > MAX_RECURSIVE_DEPTH) {
46533
46551
  return '[Array]';
46534
46552
  }
46535
46553
 
46536
- var len = Math.min(MAX_ARRAY_LENGTH$1, array.length);
46554
+ var len = Math.min(MAX_ARRAY_LENGTH, array.length);
46537
46555
  var remaining = array.length - len;
46538
46556
  var items = [];
46539
46557
 
46540
46558
  for (var i = 0; i < len; ++i) {
46541
- items.push(formatValue$1(array[i], seenValues));
46559
+ items.push(formatValue(array[i], seenValues));
46542
46560
  }
46543
46561
 
46544
46562
  if (remaining === 1) {
@@ -46562,7 +46580,7 @@ function getCustomFn(object) {
46562
46580
  }
46563
46581
  }
46564
46582
 
46565
- function getObjectTag$1(object) {
46583
+ function getObjectTag(object) {
46566
46584
  var tag = Object.prototype.toString.call(object).replace(/^\[object /, '').replace(/]$/, '');
46567
46585
 
46568
46586
  if (tag === 'Object' && typeof object.constructor === 'function') {
@@ -46581,7 +46599,7 @@ function getObjectTag$1(object) {
46581
46599
  * relevant functions to be called during the visitor's traversal.
46582
46600
  */
46583
46601
 
46584
- var QueryDocumentKeys$1 = {
46602
+ var QueryDocumentKeys = {
46585
46603
  Name: [],
46586
46604
  Document: ['definitions'],
46587
46605
  OperationDefinition: ['name', 'variableDefinitions', 'directives', 'selectionSet'],
@@ -46628,7 +46646,7 @@ var QueryDocumentKeys$1 = {
46628
46646
  EnumTypeExtension: ['name', 'directives', 'values'],
46629
46647
  InputObjectTypeExtension: ['name', 'directives', 'fields']
46630
46648
  };
46631
- var BREAK$1 = Object.freeze({});
46649
+ var BREAK = Object.freeze({});
46632
46650
  /**
46633
46651
  * visit() will walk through an AST using a depth-first traversal, calling
46634
46652
  * the visitor's enter function at each node in the traversal, and calling the
@@ -46716,8 +46734,8 @@ var BREAK$1 = Object.freeze({});
46716
46734
  * })
46717
46735
  */
46718
46736
 
46719
- function visit$1(root, visitor) {
46720
- var visitorKeys = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : QueryDocumentKeys$1;
46737
+ function visit(root, visitor) {
46738
+ var visitorKeys = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : QueryDocumentKeys;
46721
46739
 
46722
46740
  /* eslint-disable no-undef-init */
46723
46741
  var stack = undefined;
@@ -46797,8 +46815,8 @@ function visit$1(root, visitor) {
46797
46815
  var result = void 0;
46798
46816
 
46799
46817
  if (!Array.isArray(node)) {
46800
- if (!isNode$1(node)) {
46801
- throw new Error("Invalid AST Node: ".concat(inspect$1(node), "."));
46818
+ if (!isNode(node)) {
46819
+ throw new Error("Invalid AST Node: ".concat(inspect(node), "."));
46802
46820
  }
46803
46821
 
46804
46822
  var visitFn = getVisitFn(visitor, node.kind, isLeaving);
@@ -46806,7 +46824,7 @@ function visit$1(root, visitor) {
46806
46824
  if (visitFn) {
46807
46825
  result = visitFn.call(visitor, node, key, parent, path, ancestors);
46808
46826
 
46809
- if (result === BREAK$1) {
46827
+ if (result === BREAK) {
46810
46828
  break;
46811
46829
  }
46812
46830
 
@@ -46819,7 +46837,7 @@ function visit$1(root, visitor) {
46819
46837
  edits.push([key, result]);
46820
46838
 
46821
46839
  if (!isLeaving) {
46822
- if (isNode$1(result)) {
46840
+ if (isNode(result)) {
46823
46841
  node = result;
46824
46842
  } else {
46825
46843
  path.pop();
@@ -46995,7 +47013,7 @@ function decodeV1Cursor(base64cursor) {
46995
47013
  function selectionIncludesHasNextPage(selections, fragments) {
46996
47014
  for (let selection of selections) {
46997
47015
  switch (selection.kind) {
46998
- case Kind$1.FIELD: {
47016
+ case Kind.FIELD: {
46999
47017
  if (selection.name.value === 'pageInfo') {
47000
47018
  if (!selection.selectionSet)
47001
47019
  continue;
@@ -47006,7 +47024,7 @@ function selectionIncludesHasNextPage(selections, fragments) {
47006
47024
  }
47007
47025
  break;
47008
47026
  }
47009
- case Kind$1.FRAGMENT_SPREAD: {
47027
+ case Kind.FRAGMENT_SPREAD: {
47010
47028
  let fragment = fragments[selection.name.value];
47011
47029
  if (!fragment)
47012
47030
  return false;
@@ -47015,7 +47033,7 @@ function selectionIncludesHasNextPage(selections, fragments) {
47015
47033
  }
47016
47034
  break;
47017
47035
  }
47018
- case Kind$1.INLINE_FRAGMENT:
47036
+ case Kind.INLINE_FRAGMENT:
47019
47037
  if (selectionIncludesHasNextPage(selection.selectionSet.selections, fragments)) {
47020
47038
  return true;
47021
47039
  }
@@ -47071,7 +47089,7 @@ function mapCursorValue(originalValue, paginationMetadata) {
47071
47089
  async function mapPaginationCursors(originalAST, variables, store) {
47072
47090
  // first pass, identify record query cache keys for reading pagination metadata
47073
47091
  let requiredPaginationMetadataKeys = [];
47074
- visit$2(originalAST, {
47092
+ visit$1(originalAST, {
47075
47093
  Field(node, _key, _parent, _path, ancestors) {
47076
47094
  // is it a record query?
47077
47095
  if (!isRecordQuery(node)) {
@@ -47099,7 +47117,7 @@ async function mapPaginationCursors(originalAST, variables, store) {
47099
47117
  // holds the original cursor values that were mapped back to server cursors
47100
47118
  let mappedCursors = new Map();
47101
47119
  // rewrite nodes/variables with mapped cursors now that we read the pagination metadata
47102
- let ast = visit$2(originalAST, {
47120
+ let ast = visit$1(originalAST, {
47103
47121
  Field(node, _key, _parent, _path, ancestors) {
47104
47122
  // is it a record query?
47105
47123
  if (!isRecordQuery(node)) {
@@ -48155,7 +48173,7 @@ async function evaluate(config, observers, settings, objectInfos, store, snapsho
48155
48173
  const operationNode = getOperationFromDocument(config.query);
48156
48174
  let topLevelQueries = [];
48157
48175
  // assume that 'config.query' has required injected fields.
48158
- const modifiedAST = visit$2(config.query, {
48176
+ const modifiedAST = visit$1(config.query, {
48159
48177
  Field: {
48160
48178
  leave(node) {
48161
48179
  if (node.name.value !== `node`)
@@ -48244,20 +48262,20 @@ async function evaluate(config, observers, settings, objectInfos, store, snapsho
48244
48262
  }
48245
48263
 
48246
48264
  const parentRelationshipDirective = {
48247
- kind: Kind$2.DIRECTIVE,
48265
+ kind: Kind$1.DIRECTIVE,
48248
48266
  name: {
48249
- kind: Kind$2.NAME,
48267
+ kind: Kind$1.NAME,
48250
48268
  value: 'category',
48251
48269
  },
48252
48270
  arguments: [
48253
48271
  {
48254
- kind: Kind$2.ARGUMENT,
48272
+ kind: Kind$1.ARGUMENT,
48255
48273
  name: {
48256
- kind: Kind$2.NAME,
48274
+ kind: Kind$1.NAME,
48257
48275
  value: 'name',
48258
48276
  },
48259
48277
  value: {
48260
- kind: Kind$2.STRING,
48278
+ kind: Kind$1.STRING,
48261
48279
  value: PARENT_RELATIONSHIP,
48262
48280
  block: false,
48263
48281
  },
@@ -48265,12 +48283,12 @@ const parentRelationshipDirective = {
48265
48283
  ],
48266
48284
  };
48267
48285
  const FieldValueNodeSelectionSet = {
48268
- kind: Kind$2.SELECTION_SET,
48286
+ kind: Kind$1.SELECTION_SET,
48269
48287
  selections: [
48270
48288
  {
48271
- kind: Kind$2.FIELD,
48289
+ kind: Kind$1.FIELD,
48272
48290
  name: {
48273
- kind: Kind$2.NAME,
48291
+ kind: Kind$1.NAME,
48274
48292
  value: 'value',
48275
48293
  },
48276
48294
  },
@@ -48296,7 +48314,7 @@ async function injectSyntheticFields(originalAST, objectInfoService, draftFuncti
48296
48314
  unmappedDraftIDs: new Set(),
48297
48315
  };
48298
48316
  let assignedtomeQueryFieldNode = undefined;
48299
- visit$2(originalAST, {
48317
+ visit$1(originalAST, {
48300
48318
  Argument: {
48301
48319
  enter(node, key, parent, path, ancestors) {
48302
48320
  const { connection: recordConnectionNode, path: ancesterPath } = findNearestConnectionWithPath(ancestors);
@@ -48368,7 +48386,7 @@ async function injectSyntheticFields(originalAST, objectInfoService, draftFuncti
48368
48386
  objectInfos = await resolveObjectInfos(objectNodeInfoTree, pathToObjectApiNamesMap, startNodes, objectInfoService);
48369
48387
  }
48370
48388
  // read pass; gather whats needed
48371
- visit$2(originalAST, {
48389
+ visit$1(originalAST, {
48372
48390
  Argument: {
48373
48391
  leave(node, key, parent, path, ancestors) {
48374
48392
  const recordQueryField = findNearestConnection(ancestors);
@@ -48455,7 +48473,7 @@ async function injectSyntheticFields(originalAST, objectInfoService, draftFuncti
48455
48473
  },
48456
48474
  });
48457
48475
  // write pass; inject whats needed
48458
- const modifiedAST = visit$2(originalAST, {
48476
+ const modifiedAST = visit$1(originalAST, {
48459
48477
  Field: {
48460
48478
  leave(node, key, parent, path, ancestors) {
48461
48479
  // removes 'ServicesResources' query field node if 'assignedtome' scope shows up
@@ -48533,7 +48551,7 @@ async function injectSyntheticFields(originalAST, objectInfoService, draftFuncti
48533
48551
  }
48534
48552
  function swapIdField(filterFields, objectInfo, swapped, idState, draftFunctions) {
48535
48553
  switch (filterFields.kind) {
48536
- case Kind$2.OBJECT: {
48554
+ case Kind$1.OBJECT: {
48537
48555
  const fieldNodes = filterFields.fields.map((fieldNode) => {
48538
48556
  // check at the object value node level if the node's name is an Id/Reference
48539
48557
  // if not then just pass the current swapped state
@@ -48551,7 +48569,7 @@ function swapIdField(filterFields, objectInfo, swapped, idState, draftFunctions)
48551
48569
  fields: fieldNodes,
48552
48570
  };
48553
48571
  }
48554
- case Kind$2.STRING: {
48572
+ case Kind$1.STRING: {
48555
48573
  if (!swapped) {
48556
48574
  return filterFields;
48557
48575
  }
@@ -48570,7 +48588,7 @@ function swapIdField(filterFields, objectInfo, swapped, idState, draftFunctions)
48570
48588
  block: false,
48571
48589
  };
48572
48590
  }
48573
- case Kind$2.LIST: {
48591
+ case Kind$1.LIST: {
48574
48592
  const values = filterFields.values.map((valueNode) => swapIdField(valueNode, objectInfo, swapped, idState, draftFunctions));
48575
48593
  return {
48576
48594
  kind: 'ListValue',
@@ -48656,14 +48674,14 @@ function mergeSelectionNodes(group1, group2) {
48656
48674
  function growObjectFieldTree(tree, parentNode, entryNode, totalNodes, startNodes) {
48657
48675
  entryNode.fields.forEach((objectFieldNode) => {
48658
48676
  // objectFieldNode: {Account: { Name : { eq: "xxyyzz"}}}; objectFieldNode.value: { Name : { eq: "xxyyzz"}}
48659
- if (objectFieldNode.value.kind === Kind$2.OBJECT) {
48677
+ if (objectFieldNode.value.kind === Kind$1.OBJECT) {
48660
48678
  if (objectFieldNode.name.value === 'not') {
48661
48679
  // recursively go to deeper level of filter.
48662
48680
  growObjectFieldTree(tree, parentNode, objectFieldNode.value, totalNodes, startNodes);
48663
48681
  }
48664
48682
  else {
48665
48683
  // Spanning Field 'Account'
48666
- if (objectFieldNode.value.fields.some((childObjectFieldNode) => childObjectFieldNode.value.kind === Kind$2.OBJECT)) {
48684
+ if (objectFieldNode.value.fields.some((childObjectFieldNode) => childObjectFieldNode.value.kind === Kind$1.OBJECT)) {
48667
48685
  if (!totalNodes.has(parentNode)) {
48668
48686
  totalNodes.add(parentNode);
48669
48687
  startNodes.add(parentNode);
@@ -48686,7 +48704,7 @@ function growObjectFieldTree(tree, parentNode, entryNode, totalNodes, startNodes
48686
48704
  }
48687
48705
  }
48688
48706
  }
48689
- else if (objectFieldNode.value.kind === Kind$2.LIST) {
48707
+ else if (objectFieldNode.value.kind === Kind$1.LIST) {
48690
48708
  objectFieldNode.value.values.filter(isObjectValueNode).forEach((childNode) => {
48691
48709
  growObjectFieldTree(tree, parentNode, childNode, totalNodes, startNodes);
48692
48710
  });
@@ -48968,7 +48986,7 @@ function injectFilter(filterNode, idState, parentPath, isParentPolymorphic, obje
48968
48986
  const injectedSelections = [];
48969
48987
  let isPolymorphicField = false;
48970
48988
  switch (filterNode.kind) {
48971
- case Kind$2.ARGUMENT:
48989
+ case Kind$1.ARGUMENT:
48972
48990
  if (filterNode.value.kind !== 'ObjectValue')
48973
48991
  return [];
48974
48992
  filterNode.value.fields.forEach((objectFieldNode) => {
@@ -48982,9 +49000,9 @@ function injectFilter(filterNode, idState, parentPath, isParentPolymorphic, obje
48982
49000
  }
48983
49001
  });
48984
49002
  return injectedSelections;
48985
- case Kind$2.OBJECT_FIELD:
49003
+ case Kind$1.OBJECT_FIELD:
48986
49004
  switch (filterNode.value.kind) {
48987
- case Kind$2.LIST: {
49005
+ case Kind$1.LIST: {
48988
49006
  filterNode.value.values.filter(isObjectValueNode).forEach((objectValueNode) => {
48989
49007
  objectValueNode.fields.forEach((objectFieldNode) => {
48990
49008
  const subResults = injectFilter(objectFieldNode, idState, parentPath, isParentPolymorphic, objectInfos, pathToObjectApiNamesMap, draftFunctions, queryNode);
@@ -48995,7 +49013,7 @@ function injectFilter(filterNode, idState, parentPath, isParentPolymorphic, obje
48995
49013
  });
48996
49014
  return injectedSelections;
48997
49015
  }
48998
- case Kind$2.OBJECT: {
49016
+ case Kind$1.OBJECT: {
48999
49017
  if (filterNode.name.value === 'not') {
49000
49018
  filterNode.value.fields.forEach((objectFieldNode) => {
49001
49019
  const subResults = injectFilter(objectFieldNode, idState, parentPath, isParentPolymorphic, objectInfos, pathToObjectApiNamesMap, draftFunctions, queryNode);
@@ -49125,9 +49143,9 @@ function injectFilter(filterNode, idState, parentPath, isParentPolymorphic, obje
49125
49143
  (isInlineFragment && !isTypeNameExisting)) {
49126
49144
  if (isInlineFragment) {
49127
49145
  sel = {
49128
- kind: Kind$2.INLINE_FRAGMENT,
49146
+ kind: Kind$1.INLINE_FRAGMENT,
49129
49147
  typeCondition: {
49130
- kind: Kind$2.NAMED_TYPE,
49148
+ kind: Kind$1.NAMED_TYPE,
49131
49149
  name: {
49132
49150
  kind: 'Name',
49133
49151
  value: filterNode.name.value,
@@ -49146,14 +49164,14 @@ function injectFilter(filterNode, idState, parentPath, isParentPolymorphic, obje
49146
49164
  ...sel,
49147
49165
  directives,
49148
49166
  selectionSet: {
49149
- kind: Kind$2.SELECTION_SET,
49167
+ kind: Kind$1.SELECTION_SET,
49150
49168
  selections: idField.concat(...subSelectionNodes),
49151
49169
  },
49152
49170
  }
49153
49171
  : {
49154
49172
  ...sel,
49155
49173
  selectionSet: {
49156
- kind: Kind$2.SELECTION_SET,
49174
+ kind: Kind$1.SELECTION_SET,
49157
49175
  selections: idField.concat(...subSelectionNodes),
49158
49176
  },
49159
49177
  };
@@ -49286,12 +49304,12 @@ function updateIDInfo(fieldNode, idState, draftFunctions) {
49286
49304
  if (isObjectValueNode(fieldNode.value)) {
49287
49305
  const idOpValueNode = fieldNode.value.fields[0];
49288
49306
  switch (idOpValueNode.value.kind) {
49289
- case Kind$2.STRING: {
49307
+ case Kind$1.STRING: {
49290
49308
  const id = idOpValueNode.value.value;
49291
49309
  idState.swapNeeded = draftFunctions.isDraftId(id);
49292
49310
  break;
49293
49311
  }
49294
- case Kind$2.LIST: {
49312
+ case Kind$1.LIST: {
49295
49313
  const listValues = idOpValueNode.value.values;
49296
49314
  idState.swapNeeded = listValues
49297
49315
  .filter(isStringValueNode)
@@ -49378,7 +49396,7 @@ function injectParentRelationships(selections, parentNode, parentPath, ancestors
49378
49396
  parentInjectedNodes.push({
49379
49397
  ...selection,
49380
49398
  selectionSet: {
49381
- kind: Kind$2.SELECTION_SET,
49399
+ kind: Kind$1.SELECTION_SET,
49382
49400
  selections: [...idSelection, ...subInjectedSelections],
49383
49401
  },
49384
49402
  });
@@ -49928,9 +49946,9 @@ function referenceIdFieldForRelationship(relationshipName) {
49928
49946
  */
49929
49947
  function createFieldNode(nameValue, selectionSet) {
49930
49948
  return {
49931
- kind: Kind$2.FIELD,
49949
+ kind: Kind$1.FIELD,
49932
49950
  name: {
49933
- kind: Kind$2.NAME,
49951
+ kind: Kind$1.NAME,
49934
49952
  value: nameValue,
49935
49953
  },
49936
49954
  selectionSet,
@@ -50066,7 +50084,7 @@ function instrumentLimits(ast, variables) {
50066
50084
  let currentChildRelationships = 0;
50067
50085
  let currentRootRecordCount = 0;
50068
50086
  let currentTotalRecordCount = 0;
50069
- visit$2(ast, {
50087
+ visit$1(ast, {
50070
50088
  Field: {
50071
50089
  enter(node) {
50072
50090
  if (isRecordQuery(node)) {
@@ -50130,7 +50148,7 @@ function enforceFieldLimitOnAST(ast, variables, objectInfos, enforcedLimits = {
50130
50148
  }) {
50131
50149
  const { maxFieldCount, maxRecordLimit, singleRecordField, maxFieldSize } = enforcedLimits;
50132
50150
  const fieldsWithDataType = findFieldTypeInObjectInfo(objectInfos, singleRecordField);
50133
- const documentNode = visit$1(ast, {
50151
+ const documentNode = visit(ast, {
50134
50152
  Field(node) {
50135
50153
  // is it a record query?
50136
50154
  if (!isRecordQuery(node)) {
@@ -50180,7 +50198,7 @@ function enforceFieldLimitOnAST(ast, variables, objectInfos, enforcedLimits = {
50180
50198
  return {
50181
50199
  ...argument,
50182
50200
  value: {
50183
- kind: Kind$1.INT,
50201
+ kind: Kind.INT,
50184
50202
  value: recordLimit,
50185
50203
  },
50186
50204
  };
@@ -50810,7 +50828,7 @@ const recordIdGenerator = (id) => {
50810
50828
 
50811
50829
  const { keys: keys$2, create: create$2, assign: assign$1, entries: entries$2 } = Object;
50812
50830
  const { stringify: stringify$4, parse: parse$4 } = JSON;
50813
- const { push, join: join$1, slice } = Array.prototype;
50831
+ const { push, join, slice } = Array.prototype;
50814
50832
  const { isArray: isArray$2, from } = Array;
50815
50833
 
50816
50834
  function ldsParamsToString(params) {
@@ -50992,10 +51010,10 @@ class ScopedFields {
50992
51010
  fields.forEach(this.addField, this);
50993
51011
  }
50994
51012
  toQueryParameterValue() {
50995
- const joinedFields = join$1.call(Object.keys(this.fields), SEPARATOR_BETWEEN_FIELDS);
51013
+ const joinedFields = join.call(Object.keys(this.fields), SEPARATOR_BETWEEN_FIELDS);
50996
51014
  return this.isUnScoped()
50997
51015
  ? joinedFields
50998
- : join$1.call([this.scope, joinedFields], SEPARATOR_BETWEEN_SCOPE_AND_FIELDS);
51016
+ : join.call([this.scope, joinedFields], SEPARATOR_BETWEEN_SCOPE_AND_FIELDS);
50999
51017
  }
51000
51018
  toQueryParams() {
51001
51019
  return this.isUnScoped() ? Object.keys(this.fields) : this.toQueryParameterValue();
@@ -51063,7 +51081,7 @@ class ScopedFieldsCollection {
51063
51081
  if (chunk !== undefined)
51064
51082
  result.push(chunk);
51065
51083
  }
51066
- return join$1.call(result, SEPARATOR_BETWEEN_SCOPES);
51084
+ return join.call(result, SEPARATOR_BETWEEN_SCOPES);
51067
51085
  }
51068
51086
  /**
51069
51087
  * split the ScopedFields into multiple ScopedFields
@@ -51240,7 +51258,7 @@ function buildAggregateUiUrl(params, resourceRequest) {
51240
51258
  queryString.push(`${key}=${isArray$2(value) ? value.join(',') : value}`);
51241
51259
  }
51242
51260
  }
51243
- return `${resourceRequest.baseUri}${resourceRequest.basePath}?${join$1.call(queryString, '&')}`;
51261
+ return `${resourceRequest.baseUri}${resourceRequest.basePath}?${join.call(queryString, '&')}`;
51244
51262
  }
51245
51263
  function shouldUseAggregateUiForFields(fieldsArray, optionalFieldsArray, maxLengthPerChunk) {
51246
51264
  return fieldsArray.length + optionalFieldsArray.length >= maxLengthPerChunk;
@@ -54456,7 +54474,7 @@ function createResourceRequest$2(config) {
54456
54474
  baseUri: '/services/data/v66.0',
54457
54475
  basePath: '/graphql',
54458
54476
  method: 'post',
54459
- body: { ...config.body, query: print$1(config.body.query) },
54477
+ body: { ...config.body, query: print(config.body.query) },
54460
54478
  urlParams: {},
54461
54479
  queryParams: {},
54462
54480
  headers,
@@ -54480,7 +54498,7 @@ function stripMetaschemaFromFieldNode(fieldNode) {
54480
54498
  return fieldNode;
54481
54499
  }
54482
54500
  function stripDocumentOfMetaschema(documentNode) {
54483
- return visit$2(documentNode, {
54501
+ return visit$1(documentNode, {
54484
54502
  Field(node) {
54485
54503
  return stripMetaschemaFromFieldNode(node);
54486
54504
  },
@@ -54512,7 +54530,7 @@ function transformConfiguration$1(config) {
54512
54530
  // Make a copy of the config before running transform to avoid mutating the original config
54513
54531
  const adapterConfigCopy = {
54514
54532
  ...config,
54515
- query: parse$8(print$1(config.query))
54533
+ query: parse$8(print(config.query))
54516
54534
  };
54517
54535
  return {
54518
54536
  ...adapterConfigCopy,
@@ -54594,7 +54612,7 @@ function stripDocumentsOfMetaschema(config) {
54594
54612
  const batchQueryTransformed = config.body.batchQuery.map((singleConfig) => {
54595
54613
  return {
54596
54614
  ...singleConfig,
54597
- query: print$1(stripDocumentOfMetaschema(singleConfig.query)),
54615
+ query: print(stripDocumentOfMetaschema(singleConfig.query)),
54598
54616
  };
54599
54617
  });
54600
54618
  return {
@@ -54890,7 +54908,7 @@ function transformConfiguration(config) {
54890
54908
  const batchQueryTransformed = config.batchQuery.map((singleConfig) => {
54891
54909
  return {
54892
54910
  ...singleConfig,
54893
- query: applyMinimumFieldsToQuery(parse$8(print$1(singleConfig.query))), // Stringifies and parses again to avoid mutating original. Should we just JSON.stringify to avoid the dependency on the parser?
54911
+ 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
54912
  };
54895
54913
  });
54896
54914
  return {
@@ -58329,7 +58347,7 @@ function buildServiceDescriptor$b(luvio) {
58329
58347
  },
58330
58348
  };
58331
58349
  }
58332
- // version: 1.404.0-dev2-c0a696aed4
58350
+ // version: 1.404.0-dev5-38a59c52aa
58333
58351
 
58334
58352
  /**
58335
58353
  * Copyright (c) 2022, Salesforce, Inc.,
@@ -58355,903 +58373,7 @@ function buildServiceDescriptor$a(notifyRecordUpdateAvailable, getNormalizedLuvi
58355
58373
  },
58356
58374
  };
58357
58375
  }
58358
- // version: 1.404.0-dev2-c0a696aed4
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
- }
58376
+ // version: 1.404.0-dev5-38a59c52aa
59255
58377
 
59256
58378
  /*!
59257
58379
  * Copyright (c) 2022, Salesforce, Inc.,
@@ -59260,7 +58382,7 @@ function wrapConfigAndVerify(config, options) {
59260
58382
  */
59261
58383
  function findExecutableOperation(input) {
59262
58384
  const operations = input.query.definitions.filter(
59263
- (def) => def.kind === Kind.OPERATION_DEFINITION
58385
+ (def) => def.kind === Kind$2.OPERATION_DEFINITION
59264
58386
  );
59265
58387
  if (operations.length === 0) {
59266
58388
  return err$1(new Error("No operations found in query"));
@@ -59307,14 +58429,14 @@ function buildGraphQLInputExtension(input) {
59307
58429
  });
59308
58430
  }
59309
58431
  const TYPENAME_FIELD = {
59310
- kind: Kind.FIELD,
58432
+ kind: Kind$2.FIELD,
59311
58433
  name: {
59312
- kind: Kind.NAME,
58434
+ kind: Kind$2.NAME,
59313
58435
  value: "__typename"
59314
58436
  }
59315
58437
  };
59316
58438
  function addTypenameToDocument(doc) {
59317
- return visit(doc, {
58439
+ return visit$2(doc, {
59318
58440
  SelectionSet: {
59319
58441
  enter(node, _key, parent) {
59320
58442
  if (isOperationDefinition(parent)) {
@@ -59339,13 +58461,13 @@ function addTypenameToDocument(doc) {
59339
58461
  });
59340
58462
  }
59341
58463
  function isOperationDefinition(parent) {
59342
- return !!parent && !Array.isArray(parent) && parent.kind === Kind.OPERATION_DEFINITION;
58464
+ return !!parent && !Array.isArray(parent) && parent.kind === Kind$2.OPERATION_DEFINITION;
59343
58465
  }
59344
58466
  function isField(node) {
59345
- return node.kind === Kind.FIELD;
58467
+ return node.kind === Kind$2.FIELD;
59346
58468
  }
59347
58469
  function isFragmentDefinition(node) {
59348
- return node.kind === Kind.FRAGMENT_DEFINITION;
58470
+ return node.kind === Kind$2.FRAGMENT_DEFINITION;
59349
58471
  }
59350
58472
 
59351
58473
  /*!
@@ -59409,14 +58531,14 @@ class AuraGraphQLNormalizedCacheControlCommand extends AuraNormalizedCacheContro
59409
58531
  return void 0;
59410
58532
  }
59411
58533
  get auraParams() {
59412
- const params = { ...this.config, query: print(this.buildRequestQuery()) };
58534
+ const params = { ...this.config, query: print$1(this.buildRequestQuery()) };
59413
58535
  if (this.auraBodyWrapperName) {
59414
58536
  return { [this.auraBodyWrapperName]: params };
59415
58537
  }
59416
58538
  return params;
59417
58539
  }
59418
58540
  get fetchParams() {
59419
- const body = { ...this.config, query: print(this.buildRequestQuery()) };
58541
+ const body = { ...this.config, query: print$1(this.buildRequestQuery()) };
59420
58542
  const headers = {
59421
58543
  "Content-Type": "application/json"
59422
58544
  };
@@ -59429,14 +58551,14 @@ class AuraGraphQLNormalizedCacheControlCommand extends AuraNormalizedCacheContro
59429
58551
  return [this.url, params];
59430
58552
  }
59431
58553
  get originalAuraParams() {
59432
- const params = { ...this.config, query: print(this.config.query) };
58554
+ const params = { ...this.config, query: print$1(this.config.query) };
59433
58555
  if (this.auraBodyWrapperName) {
59434
58556
  return { [this.auraBodyWrapperName]: params };
59435
58557
  }
59436
58558
  return params;
59437
58559
  }
59438
58560
  get originalFetchParams() {
59439
- const body = { ...this.config, query: print(this.config.query) };
58561
+ const body = { ...this.config, query: print$1(this.config.query) };
59440
58562
  const headers = {
59441
58563
  "Content-Type": "application/json"
59442
58564
  };
@@ -59556,7 +58678,7 @@ class HttpGraphQLNormalizedCacheControlCommand extends HttpNormalizedCacheContro
59556
58678
  };
59557
58679
  }
59558
58680
  get fetchParams() {
59559
- const body = { ...this.config, query: print(this.buildRequestQuery()) };
58681
+ const body = { ...this.config, query: print$1(this.buildRequestQuery()) };
59560
58682
  const headers = {
59561
58683
  "Content-Type": "application/json"
59562
58684
  };
@@ -59569,7 +58691,7 @@ class HttpGraphQLNormalizedCacheControlCommand extends HttpNormalizedCacheContro
59569
58691
  return [this.url, params];
59570
58692
  }
59571
58693
  get originalFetchParams() {
59572
- const body = { ...this.config, query: print(this.config.query) };
58694
+ const body = { ...this.config, query: print$1(this.config.query) };
59573
58695
  const headers = {
59574
58696
  "Content-Type": "application/json"
59575
58697
  };
@@ -61814,4 +60936,4 @@ register({
61814
60936
  });
61815
60937
 
61816
60938
  export { O11Y_NAMESPACE_LDS_MOBILE, getRuntime, ingest$1o as ingestDenormalizedRecordRepresentation, initializeOneStore, registerReportObserver, reportGraphqlQueryParseError };
61817
- // version: 1.404.0-dev2-3aea909b9d
60939
+ // version: 1.404.0-dev5-924c469d6b