@zuplo/graphql 5.2424.0 → 5.2427.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +4 -4
- package/out/cjs/index.js +0 -181
- package/out/cjs/index.js.LEGAL.txt +0 -0
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zuplo/graphql",
|
|
3
|
-
"
|
|
3
|
+
"type": "module",
|
|
4
|
+
"version": "5.2427.0",
|
|
4
5
|
"repository": "https://github.com/zuplo/zuplo",
|
|
5
6
|
"author": "Zuplo, Inc.",
|
|
6
7
|
"exports": {
|
|
7
8
|
".": {
|
|
8
|
-
"
|
|
9
|
-
"worker": "./out/esm/index.js",
|
|
9
|
+
"import": "./out/index.js",
|
|
10
10
|
"types": "./out/types/index.d.ts"
|
|
11
11
|
}
|
|
12
12
|
},
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"LICENSE.txt"
|
|
25
25
|
],
|
|
26
26
|
"devDependencies": {
|
|
27
|
-
"@types/node": "^18.
|
|
27
|
+
"@types/node": "^18.14.0",
|
|
28
28
|
"typescript": "^5.5.4"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
package/out/cjs/index.js
DELETED
|
@@ -1,181 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
/*---------------------------------------------------------------------------------------------
|
|
3
|
-
* Copyright (c) Zuplo, Inc. All rights reserved.
|
|
4
|
-
*
|
|
5
|
-
* This software and associated documentation files (the "Software") is intended to be used
|
|
6
|
-
* only by Zuplo customers solely to develop and test applications that will be deployed
|
|
7
|
-
* to Zuplo hosted services. You and others in your organization may use these files on your
|
|
8
|
-
* Development Devices solely for the above stated purpose.
|
|
9
|
-
*
|
|
10
|
-
* Outside of uses stated above, no license is granted for any other purpose including
|
|
11
|
-
* without limitation the rights to use, copy, modify, merge, publish, distribute,
|
|
12
|
-
* sublicense, host, and/or sell copies of the Software.
|
|
13
|
-
*
|
|
14
|
-
* The software may include third party components with separate legal notices or governed by
|
|
15
|
-
* other agreements, as described in licenses either embedded in or accompanying the Software.
|
|
16
|
-
*
|
|
17
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
|
18
|
-
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
|
19
|
-
* PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
|
|
20
|
-
* FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
|
21
|
-
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
|
22
|
-
* DEALINGS IN THE SOFTWARE.
|
|
23
|
-
*--------------------------------------------------------------------------------------------*/
|
|
24
|
-
|
|
25
|
-
"use strict";var et=Object.defineProperty;var Pn=Object.getOwnPropertyDescriptor;var Qn=Object.getOwnPropertyNames;var Bn=Object.prototype.hasOwnProperty;var s=(e,t)=>et(e,"name",{value:t,configurable:!0});var qn=(e,t)=>{for(var n in t)et(e,n,{get:t[n],enumerable:!0})},Jn=(e,t,n,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of Qn(t))!Bn.call(e,r)&&r!==n&&et(e,r,{get:()=>t[r],enumerable:!(i=Pn(t,r))||i.enumerable});return e};var Yn=e=>Jn(et({},"__esModule",{value:!0}),e);var er={};qn(er,{GraphQLComplexityLimitInboundPolicy:()=>Un,GraphQLDisableIntrospectionInboundPolicy:()=>Gn});module.exports=Yn(er);var Ft=require("@zuplo/runtime");function I(e,t){if(!!!e)throw new Error(t)}s(I,"devAssert");function k(e){return typeof e=="object"&&e!==null}s(k,"isObjectLike");function oe(e,t){if(!!!e)throw new Error(t??"Unexpected invariant triggered.")}s(oe,"invariant");var zn=/\r\n|[\n\r]/g;function Se(e,t){let n=0,i=1;for(let r of e.body.matchAll(zn)){if(typeof r.index=="number"||oe(!1),r.index>=t)break;n=r.index+r[0].length,i+=1}return{line:i,column:t+1-n}}s(Se,"getLocation");function Vt(e){return tt(e.source,Se(e.source,e.start))}s(Vt,"printLocation");function tt(e,t){let n=e.locationOffset.column-1,i="".padStart(n)+e.body,r=t.line-1,o=e.locationOffset.line-1,a=t.line+o,c=t.line===1?n:0,d=t.column+c,f=`${e.name}:${a}:${d}
|
|
26
|
-
`,T=i.split(/\r\n|[\n\r]/g),x=T[r];if(x.length>120){let N=Math.floor(d/80),S=d%80,g=[];for(let U=0;U<x.length;U+=80)g.push(x.slice(U,U+80));return f+an([[`${a} |`,g[0]],...g.slice(1,N+1).map(U=>["|",U]),["|","^".padStart(S)],["|",g[N+1]]])}return f+an([[`${a-1} |`,T[r-1]],[`${a} |`,x],["|","^".padStart(d)],[`${a+1} |`,T[r+1]]])}s(tt,"printSourceLocation");function an(e){let t=e.filter(([i,r])=>r!==void 0),n=Math.max(...t.map(([i])=>i.length));return t.map(([i,r])=>i.padStart(n)+(r?" "+r:"")).join(`
|
|
27
|
-
`)}s(an,"printPrefixedLines");function Kn(e){let t=e[0];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}s(Kn,"toNormalizedOptions");var y=class e extends Error{static{s(this,"GraphQLError")}constructor(t,...n){var i,r,o;let{nodes:a,source:c,positions:d,path:f,originalError:T,extensions:x}=Kn(n);super(t),this.name="GraphQLError",this.path=f??void 0,this.originalError=T??void 0,this.nodes=pn(Array.isArray(a)?a:a?[a]:void 0);let N=pn((i=this.nodes)===null||i===void 0?void 0:i.map(g=>g.loc).filter(g=>g!=null));this.source=c??(N==null||(r=N[0])===null||r===void 0?void 0:r.source),this.positions=d??N?.map(g=>g.start),this.locations=d&&c?d.map(g=>Se(c,g)):N?.map(g=>Se(g.source,g.start));let S=k(T?.extensions)?T?.extensions:void 0;this.extensions=(o=x??S)!==null&&o!==void 0?o: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}}),T!=null&&T.stack?Object.defineProperty(this,"stack",{value:T.stack,writable:!0,configurable:!0}):Error.captureStackTrace?Error.captureStackTrace(this,e):Object.defineProperty(this,"stack",{value:Error().stack,writable:!0,configurable:!0})}get[Symbol.toStringTag](){return"GraphQLError"}toString(){let t=this.message;if(this.nodes)for(let n of this.nodes)n.loc&&(t+=`
|
|
28
|
-
|
|
29
|
-
`+Vt(n.loc));else if(this.source&&this.locations)for(let n of this.locations)t+=`
|
|
30
|
-
|
|
31
|
-
`+tt(this.source,n);return t}toJSON(){let t={message:this.message};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}};function pn(e){return e===void 0||e.length===0?void 0:e}s(pn,"undefinedIfEmpty");function D(e,t,n){return new y(`Syntax Error: ${n}`,{source:e,positions:[t]})}s(D,"syntaxError");var Me=class{static{s(this,"Location")}constructor(t,n,i){this.start=t.start,this.end=n.end,this.startToken=t,this.endToken=n,this.source=i}get[Symbol.toStringTag](){return"Location"}toJSON(){return{start:this.start,end:this.end}}},Le=class{static{s(this,"Token")}constructor(t,n,i,r,o,a){this.kind=t,this.start=n,this.end=i,this.line=r,this.column=o,this.value=a,this.prev=null,this.next=null}get[Symbol.toStringTag](){return"Token"}toJSON(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}}},Ut={Name:[],Document:["definitions"],OperationDefinition:["name","variableDefinitions","directives","selectionSet"],VariableDefinition:["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:["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"]},Hn=new Set(Object.keys(Ut));function Ge(e){let t=e?.kind;return typeof t=="string"&&Hn.has(t)}s(Ge,"isNode");var H;(function(e){e.QUERY="query",e.MUTATION="mutation",e.SUBSCRIPTION="subscription"})(H||(H={}));var b;(function(e){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"})(b||(b={}));var p;(function(e){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"})(p||(p={}));function nt(e){return e===9||e===32}s(nt,"isWhiteSpace");function Oe(e){return e>=48&&e<=57}s(Oe,"isDigit");function cn(e){return e>=97&&e<=122||e>=65&&e<=90}s(cn,"isLetter");function je(e){return cn(e)||e===95}s(je,"isNameStart");function it(e){return cn(e)||Oe(e)||e===95}s(it,"isNameContinue");function un(e){var t;let n=Number.MAX_SAFE_INTEGER,i=null,r=-1;for(let a=0;a<e.length;++a){var o;let c=e[a],d=Xn(c);d!==c.length&&(i=(o=i)!==null&&o!==void 0?o:a,r=a,a!==0&&d<n&&(n=d))}return e.map((a,c)=>c===0?a:a.slice(n)).slice((t=i)!==null&&t!==void 0?t:0,r+1)}s(un,"dedentBlockStringLines");function Xn(e){let t=0;for(;t<e.length&&nt(e.charCodeAt(t));)++t;return t}s(Xn,"leadingWhitespace");function ln(e,t){let n=e.replace(/"""/g,'\\"""'),i=n.split(/\r\n|[\n\r]/g),r=i.length===1,o=i.length>1&&i.slice(1).every(S=>S.length===0||nt(S.charCodeAt(0))),a=n.endsWith('\\"""'),c=e.endsWith('"')&&!a,d=e.endsWith("\\"),f=c||d,T=!(t!=null&&t.minimize)&&(!r||e.length>70||f||o||a),x="",N=r&&nt(e.charCodeAt(0));return(T&&!N||o)&&(x+=`
|
|
32
|
-
`),x+=n,(T||f)&&(x+=`
|
|
33
|
-
`),'"""'+x+'"""'}s(ln,"printBlockString");var u;(function(e){e.SOF="<SOF>",e.EOF="<EOF>",e.BANG="!",e.DOLLAR="$",e.AMP="&",e.PAREN_L="(",e.PAREN_R=")",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"})(u||(u={}));var Pe=class{static{s(this,"Lexer")}constructor(t){let n=new Le(u.SOF,0,0,0,0);this.source=t,this.lastToken=n,this.token=n,this.line=1,this.lineStart=0}get[Symbol.toStringTag](){return"Lexer"}advance(){return this.lastToken=this.token,this.token=this.lookahead()}lookahead(){let t=this.token;if(t.kind!==u.EOF)do if(t.next)t=t.next;else{let n=Wn(this,t.end);t.next=n,n.prev=t,t=n}while(t.kind===u.COMMENT);return t}};function fn(e){return e===u.BANG||e===u.DOLLAR||e===u.AMP||e===u.PAREN_L||e===u.PAREN_R||e===u.SPREAD||e===u.COLON||e===u.EQUALS||e===u.AT||e===u.BRACKET_L||e===u.BRACKET_R||e===u.BRACE_L||e===u.PIPE||e===u.BRACE_R}s(fn,"isPunctuatorTokenKind");function Ae(e){return e>=0&&e<=55295||e>=57344&&e<=1114111}s(Ae,"isUnicodeScalarValue");function rt(e,t){return mn(e.charCodeAt(t))&&hn(e.charCodeAt(t+1))}s(rt,"isSupplementaryCodePoint");function mn(e){return e>=55296&&e<=56319}s(mn,"isLeadingSurrogate");function hn(e){return e>=56320&&e<=57343}s(hn,"isTrailingSurrogate");function ge(e,t){let n=e.source.body.codePointAt(t);if(n===void 0)return u.EOF;if(n>=32&&n<=126){let i=String.fromCodePoint(n);return i==='"'?`'"'`:`"${i}"`}return"U+"+n.toString(16).toUpperCase().padStart(4,"0")}s(ge,"printCodePointAt");function R(e,t,n,i,r){let o=e.line,a=1+n-e.lineStart;return new Le(t,n,i,o,a,r)}s(R,"createToken");function Wn(e,t){let n=e.source.body,i=n.length,r=t;for(;r<i;){let o=n.charCodeAt(r);switch(o){case 65279:case 9:case 32:case 44:++r;continue;case 10:++r,++e.line,e.lineStart=r;continue;case 13:n.charCodeAt(r+1)===10?r+=2:++r,++e.line,e.lineStart=r;continue;case 35:return Zn(e,r);case 33:return R(e,u.BANG,r,r+1);case 36:return R(e,u.DOLLAR,r,r+1);case 38:return R(e,u.AMP,r,r+1);case 40:return R(e,u.PAREN_L,r,r+1);case 41:return R(e,u.PAREN_R,r,r+1);case 46:if(n.charCodeAt(r+1)===46&&n.charCodeAt(r+2)===46)return R(e,u.SPREAD,r,r+3);break;case 58:return R(e,u.COLON,r,r+1);case 61:return R(e,u.EQUALS,r,r+1);case 64:return R(e,u.AT,r,r+1);case 91:return R(e,u.BRACKET_L,r,r+1);case 93:return R(e,u.BRACKET_R,r,r+1);case 123:return R(e,u.BRACE_L,r,r+1);case 124:return R(e,u.PIPE,r,r+1);case 125:return R(e,u.BRACE_R,r,r+1);case 34:return n.charCodeAt(r+1)===34&&n.charCodeAt(r+2)===34?si(e,r):ti(e,r)}if(Oe(o)||o===45)return ei(e,r,o);if(je(o))return oi(e,r);throw D(e.source,r,o===39?`Unexpected single quote character ('), did you mean to use a double quote (")?`:Ae(o)||rt(n,r)?`Unexpected character: ${ge(e,r)}.`:`Invalid character: ${ge(e,r)}.`)}return R(e,u.EOF,i,i)}s(Wn,"readNextToken");function Zn(e,t){let n=e.source.body,i=n.length,r=t+1;for(;r<i;){let o=n.charCodeAt(r);if(o===10||o===13)break;if(Ae(o))++r;else if(rt(n,r))r+=2;else break}return R(e,u.COMMENT,t,r,n.slice(t+1,r))}s(Zn,"readComment");function ei(e,t,n){let i=e.source.body,r=t,o=n,a=!1;if(o===45&&(o=i.charCodeAt(++r)),o===48){if(o=i.charCodeAt(++r),Oe(o))throw D(e.source,r,`Invalid number, unexpected digit after 0: ${ge(e,r)}.`)}else r=Mt(e,r,o),o=i.charCodeAt(r);if(o===46&&(a=!0,o=i.charCodeAt(++r),r=Mt(e,r,o),o=i.charCodeAt(r)),(o===69||o===101)&&(a=!0,o=i.charCodeAt(++r),(o===43||o===45)&&(o=i.charCodeAt(++r)),r=Mt(e,r,o),o=i.charCodeAt(r)),o===46||je(o))throw D(e.source,r,`Invalid number, expected digit but got: ${ge(e,r)}.`);return R(e,a?u.FLOAT:u.INT,t,r,i.slice(t,r))}s(ei,"readNumber");function Mt(e,t,n){if(!Oe(n))throw D(e.source,t,`Invalid number, expected digit but got: ${ge(e,t)}.`);let i=e.source.body,r=t+1;for(;Oe(i.charCodeAt(r));)++r;return r}s(Mt,"readDigits");function ti(e,t){let n=e.source.body,i=n.length,r=t+1,o=r,a="";for(;r<i;){let c=n.charCodeAt(r);if(c===34)return a+=n.slice(o,r),R(e,u.STRING,t,r+1,a);if(c===92){a+=n.slice(o,r);let d=n.charCodeAt(r+1)===117?n.charCodeAt(r+2)===123?ni(e,r):ii(e,r):ri(e,r);a+=d.value,r+=d.size,o=r;continue}if(c===10||c===13)break;if(Ae(c))++r;else if(rt(n,r))r+=2;else throw D(e.source,r,`Invalid character within String: ${ge(e,r)}.`)}throw D(e.source,r,"Unterminated string.")}s(ti,"readString");function ni(e,t){let n=e.source.body,i=0,r=3;for(;r<12;){let o=n.charCodeAt(t+r++);if(o===125){if(r<5||!Ae(i))break;return{value:String.fromCodePoint(i),size:r}}if(i=i<<4|$e(o),i<0)break}throw D(e.source,t,`Invalid Unicode escape sequence: "${n.slice(t,t+r)}".`)}s(ni,"readEscapedUnicodeVariableWidth");function ii(e,t){let n=e.source.body,i=dn(n,t+2);if(Ae(i))return{value:String.fromCodePoint(i),size:6};if(mn(i)&&n.charCodeAt(t+6)===92&&n.charCodeAt(t+7)===117){let r=dn(n,t+8);if(hn(r))return{value:String.fromCodePoint(i,r),size:12}}throw D(e.source,t,`Invalid Unicode escape sequence: "${n.slice(t,t+6)}".`)}s(ii,"readEscapedUnicodeFixedWidth");function dn(e,t){return $e(e.charCodeAt(t))<<12|$e(e.charCodeAt(t+1))<<8|$e(e.charCodeAt(t+2))<<4|$e(e.charCodeAt(t+3))}s(dn,"read16BitHexCode");function $e(e){return e>=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:-1}s($e,"readHexDigit");function ri(e,t){let n=e.source.body;switch(n.charCodeAt(t+1)){case 34:return{value:'"',size:2};case 92:return{value:"\\",size:2};case 47:return{value:"/",size:2};case 98:return{value:"\b",size:2};case 102:return{value:"\f",size:2};case 110:return{value:`
|
|
34
|
-
`,size:2};case 114:return{value:"\r",size:2};case 116:return{value:" ",size:2}}throw D(e.source,t,`Invalid character escape sequence: "${n.slice(t,t+2)}".`)}s(ri,"readEscapedCharacter");function si(e,t){let n=e.source.body,i=n.length,r=e.lineStart,o=t+3,a=o,c="",d=[];for(;o<i;){let f=n.charCodeAt(o);if(f===34&&n.charCodeAt(o+1)===34&&n.charCodeAt(o+2)===34){c+=n.slice(a,o),d.push(c);let T=R(e,u.BLOCK_STRING,t,o+3,un(d).join(`
|
|
35
|
-
`));return e.line+=d.length-1,e.lineStart=r,T}if(f===92&&n.charCodeAt(o+1)===34&&n.charCodeAt(o+2)===34&&n.charCodeAt(o+3)===34){c+=n.slice(a,o),a=o+1,o+=4;continue}if(f===10||f===13){c+=n.slice(a,o),d.push(c),f===13&&n.charCodeAt(o+1)===10?o+=2:++o,c="",a=o,r=o;continue}if(Ae(f))++o;else if(rt(n,o))o+=2;else throw D(e.source,o,`Invalid character within String: ${ge(e,o)}.`)}throw D(e.source,o,"Unterminated string.")}s(si,"readBlockString");function oi(e,t){let n=e.source.body,i=n.length,r=t+1;for(;r<i;){let o=n.charCodeAt(r);if(it(o))++r;else break}return R(e,u.NAME,t,r,n.slice(t,r))}s(oi,"readName");function m(e){return st(e,[])}s(m,"inspect");function st(e,t){switch(typeof e){case"string":return JSON.stringify(e);case"function":return e.name?`[function ${e.name}]`:"[function]";case"object":return ai(e,t);default:return String(e)}}s(st,"formatValue");function ai(e,t){if(e===null)return"null";if(t.includes(e))return"[Circular]";let n=[...t,e];if(pi(e)){let i=e.toJSON();if(i!==e)return typeof i=="string"?i:st(i,n)}else if(Array.isArray(e))return ui(e,n);return ci(e,n)}s(ai,"formatObjectValue");function pi(e){return typeof e.toJSON=="function"}s(pi,"isJSONable");function ci(e,t){let n=Object.entries(e);return n.length===0?"{}":t.length>2?"["+li(e)+"]":"{ "+n.map(([r,o])=>r+": "+st(o,t)).join(", ")+" }"}s(ci,"formatObject");function ui(e,t){if(e.length===0)return"[]";if(t.length>2)return"[Array]";let n=Math.min(10,e.length),i=e.length-n,r=[];for(let o=0;o<n;++o)r.push(st(e[o],t));return i===1?r.push("... 1 more item"):i>1&&r.push(`... ${i} more items`),"["+r.join(", ")+"]"}s(ui,"formatArray");function li(e){let t=Object.prototype.toString.call(e).replace(/^\[object /,"").replace(/]$/,"");if(t==="Object"&&typeof e.constructor=="function"){let n=e.constructor.name;if(typeof n=="string"&&n!=="")return n}return t}s(li,"getObjectTag");var q=globalThis.process&&globalThis.process.env.NODE_ENV==="production"?s(function(t,n){return t instanceof n},"instanceOf"):s(function(t,n){if(t instanceof n)return!0;if(typeof t=="object"&&t!==null){var i;let r=n.prototype[Symbol.toStringTag],o=Symbol.toStringTag in t?t[Symbol.toStringTag]:(i=t.constructor)===null||i===void 0?void 0:i.name;if(r===o){let a=m(t);throw new Error(`Cannot use ${r} "${a}" from another module or realm.
|
|
36
|
-
|
|
37
|
-
Ensure that there is only one instance of "graphql" in the node_modules
|
|
38
|
-
directory. If different versions of "graphql" are the dependencies of other
|
|
39
|
-
relied on modules, use "resolutions" to ensure only one version is installed.
|
|
40
|
-
|
|
41
|
-
https://yarnpkg.com/en/docs/selective-version-resolutions
|
|
42
|
-
|
|
43
|
-
Duplicate "graphql" modules cannot be used at the same time since different
|
|
44
|
-
versions may have different capabilities and behavior. The data from one
|
|
45
|
-
version used in the function from another could produce confusing and
|
|
46
|
-
spurious results.`)}}return!1},"instanceOf");var De=class{static{s(this,"Source")}constructor(t,n="GraphQL request",i={line:1,column:1}){typeof t=="string"||I(!1,`Body must be a string. Received: ${m(t)}.`),this.body=t,this.name=n,this.locationOffset=i,this.locationOffset.line>0||I(!1,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||I(!1,"column in locationOffset is 1-indexed and must be positive.")}get[Symbol.toStringTag](){return"Source"}};function yn(e){return q(e,De)}s(yn,"isSource");function pt(e,t){return new at(e,t).parseDocument()}s(pt,"parse");function ct(e,t){let n=new at(e,t);n.expectToken(u.SOF);let i=n.parseValueLiteral(!1);return n.expectToken(u.EOF),i}s(ct,"parseValue");var at=class{static{s(this,"Parser")}constructor(t,n={}){let i=yn(t)?t:new De(t);this._lexer=new Pe(i),this._options=n,this._tokenCounter=0}parseName(){let t=this.expectToken(u.NAME);return this.node(t,{kind:p.NAME,value:t.value})}parseDocument(){return this.node(this._lexer.token,{kind:p.DOCUMENT,definitions:this.many(u.SOF,this.parseDefinition,u.EOF)})}parseDefinition(){if(this.peek(u.BRACE_L))return this.parseOperationDefinition();let t=this.peekDescription(),n=t?this._lexer.lookahead():this._lexer.token;if(n.kind===u.NAME){switch(n.value){case"schema":return this.parseSchemaDefinition();case"scalar":return this.parseScalarTypeDefinition();case"type":return this.parseObjectTypeDefinition();case"interface":return this.parseInterfaceTypeDefinition();case"union":return this.parseUnionTypeDefinition();case"enum":return this.parseEnumTypeDefinition();case"input":return this.parseInputObjectTypeDefinition();case"directive":return this.parseDirectiveDefinition()}if(t)throw D(this._lexer.source,this._lexer.token.start,"Unexpected description, descriptions are supported only on type definitions.");switch(n.value){case"query":case"mutation":case"subscription":return this.parseOperationDefinition();case"fragment":return this.parseFragmentDefinition();case"extend":return this.parseTypeSystemExtension()}}throw this.unexpected(n)}parseOperationDefinition(){let t=this._lexer.token;if(this.peek(u.BRACE_L))return this.node(t,{kind:p.OPERATION_DEFINITION,operation:H.QUERY,name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet()});let n=this.parseOperationType(),i;return this.peek(u.NAME)&&(i=this.parseName()),this.node(t,{kind:p.OPERATION_DEFINITION,operation:n,name:i,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseOperationType(){let t=this.expectToken(u.NAME);switch(t.value){case"query":return H.QUERY;case"mutation":return H.MUTATION;case"subscription":return H.SUBSCRIPTION}throw this.unexpected(t)}parseVariableDefinitions(){return this.optionalMany(u.PAREN_L,this.parseVariableDefinition,u.PAREN_R)}parseVariableDefinition(){return this.node(this._lexer.token,{kind:p.VARIABLE_DEFINITION,variable:this.parseVariable(),type:(this.expectToken(u.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(u.EQUALS)?this.parseConstValueLiteral():void 0,directives:this.parseConstDirectives()})}parseVariable(){let t=this._lexer.token;return this.expectToken(u.DOLLAR),this.node(t,{kind:p.VARIABLE,name:this.parseName()})}parseSelectionSet(){return this.node(this._lexer.token,{kind:p.SELECTION_SET,selections:this.many(u.BRACE_L,this.parseSelection,u.BRACE_R)})}parseSelection(){return this.peek(u.SPREAD)?this.parseFragment():this.parseField()}parseField(){let t=this._lexer.token,n=this.parseName(),i,r;return this.expectOptionalToken(u.COLON)?(i=n,r=this.parseName()):r=n,this.node(t,{kind:p.FIELD,alias:i,name:r,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(u.BRACE_L)?this.parseSelectionSet():void 0})}parseArguments(t){let n=t?this.parseConstArgument:this.parseArgument;return this.optionalMany(u.PAREN_L,n,u.PAREN_R)}parseArgument(t=!1){let n=this._lexer.token,i=this.parseName();return this.expectToken(u.COLON),this.node(n,{kind:p.ARGUMENT,name:i,value:this.parseValueLiteral(t)})}parseConstArgument(){return this.parseArgument(!0)}parseFragment(){let t=this._lexer.token;this.expectToken(u.SPREAD);let n=this.expectOptionalKeyword("on");return!n&&this.peek(u.NAME)?this.node(t,{kind:p.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1)}):this.node(t,{kind:p.INLINE_FRAGMENT,typeCondition:n?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentDefinition(){let t=this._lexer.token;return this.expectKeyword("fragment"),this._options.allowLegacyFragmentVariables===!0?this.node(t,{kind:p.FRAGMENT_DEFINITION,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()}):this.node(t,{kind:p.FRAGMENT_DEFINITION,name:this.parseFragmentName(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentName(){if(this._lexer.token.value==="on")throw this.unexpected();return this.parseName()}parseValueLiteral(t){let n=this._lexer.token;switch(n.kind){case u.BRACKET_L:return this.parseList(t);case u.BRACE_L:return this.parseObject(t);case u.INT:return this.advanceLexer(),this.node(n,{kind:p.INT,value:n.value});case u.FLOAT:return this.advanceLexer(),this.node(n,{kind:p.FLOAT,value:n.value});case u.STRING:case u.BLOCK_STRING:return this.parseStringLiteral();case u.NAME:switch(this.advanceLexer(),n.value){case"true":return this.node(n,{kind:p.BOOLEAN,value:!0});case"false":return this.node(n,{kind:p.BOOLEAN,value:!1});case"null":return this.node(n,{kind:p.NULL});default:return this.node(n,{kind:p.ENUM,value:n.value})}case u.DOLLAR:if(t)if(this.expectToken(u.DOLLAR),this._lexer.token.kind===u.NAME){let i=this._lexer.token.value;throw D(this._lexer.source,n.start,`Unexpected variable "$${i}" in constant value.`)}else throw this.unexpected(n);return this.parseVariable();default:throw this.unexpected()}}parseConstValueLiteral(){return this.parseValueLiteral(!0)}parseStringLiteral(){let t=this._lexer.token;return this.advanceLexer(),this.node(t,{kind:p.STRING,value:t.value,block:t.kind===u.BLOCK_STRING})}parseList(t){let n=s(()=>this.parseValueLiteral(t),"item");return this.node(this._lexer.token,{kind:p.LIST,values:this.any(u.BRACKET_L,n,u.BRACKET_R)})}parseObject(t){let n=s(()=>this.parseObjectField(t),"item");return this.node(this._lexer.token,{kind:p.OBJECT,fields:this.any(u.BRACE_L,n,u.BRACE_R)})}parseObjectField(t){let n=this._lexer.token,i=this.parseName();return this.expectToken(u.COLON),this.node(n,{kind:p.OBJECT_FIELD,name:i,value:this.parseValueLiteral(t)})}parseDirectives(t){let n=[];for(;this.peek(u.AT);)n.push(this.parseDirective(t));return n}parseConstDirectives(){return this.parseDirectives(!0)}parseDirective(t){let n=this._lexer.token;return this.expectToken(u.AT),this.node(n,{kind:p.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(t)})}parseTypeReference(){let t=this._lexer.token,n;if(this.expectOptionalToken(u.BRACKET_L)){let i=this.parseTypeReference();this.expectToken(u.BRACKET_R),n=this.node(t,{kind:p.LIST_TYPE,type:i})}else n=this.parseNamedType();return this.expectOptionalToken(u.BANG)?this.node(t,{kind:p.NON_NULL_TYPE,type:n}):n}parseNamedType(){return this.node(this._lexer.token,{kind:p.NAMED_TYPE,name:this.parseName()})}peekDescription(){return this.peek(u.STRING)||this.peek(u.BLOCK_STRING)}parseDescription(){if(this.peekDescription())return this.parseStringLiteral()}parseSchemaDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("schema");let i=this.parseConstDirectives(),r=this.many(u.BRACE_L,this.parseOperationTypeDefinition,u.BRACE_R);return this.node(t,{kind:p.SCHEMA_DEFINITION,description:n,directives:i,operationTypes:r})}parseOperationTypeDefinition(){let t=this._lexer.token,n=this.parseOperationType();this.expectToken(u.COLON);let i=this.parseNamedType();return this.node(t,{kind:p.OPERATION_TYPE_DEFINITION,operation:n,type:i})}parseScalarTypeDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("scalar");let i=this.parseName(),r=this.parseConstDirectives();return this.node(t,{kind:p.SCALAR_TYPE_DEFINITION,description:n,name:i,directives:r})}parseObjectTypeDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("type");let i=this.parseName(),r=this.parseImplementsInterfaces(),o=this.parseConstDirectives(),a=this.parseFieldsDefinition();return this.node(t,{kind:p.OBJECT_TYPE_DEFINITION,description:n,name:i,interfaces:r,directives:o,fields:a})}parseImplementsInterfaces(){return this.expectOptionalKeyword("implements")?this.delimitedMany(u.AMP,this.parseNamedType):[]}parseFieldsDefinition(){return this.optionalMany(u.BRACE_L,this.parseFieldDefinition,u.BRACE_R)}parseFieldDefinition(){let t=this._lexer.token,n=this.parseDescription(),i=this.parseName(),r=this.parseArgumentDefs();this.expectToken(u.COLON);let o=this.parseTypeReference(),a=this.parseConstDirectives();return this.node(t,{kind:p.FIELD_DEFINITION,description:n,name:i,arguments:r,type:o,directives:a})}parseArgumentDefs(){return this.optionalMany(u.PAREN_L,this.parseInputValueDef,u.PAREN_R)}parseInputValueDef(){let t=this._lexer.token,n=this.parseDescription(),i=this.parseName();this.expectToken(u.COLON);let r=this.parseTypeReference(),o;this.expectOptionalToken(u.EQUALS)&&(o=this.parseConstValueLiteral());let a=this.parseConstDirectives();return this.node(t,{kind:p.INPUT_VALUE_DEFINITION,description:n,name:i,type:r,defaultValue:o,directives:a})}parseInterfaceTypeDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("interface");let i=this.parseName(),r=this.parseImplementsInterfaces(),o=this.parseConstDirectives(),a=this.parseFieldsDefinition();return this.node(t,{kind:p.INTERFACE_TYPE_DEFINITION,description:n,name:i,interfaces:r,directives:o,fields:a})}parseUnionTypeDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("union");let i=this.parseName(),r=this.parseConstDirectives(),o=this.parseUnionMemberTypes();return this.node(t,{kind:p.UNION_TYPE_DEFINITION,description:n,name:i,directives:r,types:o})}parseUnionMemberTypes(){return this.expectOptionalToken(u.EQUALS)?this.delimitedMany(u.PIPE,this.parseNamedType):[]}parseEnumTypeDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("enum");let i=this.parseName(),r=this.parseConstDirectives(),o=this.parseEnumValuesDefinition();return this.node(t,{kind:p.ENUM_TYPE_DEFINITION,description:n,name:i,directives:r,values:o})}parseEnumValuesDefinition(){return this.optionalMany(u.BRACE_L,this.parseEnumValueDefinition,u.BRACE_R)}parseEnumValueDefinition(){let t=this._lexer.token,n=this.parseDescription(),i=this.parseEnumValueName(),r=this.parseConstDirectives();return this.node(t,{kind:p.ENUM_VALUE_DEFINITION,description:n,name:i,directives:r})}parseEnumValueName(){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,`${ot(this._lexer.token)} is reserved and cannot be used for an enum value.`);return this.parseName()}parseInputObjectTypeDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("input");let i=this.parseName(),r=this.parseConstDirectives(),o=this.parseInputFieldsDefinition();return this.node(t,{kind:p.INPUT_OBJECT_TYPE_DEFINITION,description:n,name:i,directives:r,fields:o})}parseInputFieldsDefinition(){return this.optionalMany(u.BRACE_L,this.parseInputValueDef,u.BRACE_R)}parseTypeSystemExtension(){let t=this._lexer.lookahead();if(t.kind===u.NAME)switch(t.value){case"schema":return this.parseSchemaExtension();case"scalar":return this.parseScalarTypeExtension();case"type":return this.parseObjectTypeExtension();case"interface":return this.parseInterfaceTypeExtension();case"union":return this.parseUnionTypeExtension();case"enum":return this.parseEnumTypeExtension();case"input":return this.parseInputObjectTypeExtension()}throw this.unexpected(t)}parseSchemaExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");let n=this.parseConstDirectives(),i=this.optionalMany(u.BRACE_L,this.parseOperationTypeDefinition,u.BRACE_R);if(n.length===0&&i.length===0)throw this.unexpected();return this.node(t,{kind:p.SCHEMA_EXTENSION,directives:n,operationTypes:i})}parseScalarTypeExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");let n=this.parseName(),i=this.parseConstDirectives();if(i.length===0)throw this.unexpected();return this.node(t,{kind:p.SCALAR_TYPE_EXTENSION,name:n,directives:i})}parseObjectTypeExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");let n=this.parseName(),i=this.parseImplementsInterfaces(),r=this.parseConstDirectives(),o=this.parseFieldsDefinition();if(i.length===0&&r.length===0&&o.length===0)throw this.unexpected();return this.node(t,{kind:p.OBJECT_TYPE_EXTENSION,name:n,interfaces:i,directives:r,fields:o})}parseInterfaceTypeExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");let n=this.parseName(),i=this.parseImplementsInterfaces(),r=this.parseConstDirectives(),o=this.parseFieldsDefinition();if(i.length===0&&r.length===0&&o.length===0)throw this.unexpected();return this.node(t,{kind:p.INTERFACE_TYPE_EXTENSION,name:n,interfaces:i,directives:r,fields:o})}parseUnionTypeExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");let n=this.parseName(),i=this.parseConstDirectives(),r=this.parseUnionMemberTypes();if(i.length===0&&r.length===0)throw this.unexpected();return this.node(t,{kind:p.UNION_TYPE_EXTENSION,name:n,directives:i,types:r})}parseEnumTypeExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");let n=this.parseName(),i=this.parseConstDirectives(),r=this.parseEnumValuesDefinition();if(i.length===0&&r.length===0)throw this.unexpected();return this.node(t,{kind:p.ENUM_TYPE_EXTENSION,name:n,directives:i,values:r})}parseInputObjectTypeExtension(){let t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");let n=this.parseName(),i=this.parseConstDirectives(),r=this.parseInputFieldsDefinition();if(i.length===0&&r.length===0)throw this.unexpected();return this.node(t,{kind:p.INPUT_OBJECT_TYPE_EXTENSION,name:n,directives:i,fields:r})}parseDirectiveDefinition(){let t=this._lexer.token,n=this.parseDescription();this.expectKeyword("directive"),this.expectToken(u.AT);let i=this.parseName(),r=this.parseArgumentDefs(),o=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");let a=this.parseDirectiveLocations();return this.node(t,{kind:p.DIRECTIVE_DEFINITION,description:n,name:i,arguments:r,repeatable:o,locations:a})}parseDirectiveLocations(){return this.delimitedMany(u.PIPE,this.parseDirectiveLocation)}parseDirectiveLocation(){let t=this._lexer.token,n=this.parseName();if(Object.prototype.hasOwnProperty.call(b,n.value))return n;throw this.unexpected(t)}node(t,n){return this._options.noLocation!==!0&&(n.loc=new Me(t,this._lexer.lastToken,this._lexer.source)),n}peek(t){return this._lexer.token.kind===t}expectToken(t){let n=this._lexer.token;if(n.kind===t)return this.advanceLexer(),n;throw D(this._lexer.source,n.start,`Expected ${Tn(t)}, found ${ot(n)}.`)}expectOptionalToken(t){return this._lexer.token.kind===t?(this.advanceLexer(),!0):!1}expectKeyword(t){let n=this._lexer.token;if(n.kind===u.NAME&&n.value===t)this.advanceLexer();else throw D(this._lexer.source,n.start,`Expected "${t}", found ${ot(n)}.`)}expectOptionalKeyword(t){let n=this._lexer.token;return n.kind===u.NAME&&n.value===t?(this.advanceLexer(),!0):!1}unexpected(t){let n=t??this._lexer.token;return D(this._lexer.source,n.start,`Unexpected ${ot(n)}.`)}any(t,n,i){this.expectToken(t);let r=[];for(;!this.expectOptionalToken(i);)r.push(n.call(this));return r}optionalMany(t,n,i){if(this.expectOptionalToken(t)){let r=[];do r.push(n.call(this));while(!this.expectOptionalToken(i));return r}return[]}many(t,n,i){this.expectToken(t);let r=[];do r.push(n.call(this));while(!this.expectOptionalToken(i));return r}delimitedMany(t,n){this.expectOptionalToken(t);let i=[];do i.push(n.call(this));while(this.expectOptionalToken(t));return i}advanceLexer(){let{maxTokens:t}=this._options,n=this._lexer.advance();if(t!==void 0&&n.kind!==u.EOF&&(++this._tokenCounter,this._tokenCounter>t))throw D(this._lexer.source,n.start,`Document contains more that ${t} tokens. Parsing aborted.`)}};function ot(e){let t=e.value;return Tn(e.kind)+(t!=null?` "${t}"`:"")}s(ot,"getTokenDesc");function Tn(e){return fn(e)?`"${e}"`:e}s(Tn,"getTokenKindDesc");function ut(e,t){let[n,i]=t?[e,t]:[void 0,e],r=" Did you mean ";n&&(r+=n+" ");let o=i.map(d=>`"${d}"`);switch(o.length){case 0:return"";case 1:return r+o[0]+"?";case 2:return r+o[0]+" or "+o[1]+"?"}let a=o.slice(0,5),c=a.pop();return r+a.join(", ")+", or "+c+"?"}s(ut,"didYouMean");function Gt(e){return e}s(Gt,"identityFunc");function we(e,t){let n=Object.create(null);for(let i of e)n[t(i)]=i;return n}s(we,"keyMap");function ae(e,t,n){let i=Object.create(null);for(let r of e)i[t(r)]=n(r);return i}s(ae,"keyValMap");function Qe(e,t){let n=Object.create(null);for(let i of Object.keys(e))n[i]=t(e[i],i);return n}s(Qe,"mapValue");function xn(e,t){let n=0,i=0;for(;n<e.length&&i<t.length;){let r=e.charCodeAt(n),o=t.charCodeAt(i);if(lt(r)&<(o)){let a=0;do++n,a=a*10+r-jt,r=e.charCodeAt(n);while(lt(r)&&a>0);let c=0;do++i,c=c*10+o-jt,o=t.charCodeAt(i);while(lt(o)&&c>0);if(a<c)return-1;if(a>c)return 1}else{if(r<o)return-1;if(r>o)return 1;++n,++i}}return e.length-t.length}s(xn,"naturalCompare");var jt=48,di=57;function lt(e){return!isNaN(e)&&jt<=e&&e<=di}s(lt,"isDigit");function dt(e,t){let n=Object.create(null),i=new $t(e),r=Math.floor(e.length*.4)+1;for(let o of t){let a=i.measure(o,r);a!==void 0&&(n[o]=a)}return Object.keys(n).sort((o,a)=>{let c=n[o]-n[a];return c!==0?c:xn(o,a)})}s(dt,"suggestionList");var $t=class{static{s(this,"LexicalDistance")}constructor(t){this._input=t,this._inputLowerCase=t.toLowerCase(),this._inputArray=Nn(this._inputLowerCase),this._rows=[new Array(t.length+1).fill(0),new Array(t.length+1).fill(0),new Array(t.length+1).fill(0)]}measure(t,n){if(this._input===t)return 0;let i=t.toLowerCase();if(this._inputLowerCase===i)return 1;let r=Nn(i),o=this._inputArray;if(r.length<o.length){let T=r;r=o,o=T}let a=r.length,c=o.length;if(a-c>n)return;let d=this._rows;for(let T=0;T<=c;T++)d[0][T]=T;for(let T=1;T<=a;T++){let x=d[(T-1)%3],N=d[T%3],S=N[0]=T;for(let g=1;g<=c;g++){let U=r[T-1]===o[g-1]?0:1,K=Math.min(x[g]+1,N[g-1]+1,x[g-1]+U);if(T>1&&g>1&&r[T-1]===o[g-2]&&r[T-2]===o[g-1]){let F=d[(T-2)%3][g-2];K=Math.min(K,F+1)}K<S&&(S=K),N[g]=K}if(S>n)return}let f=d[a%3][c];return f<=n?f:void 0}};function Nn(e){let t=e.length,n=new Array(t);for(let i=0;i<t;++i)n[i]=e.charCodeAt(i);return n}s(Nn,"stringToArray");function j(e){if(e==null)return Object.create(null);if(Object.getPrototypeOf(e)===null)return e;let t=Object.create(null);for(let[n,i]of Object.entries(e))t[n]=i;return t}s(j,"toObjMap");function En(e){return`"${e.replace(fi,mi)}"`}s(En,"printString");var fi=/[\x00-\x1f\x22\x5c\x7f-\x9f]/g;function mi(e){return hi[e.charCodeAt(0)]}s(mi,"escapedReplacer");var hi=["\\u0000","\\u0001","\\u0002","\\u0003","\\u0004","\\u0005","\\u0006","\\u0007","\\b","\\t","\\n","\\u000B","\\f","\\r","\\u000E","\\u000F","\\u0010","\\u0011","\\u0012","\\u0013","\\u0014","\\u0015","\\u0016","\\u0017","\\u0018","\\u0019","\\u001A","\\u001B","\\u001C","\\u001D","\\u001E","\\u001F","","",'\\"',"","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\\\","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\u007F","\\u0080","\\u0081","\\u0082","\\u0083","\\u0084","\\u0085","\\u0086","\\u0087","\\u0088","\\u0089","\\u008A","\\u008B","\\u008C","\\u008D","\\u008E","\\u008F","\\u0090","\\u0091","\\u0092","\\u0093","\\u0094","\\u0095","\\u0096","\\u0097","\\u0098","\\u0099","\\u009A","\\u009B","\\u009C","\\u009D","\\u009E","\\u009F"];var Pt=Object.freeze({});function he(e,t,n=Ut){let i=new Map;for(let F of Object.values(p))i.set(F,Re(t,F));let r,o=Array.isArray(e),a=[e],c=-1,d=[],f=e,T,x,N=[],S=[];do{c++;let F=c===a.length,me=F&&d.length!==0;if(F){if(T=S.length===0?void 0:N[N.length-1],f=x,x=S.pop(),me)if(o){f=f.slice();let Z=0;for(let[Ue,_e]of d){let Ze=Ue-Z;_e===null?(f.splice(Ze,1),Z++):f[Ze]=_e}}else{f=Object.defineProperties({},Object.getOwnPropertyDescriptors(f));for(let[Z,Ue]of d)f[Z]=Ue}c=r.index,a=r.keys,d=r.edits,o=r.inArray,r=r.prev}else if(x){if(T=o?c:a[c],f=x[T],f==null)continue;N.push(T)}let re;if(!Array.isArray(f)){var g,U;Ge(f)||I(!1,`Invalid AST Node: ${m(f)}.`);let Z=F?(g=i.get(f.kind))===null||g===void 0?void 0:g.leave:(U=i.get(f.kind))===null||U===void 0?void 0:U.enter;if(re=Z?.call(t,f,T,x,N,S),re===Pt)break;if(re===!1){if(!F){N.pop();continue}}else if(re!==void 0&&(d.push([T,re]),!F))if(Ge(re))f=re;else{N.pop();continue}}if(re===void 0&&me&&d.push([T,f]),F)N.pop();else{var K;r={inArray:o,index:c,keys:a,edits:d,prev:r},o=Array.isArray(f),a=o?f:(K=n[f.kind])!==null&&K!==void 0?K:[],c=-1,d=[],x&&S.push(x),x=f}}while(r!==void 0);return d.length!==0?d[d.length-1][1]:e}s(he,"visit");function Re(e,t){let n=e[t];return typeof n=="object"?n:typeof n=="function"?{enter:n,leave:void 0}:{enter:e.enter,leave:e.leave}}s(Re,"getEnterLeaveForKind");function $(e){return he(e,Ti)}s($,"print");var yi=80,Ti={Name:{leave:s(e=>e.value,"leave")},Variable:{leave:s(e=>"$"+e.name,"leave")},Document:{leave:s(e=>h(e.definitions,`
|
|
47
|
-
|
|
48
|
-
`),"leave")},OperationDefinition:{leave(e){let t=_("(",h(e.variableDefinitions,", "),")"),n=h([e.operation,h([e.name,t]),h(e.directives," ")]," ");return(n==="query"?"":n+" ")+e.selectionSet}},VariableDefinition:{leave:s(({variable:e,type:t,defaultValue:n,directives:i})=>e+": "+t+_(" = ",n)+_(" ",h(i," ")),"leave")},SelectionSet:{leave:s(({selections:e})=>ee(e),"leave")},Field:{leave({alias:e,name:t,arguments:n,directives:i,selectionSet:r}){let o=_("",e,": ")+t,a=o+_("(",h(n,", "),")");return a.length>yi&&(a=o+_(`(
|
|
49
|
-
`,ft(h(n,`
|
|
50
|
-
`)),`
|
|
51
|
-
)`)),h([a,h(i," "),r]," ")}},Argument:{leave:s(({name:e,value:t})=>e+": "+t,"leave")},FragmentSpread:{leave:s(({name:e,directives:t})=>"..."+e+_(" ",h(t," ")),"leave")},InlineFragment:{leave:s(({typeCondition:e,directives:t,selectionSet:n})=>h(["...",_("on ",e),h(t," "),n]," "),"leave")},FragmentDefinition:{leave:s(({name:e,typeCondition:t,variableDefinitions:n,directives:i,selectionSet:r})=>`fragment ${e}${_("(",h(n,", "),")")} on ${t} ${_("",h(i," ")," ")}`+r,"leave")},IntValue:{leave:s(({value:e})=>e,"leave")},FloatValue:{leave:s(({value:e})=>e,"leave")},StringValue:{leave:s(({value:e,block:t})=>t?ln(e):En(e),"leave")},BooleanValue:{leave:s(({value:e})=>e?"true":"false","leave")},NullValue:{leave:s(()=>"null","leave")},EnumValue:{leave:s(({value:e})=>e,"leave")},ListValue:{leave:s(({values:e})=>"["+h(e,", ")+"]","leave")},ObjectValue:{leave:s(({fields:e})=>"{"+h(e,", ")+"}","leave")},ObjectField:{leave:s(({name:e,value:t})=>e+": "+t,"leave")},Directive:{leave:s(({name:e,arguments:t})=>"@"+e+_("(",h(t,", "),")"),"leave")},NamedType:{leave:s(({name:e})=>e,"leave")},ListType:{leave:s(({type:e})=>"["+e+"]","leave")},NonNullType:{leave:s(({type:e})=>e+"!","leave")},SchemaDefinition:{leave:s(({description:e,directives:t,operationTypes:n})=>_("",e,`
|
|
52
|
-
`)+h(["schema",h(t," "),ee(n)]," "),"leave")},OperationTypeDefinition:{leave:s(({operation:e,type:t})=>e+": "+t,"leave")},ScalarTypeDefinition:{leave:s(({description:e,name:t,directives:n})=>_("",e,`
|
|
53
|
-
`)+h(["scalar",t,h(n," ")]," "),"leave")},ObjectTypeDefinition:{leave:s(({description:e,name:t,interfaces:n,directives:i,fields:r})=>_("",e,`
|
|
54
|
-
`)+h(["type",t,_("implements ",h(n," & ")),h(i," "),ee(r)]," "),"leave")},FieldDefinition:{leave:s(({description:e,name:t,arguments:n,type:i,directives:r})=>_("",e,`
|
|
55
|
-
`)+t+(gn(n)?_(`(
|
|
56
|
-
`,ft(h(n,`
|
|
57
|
-
`)),`
|
|
58
|
-
)`):_("(",h(n,", "),")"))+": "+i+_(" ",h(r," ")),"leave")},InputValueDefinition:{leave:s(({description:e,name:t,type:n,defaultValue:i,directives:r})=>_("",e,`
|
|
59
|
-
`)+h([t+": "+n,_("= ",i),h(r," ")]," "),"leave")},InterfaceTypeDefinition:{leave:s(({description:e,name:t,interfaces:n,directives:i,fields:r})=>_("",e,`
|
|
60
|
-
`)+h(["interface",t,_("implements ",h(n," & ")),h(i," "),ee(r)]," "),"leave")},UnionTypeDefinition:{leave:s(({description:e,name:t,directives:n,types:i})=>_("",e,`
|
|
61
|
-
`)+h(["union",t,h(n," "),_("= ",h(i," | "))]," "),"leave")},EnumTypeDefinition:{leave:s(({description:e,name:t,directives:n,values:i})=>_("",e,`
|
|
62
|
-
`)+h(["enum",t,h(n," "),ee(i)]," "),"leave")},EnumValueDefinition:{leave:s(({description:e,name:t,directives:n})=>_("",e,`
|
|
63
|
-
`)+h([t,h(n," ")]," "),"leave")},InputObjectTypeDefinition:{leave:s(({description:e,name:t,directives:n,fields:i})=>_("",e,`
|
|
64
|
-
`)+h(["input",t,h(n," "),ee(i)]," "),"leave")},DirectiveDefinition:{leave:s(({description:e,name:t,arguments:n,repeatable:i,locations:r})=>_("",e,`
|
|
65
|
-
`)+"directive @"+t+(gn(n)?_(`(
|
|
66
|
-
`,ft(h(n,`
|
|
67
|
-
`)),`
|
|
68
|
-
)`):_("(",h(n,", "),")"))+(i?" repeatable":"")+" on "+h(r," | "),"leave")},SchemaExtension:{leave:s(({directives:e,operationTypes:t})=>h(["extend schema",h(e," "),ee(t)]," "),"leave")},ScalarTypeExtension:{leave:s(({name:e,directives:t})=>h(["extend scalar",e,h(t," ")]," "),"leave")},ObjectTypeExtension:{leave:s(({name:e,interfaces:t,directives:n,fields:i})=>h(["extend type",e,_("implements ",h(t," & ")),h(n," "),ee(i)]," "),"leave")},InterfaceTypeExtension:{leave:s(({name:e,interfaces:t,directives:n,fields:i})=>h(["extend interface",e,_("implements ",h(t," & ")),h(n," "),ee(i)]," "),"leave")},UnionTypeExtension:{leave:s(({name:e,directives:t,types:n})=>h(["extend union",e,h(t," "),_("= ",h(n," | "))]," "),"leave")},EnumTypeExtension:{leave:s(({name:e,directives:t,values:n})=>h(["extend enum",e,h(t," "),ee(n)]," "),"leave")},InputObjectTypeExtension:{leave:s(({name:e,directives:t,fields:n})=>h(["extend input",e,h(t," "),ee(n)]," "),"leave")}};function h(e,t=""){var n;return(n=e?.filter(i=>i).join(t))!==null&&n!==void 0?n:""}s(h,"join");function ee(e){return _(`{
|
|
69
|
-
`,ft(h(e,`
|
|
70
|
-
`)),`
|
|
71
|
-
}`)}s(ee,"block");function _(e,t,n=""){return t!=null&&t!==""?e+t+n:""}s(_,"wrap");function ft(e){return _(" ",e.replace(/\n/g,`
|
|
72
|
-
`))}s(ft,"indent");function gn(e){var t;return(t=e?.some(n=>n.includes(`
|
|
73
|
-
`)))!==null&&t!==void 0?t:!1}s(gn,"hasMultilineItems");function Be(e,t){switch(e.kind){case p.NULL:return null;case p.INT:return parseInt(e.value,10);case p.FLOAT:return parseFloat(e.value);case p.STRING:case p.ENUM:case p.BOOLEAN:return e.value;case p.LIST:return e.values.map(n=>Be(n,t));case p.OBJECT:return ae(e.fields,n=>n.name.value,n=>Be(n.value,t));case p.VARIABLE:return t?.[e.name.value]}}s(Be,"valueFromASTUntyped");function Q(e){if(e!=null||I(!1,"Must provide name."),typeof e=="string"||I(!1,"Expected name to be a string."),e.length===0)throw new y("Expected name to be a non-empty string.");for(let t=1;t<e.length;++t)if(!it(e.charCodeAt(t)))throw new y(`Names must only contain [_a-zA-Z0-9] but "${e}" does not.`);if(!je(e.charCodeAt(0)))throw new y(`Names must start with [_a-zA-Z] but "${e}" does not.`);return e}s(Q,"assertName");function Qt(e){if(e==="true"||e==="false"||e==="null")throw new y(`Enum values cannot be named: ${e}`);return Q(e)}s(Qt,"assertEnumValueName");function ht(e){return ye(e)||G(e)||C(e)||X(e)||Y(e)||V(e)||B(e)||A(e)}s(ht,"isType");function ye(e){return q(e,J)}s(ye,"isScalarType");function G(e){return q(e,M)}s(G,"isObjectType");function yt(e){if(!G(e))throw new Error(`Expected ${m(e)} to be a GraphQL Object type.`);return e}s(yt,"assertObjectType");function C(e){return q(e,le)}s(C,"isInterfaceType");function Tt(e){if(!C(e))throw new Error(`Expected ${m(e)} to be a GraphQL Interface type.`);return e}s(Tt,"assertInterfaceType");function X(e){return q(e,ve)}s(X,"isUnionType");function Y(e){return q(e,pe)}s(Y,"isEnumType");function V(e){return q(e,Ie)}s(V,"isInputObjectType");function B(e){return q(e,w)}s(B,"isListType");function A(e){return q(e,E)}s(A,"isNonNullType");function z(e){return ye(e)||Y(e)||V(e)||qe(e)&&z(e.ofType)}s(z,"isInputType");function de(e){return ye(e)||G(e)||C(e)||X(e)||Y(e)||qe(e)&&de(e.ofType)}s(de,"isOutputType");function Te(e){return ye(e)||Y(e)}s(Te,"isLeafType");function ce(e){return G(e)||C(e)||X(e)}s(ce,"isCompositeType");function xe(e){return C(e)||X(e)}s(xe,"isAbstractType");var w=class{static{s(this,"GraphQLList")}constructor(t){ht(t)||I(!1,`Expected ${m(t)} to be a GraphQL type.`),this.ofType=t}get[Symbol.toStringTag](){return"GraphQLList"}toString(){return"["+String(this.ofType)+"]"}toJSON(){return this.toString()}},E=class{static{s(this,"GraphQLNonNull")}constructor(t){xt(t)||I(!1,`Expected ${m(t)} to be a GraphQL nullable type.`),this.ofType=t}get[Symbol.toStringTag](){return"GraphQLNonNull"}toString(){return String(this.ofType)+"!"}toJSON(){return this.toString()}};function qe(e){return B(e)||A(e)}s(qe,"isWrappingType");function xt(e){return ht(e)&&!A(e)}s(xt,"isNullableType");function Nt(e){if(!xt(e))throw new Error(`Expected ${m(e)} to be a GraphQL nullable type.`);return e}s(Nt,"assertNullableType");function Et(e){if(e)return A(e)?e.ofType:e}s(Et,"getNullableType");function te(e){if(e){let t=e;for(;qe(t);)t=t.ofType;return t}}s(te,"getNamedType");function gt(e){return typeof e=="function"?e():e}s(gt,"resolveReadonlyArrayThunk");function vt(e){return typeof e=="function"?e():e}s(vt,"resolveObjMapThunk");var J=class{static{s(this,"GraphQLScalarType")}constructor(t){var n,i,r,o;let a=(n=t.parseValue)!==null&&n!==void 0?n:Gt;this.name=Q(t.name),this.description=t.description,this.specifiedByURL=t.specifiedByURL,this.serialize=(i=t.serialize)!==null&&i!==void 0?i:Gt,this.parseValue=a,this.parseLiteral=(r=t.parseLiteral)!==null&&r!==void 0?r:(c,d)=>a(Be(c,d)),this.extensions=j(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=(o=t.extensionASTNodes)!==null&&o!==void 0?o:[],t.specifiedByURL==null||typeof t.specifiedByURL=="string"||I(!1,`${this.name} must provide "specifiedByURL" as a string, but got: ${m(t.specifiedByURL)}.`),t.serialize==null||typeof t.serialize=="function"||I(!1,`${this.name} must provide "serialize" function. If this custom Scalar is also used as an input type, ensure "parseValue" and "parseLiteral" functions are also provided.`),t.parseLiteral&&(typeof t.parseValue=="function"&&typeof t.parseLiteral=="function"||I(!1,`${this.name} must provide both "parseValue" and "parseLiteral" functions.`))}get[Symbol.toStringTag](){return"GraphQLScalarType"}toConfig(){return{name:this.name,description:this.description,specifiedByURL:this.specifiedByURL,serialize:this.serialize,parseValue:this.parseValue,parseLiteral:this.parseLiteral,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}},M=class{static{s(this,"GraphQLObjectType")}constructor(t){var n;this.name=Q(t.name),this.description=t.description,this.isTypeOf=t.isTypeOf,this.extensions=j(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=(n=t.extensionASTNodes)!==null&&n!==void 0?n:[],this._fields=()=>In(t),this._interfaces=()=>vn(t),t.isTypeOf==null||typeof t.isTypeOf=="function"||I(!1,`${this.name} must provide "isTypeOf" as a function, but got: ${m(t.isTypeOf)}.`)}get[Symbol.toStringTag](){return"GraphQLObjectType"}getFields(){return typeof this._fields=="function"&&(this._fields=this._fields()),this._fields}getInterfaces(){return typeof this._interfaces=="function"&&(this._interfaces=this._interfaces()),this._interfaces}toConfig(){return{name:this.name,description:this.description,interfaces:this.getInterfaces(),fields:bn(this.getFields()),isTypeOf:this.isTypeOf,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}};function vn(e){var t;let n=gt((t=e.interfaces)!==null&&t!==void 0?t:[]);return Array.isArray(n)||I(!1,`${e.name} interfaces must be an Array or a function which returns an Array.`),n}s(vn,"defineInterfaces");function In(e){let t=vt(e.fields);return ke(t)||I(!1,`${e.name} fields must be an object with field names as keys or a function which returns such an object.`),Qe(t,(n,i)=>{var r;ke(n)||I(!1,`${e.name}.${i} field config must be an object.`),n.resolve==null||typeof n.resolve=="function"||I(!1,`${e.name}.${i} field resolver must be a function if provided, but got: ${m(n.resolve)}.`);let o=(r=n.args)!==null&&r!==void 0?r:{};return ke(o)||I(!1,`${e.name}.${i} args must be an object with argument names as keys.`),{name:Q(i),description:n.description,type:n.type,args:Bt(o),resolve:n.resolve,subscribe:n.subscribe,deprecationReason:n.deprecationReason,extensions:j(n.extensions),astNode:n.astNode}})}s(In,"defineFieldMap");function Bt(e){return Object.entries(e).map(([t,n])=>({name:Q(t),description:n.description,type:n.type,defaultValue:n.defaultValue,deprecationReason:n.deprecationReason,extensions:j(n.extensions),astNode:n.astNode}))}s(Bt,"defineArguments");function ke(e){return k(e)&&!Array.isArray(e)}s(ke,"isPlainObj");function bn(e){return Qe(e,t=>({description:t.description,type:t.type,args:qt(t.args),resolve:t.resolve,subscribe:t.subscribe,deprecationReason:t.deprecationReason,extensions:t.extensions,astNode:t.astNode}))}s(bn,"fieldsToFieldsConfig");function qt(e){return ae(e,t=>t.name,t=>({description:t.description,type:t.type,defaultValue:t.defaultValue,deprecationReason:t.deprecationReason,extensions:t.extensions,astNode:t.astNode}))}s(qt,"argsToArgsConfig");var le=class{static{s(this,"GraphQLInterfaceType")}constructor(t){var n;this.name=Q(t.name),this.description=t.description,this.resolveType=t.resolveType,this.extensions=j(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=(n=t.extensionASTNodes)!==null&&n!==void 0?n:[],this._fields=In.bind(void 0,t),this._interfaces=vn.bind(void 0,t),t.resolveType==null||typeof t.resolveType=="function"||I(!1,`${this.name} must provide "resolveType" as a function, but got: ${m(t.resolveType)}.`)}get[Symbol.toStringTag](){return"GraphQLInterfaceType"}getFields(){return typeof this._fields=="function"&&(this._fields=this._fields()),this._fields}getInterfaces(){return typeof this._interfaces=="function"&&(this._interfaces=this._interfaces()),this._interfaces}toConfig(){return{name:this.name,description:this.description,interfaces:this.getInterfaces(),fields:bn(this.getFields()),resolveType:this.resolveType,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}},ve=class{static{s(this,"GraphQLUnionType")}constructor(t){var n;this.name=Q(t.name),this.description=t.description,this.resolveType=t.resolveType,this.extensions=j(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=(n=t.extensionASTNodes)!==null&&n!==void 0?n:[],this._types=xi.bind(void 0,t),t.resolveType==null||typeof t.resolveType=="function"||I(!1,`${this.name} must provide "resolveType" as a function, but got: ${m(t.resolveType)}.`)}get[Symbol.toStringTag](){return"GraphQLUnionType"}getTypes(){return typeof this._types=="function"&&(this._types=this._types()),this._types}toConfig(){return{name:this.name,description:this.description,types:this.getTypes(),resolveType:this.resolveType,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}};function xi(e){let t=gt(e.types);return Array.isArray(t)||I(!1,`Must provide Array of types or a function which returns such an array for Union ${e.name}.`),t}s(xi,"defineTypes");var pe=class{static{s(this,"GraphQLEnumType")}constructor(t){var n;this.name=Q(t.name),this.description=t.description,this.extensions=j(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=(n=t.extensionASTNodes)!==null&&n!==void 0?n:[],this._values=Ni(this.name,t.values),this._valueLookup=new Map(this._values.map(i=>[i.value,i])),this._nameLookup=we(this._values,i=>i.name)}get[Symbol.toStringTag](){return"GraphQLEnumType"}getValues(){return this._values}getValue(t){return this._nameLookup[t]}serialize(t){let n=this._valueLookup.get(t);if(n===void 0)throw new y(`Enum "${this.name}" cannot represent value: ${m(t)}`);return n.name}parseValue(t){if(typeof t!="string"){let i=m(t);throw new y(`Enum "${this.name}" cannot represent non-string value: ${i}.`+mt(this,i))}let n=this.getValue(t);if(n==null)throw new y(`Value "${t}" does not exist in "${this.name}" enum.`+mt(this,t));return n.value}parseLiteral(t,n){if(t.kind!==p.ENUM){let r=$(t);throw new y(`Enum "${this.name}" cannot represent non-enum value: ${r}.`+mt(this,r),{nodes:t})}let i=this.getValue(t.value);if(i==null){let r=$(t);throw new y(`Value "${r}" does not exist in "${this.name}" enum.`+mt(this,r),{nodes:t})}return i.value}toConfig(){let t=ae(this.getValues(),n=>n.name,n=>({description:n.description,value:n.value,deprecationReason:n.deprecationReason,extensions:n.extensions,astNode:n.astNode}));return{name:this.name,description:this.description,values:t,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}};function mt(e,t){let n=e.getValues().map(r=>r.name),i=dt(t,n);return ut("the enum value",i)}s(mt,"didYouMeanEnumValue");function Ni(e,t){return ke(t)||I(!1,`${e} values must be an object with value names as keys.`),Object.entries(t).map(([n,i])=>(ke(i)||I(!1,`${e}.${n} must refer to an object with a "value" key representing an internal value but got: ${m(i)}.`),{name:Qt(n),description:i.description,value:i.value!==void 0?i.value:n,deprecationReason:i.deprecationReason,extensions:j(i.extensions),astNode:i.astNode}))}s(Ni,"defineEnumValues");var Ie=class{static{s(this,"GraphQLInputObjectType")}constructor(t){var n;this.name=Q(t.name),this.description=t.description,this.extensions=j(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=(n=t.extensionASTNodes)!==null&&n!==void 0?n:[],this._fields=Ei.bind(void 0,t)}get[Symbol.toStringTag](){return"GraphQLInputObjectType"}getFields(){return typeof this._fields=="function"&&(this._fields=this._fields()),this._fields}toConfig(){let t=Qe(this.getFields(),n=>({description:n.description,type:n.type,defaultValue:n.defaultValue,deprecationReason:n.deprecationReason,extensions:n.extensions,astNode:n.astNode}));return{name:this.name,description:this.description,fields:t,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}};function Ei(e){let t=vt(e.fields);return ke(t)||I(!1,`${e.name} fields must be an object with field names as keys or a function which returns such an object.`),Qe(t,(n,i)=>(!("resolve"in n)||I(!1,`${e.name}.${i} field has a resolve property, but Input Types cannot define resolvers.`),{name:Q(i),description:n.description,type:n.type,defaultValue:n.defaultValue,deprecationReason:n.deprecationReason,extensions:j(n.extensions),astNode:n.astNode}))}s(Ei,"defineInputFieldMap");var It=2147483647,bt=-2147483648,Jt=new J({name:"Int",description:"The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1.",serialize(e){let t=Je(e);if(typeof t=="boolean")return t?1:0;let n=t;if(typeof t=="string"&&t!==""&&(n=Number(t)),typeof n!="number"||!Number.isInteger(n))throw new y(`Int cannot represent non-integer value: ${m(t)}`);if(n>It||n<bt)throw new y("Int cannot represent non 32-bit signed integer value: "+m(t));return n},parseValue(e){if(typeof e!="number"||!Number.isInteger(e))throw new y(`Int cannot represent non-integer value: ${m(e)}`);if(e>It||e<bt)throw new y(`Int cannot represent non 32-bit signed integer value: ${e}`);return e},parseLiteral(e){if(e.kind!==p.INT)throw new y(`Int cannot represent non-integer value: ${$(e)}`,{nodes:e});let t=parseInt(e.value,10);if(t>It||t<bt)throw new y(`Int cannot represent non 32-bit signed integer value: ${e.value}`,{nodes:e});return t}}),_n=new J({name:"Float",description:"The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](https://en.wikipedia.org/wiki/IEEE_floating_point).",serialize(e){let t=Je(e);if(typeof t=="boolean")return t?1:0;let n=t;if(typeof t=="string"&&t!==""&&(n=Number(t)),typeof n!="number"||!Number.isFinite(n))throw new y(`Float cannot represent non numeric value: ${m(t)}`);return n},parseValue(e){if(typeof e!="number"||!Number.isFinite(e))throw new y(`Float cannot represent non numeric value: ${m(e)}`);return e},parseLiteral(e){if(e.kind!==p.FLOAT&&e.kind!==p.INT)throw new y(`Float cannot represent non numeric value: ${$(e)}`,e);return parseFloat(e.value)}}),O=new J({name:"String",description:"The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.",serialize(e){let t=Je(e);if(typeof t=="string")return t;if(typeof t=="boolean")return t?"true":"false";if(typeof t=="number"&&Number.isFinite(t))return t.toString();throw new y(`String cannot represent value: ${m(e)}`)},parseValue(e){if(typeof e!="string")throw new y(`String cannot represent a non string value: ${m(e)}`);return e},parseLiteral(e){if(e.kind!==p.STRING)throw new y(`String cannot represent a non string value: ${$(e)}`,{nodes:e});return e.value}}),P=new J({name:"Boolean",description:"The `Boolean` scalar type represents `true` or `false`.",serialize(e){let t=Je(e);if(typeof t=="boolean")return t;if(Number.isFinite(t))return t!==0;throw new y(`Boolean cannot represent a non boolean value: ${m(t)}`)},parseValue(e){if(typeof e!="boolean")throw new y(`Boolean cannot represent a non boolean value: ${m(e)}`);return e},parseLiteral(e){if(e.kind!==p.BOOLEAN)throw new y(`Boolean cannot represent a non boolean value: ${$(e)}`,{nodes:e});return e.value}}),_t=new J({name:"ID",description:'The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) input value will be accepted as an ID.',serialize(e){let t=Je(e);if(typeof t=="string")return t;if(Number.isInteger(t))return String(t);throw new y(`ID cannot represent value: ${m(e)}`)},parseValue(e){if(typeof e=="string")return e;if(typeof e=="number"&&Number.isInteger(e))return e.toString();throw new y(`ID cannot represent value: ${m(e)}`)},parseLiteral(e){if(e.kind!==p.STRING&&e.kind!==p.INT)throw new y("ID cannot represent a non-string and non-integer value: "+$(e),{nodes:e});return e.value}}),Yt=Object.freeze([O,Jt,_n,P,_t]);function Je(e){if(k(e)){if(typeof e.valueOf=="function"){let t=e.valueOf();if(!k(t))return t}if(typeof e.toJSON=="function")return e.toJSON()}return e}s(Je,"serializeObject");function zt(e){return q(e,ne)}s(zt,"isDirective");var ne=class{static{s(this,"GraphQLDirective")}constructor(t){var n,i;this.name=Q(t.name),this.description=t.description,this.locations=t.locations,this.isRepeatable=(n=t.isRepeatable)!==null&&n!==void 0?n:!1,this.extensions=j(t.extensions),this.astNode=t.astNode,Array.isArray(t.locations)||I(!1,`@${t.name} locations must be an Array.`);let r=(i=t.args)!==null&&i!==void 0?i:{};k(r)&&!Array.isArray(r)||I(!1,`@${t.name} args must be an object with argument names as keys.`),this.args=Bt(r)}get[Symbol.toStringTag](){return"GraphQLDirective"}toConfig(){return{name:this.name,description:this.description,locations:this.locations,args:qt(this.args),isRepeatable:this.isRepeatable,extensions:this.extensions,astNode:this.astNode}}toString(){return"@"+this.name}toJSON(){return this.toString()}},Sn=new ne({name:"include",description:"Directs the executor to include this field or fragment only when the `if` argument is true.",locations:[b.FIELD,b.FRAGMENT_SPREAD,b.INLINE_FRAGMENT],args:{if:{type:new E(P),description:"Included when true."}}}),Ln=new ne({name:"skip",description:"Directs the executor to skip this field or fragment when the `if` argument is true.",locations:[b.FIELD,b.FRAGMENT_SPREAD,b.INLINE_FRAGMENT],args:{if:{type:new E(P),description:"Skipped when true."}}}),On="No longer supported",An=new ne({name:"deprecated",description:"Marks an element of a GraphQL schema as no longer supported.",locations:[b.FIELD_DEFINITION,b.ARGUMENT_DEFINITION,b.INPUT_FIELD_DEFINITION,b.ENUM_VALUE],args:{reason:{type:O,description:"Explains why this element was deprecated, usually also including a suggestion for how to access supported similar data. Formatted using the Markdown syntax, as specified by [CommonMark](https://commonmark.org/).",defaultValue:On}}}),Dn=new ne({name:"specifiedBy",description:"Exposes a URL that specifies the behavior of this scalar.",locations:[b.SCALAR],args:{url:{type:new E(O),description:"The URL that specifies the behavior of this scalar."}}}),Kt=Object.freeze([Sn,Ln,An,Dn]);function St(e){return typeof e=="object"&&typeof e?.[Symbol.iterator]=="function"}s(St,"isIterableObject");function be(e,t){if(A(t)){let n=be(e,t.ofType);return n?.kind===p.NULL?null:n}if(e===null)return{kind:p.NULL};if(e===void 0)return null;if(B(t)){let n=t.ofType;if(St(e)){let i=[];for(let r of e){let o=be(r,n);o!=null&&i.push(o)}return{kind:p.LIST,values:i}}return be(e,n)}if(V(t)){if(!k(e))return null;let n=[];for(let i of Object.values(t.getFields())){let r=be(e[i.name],i.type);r&&n.push({kind:p.OBJECT_FIELD,name:{kind:p.NAME,value:i.name},value:r})}return{kind:p.OBJECT,fields:n}}if(Te(t)){let n=t.serialize(e);if(n==null)return null;if(typeof n=="boolean")return{kind:p.BOOLEAN,value:n};if(typeof n=="number"&&Number.isFinite(n)){let i=String(n);return wn.test(i)?{kind:p.INT,value:i}:{kind:p.FLOAT,value:i}}if(typeof n=="string")return Y(t)?{kind:p.ENUM,value:n}:t===_t&&wn.test(n)?{kind:p.INT,value:n}:{kind:p.STRING,value:n};throw new TypeError(`Cannot convert value to AST: ${m(n)}.`)}oe(!1,"Unexpected input type: "+m(t))}s(be,"astFromValue");var wn=/^-?(?:0|[1-9][0-9]*)$/;var Ye=new M({name:"__Schema",description:"A GraphQL Schema defines the capabilities of a GraphQL server. It exposes all available types and directives on the server, as well as the entry points for query, mutation, and subscription operations.",fields:s(()=>({description:{type:O,resolve:s(e=>e.description,"resolve")},types:{description:"A list of all types supported by this server.",type:new E(new w(new E(W))),resolve(e){return Object.values(e.getTypeMap())}},queryType:{description:"The type that query operations will be rooted at.",type:new E(W),resolve:s(e=>e.getQueryType(),"resolve")},mutationType:{description:"If this server supports mutation, the type that mutation operations will be rooted at.",type:W,resolve:s(e=>e.getMutationType(),"resolve")},subscriptionType:{description:"If this server support subscription, the type that subscription operations will be rooted at.",type:W,resolve:s(e=>e.getSubscriptionType(),"resolve")},directives:{description:"A list of all directives supported by this server.",type:new E(new w(new E(Ht))),resolve:s(e=>e.getDirectives(),"resolve")}}),"fields")}),Ht=new M({name:"__Directive",description:`A Directive provides a way to describe alternate runtime execution and type validation behavior in a GraphQL document.
|
|
74
|
-
|
|
75
|
-
In some cases, you need to provide options to alter GraphQL's execution behavior in ways field arguments will not suffice, such as conditionally including or skipping a field. Directives provide this by describing additional information to the executor.`,fields:s(()=>({name:{type:new E(O),resolve:s(e=>e.name,"resolve")},description:{type:O,resolve:s(e=>e.description,"resolve")},isRepeatable:{type:new E(P),resolve:s(e=>e.isRepeatable,"resolve")},locations:{type:new E(new w(new E(Xt))),resolve:s(e=>e.locations,"resolve")},args:{type:new E(new w(new E(ze))),args:{includeDeprecated:{type:P,defaultValue:!1}},resolve(e,{includeDeprecated:t}){return t?e.args:e.args.filter(n=>n.deprecationReason==null)}}}),"fields")}),Xt=new pe({name:"__DirectiveLocation",description:"A Directive can be adjacent to many parts of the GraphQL language, a __DirectiveLocation describes one such possible adjacencies.",values:{QUERY:{value:b.QUERY,description:"Location adjacent to a query operation."},MUTATION:{value:b.MUTATION,description:"Location adjacent to a mutation operation."},SUBSCRIPTION:{value:b.SUBSCRIPTION,description:"Location adjacent to a subscription operation."},FIELD:{value:b.FIELD,description:"Location adjacent to a field."},FRAGMENT_DEFINITION:{value:b.FRAGMENT_DEFINITION,description:"Location adjacent to a fragment definition."},FRAGMENT_SPREAD:{value:b.FRAGMENT_SPREAD,description:"Location adjacent to a fragment spread."},INLINE_FRAGMENT:{value:b.INLINE_FRAGMENT,description:"Location adjacent to an inline fragment."},VARIABLE_DEFINITION:{value:b.VARIABLE_DEFINITION,description:"Location adjacent to a variable definition."},SCHEMA:{value:b.SCHEMA,description:"Location adjacent to a schema definition."},SCALAR:{value:b.SCALAR,description:"Location adjacent to a scalar definition."},OBJECT:{value:b.OBJECT,description:"Location adjacent to an object type definition."},FIELD_DEFINITION:{value:b.FIELD_DEFINITION,description:"Location adjacent to a field definition."},ARGUMENT_DEFINITION:{value:b.ARGUMENT_DEFINITION,description:"Location adjacent to an argument definition."},INTERFACE:{value:b.INTERFACE,description:"Location adjacent to an interface definition."},UNION:{value:b.UNION,description:"Location adjacent to a union definition."},ENUM:{value:b.ENUM,description:"Location adjacent to an enum definition."},ENUM_VALUE:{value:b.ENUM_VALUE,description:"Location adjacent to an enum value definition."},INPUT_OBJECT:{value:b.INPUT_OBJECT,description:"Location adjacent to an input object type definition."},INPUT_FIELD_DEFINITION:{value:b.INPUT_FIELD_DEFINITION,description:"Location adjacent to an input object field definition."}}}),W=new M({name:"__Type",description:"The fundamental unit of any GraphQL Schema is the type. There are many kinds of types in GraphQL as represented by the `__TypeKind` enum.\n\nDepending on the kind of a type, certain fields describe information about that type. Scalar types provide no information beyond a name, description and optional `specifiedByURL`, while Enum types provide their values. Object and Interface types provide the fields they describe. Abstract types, Union and Interface, provide the Object types possible at runtime. List and NonNull types compose other types.",fields:s(()=>({kind:{type:new E(en),resolve(e){if(ye(e))return L.SCALAR;if(G(e))return L.OBJECT;if(C(e))return L.INTERFACE;if(X(e))return L.UNION;if(Y(e))return L.ENUM;if(V(e))return L.INPUT_OBJECT;if(B(e))return L.LIST;if(A(e))return L.NON_NULL;oe(!1,`Unexpected type: "${m(e)}".`)}},name:{type:O,resolve:s(e=>"name"in e?e.name:void 0,"resolve")},description:{type:O,resolve:s(e=>"description"in e?e.description:void 0,"resolve")},specifiedByURL:{type:O,resolve:s(e=>"specifiedByURL"in e?e.specifiedByURL:void 0,"resolve")},fields:{type:new w(new E(Wt)),args:{includeDeprecated:{type:P,defaultValue:!1}},resolve(e,{includeDeprecated:t}){if(G(e)||C(e)){let n=Object.values(e.getFields());return t?n:n.filter(i=>i.deprecationReason==null)}}},interfaces:{type:new w(new E(W)),resolve(e){if(G(e)||C(e))return e.getInterfaces()}},possibleTypes:{type:new w(new E(W)),resolve(e,t,n,{schema:i}){if(xe(e))return i.getPossibleTypes(e)}},enumValues:{type:new w(new E(Zt)),args:{includeDeprecated:{type:P,defaultValue:!1}},resolve(e,{includeDeprecated:t}){if(Y(e)){let n=e.getValues();return t?n:n.filter(i=>i.deprecationReason==null)}}},inputFields:{type:new w(new E(ze)),args:{includeDeprecated:{type:P,defaultValue:!1}},resolve(e,{includeDeprecated:t}){if(V(e)){let n=Object.values(e.getFields());return t?n:n.filter(i=>i.deprecationReason==null)}}},ofType:{type:W,resolve:s(e=>"ofType"in e?e.ofType:void 0,"resolve")}}),"fields")}),Wt=new M({name:"__Field",description:"Object and Interface types are described by a list of Fields, each of which has a name, potentially a list of arguments, and a return type.",fields:s(()=>({name:{type:new E(O),resolve:s(e=>e.name,"resolve")},description:{type:O,resolve:s(e=>e.description,"resolve")},args:{type:new E(new w(new E(ze))),args:{includeDeprecated:{type:P,defaultValue:!1}},resolve(e,{includeDeprecated:t}){return t?e.args:e.args.filter(n=>n.deprecationReason==null)}},type:{type:new E(W),resolve:s(e=>e.type,"resolve")},isDeprecated:{type:new E(P),resolve:s(e=>e.deprecationReason!=null,"resolve")},deprecationReason:{type:O,resolve:s(e=>e.deprecationReason,"resolve")}}),"fields")}),ze=new M({name:"__InputValue",description:"Arguments provided to Fields or Directives and the input fields of an InputObject are represented as Input Values which describe their type and optionally a default value.",fields:s(()=>({name:{type:new E(O),resolve:s(e=>e.name,"resolve")},description:{type:O,resolve:s(e=>e.description,"resolve")},type:{type:new E(W),resolve:s(e=>e.type,"resolve")},defaultValue:{type:O,description:"A GraphQL-formatted string representing the default value for this input value.",resolve(e){let{type:t,defaultValue:n}=e,i=be(n,t);return i?$(i):null}},isDeprecated:{type:new E(P),resolve:s(e=>e.deprecationReason!=null,"resolve")},deprecationReason:{type:O,resolve:s(e=>e.deprecationReason,"resolve")}}),"fields")}),Zt=new M({name:"__EnumValue",description:"One possible value for a given Enum. Enum values are unique values, not a placeholder for a string or numeric value. However an Enum value is returned in a JSON response as a string.",fields:s(()=>({name:{type:new E(O),resolve:s(e=>e.name,"resolve")},description:{type:O,resolve:s(e=>e.description,"resolve")},isDeprecated:{type:new E(P),resolve:s(e=>e.deprecationReason!=null,"resolve")},deprecationReason:{type:O,resolve:s(e=>e.deprecationReason,"resolve")}}),"fields")}),L;(function(e){e.SCALAR="SCALAR",e.OBJECT="OBJECT",e.INTERFACE="INTERFACE",e.UNION="UNION",e.ENUM="ENUM",e.INPUT_OBJECT="INPUT_OBJECT",e.LIST="LIST",e.NON_NULL="NON_NULL"})(L||(L={}));var en=new pe({name:"__TypeKind",description:"An enum describing what kind of type a given `__Type` is.",values:{SCALAR:{value:L.SCALAR,description:"Indicates this type is a scalar."},OBJECT:{value:L.OBJECT,description:"Indicates this type is an object. `fields` and `interfaces` are valid fields."},INTERFACE:{value:L.INTERFACE,description:"Indicates this type is an interface. `fields`, `interfaces`, and `possibleTypes` are valid fields."},UNION:{value:L.UNION,description:"Indicates this type is a union. `possibleTypes` is a valid field."},ENUM:{value:L.ENUM,description:"Indicates this type is an enum. `enumValues` is a valid field."},INPUT_OBJECT:{value:L.INPUT_OBJECT,description:"Indicates this type is an input object. `inputFields` is a valid field."},LIST:{value:L.LIST,description:"Indicates this type is a list. `ofType` is a valid field."},NON_NULL:{value:L.NON_NULL,description:"Indicates this type is a non-null. `ofType` is a valid field."}}}),Lt={name:"__schema",type:new E(Ye),description:"Access the current type schema of this server.",args:[],resolve:s((e,t,n,{schema:i})=>i,"resolve"),deprecationReason:void 0,extensions:Object.create(null),astNode:void 0},Ot={name:"__type",type:W,description:"Request the type information of a single type.",args:[{name:"name",description:void 0,type:new E(O),defaultValue:void 0,deprecationReason:void 0,extensions:Object.create(null),astNode:void 0}],resolve:s((e,{name:t},n,{schema:i})=>i.getType(t),"resolve"),deprecationReason:void 0,extensions:Object.create(null),astNode:void 0},At={name:"__typename",type:new E(O),description:"The name of the current Object type at runtime.",args:[],resolve:s((e,t,n,{parentType:i})=>i.name,"resolve"),deprecationReason:void 0,extensions:Object.create(null),astNode:void 0},tn=Object.freeze([Ye,Ht,Xt,W,Wt,ze,Zt,en]);var Ke=class{static{s(this,"GraphQLSchema")}constructor(t){var n,i;this.__validationErrors=t.assumeValid===!0?[]:void 0,k(t)||I(!1,"Must provide configuration object."),!t.types||Array.isArray(t.types)||I(!1,`"types" must be Array if provided but got: ${m(t.types)}.`),!t.directives||Array.isArray(t.directives)||I(!1,`"directives" must be Array if provided but got: ${m(t.directives)}.`),this.description=t.description,this.extensions=j(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=(n=t.extensionASTNodes)!==null&&n!==void 0?n:[],this._queryType=t.query,this._mutationType=t.mutation,this._subscriptionType=t.subscription,this._directives=(i=t.directives)!==null&&i!==void 0?i:Kt;let r=new Set(t.types);if(t.types!=null)for(let o of t.types)r.delete(o),ie(o,r);this._queryType!=null&&ie(this._queryType,r),this._mutationType!=null&&ie(this._mutationType,r),this._subscriptionType!=null&&ie(this._subscriptionType,r);for(let o of this._directives)if(zt(o))for(let a of o.args)ie(a.type,r);ie(Ye,r),this._typeMap=Object.create(null),this._subTypeMap=Object.create(null),this._implementationsMap=Object.create(null);for(let o of r){if(o==null)continue;let a=o.name;if(a||I(!1,"One of the provided types for building the Schema is missing a name."),this._typeMap[a]!==void 0)throw new Error(`Schema must contain uniquely named types but contains multiple types named "${a}".`);if(this._typeMap[a]=o,C(o)){for(let c of o.getInterfaces())if(C(c)){let d=this._implementationsMap[c.name];d===void 0&&(d=this._implementationsMap[c.name]={objects:[],interfaces:[]}),d.interfaces.push(o)}}else if(G(o)){for(let c of o.getInterfaces())if(C(c)){let d=this._implementationsMap[c.name];d===void 0&&(d=this._implementationsMap[c.name]={objects:[],interfaces:[]}),d.objects.push(o)}}}}get[Symbol.toStringTag](){return"GraphQLSchema"}getQueryType(){return this._queryType}getMutationType(){return this._mutationType}getSubscriptionType(){return this._subscriptionType}getRootType(t){switch(t){case H.QUERY:return this.getQueryType();case H.MUTATION:return this.getMutationType();case H.SUBSCRIPTION:return this.getSubscriptionType()}}getTypeMap(){return this._typeMap}getType(t){return this.getTypeMap()[t]}getPossibleTypes(t){return X(t)?t.getTypes():this.getImplementations(t).objects}getImplementations(t){let n=this._implementationsMap[t.name];return n??{objects:[],interfaces:[]}}isSubType(t,n){let i=this._subTypeMap[t.name];if(i===void 0){if(i=Object.create(null),X(t))for(let r of t.getTypes())i[r.name]=!0;else{let r=this.getImplementations(t);for(let o of r.objects)i[o.name]=!0;for(let o of r.interfaces)i[o.name]=!0}this._subTypeMap[t.name]=i}return i[n.name]!==void 0}getDirectives(){return this._directives}getDirective(t){return this.getDirectives().find(n=>n.name===t)}toConfig(){return{description:this.description,query:this.getQueryType(),mutation:this.getMutationType(),subscription:this.getSubscriptionType(),types:Object.values(this.getTypeMap()),directives:this.getDirectives(),extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes,assumeValid:this.__validationErrors!==void 0}}};function ie(e,t){let n=te(e);if(!t.has(n)){if(t.add(n),X(n))for(let i of n.getTypes())ie(i,t);else if(G(n)||C(n)){for(let i of n.getInterfaces())ie(i,t);for(let i of Object.values(n.getFields())){ie(i.type,t);for(let r of i.args)ie(r.type,t)}}else if(V(n))for(let i of Object.values(n.getFields()))ie(i.type,t)}return t}s(ie,"collectReferencedTypes");function Ne(e,t){switch(t.kind){case p.LIST_TYPE:{let n=Ne(e,t.type);return n&&new w(n)}case p.NON_NULL_TYPE:{let n=Ne(e,t.type);return n&&new E(n)}case p.NAMED_TYPE:return e.getType(t.name.value)}}s(Ne,"typeFromAST");var Ee=class{static{s(this,"TypeInfo")}constructor(t,n,i){this._schema=t,this._typeStack=[],this._parentTypeStack=[],this._inputTypeStack=[],this._fieldDefStack=[],this._defaultValueStack=[],this._directive=null,this._argument=null,this._enumValue=null,this._getFieldDef=i??gi,n&&(z(n)&&this._inputTypeStack.push(n),ce(n)&&this._parentTypeStack.push(n),de(n)&&this._typeStack.push(n))}get[Symbol.toStringTag](){return"TypeInfo"}getType(){if(this._typeStack.length>0)return this._typeStack[this._typeStack.length-1]}getParentType(){if(this._parentTypeStack.length>0)return this._parentTypeStack[this._parentTypeStack.length-1]}getInputType(){if(this._inputTypeStack.length>0)return this._inputTypeStack[this._inputTypeStack.length-1]}getParentInputType(){if(this._inputTypeStack.length>1)return this._inputTypeStack[this._inputTypeStack.length-2]}getFieldDef(){if(this._fieldDefStack.length>0)return this._fieldDefStack[this._fieldDefStack.length-1]}getDefaultValue(){if(this._defaultValueStack.length>0)return this._defaultValueStack[this._defaultValueStack.length-1]}getDirective(){return this._directive}getArgument(){return this._argument}getEnumValue(){return this._enumValue}enter(t){let n=this._schema;switch(t.kind){case p.SELECTION_SET:{let r=te(this.getType());this._parentTypeStack.push(ce(r)?r:void 0);break}case p.FIELD:{let r=this.getParentType(),o,a;r&&(o=this._getFieldDef(n,r,t),o&&(a=o.type)),this._fieldDefStack.push(o),this._typeStack.push(de(a)?a:void 0);break}case p.DIRECTIVE:this._directive=n.getDirective(t.name.value);break;case p.OPERATION_DEFINITION:{let r=n.getRootType(t.operation);this._typeStack.push(G(r)?r:void 0);break}case p.INLINE_FRAGMENT:case p.FRAGMENT_DEFINITION:{let r=t.typeCondition,o=r?Ne(n,r):te(this.getType());this._typeStack.push(de(o)?o:void 0);break}case p.VARIABLE_DEFINITION:{let r=Ne(n,t.type);this._inputTypeStack.push(z(r)?r:void 0);break}case p.ARGUMENT:{var i;let r,o,a=(i=this.getDirective())!==null&&i!==void 0?i:this.getFieldDef();a&&(r=a.args.find(c=>c.name===t.name.value),r&&(o=r.type)),this._argument=r,this._defaultValueStack.push(r?r.defaultValue:void 0),this._inputTypeStack.push(z(o)?o:void 0);break}case p.LIST:{let r=Et(this.getInputType()),o=B(r)?r.ofType:r;this._defaultValueStack.push(void 0),this._inputTypeStack.push(z(o)?o:void 0);break}case p.OBJECT_FIELD:{let r=te(this.getInputType()),o,a;V(r)&&(a=r.getFields()[t.name.value],a&&(o=a.type)),this._defaultValueStack.push(a?a.defaultValue:void 0),this._inputTypeStack.push(z(o)?o:void 0);break}case p.ENUM:{let r=te(this.getInputType()),o;Y(r)&&(o=r.getValue(t.value)),this._enumValue=o;break}default:}}leave(t){switch(t.kind){case p.SELECTION_SET:this._parentTypeStack.pop();break;case p.FIELD:this._fieldDefStack.pop(),this._typeStack.pop();break;case p.DIRECTIVE:this._directive=null;break;case p.OPERATION_DEFINITION:case p.INLINE_FRAGMENT:case p.FRAGMENT_DEFINITION:this._typeStack.pop();break;case p.VARIABLE_DEFINITION:this._inputTypeStack.pop();break;case p.ARGUMENT:this._argument=null,this._defaultValueStack.pop(),this._inputTypeStack.pop();break;case p.LIST:case p.OBJECT_FIELD:this._defaultValueStack.pop(),this._inputTypeStack.pop();break;case p.ENUM:this._enumValue=null;break;default:}}};function gi(e,t,n){let i=n.name.value;if(i===Lt.name&&e.getQueryType()===t)return Lt;if(i===Ot.name&&e.getQueryType()===t)return Ot;if(i===At.name&&ce(t))return At;if(G(t)||C(t))return t.getFields()[i]}s(gi,"getFieldDef");function Ce(e,t){return{enter(...n){let i=n[0];e.enter(i);let r=Re(t,i.kind).enter;if(r){let o=r.apply(t,n);return o!==void 0&&(e.leave(i),Ge(o)&&e.enter(o)),o}},leave(...n){let i=n[0],r=Re(t,i.kind).leave,o;return r&&(o=r.apply(t,n)),e.leave(i),o}}}s(Ce,"visitWithTypeInfo");function Dt(e){return e.map(t=>typeof t=="number"?"["+t.toString()+"]":"."+t).join("")}s(Dt,"printPathArray");function nn(e,t,n){return{prev:e,key:t,typename:n}}s(nn,"addPath");function fe(e){let t=[],n=e;for(;n;)t.push(n.key),n=n.prev;return t.reverse()}s(fe,"pathToArray");function rn(e,t,n=vi){return He(e,t,n,void 0)}s(rn,"coerceInputValue");function vi(e,t,n){let i="Invalid value "+m(t);throw e.length>0&&(i+=` at "value${Dt(e)}"`),n.message=i+": "+n.message,n}s(vi,"defaultOnError");function He(e,t,n,i){if(A(t)){if(e!=null)return He(e,t.ofType,n,i);n(fe(i),e,new y(`Expected non-nullable type "${m(t)}" not to be null.`));return}if(e==null)return null;if(B(t)){let r=t.ofType;return St(e)?Array.from(e,(o,a)=>{let c=nn(i,a,void 0);return He(o,r,n,c)}):[He(e,r,n,i)]}if(V(t)){if(!k(e)){n(fe(i),e,new y(`Expected type "${t.name}" to be an object.`));return}let r={},o=t.getFields();for(let a of Object.values(o)){let c=e[a.name];if(c===void 0){if(a.defaultValue!==void 0)r[a.name]=a.defaultValue;else if(A(a.type)){let d=m(a.type);n(fe(i),e,new y(`Field "${a.name}" of required type "${d}" was not provided.`))}continue}r[a.name]=He(c,a.type,n,nn(i,a.name,t.name))}for(let a of Object.keys(e))if(!o[a]){let c=dt(a,Object.keys(t.getFields()));n(fe(i),e,new y(`Field "${a}" is not defined by type "${t.name}".`+ut(c)))}return r}if(Te(t)){let r;try{r=t.parseValue(e)}catch(o){o instanceof y?n(fe(i),e,o):n(fe(i),e,new y(`Expected type "${t.name}". `+o.message,{originalError:o}));return}return r===void 0&&n(fe(i),e,new y(`Expected type "${t.name}".`)),r}oe(!1,"Unexpected input type: "+m(t))}s(He,"coerceInputValueImpl");function ue(e,t,n){if(e){if(e.kind===p.VARIABLE){let i=e.name.value;if(n==null||n[i]===void 0)return;let r=n[i];return r===null&&A(t)?void 0:r}if(A(t))return e.kind===p.NULL?void 0:ue(e,t.ofType,n);if(e.kind===p.NULL)return null;if(B(t)){let i=t.ofType;if(e.kind===p.LIST){let o=[];for(let a of e.values)if(Rn(a,n)){if(A(i))return;o.push(null)}else{let c=ue(a,i,n);if(c===void 0)return;o.push(c)}return o}let r=ue(e,i,n);return r===void 0?void 0:[r]}if(V(t)){if(e.kind!==p.OBJECT)return;let i=Object.create(null),r=we(e.fields,o=>o.name.value);for(let o of Object.values(t.getFields())){let a=r[o.name];if(!a||Rn(a.value,n)){if(o.defaultValue!==void 0)i[o.name]=o.defaultValue;else if(A(o.type))return;continue}let c=ue(a.value,o.type,n);if(c===void 0)return;i[o.name]=c}return i}if(Te(t)){let i;try{i=t.parseLiteral(e,n)}catch{return}return i===void 0?void 0:i}oe(!1,"Unexpected input type: "+m(t))}}s(ue,"valueFromAST");function Rn(e,t){return e.kind===p.VARIABLE&&(t==null||t[e.name.value]===void 0)}s(Rn,"isMissingVariable");function wt(e,t,n,i){let r=[],o=i?.maxErrors;try{let a=Ii(e,t,n,c=>{if(o!=null&&r.length>=o)throw new y("Too many errors processing variables, error limit reached. Execution aborted.");r.push(c)});if(r.length===0)return{coerced:a}}catch(a){r.push(a)}return{errors:r}}s(wt,"getVariableValues");function Ii(e,t,n,i){let r={};for(let o of t){let a=o.variable.name.value,c=Ne(e,o.type);if(!z(c)){let f=$(o.type);i(new y(`Variable "$${a}" expected value of type "${f}" which cannot be used as an input type.`,{nodes:o.type}));continue}if(!kn(n,a)){if(o.defaultValue)r[a]=ue(o.defaultValue,c);else if(A(c)){let f=m(c);i(new y(`Variable "$${a}" of required type "${f}" was not provided.`,{nodes:o}))}continue}let d=n[a];if(d===null&&A(c)){let f=m(c);i(new y(`Variable "$${a}" of non-null type "${f}" must not be null.`,{nodes:o}));continue}r[a]=rn(d,c,(f,T,x)=>{let N=`Variable "$${a}" got invalid value `+m(T);f.length>0&&(N+=` at "${a}${Dt(f)}"`),i(new y(N+"; "+x.message,{nodes:o,originalError:x}))})}return r}s(Ii,"coerceVariableValues");function Xe(e,t,n){var i;let r={},o=(i=t.arguments)!==null&&i!==void 0?i:[],a=we(o,c=>c.name.value);for(let c of e.args){let d=c.name,f=c.type,T=a[d];if(!T){if(c.defaultValue!==void 0)r[d]=c.defaultValue;else if(A(f))throw new y(`Argument "${d}" of required type "${m(f)}" was not provided.`,{nodes:t});continue}let x=T.value,N=x.kind===p.NULL;if(x.kind===p.VARIABLE){let g=x.name.value;if(n==null||!kn(n,g)){if(c.defaultValue!==void 0)r[d]=c.defaultValue;else if(A(f))throw new y(`Argument "${d}" of required type "${m(f)}" was provided the variable "$${g}" which was not provided a runtime value.`,{nodes:x});continue}N=n[g]==null}if(N&&A(f))throw new y(`Argument "${d}" of non-null type "${m(f)}" must not be null.`,{nodes:x});let S=ue(x,f,n);if(S===void 0)throw new y(`Argument "${d}" has invalid value ${$(x)}.`,{nodes:x});r[d]=S}return r}s(Xe,"getArgumentValues");function We(e,t,n){var i;let r=(i=t.directives)===null||i===void 0?void 0:i.find(o=>o.name.value===e.name);if(r)return Xe(e,r,n)}s(We,"getDirectiveValues");function kn(e,t){return Object.prototype.hasOwnProperty.call(e,t)}s(kn,"hasOwnProperty");var sn=class{static{s(this,"ASTValidationContext")}constructor(t,n){this._ast=t,this._fragments=void 0,this._fragmentSpreads=new Map,this._recursivelyReferencedFragments=new Map,this._onError=n}get[Symbol.toStringTag](){return"ASTValidationContext"}reportError(t){this._onError(t)}getDocument(){return this._ast}getFragment(t){let n;if(this._fragments)n=this._fragments;else{n=Object.create(null);for(let i of this.getDocument().definitions)i.kind===p.FRAGMENT_DEFINITION&&(n[i.name.value]=i);this._fragments=n}return n[t]}getFragmentSpreads(t){let n=this._fragmentSpreads.get(t);if(!n){n=[];let i=[t],r;for(;r=i.pop();)for(let o of r.selections)o.kind===p.FRAGMENT_SPREAD?n.push(o):o.selectionSet&&i.push(o.selectionSet);this._fragmentSpreads.set(t,n)}return n}getRecursivelyReferencedFragments(t){let n=this._recursivelyReferencedFragments.get(t);if(!n){n=[];let i=Object.create(null),r=[t.selectionSet],o;for(;o=r.pop();)for(let a of this.getFragmentSpreads(o)){let c=a.name.value;if(i[c]!==!0){i[c]=!0;let d=this.getFragment(c);d&&(n.push(d),r.push(d.selectionSet))}}this._recursivelyReferencedFragments.set(t,n)}return n}};var Fe=class extends sn{static{s(this,"ValidationContext")}constructor(t,n,i,r){super(n,r),this._schema=t,this._typeInfo=i,this._variableUsages=new Map,this._recursiveVariableUsages=new Map}get[Symbol.toStringTag](){return"ValidationContext"}getSchema(){return this._schema}getVariableUsages(t){let n=this._variableUsages.get(t);if(!n){let i=[],r=new Ee(this._schema);he(t,Ce(r,{VariableDefinition:s(()=>!1,"VariableDefinition"),Variable(o){i.push({node:o,type:r.getInputType(),defaultValue:r.getDefaultValue()})}})),n=i,this._variableUsages.set(t,n)}return n}getRecursiveVariableUsages(t){let n=this._recursiveVariableUsages.get(t);if(!n){n=this.getVariableUsages(t);for(let i of this.getRecursivelyReferencedFragments(t))n=n.concat(this.getVariableUsages(i));this._recursiveVariableUsages.set(t,n)}return n}getType(){return this._typeInfo.getType()}getParentType(){return this._typeInfo.getParentType()}getInputType(){return this._typeInfo.getInputType()}getParentInputType(){return this._typeInfo.getParentInputType()}getFieldDef(){return this._typeInfo.getFieldDef()}getDirective(){return this._typeInfo.getDirective()}getArgument(){return this._typeInfo.getArgument()}getEnumValue(){return this._typeInfo.getEnumValue()}};function Rt(e){let t={descriptions:!0,specifiedByUrl:!1,directiveIsRepeatable:!1,schemaDescription:!1,inputValueDeprecation:!1,...e},n=t.descriptions?"description":"",i=t.specifiedByUrl?"specifiedByURL":"",r=t.directiveIsRepeatable?"isRepeatable":"",o=t.schemaDescription?n:"";function a(c){return t.inputValueDeprecation?c:""}return s(a,"inputDeprecation"),`
|
|
76
|
-
query IntrospectionQuery {
|
|
77
|
-
__schema {
|
|
78
|
-
${o}
|
|
79
|
-
queryType { name }
|
|
80
|
-
mutationType { name }
|
|
81
|
-
subscriptionType { name }
|
|
82
|
-
types {
|
|
83
|
-
...FullType
|
|
84
|
-
}
|
|
85
|
-
directives {
|
|
86
|
-
name
|
|
87
|
-
${n}
|
|
88
|
-
${r}
|
|
89
|
-
locations
|
|
90
|
-
args${a("(includeDeprecated: true)")} {
|
|
91
|
-
...InputValue
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
fragment FullType on __Type {
|
|
98
|
-
kind
|
|
99
|
-
name
|
|
100
|
-
${n}
|
|
101
|
-
${i}
|
|
102
|
-
fields(includeDeprecated: true) {
|
|
103
|
-
name
|
|
104
|
-
${n}
|
|
105
|
-
args${a("(includeDeprecated: true)")} {
|
|
106
|
-
...InputValue
|
|
107
|
-
}
|
|
108
|
-
type {
|
|
109
|
-
...TypeRef
|
|
110
|
-
}
|
|
111
|
-
isDeprecated
|
|
112
|
-
deprecationReason
|
|
113
|
-
}
|
|
114
|
-
inputFields${a("(includeDeprecated: true)")} {
|
|
115
|
-
...InputValue
|
|
116
|
-
}
|
|
117
|
-
interfaces {
|
|
118
|
-
...TypeRef
|
|
119
|
-
}
|
|
120
|
-
enumValues(includeDeprecated: true) {
|
|
121
|
-
name
|
|
122
|
-
${n}
|
|
123
|
-
isDeprecated
|
|
124
|
-
deprecationReason
|
|
125
|
-
}
|
|
126
|
-
possibleTypes {
|
|
127
|
-
...TypeRef
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
fragment InputValue on __InputValue {
|
|
132
|
-
name
|
|
133
|
-
${n}
|
|
134
|
-
type { ...TypeRef }
|
|
135
|
-
defaultValue
|
|
136
|
-
${a("isDeprecated")}
|
|
137
|
-
${a("deprecationReason")}
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
fragment TypeRef on __Type {
|
|
141
|
-
kind
|
|
142
|
-
name
|
|
143
|
-
ofType {
|
|
144
|
-
kind
|
|
145
|
-
name
|
|
146
|
-
ofType {
|
|
147
|
-
kind
|
|
148
|
-
name
|
|
149
|
-
ofType {
|
|
150
|
-
kind
|
|
151
|
-
name
|
|
152
|
-
ofType {
|
|
153
|
-
kind
|
|
154
|
-
name
|
|
155
|
-
ofType {
|
|
156
|
-
kind
|
|
157
|
-
name
|
|
158
|
-
ofType {
|
|
159
|
-
kind
|
|
160
|
-
name
|
|
161
|
-
ofType {
|
|
162
|
-
kind
|
|
163
|
-
name
|
|
164
|
-
ofType {
|
|
165
|
-
kind
|
|
166
|
-
name
|
|
167
|
-
ofType {
|
|
168
|
-
kind
|
|
169
|
-
name
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
`}s(Rt,"getIntrospectionQuery");function kt(e,t){k(e)&&k(e.__schema)||I(!1,`Invalid or incomplete introspection result. Ensure that you are passing "data" property of introspection response and no "errors" was returned alongside: ${m(e)}.`);let n=e.__schema,i=ae(n.types,l=>l.name,l=>N(l));for(let l of[...Yt,...tn])i[l.name]&&(i[l.name]=l);let r=n.queryType?T(n.queryType):null,o=n.mutationType?T(n.mutationType):null,a=n.subscriptionType?T(n.subscriptionType):null,c=n.directives?n.directives.map(jn):[];return new Ke({description:n.description,query:r,mutation:o,subscription:a,types:Object.values(i),directives:c,assumeValid:t?.assumeValid});function d(l){if(l.kind===L.LIST){let v=l.ofType;if(!v)throw new Error("Decorated type deeper than introspection query.");return new w(d(v))}if(l.kind===L.NON_NULL){let v=l.ofType;if(!v)throw new Error("Decorated type deeper than introspection query.");let se=d(v);return new E(Nt(se))}return f(l)}function f(l){let v=l.name;if(!v)throw new Error(`Unknown type reference: ${m(l)}.`);let se=i[v];if(!se)throw new Error(`Invalid or incomplete schema, unknown type: ${v}. Ensure that a full introspection query is used in order to build a client schema.`);return se}function T(l){return yt(f(l))}function x(l){return Tt(f(l))}function N(l){if(l!=null&&l.name!=null&&l.kind!=null)switch(l.kind){case L.SCALAR:return S(l);case L.OBJECT:return U(l);case L.INTERFACE:return K(l);case L.UNION:return F(l);case L.ENUM:return me(l);case L.INPUT_OBJECT:return re(l)}let v=m(l);throw new Error(`Invalid or incomplete introspection result. Ensure that a full introspection query is used in order to build a client schema: ${v}.`)}function S(l){return new J({name:l.name,description:l.description,specifiedByURL:l.specifiedByURL})}function g(l){if(l.interfaces===null&&l.kind===L.INTERFACE)return[];if(!l.interfaces){let v=m(l);throw new Error(`Introspection result missing interfaces: ${v}.`)}return l.interfaces.map(x)}function U(l){return new M({name:l.name,description:l.description,interfaces:s(()=>g(l),"interfaces"),fields:s(()=>Z(l),"fields")})}function K(l){return new le({name:l.name,description:l.description,interfaces:s(()=>g(l),"interfaces"),fields:s(()=>Z(l),"fields")})}function F(l){if(!l.possibleTypes){let v=m(l);throw new Error(`Introspection result missing possibleTypes: ${v}.`)}return new ve({name:l.name,description:l.description,types:s(()=>l.possibleTypes.map(T),"types")})}function me(l){if(!l.enumValues){let v=m(l);throw new Error(`Introspection result missing enumValues: ${v}.`)}return new pe({name:l.name,description:l.description,values:ae(l.enumValues,v=>v.name,v=>({description:v.description,deprecationReason:v.deprecationReason}))})}function re(l){if(!l.inputFields){let v=m(l);throw new Error(`Introspection result missing inputFields: ${v}.`)}return new Ie({name:l.name,description:l.description,fields:s(()=>_e(l.inputFields),"fields")})}function Z(l){if(!l.fields)throw new Error(`Introspection result missing fields: ${m(l)}.`);return ae(l.fields,v=>v.name,Ue)}function Ue(l){let v=d(l.type);if(!de(v)){let se=m(v);throw new Error(`Introspection must provide output type for fields, but received: ${se}.`)}if(!l.args){let se=m(l);throw new Error(`Introspection result missing field args: ${se}.`)}return{description:l.description,deprecationReason:l.deprecationReason,type:v,args:_e(l.args)}}function _e(l){return ae(l,v=>v.name,Ze)}function Ze(l){let v=d(l.type);if(!z(v)){let $n=m(v);throw new Error(`Introspection must provide input type for arguments, but received: ${$n}.`)}let se=l.defaultValue!=null?ue(ct(l.defaultValue),v):void 0;return{description:l.description,type:v,defaultValue:se,deprecationReason:l.deprecationReason}}function jn(l){if(!l.args){let v=m(l);throw new Error(`Introspection result missing directive args: ${v}.`)}if(!l.locations){let v=m(l);throw new Error(`Introspection result missing directive locations: ${v}.`)}return new ne({name:l.name,description:l.description,isRepeatable:l.isRepeatable,locations:l.locations.slice(),args:_e(l.args)})}}s(kt,"buildClientSchema");function Yi(e,t){return`The query exceeds the maximum complexity of ${e}. Actual complexity is ${t}`}s(Yi,"queryComplexityMessage");function Cn(e){let t=new Ee(e.schema),n=[],i=new Fe(e.schema,e.query,t,o=>n.push(o)),r=new on(i,{maximumComplexity:e.maximumComplexity??1/0,estimators:e.estimators,variables:e.variables,operationName:e.operationName,context:e.context});if(he(e.query,Ce(t,r)),n.length)throw n.pop();return r.complexity}s(Cn,"getComplexity");var on=class{static{s(this,"QueryComplexity")}context;complexity;options;OperationDefinition;estimators;includeDirectiveDef;skipDirectiveDef;variableValues;requestContext;constructor(t,n){if(Number(n.maximumComplexity)<=0)throw new Error("Maximum query complexity must be a positive number");this.context=t,this.complexity=0,this.options=n,this.includeDirectiveDef=this.context.getSchema().getDirective("include")||void 0,this.skipDirectiveDef=this.context.getSchema().getDirective("skip")||void 0,this.estimators=n.estimators,this.variableValues={},this.requestContext=n.context,this.OperationDefinition={enter:this.onOperationDefinitionEnter,leave:this.onOperationDefinitionLeave}}onOperationDefinitionEnter(t){if(typeof this.options.operationName=="string"&&this.options.operationName!==t.name?.value)return;let{coerced:n,errors:i}=wt(this.context.getSchema(),t.variableDefinitions?[...t.variableDefinitions]:[],this.options.variables??{});if(i&&i.length){i.forEach(o=>this.context.reportError(o));return}this.variableValues=n||{};let r=this.context.getSchema();switch(t.operation){case"query":{let o=r.getQueryType();if(!o)throw new Error("Schema does not define the required query root type");this.complexity+=this.nodeComplexity(t,o);break}case"mutation":{let o=r.getMutationType();if(!o)throw new Error("Schema does not define the required mutation root type");this.complexity+=this.nodeComplexity(t,o);break}case"subscription":{let o=r.getSubscriptionType();if(!o)throw new Error("Schema does not define the required mutation subscription type");this.complexity+=this.nodeComplexity(t,o);break}default:throw new Error(`Query complexity could not be calculated for operation of type ${t.operation}`)}}onOperationDefinitionLeave(t){if(!(typeof this.options.operationName=="string"&&this.options.operationName!==t.name?.value)&&(this.options.onComplete&&this.options.onComplete(this.complexity),this.complexity>this.options.maximumComplexity))return this.context.reportError(this.createError())}nodeComplexity(t,n){if(t.selectionSet){let i={};(n instanceof M||n instanceof le)&&(i=n.getFields());let r;xe(n)?r=this.context.getSchema().getPossibleTypes(n).map(a=>a.name):r=[n.name];let o=t.selectionSet.selections.reduce((a,c)=>{let d=a,f=!0,T=!1;for(let x of c.directives??[])switch(x.name.value){case"include":{let S=this.includeDirectiveDef&&We(this.includeDirectiveDef,c,this.variableValues||{});typeof S?.if=="boolean"&&(f=S.if);break}case"skip":{let S=this.skipDirectiveDef&&We(this.skipDirectiveDef,c,this.variableValues||{});typeof S?.if=="boolean"&&(T=S.if);break}}if(!f||T)return a;switch(c.kind){case p.FIELD:{let x=i[c.name.value];if(!x)break;let N=te(x.type),S;try{S=Xe(x,c,this.variableValues||{})}catch(F){return this.context.reportError(F),a}let g=0;ce(N)&&(g=this.nodeComplexity(c,N));let U={childComplexity:g,args:S,field:x,node:c,type:n,context:this.requestContext};if(!this.estimators.find(F=>{let me=F(U);return typeof me=="number"&&!isNaN(me)?(d=Ve(me,a,r),!0):!1}))return this.context.reportError(new y(`No complexity could be calculated for field ${n.name}.${x.name}. At least one complexity estimator has to return a complexity score.`)),a;break}case p.FRAGMENT_SPREAD:{let x=this.context.getFragment(c.name.value);if(!x)break;let N=this.context.getSchema().getType(x.typeCondition.name.value);if(!ce(N))break;let S=this.nodeComplexity(x,N);xe(N)?d=Ve(S,a,this.context.getSchema().getPossibleTypes(N).map(g=>g.name)):d=Ve(S,a,[N.name]);break}case p.INLINE_FRAGMENT:{let x=n;if(c.typeCondition&&c.typeCondition.name&&(x=this.context.getSchema().getType(c.typeCondition.name.value)||x,!ce(x)))break;let N=this.nodeComplexity(c,x);xe(x)?d=Ve(N,a,this.context.getSchema().getPossibleTypes(x).map(S=>S.name)):d=Ve(N,a,[x.name]);break}default:{d=Ve(this.nodeComplexity(c,n),a,r);break}}return d},{});return o?Math.max(...Object.values(o),0):NaN}return 0}createError(){return typeof this.options.createError=="function"?this.options.createError(this.options.maximumComplexity,this.complexity):new y(Yi(this.options.maximumComplexity,this.complexity))}};function Ve(e,t,n){for(let i of n)Object.prototype.hasOwnProperty.call(t,i)?t[i]+=e:t[i]=e;return t}s(Ve,"addComplexities");function Fn(e){let t=e?.defaultComplexity??1;return n=>t+n.childComplexity}s(Fn,"simpleEstimator");var Vn=s((e,t,n={})=>{let{definitions:i}=e,r=zi(i),o=Ki(i);return Object.entries(o).map(([a,c])=>Ct(c,r,0,t,a,n))},"depthLimit");function zi(e){return e.reduce((t,n)=>(n.kind===p.FRAGMENT_DEFINITION&&(t[n?.name?.value??""]=n),t),{})}s(zi,"getFragments");function Ki(e){return e.reduce((t,n)=>{if(n.kind===p.OPERATION_DEFINITION){let i=n?.name?.value??"";t[i]=n}return t},{})}s(Ki,"getQueriesAndMutations");function Ct(e,t,n,i,r,o){if(n>i)throw o?.onLimitReached?.(n,r),new y(`${r||"Your query"} exceeds maximum operation depth of ${i}`,{nodes:[e]});let a=o?.ignore??[/^__/];switch(e.kind){case p.FIELD:return Hi(e,a)||!e.selectionSet?0:1+Math.max(...e.selectionSet.selections.map(c=>Ct(c,t,n+1,i,r,o)));case p.FRAGMENT_SPREAD:return Ct(t[e.name.value],t,n,i,r,o);case p.INLINE_FRAGMENT:case p.FRAGMENT_DEFINITION:case p.OPERATION_DEFINITION:return Math.max(...e.selectionSet.selections.map(c=>Ct(c,t,n,i,r,o)));default:throw new Error("uh oh! depth crawler cannot handle: "+e.kind)}}s(Ct,"determineDepth");var Hi=s((e,t)=>t.find(n=>e.name.value.match(n)!==null)||!1,"isIgnored");var Xi=s(async(e,t)=>{if(!t.complexityLimit)throw new Ft.ConfigurationError("No complexity maximum defined, you need to pass a maxComplexity to the policy");let i=t.endpointUrl;if(!i)throw new Ft.ConfigurationError("No GraphQL endpoint, you need to pass a endpointUrl to the policy");let r=Rt(),c=(await(await fetch(i,{method:"POST",body:JSON.stringify({query:r}),headers:{"Content-Type":"application/json"}})).json()).data;if(!c||!c?.__schema)throw new y("GraphQL introspection query failed, enable introspection or pass a schema url in configuration.");let d=kt(c,{assumeValid:!0}),f=Cn({estimators:[Fn({defaultComplexity:1})],schema:d,query:e,variables:{count:10}});if(t.complexityLimit&&f>t.complexityLimit)throw new y(`Query is too complex (${f}/${t.complexityLimit}), remove some fields and try again`)},"applyComplexityLimitPolicy"),Wi=s(async(e,t)=>{let n=t.depthLimit;if(!n)throw new Ft.ConfigurationError("No maximum depth defined, you need to pass a maxDepth to the policy");return Math.max(...Vn(e,n))},"applyDepthLimitPolicy"),Un=s(async(e,t,n)=>{try{let r=await e.clone().json(),o=pt(r.query);n.useDepthLimit&&await Wi(o,n.useDepthLimit),n.useComplexityLimit&&await Xi(o,n.useComplexityLimit)}catch(i){if(t.log.error(i),i instanceof y)return new Response(JSON.stringify(i.toJSON()),{status:400,headers:{"Content-Type":"application/json"}});throw i}return e},"GraphQLComplexityLimitInboundPolicy");var Mn=require("@zuplo/runtime");function Zi(e){if(!e)return!1;let t=e.replace(/\s/g,"");return t.includes("__schema")||t.includes("__type")}s(Zi,"isIntrospectionQuery");var Gn=s(async(e,t)=>{let i=await e.clone().json();return Zi(i.query)?Mn.HttpProblems.forbidden(e,t,{detail:"Introspection queries are not allowed"}):e},"GraphQLDisableIntrospectionInboundPolicy");
|
|
181
|
-
/*! For license information please see index.js.LEGAL.txt */
|
|
File without changes
|