odm-client 0.0.1 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/mongodb-client.d.ts +9 -7
- package/dist/client/mongodb-index.d.ts +2 -2
- package/dist/cloudbase-index.cjs +1 -1
- package/dist/cloudbase-index.js +66 -56
- package/dist/decorators/index.d.ts +7 -0
- package/dist/deps/_commonjsHelpers-KaVRbhAgd4-5pgl5rkso.js +28 -0
- package/dist/deps/_commonjsHelpers-KaVRbhAgd4-r4alsdeis.js +1 -0
- package/dist/deps/acorn-DYjaOAP8Gz-29lcn4w0b.js +16 -0
- package/dist/deps/acorn-DYjaOAP8Gz-gyct7wut5.js +3005 -0
- package/dist/deps/angular-1bp1uAROl4-bz9b1prej.js +2533 -0
- package/dist/deps/angular-1bp1uAROl4-z3xa5q2km.js +3 -0
- package/dist/deps/babel-_P9jsDBVVy-ipfz7c01i.js +7217 -0
- package/dist/deps/babel-_P9jsDBVVy-kjb76ly0t.js +15 -0
- package/dist/deps/estree-Q-oFBmJEml-u09jq3zep.js +44 -0
- package/dist/deps/estree-Q-oFBmJEml-w9z7zljkf.js +4528 -0
- package/dist/deps/flow-j77MFvzLrn-kf5rv1yl1.js +20 -0
- package/dist/deps/flow-j77MFvzLrn-l8rtylmcl.js +27411 -0
- package/dist/deps/glimmer-ewQPb5nTUl-5p9240228.js +37 -0
- package/dist/deps/glimmer-ewQPb5nTUl-xsdp5ejns.js +2703 -0
- package/dist/deps/graphql-8EXR1_taGG-a4my17998.js +28 -0
- package/dist/deps/graphql-8EXR1_taGG-iqqy1396h.js +1221 -0
- package/dist/deps/html-dGbiW_CFWL-inuu6eaf1.js +25 -0
- package/dist/deps/html-dGbiW_CFWL-mq1pmq7je.js +2791 -0
- package/dist/deps/markdown-vAYIRClyWZ-el25zjeip.js +62 -0
- package/dist/deps/markdown-vAYIRClyWZ-f8svm8az3.js +3190 -0
- package/dist/deps/meriyah-d5_qqf88x--ntk7vora9.js +5 -0
- package/dist/deps/meriyah-d5_qqf88x--tbqv1nv9b.js +2645 -0
- package/dist/deps/postcss-Vz5bDQ3hJO-if8y8k5xi.js +4739 -0
- package/dist/deps/postcss-Vz5bDQ3hJO-rmv75nb4j.js +61 -0
- package/dist/deps/typescript-2hCq12HCbJ-n0w7fscoa.js +21 -0
- package/dist/deps/typescript-2hCq12HCbJ-yusfiayfb.js +12947 -0
- package/dist/deps/yaml-I5o0CrcX7J-ibk1yd293.js +4079 -0
- package/dist/deps/yaml-I5o0CrcX7J-xyc4o9p22.js +159 -0
- package/dist/generator/cloudbase-init-generator.d.ts +8 -0
- package/dist/generator/enum-generator.d.ts +3 -0
- package/dist/generator/index.d.ts +6 -0
- package/dist/generator/mongodb-init-generator.d.ts +9 -0
- package/dist/generator/parser.d.ts +21 -0
- package/dist/generator/table-generator.d.ts +3 -0
- package/dist/generator/type-generator.d.ts +6 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +6 -29
- package/dist/index2.cjs +42770 -0
- package/dist/index2.js +242204 -0
- package/dist/mongodb-index.cjs +11 -11
- package/dist/mongodb-index.js +2103 -2106
- package/dist/types/index.d.ts +14 -0
- package/package.json +3 -1
- /package/dist/deps/{query-builder-h6B2D2BCoQ-4ajykqs3m.js → query-builder-h6B2D2BCoQ-f5zcr506g.js} +0 -0
- /package/dist/deps/{query-builder-h6B2D2BCoQ-wqso6i87o.js → query-builder-h6B2D2BCoQ-iw94q0kiz.js} +0 -0
|
@@ -0,0 +1,1221 @@
|
|
|
1
|
+
var Ie = Object.defineProperty;
|
|
2
|
+
var ve = (e, t, i) => t in e ? Ie(e, t, { enumerable: !0, configurable: !0, writable: !0, value: i }) : e[t] = i;
|
|
3
|
+
var J = (e, t, i) => ve(e, typeof t != "symbol" ? t + "" : t, i);
|
|
4
|
+
var ye = Object.defineProperty, Z = (e, t) => {
|
|
5
|
+
for (var i in t) ye(e, i, { get: t[i], enumerable: !0 });
|
|
6
|
+
}, Oe = {};
|
|
7
|
+
Z(Oe, { languages: () => Tt, options: () => vt, parsers: () => ce, printers: () => si });
|
|
8
|
+
var De = (e, t) => (i, n, ...r) => i | 1 && n == null ? void 0 : (t.call(n) ?? n[e]).apply(n, r), Ae = String.prototype.replaceAll ?? function(e, t) {
|
|
9
|
+
return e.global ? this.replace(e, t) : this.split(e).join(t);
|
|
10
|
+
}, xe = De("replaceAll", function() {
|
|
11
|
+
if (typeof this == "string") return Ae;
|
|
12
|
+
}), B = xe, _e = () => {
|
|
13
|
+
}, ke = _e, ge = "indent", Ce = "group", Se = "if-break", Y = "line", Re = "break-parent", be = ke;
|
|
14
|
+
function v(e) {
|
|
15
|
+
return { type: ge, contents: e };
|
|
16
|
+
}
|
|
17
|
+
var Le = { type: Re };
|
|
18
|
+
function O(e, t = {}) {
|
|
19
|
+
return be(t.expandedStates), { type: Ce, id: t.id, contents: e, break: !!t.shouldBreak, expandedStates: t.expandedStates };
|
|
20
|
+
}
|
|
21
|
+
function x(e, t = "", i = {}) {
|
|
22
|
+
return { type: Se, breakContents: e, flatContents: t, groupId: i.groupId };
|
|
23
|
+
}
|
|
24
|
+
function m(e, t) {
|
|
25
|
+
let i = [];
|
|
26
|
+
for (let n = 0; n < t.length; n++) n !== 0 && i.push(e), i.push(t[n]);
|
|
27
|
+
return i;
|
|
28
|
+
}
|
|
29
|
+
var S = { type: Y }, p = { type: Y, soft: !0 }, Fe = { type: Y, hard: !0 }, h = [Fe, Le];
|
|
30
|
+
function q(e) {
|
|
31
|
+
return (t, i, n) => {
|
|
32
|
+
let r = !!(n != null && n.backwards);
|
|
33
|
+
if (i === !1) return !1;
|
|
34
|
+
let { length: s } = t, o = i;
|
|
35
|
+
for (; o >= 0 && o < s; ) {
|
|
36
|
+
let c = t.charAt(o);
|
|
37
|
+
if (e instanceof RegExp) {
|
|
38
|
+
if (!e.test(c)) return o;
|
|
39
|
+
} else if (!e.includes(c)) return o;
|
|
40
|
+
r ? o-- : o++;
|
|
41
|
+
}
|
|
42
|
+
return o === -1 || o === s ? o : !1;
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
var ee = q(" "), we = q(",; "), Pe = q(/[^\n\r]/u), Q = (e) => e === `
|
|
46
|
+
` || e === "\r" || e === "\u2028" || e === "\u2029";
|
|
47
|
+
function Me(e, t, i) {
|
|
48
|
+
let n = !!(i != null && i.backwards);
|
|
49
|
+
if (t === !1) return !1;
|
|
50
|
+
let r = e.charAt(t);
|
|
51
|
+
if (n) {
|
|
52
|
+
if (e.charAt(t - 1) === "\r" && r === `
|
|
53
|
+
`) return t - 2;
|
|
54
|
+
if (Q(r)) return t - 1;
|
|
55
|
+
} else {
|
|
56
|
+
if (r === "\r" && e.charAt(t + 1) === `
|
|
57
|
+
`) return t + 2;
|
|
58
|
+
if (Q(r)) return t + 1;
|
|
59
|
+
}
|
|
60
|
+
return t;
|
|
61
|
+
}
|
|
62
|
+
var te = Me;
|
|
63
|
+
function Ue(e, t, i = {}) {
|
|
64
|
+
let n = ee(e, i.backwards ? t - 1 : t, i), r = te(e, n, i);
|
|
65
|
+
return n !== r;
|
|
66
|
+
}
|
|
67
|
+
var Ve = Ue;
|
|
68
|
+
function Be(e, t) {
|
|
69
|
+
if (t === !1) return !1;
|
|
70
|
+
if (e.charAt(t) === "/" && e.charAt(t + 1) === "*") {
|
|
71
|
+
for (let i = t + 2; i < e.length; ++i) if (e.charAt(i) === "*" && e.charAt(i + 1) === "/") return i + 2;
|
|
72
|
+
}
|
|
73
|
+
return t;
|
|
74
|
+
}
|
|
75
|
+
var je = Be;
|
|
76
|
+
function Ke(e, t) {
|
|
77
|
+
return t === !1 ? !1 : e.charAt(t) === "/" && e.charAt(t + 1) === "/" ? Pe(e, t) : t;
|
|
78
|
+
}
|
|
79
|
+
var $e = Ke;
|
|
80
|
+
function Ge(e, t) {
|
|
81
|
+
let i = null, n = t;
|
|
82
|
+
for (; n !== i; ) i = n, n = we(e, n), n = je(e, n), n = ee(e, n);
|
|
83
|
+
return n = $e(e, n), n = te(e, n), n !== !1 && Ve(e, n);
|
|
84
|
+
}
|
|
85
|
+
var Ye = Ge;
|
|
86
|
+
function qe(e) {
|
|
87
|
+
return Array.isArray(e) && e.length > 0;
|
|
88
|
+
}
|
|
89
|
+
var ie = qe, Je = class extends Error {
|
|
90
|
+
constructor(t, i, n = "type") {
|
|
91
|
+
super(`Unexpected ${i} node ${n}: ${JSON.stringify(t[n])}.`);
|
|
92
|
+
J(this, "name", "UnexpectedNodeError");
|
|
93
|
+
this.node = t;
|
|
94
|
+
}
|
|
95
|
+
}, Qe = Je, b = null;
|
|
96
|
+
function F(e) {
|
|
97
|
+
if (b !== null && typeof b.property) {
|
|
98
|
+
let t = b;
|
|
99
|
+
return b = F.prototype = null, t;
|
|
100
|
+
}
|
|
101
|
+
return b = F.prototype = e ?? /* @__PURE__ */ Object.create(null), new F();
|
|
102
|
+
}
|
|
103
|
+
var Xe = 10;
|
|
104
|
+
for (let e = 0; e <= Xe; e++) F();
|
|
105
|
+
function ze(e) {
|
|
106
|
+
return F(e);
|
|
107
|
+
}
|
|
108
|
+
function He(e, t = "type") {
|
|
109
|
+
ze(e);
|
|
110
|
+
function i(n) {
|
|
111
|
+
let r = n[t], s = e[r];
|
|
112
|
+
if (!Array.isArray(s)) throw Object.assign(new Error(`Missing visitor keys for '${r}'.`), { node: n });
|
|
113
|
+
return s;
|
|
114
|
+
}
|
|
115
|
+
return i;
|
|
116
|
+
}
|
|
117
|
+
var We = He, Ze = class {
|
|
118
|
+
constructor(e, t, i) {
|
|
119
|
+
this.start = e.start, this.end = t.end, this.startToken = e, this.endToken = t, this.source = i;
|
|
120
|
+
}
|
|
121
|
+
get [Symbol.toStringTag]() {
|
|
122
|
+
return "Location";
|
|
123
|
+
}
|
|
124
|
+
toJSON() {
|
|
125
|
+
return { start: this.start, end: this.end };
|
|
126
|
+
}
|
|
127
|
+
}, ne = class {
|
|
128
|
+
constructor(e, t, i, n, r, s) {
|
|
129
|
+
this.kind = e, this.start = t, this.end = i, this.line = n, this.column = r, this.value = s, this.prev = null, this.next = null;
|
|
130
|
+
}
|
|
131
|
+
get [Symbol.toStringTag]() {
|
|
132
|
+
return "Token";
|
|
133
|
+
}
|
|
134
|
+
toJSON() {
|
|
135
|
+
return { kind: this.kind, value: this.value, line: this.line, column: this.column };
|
|
136
|
+
}
|
|
137
|
+
}, re = { Name: [], Document: ["definitions"], OperationDefinition: ["description", "name", "variableDefinitions", "directives", "selectionSet"], VariableDefinition: ["description", "variable", "type", "defaultValue", "directives"], Variable: ["name"], SelectionSet: ["selections"], Field: ["alias", "name", "arguments", "directives", "selectionSet"], Argument: ["name", "value"], FragmentSpread: ["name", "directives"], InlineFragment: ["typeCondition", "directives", "selectionSet"], FragmentDefinition: ["description", "name", "variableDefinitions", "typeCondition", "directives", "selectionSet"], IntValue: [], FloatValue: [], StringValue: [], BooleanValue: [], NullValue: [], EnumValue: [], ListValue: ["values"], ObjectValue: ["fields"], ObjectField: ["name", "value"], Directive: ["name", "arguments"], NamedType: ["name"], ListType: ["type"], NonNullType: ["type"], SchemaDefinition: ["description", "directives", "operationTypes"], OperationTypeDefinition: ["type"], ScalarTypeDefinition: ["description", "name", "directives"], ObjectTypeDefinition: ["description", "name", "interfaces", "directives", "fields"], FieldDefinition: ["description", "name", "arguments", "type", "directives"], InputValueDefinition: ["description", "name", "type", "defaultValue", "directives"], InterfaceTypeDefinition: ["description", "name", "interfaces", "directives", "fields"], UnionTypeDefinition: ["description", "name", "directives", "types"], EnumTypeDefinition: ["description", "name", "directives", "values"], EnumValueDefinition: ["description", "name", "directives"], InputObjectTypeDefinition: ["description", "name", "directives", "fields"], DirectiveDefinition: ["description", "name", "arguments", "locations"], SchemaExtension: ["directives", "operationTypes"], ScalarTypeExtension: ["name", "directives"], ObjectTypeExtension: ["name", "interfaces", "directives", "fields"], InterfaceTypeExtension: ["name", "interfaces", "directives", "fields"], UnionTypeExtension: ["name", "directives", "types"], EnumTypeExtension: ["name", "directives", "values"], InputObjectTypeExtension: ["name", "directives", "fields"], TypeCoordinate: ["name"], MemberCoordinate: ["name", "memberName"], ArgumentCoordinate: ["name", "fieldName", "argumentName"], DirectiveCoordinate: ["name"], DirectiveArgumentCoordinate: ["name", "argumentName"] };
|
|
138
|
+
new Set(Object.keys(re));
|
|
139
|
+
var C;
|
|
140
|
+
(function(e) {
|
|
141
|
+
e.QUERY = "query", e.MUTATION = "mutation", e.SUBSCRIPTION = "subscription";
|
|
142
|
+
})(C || (C = {}));
|
|
143
|
+
var se = { ...re };
|
|
144
|
+
for (let e of ["ArgumentCoordinate", "DirectiveArgumentCoordinate", "DirectiveCoordinate", "MemberCoordinate", "TypeCoordinate"]) delete se[e];
|
|
145
|
+
var et = se, tt = We(et, "kind"), it = tt, ae = (e) => e.loc.start, oe = (e) => e.loc.end, nt = "format", rt = /^\s*#[^\S\n]*@(?:noformat|noprettier)\s*(?:\n|$)/u, st = /^\s*#[^\S\n]*@(?:format|prettier)\s*(?:\n|$)/u, at = (e) => st.test(e), ot = (e) => rt.test(e), lt = (e) => `# @${nt}
|
|
146
|
+
|
|
147
|
+
${e}`;
|
|
148
|
+
function ct(e, t, i) {
|
|
149
|
+
let { node: n } = e;
|
|
150
|
+
if (!n.description) return "";
|
|
151
|
+
let r = [i("description")];
|
|
152
|
+
return n.kind === "InputValueDefinition" && !n.description.block ? r.push(S) : r.push(h), r;
|
|
153
|
+
}
|
|
154
|
+
var y = ct;
|
|
155
|
+
function ut(e, t, i) {
|
|
156
|
+
let { node: n } = e;
|
|
157
|
+
switch (n.kind) {
|
|
158
|
+
case "Document":
|
|
159
|
+
return [...m(h, A(e, t, i, "definitions")), h];
|
|
160
|
+
case "OperationDefinition": {
|
|
161
|
+
let r = t.originalText[ae(n)] !== "{", s = !!n.name;
|
|
162
|
+
return [y(e, t, i), r ? n.operation : "", r && s ? [" ", i("name")] : "", r && !s && ie(n.variableDefinitions) ? " " : "", X(e, i), N(e, i, n), !r && !s ? "" : " ", i("selectionSet")];
|
|
163
|
+
}
|
|
164
|
+
case "FragmentDefinition":
|
|
165
|
+
return [y(e, t, i), "fragment ", i("name"), X(e, i), " on ", i("typeCondition"), N(e, i, n), " ", i("selectionSet")];
|
|
166
|
+
case "SelectionSet":
|
|
167
|
+
return ["{", v([h, m(h, A(e, t, i, "selections"))]), h, "}"];
|
|
168
|
+
case "Field":
|
|
169
|
+
return O([n.alias ? [i("alias"), ": "] : "", i("name"), n.arguments.length > 0 ? O(["(", v([p, m([x("", ", "), p], A(e, t, i, "arguments"))]), p, ")"]) : "", N(e, i, n), n.selectionSet ? " " : "", i("selectionSet")]);
|
|
170
|
+
case "Name":
|
|
171
|
+
return n.value;
|
|
172
|
+
case "StringValue":
|
|
173
|
+
if (n.block) {
|
|
174
|
+
let r = B(0, n.value, '"""', '\\"""').split(`
|
|
175
|
+
`);
|
|
176
|
+
return r.length === 1 && (r[0] = r[0].trim()), r.every((s) => s === "") && (r.length = 0), m(h, ['"""', ...r, '"""']);
|
|
177
|
+
}
|
|
178
|
+
return ['"', B(0, B(0, n.value, /["\\]/gu, "\\$&"), `
|
|
179
|
+
`, "\\n"), '"'];
|
|
180
|
+
case "IntValue":
|
|
181
|
+
case "FloatValue":
|
|
182
|
+
case "EnumValue":
|
|
183
|
+
return n.value;
|
|
184
|
+
case "BooleanValue":
|
|
185
|
+
return n.value ? "true" : "false";
|
|
186
|
+
case "NullValue":
|
|
187
|
+
return "null";
|
|
188
|
+
case "Variable":
|
|
189
|
+
return ["$", i("name")];
|
|
190
|
+
case "ListValue":
|
|
191
|
+
return O(["[", v([p, m([x("", ", "), p], e.map(i, "values"))]), p, "]"]);
|
|
192
|
+
case "ObjectValue": {
|
|
193
|
+
let r = t.bracketSpacing && n.fields.length > 0 ? " " : "";
|
|
194
|
+
return O(["{", r, v([p, m([x("", ", "), p], e.map(i, "fields"))]), p, x("", r), "}"]);
|
|
195
|
+
}
|
|
196
|
+
case "ObjectField":
|
|
197
|
+
case "Argument":
|
|
198
|
+
return [i("name"), ": ", i("value")];
|
|
199
|
+
case "Directive":
|
|
200
|
+
return ["@", i("name"), n.arguments.length > 0 ? O(["(", v([p, m([x("", ", "), p], A(e, t, i, "arguments"))]), p, ")"]) : ""];
|
|
201
|
+
case "NamedType":
|
|
202
|
+
return i("name");
|
|
203
|
+
case "VariableDefinition":
|
|
204
|
+
return [y(e, t, i), i("variable"), ": ", i("type"), n.defaultValue ? [" = ", i("defaultValue")] : "", N(e, i, n)];
|
|
205
|
+
case "ObjectTypeExtension":
|
|
206
|
+
case "ObjectTypeDefinition":
|
|
207
|
+
case "InputObjectTypeExtension":
|
|
208
|
+
case "InputObjectTypeDefinition":
|
|
209
|
+
case "InterfaceTypeExtension":
|
|
210
|
+
case "InterfaceTypeDefinition": {
|
|
211
|
+
let { kind: r } = n, s = [];
|
|
212
|
+
return r.endsWith("TypeDefinition") ? s.push(y(e, t, i)) : s.push("extend "), r.startsWith("ObjectType") ? s.push("type") : r.startsWith("InputObjectType") ? s.push("input") : s.push("interface"), s.push(" ", i("name")), !r.startsWith("InputObjectType") && n.interfaces.length > 0 && s.push(" implements ", ...dt(e, t, i)), s.push(N(e, i, n)), n.fields.length > 0 && s.push([" {", v([h, m(h, A(e, t, i, "fields"))]), h, "}"]), s;
|
|
213
|
+
}
|
|
214
|
+
case "FieldDefinition":
|
|
215
|
+
return [y(e, t, i), i("name"), n.arguments.length > 0 ? O(["(", v([p, m([x("", ", "), p], A(e, t, i, "arguments"))]), p, ")"]) : "", ": ", i("type"), N(e, i, n)];
|
|
216
|
+
case "DirectiveDefinition":
|
|
217
|
+
return [y(e, t, i), "directive ", "@", i("name"), n.arguments.length > 0 ? O(["(", v([p, m([x("", ", "), p], A(e, t, i, "arguments"))]), p, ")"]) : "", n.repeatable ? " repeatable" : "", " on ", ...m(" | ", e.map(i, "locations"))];
|
|
218
|
+
case "EnumTypeExtension":
|
|
219
|
+
case "EnumTypeDefinition":
|
|
220
|
+
return [y(e, t, i), n.kind === "EnumTypeExtension" ? "extend " : "", "enum ", i("name"), N(e, i, n), n.values.length > 0 ? [" {", v([h, m(h, A(e, t, i, "values"))]), h, "}"] : ""];
|
|
221
|
+
case "EnumValueDefinition":
|
|
222
|
+
return [y(e, t, i), i("name"), N(e, i, n)];
|
|
223
|
+
case "InputValueDefinition":
|
|
224
|
+
return [y(e, t, i), i("name"), ": ", i("type"), n.defaultValue ? [" = ", i("defaultValue")] : "", N(e, i, n)];
|
|
225
|
+
case "SchemaExtension":
|
|
226
|
+
return ["extend schema", N(e, i, n), ...n.operationTypes.length > 0 ? [" {", v([h, m(h, A(e, t, i, "operationTypes"))]), h, "}"] : []];
|
|
227
|
+
case "SchemaDefinition":
|
|
228
|
+
return [y(e, t, i), "schema", N(e, i, n), " {", n.operationTypes.length > 0 ? v([h, m(h, A(e, t, i, "operationTypes"))]) : "", h, "}"];
|
|
229
|
+
case "OperationTypeDefinition":
|
|
230
|
+
return [n.operation, ": ", i("type")];
|
|
231
|
+
case "FragmentSpread":
|
|
232
|
+
return ["...", i("name"), N(e, i, n)];
|
|
233
|
+
case "InlineFragment":
|
|
234
|
+
return ["...", n.typeCondition ? [" on ", i("typeCondition")] : "", N(e, i, n), " ", i("selectionSet")];
|
|
235
|
+
case "UnionTypeExtension":
|
|
236
|
+
case "UnionTypeDefinition":
|
|
237
|
+
return O([y(e, t, i), O([n.kind === "UnionTypeExtension" ? "extend " : "", "union ", i("name"), N(e, i, n), n.types.length > 0 ? [" =", x("", " "), v([x([S, "| "]), m([S, "| "], e.map(i, "types"))])] : ""])]);
|
|
238
|
+
case "ScalarTypeExtension":
|
|
239
|
+
case "ScalarTypeDefinition":
|
|
240
|
+
return [y(e, t, i), n.kind === "ScalarTypeExtension" ? "extend " : "", "scalar ", i("name"), N(e, i, n)];
|
|
241
|
+
case "NonNullType":
|
|
242
|
+
return [i("type"), "!"];
|
|
243
|
+
case "ListType":
|
|
244
|
+
return ["[", i("type"), "]"];
|
|
245
|
+
default:
|
|
246
|
+
throw new Qe(n, "Graphql", "kind");
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
function N(e, t, i) {
|
|
250
|
+
if (i.directives.length === 0) return "";
|
|
251
|
+
let n = m(S, e.map(t, "directives"));
|
|
252
|
+
return i.kind === "FragmentDefinition" || i.kind === "OperationDefinition" ? O([S, n]) : [" ", O(v([p, n]))];
|
|
253
|
+
}
|
|
254
|
+
function A(e, t, i, n) {
|
|
255
|
+
return e.map(({ isLast: r, node: s }) => {
|
|
256
|
+
let o = i();
|
|
257
|
+
return !r && Ye(t.originalText, oe(s)) ? [o, h] : o;
|
|
258
|
+
}, n);
|
|
259
|
+
}
|
|
260
|
+
function pt(e) {
|
|
261
|
+
return e.kind !== "Comment";
|
|
262
|
+
}
|
|
263
|
+
function ht({ node: e }) {
|
|
264
|
+
if (e.kind === "Comment") return "#" + e.value.trimEnd();
|
|
265
|
+
throw new Error("Not a comment: " + JSON.stringify(e));
|
|
266
|
+
}
|
|
267
|
+
function dt(e, t, i) {
|
|
268
|
+
let { node: n } = e, r = [], { interfaces: s } = n, o = e.map(i, "interfaces");
|
|
269
|
+
for (let c = 0; c < s.length; c++) {
|
|
270
|
+
let u = s[c];
|
|
271
|
+
r.push(o[c]);
|
|
272
|
+
let I = s[c + 1];
|
|
273
|
+
if (I) {
|
|
274
|
+
let E = t.originalText.slice(u.loc.end, I.loc.start).includes("#");
|
|
275
|
+
r.push(" &", E ? S : " ");
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
return r;
|
|
279
|
+
}
|
|
280
|
+
function X(e, t) {
|
|
281
|
+
let { node: i } = e;
|
|
282
|
+
return ie(i.variableDefinitions) ? O(["(", v([p, m([x("", ", "), p], e.map(t, "variableDefinitions"))]), p, ")"]) : "";
|
|
283
|
+
}
|
|
284
|
+
function le(e, t) {
|
|
285
|
+
e.kind === "StringValue" && e.block && !e.value.includes(`
|
|
286
|
+
`) && (t.value = e.value.trim());
|
|
287
|
+
}
|
|
288
|
+
le.ignoredProperties = /* @__PURE__ */ new Set(["loc", "comments"]);
|
|
289
|
+
function ft(e) {
|
|
290
|
+
var i;
|
|
291
|
+
let { node: t } = e;
|
|
292
|
+
return (i = t == null ? void 0 : t.comments) == null ? void 0 : i.some((n) => n.value.trim() === "prettier-ignore");
|
|
293
|
+
}
|
|
294
|
+
var Et = { print: ut, massageAstNode: le, hasPrettierIgnore: ft, insertPragma: lt, printComment: ht, canAttachComment: pt, getVisitorKeys: it }, mt = Et, Tt = [{ name: "GraphQL", type: "data", aceMode: "graphqlschema", extensions: [".graphql", ".gql", ".graphqls"], tmScope: "source.graphql", parsers: ["graphql"], vscodeLanguageIds: ["graphql"], linguistLanguageId: 139 }], Nt = { bracketSpacing: { category: "Common", type: "boolean", default: !0, description: "Print spaces between brackets.", oppositeDescription: "Do not print spaces between brackets." } }, It = { bracketSpacing: Nt.bracketSpacing }, vt = It, ce = {};
|
|
295
|
+
Z(ce, { graphql: () => ri });
|
|
296
|
+
function yt(e) {
|
|
297
|
+
return typeof e == "object" && e !== null;
|
|
298
|
+
}
|
|
299
|
+
function Ot(e, t) {
|
|
300
|
+
throw new Error("Unexpected invariant triggered.");
|
|
301
|
+
}
|
|
302
|
+
var Dt = /\r\n|[\n\r]/g;
|
|
303
|
+
function $(e, t) {
|
|
304
|
+
let i = 0, n = 1;
|
|
305
|
+
for (let r of e.body.matchAll(Dt)) {
|
|
306
|
+
if (typeof r.index == "number" || Ot(), r.index >= t) break;
|
|
307
|
+
i = r.index + r[0].length, n += 1;
|
|
308
|
+
}
|
|
309
|
+
return { line: n, column: t + 1 - i };
|
|
310
|
+
}
|
|
311
|
+
function At(e) {
|
|
312
|
+
return ue(e.source, $(e.source, e.start));
|
|
313
|
+
}
|
|
314
|
+
function ue(e, t) {
|
|
315
|
+
let i = e.locationOffset.column - 1, n = "".padStart(i) + e.body, r = t.line - 1, s = e.locationOffset.line - 1, o = t.line + s, c = t.line === 1 ? i : 0, u = t.column + c, I = `${e.name}:${o}:${u}
|
|
316
|
+
`, E = n.split(/\r\n|[\n\r]/g), k = E[r];
|
|
317
|
+
if (k.length > 120) {
|
|
318
|
+
let D = Math.floor(u / 80), V = u % 80, T = [];
|
|
319
|
+
for (let g = 0; g < k.length; g += 80) T.push(k.slice(g, g + 80));
|
|
320
|
+
return I + z([[`${o} |`, T[0]], ...T.slice(1, D + 1).map((g) => ["|", g]), ["|", "^".padStart(V)], ["|", T[D + 1]]]);
|
|
321
|
+
}
|
|
322
|
+
return I + z([[`${o - 1} |`, E[r - 1]], [`${o} |`, k], ["|", "^".padStart(u)], [`${o + 1} |`, E[r + 1]]]);
|
|
323
|
+
}
|
|
324
|
+
function z(e) {
|
|
325
|
+
let t = e.filter(([n, r]) => r !== void 0), i = Math.max(...t.map(([n]) => n.length));
|
|
326
|
+
return t.map(([n, r]) => n.padStart(i) + (r ? " " + r : "")).join(`
|
|
327
|
+
`);
|
|
328
|
+
}
|
|
329
|
+
function xt(e) {
|
|
330
|
+
let t = e[0];
|
|
331
|
+
return t == null || "kind" in t || "length" in t ? { nodes: t, source: e[1], positions: e[2], path: e[3], originalError: e[4], extensions: e[5] } : t;
|
|
332
|
+
}
|
|
333
|
+
var _t = class pe extends Error {
|
|
334
|
+
constructor(t, ...i) {
|
|
335
|
+
var n, r, s;
|
|
336
|
+
let { nodes: o, source: c, positions: u, path: I, originalError: E, extensions: k } = xt(i);
|
|
337
|
+
super(t), this.name = "GraphQLError", this.path = I ?? void 0, this.originalError = E ?? void 0, this.nodes = H(Array.isArray(o) ? o : o ? [o] : void 0);
|
|
338
|
+
let D = H((n = this.nodes) === null || n === void 0 ? void 0 : n.map((T) => T.loc).filter((T) => T != null));
|
|
339
|
+
this.source = c ?? (D == null || (r = D[0]) === null || r === void 0 ? void 0 : r.source), this.positions = u ?? (D == null ? void 0 : D.map((T) => T.start)), this.locations = u && c ? u.map((T) => $(c, T)) : D == null ? void 0 : D.map((T) => $(T.source, T.start));
|
|
340
|
+
let V = yt(E == null ? void 0 : E.extensions) ? E == null ? void 0 : E.extensions : void 0;
|
|
341
|
+
this.extensions = (s = k ?? V) !== null && s !== void 0 ? s : /* @__PURE__ */ Object.create(null), Object.defineProperties(this, { message: { writable: !0, enumerable: !0 }, name: { enumerable: !1 }, nodes: { enumerable: !1 }, source: { enumerable: !1 }, positions: { enumerable: !1 }, originalError: { enumerable: !1 } }), E != null && E.stack ? Object.defineProperty(this, "stack", { value: E.stack, writable: !0, configurable: !0 }) : Error.captureStackTrace ? Error.captureStackTrace(this, pe) : Object.defineProperty(this, "stack", { value: Error().stack, writable: !0, configurable: !0 });
|
|
342
|
+
}
|
|
343
|
+
get [Symbol.toStringTag]() {
|
|
344
|
+
return "GraphQLError";
|
|
345
|
+
}
|
|
346
|
+
toString() {
|
|
347
|
+
let t = this.message;
|
|
348
|
+
if (this.nodes) for (let i of this.nodes) i.loc && (t += `
|
|
349
|
+
|
|
350
|
+
` + At(i.loc));
|
|
351
|
+
else if (this.source && this.locations) for (let i of this.locations) t += `
|
|
352
|
+
|
|
353
|
+
` + ue(this.source, i);
|
|
354
|
+
return t;
|
|
355
|
+
}
|
|
356
|
+
toJSON() {
|
|
357
|
+
let t = { message: this.message };
|
|
358
|
+
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;
|
|
359
|
+
}
|
|
360
|
+
};
|
|
361
|
+
function H(e) {
|
|
362
|
+
return e === void 0 || e.length === 0 ? void 0 : e;
|
|
363
|
+
}
|
|
364
|
+
function f(e, t, i) {
|
|
365
|
+
return new _t(`Syntax Error: ${i}`, { source: e, positions: [t] });
|
|
366
|
+
}
|
|
367
|
+
var G;
|
|
368
|
+
(function(e) {
|
|
369
|
+
e.QUERY = "QUERY", e.MUTATION = "MUTATION", e.SUBSCRIPTION = "SUBSCRIPTION", e.FIELD = "FIELD", e.FRAGMENT_DEFINITION = "FRAGMENT_DEFINITION", e.FRAGMENT_SPREAD = "FRAGMENT_SPREAD", e.INLINE_FRAGMENT = "INLINE_FRAGMENT", e.VARIABLE_DEFINITION = "VARIABLE_DEFINITION", e.SCHEMA = "SCHEMA", e.SCALAR = "SCALAR", e.OBJECT = "OBJECT", e.FIELD_DEFINITION = "FIELD_DEFINITION", e.ARGUMENT_DEFINITION = "ARGUMENT_DEFINITION", e.INTERFACE = "INTERFACE", e.UNION = "UNION", e.ENUM = "ENUM", e.ENUM_VALUE = "ENUM_VALUE", e.INPUT_OBJECT = "INPUT_OBJECT", e.INPUT_FIELD_DEFINITION = "INPUT_FIELD_DEFINITION";
|
|
370
|
+
})(G || (G = {}));
|
|
371
|
+
var l;
|
|
372
|
+
(function(e) {
|
|
373
|
+
e.NAME = "Name", e.DOCUMENT = "Document", e.OPERATION_DEFINITION = "OperationDefinition", e.VARIABLE_DEFINITION = "VariableDefinition", e.SELECTION_SET = "SelectionSet", e.FIELD = "Field", e.ARGUMENT = "Argument", e.FRAGMENT_SPREAD = "FragmentSpread", e.INLINE_FRAGMENT = "InlineFragment", e.FRAGMENT_DEFINITION = "FragmentDefinition", e.VARIABLE = "Variable", e.INT = "IntValue", e.FLOAT = "FloatValue", e.STRING = "StringValue", e.BOOLEAN = "BooleanValue", e.NULL = "NullValue", e.ENUM = "EnumValue", e.LIST = "ListValue", e.OBJECT = "ObjectValue", e.OBJECT_FIELD = "ObjectField", e.DIRECTIVE = "Directive", e.NAMED_TYPE = "NamedType", e.LIST_TYPE = "ListType", e.NON_NULL_TYPE = "NonNullType", e.SCHEMA_DEFINITION = "SchemaDefinition", e.OPERATION_TYPE_DEFINITION = "OperationTypeDefinition", e.SCALAR_TYPE_DEFINITION = "ScalarTypeDefinition", e.OBJECT_TYPE_DEFINITION = "ObjectTypeDefinition", e.FIELD_DEFINITION = "FieldDefinition", e.INPUT_VALUE_DEFINITION = "InputValueDefinition", e.INTERFACE_TYPE_DEFINITION = "InterfaceTypeDefinition", e.UNION_TYPE_DEFINITION = "UnionTypeDefinition", e.ENUM_TYPE_DEFINITION = "EnumTypeDefinition", e.ENUM_VALUE_DEFINITION = "EnumValueDefinition", e.INPUT_OBJECT_TYPE_DEFINITION = "InputObjectTypeDefinition", e.DIRECTIVE_DEFINITION = "DirectiveDefinition", e.SCHEMA_EXTENSION = "SchemaExtension", e.SCALAR_TYPE_EXTENSION = "ScalarTypeExtension", e.OBJECT_TYPE_EXTENSION = "ObjectTypeExtension", e.INTERFACE_TYPE_EXTENSION = "InterfaceTypeExtension", e.UNION_TYPE_EXTENSION = "UnionTypeExtension", e.ENUM_TYPE_EXTENSION = "EnumTypeExtension", e.INPUT_OBJECT_TYPE_EXTENSION = "InputObjectTypeExtension", e.TYPE_COORDINATE = "TypeCoordinate", e.MEMBER_COORDINATE = "MemberCoordinate", e.ARGUMENT_COORDINATE = "ArgumentCoordinate", e.DIRECTIVE_COORDINATE = "DirectiveCoordinate", e.DIRECTIVE_ARGUMENT_COORDINATE = "DirectiveArgumentCoordinate";
|
|
374
|
+
})(l || (l = {}));
|
|
375
|
+
function kt(e) {
|
|
376
|
+
return e === 9 || e === 32;
|
|
377
|
+
}
|
|
378
|
+
function w(e) {
|
|
379
|
+
return e >= 48 && e <= 57;
|
|
380
|
+
}
|
|
381
|
+
function he(e) {
|
|
382
|
+
return e >= 97 && e <= 122 || e >= 65 && e <= 90;
|
|
383
|
+
}
|
|
384
|
+
function de(e) {
|
|
385
|
+
return he(e) || e === 95;
|
|
386
|
+
}
|
|
387
|
+
function gt(e) {
|
|
388
|
+
return he(e) || w(e) || e === 95;
|
|
389
|
+
}
|
|
390
|
+
function Ct(e) {
|
|
391
|
+
var t;
|
|
392
|
+
let i = Number.MAX_SAFE_INTEGER, n = null, r = -1;
|
|
393
|
+
for (let o = 0; o < e.length; ++o) {
|
|
394
|
+
var s;
|
|
395
|
+
let c = e[o], u = St(c);
|
|
396
|
+
u !== c.length && (n = (s = n) !== null && s !== void 0 ? s : o, r = o, o !== 0 && u < i && (i = u));
|
|
397
|
+
}
|
|
398
|
+
return e.map((o, c) => c === 0 ? o : o.slice(i)).slice((t = n) !== null && t !== void 0 ? t : 0, r + 1);
|
|
399
|
+
}
|
|
400
|
+
function St(e) {
|
|
401
|
+
let t = 0;
|
|
402
|
+
for (; t < e.length && kt(e.charCodeAt(t)); ) ++t;
|
|
403
|
+
return t;
|
|
404
|
+
}
|
|
405
|
+
var a;
|
|
406
|
+
(function(e) {
|
|
407
|
+
e.SOF = "<SOF>", e.EOF = "<EOF>", e.BANG = "!", e.DOLLAR = "$", e.AMP = "&", e.PAREN_L = "(", e.PAREN_R = ")", e.DOT = ".", e.SPREAD = "...", e.COLON = ":", e.EQUALS = "=", e.AT = "@", e.BRACKET_L = "[", e.BRACKET_R = "]", e.BRACE_L = "{", e.PIPE = "|", e.BRACE_R = "}", e.NAME = "Name", e.INT = "Int", e.FLOAT = "Float", e.STRING = "String", e.BLOCK_STRING = "BlockString", e.COMMENT = "Comment";
|
|
408
|
+
})(a || (a = {}));
|
|
409
|
+
var Rt = class {
|
|
410
|
+
constructor(e) {
|
|
411
|
+
let t = new ne(a.SOF, 0, 0, 0, 0);
|
|
412
|
+
this.source = e, this.lastToken = t, this.token = t, this.line = 1, this.lineStart = 0;
|
|
413
|
+
}
|
|
414
|
+
get [Symbol.toStringTag]() {
|
|
415
|
+
return "Lexer";
|
|
416
|
+
}
|
|
417
|
+
advance() {
|
|
418
|
+
return this.lastToken = this.token, this.token = this.lookahead();
|
|
419
|
+
}
|
|
420
|
+
lookahead() {
|
|
421
|
+
let e = this.token;
|
|
422
|
+
if (e.kind !== a.EOF) do
|
|
423
|
+
if (e.next) e = e.next;
|
|
424
|
+
else {
|
|
425
|
+
let t = Lt(this, e.end);
|
|
426
|
+
e.next = t, t.prev = e, e = t;
|
|
427
|
+
}
|
|
428
|
+
while (e.kind === a.COMMENT);
|
|
429
|
+
return e;
|
|
430
|
+
}
|
|
431
|
+
};
|
|
432
|
+
function bt(e) {
|
|
433
|
+
return e === a.BANG || e === a.DOLLAR || e === a.AMP || e === a.PAREN_L || e === a.PAREN_R || e === a.DOT || e === a.SPREAD || e === a.COLON || e === a.EQUALS || e === a.AT || e === a.BRACKET_L || e === a.BRACKET_R || e === a.BRACE_L || e === a.PIPE || e === a.BRACE_R;
|
|
434
|
+
}
|
|
435
|
+
function R(e) {
|
|
436
|
+
return e >= 0 && e <= 55295 || e >= 57344 && e <= 1114111;
|
|
437
|
+
}
|
|
438
|
+
function M(e, t) {
|
|
439
|
+
return fe(e.charCodeAt(t)) && Ee(e.charCodeAt(t + 1));
|
|
440
|
+
}
|
|
441
|
+
function fe(e) {
|
|
442
|
+
return e >= 55296 && e <= 56319;
|
|
443
|
+
}
|
|
444
|
+
function Ee(e) {
|
|
445
|
+
return e >= 56320 && e <= 57343;
|
|
446
|
+
}
|
|
447
|
+
function _(e, t) {
|
|
448
|
+
let i = e.source.body.codePointAt(t);
|
|
449
|
+
if (i === void 0) return a.EOF;
|
|
450
|
+
if (i >= 32 && i <= 126) {
|
|
451
|
+
let n = String.fromCodePoint(i);
|
|
452
|
+
return n === '"' ? `'"'` : `"${n}"`;
|
|
453
|
+
}
|
|
454
|
+
return "U+" + i.toString(16).toUpperCase().padStart(4, "0");
|
|
455
|
+
}
|
|
456
|
+
function d(e, t, i, n, r) {
|
|
457
|
+
let s = e.line, o = 1 + i - e.lineStart;
|
|
458
|
+
return new ne(t, i, n, s, o, r);
|
|
459
|
+
}
|
|
460
|
+
function Lt(e, t) {
|
|
461
|
+
let i = e.source.body, n = i.length, r = t;
|
|
462
|
+
for (; r < n; ) {
|
|
463
|
+
let s = i.charCodeAt(r);
|
|
464
|
+
switch (s) {
|
|
465
|
+
case 65279:
|
|
466
|
+
case 9:
|
|
467
|
+
case 32:
|
|
468
|
+
case 44:
|
|
469
|
+
++r;
|
|
470
|
+
continue;
|
|
471
|
+
case 10:
|
|
472
|
+
++r, ++e.line, e.lineStart = r;
|
|
473
|
+
continue;
|
|
474
|
+
case 13:
|
|
475
|
+
i.charCodeAt(r + 1) === 10 ? r += 2 : ++r, ++e.line, e.lineStart = r;
|
|
476
|
+
continue;
|
|
477
|
+
case 35:
|
|
478
|
+
return Ft(e, r);
|
|
479
|
+
case 33:
|
|
480
|
+
return d(e, a.BANG, r, r + 1);
|
|
481
|
+
case 36:
|
|
482
|
+
return d(e, a.DOLLAR, r, r + 1);
|
|
483
|
+
case 38:
|
|
484
|
+
return d(e, a.AMP, r, r + 1);
|
|
485
|
+
case 40:
|
|
486
|
+
return d(e, a.PAREN_L, r, r + 1);
|
|
487
|
+
case 41:
|
|
488
|
+
return d(e, a.PAREN_R, r, r + 1);
|
|
489
|
+
case 46:
|
|
490
|
+
if (i.charCodeAt(r + 1) === 46 && i.charCodeAt(r + 2) === 46) return d(e, a.SPREAD, r, r + 3);
|
|
491
|
+
break;
|
|
492
|
+
case 58:
|
|
493
|
+
return d(e, a.COLON, r, r + 1);
|
|
494
|
+
case 61:
|
|
495
|
+
return d(e, a.EQUALS, r, r + 1);
|
|
496
|
+
case 64:
|
|
497
|
+
return d(e, a.AT, r, r + 1);
|
|
498
|
+
case 91:
|
|
499
|
+
return d(e, a.BRACKET_L, r, r + 1);
|
|
500
|
+
case 93:
|
|
501
|
+
return d(e, a.BRACKET_R, r, r + 1);
|
|
502
|
+
case 123:
|
|
503
|
+
return d(e, a.BRACE_L, r, r + 1);
|
|
504
|
+
case 124:
|
|
505
|
+
return d(e, a.PIPE, r, r + 1);
|
|
506
|
+
case 125:
|
|
507
|
+
return d(e, a.BRACE_R, r, r + 1);
|
|
508
|
+
case 34:
|
|
509
|
+
return i.charCodeAt(r + 1) === 34 && i.charCodeAt(r + 2) === 34 ? Bt(e, r) : Pt(e, r);
|
|
510
|
+
}
|
|
511
|
+
if (w(s) || s === 45) return wt(e, r, s);
|
|
512
|
+
if (de(s)) return jt(e, r);
|
|
513
|
+
throw f(e.source, r, s === 39 ? `Unexpected single quote character ('), did you mean to use a double quote (")?` : R(s) || M(i, r) ? `Unexpected character: ${_(e, r)}.` : `Invalid character: ${_(e, r)}.`);
|
|
514
|
+
}
|
|
515
|
+
return d(e, a.EOF, n, n);
|
|
516
|
+
}
|
|
517
|
+
function Ft(e, t) {
|
|
518
|
+
let i = e.source.body, n = i.length, r = t + 1;
|
|
519
|
+
for (; r < n; ) {
|
|
520
|
+
let s = i.charCodeAt(r);
|
|
521
|
+
if (s === 10 || s === 13) break;
|
|
522
|
+
if (R(s)) ++r;
|
|
523
|
+
else if (M(i, r)) r += 2;
|
|
524
|
+
else break;
|
|
525
|
+
}
|
|
526
|
+
return d(e, a.COMMENT, t, r, i.slice(t + 1, r));
|
|
527
|
+
}
|
|
528
|
+
function wt(e, t, i) {
|
|
529
|
+
let n = e.source.body, r = t, s = i, o = !1;
|
|
530
|
+
if (s === 45 && (s = n.charCodeAt(++r)), s === 48) {
|
|
531
|
+
if (s = n.charCodeAt(++r), w(s)) throw f(e.source, r, `Invalid number, unexpected digit after 0: ${_(e, r)}.`);
|
|
532
|
+
} else r = j(e, r, s), s = n.charCodeAt(r);
|
|
533
|
+
if (s === 46 && (o = !0, s = n.charCodeAt(++r), r = j(e, r, s), s = n.charCodeAt(r)), (s === 69 || s === 101) && (o = !0, s = n.charCodeAt(++r), (s === 43 || s === 45) && (s = n.charCodeAt(++r)), r = j(e, r, s), s = n.charCodeAt(r)), s === 46 || de(s)) throw f(e.source, r, `Invalid number, expected digit but got: ${_(e, r)}.`);
|
|
534
|
+
return d(e, o ? a.FLOAT : a.INT, t, r, n.slice(t, r));
|
|
535
|
+
}
|
|
536
|
+
function j(e, t, i) {
|
|
537
|
+
if (!w(i)) throw f(e.source, t, `Invalid number, expected digit but got: ${_(e, t)}.`);
|
|
538
|
+
let n = e.source.body, r = t + 1;
|
|
539
|
+
for (; w(n.charCodeAt(r)); ) ++r;
|
|
540
|
+
return r;
|
|
541
|
+
}
|
|
542
|
+
function Pt(e, t) {
|
|
543
|
+
let i = e.source.body, n = i.length, r = t + 1, s = r, o = "";
|
|
544
|
+
for (; r < n; ) {
|
|
545
|
+
let c = i.charCodeAt(r);
|
|
546
|
+
if (c === 34) return o += i.slice(s, r), d(e, a.STRING, t, r + 1, o);
|
|
547
|
+
if (c === 92) {
|
|
548
|
+
o += i.slice(s, r);
|
|
549
|
+
let u = i.charCodeAt(r + 1) === 117 ? i.charCodeAt(r + 2) === 123 ? Mt(e, r) : Ut(e, r) : Vt(e, r);
|
|
550
|
+
o += u.value, r += u.size, s = r;
|
|
551
|
+
continue;
|
|
552
|
+
}
|
|
553
|
+
if (c === 10 || c === 13) break;
|
|
554
|
+
if (R(c)) ++r;
|
|
555
|
+
else if (M(i, r)) r += 2;
|
|
556
|
+
else throw f(e.source, r, `Invalid character within String: ${_(e, r)}.`);
|
|
557
|
+
}
|
|
558
|
+
throw f(e.source, r, "Unterminated string.");
|
|
559
|
+
}
|
|
560
|
+
function Mt(e, t) {
|
|
561
|
+
let i = e.source.body, n = 0, r = 3;
|
|
562
|
+
for (; r < 12; ) {
|
|
563
|
+
let s = i.charCodeAt(t + r++);
|
|
564
|
+
if (s === 125) {
|
|
565
|
+
if (r < 5 || !R(n)) break;
|
|
566
|
+
return { value: String.fromCodePoint(n), size: r };
|
|
567
|
+
}
|
|
568
|
+
if (n = n << 4 | L(s), n < 0) break;
|
|
569
|
+
}
|
|
570
|
+
throw f(e.source, t, `Invalid Unicode escape sequence: "${i.slice(t, t + r)}".`);
|
|
571
|
+
}
|
|
572
|
+
function Ut(e, t) {
|
|
573
|
+
let i = e.source.body, n = W(i, t + 2);
|
|
574
|
+
if (R(n)) return { value: String.fromCodePoint(n), size: 6 };
|
|
575
|
+
if (fe(n) && i.charCodeAt(t + 6) === 92 && i.charCodeAt(t + 7) === 117) {
|
|
576
|
+
let r = W(i, t + 8);
|
|
577
|
+
if (Ee(r)) return { value: String.fromCodePoint(n, r), size: 12 };
|
|
578
|
+
}
|
|
579
|
+
throw f(e.source, t, `Invalid Unicode escape sequence: "${i.slice(t, t + 6)}".`);
|
|
580
|
+
}
|
|
581
|
+
function W(e, t) {
|
|
582
|
+
return L(e.charCodeAt(t)) << 12 | L(e.charCodeAt(t + 1)) << 8 | L(e.charCodeAt(t + 2)) << 4 | L(e.charCodeAt(t + 3));
|
|
583
|
+
}
|
|
584
|
+
function L(e) {
|
|
585
|
+
return e >= 48 && e <= 57 ? e - 48 : e >= 65 && e <= 70 ? e - 55 : e >= 97 && e <= 102 ? e - 87 : -1;
|
|
586
|
+
}
|
|
587
|
+
function Vt(e, t) {
|
|
588
|
+
let i = e.source.body;
|
|
589
|
+
switch (i.charCodeAt(t + 1)) {
|
|
590
|
+
case 34:
|
|
591
|
+
return { value: '"', size: 2 };
|
|
592
|
+
case 92:
|
|
593
|
+
return { value: "\\", size: 2 };
|
|
594
|
+
case 47:
|
|
595
|
+
return { value: "/", size: 2 };
|
|
596
|
+
case 98:
|
|
597
|
+
return { value: "\b", size: 2 };
|
|
598
|
+
case 102:
|
|
599
|
+
return { value: "\f", size: 2 };
|
|
600
|
+
case 110:
|
|
601
|
+
return { value: `
|
|
602
|
+
`, size: 2 };
|
|
603
|
+
case 114:
|
|
604
|
+
return { value: "\r", size: 2 };
|
|
605
|
+
case 116:
|
|
606
|
+
return { value: " ", size: 2 };
|
|
607
|
+
}
|
|
608
|
+
throw f(e.source, t, `Invalid character escape sequence: "${i.slice(t, t + 2)}".`);
|
|
609
|
+
}
|
|
610
|
+
function Bt(e, t) {
|
|
611
|
+
let i = e.source.body, n = i.length, r = e.lineStart, s = t + 3, o = s, c = "", u = [];
|
|
612
|
+
for (; s < n; ) {
|
|
613
|
+
let I = i.charCodeAt(s);
|
|
614
|
+
if (I === 34 && i.charCodeAt(s + 1) === 34 && i.charCodeAt(s + 2) === 34) {
|
|
615
|
+
c += i.slice(o, s), u.push(c);
|
|
616
|
+
let E = d(e, a.BLOCK_STRING, t, s + 3, Ct(u).join(`
|
|
617
|
+
`));
|
|
618
|
+
return e.line += u.length - 1, e.lineStart = r, E;
|
|
619
|
+
}
|
|
620
|
+
if (I === 92 && i.charCodeAt(s + 1) === 34 && i.charCodeAt(s + 2) === 34 && i.charCodeAt(s + 3) === 34) {
|
|
621
|
+
c += i.slice(o, s), o = s + 1, s += 4;
|
|
622
|
+
continue;
|
|
623
|
+
}
|
|
624
|
+
if (I === 10 || I === 13) {
|
|
625
|
+
c += i.slice(o, s), u.push(c), I === 13 && i.charCodeAt(s + 1) === 10 ? s += 2 : ++s, c = "", o = s, r = s;
|
|
626
|
+
continue;
|
|
627
|
+
}
|
|
628
|
+
if (R(I)) ++s;
|
|
629
|
+
else if (M(i, s)) s += 2;
|
|
630
|
+
else throw f(e.source, s, `Invalid character within String: ${_(e, s)}.`);
|
|
631
|
+
}
|
|
632
|
+
throw f(e.source, s, "Unterminated string.");
|
|
633
|
+
}
|
|
634
|
+
function jt(e, t) {
|
|
635
|
+
let i = e.source.body, n = i.length, r = t + 1;
|
|
636
|
+
for (; r < n; ) {
|
|
637
|
+
let s = i.charCodeAt(r);
|
|
638
|
+
if (gt(s)) ++r;
|
|
639
|
+
else break;
|
|
640
|
+
}
|
|
641
|
+
return d(e, a.NAME, t, r, i.slice(t, r));
|
|
642
|
+
}
|
|
643
|
+
function K(e, t) {
|
|
644
|
+
throw new Error(t);
|
|
645
|
+
}
|
|
646
|
+
function me(e) {
|
|
647
|
+
return U(e, []);
|
|
648
|
+
}
|
|
649
|
+
function U(e, t) {
|
|
650
|
+
switch (typeof e) {
|
|
651
|
+
case "string":
|
|
652
|
+
return JSON.stringify(e);
|
|
653
|
+
case "function":
|
|
654
|
+
return e.name ? `[function ${e.name}]` : "[function]";
|
|
655
|
+
case "object":
|
|
656
|
+
return Kt(e, t);
|
|
657
|
+
default:
|
|
658
|
+
return String(e);
|
|
659
|
+
}
|
|
660
|
+
}
|
|
661
|
+
function Kt(e, t) {
|
|
662
|
+
if (e === null) return "null";
|
|
663
|
+
if (t.includes(e)) return "[Circular]";
|
|
664
|
+
let i = [...t, e];
|
|
665
|
+
if ($t(e)) {
|
|
666
|
+
let n = e.toJSON();
|
|
667
|
+
if (n !== e) return typeof n == "string" ? n : U(n, i);
|
|
668
|
+
} else if (Array.isArray(e)) return Yt(e, i);
|
|
669
|
+
return Gt(e, i);
|
|
670
|
+
}
|
|
671
|
+
function $t(e) {
|
|
672
|
+
return typeof e.toJSON == "function";
|
|
673
|
+
}
|
|
674
|
+
function Gt(e, t) {
|
|
675
|
+
let i = Object.entries(e);
|
|
676
|
+
return i.length === 0 ? "{}" : t.length > 2 ? "[" + qt(e) + "]" : "{ " + i.map(([n, r]) => n + ": " + U(r, t)).join(", ") + " }";
|
|
677
|
+
}
|
|
678
|
+
function Yt(e, t) {
|
|
679
|
+
if (e.length === 0) return "[]";
|
|
680
|
+
if (t.length > 2) return "[Array]";
|
|
681
|
+
let i = Math.min(10, e.length), n = e.length - i, r = [];
|
|
682
|
+
for (let s = 0; s < i; ++s) r.push(U(e[s], t));
|
|
683
|
+
return n === 1 ? r.push("... 1 more item") : n > 1 && r.push(`... ${n} more items`), "[" + r.join(", ") + "]";
|
|
684
|
+
}
|
|
685
|
+
function qt(e) {
|
|
686
|
+
let t = Object.prototype.toString.call(e).replace(/^\[object /, "").replace(/]$/, "");
|
|
687
|
+
if (t === "Object" && typeof e.constructor == "function") {
|
|
688
|
+
let i = e.constructor.name;
|
|
689
|
+
if (typeof i == "string" && i !== "") return i;
|
|
690
|
+
}
|
|
691
|
+
return t;
|
|
692
|
+
}
|
|
693
|
+
var Jt = globalThis.process && !0, Qt = Jt ? function(e, t) {
|
|
694
|
+
return e instanceof t;
|
|
695
|
+
} : function(e, t) {
|
|
696
|
+
if (e instanceof t) return !0;
|
|
697
|
+
if (typeof e == "object" && e !== null) {
|
|
698
|
+
var i;
|
|
699
|
+
let n = t.prototype[Symbol.toStringTag], r = Symbol.toStringTag in e ? e[Symbol.toStringTag] : (i = e.constructor) === null || i === void 0 ? void 0 : i.name;
|
|
700
|
+
if (n === r) {
|
|
701
|
+
let s = me(e);
|
|
702
|
+
throw new Error(`Cannot use ${n} "${s}" from another module or realm.
|
|
703
|
+
|
|
704
|
+
Ensure that there is only one instance of "graphql" in the node_modules
|
|
705
|
+
directory. If different versions of "graphql" are the dependencies of other
|
|
706
|
+
relied on modules, use "resolutions" to ensure only one version is installed.
|
|
707
|
+
|
|
708
|
+
https://yarnpkg.com/en/docs/selective-version-resolutions
|
|
709
|
+
|
|
710
|
+
Duplicate "graphql" modules cannot be used at the same time since different
|
|
711
|
+
versions may have different capabilities and behavior. The data from one
|
|
712
|
+
version used in the function from another could produce confusing and
|
|
713
|
+
spurious results.`);
|
|
714
|
+
}
|
|
715
|
+
}
|
|
716
|
+
return !1;
|
|
717
|
+
}, Te = class {
|
|
718
|
+
constructor(e, t = "GraphQL request", i = { line: 1, column: 1 }) {
|
|
719
|
+
typeof e == "string" || K(!1, `Body must be a string. Received: ${me(e)}.`), this.body = e, this.name = t, this.locationOffset = i, this.locationOffset.line > 0 || K(!1, "line in locationOffset is 1-indexed and must be positive."), this.locationOffset.column > 0 || K(!1, "column in locationOffset is 1-indexed and must be positive.");
|
|
720
|
+
}
|
|
721
|
+
get [Symbol.toStringTag]() {
|
|
722
|
+
return "Source";
|
|
723
|
+
}
|
|
724
|
+
};
|
|
725
|
+
function Xt(e) {
|
|
726
|
+
return Qt(e, Te);
|
|
727
|
+
}
|
|
728
|
+
function zt(e, t) {
|
|
729
|
+
let i = new Ht(e, t), n = i.parseDocument();
|
|
730
|
+
return Object.defineProperty(n, "tokenCount", { enumerable: !1, value: i.tokenCount }), n;
|
|
731
|
+
}
|
|
732
|
+
var Ht = class {
|
|
733
|
+
constructor(e, t = {}) {
|
|
734
|
+
let { lexer: i, ...n } = t;
|
|
735
|
+
if (i) this._lexer = i;
|
|
736
|
+
else {
|
|
737
|
+
let r = Xt(e) ? e : new Te(e);
|
|
738
|
+
this._lexer = new Rt(r);
|
|
739
|
+
}
|
|
740
|
+
this._options = n, this._tokenCounter = 0;
|
|
741
|
+
}
|
|
742
|
+
get tokenCount() {
|
|
743
|
+
return this._tokenCounter;
|
|
744
|
+
}
|
|
745
|
+
parseName() {
|
|
746
|
+
let e = this.expectToken(a.NAME);
|
|
747
|
+
return this.node(e, { kind: l.NAME, value: e.value });
|
|
748
|
+
}
|
|
749
|
+
parseDocument() {
|
|
750
|
+
return this.node(this._lexer.token, { kind: l.DOCUMENT, definitions: this.many(a.SOF, this.parseDefinition, a.EOF) });
|
|
751
|
+
}
|
|
752
|
+
parseDefinition() {
|
|
753
|
+
if (this.peek(a.BRACE_L)) return this.parseOperationDefinition();
|
|
754
|
+
let e = this.peekDescription(), t = e ? this._lexer.lookahead() : this._lexer.token;
|
|
755
|
+
if (e && t.kind === a.BRACE_L) throw f(this._lexer.source, this._lexer.token.start, "Unexpected description, descriptions are not supported on shorthand queries.");
|
|
756
|
+
if (t.kind === a.NAME) {
|
|
757
|
+
switch (t.value) {
|
|
758
|
+
case "schema":
|
|
759
|
+
return this.parseSchemaDefinition();
|
|
760
|
+
case "scalar":
|
|
761
|
+
return this.parseScalarTypeDefinition();
|
|
762
|
+
case "type":
|
|
763
|
+
return this.parseObjectTypeDefinition();
|
|
764
|
+
case "interface":
|
|
765
|
+
return this.parseInterfaceTypeDefinition();
|
|
766
|
+
case "union":
|
|
767
|
+
return this.parseUnionTypeDefinition();
|
|
768
|
+
case "enum":
|
|
769
|
+
return this.parseEnumTypeDefinition();
|
|
770
|
+
case "input":
|
|
771
|
+
return this.parseInputObjectTypeDefinition();
|
|
772
|
+
case "directive":
|
|
773
|
+
return this.parseDirectiveDefinition();
|
|
774
|
+
}
|
|
775
|
+
switch (t.value) {
|
|
776
|
+
case "query":
|
|
777
|
+
case "mutation":
|
|
778
|
+
case "subscription":
|
|
779
|
+
return this.parseOperationDefinition();
|
|
780
|
+
case "fragment":
|
|
781
|
+
return this.parseFragmentDefinition();
|
|
782
|
+
}
|
|
783
|
+
if (e) throw f(this._lexer.source, this._lexer.token.start, "Unexpected description, only GraphQL definitions support descriptions.");
|
|
784
|
+
switch (t.value) {
|
|
785
|
+
case "extend":
|
|
786
|
+
return this.parseTypeSystemExtension();
|
|
787
|
+
}
|
|
788
|
+
}
|
|
789
|
+
throw this.unexpected(t);
|
|
790
|
+
}
|
|
791
|
+
parseOperationDefinition() {
|
|
792
|
+
let e = this._lexer.token;
|
|
793
|
+
if (this.peek(a.BRACE_L)) return this.node(e, { kind: l.OPERATION_DEFINITION, operation: C.QUERY, description: void 0, name: void 0, variableDefinitions: [], directives: [], selectionSet: this.parseSelectionSet() });
|
|
794
|
+
let t = this.parseDescription(), i = this.parseOperationType(), n;
|
|
795
|
+
return this.peek(a.NAME) && (n = this.parseName()), this.node(e, { kind: l.OPERATION_DEFINITION, operation: i, description: t, name: n, variableDefinitions: this.parseVariableDefinitions(), directives: this.parseDirectives(!1), selectionSet: this.parseSelectionSet() });
|
|
796
|
+
}
|
|
797
|
+
parseOperationType() {
|
|
798
|
+
let e = this.expectToken(a.NAME);
|
|
799
|
+
switch (e.value) {
|
|
800
|
+
case "query":
|
|
801
|
+
return C.QUERY;
|
|
802
|
+
case "mutation":
|
|
803
|
+
return C.MUTATION;
|
|
804
|
+
case "subscription":
|
|
805
|
+
return C.SUBSCRIPTION;
|
|
806
|
+
}
|
|
807
|
+
throw this.unexpected(e);
|
|
808
|
+
}
|
|
809
|
+
parseVariableDefinitions() {
|
|
810
|
+
return this.optionalMany(a.PAREN_L, this.parseVariableDefinition, a.PAREN_R);
|
|
811
|
+
}
|
|
812
|
+
parseVariableDefinition() {
|
|
813
|
+
return this.node(this._lexer.token, { kind: l.VARIABLE_DEFINITION, description: this.parseDescription(), variable: this.parseVariable(), type: (this.expectToken(a.COLON), this.parseTypeReference()), defaultValue: this.expectOptionalToken(a.EQUALS) ? this.parseConstValueLiteral() : void 0, directives: this.parseConstDirectives() });
|
|
814
|
+
}
|
|
815
|
+
parseVariable() {
|
|
816
|
+
let e = this._lexer.token;
|
|
817
|
+
return this.expectToken(a.DOLLAR), this.node(e, { kind: l.VARIABLE, name: this.parseName() });
|
|
818
|
+
}
|
|
819
|
+
parseSelectionSet() {
|
|
820
|
+
return this.node(this._lexer.token, { kind: l.SELECTION_SET, selections: this.many(a.BRACE_L, this.parseSelection, a.BRACE_R) });
|
|
821
|
+
}
|
|
822
|
+
parseSelection() {
|
|
823
|
+
return this.peek(a.SPREAD) ? this.parseFragment() : this.parseField();
|
|
824
|
+
}
|
|
825
|
+
parseField() {
|
|
826
|
+
let e = this._lexer.token, t = this.parseName(), i, n;
|
|
827
|
+
return this.expectOptionalToken(a.COLON) ? (i = t, n = this.parseName()) : n = t, this.node(e, { kind: l.FIELD, alias: i, name: n, arguments: this.parseArguments(!1), directives: this.parseDirectives(!1), selectionSet: this.peek(a.BRACE_L) ? this.parseSelectionSet() : void 0 });
|
|
828
|
+
}
|
|
829
|
+
parseArguments(e) {
|
|
830
|
+
let t = e ? this.parseConstArgument : this.parseArgument;
|
|
831
|
+
return this.optionalMany(a.PAREN_L, t, a.PAREN_R);
|
|
832
|
+
}
|
|
833
|
+
parseArgument(e = !1) {
|
|
834
|
+
let t = this._lexer.token, i = this.parseName();
|
|
835
|
+
return this.expectToken(a.COLON), this.node(t, { kind: l.ARGUMENT, name: i, value: this.parseValueLiteral(e) });
|
|
836
|
+
}
|
|
837
|
+
parseConstArgument() {
|
|
838
|
+
return this.parseArgument(!0);
|
|
839
|
+
}
|
|
840
|
+
parseFragment() {
|
|
841
|
+
let e = this._lexer.token;
|
|
842
|
+
this.expectToken(a.SPREAD);
|
|
843
|
+
let t = this.expectOptionalKeyword("on");
|
|
844
|
+
return !t && this.peek(a.NAME) ? this.node(e, { kind: l.FRAGMENT_SPREAD, name: this.parseFragmentName(), directives: this.parseDirectives(!1) }) : this.node(e, { kind: l.INLINE_FRAGMENT, typeCondition: t ? this.parseNamedType() : void 0, directives: this.parseDirectives(!1), selectionSet: this.parseSelectionSet() });
|
|
845
|
+
}
|
|
846
|
+
parseFragmentDefinition() {
|
|
847
|
+
let e = this._lexer.token, t = this.parseDescription();
|
|
848
|
+
return this.expectKeyword("fragment"), this._options.allowLegacyFragmentVariables === !0 ? this.node(e, { kind: l.FRAGMENT_DEFINITION, description: t, name: this.parseFragmentName(), variableDefinitions: this.parseVariableDefinitions(), typeCondition: (this.expectKeyword("on"), this.parseNamedType()), directives: this.parseDirectives(!1), selectionSet: this.parseSelectionSet() }) : this.node(e, { kind: l.FRAGMENT_DEFINITION, description: t, name: this.parseFragmentName(), typeCondition: (this.expectKeyword("on"), this.parseNamedType()), directives: this.parseDirectives(!1), selectionSet: this.parseSelectionSet() });
|
|
849
|
+
}
|
|
850
|
+
parseFragmentName() {
|
|
851
|
+
if (this._lexer.token.value === "on") throw this.unexpected();
|
|
852
|
+
return this.parseName();
|
|
853
|
+
}
|
|
854
|
+
parseValueLiteral(e) {
|
|
855
|
+
let t = this._lexer.token;
|
|
856
|
+
switch (t.kind) {
|
|
857
|
+
case a.BRACKET_L:
|
|
858
|
+
return this.parseList(e);
|
|
859
|
+
case a.BRACE_L:
|
|
860
|
+
return this.parseObject(e);
|
|
861
|
+
case a.INT:
|
|
862
|
+
return this.advanceLexer(), this.node(t, { kind: l.INT, value: t.value });
|
|
863
|
+
case a.FLOAT:
|
|
864
|
+
return this.advanceLexer(), this.node(t, { kind: l.FLOAT, value: t.value });
|
|
865
|
+
case a.STRING:
|
|
866
|
+
case a.BLOCK_STRING:
|
|
867
|
+
return this.parseStringLiteral();
|
|
868
|
+
case a.NAME:
|
|
869
|
+
switch (this.advanceLexer(), t.value) {
|
|
870
|
+
case "true":
|
|
871
|
+
return this.node(t, { kind: l.BOOLEAN, value: !0 });
|
|
872
|
+
case "false":
|
|
873
|
+
return this.node(t, { kind: l.BOOLEAN, value: !1 });
|
|
874
|
+
case "null":
|
|
875
|
+
return this.node(t, { kind: l.NULL });
|
|
876
|
+
default:
|
|
877
|
+
return this.node(t, { kind: l.ENUM, value: t.value });
|
|
878
|
+
}
|
|
879
|
+
case a.DOLLAR:
|
|
880
|
+
if (e) if (this.expectToken(a.DOLLAR), this._lexer.token.kind === a.NAME) {
|
|
881
|
+
let i = this._lexer.token.value;
|
|
882
|
+
throw f(this._lexer.source, t.start, `Unexpected variable "$${i}" in constant value.`);
|
|
883
|
+
} else throw this.unexpected(t);
|
|
884
|
+
return this.parseVariable();
|
|
885
|
+
default:
|
|
886
|
+
throw this.unexpected();
|
|
887
|
+
}
|
|
888
|
+
}
|
|
889
|
+
parseConstValueLiteral() {
|
|
890
|
+
return this.parseValueLiteral(!0);
|
|
891
|
+
}
|
|
892
|
+
parseStringLiteral() {
|
|
893
|
+
let e = this._lexer.token;
|
|
894
|
+
return this.advanceLexer(), this.node(e, { kind: l.STRING, value: e.value, block: e.kind === a.BLOCK_STRING });
|
|
895
|
+
}
|
|
896
|
+
parseList(e) {
|
|
897
|
+
let t = () => this.parseValueLiteral(e);
|
|
898
|
+
return this.node(this._lexer.token, { kind: l.LIST, values: this.any(a.BRACKET_L, t, a.BRACKET_R) });
|
|
899
|
+
}
|
|
900
|
+
parseObject(e) {
|
|
901
|
+
let t = () => this.parseObjectField(e);
|
|
902
|
+
return this.node(this._lexer.token, { kind: l.OBJECT, fields: this.any(a.BRACE_L, t, a.BRACE_R) });
|
|
903
|
+
}
|
|
904
|
+
parseObjectField(e) {
|
|
905
|
+
let t = this._lexer.token, i = this.parseName();
|
|
906
|
+
return this.expectToken(a.COLON), this.node(t, { kind: l.OBJECT_FIELD, name: i, value: this.parseValueLiteral(e) });
|
|
907
|
+
}
|
|
908
|
+
parseDirectives(e) {
|
|
909
|
+
let t = [];
|
|
910
|
+
for (; this.peek(a.AT); ) t.push(this.parseDirective(e));
|
|
911
|
+
return t;
|
|
912
|
+
}
|
|
913
|
+
parseConstDirectives() {
|
|
914
|
+
return this.parseDirectives(!0);
|
|
915
|
+
}
|
|
916
|
+
parseDirective(e) {
|
|
917
|
+
let t = this._lexer.token;
|
|
918
|
+
return this.expectToken(a.AT), this.node(t, { kind: l.DIRECTIVE, name: this.parseName(), arguments: this.parseArguments(e) });
|
|
919
|
+
}
|
|
920
|
+
parseTypeReference() {
|
|
921
|
+
let e = this._lexer.token, t;
|
|
922
|
+
if (this.expectOptionalToken(a.BRACKET_L)) {
|
|
923
|
+
let i = this.parseTypeReference();
|
|
924
|
+
this.expectToken(a.BRACKET_R), t = this.node(e, { kind: l.LIST_TYPE, type: i });
|
|
925
|
+
} else t = this.parseNamedType();
|
|
926
|
+
return this.expectOptionalToken(a.BANG) ? this.node(e, { kind: l.NON_NULL_TYPE, type: t }) : t;
|
|
927
|
+
}
|
|
928
|
+
parseNamedType() {
|
|
929
|
+
return this.node(this._lexer.token, { kind: l.NAMED_TYPE, name: this.parseName() });
|
|
930
|
+
}
|
|
931
|
+
peekDescription() {
|
|
932
|
+
return this.peek(a.STRING) || this.peek(a.BLOCK_STRING);
|
|
933
|
+
}
|
|
934
|
+
parseDescription() {
|
|
935
|
+
if (this.peekDescription()) return this.parseStringLiteral();
|
|
936
|
+
}
|
|
937
|
+
parseSchemaDefinition() {
|
|
938
|
+
let e = this._lexer.token, t = this.parseDescription();
|
|
939
|
+
this.expectKeyword("schema");
|
|
940
|
+
let i = this.parseConstDirectives(), n = this.many(a.BRACE_L, this.parseOperationTypeDefinition, a.BRACE_R);
|
|
941
|
+
return this.node(e, { kind: l.SCHEMA_DEFINITION, description: t, directives: i, operationTypes: n });
|
|
942
|
+
}
|
|
943
|
+
parseOperationTypeDefinition() {
|
|
944
|
+
let e = this._lexer.token, t = this.parseOperationType();
|
|
945
|
+
this.expectToken(a.COLON);
|
|
946
|
+
let i = this.parseNamedType();
|
|
947
|
+
return this.node(e, { kind: l.OPERATION_TYPE_DEFINITION, operation: t, type: i });
|
|
948
|
+
}
|
|
949
|
+
parseScalarTypeDefinition() {
|
|
950
|
+
let e = this._lexer.token, t = this.parseDescription();
|
|
951
|
+
this.expectKeyword("scalar");
|
|
952
|
+
let i = this.parseName(), n = this.parseConstDirectives();
|
|
953
|
+
return this.node(e, { kind: l.SCALAR_TYPE_DEFINITION, description: t, name: i, directives: n });
|
|
954
|
+
}
|
|
955
|
+
parseObjectTypeDefinition() {
|
|
956
|
+
let e = this._lexer.token, t = this.parseDescription();
|
|
957
|
+
this.expectKeyword("type");
|
|
958
|
+
let i = this.parseName(), n = this.parseImplementsInterfaces(), r = this.parseConstDirectives(), s = this.parseFieldsDefinition();
|
|
959
|
+
return this.node(e, { kind: l.OBJECT_TYPE_DEFINITION, description: t, name: i, interfaces: n, directives: r, fields: s });
|
|
960
|
+
}
|
|
961
|
+
parseImplementsInterfaces() {
|
|
962
|
+
return this.expectOptionalKeyword("implements") ? this.delimitedMany(a.AMP, this.parseNamedType) : [];
|
|
963
|
+
}
|
|
964
|
+
parseFieldsDefinition() {
|
|
965
|
+
return this.optionalMany(a.BRACE_L, this.parseFieldDefinition, a.BRACE_R);
|
|
966
|
+
}
|
|
967
|
+
parseFieldDefinition() {
|
|
968
|
+
let e = this._lexer.token, t = this.parseDescription(), i = this.parseName(), n = this.parseArgumentDefs();
|
|
969
|
+
this.expectToken(a.COLON);
|
|
970
|
+
let r = this.parseTypeReference(), s = this.parseConstDirectives();
|
|
971
|
+
return this.node(e, { kind: l.FIELD_DEFINITION, description: t, name: i, arguments: n, type: r, directives: s });
|
|
972
|
+
}
|
|
973
|
+
parseArgumentDefs() {
|
|
974
|
+
return this.optionalMany(a.PAREN_L, this.parseInputValueDef, a.PAREN_R);
|
|
975
|
+
}
|
|
976
|
+
parseInputValueDef() {
|
|
977
|
+
let e = this._lexer.token, t = this.parseDescription(), i = this.parseName();
|
|
978
|
+
this.expectToken(a.COLON);
|
|
979
|
+
let n = this.parseTypeReference(), r;
|
|
980
|
+
this.expectOptionalToken(a.EQUALS) && (r = this.parseConstValueLiteral());
|
|
981
|
+
let s = this.parseConstDirectives();
|
|
982
|
+
return this.node(e, { kind: l.INPUT_VALUE_DEFINITION, description: t, name: i, type: n, defaultValue: r, directives: s });
|
|
983
|
+
}
|
|
984
|
+
parseInterfaceTypeDefinition() {
|
|
985
|
+
let e = this._lexer.token, t = this.parseDescription();
|
|
986
|
+
this.expectKeyword("interface");
|
|
987
|
+
let i = this.parseName(), n = this.parseImplementsInterfaces(), r = this.parseConstDirectives(), s = this.parseFieldsDefinition();
|
|
988
|
+
return this.node(e, { kind: l.INTERFACE_TYPE_DEFINITION, description: t, name: i, interfaces: n, directives: r, fields: s });
|
|
989
|
+
}
|
|
990
|
+
parseUnionTypeDefinition() {
|
|
991
|
+
let e = this._lexer.token, t = this.parseDescription();
|
|
992
|
+
this.expectKeyword("union");
|
|
993
|
+
let i = this.parseName(), n = this.parseConstDirectives(), r = this.parseUnionMemberTypes();
|
|
994
|
+
return this.node(e, { kind: l.UNION_TYPE_DEFINITION, description: t, name: i, directives: n, types: r });
|
|
995
|
+
}
|
|
996
|
+
parseUnionMemberTypes() {
|
|
997
|
+
return this.expectOptionalToken(a.EQUALS) ? this.delimitedMany(a.PIPE, this.parseNamedType) : [];
|
|
998
|
+
}
|
|
999
|
+
parseEnumTypeDefinition() {
|
|
1000
|
+
let e = this._lexer.token, t = this.parseDescription();
|
|
1001
|
+
this.expectKeyword("enum");
|
|
1002
|
+
let i = this.parseName(), n = this.parseConstDirectives(), r = this.parseEnumValuesDefinition();
|
|
1003
|
+
return this.node(e, { kind: l.ENUM_TYPE_DEFINITION, description: t, name: i, directives: n, values: r });
|
|
1004
|
+
}
|
|
1005
|
+
parseEnumValuesDefinition() {
|
|
1006
|
+
return this.optionalMany(a.BRACE_L, this.parseEnumValueDefinition, a.BRACE_R);
|
|
1007
|
+
}
|
|
1008
|
+
parseEnumValueDefinition() {
|
|
1009
|
+
let e = this._lexer.token, t = this.parseDescription(), i = this.parseEnumValueName(), n = this.parseConstDirectives();
|
|
1010
|
+
return this.node(e, { kind: l.ENUM_VALUE_DEFINITION, description: t, name: i, directives: n });
|
|
1011
|
+
}
|
|
1012
|
+
parseEnumValueName() {
|
|
1013
|
+
if (this._lexer.token.value === "true" || this._lexer.token.value === "false" || this._lexer.token.value === "null") throw f(this._lexer.source, this._lexer.token.start, `${P(this._lexer.token)} is reserved and cannot be used for an enum value.`);
|
|
1014
|
+
return this.parseName();
|
|
1015
|
+
}
|
|
1016
|
+
parseInputObjectTypeDefinition() {
|
|
1017
|
+
let e = this._lexer.token, t = this.parseDescription();
|
|
1018
|
+
this.expectKeyword("input");
|
|
1019
|
+
let i = this.parseName(), n = this.parseConstDirectives(), r = this.parseInputFieldsDefinition();
|
|
1020
|
+
return this.node(e, { kind: l.INPUT_OBJECT_TYPE_DEFINITION, description: t, name: i, directives: n, fields: r });
|
|
1021
|
+
}
|
|
1022
|
+
parseInputFieldsDefinition() {
|
|
1023
|
+
return this.optionalMany(a.BRACE_L, this.parseInputValueDef, a.BRACE_R);
|
|
1024
|
+
}
|
|
1025
|
+
parseTypeSystemExtension() {
|
|
1026
|
+
let e = this._lexer.lookahead();
|
|
1027
|
+
if (e.kind === a.NAME) switch (e.value) {
|
|
1028
|
+
case "schema":
|
|
1029
|
+
return this.parseSchemaExtension();
|
|
1030
|
+
case "scalar":
|
|
1031
|
+
return this.parseScalarTypeExtension();
|
|
1032
|
+
case "type":
|
|
1033
|
+
return this.parseObjectTypeExtension();
|
|
1034
|
+
case "interface":
|
|
1035
|
+
return this.parseInterfaceTypeExtension();
|
|
1036
|
+
case "union":
|
|
1037
|
+
return this.parseUnionTypeExtension();
|
|
1038
|
+
case "enum":
|
|
1039
|
+
return this.parseEnumTypeExtension();
|
|
1040
|
+
case "input":
|
|
1041
|
+
return this.parseInputObjectTypeExtension();
|
|
1042
|
+
}
|
|
1043
|
+
throw this.unexpected(e);
|
|
1044
|
+
}
|
|
1045
|
+
parseSchemaExtension() {
|
|
1046
|
+
let e = this._lexer.token;
|
|
1047
|
+
this.expectKeyword("extend"), this.expectKeyword("schema");
|
|
1048
|
+
let t = this.parseConstDirectives(), i = this.optionalMany(a.BRACE_L, this.parseOperationTypeDefinition, a.BRACE_R);
|
|
1049
|
+
if (t.length === 0 && i.length === 0) throw this.unexpected();
|
|
1050
|
+
return this.node(e, { kind: l.SCHEMA_EXTENSION, directives: t, operationTypes: i });
|
|
1051
|
+
}
|
|
1052
|
+
parseScalarTypeExtension() {
|
|
1053
|
+
let e = this._lexer.token;
|
|
1054
|
+
this.expectKeyword("extend"), this.expectKeyword("scalar");
|
|
1055
|
+
let t = this.parseName(), i = this.parseConstDirectives();
|
|
1056
|
+
if (i.length === 0) throw this.unexpected();
|
|
1057
|
+
return this.node(e, { kind: l.SCALAR_TYPE_EXTENSION, name: t, directives: i });
|
|
1058
|
+
}
|
|
1059
|
+
parseObjectTypeExtension() {
|
|
1060
|
+
let e = this._lexer.token;
|
|
1061
|
+
this.expectKeyword("extend"), this.expectKeyword("type");
|
|
1062
|
+
let t = this.parseName(), i = this.parseImplementsInterfaces(), n = this.parseConstDirectives(), r = this.parseFieldsDefinition();
|
|
1063
|
+
if (i.length === 0 && n.length === 0 && r.length === 0) throw this.unexpected();
|
|
1064
|
+
return this.node(e, { kind: l.OBJECT_TYPE_EXTENSION, name: t, interfaces: i, directives: n, fields: r });
|
|
1065
|
+
}
|
|
1066
|
+
parseInterfaceTypeExtension() {
|
|
1067
|
+
let e = this._lexer.token;
|
|
1068
|
+
this.expectKeyword("extend"), this.expectKeyword("interface");
|
|
1069
|
+
let t = this.parseName(), i = this.parseImplementsInterfaces(), n = this.parseConstDirectives(), r = this.parseFieldsDefinition();
|
|
1070
|
+
if (i.length === 0 && n.length === 0 && r.length === 0) throw this.unexpected();
|
|
1071
|
+
return this.node(e, { kind: l.INTERFACE_TYPE_EXTENSION, name: t, interfaces: i, directives: n, fields: r });
|
|
1072
|
+
}
|
|
1073
|
+
parseUnionTypeExtension() {
|
|
1074
|
+
let e = this._lexer.token;
|
|
1075
|
+
this.expectKeyword("extend"), this.expectKeyword("union");
|
|
1076
|
+
let t = this.parseName(), i = this.parseConstDirectives(), n = this.parseUnionMemberTypes();
|
|
1077
|
+
if (i.length === 0 && n.length === 0) throw this.unexpected();
|
|
1078
|
+
return this.node(e, { kind: l.UNION_TYPE_EXTENSION, name: t, directives: i, types: n });
|
|
1079
|
+
}
|
|
1080
|
+
parseEnumTypeExtension() {
|
|
1081
|
+
let e = this._lexer.token;
|
|
1082
|
+
this.expectKeyword("extend"), this.expectKeyword("enum");
|
|
1083
|
+
let t = this.parseName(), i = this.parseConstDirectives(), n = this.parseEnumValuesDefinition();
|
|
1084
|
+
if (i.length === 0 && n.length === 0) throw this.unexpected();
|
|
1085
|
+
return this.node(e, { kind: l.ENUM_TYPE_EXTENSION, name: t, directives: i, values: n });
|
|
1086
|
+
}
|
|
1087
|
+
parseInputObjectTypeExtension() {
|
|
1088
|
+
let e = this._lexer.token;
|
|
1089
|
+
this.expectKeyword("extend"), this.expectKeyword("input");
|
|
1090
|
+
let t = this.parseName(), i = this.parseConstDirectives(), n = this.parseInputFieldsDefinition();
|
|
1091
|
+
if (i.length === 0 && n.length === 0) throw this.unexpected();
|
|
1092
|
+
return this.node(e, { kind: l.INPUT_OBJECT_TYPE_EXTENSION, name: t, directives: i, fields: n });
|
|
1093
|
+
}
|
|
1094
|
+
parseDirectiveDefinition() {
|
|
1095
|
+
let e = this._lexer.token, t = this.parseDescription();
|
|
1096
|
+
this.expectKeyword("directive"), this.expectToken(a.AT);
|
|
1097
|
+
let i = this.parseName(), n = this.parseArgumentDefs(), r = this.expectOptionalKeyword("repeatable");
|
|
1098
|
+
this.expectKeyword("on");
|
|
1099
|
+
let s = this.parseDirectiveLocations();
|
|
1100
|
+
return this.node(e, { kind: l.DIRECTIVE_DEFINITION, description: t, name: i, arguments: n, repeatable: r, locations: s });
|
|
1101
|
+
}
|
|
1102
|
+
parseDirectiveLocations() {
|
|
1103
|
+
return this.delimitedMany(a.PIPE, this.parseDirectiveLocation);
|
|
1104
|
+
}
|
|
1105
|
+
parseDirectiveLocation() {
|
|
1106
|
+
let e = this._lexer.token, t = this.parseName();
|
|
1107
|
+
if (Object.prototype.hasOwnProperty.call(G, t.value)) return t;
|
|
1108
|
+
throw this.unexpected(e);
|
|
1109
|
+
}
|
|
1110
|
+
parseSchemaCoordinate() {
|
|
1111
|
+
let e = this._lexer.token, t = this.expectOptionalToken(a.AT), i = this.parseName(), n;
|
|
1112
|
+
!t && this.expectOptionalToken(a.DOT) && (n = this.parseName());
|
|
1113
|
+
let r;
|
|
1114
|
+
return (t || n) && this.expectOptionalToken(a.PAREN_L) && (r = this.parseName(), this.expectToken(a.COLON), this.expectToken(a.PAREN_R)), t ? r ? this.node(e, { kind: l.DIRECTIVE_ARGUMENT_COORDINATE, name: i, argumentName: r }) : this.node(e, { kind: l.DIRECTIVE_COORDINATE, name: i }) : n ? r ? this.node(e, { kind: l.ARGUMENT_COORDINATE, name: i, fieldName: n, argumentName: r }) : this.node(e, { kind: l.MEMBER_COORDINATE, name: i, memberName: n }) : this.node(e, { kind: l.TYPE_COORDINATE, name: i });
|
|
1115
|
+
}
|
|
1116
|
+
node(e, t) {
|
|
1117
|
+
return this._options.noLocation !== !0 && (t.loc = new Ze(e, this._lexer.lastToken, this._lexer.source)), t;
|
|
1118
|
+
}
|
|
1119
|
+
peek(e) {
|
|
1120
|
+
return this._lexer.token.kind === e;
|
|
1121
|
+
}
|
|
1122
|
+
expectToken(e) {
|
|
1123
|
+
let t = this._lexer.token;
|
|
1124
|
+
if (t.kind === e) return this.advanceLexer(), t;
|
|
1125
|
+
throw f(this._lexer.source, t.start, `Expected ${Ne(e)}, found ${P(t)}.`);
|
|
1126
|
+
}
|
|
1127
|
+
expectOptionalToken(e) {
|
|
1128
|
+
return this._lexer.token.kind === e ? (this.advanceLexer(), !0) : !1;
|
|
1129
|
+
}
|
|
1130
|
+
expectKeyword(e) {
|
|
1131
|
+
let t = this._lexer.token;
|
|
1132
|
+
if (t.kind === a.NAME && t.value === e) this.advanceLexer();
|
|
1133
|
+
else throw f(this._lexer.source, t.start, `Expected "${e}", found ${P(t)}.`);
|
|
1134
|
+
}
|
|
1135
|
+
expectOptionalKeyword(e) {
|
|
1136
|
+
let t = this._lexer.token;
|
|
1137
|
+
return t.kind === a.NAME && t.value === e ? (this.advanceLexer(), !0) : !1;
|
|
1138
|
+
}
|
|
1139
|
+
unexpected(e) {
|
|
1140
|
+
let t = e ?? this._lexer.token;
|
|
1141
|
+
return f(this._lexer.source, t.start, `Unexpected ${P(t)}.`);
|
|
1142
|
+
}
|
|
1143
|
+
any(e, t, i) {
|
|
1144
|
+
this.expectToken(e);
|
|
1145
|
+
let n = [];
|
|
1146
|
+
for (; !this.expectOptionalToken(i); ) n.push(t.call(this));
|
|
1147
|
+
return n;
|
|
1148
|
+
}
|
|
1149
|
+
optionalMany(e, t, i) {
|
|
1150
|
+
if (this.expectOptionalToken(e)) {
|
|
1151
|
+
let n = [];
|
|
1152
|
+
do
|
|
1153
|
+
n.push(t.call(this));
|
|
1154
|
+
while (!this.expectOptionalToken(i));
|
|
1155
|
+
return n;
|
|
1156
|
+
}
|
|
1157
|
+
return [];
|
|
1158
|
+
}
|
|
1159
|
+
many(e, t, i) {
|
|
1160
|
+
this.expectToken(e);
|
|
1161
|
+
let n = [];
|
|
1162
|
+
do
|
|
1163
|
+
n.push(t.call(this));
|
|
1164
|
+
while (!this.expectOptionalToken(i));
|
|
1165
|
+
return n;
|
|
1166
|
+
}
|
|
1167
|
+
delimitedMany(e, t) {
|
|
1168
|
+
this.expectOptionalToken(e);
|
|
1169
|
+
let i = [];
|
|
1170
|
+
do
|
|
1171
|
+
i.push(t.call(this));
|
|
1172
|
+
while (this.expectOptionalToken(e));
|
|
1173
|
+
return i;
|
|
1174
|
+
}
|
|
1175
|
+
advanceLexer() {
|
|
1176
|
+
let { maxTokens: e } = this._options, t = this._lexer.advance();
|
|
1177
|
+
if (t.kind !== a.EOF && (++this._tokenCounter, e !== void 0 && this._tokenCounter > e)) throw f(this._lexer.source, t.start, `Document contains more that ${e} tokens. Parsing aborted.`);
|
|
1178
|
+
}
|
|
1179
|
+
};
|
|
1180
|
+
function P(e) {
|
|
1181
|
+
let t = e.value;
|
|
1182
|
+
return Ne(e.kind) + (t != null ? ` "${t}"` : "");
|
|
1183
|
+
}
|
|
1184
|
+
function Ne(e) {
|
|
1185
|
+
return bt(e) ? `"${e}"` : e;
|
|
1186
|
+
}
|
|
1187
|
+
function Wt(e, t) {
|
|
1188
|
+
let i = new SyntaxError(e + " (" + t.loc.start.line + ":" + t.loc.start.column + ")");
|
|
1189
|
+
return Object.assign(i, t);
|
|
1190
|
+
}
|
|
1191
|
+
var Zt = Wt;
|
|
1192
|
+
function ei(e) {
|
|
1193
|
+
let t = [], { startToken: i, endToken: n } = e.loc;
|
|
1194
|
+
for (let r = i; r !== n; r = r.next) r.kind === "Comment" && t.push({ ...r, loc: { start: r.start, end: r.end } });
|
|
1195
|
+
return t;
|
|
1196
|
+
}
|
|
1197
|
+
var ti = { allowLegacyFragmentVariables: !0 };
|
|
1198
|
+
function ii(e) {
|
|
1199
|
+
if ((e == null ? void 0 : e.name) === "GraphQLError") {
|
|
1200
|
+
let { message: t, locations: [i] } = e;
|
|
1201
|
+
return Zt(t, { loc: { start: i }, cause: e });
|
|
1202
|
+
}
|
|
1203
|
+
return e;
|
|
1204
|
+
}
|
|
1205
|
+
function ni(e) {
|
|
1206
|
+
let t;
|
|
1207
|
+
try {
|
|
1208
|
+
t = zt(e, ti);
|
|
1209
|
+
} catch (i) {
|
|
1210
|
+
throw ii(i);
|
|
1211
|
+
}
|
|
1212
|
+
return t.comments = ei(t), t;
|
|
1213
|
+
}
|
|
1214
|
+
var ri = { parse: ni, astFormat: "graphql", hasPragma: at, hasIgnorePragma: ot, locStart: ae, locEnd: oe }, si = { graphql: mt };
|
|
1215
|
+
export {
|
|
1216
|
+
Oe as default,
|
|
1217
|
+
Tt as languages,
|
|
1218
|
+
vt as options,
|
|
1219
|
+
ce as parsers,
|
|
1220
|
+
si as printers
|
|
1221
|
+
};
|