@osdk/cli 0.32.0-beta.2 → 0.32.0-beta.4
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/CHANGELOG.md +8 -0
- package/build/esm/{chunk-YOTB5E2E.js → chunk-5EG4W4EY.js} +7 -34
- package/build/esm/chunk-5EG4W4EY.js.map +1 -0
- package/build/esm/{chunk-4L3JS54F.js → chunk-FQRKVHAE.js} +2 -4
- package/build/esm/chunk-FQRKVHAE.js.map +1 -0
- package/build/esm/chunk-PZ5AY32C.js +9 -0
- package/build/esm/chunk-PZ5AY32C.js.map +1 -0
- package/build/esm/index.js +20 -226
- package/build/esm/index.js.map +1 -1
- package/build/esm/{siteDeployCommand-M5L2QJB3.js → siteDeployCommand-FGAA5AF6.js} +6 -13
- package/build/esm/siteDeployCommand-FGAA5AF6.js.map +1 -0
- package/build/esm/{versionDeleteCommand-5UDQWHW7.js → versionDeleteCommand-HQBNJZQO.js} +5 -9
- package/build/esm/versionDeleteCommand-HQBNJZQO.js.map +1 -0
- package/build/esm/{versionDeleteCommand-W4LWFTB7.js → versionDeleteCommand-POCHBGDL.js} +5 -9
- package/build/esm/versionDeleteCommand-POCHBGDL.js.map +1 -0
- package/build/esm/{versionGetCommand-LHHNHKGF.js → versionGetCommand-FVKH4K6S.js} +4 -8
- package/build/esm/versionGetCommand-FVKH4K6S.js.map +1 -0
- package/build/esm/{versionInfoCommand-U3QJ7CJR.js → versionInfoCommand-F44PTFBW.js} +4 -8
- package/build/esm/versionInfoCommand-F44PTFBW.js.map +1 -0
- package/build/esm/{versionListCommand-7EJ2J4JO.js → versionListCommand-SMJ6RCRM.js} +4 -8
- package/build/esm/versionListCommand-SMJ6RCRM.js.map +1 -0
- package/build/esm/{versionListCommand-VQ5TRLAK.js → versionListCommand-X5PFEG2U.js} +4 -8
- package/build/esm/versionListCommand-X5PFEG2U.js.map +1 -0
- package/build/esm/{versionSetCommand-LRLP7PHB.js → versionSetCommand-YGYI2W74.js} +4 -8
- package/build/esm/versionSetCommand-YGYI2W74.js.map +1 -0
- package/build/esm/{versionUnsetCommand-GYOKECVD.js → versionUnsetCommand-SUZPZFLN.js} +5 -9
- package/build/esm/versionUnsetCommand-SUZPZFLN.js.map +1 -0
- package/build/esm/{widgetSetDeployCommand-PWUXCOA7.js → widgetSetDeployCommand-42GOCEWP.js} +6 -9
- package/build/esm/widgetSetDeployCommand-42GOCEWP.js.map +1 -0
- package/package.json +8 -8
- package/build/esm/acorn-2YJLPGID.js +0 -4014
- package/build/esm/acorn-2YJLPGID.js.map +0 -1
- package/build/esm/angular-2UQQBORC.js +0 -3921
- package/build/esm/angular-2UQQBORC.js.map +0 -1
- package/build/esm/babel-BV4W3BOJ.js +0 -9588
- package/build/esm/babel-BV4W3BOJ.js.map +0 -1
- package/build/esm/chunk-4L3JS54F.js.map +0 -1
- package/build/esm/chunk-ALV6NI27.js +0 -127
- package/build/esm/chunk-ALV6NI27.js.map +0 -1
- package/build/esm/chunk-BL3NTXLM.js +0 -84
- package/build/esm/chunk-BL3NTXLM.js.map +0 -1
- package/build/esm/chunk-CINFOKVJ.js +0 -43
- package/build/esm/chunk-CINFOKVJ.js.map +0 -1
- package/build/esm/chunk-CKZAZPXC.js +0 -28
- package/build/esm/chunk-CKZAZPXC.js.map +0 -1
- package/build/esm/chunk-CMWYDM5Q.js +0 -332
- package/build/esm/chunk-CMWYDM5Q.js.map +0 -1
- package/build/esm/chunk-W7U4ETYH.js +0 -239
- package/build/esm/chunk-W7U4ETYH.js.map +0 -1
- package/build/esm/chunk-XF44FMSL.js +0 -221
- package/build/esm/chunk-XF44FMSL.js.map +0 -1
- package/build/esm/chunk-YOTB5E2E.js.map +0 -1
- package/build/esm/estree-PTS7QPRO.js +0 -6145
- package/build/esm/estree-PTS7QPRO.js.map +0 -1
- package/build/esm/find-up-GVGEKQPQ.js +0 -4
- package/build/esm/find-up-GVGEKQPQ.js.map +0 -1
- package/build/esm/flow-Y46VD55R.js +0 -27169
- package/build/esm/flow-Y46VD55R.js.map +0 -1
- package/build/esm/glimmer-SE4IEQF6.js +0 -6974
- package/build/esm/glimmer-SE4IEQF6.js.map +0 -1
- package/build/esm/graphql-QF7PMC3R.js +0 -1720
- package/build/esm/graphql-QF7PMC3R.js.map +0 -1
- package/build/esm/handleGenerate-JM5HIHXW.js +0 -19283
- package/build/esm/handleGenerate-JM5HIHXW.js.map +0 -1
- package/build/esm/html-EQKLXLBJ.js +0 -5810
- package/build/esm/html-EQKLXLBJ.js.map +0 -1
- package/build/esm/loginFlow-GP5ZJP3D.js +0 -4
- package/build/esm/loginFlow-GP5ZJP3D.js.map +0 -1
- package/build/esm/markdown-FZBHQ3B4.js +0 -6697
- package/build/esm/markdown-FZBHQ3B4.js.map +0 -1
- package/build/esm/meriyah-Q2DK6BAD.js +0 -4343
- package/build/esm/meriyah-Q2DK6BAD.js.map +0 -1
- package/build/esm/postcss-SR3FYBVU.js +0 -6281
- package/build/esm/postcss-SR3FYBVU.js.map +0 -1
- package/build/esm/siteDeployCommand-M5L2QJB3.js.map +0 -1
- package/build/esm/typescript-DEUJRDXE.js +0 -13078
- package/build/esm/typescript-DEUJRDXE.js.map +0 -1
- package/build/esm/versionDeleteCommand-5UDQWHW7.js.map +0 -1
- package/build/esm/versionDeleteCommand-W4LWFTB7.js.map +0 -1
- package/build/esm/versionGetCommand-LHHNHKGF.js.map +0 -1
- package/build/esm/versionInfoCommand-U3QJ7CJR.js.map +0 -1
- package/build/esm/versionListCommand-7EJ2J4JO.js.map +0 -1
- package/build/esm/versionListCommand-VQ5TRLAK.js.map +0 -1
- package/build/esm/versionSetCommand-LRLP7PHB.js.map +0 -1
- package/build/esm/versionUnsetCommand-GYOKECVD.js.map +0 -1
- package/build/esm/widgetSetDeployCommand-PWUXCOA7.js.map +0 -1
- package/build/esm/yaml-KQJSRZTS.js +0 -5822
- package/build/esm/yaml-KQJSRZTS.js.map +0 -1
- package/build/types/util/maybeUpdateJemmaCustomMetadata.test.d.ts +0 -1
- package/build/types/util/maybeUpdateJemmaCustomMetadata.test.d.ts.map +0 -1
- package/build/types/util/token.test.d.ts +0 -1
- package/build/types/util/token.test.d.ts.map +0 -1
|
@@ -1,1720 +0,0 @@
|
|
|
1
|
-
import { init_esm_shims } from './chunk-CINFOKVJ.js';
|
|
2
|
-
|
|
3
|
-
// ../../node_modules/.pnpm/prettier@3.6.2/node_modules/prettier/plugins/graphql.mjs
|
|
4
|
-
init_esm_shims();
|
|
5
|
-
var Et = Object.defineProperty;
|
|
6
|
-
var xe = (e2, t) => {
|
|
7
|
-
for (var n in t) Et(e2, n, {
|
|
8
|
-
get: t[n],
|
|
9
|
-
enumerable: true
|
|
10
|
-
});
|
|
11
|
-
};
|
|
12
|
-
var Ne = {};
|
|
13
|
-
xe(Ne, {
|
|
14
|
-
languages: () => Qe,
|
|
15
|
-
options: () => Ke,
|
|
16
|
-
parsers: () => _e,
|
|
17
|
-
printers: () => pn
|
|
18
|
-
});
|
|
19
|
-
var Tt = (e2, t, n, i) => {
|
|
20
|
-
if (!(e2 && t == null)) return t.replaceAll ? t.replaceAll(n, i) : n.global ? t.replace(n, i) : t.split(n).join(i);
|
|
21
|
-
};
|
|
22
|
-
var G = Tt;
|
|
23
|
-
var j = "indent";
|
|
24
|
-
var $ = "group";
|
|
25
|
-
var w = "if-break";
|
|
26
|
-
var S = "line";
|
|
27
|
-
var X = "break-parent";
|
|
28
|
-
var Re = () => {
|
|
29
|
-
};
|
|
30
|
-
var le = Re;
|
|
31
|
-
function N(e2) {
|
|
32
|
-
return {
|
|
33
|
-
type: j,
|
|
34
|
-
contents: e2
|
|
35
|
-
};
|
|
36
|
-
}
|
|
37
|
-
function y(e2, t = {}) {
|
|
38
|
-
return le(t.expandedStates), {
|
|
39
|
-
type: $,
|
|
40
|
-
id: t.id,
|
|
41
|
-
contents: e2,
|
|
42
|
-
break: !!t.shouldBreak,
|
|
43
|
-
expandedStates: t.expandedStates
|
|
44
|
-
};
|
|
45
|
-
}
|
|
46
|
-
function I(e2, t = "", n = {}) {
|
|
47
|
-
return {
|
|
48
|
-
type: w,
|
|
49
|
-
breakContents: e2,
|
|
50
|
-
flatContents: t,
|
|
51
|
-
groupId: n.groupId
|
|
52
|
-
};
|
|
53
|
-
}
|
|
54
|
-
var yt = {
|
|
55
|
-
type: X
|
|
56
|
-
};
|
|
57
|
-
var Ot = {
|
|
58
|
-
type: S,
|
|
59
|
-
hard: true
|
|
60
|
-
};
|
|
61
|
-
var k = {
|
|
62
|
-
type: S
|
|
63
|
-
};
|
|
64
|
-
var p = {
|
|
65
|
-
type: S,
|
|
66
|
-
soft: true
|
|
67
|
-
};
|
|
68
|
-
var f = [Ot, yt];
|
|
69
|
-
function E(e2, t) {
|
|
70
|
-
let n = [];
|
|
71
|
-
for (let i = 0; i < t.length; i++) i !== 0 && n.push(e2), n.push(t[i]);
|
|
72
|
-
return n;
|
|
73
|
-
}
|
|
74
|
-
function H(e2) {
|
|
75
|
-
return (t, n, i) => {
|
|
76
|
-
let r = !!(i != null && i.backwards);
|
|
77
|
-
if (n === false) return false;
|
|
78
|
-
let {
|
|
79
|
-
length: s
|
|
80
|
-
} = t, a = n;
|
|
81
|
-
for (; a >= 0 && a < s; ) {
|
|
82
|
-
let u = t.charAt(a);
|
|
83
|
-
if (e2 instanceof RegExp) {
|
|
84
|
-
if (!e2.test(u)) return a;
|
|
85
|
-
} else if (!e2.includes(u)) return a;
|
|
86
|
-
r ? a-- : a++;
|
|
87
|
-
}
|
|
88
|
-
return a === -1 || a === s ? a : false;
|
|
89
|
-
};
|
|
90
|
-
}
|
|
91
|
-
var J = H(" ");
|
|
92
|
-
var ve = H(",; ");
|
|
93
|
-
var Le = H(/[^\n\r]/u);
|
|
94
|
-
function It(e2, t, n) {
|
|
95
|
-
let i = !!(n != null && n.backwards);
|
|
96
|
-
if (t === false) return false;
|
|
97
|
-
let r = e2.charAt(t);
|
|
98
|
-
if (i) {
|
|
99
|
-
if (e2.charAt(t - 1) === "\r" && r === `
|
|
100
|
-
`) return t - 2;
|
|
101
|
-
if (r === `
|
|
102
|
-
` || r === "\r" || r === "\u2028" || r === "\u2029") return t - 1;
|
|
103
|
-
} else {
|
|
104
|
-
if (r === "\r" && e2.charAt(t + 1) === `
|
|
105
|
-
`) return t + 2;
|
|
106
|
-
if (r === `
|
|
107
|
-
` || r === "\r" || r === "\u2028" || r === "\u2029") return t + 1;
|
|
108
|
-
}
|
|
109
|
-
return t;
|
|
110
|
-
}
|
|
111
|
-
var q = It;
|
|
112
|
-
function At(e2, t, n = {}) {
|
|
113
|
-
let i = J(e2, n.backwards ? t - 1 : t, n), r = q(e2, i, n);
|
|
114
|
-
return i !== r;
|
|
115
|
-
}
|
|
116
|
-
var be = At;
|
|
117
|
-
function Dt(e2, t) {
|
|
118
|
-
if (t === false) return false;
|
|
119
|
-
if (e2.charAt(t) === "/" && e2.charAt(t + 1) === "*") {
|
|
120
|
-
for (let n = t + 2; n < e2.length; ++n) if (e2.charAt(n) === "*" && e2.charAt(n + 1) === "/") return n + 2;
|
|
121
|
-
}
|
|
122
|
-
return t;
|
|
123
|
-
}
|
|
124
|
-
var Pe = Dt;
|
|
125
|
-
function gt(e2, t) {
|
|
126
|
-
return t === false ? false : e2.charAt(t) === "/" && e2.charAt(t + 1) === "/" ? Le(e2, t) : t;
|
|
127
|
-
}
|
|
128
|
-
var we = gt;
|
|
129
|
-
function kt(e2, t) {
|
|
130
|
-
let n = null, i = t;
|
|
131
|
-
for (; i !== n; ) n = i, i = ve(e2, i), i = Pe(e2, i), i = J(e2, i);
|
|
132
|
-
return i = we(e2, i), i = q(e2, i), i !== false && be(e2, i);
|
|
133
|
-
}
|
|
134
|
-
var Fe = kt;
|
|
135
|
-
function St(e2) {
|
|
136
|
-
return Array.isArray(e2) && e2.length > 0;
|
|
137
|
-
}
|
|
138
|
-
var pe = St;
|
|
139
|
-
var fe = class extends Error {
|
|
140
|
-
name = "UnexpectedNodeError";
|
|
141
|
-
constructor(t, n, i = "type") {
|
|
142
|
-
super(`Unexpected ${n} node ${i}: ${JSON.stringify(t[i])}.`), this.node = t;
|
|
143
|
-
}
|
|
144
|
-
};
|
|
145
|
-
var Be = fe;
|
|
146
|
-
var F = null;
|
|
147
|
-
function B(e2) {
|
|
148
|
-
if (F !== null && typeof F.property) {
|
|
149
|
-
let t = F;
|
|
150
|
-
return F = B.prototype = null, t;
|
|
151
|
-
}
|
|
152
|
-
return F = B.prototype = e2 ?? /* @__PURE__ */ Object.create(null), new B();
|
|
153
|
-
}
|
|
154
|
-
var Ct = 10;
|
|
155
|
-
for (let e2 = 0; e2 <= Ct; e2++) B();
|
|
156
|
-
function he(e2) {
|
|
157
|
-
return B(e2);
|
|
158
|
-
}
|
|
159
|
-
function Rt(e2, t = "type") {
|
|
160
|
-
he(e2);
|
|
161
|
-
function n(i) {
|
|
162
|
-
let r = i[t], s = e2[r];
|
|
163
|
-
if (!Array.isArray(s)) throw Object.assign(new Error(`Missing visitor keys for '${r}'.`), {
|
|
164
|
-
node: i
|
|
165
|
-
});
|
|
166
|
-
return s;
|
|
167
|
-
}
|
|
168
|
-
return n;
|
|
169
|
-
}
|
|
170
|
-
var Ue = Rt;
|
|
171
|
-
var Q = class {
|
|
172
|
-
constructor(t, n, i) {
|
|
173
|
-
this.start = t.start, this.end = n.end, this.startToken = t, this.endToken = n, this.source = i;
|
|
174
|
-
}
|
|
175
|
-
get [Symbol.toStringTag]() {
|
|
176
|
-
return "Location";
|
|
177
|
-
}
|
|
178
|
-
toJSON() {
|
|
179
|
-
return {
|
|
180
|
-
start: this.start,
|
|
181
|
-
end: this.end
|
|
182
|
-
};
|
|
183
|
-
}
|
|
184
|
-
};
|
|
185
|
-
var U = class {
|
|
186
|
-
constructor(t, n, i, r, s, a) {
|
|
187
|
-
this.kind = t, this.start = n, this.end = i, this.line = r, this.column = s, this.value = a, this.prev = null, this.next = null;
|
|
188
|
-
}
|
|
189
|
-
get [Symbol.toStringTag]() {
|
|
190
|
-
return "Token";
|
|
191
|
-
}
|
|
192
|
-
toJSON() {
|
|
193
|
-
return {
|
|
194
|
-
kind: this.kind,
|
|
195
|
-
value: this.value,
|
|
196
|
-
line: this.line,
|
|
197
|
-
column: this.column
|
|
198
|
-
};
|
|
199
|
-
}
|
|
200
|
-
};
|
|
201
|
-
var W = {
|
|
202
|
-
Name: [],
|
|
203
|
-
Document: ["definitions"],
|
|
204
|
-
OperationDefinition: ["name", "variableDefinitions", "directives", "selectionSet"],
|
|
205
|
-
VariableDefinition: ["variable", "type", "defaultValue", "directives"],
|
|
206
|
-
Variable: ["name"],
|
|
207
|
-
SelectionSet: ["selections"],
|
|
208
|
-
Field: ["alias", "name", "arguments", "directives", "selectionSet"],
|
|
209
|
-
Argument: ["name", "value"],
|
|
210
|
-
FragmentSpread: ["name", "directives"],
|
|
211
|
-
InlineFragment: ["typeCondition", "directives", "selectionSet"],
|
|
212
|
-
FragmentDefinition: ["name", "variableDefinitions", "typeCondition", "directives", "selectionSet"],
|
|
213
|
-
IntValue: [],
|
|
214
|
-
FloatValue: [],
|
|
215
|
-
StringValue: [],
|
|
216
|
-
BooleanValue: [],
|
|
217
|
-
NullValue: [],
|
|
218
|
-
EnumValue: [],
|
|
219
|
-
ListValue: ["values"],
|
|
220
|
-
ObjectValue: ["fields"],
|
|
221
|
-
ObjectField: ["name", "value"],
|
|
222
|
-
Directive: ["name", "arguments"],
|
|
223
|
-
NamedType: ["name"],
|
|
224
|
-
ListType: ["type"],
|
|
225
|
-
NonNullType: ["type"],
|
|
226
|
-
SchemaDefinition: ["description", "directives", "operationTypes"],
|
|
227
|
-
OperationTypeDefinition: ["type"],
|
|
228
|
-
ScalarTypeDefinition: ["description", "name", "directives"],
|
|
229
|
-
ObjectTypeDefinition: ["description", "name", "interfaces", "directives", "fields"],
|
|
230
|
-
FieldDefinition: ["description", "name", "arguments", "type", "directives"],
|
|
231
|
-
InputValueDefinition: ["description", "name", "type", "defaultValue", "directives"],
|
|
232
|
-
InterfaceTypeDefinition: ["description", "name", "interfaces", "directives", "fields"],
|
|
233
|
-
UnionTypeDefinition: ["description", "name", "directives", "types"],
|
|
234
|
-
EnumTypeDefinition: ["description", "name", "directives", "values"],
|
|
235
|
-
EnumValueDefinition: ["description", "name", "directives"],
|
|
236
|
-
InputObjectTypeDefinition: ["description", "name", "directives", "fields"],
|
|
237
|
-
DirectiveDefinition: ["description", "name", "arguments", "locations"],
|
|
238
|
-
SchemaExtension: ["directives", "operationTypes"],
|
|
239
|
-
ScalarTypeExtension: ["name", "directives"],
|
|
240
|
-
ObjectTypeExtension: ["name", "interfaces", "directives", "fields"],
|
|
241
|
-
InterfaceTypeExtension: ["name", "interfaces", "directives", "fields"],
|
|
242
|
-
UnionTypeExtension: ["name", "directives", "types"],
|
|
243
|
-
EnumTypeExtension: ["name", "directives", "values"],
|
|
244
|
-
InputObjectTypeExtension: ["name", "directives", "fields"]
|
|
245
|
-
};
|
|
246
|
-
new Set(Object.keys(W));
|
|
247
|
-
var C;
|
|
248
|
-
(function(e2) {
|
|
249
|
-
e2.QUERY = "query", e2.MUTATION = "mutation", e2.SUBSCRIPTION = "subscription";
|
|
250
|
-
})(C || (C = {}));
|
|
251
|
-
var vt = Ue(W, "kind");
|
|
252
|
-
var Me = vt;
|
|
253
|
-
function K(e2) {
|
|
254
|
-
return e2.loc.start;
|
|
255
|
-
}
|
|
256
|
-
function z(e2) {
|
|
257
|
-
return e2.loc.end;
|
|
258
|
-
}
|
|
259
|
-
var Ve = "format";
|
|
260
|
-
var Ye = /^\s*#[^\S\n]*@(?:noformat|noprettier)\s*(?:\n|$)/u;
|
|
261
|
-
var Ge = /^\s*#[^\S\n]*@(?:format|prettier)\s*(?:\n|$)/u;
|
|
262
|
-
function je(e2) {
|
|
263
|
-
return Ge.test(e2);
|
|
264
|
-
}
|
|
265
|
-
function $e(e2) {
|
|
266
|
-
return Ye.test(e2);
|
|
267
|
-
}
|
|
268
|
-
function Xe(e2) {
|
|
269
|
-
return `# @${Ve}
|
|
270
|
-
|
|
271
|
-
${e2}`;
|
|
272
|
-
}
|
|
273
|
-
function Lt(e2, t, n) {
|
|
274
|
-
let {
|
|
275
|
-
node: i
|
|
276
|
-
} = e2;
|
|
277
|
-
if (!i.description) return "";
|
|
278
|
-
let r = [n("description")];
|
|
279
|
-
return i.kind === "InputValueDefinition" && !i.description.block ? r.push(k) : r.push(f), r;
|
|
280
|
-
}
|
|
281
|
-
var D = Lt;
|
|
282
|
-
function bt(e2, t, n) {
|
|
283
|
-
let {
|
|
284
|
-
node: i
|
|
285
|
-
} = e2;
|
|
286
|
-
switch (i.kind) {
|
|
287
|
-
case "Document":
|
|
288
|
-
return [...E(f, g(e2, t, n, "definitions")), f];
|
|
289
|
-
case "OperationDefinition": {
|
|
290
|
-
let r = t.originalText[K(i)] !== "{", s = !!i.name;
|
|
291
|
-
return [r ? i.operation : "", r && s ? [" ", n("name")] : "", r && !s && pe(i.variableDefinitions) ? " " : "", He(e2, n), x(e2, n, i), !r && !s ? "" : " ", n("selectionSet")];
|
|
292
|
-
}
|
|
293
|
-
case "FragmentDefinition":
|
|
294
|
-
return ["fragment ", n("name"), He(e2, n), " on ", n("typeCondition"), x(e2, n, i), " ", n("selectionSet")];
|
|
295
|
-
case "SelectionSet":
|
|
296
|
-
return ["{", N([f, E(f, g(e2, t, n, "selections"))]), f, "}"];
|
|
297
|
-
case "Field":
|
|
298
|
-
return y([i.alias ? [n("alias"), ": "] : "", n("name"), i.arguments.length > 0 ? y(["(", N([p, E([I("", ", "), p], g(e2, t, n, "arguments"))]), p, ")"]) : "", x(e2, n, i), i.selectionSet ? " " : "", n("selectionSet")]);
|
|
299
|
-
case "Name":
|
|
300
|
-
return i.value;
|
|
301
|
-
case "StringValue":
|
|
302
|
-
if (i.block) {
|
|
303
|
-
let r = G(false, i.value, '"""', String.raw`\"""`).split(`
|
|
304
|
-
`);
|
|
305
|
-
return r.length === 1 && (r[0] = r[0].trim()), r.every((s) => s === "") && (r.length = 0), E(f, ['"""', ...r, '"""']);
|
|
306
|
-
}
|
|
307
|
-
return ['"', G(false, G(false, i.value, /["\\]/gu, String.raw`\$&`), `
|
|
308
|
-
`, String.raw`\n`), '"'];
|
|
309
|
-
case "IntValue":
|
|
310
|
-
case "FloatValue":
|
|
311
|
-
case "EnumValue":
|
|
312
|
-
return i.value;
|
|
313
|
-
case "BooleanValue":
|
|
314
|
-
return i.value ? "true" : "false";
|
|
315
|
-
case "NullValue":
|
|
316
|
-
return "null";
|
|
317
|
-
case "Variable":
|
|
318
|
-
return ["$", n("name")];
|
|
319
|
-
case "ListValue":
|
|
320
|
-
return y(["[", N([p, E([I("", ", "), p], e2.map(n, "values"))]), p, "]"]);
|
|
321
|
-
case "ObjectValue": {
|
|
322
|
-
let r = t.bracketSpacing && i.fields.length > 0 ? " " : "";
|
|
323
|
-
return y(["{", r, N([p, E([I("", ", "), p], e2.map(n, "fields"))]), p, I("", r), "}"]);
|
|
324
|
-
}
|
|
325
|
-
case "ObjectField":
|
|
326
|
-
case "Argument":
|
|
327
|
-
return [n("name"), ": ", n("value")];
|
|
328
|
-
case "Directive":
|
|
329
|
-
return ["@", n("name"), i.arguments.length > 0 ? y(["(", N([p, E([I("", ", "), p], g(e2, t, n, "arguments"))]), p, ")"]) : ""];
|
|
330
|
-
case "NamedType":
|
|
331
|
-
return n("name");
|
|
332
|
-
case "VariableDefinition":
|
|
333
|
-
return [n("variable"), ": ", n("type"), i.defaultValue ? [" = ", n("defaultValue")] : "", x(e2, n, i)];
|
|
334
|
-
case "ObjectTypeExtension":
|
|
335
|
-
case "ObjectTypeDefinition":
|
|
336
|
-
case "InputObjectTypeExtension":
|
|
337
|
-
case "InputObjectTypeDefinition":
|
|
338
|
-
case "InterfaceTypeExtension":
|
|
339
|
-
case "InterfaceTypeDefinition": {
|
|
340
|
-
let {
|
|
341
|
-
kind: r
|
|
342
|
-
} = i, s = [];
|
|
343
|
-
return r.endsWith("TypeDefinition") ? s.push(D(e2, t, n)) : s.push("extend "), r.startsWith("ObjectType") ? s.push("type") : r.startsWith("InputObjectType") ? s.push("input") : s.push("interface"), s.push(" ", n("name")), !r.startsWith("InputObjectType") && i.interfaces.length > 0 && s.push(" implements ", ...Ft(e2, t, n)), s.push(x(e2, n, i)), i.fields.length > 0 && s.push([" {", N([f, E(f, g(e2, t, n, "fields"))]), f, "}"]), s;
|
|
344
|
-
}
|
|
345
|
-
case "FieldDefinition":
|
|
346
|
-
return [D(e2, t, n), n("name"), i.arguments.length > 0 ? y(["(", N([p, E([I("", ", "), p], g(e2, t, n, "arguments"))]), p, ")"]) : "", ": ", n("type"), x(e2, n, i)];
|
|
347
|
-
case "DirectiveDefinition":
|
|
348
|
-
return [D(e2, t, n), "directive ", "@", n("name"), i.arguments.length > 0 ? y(["(", N([p, E([I("", ", "), p], g(e2, t, n, "arguments"))]), p, ")"]) : "", i.repeatable ? " repeatable" : "", " on ", ...E(" | ", e2.map(n, "locations"))];
|
|
349
|
-
case "EnumTypeExtension":
|
|
350
|
-
case "EnumTypeDefinition":
|
|
351
|
-
return [D(e2, t, n), i.kind === "EnumTypeExtension" ? "extend " : "", "enum ", n("name"), x(e2, n, i), i.values.length > 0 ? [" {", N([f, E(f, g(e2, t, n, "values"))]), f, "}"] : ""];
|
|
352
|
-
case "EnumValueDefinition":
|
|
353
|
-
return [D(e2, t, n), n("name"), x(e2, n, i)];
|
|
354
|
-
case "InputValueDefinition":
|
|
355
|
-
return [D(e2, t, n), n("name"), ": ", n("type"), i.defaultValue ? [" = ", n("defaultValue")] : "", x(e2, n, i)];
|
|
356
|
-
case "SchemaExtension":
|
|
357
|
-
return ["extend schema", x(e2, n, i), ...i.operationTypes.length > 0 ? [" {", N([f, E(f, g(e2, t, n, "operationTypes"))]), f, "}"] : []];
|
|
358
|
-
case "SchemaDefinition":
|
|
359
|
-
return [D(e2, t, n), "schema", x(e2, n, i), " {", i.operationTypes.length > 0 ? N([f, E(f, g(e2, t, n, "operationTypes"))]) : "", f, "}"];
|
|
360
|
-
case "OperationTypeDefinition":
|
|
361
|
-
return [i.operation, ": ", n("type")];
|
|
362
|
-
case "FragmentSpread":
|
|
363
|
-
return ["...", n("name"), x(e2, n, i)];
|
|
364
|
-
case "InlineFragment":
|
|
365
|
-
return ["...", i.typeCondition ? [" on ", n("typeCondition")] : "", x(e2, n, i), " ", n("selectionSet")];
|
|
366
|
-
case "UnionTypeExtension":
|
|
367
|
-
case "UnionTypeDefinition":
|
|
368
|
-
return y([D(e2, t, n), y([i.kind === "UnionTypeExtension" ? "extend " : "", "union ", n("name"), x(e2, n, i), i.types.length > 0 ? [" =", I("", " "), N([I([k, "| "]), E([k, "| "], e2.map(n, "types"))])] : ""])]);
|
|
369
|
-
case "ScalarTypeExtension":
|
|
370
|
-
case "ScalarTypeDefinition":
|
|
371
|
-
return [D(e2, t, n), i.kind === "ScalarTypeExtension" ? "extend " : "", "scalar ", n("name"), x(e2, n, i)];
|
|
372
|
-
case "NonNullType":
|
|
373
|
-
return [n("type"), "!"];
|
|
374
|
-
case "ListType":
|
|
375
|
-
return ["[", n("type"), "]"];
|
|
376
|
-
default:
|
|
377
|
-
throw new Be(i, "Graphql", "kind");
|
|
378
|
-
}
|
|
379
|
-
}
|
|
380
|
-
function x(e2, t, n) {
|
|
381
|
-
if (n.directives.length === 0) return "";
|
|
382
|
-
let i = E(k, e2.map(t, "directives"));
|
|
383
|
-
return n.kind === "FragmentDefinition" || n.kind === "OperationDefinition" ? y([k, i]) : [" ", y(N([p, i]))];
|
|
384
|
-
}
|
|
385
|
-
function g(e2, t, n, i) {
|
|
386
|
-
return e2.map(({
|
|
387
|
-
isLast: r,
|
|
388
|
-
node: s
|
|
389
|
-
}) => {
|
|
390
|
-
let a = n();
|
|
391
|
-
return !r && Fe(t.originalText, z(s)) ? [a, f] : a;
|
|
392
|
-
}, i);
|
|
393
|
-
}
|
|
394
|
-
function Pt(e2) {
|
|
395
|
-
return e2.kind !== "Comment";
|
|
396
|
-
}
|
|
397
|
-
function wt(e2) {
|
|
398
|
-
let t = e2.node;
|
|
399
|
-
if (t.kind === "Comment") return "#" + t.value.trimEnd();
|
|
400
|
-
throw new Error("Not a comment: " + JSON.stringify(t));
|
|
401
|
-
}
|
|
402
|
-
function Ft(e2, t, n) {
|
|
403
|
-
let {
|
|
404
|
-
node: i
|
|
405
|
-
} = e2, r = [], {
|
|
406
|
-
interfaces: s
|
|
407
|
-
} = i, a = e2.map(n, "interfaces");
|
|
408
|
-
for (let u = 0; u < s.length; u++) {
|
|
409
|
-
let l = s[u];
|
|
410
|
-
r.push(a[u]);
|
|
411
|
-
let T = s[u + 1];
|
|
412
|
-
if (T) {
|
|
413
|
-
let A = t.originalText.slice(l.loc.end, T.loc.start).includes("#");
|
|
414
|
-
r.push(" &", A ? k : " ");
|
|
415
|
-
}
|
|
416
|
-
}
|
|
417
|
-
return r;
|
|
418
|
-
}
|
|
419
|
-
function He(e2, t) {
|
|
420
|
-
let {
|
|
421
|
-
node: n
|
|
422
|
-
} = e2;
|
|
423
|
-
return pe(n.variableDefinitions) ? y(["(", N([p, E([I("", ", "), p], e2.map(t, "variableDefinitions"))]), p, ")"]) : "";
|
|
424
|
-
}
|
|
425
|
-
function Je(e2, t) {
|
|
426
|
-
e2.kind === "StringValue" && e2.block && !e2.value.includes(`
|
|
427
|
-
`) && (t.value = e2.value.trim());
|
|
428
|
-
}
|
|
429
|
-
Je.ignoredProperties = /* @__PURE__ */ new Set(["loc", "comments"]);
|
|
430
|
-
function Bt(e2) {
|
|
431
|
-
var n;
|
|
432
|
-
let {
|
|
433
|
-
node: t
|
|
434
|
-
} = e2;
|
|
435
|
-
return (n = t == null ? void 0 : t.comments) == null ? void 0 : n.some((i) => i.value.trim() === "prettier-ignore");
|
|
436
|
-
}
|
|
437
|
-
var Ut = {
|
|
438
|
-
print: bt,
|
|
439
|
-
massageAstNode: Je,
|
|
440
|
-
hasPrettierIgnore: Bt,
|
|
441
|
-
insertPragma: Xe,
|
|
442
|
-
printComment: wt,
|
|
443
|
-
canAttachComment: Pt,
|
|
444
|
-
getVisitorKeys: Me
|
|
445
|
-
};
|
|
446
|
-
var qe = Ut;
|
|
447
|
-
var Qe = [{
|
|
448
|
-
name: "GraphQL",
|
|
449
|
-
type: "data",
|
|
450
|
-
extensions: [".graphql", ".gql", ".graphqls"],
|
|
451
|
-
tmScope: "source.graphql",
|
|
452
|
-
aceMode: "text",
|
|
453
|
-
parsers: ["graphql"],
|
|
454
|
-
vscodeLanguageIds: ["graphql"],
|
|
455
|
-
linguistLanguageId: 139
|
|
456
|
-
}];
|
|
457
|
-
var We = {
|
|
458
|
-
bracketSpacing: {
|
|
459
|
-
category: "Common",
|
|
460
|
-
type: "boolean",
|
|
461
|
-
default: true,
|
|
462
|
-
description: "Print spaces between brackets.",
|
|
463
|
-
oppositeDescription: "Do not print spaces between brackets."
|
|
464
|
-
}};
|
|
465
|
-
var Mt = {
|
|
466
|
-
bracketSpacing: We.bracketSpacing
|
|
467
|
-
};
|
|
468
|
-
var Ke = Mt;
|
|
469
|
-
var _e = {};
|
|
470
|
-
xe(_e, {
|
|
471
|
-
graphql: () => ln
|
|
472
|
-
});
|
|
473
|
-
function ze(e2) {
|
|
474
|
-
return typeof e2 == "object" && e2 !== null;
|
|
475
|
-
}
|
|
476
|
-
function Ze(e2, t) {
|
|
477
|
-
throw new Error("Unexpected invariant triggered.");
|
|
478
|
-
}
|
|
479
|
-
var Vt = /\r\n|[\n\r]/g;
|
|
480
|
-
function M(e2, t) {
|
|
481
|
-
let n = 0, i = 1;
|
|
482
|
-
for (let r of e2.body.matchAll(Vt)) {
|
|
483
|
-
if (typeof r.index == "number" || Ze(), r.index >= t) break;
|
|
484
|
-
n = r.index + r[0].length, i += 1;
|
|
485
|
-
}
|
|
486
|
-
return {
|
|
487
|
-
line: i,
|
|
488
|
-
column: t + 1 - n
|
|
489
|
-
};
|
|
490
|
-
}
|
|
491
|
-
function tt(e2) {
|
|
492
|
-
return de(e2.source, M(e2.source, e2.start));
|
|
493
|
-
}
|
|
494
|
-
function de(e2, t) {
|
|
495
|
-
let n = e2.locationOffset.column - 1, i = "".padStart(n) + e2.body, r = t.line - 1, s = e2.locationOffset.line - 1, a = t.line + s, u = t.line === 1 ? n : 0, l = t.column + u, T = `${e2.name}:${a}:${l}
|
|
496
|
-
`, h = i.split(/\r\n|[\n\r]/g), A = h[r];
|
|
497
|
-
if (A.length > 120) {
|
|
498
|
-
let O = Math.floor(l / 80), ae = l % 80, _ = [];
|
|
499
|
-
for (let v = 0; v < A.length; v += 80) _.push(A.slice(v, v + 80));
|
|
500
|
-
return T + et([[`${a} |`, _[0]], ..._.slice(1, O + 1).map((v) => ["|", v]), ["|", "^".padStart(ae)], ["|", _[O + 1]]]);
|
|
501
|
-
}
|
|
502
|
-
return T + et([[`${a - 1} |`, h[r - 1]], [`${a} |`, A], ["|", "^".padStart(l)], [`${a + 1} |`, h[r + 1]]]);
|
|
503
|
-
}
|
|
504
|
-
function et(e2) {
|
|
505
|
-
let t = e2.filter(([i, r]) => r !== void 0), n = Math.max(...t.map(([i]) => i.length));
|
|
506
|
-
return t.map(([i, r]) => i.padStart(n) + (r ? " " + r : "")).join(`
|
|
507
|
-
`);
|
|
508
|
-
}
|
|
509
|
-
function Yt(e2) {
|
|
510
|
-
let t = e2[0];
|
|
511
|
-
return t == null || "kind" in t || "length" in t ? {
|
|
512
|
-
nodes: t,
|
|
513
|
-
source: e2[1],
|
|
514
|
-
positions: e2[2],
|
|
515
|
-
path: e2[3],
|
|
516
|
-
originalError: e2[4],
|
|
517
|
-
extensions: e2[5]
|
|
518
|
-
} : t;
|
|
519
|
-
}
|
|
520
|
-
var Z = class e extends Error {
|
|
521
|
-
constructor(t, ...n) {
|
|
522
|
-
var i, r, s;
|
|
523
|
-
let {
|
|
524
|
-
nodes: a,
|
|
525
|
-
source: u,
|
|
526
|
-
positions: l,
|
|
527
|
-
path: T,
|
|
528
|
-
originalError: h,
|
|
529
|
-
extensions: A
|
|
530
|
-
} = Yt(n);
|
|
531
|
-
super(t), this.name = "GraphQLError", this.path = T ?? void 0, this.originalError = h ?? void 0, this.nodes = nt(Array.isArray(a) ? a : a ? [a] : void 0);
|
|
532
|
-
let O = nt((i = this.nodes) === null || i === void 0 ? void 0 : i.map((_) => _.loc).filter((_) => _ != null));
|
|
533
|
-
this.source = u ?? (O == null || (r = O[0]) === null || r === void 0 ? void 0 : r.source), this.positions = l ?? (O == null ? void 0 : O.map((_) => _.start)), this.locations = l && u ? l.map((_) => M(u, _)) : O == null ? void 0 : O.map((_) => M(_.source, _.start));
|
|
534
|
-
let ae = ze(h == null ? void 0 : h.extensions) ? h == null ? void 0 : h.extensions : void 0;
|
|
535
|
-
this.extensions = (s = A ?? ae) !== null && s !== void 0 ? s : /* @__PURE__ */ Object.create(null), Object.defineProperties(this, {
|
|
536
|
-
message: {
|
|
537
|
-
writable: true,
|
|
538
|
-
enumerable: true
|
|
539
|
-
},
|
|
540
|
-
name: {
|
|
541
|
-
enumerable: false
|
|
542
|
-
},
|
|
543
|
-
nodes: {
|
|
544
|
-
enumerable: false
|
|
545
|
-
},
|
|
546
|
-
source: {
|
|
547
|
-
enumerable: false
|
|
548
|
-
},
|
|
549
|
-
positions: {
|
|
550
|
-
enumerable: false
|
|
551
|
-
},
|
|
552
|
-
originalError: {
|
|
553
|
-
enumerable: false
|
|
554
|
-
}
|
|
555
|
-
}), h != null && h.stack ? Object.defineProperty(this, "stack", {
|
|
556
|
-
value: h.stack,
|
|
557
|
-
writable: true,
|
|
558
|
-
configurable: true
|
|
559
|
-
}) : Error.captureStackTrace ? Error.captureStackTrace(this, e) : Object.defineProperty(this, "stack", {
|
|
560
|
-
value: Error().stack,
|
|
561
|
-
writable: true,
|
|
562
|
-
configurable: true
|
|
563
|
-
});
|
|
564
|
-
}
|
|
565
|
-
get [Symbol.toStringTag]() {
|
|
566
|
-
return "GraphQLError";
|
|
567
|
-
}
|
|
568
|
-
toString() {
|
|
569
|
-
let t = this.message;
|
|
570
|
-
if (this.nodes) for (let n of this.nodes) n.loc && (t += `
|
|
571
|
-
|
|
572
|
-
` + tt(n.loc));
|
|
573
|
-
else if (this.source && this.locations) for (let n of this.locations) t += `
|
|
574
|
-
|
|
575
|
-
` + de(this.source, n);
|
|
576
|
-
return t;
|
|
577
|
-
}
|
|
578
|
-
toJSON() {
|
|
579
|
-
let t = {
|
|
580
|
-
message: this.message
|
|
581
|
-
};
|
|
582
|
-
return this.locations != null && (t.locations = this.locations), this.path != null && (t.path = this.path), this.extensions != null && Object.keys(this.extensions).length > 0 && (t.extensions = this.extensions), t;
|
|
583
|
-
}
|
|
584
|
-
};
|
|
585
|
-
function nt(e2) {
|
|
586
|
-
return e2 === void 0 || e2.length === 0 ? void 0 : e2;
|
|
587
|
-
}
|
|
588
|
-
function d(e2, t, n) {
|
|
589
|
-
return new Z(`Syntax Error: ${n}`, {
|
|
590
|
-
source: e2,
|
|
591
|
-
positions: [t]
|
|
592
|
-
});
|
|
593
|
-
}
|
|
594
|
-
var ee;
|
|
595
|
-
(function(e2) {
|
|
596
|
-
e2.QUERY = "QUERY", e2.MUTATION = "MUTATION", e2.SUBSCRIPTION = "SUBSCRIPTION", e2.FIELD = "FIELD", e2.FRAGMENT_DEFINITION = "FRAGMENT_DEFINITION", e2.FRAGMENT_SPREAD = "FRAGMENT_SPREAD", e2.INLINE_FRAGMENT = "INLINE_FRAGMENT", e2.VARIABLE_DEFINITION = "VARIABLE_DEFINITION", e2.SCHEMA = "SCHEMA", e2.SCALAR = "SCALAR", e2.OBJECT = "OBJECT", e2.FIELD_DEFINITION = "FIELD_DEFINITION", e2.ARGUMENT_DEFINITION = "ARGUMENT_DEFINITION", e2.INTERFACE = "INTERFACE", e2.UNION = "UNION", e2.ENUM = "ENUM", e2.ENUM_VALUE = "ENUM_VALUE", e2.INPUT_OBJECT = "INPUT_OBJECT", e2.INPUT_FIELD_DEFINITION = "INPUT_FIELD_DEFINITION";
|
|
597
|
-
})(ee || (ee = {}));
|
|
598
|
-
var c;
|
|
599
|
-
(function(e2) {
|
|
600
|
-
e2.NAME = "Name", e2.DOCUMENT = "Document", e2.OPERATION_DEFINITION = "OperationDefinition", e2.VARIABLE_DEFINITION = "VariableDefinition", e2.SELECTION_SET = "SelectionSet", e2.FIELD = "Field", e2.ARGUMENT = "Argument", e2.FRAGMENT_SPREAD = "FragmentSpread", e2.INLINE_FRAGMENT = "InlineFragment", e2.FRAGMENT_DEFINITION = "FragmentDefinition", e2.VARIABLE = "Variable", e2.INT = "IntValue", e2.FLOAT = "FloatValue", e2.STRING = "StringValue", e2.BOOLEAN = "BooleanValue", e2.NULL = "NullValue", e2.ENUM = "EnumValue", e2.LIST = "ListValue", e2.OBJECT = "ObjectValue", e2.OBJECT_FIELD = "ObjectField", e2.DIRECTIVE = "Directive", e2.NAMED_TYPE = "NamedType", e2.LIST_TYPE = "ListType", e2.NON_NULL_TYPE = "NonNullType", e2.SCHEMA_DEFINITION = "SchemaDefinition", e2.OPERATION_TYPE_DEFINITION = "OperationTypeDefinition", e2.SCALAR_TYPE_DEFINITION = "ScalarTypeDefinition", e2.OBJECT_TYPE_DEFINITION = "ObjectTypeDefinition", e2.FIELD_DEFINITION = "FieldDefinition", e2.INPUT_VALUE_DEFINITION = "InputValueDefinition", e2.INTERFACE_TYPE_DEFINITION = "InterfaceTypeDefinition", e2.UNION_TYPE_DEFINITION = "UnionTypeDefinition", e2.ENUM_TYPE_DEFINITION = "EnumTypeDefinition", e2.ENUM_VALUE_DEFINITION = "EnumValueDefinition", e2.INPUT_OBJECT_TYPE_DEFINITION = "InputObjectTypeDefinition", e2.DIRECTIVE_DEFINITION = "DirectiveDefinition", e2.SCHEMA_EXTENSION = "SchemaExtension", e2.SCALAR_TYPE_EXTENSION = "ScalarTypeExtension", e2.OBJECT_TYPE_EXTENSION = "ObjectTypeExtension", e2.INTERFACE_TYPE_EXTENSION = "InterfaceTypeExtension", e2.UNION_TYPE_EXTENSION = "UnionTypeExtension", e2.ENUM_TYPE_EXTENSION = "EnumTypeExtension", e2.INPUT_OBJECT_TYPE_EXTENSION = "InputObjectTypeExtension";
|
|
601
|
-
})(c || (c = {}));
|
|
602
|
-
function rt(e2) {
|
|
603
|
-
return e2 === 9 || e2 === 32;
|
|
604
|
-
}
|
|
605
|
-
function b(e2) {
|
|
606
|
-
return e2 >= 48 && e2 <= 57;
|
|
607
|
-
}
|
|
608
|
-
function it(e2) {
|
|
609
|
-
return e2 >= 97 && e2 <= 122 || e2 >= 65 && e2 <= 90;
|
|
610
|
-
}
|
|
611
|
-
function me(e2) {
|
|
612
|
-
return it(e2) || e2 === 95;
|
|
613
|
-
}
|
|
614
|
-
function st(e2) {
|
|
615
|
-
return it(e2) || b(e2) || e2 === 95;
|
|
616
|
-
}
|
|
617
|
-
function ot(e2) {
|
|
618
|
-
var t;
|
|
619
|
-
let n = Number.MAX_SAFE_INTEGER, i = null, r = -1;
|
|
620
|
-
for (let a = 0; a < e2.length; ++a) {
|
|
621
|
-
var s;
|
|
622
|
-
let u = e2[a], l = Gt(u);
|
|
623
|
-
l !== u.length && (i = (s = i) !== null && s !== void 0 ? s : a, r = a, a !== 0 && l < n && (n = l));
|
|
624
|
-
}
|
|
625
|
-
return e2.map((a, u) => u === 0 ? a : a.slice(n)).slice((t = i) !== null && t !== void 0 ? t : 0, r + 1);
|
|
626
|
-
}
|
|
627
|
-
function Gt(e2) {
|
|
628
|
-
let t = 0;
|
|
629
|
-
for (; t < e2.length && rt(e2.charCodeAt(t)); ) ++t;
|
|
630
|
-
return t;
|
|
631
|
-
}
|
|
632
|
-
var o;
|
|
633
|
-
(function(e2) {
|
|
634
|
-
e2.SOF = "<SOF>", e2.EOF = "<EOF>", e2.BANG = "!", e2.DOLLAR = "$", e2.AMP = "&", e2.PAREN_L = "(", e2.PAREN_R = ")", e2.SPREAD = "...", e2.COLON = ":", e2.EQUALS = "=", e2.AT = "@", e2.BRACKET_L = "[", e2.BRACKET_R = "]", e2.BRACE_L = "{", e2.PIPE = "|", e2.BRACE_R = "}", e2.NAME = "Name", e2.INT = "Int", e2.FLOAT = "Float", e2.STRING = "String", e2.BLOCK_STRING = "BlockString", e2.COMMENT = "Comment";
|
|
635
|
-
})(o || (o = {}));
|
|
636
|
-
var te = class {
|
|
637
|
-
constructor(t) {
|
|
638
|
-
let n = new U(o.SOF, 0, 0, 0, 0);
|
|
639
|
-
this.source = t, this.lastToken = n, this.token = n, this.line = 1, this.lineStart = 0;
|
|
640
|
-
}
|
|
641
|
-
get [Symbol.toStringTag]() {
|
|
642
|
-
return "Lexer";
|
|
643
|
-
}
|
|
644
|
-
advance() {
|
|
645
|
-
return this.lastToken = this.token, this.token = this.lookahead();
|
|
646
|
-
}
|
|
647
|
-
lookahead() {
|
|
648
|
-
let t = this.token;
|
|
649
|
-
if (t.kind !== o.EOF) do
|
|
650
|
-
if (t.next) t = t.next;
|
|
651
|
-
else {
|
|
652
|
-
let n = jt(this, t.end);
|
|
653
|
-
t.next = n, n.prev = t, t = n;
|
|
654
|
-
}
|
|
655
|
-
while (t.kind === o.COMMENT);
|
|
656
|
-
return t;
|
|
657
|
-
}
|
|
658
|
-
};
|
|
659
|
-
function ct(e2) {
|
|
660
|
-
return e2 === o.BANG || e2 === o.DOLLAR || e2 === o.AMP || e2 === o.PAREN_L || e2 === o.PAREN_R || e2 === o.SPREAD || e2 === o.COLON || e2 === o.EQUALS || e2 === o.AT || e2 === o.BRACKET_L || e2 === o.BRACKET_R || e2 === o.BRACE_L || e2 === o.PIPE || e2 === o.BRACE_R;
|
|
661
|
-
}
|
|
662
|
-
function P(e2) {
|
|
663
|
-
return e2 >= 0 && e2 <= 55295 || e2 >= 57344 && e2 <= 1114111;
|
|
664
|
-
}
|
|
665
|
-
function ne(e2, t) {
|
|
666
|
-
return ut(e2.charCodeAt(t)) && lt(e2.charCodeAt(t + 1));
|
|
667
|
-
}
|
|
668
|
-
function ut(e2) {
|
|
669
|
-
return e2 >= 55296 && e2 <= 56319;
|
|
670
|
-
}
|
|
671
|
-
function lt(e2) {
|
|
672
|
-
return e2 >= 56320 && e2 <= 57343;
|
|
673
|
-
}
|
|
674
|
-
function R(e2, t) {
|
|
675
|
-
let n = e2.source.body.codePointAt(t);
|
|
676
|
-
if (n === void 0) return o.EOF;
|
|
677
|
-
if (n >= 32 && n <= 126) {
|
|
678
|
-
let i = String.fromCodePoint(n);
|
|
679
|
-
return i === '"' ? `'"'` : `"${i}"`;
|
|
680
|
-
}
|
|
681
|
-
return "U+" + n.toString(16).toUpperCase().padStart(4, "0");
|
|
682
|
-
}
|
|
683
|
-
function m(e2, t, n, i, r) {
|
|
684
|
-
let s = e2.line, a = 1 + n - e2.lineStart;
|
|
685
|
-
return new U(t, n, i, s, a, r);
|
|
686
|
-
}
|
|
687
|
-
function jt(e2, t) {
|
|
688
|
-
let n = e2.source.body, i = n.length, r = t;
|
|
689
|
-
for (; r < i; ) {
|
|
690
|
-
let s = n.charCodeAt(r);
|
|
691
|
-
switch (s) {
|
|
692
|
-
case 65279:
|
|
693
|
-
case 9:
|
|
694
|
-
case 32:
|
|
695
|
-
case 44:
|
|
696
|
-
++r;
|
|
697
|
-
continue;
|
|
698
|
-
case 10:
|
|
699
|
-
++r, ++e2.line, e2.lineStart = r;
|
|
700
|
-
continue;
|
|
701
|
-
case 13:
|
|
702
|
-
n.charCodeAt(r + 1) === 10 ? r += 2 : ++r, ++e2.line, e2.lineStart = r;
|
|
703
|
-
continue;
|
|
704
|
-
case 35:
|
|
705
|
-
return $t(e2, r);
|
|
706
|
-
case 33:
|
|
707
|
-
return m(e2, o.BANG, r, r + 1);
|
|
708
|
-
case 36:
|
|
709
|
-
return m(e2, o.DOLLAR, r, r + 1);
|
|
710
|
-
case 38:
|
|
711
|
-
return m(e2, o.AMP, r, r + 1);
|
|
712
|
-
case 40:
|
|
713
|
-
return m(e2, o.PAREN_L, r, r + 1);
|
|
714
|
-
case 41:
|
|
715
|
-
return m(e2, o.PAREN_R, r, r + 1);
|
|
716
|
-
case 46:
|
|
717
|
-
if (n.charCodeAt(r + 1) === 46 && n.charCodeAt(r + 2) === 46) return m(e2, o.SPREAD, r, r + 3);
|
|
718
|
-
break;
|
|
719
|
-
case 58:
|
|
720
|
-
return m(e2, o.COLON, r, r + 1);
|
|
721
|
-
case 61:
|
|
722
|
-
return m(e2, o.EQUALS, r, r + 1);
|
|
723
|
-
case 64:
|
|
724
|
-
return m(e2, o.AT, r, r + 1);
|
|
725
|
-
case 91:
|
|
726
|
-
return m(e2, o.BRACKET_L, r, r + 1);
|
|
727
|
-
case 93:
|
|
728
|
-
return m(e2, o.BRACKET_R, r, r + 1);
|
|
729
|
-
case 123:
|
|
730
|
-
return m(e2, o.BRACE_L, r, r + 1);
|
|
731
|
-
case 124:
|
|
732
|
-
return m(e2, o.PIPE, r, r + 1);
|
|
733
|
-
case 125:
|
|
734
|
-
return m(e2, o.BRACE_R, r, r + 1);
|
|
735
|
-
case 34:
|
|
736
|
-
return n.charCodeAt(r + 1) === 34 && n.charCodeAt(r + 2) === 34 ? Wt(e2, r) : Ht(e2, r);
|
|
737
|
-
}
|
|
738
|
-
if (b(s) || s === 45) return Xt(e2, r, s);
|
|
739
|
-
if (me(s)) return Kt(e2, r);
|
|
740
|
-
throw d(e2.source, r, s === 39 ? `Unexpected single quote character ('), did you mean to use a double quote (")?` : P(s) || ne(n, r) ? `Unexpected character: ${R(e2, r)}.` : `Invalid character: ${R(e2, r)}.`);
|
|
741
|
-
}
|
|
742
|
-
return m(e2, o.EOF, i, i);
|
|
743
|
-
}
|
|
744
|
-
function $t(e2, t) {
|
|
745
|
-
let n = e2.source.body, i = n.length, r = t + 1;
|
|
746
|
-
for (; r < i; ) {
|
|
747
|
-
let s = n.charCodeAt(r);
|
|
748
|
-
if (s === 10 || s === 13) break;
|
|
749
|
-
if (P(s)) ++r;
|
|
750
|
-
else if (ne(n, r)) r += 2;
|
|
751
|
-
else break;
|
|
752
|
-
}
|
|
753
|
-
return m(e2, o.COMMENT, t, r, n.slice(t + 1, r));
|
|
754
|
-
}
|
|
755
|
-
function Xt(e2, t, n) {
|
|
756
|
-
let i = e2.source.body, r = t, s = n, a = false;
|
|
757
|
-
if (s === 45 && (s = i.charCodeAt(++r)), s === 48) {
|
|
758
|
-
if (s = i.charCodeAt(++r), b(s)) throw d(e2.source, r, `Invalid number, unexpected digit after 0: ${R(e2, r)}.`);
|
|
759
|
-
} else r = Ee(e2, r, s), s = i.charCodeAt(r);
|
|
760
|
-
if (s === 46 && (a = true, s = i.charCodeAt(++r), r = Ee(e2, r, s), s = i.charCodeAt(r)), (s === 69 || s === 101) && (a = true, s = i.charCodeAt(++r), (s === 43 || s === 45) && (s = i.charCodeAt(++r)), r = Ee(e2, r, s), s = i.charCodeAt(r)), s === 46 || me(s)) throw d(e2.source, r, `Invalid number, expected digit but got: ${R(e2, r)}.`);
|
|
761
|
-
return m(e2, a ? o.FLOAT : o.INT, t, r, i.slice(t, r));
|
|
762
|
-
}
|
|
763
|
-
function Ee(e2, t, n) {
|
|
764
|
-
if (!b(n)) throw d(e2.source, t, `Invalid number, expected digit but got: ${R(e2, t)}.`);
|
|
765
|
-
let i = e2.source.body, r = t + 1;
|
|
766
|
-
for (; b(i.charCodeAt(r)); ) ++r;
|
|
767
|
-
return r;
|
|
768
|
-
}
|
|
769
|
-
function Ht(e2, t) {
|
|
770
|
-
let n = e2.source.body, i = n.length, r = t + 1, s = r, a = "";
|
|
771
|
-
for (; r < i; ) {
|
|
772
|
-
let u = n.charCodeAt(r);
|
|
773
|
-
if (u === 34) return a += n.slice(s, r), m(e2, o.STRING, t, r + 1, a);
|
|
774
|
-
if (u === 92) {
|
|
775
|
-
a += n.slice(s, r);
|
|
776
|
-
let l = n.charCodeAt(r + 1) === 117 ? n.charCodeAt(r + 2) === 123 ? Jt(e2, r) : qt(e2, r) : Qt(e2, r);
|
|
777
|
-
a += l.value, r += l.size, s = r;
|
|
778
|
-
continue;
|
|
779
|
-
}
|
|
780
|
-
if (u === 10 || u === 13) break;
|
|
781
|
-
if (P(u)) ++r;
|
|
782
|
-
else if (ne(n, r)) r += 2;
|
|
783
|
-
else throw d(e2.source, r, `Invalid character within String: ${R(e2, r)}.`);
|
|
784
|
-
}
|
|
785
|
-
throw d(e2.source, r, "Unterminated string.");
|
|
786
|
-
}
|
|
787
|
-
function Jt(e2, t) {
|
|
788
|
-
let n = e2.source.body, i = 0, r = 3;
|
|
789
|
-
for (; r < 12; ) {
|
|
790
|
-
let s = n.charCodeAt(t + r++);
|
|
791
|
-
if (s === 125) {
|
|
792
|
-
if (r < 5 || !P(i)) break;
|
|
793
|
-
return {
|
|
794
|
-
value: String.fromCodePoint(i),
|
|
795
|
-
size: r
|
|
796
|
-
};
|
|
797
|
-
}
|
|
798
|
-
if (i = i << 4 | V(s), i < 0) break;
|
|
799
|
-
}
|
|
800
|
-
throw d(e2.source, t, `Invalid Unicode escape sequence: "${n.slice(t, t + r)}".`);
|
|
801
|
-
}
|
|
802
|
-
function qt(e2, t) {
|
|
803
|
-
let n = e2.source.body, i = at(n, t + 2);
|
|
804
|
-
if (P(i)) return {
|
|
805
|
-
value: String.fromCodePoint(i),
|
|
806
|
-
size: 6
|
|
807
|
-
};
|
|
808
|
-
if (ut(i) && n.charCodeAt(t + 6) === 92 && n.charCodeAt(t + 7) === 117) {
|
|
809
|
-
let r = at(n, t + 8);
|
|
810
|
-
if (lt(r)) return {
|
|
811
|
-
value: String.fromCodePoint(i, r),
|
|
812
|
-
size: 12
|
|
813
|
-
};
|
|
814
|
-
}
|
|
815
|
-
throw d(e2.source, t, `Invalid Unicode escape sequence: "${n.slice(t, t + 6)}".`);
|
|
816
|
-
}
|
|
817
|
-
function at(e2, t) {
|
|
818
|
-
return V(e2.charCodeAt(t)) << 12 | V(e2.charCodeAt(t + 1)) << 8 | V(e2.charCodeAt(t + 2)) << 4 | V(e2.charCodeAt(t + 3));
|
|
819
|
-
}
|
|
820
|
-
function V(e2) {
|
|
821
|
-
return e2 >= 48 && e2 <= 57 ? e2 - 48 : e2 >= 65 && e2 <= 70 ? e2 - 55 : e2 >= 97 && e2 <= 102 ? e2 - 87 : -1;
|
|
822
|
-
}
|
|
823
|
-
function Qt(e2, t) {
|
|
824
|
-
let n = e2.source.body;
|
|
825
|
-
switch (n.charCodeAt(t + 1)) {
|
|
826
|
-
case 34:
|
|
827
|
-
return {
|
|
828
|
-
value: '"',
|
|
829
|
-
size: 2
|
|
830
|
-
};
|
|
831
|
-
case 92:
|
|
832
|
-
return {
|
|
833
|
-
value: "\\",
|
|
834
|
-
size: 2
|
|
835
|
-
};
|
|
836
|
-
case 47:
|
|
837
|
-
return {
|
|
838
|
-
value: "/",
|
|
839
|
-
size: 2
|
|
840
|
-
};
|
|
841
|
-
case 98:
|
|
842
|
-
return {
|
|
843
|
-
value: "\b",
|
|
844
|
-
size: 2
|
|
845
|
-
};
|
|
846
|
-
case 102:
|
|
847
|
-
return {
|
|
848
|
-
value: "\f",
|
|
849
|
-
size: 2
|
|
850
|
-
};
|
|
851
|
-
case 110:
|
|
852
|
-
return {
|
|
853
|
-
value: `
|
|
854
|
-
`,
|
|
855
|
-
size: 2
|
|
856
|
-
};
|
|
857
|
-
case 114:
|
|
858
|
-
return {
|
|
859
|
-
value: "\r",
|
|
860
|
-
size: 2
|
|
861
|
-
};
|
|
862
|
-
case 116:
|
|
863
|
-
return {
|
|
864
|
-
value: " ",
|
|
865
|
-
size: 2
|
|
866
|
-
};
|
|
867
|
-
}
|
|
868
|
-
throw d(e2.source, t, `Invalid character escape sequence: "${n.slice(t, t + 2)}".`);
|
|
869
|
-
}
|
|
870
|
-
function Wt(e2, t) {
|
|
871
|
-
let n = e2.source.body, i = n.length, r = e2.lineStart, s = t + 3, a = s, u = "", l = [];
|
|
872
|
-
for (; s < i; ) {
|
|
873
|
-
let T = n.charCodeAt(s);
|
|
874
|
-
if (T === 34 && n.charCodeAt(s + 1) === 34 && n.charCodeAt(s + 2) === 34) {
|
|
875
|
-
u += n.slice(a, s), l.push(u);
|
|
876
|
-
let h = m(e2, o.BLOCK_STRING, t, s + 3, ot(l).join(`
|
|
877
|
-
`));
|
|
878
|
-
return e2.line += l.length - 1, e2.lineStart = r, h;
|
|
879
|
-
}
|
|
880
|
-
if (T === 92 && n.charCodeAt(s + 1) === 34 && n.charCodeAt(s + 2) === 34 && n.charCodeAt(s + 3) === 34) {
|
|
881
|
-
u += n.slice(a, s), a = s + 1, s += 4;
|
|
882
|
-
continue;
|
|
883
|
-
}
|
|
884
|
-
if (T === 10 || T === 13) {
|
|
885
|
-
u += n.slice(a, s), l.push(u), T === 13 && n.charCodeAt(s + 1) === 10 ? s += 2 : ++s, u = "", a = s, r = s;
|
|
886
|
-
continue;
|
|
887
|
-
}
|
|
888
|
-
if (P(T)) ++s;
|
|
889
|
-
else if (ne(n, s)) s += 2;
|
|
890
|
-
else throw d(e2.source, s, `Invalid character within String: ${R(e2, s)}.`);
|
|
891
|
-
}
|
|
892
|
-
throw d(e2.source, s, "Unterminated string.");
|
|
893
|
-
}
|
|
894
|
-
function Kt(e2, t) {
|
|
895
|
-
let n = e2.source.body, i = n.length, r = t + 1;
|
|
896
|
-
for (; r < i; ) {
|
|
897
|
-
let s = n.charCodeAt(r);
|
|
898
|
-
if (st(s)) ++r;
|
|
899
|
-
else break;
|
|
900
|
-
}
|
|
901
|
-
return m(e2, o.NAME, t, r, n.slice(t, r));
|
|
902
|
-
}
|
|
903
|
-
function re(e2, t) {
|
|
904
|
-
throw new Error(t);
|
|
905
|
-
}
|
|
906
|
-
function ie(e2) {
|
|
907
|
-
return se(e2, []);
|
|
908
|
-
}
|
|
909
|
-
function se(e2, t) {
|
|
910
|
-
switch (typeof e2) {
|
|
911
|
-
case "string":
|
|
912
|
-
return JSON.stringify(e2);
|
|
913
|
-
case "function":
|
|
914
|
-
return e2.name ? `[function ${e2.name}]` : "[function]";
|
|
915
|
-
case "object":
|
|
916
|
-
return zt(e2, t);
|
|
917
|
-
default:
|
|
918
|
-
return String(e2);
|
|
919
|
-
}
|
|
920
|
-
}
|
|
921
|
-
function zt(e2, t) {
|
|
922
|
-
if (e2 === null) return "null";
|
|
923
|
-
if (t.includes(e2)) return "[Circular]";
|
|
924
|
-
let n = [...t, e2];
|
|
925
|
-
if (Zt(e2)) {
|
|
926
|
-
let i = e2.toJSON();
|
|
927
|
-
if (i !== e2) return typeof i == "string" ? i : se(i, n);
|
|
928
|
-
} else if (Array.isArray(e2)) return tn(e2, n);
|
|
929
|
-
return en(e2, n);
|
|
930
|
-
}
|
|
931
|
-
function Zt(e2) {
|
|
932
|
-
return typeof e2.toJSON == "function";
|
|
933
|
-
}
|
|
934
|
-
function en(e2, t) {
|
|
935
|
-
let n = Object.entries(e2);
|
|
936
|
-
return n.length === 0 ? "{}" : t.length > 2 ? "[" + nn(e2) + "]" : "{ " + n.map(([r, s]) => r + ": " + se(s, t)).join(", ") + " }";
|
|
937
|
-
}
|
|
938
|
-
function tn(e2, t) {
|
|
939
|
-
if (e2.length === 0) return "[]";
|
|
940
|
-
if (t.length > 2) return "[Array]";
|
|
941
|
-
let n = Math.min(10, e2.length), i = e2.length - n, r = [];
|
|
942
|
-
for (let s = 0; s < n; ++s) r.push(se(e2[s], t));
|
|
943
|
-
return i === 1 ? r.push("... 1 more item") : i > 1 && r.push(`... ${i} more items`), "[" + r.join(", ") + "]";
|
|
944
|
-
}
|
|
945
|
-
function nn(e2) {
|
|
946
|
-
let t = Object.prototype.toString.call(e2).replace(/^\[object /, "").replace(/]$/, "");
|
|
947
|
-
if (t === "Object" && typeof e2.constructor == "function") {
|
|
948
|
-
let n = e2.constructor.name;
|
|
949
|
-
if (typeof n == "string" && n !== "") return n;
|
|
950
|
-
}
|
|
951
|
-
return t;
|
|
952
|
-
}
|
|
953
|
-
var rn = globalThis.process && true;
|
|
954
|
-
var pt = rn ? function(t, n) {
|
|
955
|
-
return t instanceof n;
|
|
956
|
-
} : function(t, n) {
|
|
957
|
-
if (t instanceof n) return true;
|
|
958
|
-
if (typeof t == "object" && t !== null) {
|
|
959
|
-
var i;
|
|
960
|
-
let r = n.prototype[Symbol.toStringTag], s = Symbol.toStringTag in t ? t[Symbol.toStringTag] : (i = t.constructor) === null || i === void 0 ? void 0 : i.name;
|
|
961
|
-
if (r === s) {
|
|
962
|
-
let a = ie(t);
|
|
963
|
-
throw new Error(`Cannot use ${r} "${a}" from another module or realm.
|
|
964
|
-
|
|
965
|
-
Ensure that there is only one instance of "graphql" in the node_modules
|
|
966
|
-
directory. If different versions of "graphql" are the dependencies of other
|
|
967
|
-
relied on modules, use "resolutions" to ensure only one version is installed.
|
|
968
|
-
|
|
969
|
-
https://yarnpkg.com/en/docs/selective-version-resolutions
|
|
970
|
-
|
|
971
|
-
Duplicate "graphql" modules cannot be used at the same time since different
|
|
972
|
-
versions may have different capabilities and behavior. The data from one
|
|
973
|
-
version used in the function from another could produce confusing and
|
|
974
|
-
spurious results.`);
|
|
975
|
-
}
|
|
976
|
-
}
|
|
977
|
-
return false;
|
|
978
|
-
};
|
|
979
|
-
var Y = class {
|
|
980
|
-
constructor(t, n = "GraphQL request", i = {
|
|
981
|
-
line: 1,
|
|
982
|
-
column: 1
|
|
983
|
-
}) {
|
|
984
|
-
typeof t == "string" || re(false, `Body must be a string. Received: ${ie(t)}.`), this.body = t, this.name = n, this.locationOffset = i, this.locationOffset.line > 0 || re(false, "line in locationOffset is 1-indexed and must be positive."), this.locationOffset.column > 0 || re(false, "column in locationOffset is 1-indexed and must be positive.");
|
|
985
|
-
}
|
|
986
|
-
get [Symbol.toStringTag]() {
|
|
987
|
-
return "Source";
|
|
988
|
-
}
|
|
989
|
-
};
|
|
990
|
-
function ft(e2) {
|
|
991
|
-
return pt(e2, Y);
|
|
992
|
-
}
|
|
993
|
-
function ht(e2, t) {
|
|
994
|
-
let n = new Te(e2, t), i = n.parseDocument();
|
|
995
|
-
return Object.defineProperty(i, "tokenCount", {
|
|
996
|
-
enumerable: false,
|
|
997
|
-
value: n.tokenCount
|
|
998
|
-
}), i;
|
|
999
|
-
}
|
|
1000
|
-
var Te = class {
|
|
1001
|
-
constructor(t, n = {}) {
|
|
1002
|
-
let i = ft(t) ? t : new Y(t);
|
|
1003
|
-
this._lexer = new te(i), this._options = n, this._tokenCounter = 0;
|
|
1004
|
-
}
|
|
1005
|
-
get tokenCount() {
|
|
1006
|
-
return this._tokenCounter;
|
|
1007
|
-
}
|
|
1008
|
-
parseName() {
|
|
1009
|
-
let t = this.expectToken(o.NAME);
|
|
1010
|
-
return this.node(t, {
|
|
1011
|
-
kind: c.NAME,
|
|
1012
|
-
value: t.value
|
|
1013
|
-
});
|
|
1014
|
-
}
|
|
1015
|
-
parseDocument() {
|
|
1016
|
-
return this.node(this._lexer.token, {
|
|
1017
|
-
kind: c.DOCUMENT,
|
|
1018
|
-
definitions: this.many(o.SOF, this.parseDefinition, o.EOF)
|
|
1019
|
-
});
|
|
1020
|
-
}
|
|
1021
|
-
parseDefinition() {
|
|
1022
|
-
if (this.peek(o.BRACE_L)) return this.parseOperationDefinition();
|
|
1023
|
-
let t = this.peekDescription(), n = t ? this._lexer.lookahead() : this._lexer.token;
|
|
1024
|
-
if (n.kind === o.NAME) {
|
|
1025
|
-
switch (n.value) {
|
|
1026
|
-
case "schema":
|
|
1027
|
-
return this.parseSchemaDefinition();
|
|
1028
|
-
case "scalar":
|
|
1029
|
-
return this.parseScalarTypeDefinition();
|
|
1030
|
-
case "type":
|
|
1031
|
-
return this.parseObjectTypeDefinition();
|
|
1032
|
-
case "interface":
|
|
1033
|
-
return this.parseInterfaceTypeDefinition();
|
|
1034
|
-
case "union":
|
|
1035
|
-
return this.parseUnionTypeDefinition();
|
|
1036
|
-
case "enum":
|
|
1037
|
-
return this.parseEnumTypeDefinition();
|
|
1038
|
-
case "input":
|
|
1039
|
-
return this.parseInputObjectTypeDefinition();
|
|
1040
|
-
case "directive":
|
|
1041
|
-
return this.parseDirectiveDefinition();
|
|
1042
|
-
}
|
|
1043
|
-
if (t) throw d(this._lexer.source, this._lexer.token.start, "Unexpected description, descriptions are supported only on type definitions.");
|
|
1044
|
-
switch (n.value) {
|
|
1045
|
-
case "query":
|
|
1046
|
-
case "mutation":
|
|
1047
|
-
case "subscription":
|
|
1048
|
-
return this.parseOperationDefinition();
|
|
1049
|
-
case "fragment":
|
|
1050
|
-
return this.parseFragmentDefinition();
|
|
1051
|
-
case "extend":
|
|
1052
|
-
return this.parseTypeSystemExtension();
|
|
1053
|
-
}
|
|
1054
|
-
}
|
|
1055
|
-
throw this.unexpected(n);
|
|
1056
|
-
}
|
|
1057
|
-
parseOperationDefinition() {
|
|
1058
|
-
let t = this._lexer.token;
|
|
1059
|
-
if (this.peek(o.BRACE_L)) return this.node(t, {
|
|
1060
|
-
kind: c.OPERATION_DEFINITION,
|
|
1061
|
-
operation: C.QUERY,
|
|
1062
|
-
name: void 0,
|
|
1063
|
-
variableDefinitions: [],
|
|
1064
|
-
directives: [],
|
|
1065
|
-
selectionSet: this.parseSelectionSet()
|
|
1066
|
-
});
|
|
1067
|
-
let n = this.parseOperationType(), i;
|
|
1068
|
-
return this.peek(o.NAME) && (i = this.parseName()), this.node(t, {
|
|
1069
|
-
kind: c.OPERATION_DEFINITION,
|
|
1070
|
-
operation: n,
|
|
1071
|
-
name: i,
|
|
1072
|
-
variableDefinitions: this.parseVariableDefinitions(),
|
|
1073
|
-
directives: this.parseDirectives(false),
|
|
1074
|
-
selectionSet: this.parseSelectionSet()
|
|
1075
|
-
});
|
|
1076
|
-
}
|
|
1077
|
-
parseOperationType() {
|
|
1078
|
-
let t = this.expectToken(o.NAME);
|
|
1079
|
-
switch (t.value) {
|
|
1080
|
-
case "query":
|
|
1081
|
-
return C.QUERY;
|
|
1082
|
-
case "mutation":
|
|
1083
|
-
return C.MUTATION;
|
|
1084
|
-
case "subscription":
|
|
1085
|
-
return C.SUBSCRIPTION;
|
|
1086
|
-
}
|
|
1087
|
-
throw this.unexpected(t);
|
|
1088
|
-
}
|
|
1089
|
-
parseVariableDefinitions() {
|
|
1090
|
-
return this.optionalMany(o.PAREN_L, this.parseVariableDefinition, o.PAREN_R);
|
|
1091
|
-
}
|
|
1092
|
-
parseVariableDefinition() {
|
|
1093
|
-
return this.node(this._lexer.token, {
|
|
1094
|
-
kind: c.VARIABLE_DEFINITION,
|
|
1095
|
-
variable: this.parseVariable(),
|
|
1096
|
-
type: (this.expectToken(o.COLON), this.parseTypeReference()),
|
|
1097
|
-
defaultValue: this.expectOptionalToken(o.EQUALS) ? this.parseConstValueLiteral() : void 0,
|
|
1098
|
-
directives: this.parseConstDirectives()
|
|
1099
|
-
});
|
|
1100
|
-
}
|
|
1101
|
-
parseVariable() {
|
|
1102
|
-
let t = this._lexer.token;
|
|
1103
|
-
return this.expectToken(o.DOLLAR), this.node(t, {
|
|
1104
|
-
kind: c.VARIABLE,
|
|
1105
|
-
name: this.parseName()
|
|
1106
|
-
});
|
|
1107
|
-
}
|
|
1108
|
-
parseSelectionSet() {
|
|
1109
|
-
return this.node(this._lexer.token, {
|
|
1110
|
-
kind: c.SELECTION_SET,
|
|
1111
|
-
selections: this.many(o.BRACE_L, this.parseSelection, o.BRACE_R)
|
|
1112
|
-
});
|
|
1113
|
-
}
|
|
1114
|
-
parseSelection() {
|
|
1115
|
-
return this.peek(o.SPREAD) ? this.parseFragment() : this.parseField();
|
|
1116
|
-
}
|
|
1117
|
-
parseField() {
|
|
1118
|
-
let t = this._lexer.token, n = this.parseName(), i, r;
|
|
1119
|
-
return this.expectOptionalToken(o.COLON) ? (i = n, r = this.parseName()) : r = n, this.node(t, {
|
|
1120
|
-
kind: c.FIELD,
|
|
1121
|
-
alias: i,
|
|
1122
|
-
name: r,
|
|
1123
|
-
arguments: this.parseArguments(false),
|
|
1124
|
-
directives: this.parseDirectives(false),
|
|
1125
|
-
selectionSet: this.peek(o.BRACE_L) ? this.parseSelectionSet() : void 0
|
|
1126
|
-
});
|
|
1127
|
-
}
|
|
1128
|
-
parseArguments(t) {
|
|
1129
|
-
let n = t ? this.parseConstArgument : this.parseArgument;
|
|
1130
|
-
return this.optionalMany(o.PAREN_L, n, o.PAREN_R);
|
|
1131
|
-
}
|
|
1132
|
-
parseArgument(t = false) {
|
|
1133
|
-
let n = this._lexer.token, i = this.parseName();
|
|
1134
|
-
return this.expectToken(o.COLON), this.node(n, {
|
|
1135
|
-
kind: c.ARGUMENT,
|
|
1136
|
-
name: i,
|
|
1137
|
-
value: this.parseValueLiteral(t)
|
|
1138
|
-
});
|
|
1139
|
-
}
|
|
1140
|
-
parseConstArgument() {
|
|
1141
|
-
return this.parseArgument(true);
|
|
1142
|
-
}
|
|
1143
|
-
parseFragment() {
|
|
1144
|
-
let t = this._lexer.token;
|
|
1145
|
-
this.expectToken(o.SPREAD);
|
|
1146
|
-
let n = this.expectOptionalKeyword("on");
|
|
1147
|
-
return !n && this.peek(o.NAME) ? this.node(t, {
|
|
1148
|
-
kind: c.FRAGMENT_SPREAD,
|
|
1149
|
-
name: this.parseFragmentName(),
|
|
1150
|
-
directives: this.parseDirectives(false)
|
|
1151
|
-
}) : this.node(t, {
|
|
1152
|
-
kind: c.INLINE_FRAGMENT,
|
|
1153
|
-
typeCondition: n ? this.parseNamedType() : void 0,
|
|
1154
|
-
directives: this.parseDirectives(false),
|
|
1155
|
-
selectionSet: this.parseSelectionSet()
|
|
1156
|
-
});
|
|
1157
|
-
}
|
|
1158
|
-
parseFragmentDefinition() {
|
|
1159
|
-
let t = this._lexer.token;
|
|
1160
|
-
return this.expectKeyword("fragment"), this._options.allowLegacyFragmentVariables === true ? this.node(t, {
|
|
1161
|
-
kind: c.FRAGMENT_DEFINITION,
|
|
1162
|
-
name: this.parseFragmentName(),
|
|
1163
|
-
variableDefinitions: this.parseVariableDefinitions(),
|
|
1164
|
-
typeCondition: (this.expectKeyword("on"), this.parseNamedType()),
|
|
1165
|
-
directives: this.parseDirectives(false),
|
|
1166
|
-
selectionSet: this.parseSelectionSet()
|
|
1167
|
-
}) : this.node(t, {
|
|
1168
|
-
kind: c.FRAGMENT_DEFINITION,
|
|
1169
|
-
name: this.parseFragmentName(),
|
|
1170
|
-
typeCondition: (this.expectKeyword("on"), this.parseNamedType()),
|
|
1171
|
-
directives: this.parseDirectives(false),
|
|
1172
|
-
selectionSet: this.parseSelectionSet()
|
|
1173
|
-
});
|
|
1174
|
-
}
|
|
1175
|
-
parseFragmentName() {
|
|
1176
|
-
if (this._lexer.token.value === "on") throw this.unexpected();
|
|
1177
|
-
return this.parseName();
|
|
1178
|
-
}
|
|
1179
|
-
parseValueLiteral(t) {
|
|
1180
|
-
let n = this._lexer.token;
|
|
1181
|
-
switch (n.kind) {
|
|
1182
|
-
case o.BRACKET_L:
|
|
1183
|
-
return this.parseList(t);
|
|
1184
|
-
case o.BRACE_L:
|
|
1185
|
-
return this.parseObject(t);
|
|
1186
|
-
case o.INT:
|
|
1187
|
-
return this.advanceLexer(), this.node(n, {
|
|
1188
|
-
kind: c.INT,
|
|
1189
|
-
value: n.value
|
|
1190
|
-
});
|
|
1191
|
-
case o.FLOAT:
|
|
1192
|
-
return this.advanceLexer(), this.node(n, {
|
|
1193
|
-
kind: c.FLOAT,
|
|
1194
|
-
value: n.value
|
|
1195
|
-
});
|
|
1196
|
-
case o.STRING:
|
|
1197
|
-
case o.BLOCK_STRING:
|
|
1198
|
-
return this.parseStringLiteral();
|
|
1199
|
-
case o.NAME:
|
|
1200
|
-
switch (this.advanceLexer(), n.value) {
|
|
1201
|
-
case "true":
|
|
1202
|
-
return this.node(n, {
|
|
1203
|
-
kind: c.BOOLEAN,
|
|
1204
|
-
value: true
|
|
1205
|
-
});
|
|
1206
|
-
case "false":
|
|
1207
|
-
return this.node(n, {
|
|
1208
|
-
kind: c.BOOLEAN,
|
|
1209
|
-
value: false
|
|
1210
|
-
});
|
|
1211
|
-
case "null":
|
|
1212
|
-
return this.node(n, {
|
|
1213
|
-
kind: c.NULL
|
|
1214
|
-
});
|
|
1215
|
-
default:
|
|
1216
|
-
return this.node(n, {
|
|
1217
|
-
kind: c.ENUM,
|
|
1218
|
-
value: n.value
|
|
1219
|
-
});
|
|
1220
|
-
}
|
|
1221
|
-
case o.DOLLAR:
|
|
1222
|
-
if (t) if (this.expectToken(o.DOLLAR), this._lexer.token.kind === o.NAME) {
|
|
1223
|
-
let i = this._lexer.token.value;
|
|
1224
|
-
throw d(this._lexer.source, n.start, `Unexpected variable "$${i}" in constant value.`);
|
|
1225
|
-
} else throw this.unexpected(n);
|
|
1226
|
-
return this.parseVariable();
|
|
1227
|
-
default:
|
|
1228
|
-
throw this.unexpected();
|
|
1229
|
-
}
|
|
1230
|
-
}
|
|
1231
|
-
parseConstValueLiteral() {
|
|
1232
|
-
return this.parseValueLiteral(true);
|
|
1233
|
-
}
|
|
1234
|
-
parseStringLiteral() {
|
|
1235
|
-
let t = this._lexer.token;
|
|
1236
|
-
return this.advanceLexer(), this.node(t, {
|
|
1237
|
-
kind: c.STRING,
|
|
1238
|
-
value: t.value,
|
|
1239
|
-
block: t.kind === o.BLOCK_STRING
|
|
1240
|
-
});
|
|
1241
|
-
}
|
|
1242
|
-
parseList(t) {
|
|
1243
|
-
let n = () => this.parseValueLiteral(t);
|
|
1244
|
-
return this.node(this._lexer.token, {
|
|
1245
|
-
kind: c.LIST,
|
|
1246
|
-
values: this.any(o.BRACKET_L, n, o.BRACKET_R)
|
|
1247
|
-
});
|
|
1248
|
-
}
|
|
1249
|
-
parseObject(t) {
|
|
1250
|
-
let n = () => this.parseObjectField(t);
|
|
1251
|
-
return this.node(this._lexer.token, {
|
|
1252
|
-
kind: c.OBJECT,
|
|
1253
|
-
fields: this.any(o.BRACE_L, n, o.BRACE_R)
|
|
1254
|
-
});
|
|
1255
|
-
}
|
|
1256
|
-
parseObjectField(t) {
|
|
1257
|
-
let n = this._lexer.token, i = this.parseName();
|
|
1258
|
-
return this.expectToken(o.COLON), this.node(n, {
|
|
1259
|
-
kind: c.OBJECT_FIELD,
|
|
1260
|
-
name: i,
|
|
1261
|
-
value: this.parseValueLiteral(t)
|
|
1262
|
-
});
|
|
1263
|
-
}
|
|
1264
|
-
parseDirectives(t) {
|
|
1265
|
-
let n = [];
|
|
1266
|
-
for (; this.peek(o.AT); ) n.push(this.parseDirective(t));
|
|
1267
|
-
return n;
|
|
1268
|
-
}
|
|
1269
|
-
parseConstDirectives() {
|
|
1270
|
-
return this.parseDirectives(true);
|
|
1271
|
-
}
|
|
1272
|
-
parseDirective(t) {
|
|
1273
|
-
let n = this._lexer.token;
|
|
1274
|
-
return this.expectToken(o.AT), this.node(n, {
|
|
1275
|
-
kind: c.DIRECTIVE,
|
|
1276
|
-
name: this.parseName(),
|
|
1277
|
-
arguments: this.parseArguments(t)
|
|
1278
|
-
});
|
|
1279
|
-
}
|
|
1280
|
-
parseTypeReference() {
|
|
1281
|
-
let t = this._lexer.token, n;
|
|
1282
|
-
if (this.expectOptionalToken(o.BRACKET_L)) {
|
|
1283
|
-
let i = this.parseTypeReference();
|
|
1284
|
-
this.expectToken(o.BRACKET_R), n = this.node(t, {
|
|
1285
|
-
kind: c.LIST_TYPE,
|
|
1286
|
-
type: i
|
|
1287
|
-
});
|
|
1288
|
-
} else n = this.parseNamedType();
|
|
1289
|
-
return this.expectOptionalToken(o.BANG) ? this.node(t, {
|
|
1290
|
-
kind: c.NON_NULL_TYPE,
|
|
1291
|
-
type: n
|
|
1292
|
-
}) : n;
|
|
1293
|
-
}
|
|
1294
|
-
parseNamedType() {
|
|
1295
|
-
return this.node(this._lexer.token, {
|
|
1296
|
-
kind: c.NAMED_TYPE,
|
|
1297
|
-
name: this.parseName()
|
|
1298
|
-
});
|
|
1299
|
-
}
|
|
1300
|
-
peekDescription() {
|
|
1301
|
-
return this.peek(o.STRING) || this.peek(o.BLOCK_STRING);
|
|
1302
|
-
}
|
|
1303
|
-
parseDescription() {
|
|
1304
|
-
if (this.peekDescription()) return this.parseStringLiteral();
|
|
1305
|
-
}
|
|
1306
|
-
parseSchemaDefinition() {
|
|
1307
|
-
let t = this._lexer.token, n = this.parseDescription();
|
|
1308
|
-
this.expectKeyword("schema");
|
|
1309
|
-
let i = this.parseConstDirectives(), r = this.many(o.BRACE_L, this.parseOperationTypeDefinition, o.BRACE_R);
|
|
1310
|
-
return this.node(t, {
|
|
1311
|
-
kind: c.SCHEMA_DEFINITION,
|
|
1312
|
-
description: n,
|
|
1313
|
-
directives: i,
|
|
1314
|
-
operationTypes: r
|
|
1315
|
-
});
|
|
1316
|
-
}
|
|
1317
|
-
parseOperationTypeDefinition() {
|
|
1318
|
-
let t = this._lexer.token, n = this.parseOperationType();
|
|
1319
|
-
this.expectToken(o.COLON);
|
|
1320
|
-
let i = this.parseNamedType();
|
|
1321
|
-
return this.node(t, {
|
|
1322
|
-
kind: c.OPERATION_TYPE_DEFINITION,
|
|
1323
|
-
operation: n,
|
|
1324
|
-
type: i
|
|
1325
|
-
});
|
|
1326
|
-
}
|
|
1327
|
-
parseScalarTypeDefinition() {
|
|
1328
|
-
let t = this._lexer.token, n = this.parseDescription();
|
|
1329
|
-
this.expectKeyword("scalar");
|
|
1330
|
-
let i = this.parseName(), r = this.parseConstDirectives();
|
|
1331
|
-
return this.node(t, {
|
|
1332
|
-
kind: c.SCALAR_TYPE_DEFINITION,
|
|
1333
|
-
description: n,
|
|
1334
|
-
name: i,
|
|
1335
|
-
directives: r
|
|
1336
|
-
});
|
|
1337
|
-
}
|
|
1338
|
-
parseObjectTypeDefinition() {
|
|
1339
|
-
let t = this._lexer.token, n = this.parseDescription();
|
|
1340
|
-
this.expectKeyword("type");
|
|
1341
|
-
let i = this.parseName(), r = this.parseImplementsInterfaces(), s = this.parseConstDirectives(), a = this.parseFieldsDefinition();
|
|
1342
|
-
return this.node(t, {
|
|
1343
|
-
kind: c.OBJECT_TYPE_DEFINITION,
|
|
1344
|
-
description: n,
|
|
1345
|
-
name: i,
|
|
1346
|
-
interfaces: r,
|
|
1347
|
-
directives: s,
|
|
1348
|
-
fields: a
|
|
1349
|
-
});
|
|
1350
|
-
}
|
|
1351
|
-
parseImplementsInterfaces() {
|
|
1352
|
-
return this.expectOptionalKeyword("implements") ? this.delimitedMany(o.AMP, this.parseNamedType) : [];
|
|
1353
|
-
}
|
|
1354
|
-
parseFieldsDefinition() {
|
|
1355
|
-
return this.optionalMany(o.BRACE_L, this.parseFieldDefinition, o.BRACE_R);
|
|
1356
|
-
}
|
|
1357
|
-
parseFieldDefinition() {
|
|
1358
|
-
let t = this._lexer.token, n = this.parseDescription(), i = this.parseName(), r = this.parseArgumentDefs();
|
|
1359
|
-
this.expectToken(o.COLON);
|
|
1360
|
-
let s = this.parseTypeReference(), a = this.parseConstDirectives();
|
|
1361
|
-
return this.node(t, {
|
|
1362
|
-
kind: c.FIELD_DEFINITION,
|
|
1363
|
-
description: n,
|
|
1364
|
-
name: i,
|
|
1365
|
-
arguments: r,
|
|
1366
|
-
type: s,
|
|
1367
|
-
directives: a
|
|
1368
|
-
});
|
|
1369
|
-
}
|
|
1370
|
-
parseArgumentDefs() {
|
|
1371
|
-
return this.optionalMany(o.PAREN_L, this.parseInputValueDef, o.PAREN_R);
|
|
1372
|
-
}
|
|
1373
|
-
parseInputValueDef() {
|
|
1374
|
-
let t = this._lexer.token, n = this.parseDescription(), i = this.parseName();
|
|
1375
|
-
this.expectToken(o.COLON);
|
|
1376
|
-
let r = this.parseTypeReference(), s;
|
|
1377
|
-
this.expectOptionalToken(o.EQUALS) && (s = this.parseConstValueLiteral());
|
|
1378
|
-
let a = this.parseConstDirectives();
|
|
1379
|
-
return this.node(t, {
|
|
1380
|
-
kind: c.INPUT_VALUE_DEFINITION,
|
|
1381
|
-
description: n,
|
|
1382
|
-
name: i,
|
|
1383
|
-
type: r,
|
|
1384
|
-
defaultValue: s,
|
|
1385
|
-
directives: a
|
|
1386
|
-
});
|
|
1387
|
-
}
|
|
1388
|
-
parseInterfaceTypeDefinition() {
|
|
1389
|
-
let t = this._lexer.token, n = this.parseDescription();
|
|
1390
|
-
this.expectKeyword("interface");
|
|
1391
|
-
let i = this.parseName(), r = this.parseImplementsInterfaces(), s = this.parseConstDirectives(), a = this.parseFieldsDefinition();
|
|
1392
|
-
return this.node(t, {
|
|
1393
|
-
kind: c.INTERFACE_TYPE_DEFINITION,
|
|
1394
|
-
description: n,
|
|
1395
|
-
name: i,
|
|
1396
|
-
interfaces: r,
|
|
1397
|
-
directives: s,
|
|
1398
|
-
fields: a
|
|
1399
|
-
});
|
|
1400
|
-
}
|
|
1401
|
-
parseUnionTypeDefinition() {
|
|
1402
|
-
let t = this._lexer.token, n = this.parseDescription();
|
|
1403
|
-
this.expectKeyword("union");
|
|
1404
|
-
let i = this.parseName(), r = this.parseConstDirectives(), s = this.parseUnionMemberTypes();
|
|
1405
|
-
return this.node(t, {
|
|
1406
|
-
kind: c.UNION_TYPE_DEFINITION,
|
|
1407
|
-
description: n,
|
|
1408
|
-
name: i,
|
|
1409
|
-
directives: r,
|
|
1410
|
-
types: s
|
|
1411
|
-
});
|
|
1412
|
-
}
|
|
1413
|
-
parseUnionMemberTypes() {
|
|
1414
|
-
return this.expectOptionalToken(o.EQUALS) ? this.delimitedMany(o.PIPE, this.parseNamedType) : [];
|
|
1415
|
-
}
|
|
1416
|
-
parseEnumTypeDefinition() {
|
|
1417
|
-
let t = this._lexer.token, n = this.parseDescription();
|
|
1418
|
-
this.expectKeyword("enum");
|
|
1419
|
-
let i = this.parseName(), r = this.parseConstDirectives(), s = this.parseEnumValuesDefinition();
|
|
1420
|
-
return this.node(t, {
|
|
1421
|
-
kind: c.ENUM_TYPE_DEFINITION,
|
|
1422
|
-
description: n,
|
|
1423
|
-
name: i,
|
|
1424
|
-
directives: r,
|
|
1425
|
-
values: s
|
|
1426
|
-
});
|
|
1427
|
-
}
|
|
1428
|
-
parseEnumValuesDefinition() {
|
|
1429
|
-
return this.optionalMany(o.BRACE_L, this.parseEnumValueDefinition, o.BRACE_R);
|
|
1430
|
-
}
|
|
1431
|
-
parseEnumValueDefinition() {
|
|
1432
|
-
let t = this._lexer.token, n = this.parseDescription(), i = this.parseEnumValueName(), r = this.parseConstDirectives();
|
|
1433
|
-
return this.node(t, {
|
|
1434
|
-
kind: c.ENUM_VALUE_DEFINITION,
|
|
1435
|
-
description: n,
|
|
1436
|
-
name: i,
|
|
1437
|
-
directives: r
|
|
1438
|
-
});
|
|
1439
|
-
}
|
|
1440
|
-
parseEnumValueName() {
|
|
1441
|
-
if (this._lexer.token.value === "true" || this._lexer.token.value === "false" || this._lexer.token.value === "null") throw d(this._lexer.source, this._lexer.token.start, `${oe(this._lexer.token)} is reserved and cannot be used for an enum value.`);
|
|
1442
|
-
return this.parseName();
|
|
1443
|
-
}
|
|
1444
|
-
parseInputObjectTypeDefinition() {
|
|
1445
|
-
let t = this._lexer.token, n = this.parseDescription();
|
|
1446
|
-
this.expectKeyword("input");
|
|
1447
|
-
let i = this.parseName(), r = this.parseConstDirectives(), s = this.parseInputFieldsDefinition();
|
|
1448
|
-
return this.node(t, {
|
|
1449
|
-
kind: c.INPUT_OBJECT_TYPE_DEFINITION,
|
|
1450
|
-
description: n,
|
|
1451
|
-
name: i,
|
|
1452
|
-
directives: r,
|
|
1453
|
-
fields: s
|
|
1454
|
-
});
|
|
1455
|
-
}
|
|
1456
|
-
parseInputFieldsDefinition() {
|
|
1457
|
-
return this.optionalMany(o.BRACE_L, this.parseInputValueDef, o.BRACE_R);
|
|
1458
|
-
}
|
|
1459
|
-
parseTypeSystemExtension() {
|
|
1460
|
-
let t = this._lexer.lookahead();
|
|
1461
|
-
if (t.kind === o.NAME) switch (t.value) {
|
|
1462
|
-
case "schema":
|
|
1463
|
-
return this.parseSchemaExtension();
|
|
1464
|
-
case "scalar":
|
|
1465
|
-
return this.parseScalarTypeExtension();
|
|
1466
|
-
case "type":
|
|
1467
|
-
return this.parseObjectTypeExtension();
|
|
1468
|
-
case "interface":
|
|
1469
|
-
return this.parseInterfaceTypeExtension();
|
|
1470
|
-
case "union":
|
|
1471
|
-
return this.parseUnionTypeExtension();
|
|
1472
|
-
case "enum":
|
|
1473
|
-
return this.parseEnumTypeExtension();
|
|
1474
|
-
case "input":
|
|
1475
|
-
return this.parseInputObjectTypeExtension();
|
|
1476
|
-
}
|
|
1477
|
-
throw this.unexpected(t);
|
|
1478
|
-
}
|
|
1479
|
-
parseSchemaExtension() {
|
|
1480
|
-
let t = this._lexer.token;
|
|
1481
|
-
this.expectKeyword("extend"), this.expectKeyword("schema");
|
|
1482
|
-
let n = this.parseConstDirectives(), i = this.optionalMany(o.BRACE_L, this.parseOperationTypeDefinition, o.BRACE_R);
|
|
1483
|
-
if (n.length === 0 && i.length === 0) throw this.unexpected();
|
|
1484
|
-
return this.node(t, {
|
|
1485
|
-
kind: c.SCHEMA_EXTENSION,
|
|
1486
|
-
directives: n,
|
|
1487
|
-
operationTypes: i
|
|
1488
|
-
});
|
|
1489
|
-
}
|
|
1490
|
-
parseScalarTypeExtension() {
|
|
1491
|
-
let t = this._lexer.token;
|
|
1492
|
-
this.expectKeyword("extend"), this.expectKeyword("scalar");
|
|
1493
|
-
let n = this.parseName(), i = this.parseConstDirectives();
|
|
1494
|
-
if (i.length === 0) throw this.unexpected();
|
|
1495
|
-
return this.node(t, {
|
|
1496
|
-
kind: c.SCALAR_TYPE_EXTENSION,
|
|
1497
|
-
name: n,
|
|
1498
|
-
directives: i
|
|
1499
|
-
});
|
|
1500
|
-
}
|
|
1501
|
-
parseObjectTypeExtension() {
|
|
1502
|
-
let t = this._lexer.token;
|
|
1503
|
-
this.expectKeyword("extend"), this.expectKeyword("type");
|
|
1504
|
-
let n = this.parseName(), i = this.parseImplementsInterfaces(), r = this.parseConstDirectives(), s = this.parseFieldsDefinition();
|
|
1505
|
-
if (i.length === 0 && r.length === 0 && s.length === 0) throw this.unexpected();
|
|
1506
|
-
return this.node(t, {
|
|
1507
|
-
kind: c.OBJECT_TYPE_EXTENSION,
|
|
1508
|
-
name: n,
|
|
1509
|
-
interfaces: i,
|
|
1510
|
-
directives: r,
|
|
1511
|
-
fields: s
|
|
1512
|
-
});
|
|
1513
|
-
}
|
|
1514
|
-
parseInterfaceTypeExtension() {
|
|
1515
|
-
let t = this._lexer.token;
|
|
1516
|
-
this.expectKeyword("extend"), this.expectKeyword("interface");
|
|
1517
|
-
let n = this.parseName(), i = this.parseImplementsInterfaces(), r = this.parseConstDirectives(), s = this.parseFieldsDefinition();
|
|
1518
|
-
if (i.length === 0 && r.length === 0 && s.length === 0) throw this.unexpected();
|
|
1519
|
-
return this.node(t, {
|
|
1520
|
-
kind: c.INTERFACE_TYPE_EXTENSION,
|
|
1521
|
-
name: n,
|
|
1522
|
-
interfaces: i,
|
|
1523
|
-
directives: r,
|
|
1524
|
-
fields: s
|
|
1525
|
-
});
|
|
1526
|
-
}
|
|
1527
|
-
parseUnionTypeExtension() {
|
|
1528
|
-
let t = this._lexer.token;
|
|
1529
|
-
this.expectKeyword("extend"), this.expectKeyword("union");
|
|
1530
|
-
let n = this.parseName(), i = this.parseConstDirectives(), r = this.parseUnionMemberTypes();
|
|
1531
|
-
if (i.length === 0 && r.length === 0) throw this.unexpected();
|
|
1532
|
-
return this.node(t, {
|
|
1533
|
-
kind: c.UNION_TYPE_EXTENSION,
|
|
1534
|
-
name: n,
|
|
1535
|
-
directives: i,
|
|
1536
|
-
types: r
|
|
1537
|
-
});
|
|
1538
|
-
}
|
|
1539
|
-
parseEnumTypeExtension() {
|
|
1540
|
-
let t = this._lexer.token;
|
|
1541
|
-
this.expectKeyword("extend"), this.expectKeyword("enum");
|
|
1542
|
-
let n = this.parseName(), i = this.parseConstDirectives(), r = this.parseEnumValuesDefinition();
|
|
1543
|
-
if (i.length === 0 && r.length === 0) throw this.unexpected();
|
|
1544
|
-
return this.node(t, {
|
|
1545
|
-
kind: c.ENUM_TYPE_EXTENSION,
|
|
1546
|
-
name: n,
|
|
1547
|
-
directives: i,
|
|
1548
|
-
values: r
|
|
1549
|
-
});
|
|
1550
|
-
}
|
|
1551
|
-
parseInputObjectTypeExtension() {
|
|
1552
|
-
let t = this._lexer.token;
|
|
1553
|
-
this.expectKeyword("extend"), this.expectKeyword("input");
|
|
1554
|
-
let n = this.parseName(), i = this.parseConstDirectives(), r = this.parseInputFieldsDefinition();
|
|
1555
|
-
if (i.length === 0 && r.length === 0) throw this.unexpected();
|
|
1556
|
-
return this.node(t, {
|
|
1557
|
-
kind: c.INPUT_OBJECT_TYPE_EXTENSION,
|
|
1558
|
-
name: n,
|
|
1559
|
-
directives: i,
|
|
1560
|
-
fields: r
|
|
1561
|
-
});
|
|
1562
|
-
}
|
|
1563
|
-
parseDirectiveDefinition() {
|
|
1564
|
-
let t = this._lexer.token, n = this.parseDescription();
|
|
1565
|
-
this.expectKeyword("directive"), this.expectToken(o.AT);
|
|
1566
|
-
let i = this.parseName(), r = this.parseArgumentDefs(), s = this.expectOptionalKeyword("repeatable");
|
|
1567
|
-
this.expectKeyword("on");
|
|
1568
|
-
let a = this.parseDirectiveLocations();
|
|
1569
|
-
return this.node(t, {
|
|
1570
|
-
kind: c.DIRECTIVE_DEFINITION,
|
|
1571
|
-
description: n,
|
|
1572
|
-
name: i,
|
|
1573
|
-
arguments: r,
|
|
1574
|
-
repeatable: s,
|
|
1575
|
-
locations: a
|
|
1576
|
-
});
|
|
1577
|
-
}
|
|
1578
|
-
parseDirectiveLocations() {
|
|
1579
|
-
return this.delimitedMany(o.PIPE, this.parseDirectiveLocation);
|
|
1580
|
-
}
|
|
1581
|
-
parseDirectiveLocation() {
|
|
1582
|
-
let t = this._lexer.token, n = this.parseName();
|
|
1583
|
-
if (Object.prototype.hasOwnProperty.call(ee, n.value)) return n;
|
|
1584
|
-
throw this.unexpected(t);
|
|
1585
|
-
}
|
|
1586
|
-
node(t, n) {
|
|
1587
|
-
return this._options.noLocation !== true && (n.loc = new Q(t, this._lexer.lastToken, this._lexer.source)), n;
|
|
1588
|
-
}
|
|
1589
|
-
peek(t) {
|
|
1590
|
-
return this._lexer.token.kind === t;
|
|
1591
|
-
}
|
|
1592
|
-
expectToken(t) {
|
|
1593
|
-
let n = this._lexer.token;
|
|
1594
|
-
if (n.kind === t) return this.advanceLexer(), n;
|
|
1595
|
-
throw d(this._lexer.source, n.start, `Expected ${dt(t)}, found ${oe(n)}.`);
|
|
1596
|
-
}
|
|
1597
|
-
expectOptionalToken(t) {
|
|
1598
|
-
return this._lexer.token.kind === t ? (this.advanceLexer(), true) : false;
|
|
1599
|
-
}
|
|
1600
|
-
expectKeyword(t) {
|
|
1601
|
-
let n = this._lexer.token;
|
|
1602
|
-
if (n.kind === o.NAME && n.value === t) this.advanceLexer();
|
|
1603
|
-
else throw d(this._lexer.source, n.start, `Expected "${t}", found ${oe(n)}.`);
|
|
1604
|
-
}
|
|
1605
|
-
expectOptionalKeyword(t) {
|
|
1606
|
-
let n = this._lexer.token;
|
|
1607
|
-
return n.kind === o.NAME && n.value === t ? (this.advanceLexer(), true) : false;
|
|
1608
|
-
}
|
|
1609
|
-
unexpected(t) {
|
|
1610
|
-
let n = t ?? this._lexer.token;
|
|
1611
|
-
return d(this._lexer.source, n.start, `Unexpected ${oe(n)}.`);
|
|
1612
|
-
}
|
|
1613
|
-
any(t, n, i) {
|
|
1614
|
-
this.expectToken(t);
|
|
1615
|
-
let r = [];
|
|
1616
|
-
for (; !this.expectOptionalToken(i); ) r.push(n.call(this));
|
|
1617
|
-
return r;
|
|
1618
|
-
}
|
|
1619
|
-
optionalMany(t, n, i) {
|
|
1620
|
-
if (this.expectOptionalToken(t)) {
|
|
1621
|
-
let r = [];
|
|
1622
|
-
do
|
|
1623
|
-
r.push(n.call(this));
|
|
1624
|
-
while (!this.expectOptionalToken(i));
|
|
1625
|
-
return r;
|
|
1626
|
-
}
|
|
1627
|
-
return [];
|
|
1628
|
-
}
|
|
1629
|
-
many(t, n, i) {
|
|
1630
|
-
this.expectToken(t);
|
|
1631
|
-
let r = [];
|
|
1632
|
-
do
|
|
1633
|
-
r.push(n.call(this));
|
|
1634
|
-
while (!this.expectOptionalToken(i));
|
|
1635
|
-
return r;
|
|
1636
|
-
}
|
|
1637
|
-
delimitedMany(t, n) {
|
|
1638
|
-
this.expectOptionalToken(t);
|
|
1639
|
-
let i = [];
|
|
1640
|
-
do
|
|
1641
|
-
i.push(n.call(this));
|
|
1642
|
-
while (this.expectOptionalToken(t));
|
|
1643
|
-
return i;
|
|
1644
|
-
}
|
|
1645
|
-
advanceLexer() {
|
|
1646
|
-
let {
|
|
1647
|
-
maxTokens: t
|
|
1648
|
-
} = this._options, n = this._lexer.advance();
|
|
1649
|
-
if (n.kind !== o.EOF && (++this._tokenCounter, t !== void 0 && this._tokenCounter > t)) throw d(this._lexer.source, n.start, `Document contains more that ${t} tokens. Parsing aborted.`);
|
|
1650
|
-
}
|
|
1651
|
-
};
|
|
1652
|
-
function oe(e2) {
|
|
1653
|
-
let t = e2.value;
|
|
1654
|
-
return dt(e2.kind) + (t != null ? ` "${t}"` : "");
|
|
1655
|
-
}
|
|
1656
|
-
function dt(e2) {
|
|
1657
|
-
return ct(e2) ? `"${e2}"` : e2;
|
|
1658
|
-
}
|
|
1659
|
-
function sn(e2, t) {
|
|
1660
|
-
let n = new SyntaxError(e2 + " (" + t.loc.start.line + ":" + t.loc.start.column + ")");
|
|
1661
|
-
return Object.assign(n, t);
|
|
1662
|
-
}
|
|
1663
|
-
var mt = sn;
|
|
1664
|
-
function on(e2) {
|
|
1665
|
-
let t = [], {
|
|
1666
|
-
startToken: n,
|
|
1667
|
-
endToken: i
|
|
1668
|
-
} = e2.loc;
|
|
1669
|
-
for (let r = n; r !== i; r = r.next) r.kind === "Comment" && t.push({
|
|
1670
|
-
...r,
|
|
1671
|
-
loc: {
|
|
1672
|
-
start: r.start,
|
|
1673
|
-
end: r.end
|
|
1674
|
-
}
|
|
1675
|
-
});
|
|
1676
|
-
return t;
|
|
1677
|
-
}
|
|
1678
|
-
var an = {
|
|
1679
|
-
allowLegacyFragmentVariables: true
|
|
1680
|
-
};
|
|
1681
|
-
function cn(e2) {
|
|
1682
|
-
if ((e2 == null ? void 0 : e2.name) === "GraphQLError") {
|
|
1683
|
-
let {
|
|
1684
|
-
message: t,
|
|
1685
|
-
locations: [n]
|
|
1686
|
-
} = e2;
|
|
1687
|
-
return mt(t, {
|
|
1688
|
-
loc: {
|
|
1689
|
-
start: n
|
|
1690
|
-
},
|
|
1691
|
-
cause: e2
|
|
1692
|
-
});
|
|
1693
|
-
}
|
|
1694
|
-
return e2;
|
|
1695
|
-
}
|
|
1696
|
-
function un(e2) {
|
|
1697
|
-
let t;
|
|
1698
|
-
try {
|
|
1699
|
-
t = ht(e2, an);
|
|
1700
|
-
} catch (n) {
|
|
1701
|
-
throw cn(n);
|
|
1702
|
-
}
|
|
1703
|
-
return t.comments = on(t), t;
|
|
1704
|
-
}
|
|
1705
|
-
var ln = {
|
|
1706
|
-
parse: un,
|
|
1707
|
-
astFormat: "graphql",
|
|
1708
|
-
hasPragma: je,
|
|
1709
|
-
hasIgnorePragma: $e,
|
|
1710
|
-
locStart: K,
|
|
1711
|
-
locEnd: z
|
|
1712
|
-
};
|
|
1713
|
-
var pn = {
|
|
1714
|
-
graphql: qe
|
|
1715
|
-
};
|
|
1716
|
-
var Ui = Ne;
|
|
1717
|
-
|
|
1718
|
-
export { Ui as default, Qe as languages, Ke as options, _e as parsers, pn as printers };
|
|
1719
|
-
//# sourceMappingURL=graphql-QF7PMC3R.js.map
|
|
1720
|
-
//# sourceMappingURL=graphql-QF7PMC3R.js.map
|