@spritz-finance/api-client 0.0.6 → 0.0.8
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/README.md +106 -26
- package/dist/spritz-api-client.d.ts +12 -0
- package/dist/spritz-api-client.js +32 -32
- package/dist/spritz-api-client.js.map +1 -1
- package/dist/spritz-api-client.mjs +32 -32
- package/dist/spritz-api-client.mjs.map +1 -1
- package/package.json +2 -1
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
`),g=i.split(/\r\n|[\n\r]/g),E=g[
|
|
3
|
-
`)}function
|
|
1
|
+
import In from"axios";var Di=Object.getOwnPropertyNames,Z=(e,n)=>function(){return n||(0,e[Di(e)[0]])((n={exports:{}}).exports,n),n.exports};function xe(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?xe=function(t){return typeof t}:xe=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},xe(e)}function oe(e){return xe(e)=="object"&&e!==null}var ot=typeof Symbol=="function"&&Symbol.iterator!=null?Symbol.iterator:"@@iterator",G=typeof Symbol=="function"&&Symbol.toStringTag!=null?Symbol.toStringTag:"@@toStringTag";function wn(e,n){for(var t=/\r\n|[\n\r]/g,i=1,a=n+1,r;(r=t.exec(e.body))&&r.index<n;)i+=1,a=n+1-(r.index+r[0].length);return{line:i,column:a}}function Oi(e){return st(e.source,wn(e.source,e.start))}function st(e,n){var t=e.locationOffset.column-1,i=Ce(t)+e.body,a=n.line-1,r=e.locationOffset.line-1,u=n.line+r,o=n.line===1?t:0,s=n.column+o,l="".concat(e.name,":").concat(u,":").concat(s,`
|
|
2
|
+
`),g=i.split(/\r\n|[\n\r]/g),E=g[a];if(E.length>120){for(var y=Math.floor(s/80),d=s%80,N=[],w=0;w<E.length;w+=80)N.push(E.slice(w,w+80));return l+ut([["".concat(u),N[0]]].concat(N.slice(1,y+1).map(function(O){return["",O]}),[[" ",Ce(d-1)+"^"],["",N[y+1]]]))}return l+ut([["".concat(u-1),g[a-1]],["".concat(u),E],["",Ce(s-1)+"^"],["".concat(u+1),g[a+1]]])}function ut(e){var n=e.filter(function(i){i[0];var a=i[1];return a!==void 0}),t=Math.max.apply(Math,n.map(function(i){var a=i[0];return a.length}));return n.map(function(i){var a=i[0],r=i[1];return _i(t,a)+(r?" | "+r:" |")}).join(`
|
|
3
|
+
`)}function Ce(e){return Array(e+1).join(" ")}function _i(e,n){return Ce(e-n.length)+n}function qe(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?qe=function(t){return typeof t}:qe=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},qe(e)}function ct(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),t.push.apply(t,i)}return t}function Fi(e){for(var n=1;n<arguments.length;n++){var t=arguments[n]!=null?arguments[n]:{};n%2?ct(Object(t),!0).forEach(function(i){Li(e,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ct(Object(t)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(t,i))})}return e}function Li(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function Ri(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}function lt(e,n){for(var t=0;t<n.length;t++){var i=n[t];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function Pi(e,n,t){return n&<(e.prototype,n),t&<(e,t),e}function Ui(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(n&&n.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),n&&Ae(e,n)}function Bi(e){var n=dt();return function(){var i=De(e),a;if(n){var r=De(this).constructor;a=Reflect.construct(i,arguments,r)}else a=i.apply(this,arguments);return ft(this,a)}}function ft(e,n){return n&&(qe(n)==="object"||typeof n=="function")?n:we(e)}function we(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function An(e){var n=typeof Map=="function"?new Map:void 0;return An=function(i){if(i===null||!Vi(i))return i;if(typeof i!="function")throw new TypeError("Super expression must either be null or a function");if(typeof n<"u"){if(n.has(i))return n.get(i);n.set(i,a)}function a(){return je(i,arguments,De(this).constructor)}return a.prototype=Object.create(i.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),Ae(a,i)},An(e)}function je(e,n,t){return dt()?je=Reflect.construct:je=function(a,r,u){var o=[null];o.push.apply(o,r);var s=Function.bind.apply(a,o),l=new s;return u&&Ae(l,u.prototype),l},je.apply(null,arguments)}function dt(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function Vi(e){return Function.toString.call(e).indexOf("[native code]")!==-1}function Ae(e,n){return Ae=Object.setPrototypeOf||function(i,a){return i.__proto__=a,i},Ae(e,n)}function De(e){return De=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},De(e)}var U=function(e){Ui(t,e);var n=Bi(t);function t(i,a,r,u,o,s,l){var g,E,y,d;Ri(this,t),d=n.call(this,i),d.name="GraphQLError",d.originalError=s??void 0,d.nodes=vt(Array.isArray(a)?a:a?[a]:void 0);for(var N=[],w=0,O=(D=d.nodes)!==null&&D!==void 0?D:[];w<O.length;w++){var D,P=O[w],L=P.loc;L!=null&&N.push(L)}N=vt(N),d.source=r??((g=N)===null||g===void 0?void 0:g[0].source),d.positions=u??((E=N)===null||E===void 0?void 0:E.map(function(c){return c.start})),d.locations=u&&r?u.map(function(c){return wn(r,c)}):(y=N)===null||y===void 0?void 0:y.map(function(c){return wn(c.source,c.start)}),d.path=o??void 0;var f=s?.extensions;return l==null&&oe(f)?d.extensions=Fi({},f):d.extensions=l??{},Object.defineProperties(we(d),{message:{enumerable:!0},locations:{enumerable:d.locations!=null},path:{enumerable:d.path!=null},extensions:{enumerable:d.extensions!=null&&Object.keys(d.extensions).length>0},name:{enumerable:!1},nodes:{enumerable:!1},source:{enumerable:!1},positions:{enumerable:!1},originalError:{enumerable:!1}}),s!=null&&s.stack?(Object.defineProperty(we(d),"stack",{value:s.stack,writable:!0,configurable:!0}),ft(d)):(Error.captureStackTrace?Error.captureStackTrace(we(d),t):Object.defineProperty(we(d),"stack",{value:Error().stack,writable:!0,configurable:!0}),d)}return Pi(t,[{key:"toString",value:function(){return Mi(this)}},{key:G,get:function(){return"Object"}}]),t}(An(Error));function vt(e){return e===void 0||e.length===0?void 0:e}function Mi(e){var n=e.message;if(e.nodes)for(var t=0,i=e.nodes;t<i.length;t++){var a=i[t];a.loc&&(n+=`
|
|
4
4
|
|
|
5
|
-
`+
|
|
5
|
+
`+Oi(a.loc))}else if(e.source&&e.locations)for(var r=0,u=e.locations;r<u.length;r++){var o=u[r];n+=`
|
|
6
6
|
|
|
7
|
-
`+st(e.source,o)}return n}var h=Object.freeze({NAME:"Name",DOCUMENT:"Document",OPERATION_DEFINITION:"OperationDefinition",VARIABLE_DEFINITION:"VariableDefinition",SELECTION_SET:"SelectionSet",FIELD:"Field",ARGUMENT:"Argument",FRAGMENT_SPREAD:"FragmentSpread",INLINE_FRAGMENT:"InlineFragment",FRAGMENT_DEFINITION:"FragmentDefinition",VARIABLE:"Variable",INT:"IntValue",FLOAT:"FloatValue",STRING:"StringValue",BOOLEAN:"BooleanValue",NULL:"NullValue",ENUM:"EnumValue",LIST:"ListValue",OBJECT:"ObjectValue",OBJECT_FIELD:"ObjectField",DIRECTIVE:"Directive",NAMED_TYPE:"NamedType",LIST_TYPE:"ListType",NON_NULL_TYPE:"NonNullType",SCHEMA_DEFINITION:"SchemaDefinition",OPERATION_TYPE_DEFINITION:"OperationTypeDefinition",SCALAR_TYPE_DEFINITION:"ScalarTypeDefinition",OBJECT_TYPE_DEFINITION:"ObjectTypeDefinition",FIELD_DEFINITION:"FieldDefinition",INPUT_VALUE_DEFINITION:"InputValueDefinition",INTERFACE_TYPE_DEFINITION:"InterfaceTypeDefinition",UNION_TYPE_DEFINITION:"UnionTypeDefinition",ENUM_TYPE_DEFINITION:"EnumTypeDefinition",ENUM_VALUE_DEFINITION:"EnumValueDefinition",INPUT_OBJECT_TYPE_DEFINITION:"InputObjectTypeDefinition",DIRECTIVE_DEFINITION:"DirectiveDefinition",SCHEMA_EXTENSION:"SchemaExtension",SCALAR_TYPE_EXTENSION:"ScalarTypeExtension",OBJECT_TYPE_EXTENSION:"ObjectTypeExtension",INTERFACE_TYPE_EXTENSION:"InterfaceTypeExtension",UNION_TYPE_EXTENSION:"UnionTypeExtension",ENUM_TYPE_EXTENSION:"EnumTypeExtension",INPUT_OBJECT_TYPE_EXTENSION:"InputObjectTypeExtension"});function Oe(e,n){var t=!!e;if(!t)throw new Error(n??"Unexpected invariant triggered.")}var
|
|
7
|
+
`+st(e.source,o)}return n}var h=Object.freeze({NAME:"Name",DOCUMENT:"Document",OPERATION_DEFINITION:"OperationDefinition",VARIABLE_DEFINITION:"VariableDefinition",SELECTION_SET:"SelectionSet",FIELD:"Field",ARGUMENT:"Argument",FRAGMENT_SPREAD:"FragmentSpread",INLINE_FRAGMENT:"InlineFragment",FRAGMENT_DEFINITION:"FragmentDefinition",VARIABLE:"Variable",INT:"IntValue",FLOAT:"FloatValue",STRING:"StringValue",BOOLEAN:"BooleanValue",NULL:"NullValue",ENUM:"EnumValue",LIST:"ListValue",OBJECT:"ObjectValue",OBJECT_FIELD:"ObjectField",DIRECTIVE:"Directive",NAMED_TYPE:"NamedType",LIST_TYPE:"ListType",NON_NULL_TYPE:"NonNullType",SCHEMA_DEFINITION:"SchemaDefinition",OPERATION_TYPE_DEFINITION:"OperationTypeDefinition",SCALAR_TYPE_DEFINITION:"ScalarTypeDefinition",OBJECT_TYPE_DEFINITION:"ObjectTypeDefinition",FIELD_DEFINITION:"FieldDefinition",INPUT_VALUE_DEFINITION:"InputValueDefinition",INTERFACE_TYPE_DEFINITION:"InterfaceTypeDefinition",UNION_TYPE_DEFINITION:"UnionTypeDefinition",ENUM_TYPE_DEFINITION:"EnumTypeDefinition",ENUM_VALUE_DEFINITION:"EnumValueDefinition",INPUT_OBJECT_TYPE_DEFINITION:"InputObjectTypeDefinition",DIRECTIVE_DEFINITION:"DirectiveDefinition",SCHEMA_EXTENSION:"SchemaExtension",SCALAR_TYPE_EXTENSION:"ScalarTypeExtension",OBJECT_TYPE_EXTENSION:"ObjectTypeExtension",INTERFACE_TYPE_EXTENSION:"InterfaceTypeExtension",UNION_TYPE_EXTENSION:"UnionTypeExtension",ENUM_TYPE_EXTENSION:"EnumTypeExtension",INPUT_OBJECT_TYPE_EXTENSION:"InputObjectTypeExtension"});function Oe(e,n){var t=!!e;if(!t)throw new Error(n??"Unexpected invariant triggered.")}var xi=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):void 0,Dn=xi;function H(e){var n=e.prototype.toJSON;typeof n=="function"||Oe(0),e.prototype.inspect=n,Dn&&(e.prototype[Dn]=n)}var Ci=function(){function e(t,i,a){this.start=t.start,this.end=i.end,this.startToken=t,this.endToken=i,this.source=a}var n=e.prototype;return n.toJSON=function(){return{start:this.start,end:this.end}},e}();H(Ci);var qi=function(){function e(t,i,a,r,u,o,s){this.kind=t,this.start=i,this.end=a,this.line=r,this.column=u,this.value=s,this.prev=o,this.next=null}var n=e.prototype;return n.toJSON=function(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}},e}();H(qi);function On(e){return e!=null&&typeof e.kind=="string"}function Ge(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Ge=function(t){return typeof t}:Ge=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ge(e)}var ji=10,pt=2;function F(e){return $e(e,[])}function $e(e,n){switch(Ge(e)){case"string":return JSON.stringify(e);case"function":return e.name?"[function ".concat(e.name,"]"):"[function]";case"object":return e===null?"null":Gi(e,n);default:return String(e)}}function Gi(e,n){if(n.indexOf(e)!==-1)return"[Circular]";var t=[].concat(n,[e]),i=Ji(e);if(i!==void 0){var a=i.call(e);if(a!==e)return typeof a=="string"?a:$e(a,t)}else if(Array.isArray(e))return Qi(e,t);return $i(e,t)}function $i(e,n){var t=Object.keys(e);if(t.length===0)return"{}";if(n.length>pt)return"["+Hi(e)+"]";var i=t.map(function(a){var r=$e(e[a],n);return a+": "+r});return"{ "+i.join(", ")+" }"}function Qi(e,n){if(e.length===0)return"[]";if(n.length>pt)return"[Array]";for(var t=Math.min(ji,e.length),i=e.length-t,a=[],r=0;r<t;++r)a.push($e(e[r],n));return i===1?a.push("... 1 more item"):i>1&&a.push("... ".concat(i," more items")),"["+a.join(", ")+"]"}function Ji(e){var n=e[String(Dn)];if(typeof n=="function")return n;if(typeof e.inspect=="function")return e.inspect}function Hi(e){var n=Object.prototype.toString.call(e).replace(/^\[object /,"").replace(/]$/,"");if(n==="Object"&&typeof e.constructor=="function"){var t=e.constructor.name;if(typeof t=="string"&&t!=="")return t}return n}function _(e,n){var t=!!e;if(!t)throw new Error(n)}function Qe(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Qe=function(t){return typeof t}:Qe=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Qe(e)}var ee=function(n,t){if(n instanceof t)return!0;if(Qe(n)==="object"&&n!==null){var i,a=t.prototype[Symbol.toStringTag],r=Symbol.toStringTag in n?n[Symbol.toStringTag]:(i=n.constructor)===null||i===void 0?void 0:i.name;if(a===r){var u=F(n);throw new Error("Cannot use ".concat(a,' "').concat(u,`" from another module or realm.
|
|
8
8
|
|
|
9
9
|
Ensure that there is only one instance of "graphql" in the node_modules
|
|
10
10
|
directory. If different versions of "graphql" are the dependencies of other
|
|
@@ -15,31 +15,31 @@ https://yarnpkg.com/en/docs/selective-version-resolutions
|
|
|
15
15
|
Duplicate "graphql" modules cannot be used at the same time since different
|
|
16
16
|
versions may have different capabilities and behavior. The data from one
|
|
17
17
|
version used in the function from another could produce confusing and
|
|
18
|
-
spurious results.`))}}return!1};function mt(e,n){for(var t=0;t<n.length;t++){var i=n[t];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function
|
|
19
|
-
`)===-1,
|
|
18
|
+
spurious results.`))}}return!1};function mt(e,n){for(var t=0;t<n.length;t++){var i=n[t];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function zi(e,n,t){return n&&mt(e.prototype,n),t&&mt(e,t),e}(function(){function e(n){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"GraphQL request",i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{line:1,column:1};typeof n=="string"||_(0,"Body must be a string. Received: ".concat(F(n),".")),this.body=n,this.name=t,this.locationOffset=i,this.locationOffset.line>0||_(0,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||_(0,"column in locationOffset is 1-indexed and must be positive.")}return zi(e,[{key:G,get:function(){return"Source"}}]),e})();var R=Object.freeze({QUERY:"QUERY",MUTATION:"MUTATION",SUBSCRIPTION:"SUBSCRIPTION",FIELD:"FIELD",FRAGMENT_DEFINITION:"FRAGMENT_DEFINITION",FRAGMENT_SPREAD:"FRAGMENT_SPREAD",INLINE_FRAGMENT:"INLINE_FRAGMENT",VARIABLE_DEFINITION:"VARIABLE_DEFINITION",SCHEMA:"SCHEMA",SCALAR:"SCALAR",OBJECT:"OBJECT",FIELD_DEFINITION:"FIELD_DEFINITION",ARGUMENT_DEFINITION:"ARGUMENT_DEFINITION",INTERFACE:"INTERFACE",UNION:"UNION",ENUM:"ENUM",ENUM_VALUE:"ENUM_VALUE",INPUT_OBJECT:"INPUT_OBJECT",INPUT_FIELD_DEFINITION:"INPUT_FIELD_DEFINITION"});function Yi(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,i=e.indexOf(`
|
|
19
|
+
`)===-1,a=e[0]===" "||e[0]===" ",r=e[e.length-1]==='"',u=e[e.length-1]==="\\",o=!i||r||u||t,s="";return o&&!(i&&a)&&(s+=`
|
|
20
20
|
`+n),s+=n?e.replace(/\n/g,`
|
|
21
21
|
`+n):e,o&&(s+=`
|
|
22
|
-
`),'"""'+s.replace(/"""/g,'\\"""')+'"""'}var
|
|
22
|
+
`),'"""'+s.replace(/"""/g,'\\"""')+'"""'}var Ki={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"]},Xi=Object.freeze({});function ht(e,n){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Ki,i=void 0,a=Array.isArray(e),r=[e],u=-1,o=[],s=void 0,l=void 0,g=void 0,E=[],y=[],d=e;do{u++;var N=u===r.length,w=N&&o.length!==0;if(N){if(l=y.length===0?void 0:E[E.length-1],s=g,g=y.pop(),w){if(a)s=s.slice();else{for(var O={},D=0,P=Object.keys(s);D<P.length;D++){var L=P[D];O[L]=s[L]}s=O}for(var f=0,c=0;c<o.length;c++){var S=o[c][0],v=o[c][1];a&&(S-=f),a&&v===null?(s.splice(S,1),f++):s[S]=v}}u=i.index,r=i.keys,o=i.edits,a=i.inArray,i=i.prev}else{if(l=g?a?u:r[u]:void 0,s=g?g[l]:d,s==null)continue;g&&E.push(l)}var b=void 0;if(!Array.isArray(s)){if(!On(s))throw new Error("Invalid AST Node: ".concat(F(s),"."));var A=_n(n,s.kind,N);if(A){if(b=A.call(n,s,l,g,E,y),b===Xi)break;if(b===!1){if(!N){E.pop();continue}}else if(b!==void 0&&(o.push([l,b]),!N))if(On(b))s=b;else{E.pop();continue}}}if(b===void 0&&w&&o.push([l,s]),N)E.pop();else{var m;i={inArray:a,index:u,keys:r,edits:o,prev:i},a=Array.isArray(s),r=a?s:(m=t[s.kind])!==null&&m!==void 0?m:[],u=-1,o=[],g&&y.push(g),g=s}}while(i!==void 0);return o.length!==0&&(d=o[o.length-1][1]),d}function _n(e,n,t){var i=e[n];if(i){if(!t&&typeof i=="function")return i;var a=t?i.leave:i.enter;if(typeof a=="function")return a}else{var r=t?e.leave:e.enter;if(r){if(typeof r=="function")return r;var u=r[n];if(typeof u=="function")return u}}}var Wi=Array.prototype.find?function(e,n){return Array.prototype.find.call(e,n)}:function(e,n){for(var t=0;t<e.length;t++){var i=e[t];if(n(i))return i}},yt=Wi,Zi=Object.values||function(e){return Object.keys(e).map(function(n){return e[n]})},se=Zi,ea=Object.entries||function(e){return Object.keys(e).map(function(n){return[n,e[n]]})},_e=ea;function gt(e,n){return e.reduce(function(t,i){return t[n(i)]=i,t},Object.create(null))}function Je(e,n){for(var t=Object.create(null),i=0,a=_e(e);i<a.length;i++){var r=a[i],u=r[0],o=r[1];t[u]=n(o,u)}return t}function j(e){if(Object.getPrototypeOf(e)===null)return e;for(var n=Object.create(null),t=0,i=_e(e);t<i.length;t++){var a=i[t],r=a[0],u=a[1];n[r]=u}return n}function Fn(e,n,t){return e.reduce(function(i,a){return i[n(a)]=t(a),i},Object.create(null))}var na=5;function ta(e,n){var t=typeof e=="string"?[e,n]:[void 0,e],i=t[0],a=t[1],r=" Did you mean ";i&&(r+=i+" ");var u=a.map(function(l){return'"'.concat(l,'"')});switch(u.length){case 0:return"";case 1:return r+u[0]+"?";case 2:return r+u[0]+" or "+u[1]+"?"}var o=u.slice(0,na),s=o.pop();return r+o.join(", ")+", or "+s+"?"}function kt(e){return e}function ia(e,n){for(var t=0,i=0;t<e.length&&i<n.length;){var a=e.charCodeAt(t),r=n.charCodeAt(i);if(He(a)&&He(r)){var u=0;do++t,u=u*10+a-Ln,a=e.charCodeAt(t);while(He(a)&&u>0);var o=0;do++i,o=o*10+r-Ln,r=n.charCodeAt(i);while(He(r)&&o>0);if(u<o)return-1;if(u>o)return 1}else{if(a<r)return-1;if(a>r)return 1;++t,++i}}return e.length-n.length}var Ln=48,aa=57;function He(e){return!isNaN(e)&&Ln<=e&&e<=aa}function ra(e,n){for(var t=Object.create(null),i=new oa(e),a=Math.floor(e.length*.4)+1,r=0;r<n.length;r++){var u=n[r],o=i.measure(u,a);o!==void 0&&(t[u]=o)}return Object.keys(t).sort(function(s,l){var g=t[s]-t[l];return g!==0?g:ia(s,l)})}var oa=function(){function e(t){this._input=t,this._inputLowerCase=t.toLowerCase(),this._inputArray=St(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)]}var n=e.prototype;return n.measure=function(i,a){if(this._input===i)return 0;var r=i.toLowerCase();if(this._inputLowerCase===r)return 1;var u=St(r),o=this._inputArray;if(u.length<o.length){var s=u;u=o,o=s}var l=u.length,g=o.length;if(!(l-g>a)){for(var E=this._rows,y=0;y<=g;y++)E[0][y]=y;for(var d=1;d<=l;d++){for(var N=E[(d-1)%3],w=E[d%3],O=w[0]=d,D=1;D<=g;D++){var P=u[d-1]===o[D-1]?0:1,L=Math.min(N[D]+1,w[D-1]+1,N[D-1]+P);if(d>1&&D>1&&u[d-1]===o[D-2]&&u[d-2]===o[D-1]){var f=E[(d-2)%3][D-2];L=Math.min(L,f+1)}L<O&&(O=L),w[D]=L}if(O>a)return}var c=E[l%3][g];return c<=a?c:void 0}},e}();function St(e){for(var n=e.length,t=new Array(n),i=0;i<n;++i)t[i]=e.charCodeAt(i);return t}function ne(e){return ht(e,{leave:ua})}var sa=80,ua={Name:function(n){return n.value},Variable:function(n){return"$"+n.name},Document:function(n){return k(n.definitions,`
|
|
23
23
|
|
|
24
24
|
`)+`
|
|
25
|
-
`},OperationDefinition:function(n){var t=n.operation,i=n.name,
|
|
26
|
-
`,ze(k(
|
|
25
|
+
`},OperationDefinition:function(n){var t=n.operation,i=n.name,a=B("(",k(n.variableDefinitions,", "),")"),r=k(n.directives," "),u=n.selectionSet;return!i&&!r&&!a&&t==="query"?u:k([t,k([i,a]),r,u]," ")},VariableDefinition:function(n){var t=n.variable,i=n.type,a=n.defaultValue,r=n.directives;return t+": "+i+B(" = ",a)+B(" ",k(r," "))},SelectionSet:function(n){var t=n.selections;return Y(t)},Field:function(n){var t=n.alias,i=n.name,a=n.arguments,r=n.directives,u=n.selectionSet,o=B("",t,": ")+i,s=o+B("(",k(a,", "),")");return s.length>sa&&(s=o+B(`(
|
|
26
|
+
`,ze(k(a,`
|
|
27
27
|
`)),`
|
|
28
|
-
)`)),k([s,k(
|
|
28
|
+
)`)),k([s,k(r," "),u]," ")},Argument:function(n){var t=n.name,i=n.value;return t+": "+i},FragmentSpread:function(n){var t=n.name,i=n.directives;return"..."+t+B(" ",k(i," "))},InlineFragment:function(n){var t=n.typeCondition,i=n.directives,a=n.selectionSet;return k(["...",B("on ",t),k(i," "),a]," ")},FragmentDefinition:function(n){var t=n.name,i=n.typeCondition,a=n.variableDefinitions,r=n.directives,u=n.selectionSet;return"fragment ".concat(t).concat(B("(",k(a,", "),")")," ")+"on ".concat(i," ").concat(B("",k(r," ")," "))+u},IntValue:function(n){var t=n.value;return t},FloatValue:function(n){var t=n.value;return t},StringValue:function(n,t){var i=n.value,a=n.block;return a?Yi(i,t==="description"?"":" "):JSON.stringify(i)},BooleanValue:function(n){var t=n.value;return t?"true":"false"},NullValue:function(){return"null"},EnumValue:function(n){var t=n.value;return t},ListValue:function(n){var t=n.values;return"["+k(t,", ")+"]"},ObjectValue:function(n){var t=n.fields;return"{"+k(t,", ")+"}"},ObjectField:function(n){var t=n.name,i=n.value;return t+": "+i},Directive:function(n){var t=n.name,i=n.arguments;return"@"+t+B("(",k(i,", "),")")},NamedType:function(n){var t=n.name;return t},ListType:function(n){var t=n.type;return"["+t+"]"},NonNullType:function(n){var t=n.type;return t+"!"},SchemaDefinition:z(function(e){var n=e.directives,t=e.operationTypes;return k(["schema",k(n," "),Y(t)]," ")}),OperationTypeDefinition:function(n){var t=n.operation,i=n.type;return t+": "+i},ScalarTypeDefinition:z(function(e){var n=e.name,t=e.directives;return k(["scalar",n,k(t," ")]," ")}),ObjectTypeDefinition:z(function(e){var n=e.name,t=e.interfaces,i=e.directives,a=e.fields;return k(["type",n,B("implements ",k(t," & ")),k(i," "),Y(a)]," ")}),FieldDefinition:z(function(e){var n=e.name,t=e.arguments,i=e.type,a=e.directives;return n+(Tt(t)?B(`(
|
|
29
29
|
`,ze(k(t,`
|
|
30
30
|
`)),`
|
|
31
|
-
)`):B("(",k(t,", "),")"))+": "+i+B(" ",k(
|
|
31
|
+
)`):B("(",k(t,", "),")"))+": "+i+B(" ",k(a," "))}),InputValueDefinition:z(function(e){var n=e.name,t=e.type,i=e.defaultValue,a=e.directives;return k([n+": "+t,B("= ",i),k(a," ")]," ")}),InterfaceTypeDefinition:z(function(e){var n=e.name,t=e.interfaces,i=e.directives,a=e.fields;return k(["interface",n,B("implements ",k(t," & ")),k(i," "),Y(a)]," ")}),UnionTypeDefinition:z(function(e){var n=e.name,t=e.directives,i=e.types;return k(["union",n,k(t," "),i&&i.length!==0?"= "+k(i," | "):""]," ")}),EnumTypeDefinition:z(function(e){var n=e.name,t=e.directives,i=e.values;return k(["enum",n,k(t," "),Y(i)]," ")}),EnumValueDefinition:z(function(e){var n=e.name,t=e.directives;return k([n,k(t," ")]," ")}),InputObjectTypeDefinition:z(function(e){var n=e.name,t=e.directives,i=e.fields;return k(["input",n,k(t," "),Y(i)]," ")}),DirectiveDefinition:z(function(e){var n=e.name,t=e.arguments,i=e.repeatable,a=e.locations;return"directive @"+n+(Tt(t)?B(`(
|
|
32
32
|
`,ze(k(t,`
|
|
33
33
|
`)),`
|
|
34
|
-
)`):B("(",k(t,", "),")"))+(i?" repeatable":"")+" on "+k(
|
|
34
|
+
)`):B("(",k(t,", "),")"))+(i?" repeatable":"")+" on "+k(a," | ")}),SchemaExtension:function(n){var t=n.directives,i=n.operationTypes;return k(["extend schema",k(t," "),Y(i)]," ")},ScalarTypeExtension:function(n){var t=n.name,i=n.directives;return k(["extend scalar",t,k(i," ")]," ")},ObjectTypeExtension:function(n){var t=n.name,i=n.interfaces,a=n.directives,r=n.fields;return k(["extend type",t,B("implements ",k(i," & ")),k(a," "),Y(r)]," ")},InterfaceTypeExtension:function(n){var t=n.name,i=n.interfaces,a=n.directives,r=n.fields;return k(["extend interface",t,B("implements ",k(i," & ")),k(a," "),Y(r)]," ")},UnionTypeExtension:function(n){var t=n.name,i=n.directives,a=n.types;return k(["extend union",t,k(i," "),a&&a.length!==0?"= "+k(a," | "):""]," ")},EnumTypeExtension:function(n){var t=n.name,i=n.directives,a=n.values;return k(["extend enum",t,k(i," "),Y(a)]," ")},InputObjectTypeExtension:function(n){var t=n.name,i=n.directives,a=n.fields;return k(["extend input",t,k(i," "),Y(a)]," ")}};function z(e){return function(n){return k([n.description,e(n)],`
|
|
35
35
|
`)}}function k(e){var n,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";return(n=e?.filter(function(i){return i}).join(t))!==null&&n!==void 0?n:""}function Y(e){return B(`{
|
|
36
36
|
`,ze(k(e,`
|
|
37
37
|
`)),`
|
|
38
38
|
}`)}function B(e,n){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"";return n!=null&&n!==""?e+n+t:""}function ze(e){return B(" ",e.replace(/\n/g,`
|
|
39
|
-
`))}function
|
|
40
|
-
`)!==-1}function Tt(e){return e!=null&&e.some(ur)}function Ln(e,n){switch(e.kind){case h.NULL:return null;case h.INT:return parseInt(e.value,10);case h.FLOAT:return parseFloat(e.value);case h.STRING:case h.ENUM:case h.BOOLEAN:return e.value;case h.LIST:return e.values.map(function(t){return Ln(t,n)});case h.OBJECT:return _n(e.fields,function(t){return t.name.value},function(t){return Ln(t.value,n)});case h.VARIABLE:return n?.[e.name.value]}Oe(0,"Unexpected value node: "+F(e))}function Nt(e,n){for(var t=0;t<n.length;t++){var i=n[t];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function fe(e,n,t){return n&&Nt(e.prototype,n),t&&Nt(e,t),e}function bt(e){return Fe(e)||W(e)||$(e)||te(e)||ie(e)||ue(e)||Le(e)||de(e)}function cr(e){if(!bt(e))throw new Error("Expected ".concat(F(e)," to be a GraphQL type."));return e}function Fe(e){return ee(e,ce)}function W(e){return ee(e,re)}function $(e){return ee(e,Dt)}function te(e){return ee(e,Ot)}function ie(e){return ee(e,Ke)}function ue(e){return ee(e,_t)}function Le(e){return ee(e,q)}function de(e){return ee(e,I)}function ve(e){return Fe(e)||ie(e)||ue(e)||Pn(e)&&ve(e.ofType)}function Ye(e){return Fe(e)||W(e)||$(e)||te(e)||ie(e)||Pn(e)&&Ye(e.ofType)}function lr(e){return Fe(e)||ie(e)}function Rn(e){return W(e)||$(e)||te(e)}function fr(e){return $(e)||te(e)}function q(e){if(this instanceof q)this.ofType=cr(e);else return new q(e)}q.prototype.toString=function(){return"["+String(this.ofType)+"]"},q.prototype.toJSON=function(){return this.toString()},Object.defineProperty(q.prototype,G,{get:function(){return"GraphQLList"}}),H(q);function I(e){if(this instanceof I)this.ofType=vr(e);else return new I(e)}I.prototype.toString=function(){return String(this.ofType)+"!"},I.prototype.toJSON=function(){return this.toString()},Object.defineProperty(I.prototype,G,{get:function(){return"GraphQLNonNull"}}),H(I);function Pn(e){return Le(e)||de(e)}function dr(e){return bt(e)&&!de(e)}function vr(e){if(!dr(e))throw new Error("Expected ".concat(F(e)," to be a GraphQL nullable type."));return e}function pr(e){if(e)return de(e)?e.ofType:e}function Re(e){if(e){for(var n=e;Pn(n);)n=n.ofType;return n}}function Xe(e){return typeof e=="function"?e():e}function pe(e){return e&&e.length>0?e:void 0}var ce=function(){function e(t){var i,r,a,u=(i=t.parseValue)!==null&&i!==void 0?i:kt;this.name=t.name,this.description=t.description,this.specifiedByUrl=t.specifiedByUrl,this.serialize=(r=t.serialize)!==null&&r!==void 0?r:kt,this.parseValue=u,this.parseLiteral=(a=t.parseLiteral)!==null&&a!==void 0?a:function(o,s){return u(Ln(o,s))},this.extensions=t.extensions&&j(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=pe(t.extensionASTNodes),typeof t.name=="string"||_(0,"Must provide name."),t.specifiedByUrl==null||typeof t.specifiedByUrl=="string"||_(0,"".concat(this.name,' must provide "specifiedByUrl" as a string, ')+"but got: ".concat(F(t.specifiedByUrl),".")),t.serialize==null||typeof t.serialize=="function"||_(0,"".concat(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"||_(0,"".concat(this.name,' must provide both "parseValue" and "parseLiteral" functions.')))}var n=e.prototype;return n.toConfig=function(){var i;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:(i=this.extensionASTNodes)!==null&&i!==void 0?i:[]}},n.toString=function(){return this.name},n.toJSON=function(){return this.toString()},fe(e,[{key:G,get:function(){return"GraphQLScalarType"}}]),e}();H(ce);var re=function(){function e(t){this.name=t.name,this.description=t.description,this.isTypeOf=t.isTypeOf,this.extensions=t.extensions&&j(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=pe(t.extensionASTNodes),this._fields=It.bind(void 0,t),this._interfaces=Et.bind(void 0,t),typeof t.name=="string"||_(0,"Must provide name."),t.isTypeOf==null||typeof t.isTypeOf=="function"||_(0,"".concat(this.name,' must provide "isTypeOf" as a function, ')+"but got: ".concat(F(t.isTypeOf),"."))}var n=e.prototype;return n.getFields=function(){return typeof this._fields=="function"&&(this._fields=this._fields()),this._fields},n.getInterfaces=function(){return typeof this._interfaces=="function"&&(this._interfaces=this._interfaces()),this._interfaces},n.toConfig=function(){return{name:this.name,description:this.description,interfaces:this.getInterfaces(),fields:wt(this.getFields()),isTypeOf:this.isTypeOf,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes||[]}},n.toString=function(){return this.name},n.toJSON=function(){return this.toString()},fe(e,[{key:G,get:function(){return"GraphQLObjectType"}}]),e}();H(re);function Et(e){var n,t=(n=Xe(e.interfaces))!==null&&n!==void 0?n:[];return Array.isArray(t)||_(0,"".concat(e.name," interfaces must be an Array or a function which returns an Array.")),t}function It(e){var n=Xe(e.fields);return me(n)||_(0,"".concat(e.name," fields must be an object with field names as keys or a function which returns such an object.")),Je(n,function(t,i){var r;me(t)||_(0,"".concat(e.name,".").concat(i," field config must be an object.")),!("isDeprecated"in t)||_(0,"".concat(e.name,".").concat(i,' should provide "deprecationReason" instead of "isDeprecated".')),t.resolve==null||typeof t.resolve=="function"||_(0,"".concat(e.name,".").concat(i," field resolver must be a function if ")+"provided, but got: ".concat(F(t.resolve),"."));var a=(r=t.args)!==null&&r!==void 0?r:{};me(a)||_(0,"".concat(e.name,".").concat(i," args must be an object with argument names as keys."));var u=_e(a).map(function(o){var s=o[0],l=o[1];return{name:s,description:l.description,type:l.type,defaultValue:l.defaultValue,deprecationReason:l.deprecationReason,extensions:l.extensions&&j(l.extensions),astNode:l.astNode}});return{name:i,description:t.description,type:t.type,args:u,resolve:t.resolve,subscribe:t.subscribe,isDeprecated:t.deprecationReason!=null,deprecationReason:t.deprecationReason,extensions:t.extensions&&j(t.extensions),astNode:t.astNode}})}function me(e){return oe(e)&&!Array.isArray(e)}function wt(e){return Je(e,function(n){return{description:n.description,type:n.type,args:At(n.args),resolve:n.resolve,subscribe:n.subscribe,deprecationReason:n.deprecationReason,extensions:n.extensions,astNode:n.astNode}})}function At(e){return _n(e,function(n){return n.name},function(n){return{description:n.description,type:n.type,defaultValue:n.defaultValue,deprecationReason:n.deprecationReason,extensions:n.extensions,astNode:n.astNode}})}var Dt=function(){function e(t){this.name=t.name,this.description=t.description,this.resolveType=t.resolveType,this.extensions=t.extensions&&j(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=pe(t.extensionASTNodes),this._fields=It.bind(void 0,t),this._interfaces=Et.bind(void 0,t),typeof t.name=="string"||_(0,"Must provide name."),t.resolveType==null||typeof t.resolveType=="function"||_(0,"".concat(this.name,' must provide "resolveType" as a function, ')+"but got: ".concat(F(t.resolveType),"."))}var n=e.prototype;return n.getFields=function(){return typeof this._fields=="function"&&(this._fields=this._fields()),this._fields},n.getInterfaces=function(){return typeof this._interfaces=="function"&&(this._interfaces=this._interfaces()),this._interfaces},n.toConfig=function(){var i;return{name:this.name,description:this.description,interfaces:this.getInterfaces(),fields:wt(this.getFields()),resolveType:this.resolveType,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:(i=this.extensionASTNodes)!==null&&i!==void 0?i:[]}},n.toString=function(){return this.name},n.toJSON=function(){return this.toString()},fe(e,[{key:G,get:function(){return"GraphQLInterfaceType"}}]),e}();H(Dt);var Ot=function(){function e(t){this.name=t.name,this.description=t.description,this.resolveType=t.resolveType,this.extensions=t.extensions&&j(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=pe(t.extensionASTNodes),this._types=mr.bind(void 0,t),typeof t.name=="string"||_(0,"Must provide name."),t.resolveType==null||typeof t.resolveType=="function"||_(0,"".concat(this.name,' must provide "resolveType" as a function, ')+"but got: ".concat(F(t.resolveType),"."))}var n=e.prototype;return n.getTypes=function(){return typeof this._types=="function"&&(this._types=this._types()),this._types},n.toConfig=function(){var i;return{name:this.name,description:this.description,types:this.getTypes(),resolveType:this.resolveType,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:(i=this.extensionASTNodes)!==null&&i!==void 0?i:[]}},n.toString=function(){return this.name},n.toJSON=function(){return this.toString()},fe(e,[{key:G,get:function(){return"GraphQLUnionType"}}]),e}();H(Ot);function mr(e){var n=Xe(e.types);return Array.isArray(n)||_(0,"Must provide Array of types or a function which returns such an array for Union ".concat(e.name,".")),n}var Ke=function(){function e(t){this.name=t.name,this.description=t.description,this.extensions=t.extensions&&j(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=pe(t.extensionASTNodes),this._values=hr(this.name,t.values),this._valueLookup=new Map(this._values.map(function(i){return[i.value,i]})),this._nameLookup=gt(this._values,function(i){return i.name}),typeof t.name=="string"||_(0,"Must provide name.")}var n=e.prototype;return n.getValues=function(){return this._values},n.getValue=function(i){return this._nameLookup[i]},n.serialize=function(i){var r=this._valueLookup.get(i);if(r===void 0)throw new U('Enum "'.concat(this.name,'" cannot represent value: ').concat(F(i)));return r.name},n.parseValue=function(i){if(typeof i!="string"){var r=F(i);throw new U('Enum "'.concat(this.name,'" cannot represent non-string value: ').concat(r,".")+We(this,r))}var a=this.getValue(i);if(a==null)throw new U('Value "'.concat(i,'" does not exist in "').concat(this.name,'" enum.')+We(this,i));return a.value},n.parseLiteral=function(i,r){if(i.kind!==h.ENUM){var a=ne(i);throw new U('Enum "'.concat(this.name,'" cannot represent non-enum value: ').concat(a,".")+We(this,a),i)}var u=this.getValue(i.value);if(u==null){var o=ne(i);throw new U('Value "'.concat(o,'" does not exist in "').concat(this.name,'" enum.')+We(this,o),i)}return u.value},n.toConfig=function(){var i,r=_n(this.getValues(),function(a){return a.name},function(a){return{description:a.description,value:a.value,deprecationReason:a.deprecationReason,extensions:a.extensions,astNode:a.astNode}});return{name:this.name,description:this.description,values:r,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:(i=this.extensionASTNodes)!==null&&i!==void 0?i:[]}},n.toString=function(){return this.name},n.toJSON=function(){return this.toString()},fe(e,[{key:G,get:function(){return"GraphQLEnumType"}}]),e}();H(Ke);function We(e,n){var t=e.getValues().map(function(r){return r.name}),i=rr(n,t);return nr("the enum value",i)}function hr(e,n){return me(n)||_(0,"".concat(e," values must be an object with value names as keys.")),_e(n).map(function(t){var i=t[0],r=t[1];return me(r)||_(0,"".concat(e,".").concat(i,' must refer to an object with a "value" key ')+"representing an internal value but got: ".concat(F(r),".")),!("isDeprecated"in r)||_(0,"".concat(e,".").concat(i,' should provide "deprecationReason" instead of "isDeprecated".')),{name:i,description:r.description,value:r.value!==void 0?r.value:i,isDeprecated:r.deprecationReason!=null,deprecationReason:r.deprecationReason,extensions:r.extensions&&j(r.extensions),astNode:r.astNode}})}var _t=function(){function e(t){this.name=t.name,this.description=t.description,this.extensions=t.extensions&&j(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=pe(t.extensionASTNodes),this._fields=yr.bind(void 0,t),typeof t.name=="string"||_(0,"Must provide name.")}var n=e.prototype;return n.getFields=function(){return typeof this._fields=="function"&&(this._fields=this._fields()),this._fields},n.toConfig=function(){var i,r=Je(this.getFields(),function(a){return{description:a.description,type:a.type,defaultValue:a.defaultValue,deprecationReason:a.deprecationReason,extensions:a.extensions,astNode:a.astNode}});return{name:this.name,description:this.description,fields:r,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:(i=this.extensionASTNodes)!==null&&i!==void 0?i:[]}},n.toString=function(){return this.name},n.toJSON=function(){return this.toString()},fe(e,[{key:G,get:function(){return"GraphQLInputObjectType"}}]),e}();H(_t);function yr(e){var n=Xe(e.fields);return me(n)||_(0,"".concat(e.name," fields must be an object with field names as keys or a function which returns such an object.")),Je(n,function(t,i){return!("resolve"in t)||_(0,"".concat(e.name,".").concat(i," field has a resolve property, but Input Types cannot define resolvers.")),{name:i,description:t.description,type:t.type,defaultValue:t.defaultValue,deprecationReason:t.deprecationReason,extensions:t.extensions&&j(t.extensions),astNode:t.astNode}})}var gr=Array.from||function(e,n,t){if(e==null)throw new TypeError("Array.from requires an array-like object - not null or undefined");var i=e[ot];if(typeof i=="function"){for(var r=i.call(e),a=[],u,o=0;!(u=r.next()).done;++o)if(a.push(n.call(t,u.value,o)),o>9999999)throw new TypeError("Near-infinite iteration.");return a}var s=e.length;if(typeof s=="number"&&s>=0&&s%1===0){for(var l=[],g=0;g<s;++g)Object.prototype.hasOwnProperty.call(e,g)&&l.push(n.call(t,e[g],g));return l}return[]},kr=gr,Sr=Number.isFinite||function(e){return typeof e=="number"&&isFinite(e)},Pe=Sr;function Ze(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Ze=function(t){return typeof t}:Ze=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ze(e)}function Tr(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:function(g){return g};if(e==null||Ze(e)!=="object")return null;if(Array.isArray(e))return e.map(n);var t=e[ot];if(typeof t=="function"){for(var i=t.call(e),r=[],a,u=0;!(a=i.next()).done;++u)r.push(n(a.value,u));return r}var o=e.length;if(typeof o=="number"&&o>=0&&o%1===0){for(var s=[],l=0;l<o;++l){if(!Object.prototype.hasOwnProperty.call(e,l))return null;s.push(n(e[String(l)],l))}return s}return null}var Nr=Number.isInteger||function(e){return typeof e=="number"&&isFinite(e)&&Math.floor(e)===e},en=Nr,Un=2147483647,Bn=-2147483648;function br(e){var n=Ue(e);if(typeof n=="boolean")return n?1:0;var t=n;if(typeof n=="string"&&n!==""&&(t=Number(n)),!en(t))throw new U("Int cannot represent non-integer value: ".concat(F(n)));if(t>Un||t<Bn)throw new U("Int cannot represent non 32-bit signed integer value: "+F(n));return t}function Er(e){if(!en(e))throw new U("Int cannot represent non-integer value: ".concat(F(e)));if(e>Un||e<Bn)throw new U("Int cannot represent non 32-bit signed integer value: ".concat(e));return e}var Ir=new ce({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:br,parseValue:Er,parseLiteral:function(n){if(n.kind!==h.INT)throw new U("Int cannot represent non-integer value: ".concat(ne(n)),n);var t=parseInt(n.value,10);if(t>Un||t<Bn)throw new U("Int cannot represent non 32-bit signed integer value: ".concat(n.value),n);return t}});function wr(e){var n=Ue(e);if(typeof n=="boolean")return n?1:0;var t=n;if(typeof n=="string"&&n!==""&&(t=Number(n)),!Pe(t))throw new U("Float cannot represent non numeric value: ".concat(F(n)));return t}function Ar(e){if(!Pe(e))throw new U("Float cannot represent non numeric value: ".concat(F(e)));return e}var Dr=new ce({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:wr,parseValue:Ar,parseLiteral:function(n){if(n.kind!==h.FLOAT&&n.kind!==h.INT)throw new U("Float cannot represent non numeric value: ".concat(ne(n)),n);return parseFloat(n.value)}});function Ue(e){if(oe(e)){if(typeof e.valueOf=="function"){var n=e.valueOf();if(!oe(n))return n}if(typeof e.toJSON=="function")return e.toJSON()}return e}function Or(e){var n=Ue(e);if(typeof n=="string")return n;if(typeof n=="boolean")return n?"true":"false";if(Pe(n))return n.toString();throw new U("String cannot represent value: ".concat(F(e)))}function _r(e){if(typeof e!="string")throw new U("String cannot represent a non string value: ".concat(F(e)));return e}var V=new ce({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:Or,parseValue:_r,parseLiteral:function(n){if(n.kind!==h.STRING)throw new U("String cannot represent a non string value: ".concat(ne(n)),n);return n.value}});function Fr(e){var n=Ue(e);if(typeof n=="boolean")return n;if(Pe(n))return n!==0;throw new U("Boolean cannot represent a non boolean value: ".concat(F(n)))}function Lr(e){if(typeof e!="boolean")throw new U("Boolean cannot represent a non boolean value: ".concat(F(e)));return e}var Q=new ce({name:"Boolean",description:"The `Boolean` scalar type represents `true` or `false`.",serialize:Fr,parseValue:Lr,parseLiteral:function(n){if(n.kind!==h.BOOLEAN)throw new U("Boolean cannot represent a non boolean value: ".concat(ne(n)),n);return n.value}});function Rr(e){var n=Ue(e);if(typeof n=="string")return n;if(en(n))return String(n);throw new U("ID cannot represent value: ".concat(F(e)))}function Pr(e){if(typeof e=="string")return e;if(en(e))return e.toString();throw new U("ID cannot represent value: ".concat(F(e)))}var Ft=new ce({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:Rr,parseValue:Pr,parseLiteral:function(n){if(n.kind!==h.STRING&&n.kind!==h.INT)throw new U("ID cannot represent a non-string and non-integer value: "+ne(n),n);return n.value}}),Lt=Object.freeze([V,Ir,Dr,Q,Ft]);function Be(e,n){if(de(n)){var t=Be(e,n.ofType);return t?.kind===h.NULL?null:t}if(e===null)return{kind:h.NULL};if(e===void 0)return null;if(Le(n)){var i=n.ofType,r=Tr(e);if(r!=null){for(var a=[],u=0;u<r.length;u++){var o=r[u],s=Be(o,i);s!=null&&a.push(s)}return{kind:h.LIST,values:a}}return Be(e,i)}if(ue(n)){if(!oe(e))return null;for(var l=[],g=0,E=se(n.getFields());g<E.length;g++){var y=E[g],d=Be(e[y.name],y.type);d&&l.push({kind:h.OBJECT_FIELD,name:{kind:h.NAME,value:y.name},value:d})}return{kind:h.OBJECT,fields:l}}if(lr(n)){var N=n.serialize(e);if(N==null)return null;if(typeof N=="boolean")return{kind:h.BOOLEAN,value:N};if(typeof N=="number"&&Pe(N)){var w=String(N);return Rt.test(w)?{kind:h.INT,value:w}:{kind:h.FLOAT,value:w}}if(typeof N=="string")return ie(n)?{kind:h.ENUM,value:N}:n===Ft&&Rt.test(N)?{kind:h.INT,value:N}:{kind:h.STRING,value:N};throw new TypeError("Cannot convert value to AST: ".concat(F(N),"."))}Oe(0,"Unexpected input type: "+F(n))}var Rt=/^-?(?:0|[1-9][0-9]*)$/,Vn=new re({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:function(){return{description:{type:V,resolve:function(t){return t.description}},types:{description:"A list of all types supported by this server.",type:new I(new q(new I(X))),resolve:function(t){return se(t.getTypeMap())}},queryType:{description:"The type that query operations will be rooted at.",type:new I(X),resolve:function(t){return t.getQueryType()}},mutationType:{description:"If this server supports mutation, the type that mutation operations will be rooted at.",type:X,resolve:function(t){return t.getMutationType()}},subscriptionType:{description:"If this server support subscription, the type that subscription operations will be rooted at.",type:X,resolve:function(t){return t.getSubscriptionType()}},directives:{description:"A list of all directives supported by this server.",type:new I(new q(new I(Pt))),resolve:function(t){return t.getDirectives()}}}}}),Pt=new re({name:"__Directive",description:`A Directive provides a way to describe alternate runtime execution and type validation behavior in a GraphQL document.
|
|
39
|
+
`))}function ca(e){return e.indexOf(`
|
|
40
|
+
`)!==-1}function Tt(e){return e!=null&&e.some(ca)}function Rn(e,n){switch(e.kind){case h.NULL:return null;case h.INT:return parseInt(e.value,10);case h.FLOAT:return parseFloat(e.value);case h.STRING:case h.ENUM:case h.BOOLEAN:return e.value;case h.LIST:return e.values.map(function(t){return Rn(t,n)});case h.OBJECT:return Fn(e.fields,function(t){return t.name.value},function(t){return Rn(t.value,n)});case h.VARIABLE:return n?.[e.name.value]}Oe(0,"Unexpected value node: "+F(e))}function Nt(e,n){for(var t=0;t<n.length;t++){var i=n[t];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function fe(e,n,t){return n&&Nt(e.prototype,n),t&&Nt(e,t),e}function bt(e){return Fe(e)||W(e)||$(e)||te(e)||ie(e)||ue(e)||Le(e)||de(e)}function la(e){if(!bt(e))throw new Error("Expected ".concat(F(e)," to be a GraphQL type."));return e}function Fe(e){return ee(e,ce)}function W(e){return ee(e,ae)}function $(e){return ee(e,Dt)}function te(e){return ee(e,Ot)}function ie(e){return ee(e,Xe)}function ue(e){return ee(e,_t)}function Le(e){return ee(e,C)}function de(e){return ee(e,I)}function ve(e){return Fe(e)||ie(e)||ue(e)||Un(e)&&ve(e.ofType)}function Ye(e){return Fe(e)||W(e)||$(e)||te(e)||ie(e)||Un(e)&&Ye(e.ofType)}function fa(e){return Fe(e)||ie(e)}function Pn(e){return W(e)||$(e)||te(e)}function da(e){return $(e)||te(e)}function C(e){if(this instanceof C)this.ofType=la(e);else return new C(e)}C.prototype.toString=function(){return"["+String(this.ofType)+"]"},C.prototype.toJSON=function(){return this.toString()},Object.defineProperty(C.prototype,G,{get:function(){return"GraphQLList"}}),H(C);function I(e){if(this instanceof I)this.ofType=pa(e);else return new I(e)}I.prototype.toString=function(){return String(this.ofType)+"!"},I.prototype.toJSON=function(){return this.toString()},Object.defineProperty(I.prototype,G,{get:function(){return"GraphQLNonNull"}}),H(I);function Un(e){return Le(e)||de(e)}function va(e){return bt(e)&&!de(e)}function pa(e){if(!va(e))throw new Error("Expected ".concat(F(e)," to be a GraphQL nullable type."));return e}function ma(e){if(e)return de(e)?e.ofType:e}function Re(e){if(e){for(var n=e;Un(n);)n=n.ofType;return n}}function Ke(e){return typeof e=="function"?e():e}function pe(e){return e&&e.length>0?e:void 0}var ce=function(){function e(t){var i,a,r,u=(i=t.parseValue)!==null&&i!==void 0?i:kt;this.name=t.name,this.description=t.description,this.specifiedByUrl=t.specifiedByUrl,this.serialize=(a=t.serialize)!==null&&a!==void 0?a:kt,this.parseValue=u,this.parseLiteral=(r=t.parseLiteral)!==null&&r!==void 0?r:function(o,s){return u(Rn(o,s))},this.extensions=t.extensions&&j(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=pe(t.extensionASTNodes),typeof t.name=="string"||_(0,"Must provide name."),t.specifiedByUrl==null||typeof t.specifiedByUrl=="string"||_(0,"".concat(this.name,' must provide "specifiedByUrl" as a string, ')+"but got: ".concat(F(t.specifiedByUrl),".")),t.serialize==null||typeof t.serialize=="function"||_(0,"".concat(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"||_(0,"".concat(this.name,' must provide both "parseValue" and "parseLiteral" functions.')))}var n=e.prototype;return n.toConfig=function(){var i;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:(i=this.extensionASTNodes)!==null&&i!==void 0?i:[]}},n.toString=function(){return this.name},n.toJSON=function(){return this.toString()},fe(e,[{key:G,get:function(){return"GraphQLScalarType"}}]),e}();H(ce);var ae=function(){function e(t){this.name=t.name,this.description=t.description,this.isTypeOf=t.isTypeOf,this.extensions=t.extensions&&j(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=pe(t.extensionASTNodes),this._fields=It.bind(void 0,t),this._interfaces=Et.bind(void 0,t),typeof t.name=="string"||_(0,"Must provide name."),t.isTypeOf==null||typeof t.isTypeOf=="function"||_(0,"".concat(this.name,' must provide "isTypeOf" as a function, ')+"but got: ".concat(F(t.isTypeOf),"."))}var n=e.prototype;return n.getFields=function(){return typeof this._fields=="function"&&(this._fields=this._fields()),this._fields},n.getInterfaces=function(){return typeof this._interfaces=="function"&&(this._interfaces=this._interfaces()),this._interfaces},n.toConfig=function(){return{name:this.name,description:this.description,interfaces:this.getInterfaces(),fields:wt(this.getFields()),isTypeOf:this.isTypeOf,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes||[]}},n.toString=function(){return this.name},n.toJSON=function(){return this.toString()},fe(e,[{key:G,get:function(){return"GraphQLObjectType"}}]),e}();H(ae);function Et(e){var n,t=(n=Ke(e.interfaces))!==null&&n!==void 0?n:[];return Array.isArray(t)||_(0,"".concat(e.name," interfaces must be an Array or a function which returns an Array.")),t}function It(e){var n=Ke(e.fields);return me(n)||_(0,"".concat(e.name," fields must be an object with field names as keys or a function which returns such an object.")),Je(n,function(t,i){var a;me(t)||_(0,"".concat(e.name,".").concat(i," field config must be an object.")),!("isDeprecated"in t)||_(0,"".concat(e.name,".").concat(i,' should provide "deprecationReason" instead of "isDeprecated".')),t.resolve==null||typeof t.resolve=="function"||_(0,"".concat(e.name,".").concat(i," field resolver must be a function if ")+"provided, but got: ".concat(F(t.resolve),"."));var r=(a=t.args)!==null&&a!==void 0?a:{};me(r)||_(0,"".concat(e.name,".").concat(i," args must be an object with argument names as keys."));var u=_e(r).map(function(o){var s=o[0],l=o[1];return{name:s,description:l.description,type:l.type,defaultValue:l.defaultValue,deprecationReason:l.deprecationReason,extensions:l.extensions&&j(l.extensions),astNode:l.astNode}});return{name:i,description:t.description,type:t.type,args:u,resolve:t.resolve,subscribe:t.subscribe,isDeprecated:t.deprecationReason!=null,deprecationReason:t.deprecationReason,extensions:t.extensions&&j(t.extensions),astNode:t.astNode}})}function me(e){return oe(e)&&!Array.isArray(e)}function wt(e){return Je(e,function(n){return{description:n.description,type:n.type,args:At(n.args),resolve:n.resolve,subscribe:n.subscribe,deprecationReason:n.deprecationReason,extensions:n.extensions,astNode:n.astNode}})}function At(e){return Fn(e,function(n){return n.name},function(n){return{description:n.description,type:n.type,defaultValue:n.defaultValue,deprecationReason:n.deprecationReason,extensions:n.extensions,astNode:n.astNode}})}var Dt=function(){function e(t){this.name=t.name,this.description=t.description,this.resolveType=t.resolveType,this.extensions=t.extensions&&j(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=pe(t.extensionASTNodes),this._fields=It.bind(void 0,t),this._interfaces=Et.bind(void 0,t),typeof t.name=="string"||_(0,"Must provide name."),t.resolveType==null||typeof t.resolveType=="function"||_(0,"".concat(this.name,' must provide "resolveType" as a function, ')+"but got: ".concat(F(t.resolveType),"."))}var n=e.prototype;return n.getFields=function(){return typeof this._fields=="function"&&(this._fields=this._fields()),this._fields},n.getInterfaces=function(){return typeof this._interfaces=="function"&&(this._interfaces=this._interfaces()),this._interfaces},n.toConfig=function(){var i;return{name:this.name,description:this.description,interfaces:this.getInterfaces(),fields:wt(this.getFields()),resolveType:this.resolveType,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:(i=this.extensionASTNodes)!==null&&i!==void 0?i:[]}},n.toString=function(){return this.name},n.toJSON=function(){return this.toString()},fe(e,[{key:G,get:function(){return"GraphQLInterfaceType"}}]),e}();H(Dt);var Ot=function(){function e(t){this.name=t.name,this.description=t.description,this.resolveType=t.resolveType,this.extensions=t.extensions&&j(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=pe(t.extensionASTNodes),this._types=ha.bind(void 0,t),typeof t.name=="string"||_(0,"Must provide name."),t.resolveType==null||typeof t.resolveType=="function"||_(0,"".concat(this.name,' must provide "resolveType" as a function, ')+"but got: ".concat(F(t.resolveType),"."))}var n=e.prototype;return n.getTypes=function(){return typeof this._types=="function"&&(this._types=this._types()),this._types},n.toConfig=function(){var i;return{name:this.name,description:this.description,types:this.getTypes(),resolveType:this.resolveType,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:(i=this.extensionASTNodes)!==null&&i!==void 0?i:[]}},n.toString=function(){return this.name},n.toJSON=function(){return this.toString()},fe(e,[{key:G,get:function(){return"GraphQLUnionType"}}]),e}();H(Ot);function ha(e){var n=Ke(e.types);return Array.isArray(n)||_(0,"Must provide Array of types or a function which returns such an array for Union ".concat(e.name,".")),n}var Xe=function(){function e(t){this.name=t.name,this.description=t.description,this.extensions=t.extensions&&j(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=pe(t.extensionASTNodes),this._values=ya(this.name,t.values),this._valueLookup=new Map(this._values.map(function(i){return[i.value,i]})),this._nameLookup=gt(this._values,function(i){return i.name}),typeof t.name=="string"||_(0,"Must provide name.")}var n=e.prototype;return n.getValues=function(){return this._values},n.getValue=function(i){return this._nameLookup[i]},n.serialize=function(i){var a=this._valueLookup.get(i);if(a===void 0)throw new U('Enum "'.concat(this.name,'" cannot represent value: ').concat(F(i)));return a.name},n.parseValue=function(i){if(typeof i!="string"){var a=F(i);throw new U('Enum "'.concat(this.name,'" cannot represent non-string value: ').concat(a,".")+We(this,a))}var r=this.getValue(i);if(r==null)throw new U('Value "'.concat(i,'" does not exist in "').concat(this.name,'" enum.')+We(this,i));return r.value},n.parseLiteral=function(i,a){if(i.kind!==h.ENUM){var r=ne(i);throw new U('Enum "'.concat(this.name,'" cannot represent non-enum value: ').concat(r,".")+We(this,r),i)}var u=this.getValue(i.value);if(u==null){var o=ne(i);throw new U('Value "'.concat(o,'" does not exist in "').concat(this.name,'" enum.')+We(this,o),i)}return u.value},n.toConfig=function(){var i,a=Fn(this.getValues(),function(r){return r.name},function(r){return{description:r.description,value:r.value,deprecationReason:r.deprecationReason,extensions:r.extensions,astNode:r.astNode}});return{name:this.name,description:this.description,values:a,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:(i=this.extensionASTNodes)!==null&&i!==void 0?i:[]}},n.toString=function(){return this.name},n.toJSON=function(){return this.toString()},fe(e,[{key:G,get:function(){return"GraphQLEnumType"}}]),e}();H(Xe);function We(e,n){var t=e.getValues().map(function(a){return a.name}),i=ra(n,t);return ta("the enum value",i)}function ya(e,n){return me(n)||_(0,"".concat(e," values must be an object with value names as keys.")),_e(n).map(function(t){var i=t[0],a=t[1];return me(a)||_(0,"".concat(e,".").concat(i,' must refer to an object with a "value" key ')+"representing an internal value but got: ".concat(F(a),".")),!("isDeprecated"in a)||_(0,"".concat(e,".").concat(i,' should provide "deprecationReason" instead of "isDeprecated".')),{name:i,description:a.description,value:a.value!==void 0?a.value:i,isDeprecated:a.deprecationReason!=null,deprecationReason:a.deprecationReason,extensions:a.extensions&&j(a.extensions),astNode:a.astNode}})}var _t=function(){function e(t){this.name=t.name,this.description=t.description,this.extensions=t.extensions&&j(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=pe(t.extensionASTNodes),this._fields=ga.bind(void 0,t),typeof t.name=="string"||_(0,"Must provide name.")}var n=e.prototype;return n.getFields=function(){return typeof this._fields=="function"&&(this._fields=this._fields()),this._fields},n.toConfig=function(){var i,a=Je(this.getFields(),function(r){return{description:r.description,type:r.type,defaultValue:r.defaultValue,deprecationReason:r.deprecationReason,extensions:r.extensions,astNode:r.astNode}});return{name:this.name,description:this.description,fields:a,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:(i=this.extensionASTNodes)!==null&&i!==void 0?i:[]}},n.toString=function(){return this.name},n.toJSON=function(){return this.toString()},fe(e,[{key:G,get:function(){return"GraphQLInputObjectType"}}]),e}();H(_t);function ga(e){var n=Ke(e.fields);return me(n)||_(0,"".concat(e.name," fields must be an object with field names as keys or a function which returns such an object.")),Je(n,function(t,i){return!("resolve"in t)||_(0,"".concat(e.name,".").concat(i," field has a resolve property, but Input Types cannot define resolvers.")),{name:i,description:t.description,type:t.type,defaultValue:t.defaultValue,deprecationReason:t.deprecationReason,extensions:t.extensions&&j(t.extensions),astNode:t.astNode}})}var ka=Array.from||function(e,n,t){if(e==null)throw new TypeError("Array.from requires an array-like object - not null or undefined");var i=e[ot];if(typeof i=="function"){for(var a=i.call(e),r=[],u,o=0;!(u=a.next()).done;++o)if(r.push(n.call(t,u.value,o)),o>9999999)throw new TypeError("Near-infinite iteration.");return r}var s=e.length;if(typeof s=="number"&&s>=0&&s%1===0){for(var l=[],g=0;g<s;++g)Object.prototype.hasOwnProperty.call(e,g)&&l.push(n.call(t,e[g],g));return l}return[]},Sa=ka,Ta=Number.isFinite||function(e){return typeof e=="number"&&isFinite(e)},Pe=Ta;function Ze(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Ze=function(t){return typeof t}:Ze=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ze(e)}function Na(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:function(g){return g};if(e==null||Ze(e)!=="object")return null;if(Array.isArray(e))return e.map(n);var t=e[ot];if(typeof t=="function"){for(var i=t.call(e),a=[],r,u=0;!(r=i.next()).done;++u)a.push(n(r.value,u));return a}var o=e.length;if(typeof o=="number"&&o>=0&&o%1===0){for(var s=[],l=0;l<o;++l){if(!Object.prototype.hasOwnProperty.call(e,l))return null;s.push(n(e[String(l)],l))}return s}return null}var ba=Number.isInteger||function(e){return typeof e=="number"&&isFinite(e)&&Math.floor(e)===e},en=ba,Bn=2147483647,Vn=-2147483648;function Ea(e){var n=Ue(e);if(typeof n=="boolean")return n?1:0;var t=n;if(typeof n=="string"&&n!==""&&(t=Number(n)),!en(t))throw new U("Int cannot represent non-integer value: ".concat(F(n)));if(t>Bn||t<Vn)throw new U("Int cannot represent non 32-bit signed integer value: "+F(n));return t}function Ia(e){if(!en(e))throw new U("Int cannot represent non-integer value: ".concat(F(e)));if(e>Bn||e<Vn)throw new U("Int cannot represent non 32-bit signed integer value: ".concat(e));return e}var wa=new ce({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:Ea,parseValue:Ia,parseLiteral:function(n){if(n.kind!==h.INT)throw new U("Int cannot represent non-integer value: ".concat(ne(n)),n);var t=parseInt(n.value,10);if(t>Bn||t<Vn)throw new U("Int cannot represent non 32-bit signed integer value: ".concat(n.value),n);return t}});function Aa(e){var n=Ue(e);if(typeof n=="boolean")return n?1:0;var t=n;if(typeof n=="string"&&n!==""&&(t=Number(n)),!Pe(t))throw new U("Float cannot represent non numeric value: ".concat(F(n)));return t}function Da(e){if(!Pe(e))throw new U("Float cannot represent non numeric value: ".concat(F(e)));return e}var Oa=new ce({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:Aa,parseValue:Da,parseLiteral:function(n){if(n.kind!==h.FLOAT&&n.kind!==h.INT)throw new U("Float cannot represent non numeric value: ".concat(ne(n)),n);return parseFloat(n.value)}});function Ue(e){if(oe(e)){if(typeof e.valueOf=="function"){var n=e.valueOf();if(!oe(n))return n}if(typeof e.toJSON=="function")return e.toJSON()}return e}function _a(e){var n=Ue(e);if(typeof n=="string")return n;if(typeof n=="boolean")return n?"true":"false";if(Pe(n))return n.toString();throw new U("String cannot represent value: ".concat(F(e)))}function Fa(e){if(typeof e!="string")throw new U("String cannot represent a non string value: ".concat(F(e)));return e}var V=new ce({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:_a,parseValue:Fa,parseLiteral:function(n){if(n.kind!==h.STRING)throw new U("String cannot represent a non string value: ".concat(ne(n)),n);return n.value}});function La(e){var n=Ue(e);if(typeof n=="boolean")return n;if(Pe(n))return n!==0;throw new U("Boolean cannot represent a non boolean value: ".concat(F(n)))}function Ra(e){if(typeof e!="boolean")throw new U("Boolean cannot represent a non boolean value: ".concat(F(e)));return e}var Q=new ce({name:"Boolean",description:"The `Boolean` scalar type represents `true` or `false`.",serialize:La,parseValue:Ra,parseLiteral:function(n){if(n.kind!==h.BOOLEAN)throw new U("Boolean cannot represent a non boolean value: ".concat(ne(n)),n);return n.value}});function Pa(e){var n=Ue(e);if(typeof n=="string")return n;if(en(n))return String(n);throw new U("ID cannot represent value: ".concat(F(e)))}function Ua(e){if(typeof e=="string")return e;if(en(e))return e.toString();throw new U("ID cannot represent value: ".concat(F(e)))}var Ft=new ce({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:Pa,parseValue:Ua,parseLiteral:function(n){if(n.kind!==h.STRING&&n.kind!==h.INT)throw new U("ID cannot represent a non-string and non-integer value: "+ne(n),n);return n.value}}),Lt=Object.freeze([V,wa,Oa,Q,Ft]);function Be(e,n){if(de(n)){var t=Be(e,n.ofType);return t?.kind===h.NULL?null:t}if(e===null)return{kind:h.NULL};if(e===void 0)return null;if(Le(n)){var i=n.ofType,a=Na(e);if(a!=null){for(var r=[],u=0;u<a.length;u++){var o=a[u],s=Be(o,i);s!=null&&r.push(s)}return{kind:h.LIST,values:r}}return Be(e,i)}if(ue(n)){if(!oe(e))return null;for(var l=[],g=0,E=se(n.getFields());g<E.length;g++){var y=E[g],d=Be(e[y.name],y.type);d&&l.push({kind:h.OBJECT_FIELD,name:{kind:h.NAME,value:y.name},value:d})}return{kind:h.OBJECT,fields:l}}if(fa(n)){var N=n.serialize(e);if(N==null)return null;if(typeof N=="boolean")return{kind:h.BOOLEAN,value:N};if(typeof N=="number"&&Pe(N)){var w=String(N);return Rt.test(w)?{kind:h.INT,value:w}:{kind:h.FLOAT,value:w}}if(typeof N=="string")return ie(n)?{kind:h.ENUM,value:N}:n===Ft&&Rt.test(N)?{kind:h.INT,value:N}:{kind:h.STRING,value:N};throw new TypeError("Cannot convert value to AST: ".concat(F(N),"."))}Oe(0,"Unexpected input type: "+F(n))}var Rt=/^-?(?:0|[1-9][0-9]*)$/,Mn=new ae({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:function(){return{description:{type:V,resolve:function(t){return t.description}},types:{description:"A list of all types supported by this server.",type:new I(new C(new I(K))),resolve:function(t){return se(t.getTypeMap())}},queryType:{description:"The type that query operations will be rooted at.",type:new I(K),resolve:function(t){return t.getQueryType()}},mutationType:{description:"If this server supports mutation, the type that mutation operations will be rooted at.",type:K,resolve:function(t){return t.getMutationType()}},subscriptionType:{description:"If this server support subscription, the type that subscription operations will be rooted at.",type:K,resolve:function(t){return t.getSubscriptionType()}},directives:{description:"A list of all directives supported by this server.",type:new I(new C(new I(Pt))),resolve:function(t){return t.getDirectives()}}}}}),Pt=new ae({name:"__Directive",description:`A Directive provides a way to describe alternate runtime execution and type validation behavior in a GraphQL document.
|
|
41
41
|
|
|
42
|
-
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:function(){return{name:{type:new I(V),resolve:function(t){return t.name}},description:{type:V,resolve:function(t){return t.description}},isRepeatable:{type:new I(Q),resolve:function(t){return t.isRepeatable}},locations:{type:new I(new q(new I(Ut))),resolve:function(t){return t.locations}},args:{type:new I(new q(new I(nn))),args:{includeDeprecated:{type:Q,defaultValue:!1}},resolve:function(t,i){var r=i.includeDeprecated;return r?t.args:t.args.filter(function(a){return a.deprecationReason==null})}}}}}),Ut=new Ke({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:R.QUERY,description:"Location adjacent to a query operation."},MUTATION:{value:R.MUTATION,description:"Location adjacent to a mutation operation."},SUBSCRIPTION:{value:R.SUBSCRIPTION,description:"Location adjacent to a subscription operation."},FIELD:{value:R.FIELD,description:"Location adjacent to a field."},FRAGMENT_DEFINITION:{value:R.FRAGMENT_DEFINITION,description:"Location adjacent to a fragment definition."},FRAGMENT_SPREAD:{value:R.FRAGMENT_SPREAD,description:"Location adjacent to a fragment spread."},INLINE_FRAGMENT:{value:R.INLINE_FRAGMENT,description:"Location adjacent to an inline fragment."},VARIABLE_DEFINITION:{value:R.VARIABLE_DEFINITION,description:"Location adjacent to a variable definition."},SCHEMA:{value:R.SCHEMA,description:"Location adjacent to a schema definition."},SCALAR:{value:R.SCALAR,description:"Location adjacent to a scalar definition."},OBJECT:{value:R.OBJECT,description:"Location adjacent to an object type definition."},FIELD_DEFINITION:{value:R.FIELD_DEFINITION,description:"Location adjacent to a field definition."},ARGUMENT_DEFINITION:{value:R.ARGUMENT_DEFINITION,description:"Location adjacent to an argument definition."},INTERFACE:{value:R.INTERFACE,description:"Location adjacent to an interface definition."},UNION:{value:R.UNION,description:"Location adjacent to a union definition."},ENUM:{value:R.ENUM,description:"Location adjacent to an enum definition."},ENUM_VALUE:{value:R.ENUM_VALUE,description:"Location adjacent to an enum value definition."},INPUT_OBJECT:{value:R.INPUT_OBJECT,description:"Location adjacent to an input object type definition."},INPUT_FIELD_DEFINITION:{value:R.INPUT_FIELD_DEFINITION,description:"Location adjacent to an input object field definition."}}}),X=new re({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:function(){return{kind:{type:new I(Mt),resolve:function(t){if(Fe(t))return C.SCALAR;if(W(t))return C.OBJECT;if($(t))return C.INTERFACE;if(te(t))return C.UNION;if(ie(t))return C.ENUM;if(ue(t))return C.INPUT_OBJECT;if(Le(t))return C.LIST;if(de(t))return C.NON_NULL;Oe(0,'Unexpected type: "'.concat(F(t),'".'))}},name:{type:V,resolve:function(t){return t.name!==void 0?t.name:void 0}},description:{type:V,resolve:function(t){return t.description!==void 0?t.description:void 0}},specifiedByUrl:{type:V,resolve:function(t){return t.specifiedByUrl!==void 0?t.specifiedByUrl:void 0}},fields:{type:new q(new I(Bt)),args:{includeDeprecated:{type:Q,defaultValue:!1}},resolve:function(t,i){var r=i.includeDeprecated;if(W(t)||$(t)){var a=se(t.getFields());return r?a:a.filter(function(u){return u.deprecationReason==null})}}},interfaces:{type:new q(new I(X)),resolve:function(t){if(W(t)||$(t))return t.getInterfaces()}},possibleTypes:{type:new q(new I(X)),resolve:function(t,i,r,a){var u=a.schema;if(fr(t))return u.getPossibleTypes(t)}},enumValues:{type:new q(new I(Vt)),args:{includeDeprecated:{type:Q,defaultValue:!1}},resolve:function(t,i){var r=i.includeDeprecated;if(ie(t)){var a=t.getValues();return r?a:a.filter(function(u){return u.deprecationReason==null})}}},inputFields:{type:new q(new I(nn)),args:{includeDeprecated:{type:Q,defaultValue:!1}},resolve:function(t,i){var r=i.includeDeprecated;if(ue(t)){var a=se(t.getFields());return r?a:a.filter(function(u){return u.deprecationReason==null})}}},ofType:{type:X,resolve:function(t){return t.ofType!==void 0?t.ofType:void 0}}}}}),Bt=new re({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:function(){return{name:{type:new I(V),resolve:function(t){return t.name}},description:{type:V,resolve:function(t){return t.description}},args:{type:new I(new q(new I(nn))),args:{includeDeprecated:{type:Q,defaultValue:!1}},resolve:function(t,i){var r=i.includeDeprecated;return r?t.args:t.args.filter(function(a){return a.deprecationReason==null})}},type:{type:new I(X),resolve:function(t){return t.type}},isDeprecated:{type:new I(Q),resolve:function(t){return t.deprecationReason!=null}},deprecationReason:{type:V,resolve:function(t){return t.deprecationReason}}}}}),nn=new re({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:function(){return{name:{type:new I(V),resolve:function(t){return t.name}},description:{type:V,resolve:function(t){return t.description}},type:{type:new I(X),resolve:function(t){return t.type}},defaultValue:{type:V,description:"A GraphQL-formatted string representing the default value for this input value.",resolve:function(t){var i=t.type,r=t.defaultValue,a=Be(r,i);return a?ne(a):null}},isDeprecated:{type:new I(Q),resolve:function(t){return t.deprecationReason!=null}},deprecationReason:{type:V,resolve:function(t){return t.deprecationReason}}}}}),Vt=new re({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:function(){return{name:{type:new I(V),resolve:function(t){return t.name}},description:{type:V,resolve:function(t){return t.description}},isDeprecated:{type:new I(Q),resolve:function(t){return t.deprecationReason!=null}},deprecationReason:{type:V,resolve:function(t){return t.deprecationReason}}}}}),C=Object.freeze({SCALAR:"SCALAR",OBJECT:"OBJECT",INTERFACE:"INTERFACE",UNION:"UNION",ENUM:"ENUM",INPUT_OBJECT:"INPUT_OBJECT",LIST:"LIST",NON_NULL:"NON_NULL"}),Mt=new Ke({name:"__TypeKind",description:"An enum describing what kind of type a given `__Type` is.",values:{SCALAR:{value:C.SCALAR,description:"Indicates this type is a scalar."},OBJECT:{value:C.OBJECT,description:"Indicates this type is an object. `fields` and `interfaces` are valid fields."},INTERFACE:{value:C.INTERFACE,description:"Indicates this type is an interface. `fields`, `interfaces`, and `possibleTypes` are valid fields."},UNION:{value:C.UNION,description:"Indicates this type is a union. `possibleTypes` is a valid field."},ENUM:{value:C.ENUM,description:"Indicates this type is an enum. `enumValues` is a valid field."},INPUT_OBJECT:{value:C.INPUT_OBJECT,description:"Indicates this type is an input object. `inputFields` is a valid field."},LIST:{value:C.LIST,description:"Indicates this type is a list. `ofType` is a valid field."},NON_NULL:{value:C.NON_NULL,description:"Indicates this type is a non-null. `ofType` is a valid field."}}}),xt={name:"__schema",type:new I(Vn),description:"Access the current type schema of this server.",args:[],resolve:function(n,t,i,r){var a=r.schema;return a},isDeprecated:!1,deprecationReason:void 0,extensions:void 0,astNode:void 0},qt={name:"__type",type:X,description:"Request the type information of a single type.",args:[{name:"name",description:void 0,type:new I(V),defaultValue:void 0,deprecationReason:void 0,extensions:void 0,astNode:void 0}],resolve:function(n,t,i,r){var a=t.name,u=r.schema;return u.getType(a)},isDeprecated:!1,deprecationReason:void 0,extensions:void 0,astNode:void 0},Ct={name:"__typename",type:new I(V),description:"The name of the current Object type at runtime.",args:[],resolve:function(n,t,i,r){var a=r.parentType;return a.name},isDeprecated:!1,deprecationReason:void 0,extensions:void 0,astNode:void 0},jt=Object.freeze([Vn,Pt,Ut,X,Bt,nn,Vt,Mt]);function Gt(e,n){for(var t=0;t<n.length;t++){var i=n[t];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function Ur(e,n,t){return n&&Gt(e.prototype,n),t&&Gt(e,t),e}function Br(e){return ee(e,he)}var he=function(){function e(t){var i,r;this.name=t.name,this.description=t.description,this.locations=t.locations,this.isRepeatable=(i=t.isRepeatable)!==null&&i!==void 0?i:!1,this.extensions=t.extensions&&j(t.extensions),this.astNode=t.astNode,t.name||_(0,"Directive must be named."),Array.isArray(t.locations)||_(0,"@".concat(t.name," locations must be an Array."));var a=(r=t.args)!==null&&r!==void 0?r:{};oe(a)&&!Array.isArray(a)||_(0,"@".concat(t.name," args must be an object with argument names as keys.")),this.args=_e(a).map(function(u){var o=u[0],s=u[1];return{name:o,description:s.description,type:s.type,defaultValue:s.defaultValue,deprecationReason:s.deprecationReason,extensions:s.extensions&&j(s.extensions),astNode:s.astNode}})}var n=e.prototype;return n.toConfig=function(){return{name:this.name,description:this.description,locations:this.locations,args:At(this.args),isRepeatable:this.isRepeatable,extensions:this.extensions,astNode:this.astNode}},n.toString=function(){return"@"+this.name},n.toJSON=function(){return this.toString()},Ur(e,[{key:G,get:function(){return"GraphQLDirective"}}]),e}();H(he);var Vr=new he({name:"include",description:"Directs the executor to include this field or fragment only when the `if` argument is true.",locations:[R.FIELD,R.FRAGMENT_SPREAD,R.INLINE_FRAGMENT],args:{if:{type:new I(Q),description:"Included when true."}}}),Mr=new he({name:"skip",description:"Directs the executor to skip this field or fragment when the `if` argument is true.",locations:[R.FIELD,R.FRAGMENT_SPREAD,R.INLINE_FRAGMENT],args:{if:{type:new I(Q),description:"Skipped when true."}}}),xr="No longer supported",qr=new he({name:"deprecated",description:"Marks an element of a GraphQL schema as no longer supported.",locations:[R.FIELD_DEFINITION,R.ARGUMENT_DEFINITION,R.INPUT_FIELD_DEFINITION,R.ENUM_VALUE],args:{reason:{type:V,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:xr}}}),Cr=new he({name:"specifiedBy",description:"Exposes a URL that specifies the behaviour of this scalar.",locations:[R.SCALAR],args:{url:{type:new I(V),description:"The URL that specifies the behaviour of this scalar."}}}),jr=Object.freeze([Vr,Mr,qr,Cr]);function $t(e,n){for(var t=0;t<n.length;t++){var i=n[t];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function Gr(e,n,t){return n&&$t(e.prototype,n),t&&$t(e,t),e}(function(){function e(t){var i;this.__validationErrors=t.assumeValid===!0?[]:void 0,oe(t)||_(0,"Must provide configuration object."),!t.types||Array.isArray(t.types)||_(0,'"types" must be Array if provided but got: '.concat(F(t.types),".")),!t.directives||Array.isArray(t.directives)||_(0,'"directives" must be Array if provided but got: '+"".concat(F(t.directives),".")),this.description=t.description,this.extensions=t.extensions&&j(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=t.extensionASTNodes,this._queryType=t.query,this._mutationType=t.mutation,this._subscriptionType=t.subscription,this._directives=(i=t.directives)!==null&&i!==void 0?i:jr;var r=new Set(t.types);if(t.types!=null)for(var a=0,u=t.types;a<u.length;a++){var o=u[a];r.delete(o),K(o,r)}this._queryType!=null&&K(this._queryType,r),this._mutationType!=null&&K(this._mutationType,r),this._subscriptionType!=null&&K(this._subscriptionType,r);for(var s=0,l=this._directives;s<l.length;s++){var g=l[s];if(Br(g))for(var E=0,y=g.args;E<y.length;E++){var d=y[E];K(d.type,r)}}K(Vn,r),this._typeMap=Object.create(null),this._subTypeMap=Object.create(null),this._implementationsMap=Object.create(null);for(var N=0,w=kr(r);N<w.length;N++){var O=w[N];if(O!=null){var D=O.name;if(D||_(0,"One of the provided types for building the Schema is missing a name."),this._typeMap[D]!==void 0)throw new Error('Schema must contain uniquely named types but contains multiple types named "'.concat(D,'".'));if(this._typeMap[D]=O,$(O))for(var P=0,L=O.getInterfaces();P<L.length;P++){var f=L[P];if($(f)){var c=this._implementationsMap[f.name];c===void 0&&(c=this._implementationsMap[f.name]={objects:[],interfaces:[]}),c.interfaces.push(O)}}else if(W(O))for(var S=0,v=O.getInterfaces();S<v.length;S++){var b=v[S];if($(b)){var A=this._implementationsMap[b.name];A===void 0&&(A=this._implementationsMap[b.name]={objects:[],interfaces:[]}),A.objects.push(O)}}}}}var n=e.prototype;return n.getQueryType=function(){return this._queryType},n.getMutationType=function(){return this._mutationType},n.getSubscriptionType=function(){return this._subscriptionType},n.getTypeMap=function(){return this._typeMap},n.getType=function(i){return this.getTypeMap()[i]},n.getPossibleTypes=function(i){return te(i)?i.getTypes():this.getImplementations(i).objects},n.getImplementations=function(i){var r=this._implementationsMap[i.name];return r??{objects:[],interfaces:[]}},n.isPossibleType=function(i,r){return this.isSubType(i,r)},n.isSubType=function(i,r){var a=this._subTypeMap[i.name];if(a===void 0){if(a=Object.create(null),te(i))for(var u=0,o=i.getTypes();u<o.length;u++){var s=o[u];a[s.name]=!0}else{for(var l=this.getImplementations(i),g=0,E=l.objects;g<E.length;g++){var y=E[g];a[y.name]=!0}for(var d=0,N=l.interfaces;d<N.length;d++){var w=N[d];a[w.name]=!0}}this._subTypeMap[i.name]=a}return a[r.name]!==void 0},n.getDirectives=function(){return this._directives},n.getDirective=function(i){return yt(this.getDirectives(),function(r){return r.name===i})},n.toConfig=function(){var i;return{description:this.description,query:this.getQueryType(),mutation:this.getMutationType(),subscription:this.getSubscriptionType(),types:se(this.getTypeMap()),directives:this.getDirectives().slice(),extensions:this.extensions,astNode:this.astNode,extensionASTNodes:(i=this.extensionASTNodes)!==null&&i!==void 0?i:[],assumeValid:this.__validationErrors!==void 0}},Gr(e,[{key:G,get:function(){return"GraphQLSchema"}}]),e})();function K(e,n){var t=Re(e);if(!n.has(t)){if(n.add(t),te(t))for(var i=0,r=t.getTypes();i<r.length;i++){var a=r[i];K(a,n)}else if(W(t)||$(t)){for(var u=0,o=t.getInterfaces();u<o.length;u++){var s=o[u];K(s,n)}for(var l=0,g=se(t.getFields());l<g.length;l++){var E=g[l];K(E.type,n);for(var y=0,d=E.args;y<d.length;y++){var N=d[y];K(N.type,n)}}}else if(ue(t))for(var w=0,O=se(t.getFields());w<O.length;w++){var D=O[w];K(D.type,n)}}return n}function tn(e,n){var t;if(n.kind===h.LIST_TYPE)return t=tn(e,n.type),t&&new q(t);if(n.kind===h.NON_NULL_TYPE)return t=tn(e,n.type),t&&new I(t);if(n.kind===h.NAMED_TYPE)return e.getType(n.name.value);Oe(0,"Unexpected type node: "+F(n))}var $r=function(){function e(t,i,r){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??Qr,r&&(ve(r)&&this._inputTypeStack.push(r),Rn(r)&&this._parentTypeStack.push(r),Ye(r)&&this._typeStack.push(r))}var n=e.prototype;return n.getType=function(){if(this._typeStack.length>0)return this._typeStack[this._typeStack.length-1]},n.getParentType=function(){if(this._parentTypeStack.length>0)return this._parentTypeStack[this._parentTypeStack.length-1]},n.getInputType=function(){if(this._inputTypeStack.length>0)return this._inputTypeStack[this._inputTypeStack.length-1]},n.getParentInputType=function(){if(this._inputTypeStack.length>1)return this._inputTypeStack[this._inputTypeStack.length-2]},n.getFieldDef=function(){if(this._fieldDefStack.length>0)return this._fieldDefStack[this._fieldDefStack.length-1]},n.getDefaultValue=function(){if(this._defaultValueStack.length>0)return this._defaultValueStack[this._defaultValueStack.length-1]},n.getDirective=function(){return this._directive},n.getArgument=function(){return this._argument},n.getEnumValue=function(){return this._enumValue},n.enter=function(i){var r=this._schema;switch(i.kind){case h.SELECTION_SET:{var a=Re(this.getType());this._parentTypeStack.push(Rn(a)?a:void 0);break}case h.FIELD:{var u=this.getParentType(),o,s;u&&(o=this._getFieldDef(r,u,i),o&&(s=o.type)),this._fieldDefStack.push(o),this._typeStack.push(Ye(s)?s:void 0);break}case h.DIRECTIVE:this._directive=r.getDirective(i.name.value);break;case h.OPERATION_DEFINITION:{var l;switch(i.operation){case"query":l=r.getQueryType();break;case"mutation":l=r.getMutationType();break;case"subscription":l=r.getSubscriptionType();break}this._typeStack.push(W(l)?l:void 0);break}case h.INLINE_FRAGMENT:case h.FRAGMENT_DEFINITION:{var g=i.typeCondition,E=g?tn(r,g):Re(this.getType());this._typeStack.push(Ye(E)?E:void 0);break}case h.VARIABLE_DEFINITION:{var y=tn(r,i.type);this._inputTypeStack.push(ve(y)?y:void 0);break}case h.ARGUMENT:{var d,N,w,O=(d=this.getDirective())!==null&&d!==void 0?d:this.getFieldDef();O&&(N=yt(O.args,function(b){return b.name===i.name.value}),N&&(w=N.type)),this._argument=N,this._defaultValueStack.push(N?N.defaultValue:void 0),this._inputTypeStack.push(ve(w)?w:void 0);break}case h.LIST:{var D=pr(this.getInputType()),P=Le(D)?D.ofType:D;this._defaultValueStack.push(void 0),this._inputTypeStack.push(ve(P)?P:void 0);break}case h.OBJECT_FIELD:{var L=Re(this.getInputType()),f,c;ue(L)&&(c=L.getFields()[i.name.value],c&&(f=c.type)),this._defaultValueStack.push(c?c.defaultValue:void 0),this._inputTypeStack.push(ve(f)?f:void 0);break}case h.ENUM:{var S=Re(this.getInputType()),v;ie(S)&&(v=S.getValue(i.value)),this._enumValue=v;break}}},n.leave=function(i){switch(i.kind){case h.SELECTION_SET:this._parentTypeStack.pop();break;case h.FIELD:this._fieldDefStack.pop(),this._typeStack.pop();break;case h.DIRECTIVE:this._directive=null;break;case h.OPERATION_DEFINITION:case h.INLINE_FRAGMENT:case h.FRAGMENT_DEFINITION:this._typeStack.pop();break;case h.VARIABLE_DEFINITION:this._inputTypeStack.pop();break;case h.ARGUMENT:this._argument=null,this._defaultValueStack.pop(),this._inputTypeStack.pop();break;case h.LIST:case h.OBJECT_FIELD:this._defaultValueStack.pop(),this._inputTypeStack.pop();break;case h.ENUM:this._enumValue=null;break}},e}();function Qr(e,n,t){var i=t.name.value;if(i===xt.name&&e.getQueryType()===n)return xt;if(i===qt.name&&e.getQueryType()===n)return qt;if(i===Ct.name&&Rn(n))return Ct;if(W(n)||$(n))return n.getFields()[i]}function Jr(e,n){return{enter:function(i){e.enter(i);var r=On(n,i.kind,!1);if(r){var a=r.apply(n,arguments);return a!==void 0&&(e.leave(i),Dn(a)&&e.enter(a)),a}},leave:function(i){var r=On(n,i.kind,!0),a;return r&&(a=r.apply(n,arguments)),e.leave(i),a}}}[].concat(Lt,jt).map(function(e){return e.name});var ae;function ye(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}ae={},ye(ae,h.SCALAR_TYPE_DEFINITION,h.SCALAR_TYPE_EXTENSION),ye(ae,h.OBJECT_TYPE_DEFINITION,h.OBJECT_TYPE_EXTENSION),ye(ae,h.INTERFACE_TYPE_DEFINITION,h.INTERFACE_TYPE_EXTENSION),ye(ae,h.UNION_TYPE_DEFINITION,h.UNION_TYPE_EXTENSION),ye(ae,h.ENUM_TYPE_DEFINITION,h.ENUM_TYPE_EXTENSION),ye(ae,h.INPUT_OBJECT_TYPE_DEFINITION,h.INPUT_OBJECT_TYPE_EXTENSION);function Qt(e,n){e.prototype=Object.create(n.prototype),e.prototype.constructor=e,e.__proto__=n}var Jt=function(){function e(t,i){this._ast=t,this._fragments=void 0,this._fragmentSpreads=new Map,this._recursivelyReferencedFragments=new Map,this._onError=i}var n=e.prototype;return n.reportError=function(i){this._onError(i)},n.getDocument=function(){return this._ast},n.getFragment=function(i){var r=this._fragments;return r||(this._fragments=r=this.getDocument().definitions.reduce(function(a,u){return u.kind===h.FRAGMENT_DEFINITION&&(a[u.name.value]=u),a},Object.create(null))),r[i]},n.getFragmentSpreads=function(i){var r=this._fragmentSpreads.get(i);if(!r){r=[];for(var a=[i];a.length!==0;)for(var u=a.pop(),o=0,s=u.selections;o<s.length;o++){var l=s[o];l.kind===h.FRAGMENT_SPREAD?r.push(l):l.selectionSet&&a.push(l.selectionSet)}this._fragmentSpreads.set(i,r)}return r},n.getRecursivelyReferencedFragments=function(i){var r=this._recursivelyReferencedFragments.get(i);if(!r){r=[];for(var a=Object.create(null),u=[i.selectionSet];u.length!==0;)for(var o=u.pop(),s=0,l=this.getFragmentSpreads(o);s<l.length;s++){var g=l[s],E=g.name.value;if(a[E]!==!0){a[E]=!0;var y=this.getFragment(E);y&&(r.push(y),u.push(y.selectionSet))}}this._recursivelyReferencedFragments.set(i,r)}return r},e}();(function(e){Qt(n,e);function n(i,r,a){var u;return u=e.call(this,i,a)||this,u._schema=r,u}var t=n.prototype;return t.getSchema=function(){return this._schema},n})(Jt),function(e){Qt(n,e);function n(i,r,a,u){var o;return o=e.call(this,r,u)||this,o._schema=i,o._typeInfo=a,o._variableUsages=new Map,o._recursiveVariableUsages=new Map,o}var t=n.prototype;return t.getSchema=function(){return this._schema},t.getVariableUsages=function(r){var a=this._variableUsages.get(r);if(!a){var u=[],o=new $r(this._schema);ht(r,Jr(o,{VariableDefinition:function(){return!1},Variable:function(l){u.push({node:l,type:o.getInputType(),defaultValue:o.getDefaultValue()})}})),a=u,this._variableUsages.set(r,a)}return a},t.getRecursiveVariableUsages=function(r){var a=this._recursiveVariableUsages.get(r);if(!a){a=this.getVariableUsages(r);for(var u=0,o=this.getRecursivelyReferencedFragments(r);u<o.length;u++){var s=o[u];a=a.concat(this.getVariableUsages(s))}this._recursiveVariableUsages.set(r,a)}return a},t.getType=function(){return this._typeInfo.getType()},t.getParentType=function(){return this._typeInfo.getParentType()},t.getInputType=function(){return this._typeInfo.getInputType()},t.getParentInputType=function(){return this._typeInfo.getParentInputType()},t.getFieldDef=function(){return this._typeInfo.getFieldDef()},t.getDirective=function(){return this._typeInfo.getDirective()},t.getArgument=function(){return this._typeInfo.getArgument()},t.getEnumValue=function(){return this._typeInfo.getEnumValue()},n}(Jt),gt(Lt.concat(jt),function(e){return e.name});const Hr={staging:{graphEndpoint:"https://api-staging.spritz.finance/graphql"},production:{graphEndpoint:"https://api.spritz.finance/graphql"}};let Mn=class Ii extends Error{date;constructor(n,...t){super(...t),Error.captureStackTrace&&Error.captureStackTrace(this,Ii),this.name="SpritzApiError",this.message=n,this.date=new Date}};const zr=e=>at.create(e);class Yr{client;constructor(n,t,i){this.client=zr({baseURL:Hr[n].graphEndpoint,headers:{"Content-Type":"application/json",Authorization:"Bearer "+t,...i?{"X-INTEGRATION-KEY":i}:{}}})}async query({query:n,variables:t}){try{const i=await this.client.post("",{query:ne(n),variables:t,operationName:n?.definitions?.[0]?.name?.value});if(i.data.errors)throw new Mn(`Spritz GraphQL Error: ${i.data.errors[0].message}`);return i.data.data}catch(i){if(at.isAxiosError(i)){const r=i.response?.data.Message??i.response?.data.message;throw new Mn(`Spritz Request Error: ${r}`)}else throw new Mn(`Spritz Request Error: ${i.message}`)}}}var rn={kind:"Document",definitions:[{kind:"FragmentDefinition",name:{kind:"Name",value:"PayableAccountFragment"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"PayableAccount"}},directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"name"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"userId"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"country"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"currency"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"createdAt"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"type"},arguments:[],directives:[]},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"BankAccount"}},directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"accountNumber"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"bankAccountType"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"bankAccountSubType"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"holder"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"email"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"ownedByUser"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"bankAccountDetails"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"USBankAccountDetails"}},directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"routingNumber"},arguments:[],directives:[]}]}}]}}]}},{kind:"Field",name:{kind:"Name",value:"institution"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"name"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"logo"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"country"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"currency"},arguments:[],directives:[]}]}}]}}],loc:{start:0,end:501}};rn.loc.source={body:`fragment PayableAccountFragment on PayableAccount {
|
|
42
|
+
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:function(){return{name:{type:new I(V),resolve:function(t){return t.name}},description:{type:V,resolve:function(t){return t.description}},isRepeatable:{type:new I(Q),resolve:function(t){return t.isRepeatable}},locations:{type:new I(new C(new I(Ut))),resolve:function(t){return t.locations}},args:{type:new I(new C(new I(nn))),args:{includeDeprecated:{type:Q,defaultValue:!1}},resolve:function(t,i){var a=i.includeDeprecated;return a?t.args:t.args.filter(function(r){return r.deprecationReason==null})}}}}}),Ut=new Xe({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:R.QUERY,description:"Location adjacent to a query operation."},MUTATION:{value:R.MUTATION,description:"Location adjacent to a mutation operation."},SUBSCRIPTION:{value:R.SUBSCRIPTION,description:"Location adjacent to a subscription operation."},FIELD:{value:R.FIELD,description:"Location adjacent to a field."},FRAGMENT_DEFINITION:{value:R.FRAGMENT_DEFINITION,description:"Location adjacent to a fragment definition."},FRAGMENT_SPREAD:{value:R.FRAGMENT_SPREAD,description:"Location adjacent to a fragment spread."},INLINE_FRAGMENT:{value:R.INLINE_FRAGMENT,description:"Location adjacent to an inline fragment."},VARIABLE_DEFINITION:{value:R.VARIABLE_DEFINITION,description:"Location adjacent to a variable definition."},SCHEMA:{value:R.SCHEMA,description:"Location adjacent to a schema definition."},SCALAR:{value:R.SCALAR,description:"Location adjacent to a scalar definition."},OBJECT:{value:R.OBJECT,description:"Location adjacent to an object type definition."},FIELD_DEFINITION:{value:R.FIELD_DEFINITION,description:"Location adjacent to a field definition."},ARGUMENT_DEFINITION:{value:R.ARGUMENT_DEFINITION,description:"Location adjacent to an argument definition."},INTERFACE:{value:R.INTERFACE,description:"Location adjacent to an interface definition."},UNION:{value:R.UNION,description:"Location adjacent to a union definition."},ENUM:{value:R.ENUM,description:"Location adjacent to an enum definition."},ENUM_VALUE:{value:R.ENUM_VALUE,description:"Location adjacent to an enum value definition."},INPUT_OBJECT:{value:R.INPUT_OBJECT,description:"Location adjacent to an input object type definition."},INPUT_FIELD_DEFINITION:{value:R.INPUT_FIELD_DEFINITION,description:"Location adjacent to an input object field definition."}}}),K=new ae({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:function(){return{kind:{type:new I(Mt),resolve:function(t){if(Fe(t))return q.SCALAR;if(W(t))return q.OBJECT;if($(t))return q.INTERFACE;if(te(t))return q.UNION;if(ie(t))return q.ENUM;if(ue(t))return q.INPUT_OBJECT;if(Le(t))return q.LIST;if(de(t))return q.NON_NULL;Oe(0,'Unexpected type: "'.concat(F(t),'".'))}},name:{type:V,resolve:function(t){return t.name!==void 0?t.name:void 0}},description:{type:V,resolve:function(t){return t.description!==void 0?t.description:void 0}},specifiedByUrl:{type:V,resolve:function(t){return t.specifiedByUrl!==void 0?t.specifiedByUrl:void 0}},fields:{type:new C(new I(Bt)),args:{includeDeprecated:{type:Q,defaultValue:!1}},resolve:function(t,i){var a=i.includeDeprecated;if(W(t)||$(t)){var r=se(t.getFields());return a?r:r.filter(function(u){return u.deprecationReason==null})}}},interfaces:{type:new C(new I(K)),resolve:function(t){if(W(t)||$(t))return t.getInterfaces()}},possibleTypes:{type:new C(new I(K)),resolve:function(t,i,a,r){var u=r.schema;if(da(t))return u.getPossibleTypes(t)}},enumValues:{type:new C(new I(Vt)),args:{includeDeprecated:{type:Q,defaultValue:!1}},resolve:function(t,i){var a=i.includeDeprecated;if(ie(t)){var r=t.getValues();return a?r:r.filter(function(u){return u.deprecationReason==null})}}},inputFields:{type:new C(new I(nn)),args:{includeDeprecated:{type:Q,defaultValue:!1}},resolve:function(t,i){var a=i.includeDeprecated;if(ue(t)){var r=se(t.getFields());return a?r:r.filter(function(u){return u.deprecationReason==null})}}},ofType:{type:K,resolve:function(t){return t.ofType!==void 0?t.ofType:void 0}}}}}),Bt=new ae({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:function(){return{name:{type:new I(V),resolve:function(t){return t.name}},description:{type:V,resolve:function(t){return t.description}},args:{type:new I(new C(new I(nn))),args:{includeDeprecated:{type:Q,defaultValue:!1}},resolve:function(t,i){var a=i.includeDeprecated;return a?t.args:t.args.filter(function(r){return r.deprecationReason==null})}},type:{type:new I(K),resolve:function(t){return t.type}},isDeprecated:{type:new I(Q),resolve:function(t){return t.deprecationReason!=null}},deprecationReason:{type:V,resolve:function(t){return t.deprecationReason}}}}}),nn=new ae({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:function(){return{name:{type:new I(V),resolve:function(t){return t.name}},description:{type:V,resolve:function(t){return t.description}},type:{type:new I(K),resolve:function(t){return t.type}},defaultValue:{type:V,description:"A GraphQL-formatted string representing the default value for this input value.",resolve:function(t){var i=t.type,a=t.defaultValue,r=Be(a,i);return r?ne(r):null}},isDeprecated:{type:new I(Q),resolve:function(t){return t.deprecationReason!=null}},deprecationReason:{type:V,resolve:function(t){return t.deprecationReason}}}}}),Vt=new ae({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:function(){return{name:{type:new I(V),resolve:function(t){return t.name}},description:{type:V,resolve:function(t){return t.description}},isDeprecated:{type:new I(Q),resolve:function(t){return t.deprecationReason!=null}},deprecationReason:{type:V,resolve:function(t){return t.deprecationReason}}}}}),q=Object.freeze({SCALAR:"SCALAR",OBJECT:"OBJECT",INTERFACE:"INTERFACE",UNION:"UNION",ENUM:"ENUM",INPUT_OBJECT:"INPUT_OBJECT",LIST:"LIST",NON_NULL:"NON_NULL"}),Mt=new Xe({name:"__TypeKind",description:"An enum describing what kind of type a given `__Type` is.",values:{SCALAR:{value:q.SCALAR,description:"Indicates this type is a scalar."},OBJECT:{value:q.OBJECT,description:"Indicates this type is an object. `fields` and `interfaces` are valid fields."},INTERFACE:{value:q.INTERFACE,description:"Indicates this type is an interface. `fields`, `interfaces`, and `possibleTypes` are valid fields."},UNION:{value:q.UNION,description:"Indicates this type is a union. `possibleTypes` is a valid field."},ENUM:{value:q.ENUM,description:"Indicates this type is an enum. `enumValues` is a valid field."},INPUT_OBJECT:{value:q.INPUT_OBJECT,description:"Indicates this type is an input object. `inputFields` is a valid field."},LIST:{value:q.LIST,description:"Indicates this type is a list. `ofType` is a valid field."},NON_NULL:{value:q.NON_NULL,description:"Indicates this type is a non-null. `ofType` is a valid field."}}}),xt={name:"__schema",type:new I(Mn),description:"Access the current type schema of this server.",args:[],resolve:function(n,t,i,a){var r=a.schema;return r},isDeprecated:!1,deprecationReason:void 0,extensions:void 0,astNode:void 0},Ct={name:"__type",type:K,description:"Request the type information of a single type.",args:[{name:"name",description:void 0,type:new I(V),defaultValue:void 0,deprecationReason:void 0,extensions:void 0,astNode:void 0}],resolve:function(n,t,i,a){var r=t.name,u=a.schema;return u.getType(r)},isDeprecated:!1,deprecationReason:void 0,extensions:void 0,astNode:void 0},qt={name:"__typename",type:new I(V),description:"The name of the current Object type at runtime.",args:[],resolve:function(n,t,i,a){var r=a.parentType;return r.name},isDeprecated:!1,deprecationReason:void 0,extensions:void 0,astNode:void 0},jt=Object.freeze([Mn,Pt,Ut,K,Bt,nn,Vt,Mt]);function Gt(e,n){for(var t=0;t<n.length;t++){var i=n[t];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function Ba(e,n,t){return n&&Gt(e.prototype,n),t&&Gt(e,t),e}function Va(e){return ee(e,he)}var he=function(){function e(t){var i,a;this.name=t.name,this.description=t.description,this.locations=t.locations,this.isRepeatable=(i=t.isRepeatable)!==null&&i!==void 0?i:!1,this.extensions=t.extensions&&j(t.extensions),this.astNode=t.astNode,t.name||_(0,"Directive must be named."),Array.isArray(t.locations)||_(0,"@".concat(t.name," locations must be an Array."));var r=(a=t.args)!==null&&a!==void 0?a:{};oe(r)&&!Array.isArray(r)||_(0,"@".concat(t.name," args must be an object with argument names as keys.")),this.args=_e(r).map(function(u){var o=u[0],s=u[1];return{name:o,description:s.description,type:s.type,defaultValue:s.defaultValue,deprecationReason:s.deprecationReason,extensions:s.extensions&&j(s.extensions),astNode:s.astNode}})}var n=e.prototype;return n.toConfig=function(){return{name:this.name,description:this.description,locations:this.locations,args:At(this.args),isRepeatable:this.isRepeatable,extensions:this.extensions,astNode:this.astNode}},n.toString=function(){return"@"+this.name},n.toJSON=function(){return this.toString()},Ba(e,[{key:G,get:function(){return"GraphQLDirective"}}]),e}();H(he);var Ma=new he({name:"include",description:"Directs the executor to include this field or fragment only when the `if` argument is true.",locations:[R.FIELD,R.FRAGMENT_SPREAD,R.INLINE_FRAGMENT],args:{if:{type:new I(Q),description:"Included when true."}}}),xa=new he({name:"skip",description:"Directs the executor to skip this field or fragment when the `if` argument is true.",locations:[R.FIELD,R.FRAGMENT_SPREAD,R.INLINE_FRAGMENT],args:{if:{type:new I(Q),description:"Skipped when true."}}}),Ca="No longer supported",qa=new he({name:"deprecated",description:"Marks an element of a GraphQL schema as no longer supported.",locations:[R.FIELD_DEFINITION,R.ARGUMENT_DEFINITION,R.INPUT_FIELD_DEFINITION,R.ENUM_VALUE],args:{reason:{type:V,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:Ca}}}),ja=new he({name:"specifiedBy",description:"Exposes a URL that specifies the behaviour of this scalar.",locations:[R.SCALAR],args:{url:{type:new I(V),description:"The URL that specifies the behaviour of this scalar."}}}),Ga=Object.freeze([Ma,xa,qa,ja]);function $t(e,n){for(var t=0;t<n.length;t++){var i=n[t];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function $a(e,n,t){return n&&$t(e.prototype,n),t&&$t(e,t),e}(function(){function e(t){var i;this.__validationErrors=t.assumeValid===!0?[]:void 0,oe(t)||_(0,"Must provide configuration object."),!t.types||Array.isArray(t.types)||_(0,'"types" must be Array if provided but got: '.concat(F(t.types),".")),!t.directives||Array.isArray(t.directives)||_(0,'"directives" must be Array if provided but got: '+"".concat(F(t.directives),".")),this.description=t.description,this.extensions=t.extensions&&j(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=t.extensionASTNodes,this._queryType=t.query,this._mutationType=t.mutation,this._subscriptionType=t.subscription,this._directives=(i=t.directives)!==null&&i!==void 0?i:Ga;var a=new Set(t.types);if(t.types!=null)for(var r=0,u=t.types;r<u.length;r++){var o=u[r];a.delete(o),X(o,a)}this._queryType!=null&&X(this._queryType,a),this._mutationType!=null&&X(this._mutationType,a),this._subscriptionType!=null&&X(this._subscriptionType,a);for(var s=0,l=this._directives;s<l.length;s++){var g=l[s];if(Va(g))for(var E=0,y=g.args;E<y.length;E++){var d=y[E];X(d.type,a)}}X(Mn,a),this._typeMap=Object.create(null),this._subTypeMap=Object.create(null),this._implementationsMap=Object.create(null);for(var N=0,w=Sa(a);N<w.length;N++){var O=w[N];if(O!=null){var D=O.name;if(D||_(0,"One of the provided types for building the Schema is missing a name."),this._typeMap[D]!==void 0)throw new Error('Schema must contain uniquely named types but contains multiple types named "'.concat(D,'".'));if(this._typeMap[D]=O,$(O))for(var P=0,L=O.getInterfaces();P<L.length;P++){var f=L[P];if($(f)){var c=this._implementationsMap[f.name];c===void 0&&(c=this._implementationsMap[f.name]={objects:[],interfaces:[]}),c.interfaces.push(O)}}else if(W(O))for(var S=0,v=O.getInterfaces();S<v.length;S++){var b=v[S];if($(b)){var A=this._implementationsMap[b.name];A===void 0&&(A=this._implementationsMap[b.name]={objects:[],interfaces:[]}),A.objects.push(O)}}}}}var n=e.prototype;return n.getQueryType=function(){return this._queryType},n.getMutationType=function(){return this._mutationType},n.getSubscriptionType=function(){return this._subscriptionType},n.getTypeMap=function(){return this._typeMap},n.getType=function(i){return this.getTypeMap()[i]},n.getPossibleTypes=function(i){return te(i)?i.getTypes():this.getImplementations(i).objects},n.getImplementations=function(i){var a=this._implementationsMap[i.name];return a??{objects:[],interfaces:[]}},n.isPossibleType=function(i,a){return this.isSubType(i,a)},n.isSubType=function(i,a){var r=this._subTypeMap[i.name];if(r===void 0){if(r=Object.create(null),te(i))for(var u=0,o=i.getTypes();u<o.length;u++){var s=o[u];r[s.name]=!0}else{for(var l=this.getImplementations(i),g=0,E=l.objects;g<E.length;g++){var y=E[g];r[y.name]=!0}for(var d=0,N=l.interfaces;d<N.length;d++){var w=N[d];r[w.name]=!0}}this._subTypeMap[i.name]=r}return r[a.name]!==void 0},n.getDirectives=function(){return this._directives},n.getDirective=function(i){return yt(this.getDirectives(),function(a){return a.name===i})},n.toConfig=function(){var i;return{description:this.description,query:this.getQueryType(),mutation:this.getMutationType(),subscription:this.getSubscriptionType(),types:se(this.getTypeMap()),directives:this.getDirectives().slice(),extensions:this.extensions,astNode:this.astNode,extensionASTNodes:(i=this.extensionASTNodes)!==null&&i!==void 0?i:[],assumeValid:this.__validationErrors!==void 0}},$a(e,[{key:G,get:function(){return"GraphQLSchema"}}]),e})();function X(e,n){var t=Re(e);if(!n.has(t)){if(n.add(t),te(t))for(var i=0,a=t.getTypes();i<a.length;i++){var r=a[i];X(r,n)}else if(W(t)||$(t)){for(var u=0,o=t.getInterfaces();u<o.length;u++){var s=o[u];X(s,n)}for(var l=0,g=se(t.getFields());l<g.length;l++){var E=g[l];X(E.type,n);for(var y=0,d=E.args;y<d.length;y++){var N=d[y];X(N.type,n)}}}else if(ue(t))for(var w=0,O=se(t.getFields());w<O.length;w++){var D=O[w];X(D.type,n)}}return n}function tn(e,n){var t;if(n.kind===h.LIST_TYPE)return t=tn(e,n.type),t&&new C(t);if(n.kind===h.NON_NULL_TYPE)return t=tn(e,n.type),t&&new I(t);if(n.kind===h.NAMED_TYPE)return e.getType(n.name.value);Oe(0,"Unexpected type node: "+F(n))}var Qa=function(){function e(t,i,a){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??Ja,a&&(ve(a)&&this._inputTypeStack.push(a),Pn(a)&&this._parentTypeStack.push(a),Ye(a)&&this._typeStack.push(a))}var n=e.prototype;return n.getType=function(){if(this._typeStack.length>0)return this._typeStack[this._typeStack.length-1]},n.getParentType=function(){if(this._parentTypeStack.length>0)return this._parentTypeStack[this._parentTypeStack.length-1]},n.getInputType=function(){if(this._inputTypeStack.length>0)return this._inputTypeStack[this._inputTypeStack.length-1]},n.getParentInputType=function(){if(this._inputTypeStack.length>1)return this._inputTypeStack[this._inputTypeStack.length-2]},n.getFieldDef=function(){if(this._fieldDefStack.length>0)return this._fieldDefStack[this._fieldDefStack.length-1]},n.getDefaultValue=function(){if(this._defaultValueStack.length>0)return this._defaultValueStack[this._defaultValueStack.length-1]},n.getDirective=function(){return this._directive},n.getArgument=function(){return this._argument},n.getEnumValue=function(){return this._enumValue},n.enter=function(i){var a=this._schema;switch(i.kind){case h.SELECTION_SET:{var r=Re(this.getType());this._parentTypeStack.push(Pn(r)?r:void 0);break}case h.FIELD:{var u=this.getParentType(),o,s;u&&(o=this._getFieldDef(a,u,i),o&&(s=o.type)),this._fieldDefStack.push(o),this._typeStack.push(Ye(s)?s:void 0);break}case h.DIRECTIVE:this._directive=a.getDirective(i.name.value);break;case h.OPERATION_DEFINITION:{var l;switch(i.operation){case"query":l=a.getQueryType();break;case"mutation":l=a.getMutationType();break;case"subscription":l=a.getSubscriptionType();break}this._typeStack.push(W(l)?l:void 0);break}case h.INLINE_FRAGMENT:case h.FRAGMENT_DEFINITION:{var g=i.typeCondition,E=g?tn(a,g):Re(this.getType());this._typeStack.push(Ye(E)?E:void 0);break}case h.VARIABLE_DEFINITION:{var y=tn(a,i.type);this._inputTypeStack.push(ve(y)?y:void 0);break}case h.ARGUMENT:{var d,N,w,O=(d=this.getDirective())!==null&&d!==void 0?d:this.getFieldDef();O&&(N=yt(O.args,function(b){return b.name===i.name.value}),N&&(w=N.type)),this._argument=N,this._defaultValueStack.push(N?N.defaultValue:void 0),this._inputTypeStack.push(ve(w)?w:void 0);break}case h.LIST:{var D=ma(this.getInputType()),P=Le(D)?D.ofType:D;this._defaultValueStack.push(void 0),this._inputTypeStack.push(ve(P)?P:void 0);break}case h.OBJECT_FIELD:{var L=Re(this.getInputType()),f,c;ue(L)&&(c=L.getFields()[i.name.value],c&&(f=c.type)),this._defaultValueStack.push(c?c.defaultValue:void 0),this._inputTypeStack.push(ve(f)?f:void 0);break}case h.ENUM:{var S=Re(this.getInputType()),v;ie(S)&&(v=S.getValue(i.value)),this._enumValue=v;break}}},n.leave=function(i){switch(i.kind){case h.SELECTION_SET:this._parentTypeStack.pop();break;case h.FIELD:this._fieldDefStack.pop(),this._typeStack.pop();break;case h.DIRECTIVE:this._directive=null;break;case h.OPERATION_DEFINITION:case h.INLINE_FRAGMENT:case h.FRAGMENT_DEFINITION:this._typeStack.pop();break;case h.VARIABLE_DEFINITION:this._inputTypeStack.pop();break;case h.ARGUMENT:this._argument=null,this._defaultValueStack.pop(),this._inputTypeStack.pop();break;case h.LIST:case h.OBJECT_FIELD:this._defaultValueStack.pop(),this._inputTypeStack.pop();break;case h.ENUM:this._enumValue=null;break}},e}();function Ja(e,n,t){var i=t.name.value;if(i===xt.name&&e.getQueryType()===n)return xt;if(i===Ct.name&&e.getQueryType()===n)return Ct;if(i===qt.name&&Pn(n))return qt;if(W(n)||$(n))return n.getFields()[i]}function Ha(e,n){return{enter:function(i){e.enter(i);var a=_n(n,i.kind,!1);if(a){var r=a.apply(n,arguments);return r!==void 0&&(e.leave(i),On(r)&&e.enter(r)),r}},leave:function(i){var a=_n(n,i.kind,!0),r;return a&&(r=a.apply(n,arguments)),e.leave(i),r}}}[].concat(Lt,jt).map(function(e){return e.name});var re;function ye(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}re={},ye(re,h.SCALAR_TYPE_DEFINITION,h.SCALAR_TYPE_EXTENSION),ye(re,h.OBJECT_TYPE_DEFINITION,h.OBJECT_TYPE_EXTENSION),ye(re,h.INTERFACE_TYPE_DEFINITION,h.INTERFACE_TYPE_EXTENSION),ye(re,h.UNION_TYPE_DEFINITION,h.UNION_TYPE_EXTENSION),ye(re,h.ENUM_TYPE_DEFINITION,h.ENUM_TYPE_EXTENSION),ye(re,h.INPUT_OBJECT_TYPE_DEFINITION,h.INPUT_OBJECT_TYPE_EXTENSION);function Qt(e,n){e.prototype=Object.create(n.prototype),e.prototype.constructor=e,e.__proto__=n}var Jt=function(){function e(t,i){this._ast=t,this._fragments=void 0,this._fragmentSpreads=new Map,this._recursivelyReferencedFragments=new Map,this._onError=i}var n=e.prototype;return n.reportError=function(i){this._onError(i)},n.getDocument=function(){return this._ast},n.getFragment=function(i){var a=this._fragments;return a||(this._fragments=a=this.getDocument().definitions.reduce(function(r,u){return u.kind===h.FRAGMENT_DEFINITION&&(r[u.name.value]=u),r},Object.create(null))),a[i]},n.getFragmentSpreads=function(i){var a=this._fragmentSpreads.get(i);if(!a){a=[];for(var r=[i];r.length!==0;)for(var u=r.pop(),o=0,s=u.selections;o<s.length;o++){var l=s[o];l.kind===h.FRAGMENT_SPREAD?a.push(l):l.selectionSet&&r.push(l.selectionSet)}this._fragmentSpreads.set(i,a)}return a},n.getRecursivelyReferencedFragments=function(i){var a=this._recursivelyReferencedFragments.get(i);if(!a){a=[];for(var r=Object.create(null),u=[i.selectionSet];u.length!==0;)for(var o=u.pop(),s=0,l=this.getFragmentSpreads(o);s<l.length;s++){var g=l[s],E=g.name.value;if(r[E]!==!0){r[E]=!0;var y=this.getFragment(E);y&&(a.push(y),u.push(y.selectionSet))}}this._recursivelyReferencedFragments.set(i,a)}return a},e}();(function(e){Qt(n,e);function n(i,a,r){var u;return u=e.call(this,i,r)||this,u._schema=a,u}var t=n.prototype;return t.getSchema=function(){return this._schema},n})(Jt),function(e){Qt(n,e);function n(i,a,r,u){var o;return o=e.call(this,a,u)||this,o._schema=i,o._typeInfo=r,o._variableUsages=new Map,o._recursiveVariableUsages=new Map,o}var t=n.prototype;return t.getSchema=function(){return this._schema},t.getVariableUsages=function(a){var r=this._variableUsages.get(a);if(!r){var u=[],o=new Qa(this._schema);ht(a,Ha(o,{VariableDefinition:function(){return!1},Variable:function(l){u.push({node:l,type:o.getInputType(),defaultValue:o.getDefaultValue()})}})),r=u,this._variableUsages.set(a,r)}return r},t.getRecursiveVariableUsages=function(a){var r=this._recursiveVariableUsages.get(a);if(!r){r=this.getVariableUsages(a);for(var u=0,o=this.getRecursivelyReferencedFragments(a);u<o.length;u++){var s=o[u];r=r.concat(this.getVariableUsages(s))}this._recursiveVariableUsages.set(a,r)}return r},t.getType=function(){return this._typeInfo.getType()},t.getParentType=function(){return this._typeInfo.getParentType()},t.getInputType=function(){return this._typeInfo.getInputType()},t.getParentInputType=function(){return this._typeInfo.getParentInputType()},t.getFieldDef=function(){return this._typeInfo.getFieldDef()},t.getDirective=function(){return this._typeInfo.getDirective()},t.getArgument=function(){return this._typeInfo.getArgument()},t.getEnumValue=function(){return this._typeInfo.getEnumValue()},n}(Jt),gt(Lt.concat(jt),function(e){return e.name});const Ht={staging:{baseEndpoint:"https://api-staging.spritz.finance",graphEndpoint:"https://api-staging.spritz.finance/graphql"},production:{baseEndpoint:"https://api.spritz.finance",graphEndpoint:"https://api.spritz.finance/graphql"}};let xn=class wi extends Error{date;constructor(n,...t){super(...t),Error.captureStackTrace&&Error.captureStackTrace(this,wi),this.name="SpritzApiError",this.message=n,this.date=new Date}};const za=e=>In.create(e),Ya=e=>In.create(e);class Ka{client;baseClient;constructor(n,t,i){const a={"Content-Type":"application/json",Accept:"application/json",Authorization:"Bearer "+t,...i?{"X-INTEGRATION-KEY":i}:{}};this.client=za({baseURL:Ht[n].graphEndpoint,headers:a}),this.baseClient=Ya({baseURL:Ht[n].baseEndpoint,headers:a})}async query({query:n,variables:t}){try{const i=await this.client.post("",{query:ne(n),variables:t,operationName:n?.definitions?.[0]?.name?.value});if(i.data.errors)throw new xn(`Spritz GraphQL Error: ${i.data.errors[0].message}`);return i.data.data}catch(i){if(In.isAxiosError(i)){const a=i.response?.data.Message??i.response?.data.message;throw new xn(`Spritz Request Error: ${a}`)}else throw new xn(`Spritz Request Error: ${i.message}`)}}}var an={kind:"Document",definitions:[{kind:"FragmentDefinition",name:{kind:"Name",value:"PayableAccountFragment"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"PayableAccount"}},directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"name"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"userId"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"country"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"currency"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"createdAt"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"type"},arguments:[],directives:[]},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"BankAccount"}},directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"accountNumber"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"bankAccountType"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"bankAccountSubType"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"holder"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"email"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"ownedByUser"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"bankAccountDetails"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"USBankAccountDetails"}},directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"routingNumber"},arguments:[],directives:[]}]}}]}}]}},{kind:"Field",name:{kind:"Name",value:"institution"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"name"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"logo"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"country"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"currency"},arguments:[],directives:[]}]}}]}}],loc:{start:0,end:501}};an.loc.source={body:`fragment PayableAccountFragment on PayableAccount {
|
|
43
43
|
id
|
|
44
44
|
name
|
|
45
45
|
userId
|
|
@@ -68,14 +68,14 @@ In some cases, you need to provide options to alter GraphQL's execution behavior
|
|
|
68
68
|
currency
|
|
69
69
|
}
|
|
70
70
|
}
|
|
71
|
-
`,name:"GraphQL request",locationOffset:{line:1,column:1}};function
|
|
71
|
+
`,name:"GraphQL request",locationOffset:{line:1,column:1}};function rn(e,n){if(e.kind==="FragmentSpread")n.add(e.name.value);else if(e.kind==="VariableDefinition"){var t=e.type;t.kind==="NamedType"&&n.add(t.name.value)}e.selectionSet&&e.selectionSet.selections.forEach(function(i){rn(i,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(i){rn(i,n)}),e.definitions&&e.definitions.forEach(function(i){rn(i,n)})}var Cn={};(function(){an.definitions.forEach(function(n){if(n.name){var t=new Set;rn(n,t),Cn[n.name.value]=t}})})();function zt(e,n){for(var t=0;t<e.definitions.length;t++){var i=e.definitions[t];if(i.name&&i.name.value==n)return i}}function Xa(e,n){var t={kind:e.kind,definitions:[zt(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var i=Cn[n]||new Set,a=new Set,r=new Set;for(i.forEach(function(o){r.add(o)});r.size>0;){var u=r;r=new Set,u.forEach(function(o){if(!a.has(o)){a.add(o);var s=Cn[o]||new Set;s.forEach(function(l){r.add(l)})}})}return a.forEach(function(o){var s=zt(e,o);s&&t.definitions.push(s)}),t}Xa(an,"PayableAccountFragment");var ge={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"CreateUSBankAccount"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"createUSAccountInput"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"USBankAccountInput"}}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"createUSBankAccount"},arguments:[{kind:"Argument",name:{kind:"Name",value:"createUSAccountInput"},value:{kind:"Variable",name:{kind:"Name",value:"createUSAccountInput"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"PayableAccountFragment"},directives:[]}]}}]}}],loc:{start:0,end:241}};ge.loc.source={body:`#import "../queries/payableAccountFragment.graphql"
|
|
72
72
|
|
|
73
73
|
mutation CreateUSBankAccount($createUSAccountInput: USBankAccountInput!) {
|
|
74
74
|
createUSBankAccount(createUSAccountInput: $createUSAccountInput) {
|
|
75
75
|
...PayableAccountFragment
|
|
76
76
|
}
|
|
77
77
|
}
|
|
78
|
-
`,name:"GraphQL request",locationOffset:{line:1,column:1}};var
|
|
78
|
+
`,name:"GraphQL request",locationOffset:{line:1,column:1}};var Yt={};function Wa(e){return e.filter(function(n){if(n.kind!=="FragmentDefinition")return!0;var t=n.name.value;return Yt[t]?!1:(Yt[t]=!0,!0)})}ge.definitions=ge.definitions.concat(Wa(an.definitions));function on(e,n){if(e.kind==="FragmentSpread")n.add(e.name.value);else if(e.kind==="VariableDefinition"){var t=e.type;t.kind==="NamedType"&&n.add(t.name.value)}e.selectionSet&&e.selectionSet.selections.forEach(function(i){on(i,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(i){on(i,n)}),e.definitions&&e.definitions.forEach(function(i){on(i,n)})}var qn={};(function(){ge.definitions.forEach(function(n){if(n.name){var t=new Set;on(n,t),qn[n.name.value]=t}})})();function Kt(e,n){for(var t=0;t<e.definitions.length;t++){var i=e.definitions[t];if(i.name&&i.name.value==n)return i}}function Za(e,n){var t={kind:e.kind,definitions:[Kt(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var i=qn[n]||new Set,a=new Set,r=new Set;for(i.forEach(function(o){r.add(o)});r.size>0;){var u=r;r=new Set,u.forEach(function(o){if(!a.has(o)){a.add(o);var s=qn[o]||new Set;s.forEach(function(l){r.add(l)})}})}return a.forEach(function(o){var s=Kt(e,o);s&&t.definitions.push(s)}),t}Za(ge,"CreateUSBankAccount");var ke={kind:"Document",definitions:[{kind:"FragmentDefinition",name:{kind:"Name",value:"BankAccountFragment"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"BankAccount"}},directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"name"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"userId"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"country"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"currency"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"createdAt"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"type"},arguments:[],directives:[]},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"BankAccount"}},directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"accountNumber"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"bankAccountType"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"bankAccountSubType"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"holder"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"email"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"ownedByUser"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"bankAccountDetails"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"USBankAccountDetails"}},directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"routingNumber"},arguments:[],directives:[]}]}}]}}]}},{kind:"Field",name:{kind:"Name",value:"institution"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"name"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"logo"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"country"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"currency"},arguments:[],directives:[]}]}}]}}],loc:{start:0,end:495}};ke.loc.source={body:`fragment BankAccountFragment on BankAccount {
|
|
79
79
|
id
|
|
80
80
|
name
|
|
81
81
|
userId
|
|
@@ -104,28 +104,28 @@ mutation CreateUSBankAccount($createUSAccountInput: USBankAccountInput!) {
|
|
|
104
104
|
currency
|
|
105
105
|
}
|
|
106
106
|
}
|
|
107
|
-
`,name:"GraphQL request",locationOffset:{line:1,column:1}};function sn(e,n){if(e.kind==="FragmentSpread")n.add(e.name.value);else if(e.kind==="VariableDefinition"){var t=e.type;t.kind==="NamedType"&&n.add(t.name.value)}e.selectionSet&&e.selectionSet.selections.forEach(function(i){sn(i,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(i){sn(i,n)}),e.definitions&&e.definitions.forEach(function(i){sn(i,n)})}var
|
|
107
|
+
`,name:"GraphQL request",locationOffset:{line:1,column:1}};function sn(e,n){if(e.kind==="FragmentSpread")n.add(e.name.value);else if(e.kind==="VariableDefinition"){var t=e.type;t.kind==="NamedType"&&n.add(t.name.value)}e.selectionSet&&e.selectionSet.selections.forEach(function(i){sn(i,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(i){sn(i,n)}),e.definitions&&e.definitions.forEach(function(i){sn(i,n)})}var jn={};(function(){ke.definitions.forEach(function(n){if(n.name){var t=new Set;sn(n,t),jn[n.name.value]=t}})})();function Xt(e,n){for(var t=0;t<e.definitions.length;t++){var i=e.definitions[t];if(i.name&&i.name.value==n)return i}}function er(e,n){var t={kind:e.kind,definitions:[Xt(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var i=jn[n]||new Set,a=new Set,r=new Set;for(i.forEach(function(o){r.add(o)});r.size>0;){var u=r;r=new Set,u.forEach(function(o){if(!a.has(o)){a.add(o);var s=jn[o]||new Set;s.forEach(function(l){r.add(l)})}})}return a.forEach(function(o){var s=Xt(e,o);s&&t.definitions.push(s)}),t}er(ke,"BankAccountFragment");var Se={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"RenameBankAccount"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"accountId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"name"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"renamePayableAccount"},arguments:[{kind:"Argument",name:{kind:"Name",value:"accountId"},value:{kind:"Variable",name:{kind:"Name",value:"accountId"}}},{kind:"Argument",name:{kind:"Name",value:"name"},value:{kind:"Variable",name:{kind:"Name",value:"name"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"BankAccountFragment"},directives:[]}]}}]}}],loc:{start:0,end:218}};Se.loc.source={body:`#import "../queries/bankAccountFragment.graphql"
|
|
108
108
|
|
|
109
109
|
mutation RenameBankAccount($accountId: String!, $name: String!) {
|
|
110
110
|
renamePayableAccount(accountId: $accountId, name: $name) {
|
|
111
111
|
...BankAccountFragment
|
|
112
112
|
}
|
|
113
113
|
}
|
|
114
|
-
`,name:"GraphQL request",locationOffset:{line:1,column:1}};var
|
|
114
|
+
`,name:"GraphQL request",locationOffset:{line:1,column:1}};var Wt={};function nr(e){return e.filter(function(n){if(n.kind!=="FragmentDefinition")return!0;var t=n.name.value;return Wt[t]?!1:(Wt[t]=!0,!0)})}Se.definitions=Se.definitions.concat(nr(ke.definitions));function un(e,n){if(e.kind==="FragmentSpread")n.add(e.name.value);else if(e.kind==="VariableDefinition"){var t=e.type;t.kind==="NamedType"&&n.add(t.name.value)}e.selectionSet&&e.selectionSet.selections.forEach(function(i){un(i,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(i){un(i,n)}),e.definitions&&e.definitions.forEach(function(i){un(i,n)})}var Gn={};(function(){Se.definitions.forEach(function(n){if(n.name){var t=new Set;un(n,t),Gn[n.name.value]=t}})})();function Zt(e,n){for(var t=0;t<e.definitions.length;t++){var i=e.definitions[t];if(i.name&&i.name.value==n)return i}}function tr(e,n){var t={kind:e.kind,definitions:[Zt(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var i=Gn[n]||new Set,a=new Set,r=new Set;for(i.forEach(function(o){r.add(o)});r.size>0;){var u=r;r=new Set,u.forEach(function(o){if(!a.has(o)){a.add(o);var s=Gn[o]||new Set;s.forEach(function(l){r.add(l)})}})}return a.forEach(function(o){var s=Zt(e,o);s&&t.definitions.push(s)}),t}tr(Se,"RenameBankAccount");var Te={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"DeleteBankAccount"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"accountId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"deletePayableAccount"},arguments:[{kind:"Argument",name:{kind:"Name",value:"accountId"},value:{kind:"Variable",name:{kind:"Name",value:"accountId"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"BankAccountFragment"},directives:[]}]}}]}}],loc:{start:0,end:189}};Te.loc.source={body:`#import "../queries/bankAccountFragment.graphql"
|
|
115
115
|
|
|
116
116
|
mutation DeleteBankAccount($accountId: String!) {
|
|
117
117
|
deletePayableAccount(accountId: $accountId) {
|
|
118
118
|
...BankAccountFragment
|
|
119
119
|
}
|
|
120
120
|
}
|
|
121
|
-
`,name:"GraphQL request",locationOffset:{line:1,column:1}};var
|
|
121
|
+
`,name:"GraphQL request",locationOffset:{line:1,column:1}};var ei={};function ir(e){return e.filter(function(n){if(n.kind!=="FragmentDefinition")return!0;var t=n.name.value;return ei[t]?!1:(ei[t]=!0,!0)})}Te.definitions=Te.definitions.concat(ir(ke.definitions));function cn(e,n){if(e.kind==="FragmentSpread")n.add(e.name.value);else if(e.kind==="VariableDefinition"){var t=e.type;t.kind==="NamedType"&&n.add(t.name.value)}e.selectionSet&&e.selectionSet.selections.forEach(function(i){cn(i,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(i){cn(i,n)}),e.definitions&&e.definitions.forEach(function(i){cn(i,n)})}var $n={};(function(){Te.definitions.forEach(function(n){if(n.name){var t=new Set;cn(n,t),$n[n.name.value]=t}})})();function ni(e,n){for(var t=0;t<e.definitions.length;t++){var i=e.definitions[t];if(i.name&&i.name.value==n)return i}}function ar(e,n){var t={kind:e.kind,definitions:[ni(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var i=$n[n]||new Set,a=new Set,r=new Set;for(i.forEach(function(o){r.add(o)});r.size>0;){var u=r;r=new Set,u.forEach(function(o){if(!a.has(o)){a.add(o);var s=$n[o]||new Set;s.forEach(function(l){r.add(l)})}})}return a.forEach(function(o){var s=ni(e,o);s&&t.definitions.push(s)}),t}ar(Te,"DeleteBankAccount");var Ne={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"UserBankAccounts"},variableDefinitions:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"userBankAccounts"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"BankAccountFragment"},directives:[]}]}}]}}],loc:{start:0,end:128}};Ne.loc.source={body:`#import "./bankAccountFragment.graphql"
|
|
122
122
|
|
|
123
123
|
query UserBankAccounts {
|
|
124
124
|
userBankAccounts {
|
|
125
125
|
...BankAccountFragment
|
|
126
126
|
}
|
|
127
127
|
}
|
|
128
|
-
`,name:"GraphQL request",locationOffset:{line:1,column:1}};var
|
|
128
|
+
`,name:"GraphQL request",locationOffset:{line:1,column:1}};var ti={};function rr(e){return e.filter(function(n){if(n.kind!=="FragmentDefinition")return!0;var t=n.name.value;return ti[t]?!1:(ti[t]=!0,!0)})}Ne.definitions=Ne.definitions.concat(rr(ke.definitions));function ln(e,n){if(e.kind==="FragmentSpread")n.add(e.name.value);else if(e.kind==="VariableDefinition"){var t=e.type;t.kind==="NamedType"&&n.add(t.name.value)}e.selectionSet&&e.selectionSet.selections.forEach(function(i){ln(i,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(i){ln(i,n)}),e.definitions&&e.definitions.forEach(function(i){ln(i,n)})}var Qn={};(function(){Ne.definitions.forEach(function(n){if(n.name){var t=new Set;ln(n,t),Qn[n.name.value]=t}})})();function ii(e,n){for(var t=0;t<e.definitions.length;t++){var i=e.definitions[t];if(i.name&&i.name.value==n)return i}}function or(e,n){var t={kind:e.kind,definitions:[ii(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var i=Qn[n]||new Set,a=new Set,r=new Set;for(i.forEach(function(o){r.add(o)});r.size>0;){var u=r;r=new Set,u.forEach(function(o){if(!a.has(o)){a.add(o);var s=Qn[o]||new Set;s.forEach(function(l){r.add(l)})}})}return a.forEach(function(o){var s=ii(e,o);s&&t.definitions.push(s)}),t}or(Ne,"UserBankAccounts");var Jn=(e=>(e.CHECKBOOK="CHECKBOOK",e.METHOD_FI="METHOD_FI",e))(Jn||{}),ai=(e=>(e.Business="Business",e.Checking="Checking",e.Savings="Savings",e))(ai||{}),Hn=(e=>(e.USBankAccount="USBankAccount",e))(Hn||{}),ri=(e=>(e.COMPLETED="COMPLETED",e.CONFIRMED="CONFIRMED",e.CREATED="CREATED",e.FAILED="FAILED",e.PENDING="PENDING",e.REFUNDED="REFUNDED",e.TRANSACTION_FAILED="TRANSACTION_FAILED",e.TRANSACTION_PENDING="TRANSACTION_PENDING",e))(ri||{}),oi=(e=>(e.ACTIVE="ACTIVE",e.FAILED="FAILED",e.INITIALIZED="INITIALIZED",e.LOADING="LOADING",e.UNAVAILABLE="UNAVAILABLE",e.UNINITIALIZED="UNINITIALIZED",e))(oi||{}),si=(e=>(e.BankAccount="BankAccount",e.Bill="Bill",e.DebitCard="DebitCard",e))(si||{}),ui=(e=>(e.CANCELLED="CANCELLED",e.COMPLETED="COMPLETED",e.FAILED="FAILED",e.INITIALIZED="INITIALIZED",e.PENDING="PENDING",e.REFUNDED="REFUNDED",e.REVERSAL_IN_PROGRESS="REVERSAL_IN_PROGRESS",e.REVERSED="REVERSED",e.SCHEDULED="SCHEDULED",e.SENT="SENT",e))(ui||{});const sr={[Hn.USBankAccount]:e=>({query:ge,variables:{createUSAccountInput:e},response:"createUSBankAccount"})},ur=(e,n)=>sr[e]?.(n)??null;class cr{client;constructor(n){this.client=n}async list(){return(await this.client.query({query:Ne}))?.userBankAccounts??null}async rename(n,t){return(await this.client.query({query:Se,variables:{accountId:n,name:t}}))?.renamePayableAccount??null}async delete(n){return(await this.client.query({query:Te,variables:{accountId:n}}))?.deletePayableAccount??null}async create(n,t){const i=ur(n,t);if(!i)throw new Error("Invalid bank account type");return(await this.client.query({query:i.query,variables:i.variables}))?.[i.response]??null}}var Ve={kind:"Document",definitions:[{kind:"FragmentDefinition",name:{kind:"Name",value:"PaymentFragment"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"Payment"}},directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"userId"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"status"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"accountId"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"amount"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"feeAmount"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"createdAt"},arguments:[],directives:[]}]}}],loc:{start:0,end:122}};Ve.loc.source={body:`fragment PaymentFragment on Payment {
|
|
129
129
|
id
|
|
130
130
|
userId
|
|
131
131
|
status
|
|
@@ -134,21 +134,21 @@ query UserBankAccounts {
|
|
|
134
134
|
feeAmount
|
|
135
135
|
createdAt
|
|
136
136
|
}
|
|
137
|
-
`,name:"GraphQL request",locationOffset:{line:1,column:1}};function fn(e,n){if(e.kind==="FragmentSpread")n.add(e.name.value);else if(e.kind==="VariableDefinition"){var t=e.type;t.kind==="NamedType"&&n.add(t.name.value)}e.selectionSet&&e.selectionSet.selections.forEach(function(i){fn(i,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(i){fn(i,n)}),e.definitions&&e.definitions.forEach(function(i){fn(i,n)})}var
|
|
137
|
+
`,name:"GraphQL request",locationOffset:{line:1,column:1}};function fn(e,n){if(e.kind==="FragmentSpread")n.add(e.name.value);else if(e.kind==="VariableDefinition"){var t=e.type;t.kind==="NamedType"&&n.add(t.name.value)}e.selectionSet&&e.selectionSet.selections.forEach(function(i){fn(i,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(i){fn(i,n)}),e.definitions&&e.definitions.forEach(function(i){fn(i,n)})}var zn={};(function(){Ve.definitions.forEach(function(n){if(n.name){var t=new Set;fn(n,t),zn[n.name.value]=t}})})();function ci(e,n){for(var t=0;t<e.definitions.length;t++){var i=e.definitions[t];if(i.name&&i.name.value==n)return i}}function lr(e,n){var t={kind:e.kind,definitions:[ci(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var i=zn[n]||new Set,a=new Set,r=new Set;for(i.forEach(function(o){r.add(o)});r.size>0;){var u=r;r=new Set,u.forEach(function(o){if(!a.has(o)){a.add(o);var s=zn[o]||new Set;s.forEach(function(l){r.add(l)})}})}return a.forEach(function(o){var s=ci(e,o);s&&t.definitions.push(s)}),t}lr(Ve,"PaymentFragment");var be={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"PaymentRequestPayment"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"paymentRequestId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"paymentForPaymentRequest"},arguments:[{kind:"Argument",name:{kind:"Name",value:"paymentRequestId"},value:{kind:"Variable",name:{kind:"Name",value:"paymentRequestId"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"PaymentFragment"},directives:[]}]}}]}}],loc:{start:0,end:198}};be.loc.source={body:`#import "./paymentFragment.graphql"
|
|
138
138
|
|
|
139
139
|
query PaymentRequestPayment($paymentRequestId: String!) {
|
|
140
140
|
paymentForPaymentRequest(paymentRequestId: $paymentRequestId) {
|
|
141
141
|
...PaymentFragment
|
|
142
142
|
}
|
|
143
143
|
}
|
|
144
|
-
`,name:"GraphQL request",locationOffset:{line:1,column:1}};var
|
|
144
|
+
`,name:"GraphQL request",locationOffset:{line:1,column:1}};var li={};function fr(e){return e.filter(function(n){if(n.kind!=="FragmentDefinition")return!0;var t=n.name.value;return li[t]?!1:(li[t]=!0,!0)})}be.definitions=be.definitions.concat(fr(Ve.definitions));function dn(e,n){if(e.kind==="FragmentSpread")n.add(e.name.value);else if(e.kind==="VariableDefinition"){var t=e.type;t.kind==="NamedType"&&n.add(t.name.value)}e.selectionSet&&e.selectionSet.selections.forEach(function(i){dn(i,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(i){dn(i,n)}),e.definitions&&e.definitions.forEach(function(i){dn(i,n)})}var Yn={};(function(){be.definitions.forEach(function(n){if(n.name){var t=new Set;dn(n,t),Yn[n.name.value]=t}})})();function fi(e,n){for(var t=0;t<e.definitions.length;t++){var i=e.definitions[t];if(i.name&&i.name.value==n)return i}}function dr(e,n){var t={kind:e.kind,definitions:[fi(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var i=Yn[n]||new Set,a=new Set,r=new Set;for(i.forEach(function(o){r.add(o)});r.size>0;){var u=r;r=new Set,u.forEach(function(o){if(!a.has(o)){a.add(o);var s=Yn[o]||new Set;s.forEach(function(l){r.add(l)})}})}return a.forEach(function(o){var s=fi(e,o);s&&t.definitions.push(s)}),t}dr(be,"PaymentRequestPayment");var Ee={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"AccountPayments"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"accountId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"paymentsForAccount"},arguments:[{kind:"Argument",name:{kind:"Name",value:"accountId"},value:{kind:"Variable",name:{kind:"Name",value:"accountId"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"PaymentFragment"},directives:[]}]}}]}}],loc:{start:0,end:165}};Ee.loc.source={body:`#import "./paymentFragment.graphql"
|
|
145
145
|
|
|
146
146
|
query AccountPayments($accountId: String!) {
|
|
147
147
|
paymentsForAccount(accountId: $accountId) {
|
|
148
148
|
...PaymentFragment
|
|
149
149
|
}
|
|
150
150
|
}
|
|
151
|
-
`,name:"GraphQL request",locationOffset:{line:1,column:1}};var
|
|
151
|
+
`,name:"GraphQL request",locationOffset:{line:1,column:1}};var di={};function vr(e){return e.filter(function(n){if(n.kind!=="FragmentDefinition")return!0;var t=n.name.value;return di[t]?!1:(di[t]=!0,!0)})}Ee.definitions=Ee.definitions.concat(vr(Ve.definitions));function vn(e,n){if(e.kind==="FragmentSpread")n.add(e.name.value);else if(e.kind==="VariableDefinition"){var t=e.type;t.kind==="NamedType"&&n.add(t.name.value)}e.selectionSet&&e.selectionSet.selections.forEach(function(i){vn(i,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(i){vn(i,n)}),e.definitions&&e.definitions.forEach(function(i){vn(i,n)})}var Kn={};(function(){Ee.definitions.forEach(function(n){if(n.name){var t=new Set;vn(n,t),Kn[n.name.value]=t}})})();function vi(e,n){for(var t=0;t<e.definitions.length;t++){var i=e.definitions[t];if(i.name&&i.name.value==n)return i}}function pr(e,n){var t={kind:e.kind,definitions:[vi(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var i=Kn[n]||new Set,a=new Set,r=new Set;for(i.forEach(function(o){r.add(o)});r.size>0;){var u=r;r=new Set,u.forEach(function(o){if(!a.has(o)){a.add(o);var s=Kn[o]||new Set;s.forEach(function(l){r.add(l)})}})}return a.forEach(function(o){var s=vi(e,o);s&&t.definitions.push(s)}),t}pr(Ee,"AccountPayments");class mr{client;constructor(n){this.client=n}async listForAccount(n){return(await this.client.query({query:Ee,variables:{accountId:n}}))?.paymentsForAccount??[]}async getForPaymentRequest(n){return(await this.client.query({query:be,variables:{paymentRequestId:n}}))?.paymentForPaymentRequest??null}}var pn={kind:"Document",definitions:[{kind:"FragmentDefinition",name:{kind:"Name",value:"PaymentRequestFragment"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"DirectPayment"}},directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"userId"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"accountId"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"status"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"amount"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"feeAmount"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"amountDue"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"network"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"createdAt"},arguments:[],directives:[]}]}}],loc:{start:0,end:161}};pn.loc.source={body:`fragment PaymentRequestFragment on DirectPayment {
|
|
152
152
|
id
|
|
153
153
|
userId
|
|
154
154
|
accountId
|
|
@@ -159,14 +159,14 @@ query AccountPayments($accountId: String!) {
|
|
|
159
159
|
network
|
|
160
160
|
createdAt
|
|
161
161
|
}
|
|
162
|
-
`,name:"GraphQL request",locationOffset:{line:1,column:1}};function mn(e,n){if(e.kind==="FragmentSpread")n.add(e.name.value);else if(e.kind==="VariableDefinition"){var t=e.type;t.kind==="NamedType"&&n.add(t.name.value)}e.selectionSet&&e.selectionSet.selections.forEach(function(i){mn(i,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(i){mn(i,n)}),e.definitions&&e.definitions.forEach(function(i){mn(i,n)})}var Xn={};(function(){pn.definitions.forEach(function(n){if(n.name){var t=new Set;mn(n,t),Xn[n.name.value]=t}})})();function
|
|
162
|
+
`,name:"GraphQL request",locationOffset:{line:1,column:1}};function mn(e,n){if(e.kind==="FragmentSpread")n.add(e.name.value);else if(e.kind==="VariableDefinition"){var t=e.type;t.kind==="NamedType"&&n.add(t.name.value)}e.selectionSet&&e.selectionSet.selections.forEach(function(i){mn(i,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(i){mn(i,n)}),e.definitions&&e.definitions.forEach(function(i){mn(i,n)})}var Xn={};(function(){pn.definitions.forEach(function(n){if(n.name){var t=new Set;mn(n,t),Xn[n.name.value]=t}})})();function pi(e,n){for(var t=0;t<e.definitions.length;t++){var i=e.definitions[t];if(i.name&&i.name.value==n)return i}}function hr(e,n){var t={kind:e.kind,definitions:[pi(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var i=Xn[n]||new Set,a=new Set,r=new Set;for(i.forEach(function(o){r.add(o)});r.size>0;){var u=r;r=new Set,u.forEach(function(o){if(!a.has(o)){a.add(o);var s=Xn[o]||new Set;s.forEach(function(l){r.add(l)})}})}return a.forEach(function(o){var s=pi(e,o);s&&t.definitions.push(s)}),t}hr(pn,"PaymentRequestFragment");var le={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"CreatePaymentRequest"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"createDirectPaymentInput"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"CreateDirectPaymentInput"}}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"createDirectPayment"},arguments:[{kind:"Argument",name:{kind:"Name",value:"createDirectPaymentInput"},value:{kind:"Variable",name:{kind:"Name",value:"createDirectPaymentInput"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"PaymentRequestFragment"},directives:[]}]}}]}}],loc:{start:0,end:260}};le.loc.source={body:`#import "../queries/paymentRequestFragment.graphql"
|
|
163
163
|
|
|
164
164
|
mutation CreatePaymentRequest($createDirectPaymentInput: CreateDirectPaymentInput!) {
|
|
165
165
|
createDirectPayment(createDirectPaymentInput: $createDirectPaymentInput) {
|
|
166
166
|
...PaymentRequestFragment
|
|
167
167
|
}
|
|
168
168
|
}
|
|
169
|
-
`,name:"GraphQL request",locationOffset:{line:1,column:1}};var
|
|
169
|
+
`,name:"GraphQL request",locationOffset:{line:1,column:1}};var mi={};function yr(e){return e.filter(function(n){if(n.kind!=="FragmentDefinition")return!0;var t=n.name.value;return mi[t]?!1:(mi[t]=!0,!0)})}le.definitions=le.definitions.concat(yr(pn.definitions));function hn(e,n){if(e.kind==="FragmentSpread")n.add(e.name.value);else if(e.kind==="VariableDefinition"){var t=e.type;t.kind==="NamedType"&&n.add(t.name.value)}e.selectionSet&&e.selectionSet.selections.forEach(function(i){hn(i,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(i){hn(i,n)}),e.definitions&&e.definitions.forEach(function(i){hn(i,n)})}var Wn={};(function(){le.definitions.forEach(function(n){if(n.name){var t=new Set;hn(n,t),Wn[n.name.value]=t}})})();function hi(e,n){for(var t=0;t<e.definitions.length;t++){var i=e.definitions[t];if(i.name&&i.name.value==n)return i}}function gr(e,n){var t={kind:e.kind,definitions:[hi(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var i=Wn[n]||new Set,a=new Set,r=new Set;for(i.forEach(function(o){r.add(o)});r.size>0;){var u=r;r=new Set,u.forEach(function(o){if(!a.has(o)){a.add(o);var s=Wn[o]||new Set;s.forEach(function(l){r.add(l)})}})}return a.forEach(function(o){var s=hi(e,o);s&&t.definitions.push(s)}),t}gr(le,"CreatePaymentRequest");var yn={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"GetSpritzPayParams"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"tokenAddress"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"amount"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"Float"}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"reference"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"network"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"spritzPayParams"},arguments:[{kind:"Argument",name:{kind:"Name",value:"tokenAddress"},value:{kind:"Variable",name:{kind:"Name",value:"tokenAddress"}}},{kind:"Argument",name:{kind:"Name",value:"amount"},value:{kind:"Variable",name:{kind:"Name",value:"amount"}}},{kind:"Argument",name:{kind:"Name",value:"reference"},value:{kind:"Variable",name:{kind:"Name",value:"reference"}}},{kind:"Argument",name:{kind:"Name",value:"network"},value:{kind:"Variable",name:{kind:"Name",value:"network"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"contractAddress"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"method"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"calldata"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"value"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"requiredTokenInput"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"suggestedGasLimit"},arguments:[],directives:[]}]}}]}}],loc:{start:0,end:399}};yn.loc.source={body:`query GetSpritzPayParams(
|
|
170
170
|
$tokenAddress: String!
|
|
171
171
|
$amount: Float!
|
|
172
172
|
$reference: String!
|
|
@@ -186,11 +186,11 @@ mutation CreatePaymentRequest($createDirectPaymentInput: CreateDirectPaymentInpu
|
|
|
186
186
|
suggestedGasLimit
|
|
187
187
|
}
|
|
188
188
|
}
|
|
189
|
-
`,name:"GraphQL request",locationOffset:{line:1,column:1}};function gn(e,n){if(e.kind==="FragmentSpread")n.add(e.name.value);else if(e.kind==="VariableDefinition"){var t=e.type;t.kind==="NamedType"&&n.add(t.name.value)}e.selectionSet&&e.selectionSet.selections.forEach(function(i){gn(i,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(i){gn(i,n)}),e.definitions&&e.definitions.forEach(function(i){gn(i,n)})}var
|
|
189
|
+
`,name:"GraphQL request",locationOffset:{line:1,column:1}};function gn(e,n){if(e.kind==="FragmentSpread")n.add(e.name.value);else if(e.kind==="VariableDefinition"){var t=e.type;t.kind==="NamedType"&&n.add(t.name.value)}e.selectionSet&&e.selectionSet.selections.forEach(function(i){gn(i,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(i){gn(i,n)}),e.definitions&&e.definitions.forEach(function(i){gn(i,n)})}var Zn={};(function(){yn.definitions.forEach(function(n){if(n.name){var t=new Set;gn(n,t),Zn[n.name.value]=t}})})();function yi(e,n){for(var t=0;t<e.definitions.length;t++){var i=e.definitions[t];if(i.name&&i.name.value==n)return i}}function kr(e,n){var t={kind:e.kind,definitions:[yi(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var i=Zn[n]||new Set,a=new Set,r=new Set;for(i.forEach(function(o){r.add(o)});r.size>0;){var u=r;r=new Set,u.forEach(function(o){if(!a.has(o)){a.add(o);var s=Zn[o]||new Set;s.forEach(function(l){r.add(l)})}})}return a.forEach(function(o){var s=yi(e,o);s&&t.definitions.push(s)}),t}kr(yn,"GetSpritzPayParams");var gi=Z({"node_modules/@noble/hashes/_assert.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.output=e.exists=e.hash=e.bytes=e.bool=e.number=void 0;function n(s){if(!Number.isSafeInteger(s)||s<0)throw new Error(`Wrong positive integer: ${s}`)}e.number=n;function t(s){if(typeof s!="boolean")throw new Error(`Expected boolean, not ${s}`)}e.bool=t;function i(s,...l){if(!(s instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(l.length>0&&!l.includes(s.length))throw new TypeError(`Expected Uint8Array of length ${l}, not of length=${s.length}`)}e.bytes=i;function a(s){if(typeof s!="function"||typeof s.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");n(s.outputLen),n(s.blockLen)}e.hash=a;function r(s,l=!0){if(s.destroyed)throw new Error("Hash instance has been destroyed");if(l&&s.finished)throw new Error("Hash#digest() has already been called")}e.exists=r;function u(s,l){i(s);const g=l.outputLen;if(s.length<g)throw new Error(`digestInto() expects output buffer of length at least ${g}`)}e.output=u;var o={number:n,bool:t,bytes:i,hash:a,exists:r,output:u};e.default=o}}),Sr=Z({"node_modules/@noble/hashes/crypto.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.crypto=void 0,e.crypto=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0}}),et=Z({"node_modules/@noble/hashes/utils.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.randomBytes=e.wrapConstructorWithOpts=e.wrapConstructor=e.checkOpts=e.Hash=e.concatBytes=e.toBytes=e.utf8ToBytes=e.asyncLoop=e.nextTick=e.hexToBytes=e.bytesToHex=e.isLE=e.rotr=e.createView=e.u32=e.u8=void 0;var n=Sr(),t=f=>new Uint8Array(f.buffer,f.byteOffset,f.byteLength);e.u8=t;var i=f=>new Uint32Array(f.buffer,f.byteOffset,Math.floor(f.byteLength/4));e.u32=i;var a=f=>new DataView(f.buffer,f.byteOffset,f.byteLength);e.createView=a;var r=(f,c)=>f<<32-c|f>>>c;if(e.rotr=r,e.isLE=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68,!e.isLE)throw new Error("Non little-endian hardware is not supported");var u=Array.from({length:256},(f,c)=>c.toString(16).padStart(2,"0"));function o(f){if(!(f instanceof Uint8Array))throw new Error("Uint8Array expected");let c="";for(let S=0;S<f.length;S++)c+=u[f[S]];return c}e.bytesToHex=o;function s(f){if(typeof f!="string")throw new TypeError("hexToBytes: expected string, got "+typeof f);if(f.length%2)throw new Error("hexToBytes: received invalid unpadded hex");const c=new Uint8Array(f.length/2);for(let S=0;S<c.length;S++){const v=S*2,b=f.slice(v,v+2),A=Number.parseInt(b,16);if(Number.isNaN(A)||A<0)throw new Error("Invalid byte sequence");c[S]=A}return c}e.hexToBytes=s;var l=async()=>{};e.nextTick=l;async function g(f,c,S){let v=Date.now();for(let b=0;b<f;b++){S(b);const A=Date.now()-v;A>=0&&A<c||(await(0,e.nextTick)(),v+=A)}}e.asyncLoop=g;function E(f){if(typeof f!="string")throw new TypeError(`utf8ToBytes expected string, got ${typeof f}`);return new TextEncoder().encode(f)}e.utf8ToBytes=E;function y(f){if(typeof f=="string"&&(f=E(f)),!(f instanceof Uint8Array))throw new TypeError(`Expected input type is Uint8Array (got ${typeof f})`);return f}e.toBytes=y;function d(...f){if(!f.every(v=>v instanceof Uint8Array))throw new Error("Uint8Array list expected");if(f.length===1)return f[0];const c=f.reduce((v,b)=>v+b.length,0),S=new Uint8Array(c);for(let v=0,b=0;v<f.length;v++){const A=f[v];S.set(A,b),b+=A.length}return S}e.concatBytes=d;var N=class{clone(){return this._cloneInto()}};e.Hash=N;var w=f=>Object.prototype.toString.call(f)==="[object Object]"&&f.constructor===Object;function O(f,c){if(c!==void 0&&(typeof c!="object"||!w(c)))throw new TypeError("Options should be object or undefined");return Object.assign(f,c)}e.checkOpts=O;function D(f){const c=v=>f().update(y(v)).digest(),S=f();return c.outputLen=S.outputLen,c.blockLen=S.blockLen,c.create=()=>f(),c}e.wrapConstructor=D;function P(f){const c=(v,b)=>f(b).update(y(v)).digest(),S=f({});return c.outputLen=S.outputLen,c.blockLen=S.blockLen,c.create=v=>f(v),c}e.wrapConstructorWithOpts=P;function L(f=32){if(n.crypto&&typeof n.crypto.getRandomValues=="function")return n.crypto.getRandomValues(new Uint8Array(f));throw new Error("crypto.getRandomValues must be defined")}e.randomBytes=L}}),ki=Z({"node_modules/ethereum-cryptography/utils.js"(e,n){var t=e&&e.__importDefault||function(y){return y&&y.__esModule?y:{default:y}};Object.defineProperty(e,"__esModule",{value:!0}),e.crypto=e.wrapHash=e.equalsBytes=e.hexToBytes=e.bytesToUtf8=e.utf8ToBytes=e.createView=e.concatBytes=e.toHex=e.bytesToHex=e.assertBytes=e.assertBool=void 0;var i=t(gi()),a=et(),r=i.default.bool;e.assertBool=r;var u=i.default.bytes;e.assertBytes=u;var o=et();Object.defineProperty(e,"bytesToHex",{enumerable:!0,get:function(){return o.bytesToHex}}),Object.defineProperty(e,"toHex",{enumerable:!0,get:function(){return o.bytesToHex}}),Object.defineProperty(e,"concatBytes",{enumerable:!0,get:function(){return o.concatBytes}}),Object.defineProperty(e,"createView",{enumerable:!0,get:function(){return o.createView}}),Object.defineProperty(e,"utf8ToBytes",{enumerable:!0,get:function(){return o.utf8ToBytes}});function s(y){if(!(y instanceof Uint8Array))throw new TypeError(`bytesToUtf8 expected Uint8Array, got ${typeof y}`);return new TextDecoder().decode(y)}e.bytesToUtf8=s;function l(y){const d=y.startsWith("0x")?y.substring(2):y;return(0,a.hexToBytes)(d)}e.hexToBytes=l;function g(y,d){if(y.length!==d.length)return!1;for(let N=0;N<y.length;N++)if(y[N]!==d[N])return!1;return!0}e.equalsBytes=g;function E(y){return d=>(i.default.bytes(d),y(d))}e.wrapHash=E,e.crypto=(()=>{const y=typeof self=="object"&&"crypto"in self?self.crypto:void 0,d=typeof n<"u"&&typeof n.require=="function"&&n.require.bind(n);return{node:d&&!y?d("crypto"):void 0,web:y}})()}});/*! Bundled license information:
|
|
190
190
|
|
|
191
191
|
@noble/hashes/utils.js:
|
|
192
192
|
(*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) *)
|
|
193
|
-
*/var
|
|
193
|
+
*/var Tr=Z({"node_modules/@noble/hashes/_u64.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.add=e.toBig=e.split=e.fromBig=void 0;var n=BigInt(2**32-1),t=BigInt(32);function i(m,p=!1){return p?{h:Number(m&n),l:Number(m>>t&n)}:{h:Number(m>>t&n)|0,l:Number(m&n)|0}}e.fromBig=i;function a(m,p=!1){let T=new Uint32Array(m.length),M=new Uint32Array(m.length);for(let x=0;x<m.length;x++){const{h:J,l:En}=i(m[x],p);[T[x],M[x]]=[J,En]}return[T,M]}e.split=a;var r=(m,p)=>BigInt(m>>>0)<<t|BigInt(p>>>0);e.toBig=r;var u=(m,p,T)=>m>>>T,o=(m,p,T)=>m<<32-T|p>>>T,s=(m,p,T)=>m>>>T|p<<32-T,l=(m,p,T)=>m<<32-T|p>>>T,g=(m,p,T)=>m<<64-T|p>>>T-32,E=(m,p,T)=>m>>>T-32|p<<64-T,y=(m,p)=>p,d=(m,p)=>m,N=(m,p,T)=>m<<T|p>>>32-T,w=(m,p,T)=>p<<T|m>>>32-T,O=(m,p,T)=>p<<T-32|m>>>64-T,D=(m,p,T)=>m<<T-32|p>>>64-T;function P(m,p,T,M){const x=(p>>>0)+(M>>>0);return{h:m+T+(x/2**32|0)|0,l:x|0}}e.add=P;var L=(m,p,T)=>(m>>>0)+(p>>>0)+(T>>>0),f=(m,p,T,M)=>p+T+M+(m/2**32|0)|0,c=(m,p,T,M)=>(m>>>0)+(p>>>0)+(T>>>0)+(M>>>0),S=(m,p,T,M,x)=>p+T+M+x+(m/2**32|0)|0,v=(m,p,T,M,x)=>(m>>>0)+(p>>>0)+(T>>>0)+(M>>>0)+(x>>>0),b=(m,p,T,M,x,J)=>p+T+M+x+J+(m/2**32|0)|0,A={fromBig:i,split:a,toBig:e.toBig,shrSH:u,shrSL:o,rotrSH:s,rotrSL:l,rotrBH:g,rotrBL:E,rotr32H:y,rotr32L:d,rotlSH:N,rotlSL:w,rotlBH:O,rotlBL:D,add:P,add3L:L,add3H:f,add4L:c,add4H:S,add5H:b,add5L:v};e.default=A}}),Nr=Z({"node_modules/@noble/hashes/sha3.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.shake256=e.shake128=e.keccak_512=e.keccak_384=e.keccak_256=e.keccak_224=e.sha3_512=e.sha3_384=e.sha3_256=e.sha3_224=e.Keccak=e.keccakP=void 0;var n=gi(),t=Tr(),i=et(),[a,r,u]=[[],[],[]],o=BigInt(0),s=BigInt(1),l=BigInt(2),g=BigInt(7),E=BigInt(256),y=BigInt(113);for(let c=0,S=s,v=1,b=0;c<24;c++){[v,b]=[b,(2*v+3*b)%5],a.push(2*(5*b+v)),r.push((c+1)*(c+2)/2%64);let A=o;for(let m=0;m<7;m++)S=(S<<s^(S>>g)*y)%E,S&l&&(A^=s<<(s<<BigInt(m))-s);u.push(A)}var[d,N]=t.default.split(u,!0),w=(c,S,v)=>v>32?t.default.rotlBH(c,S,v):t.default.rotlSH(c,S,v),O=(c,S,v)=>v>32?t.default.rotlBL(c,S,v):t.default.rotlSL(c,S,v);function D(c,S=24){const v=new Uint32Array(10);for(let b=24-S;b<24;b++){for(let p=0;p<10;p++)v[p]=c[p]^c[p+10]^c[p+20]^c[p+30]^c[p+40];for(let p=0;p<10;p+=2){const T=(p+8)%10,M=(p+2)%10,x=v[M],J=v[M+1],En=w(x,J,1)^v[T],Ai=O(x,J,1)^v[T+1];for(let Me=0;Me<50;Me+=10)c[p+Me]^=En,c[p+Me+1]^=Ai}let A=c[2],m=c[3];for(let p=0;p<24;p++){const T=r[p],M=w(A,m,T),x=O(A,m,T),J=a[p];A=c[J],m=c[J+1],c[J]=M,c[J+1]=x}for(let p=0;p<50;p+=10){for(let T=0;T<10;T++)v[T]=c[p+T];for(let T=0;T<10;T++)c[p+T]^=~v[(T+2)%10]&v[(T+4)%10]}c[0]^=d[b],c[1]^=N[b]}v.fill(0)}e.keccakP=D;var P=class extends i.Hash{constructor(c,S,v,b=!1,A=24){if(super(),this.blockLen=c,this.suffix=S,this.outputLen=v,this.enableXOF=b,this.rounds=A,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,n.default.number(v),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=(0,i.u32)(this.state)}keccak(){D(this.state32,this.rounds),this.posOut=0,this.pos=0}update(c){n.default.exists(this);const{blockLen:S,state:v}=this;c=(0,i.toBytes)(c);const b=c.length;for(let A=0;A<b;){const m=Math.min(S-this.pos,b-A);for(let p=0;p<m;p++)v[this.pos++]^=c[A++];this.pos===S&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:c,suffix:S,pos:v,blockLen:b}=this;c[v]^=S,S&128&&v===b-1&&this.keccak(),c[b-1]^=128,this.keccak()}writeInto(c){n.default.exists(this,!1),n.default.bytes(c),this.finish();const S=this.state,{blockLen:v}=this;for(let b=0,A=c.length;b<A;){this.posOut>=v&&this.keccak();const m=Math.min(v-this.posOut,A-b);c.set(S.subarray(this.posOut,this.posOut+m),b),this.posOut+=m,b+=m}return c}xofInto(c){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(c)}xof(c){return n.default.number(c),this.xofInto(new Uint8Array(c))}digestInto(c){if(n.default.output(c,this),this.finished)throw new Error("digest() was already called");return this.writeInto(c),this.destroy(),c}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(c){const{blockLen:S,suffix:v,outputLen:b,rounds:A,enableXOF:m}=this;return c||(c=new P(S,v,b,m,A)),c.state32.set(this.state32),c.pos=this.pos,c.posOut=this.posOut,c.finished=this.finished,c.rounds=A,c.suffix=v,c.outputLen=b,c.enableXOF=m,c.destroyed=this.destroyed,c}};e.Keccak=P;var L=(c,S,v)=>(0,i.wrapConstructor)(()=>new P(S,c,v));e.sha3_224=L(6,144,224/8),e.sha3_256=L(6,136,256/8),e.sha3_384=L(6,104,384/8),e.sha3_512=L(6,72,512/8),e.keccak_224=L(1,144,224/8),e.keccak_256=L(1,136,256/8),e.keccak_384=L(1,104,384/8),e.keccak_512=L(1,72,512/8);var f=(c,S,v)=>(0,i.wrapConstructorWithOpts)((b={})=>new P(S,c,b.dkLen===void 0?v:b.dkLen,!0));e.shake128=f(31,168,128/8),e.shake256=f(31,136,256/8)}}),br=Z({"node_modules/ethereum-cryptography/keccak.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.keccak512=e.keccak384=e.keccak256=e.keccak224=void 0;var n=Nr(),t=ki();e.keccak224=(0,t.wrapHash)(n.keccak_224),e.keccak256=(()=>{const i=(0,t.wrapHash)(n.keccak_256);return i.create=n.keccak_256.create,i})(),e.keccak384=(0,t.wrapHash)(n.keccak_384),e.keccak512=(0,t.wrapHash)(n.keccak_512)}}),Er=Z({"optimize-deps:ethereum-cryptography/keccak"(e,n){n.exports=br()}}),Ir=Er(),wr=Z({"optimize-deps:ethereum-cryptography/utils"(e,n){n.exports=ki()}}),Ar=wr();function Dr(e){let n="0x";for(const t of e){const i=t.toString(16);n+=i.length===1?`0${i}`:i}return n}const Or=e=>{if(!/^(0x)?[0-9a-f]{40}$/i.test(e))return!1;const n=e.slice(2),t=Ar.utf8ToBytes(n.toLowerCase()),i=Dr(Ir.keccak256(t)).slice(2);for(let a=0;a<40;a+=1)if(parseInt(i[a],16)>7&&n[a].toUpperCase()!==n[a]||parseInt(i[a],16)<=7&&n[a].toLowerCase()!==n[a])return!1;return!0};function _r(e){return/^0x[0-9a-f]{40}$/i.test(e)?/^0x[0-9a-f]{40}$/.test(e)||/^(0x|0X)[0-9A-F]{40}$/.test(e)?!0:Or(e):!1}const nt=e=>Math.round((e+Number.EPSILON)*100)/100;class Fr{client;constructor(n){this.client=n}async create(n){return(await this.client.query({query:le,variables:{createDirectPaymentInput:{...n,amount:nt(n.amount),provider:Jn.CHECKBOOK}}}))?.createDirectPayment}async transactionPrice(n){return(await this.client.query({query:le,variables:{amount:nt(n)}}))?.transactionPrice??0}async getWeb3PaymentParams(n){if(!_r(n.paymentTokenAddress))throw new Error("Invalid token address");return(await this.client.query({query:yn,variables:{amount:nt(n.paymentRequest.amountDue),network:n.paymentRequest.network,tokenAddress:n.paymentTokenAddress,reference:n.paymentRequest.id}}))?.spritzPayParams}}var kn={kind:"Document",definitions:[{kind:"FragmentDefinition",name:{kind:"Name",value:"UserFragment"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"User"}},directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"sub"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"email"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"firstName"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"lastName"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"picture"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"phone"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"createdAt"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"timezone"},arguments:[],directives:[]}]}}],loc:{start:0,end:135}};kn.loc.source={body:`fragment UserFragment on User {
|
|
194
194
|
id
|
|
195
195
|
sub
|
|
196
196
|
email
|
|
@@ -201,14 +201,14 @@ mutation CreatePaymentRequest($createDirectPaymentInput: CreateDirectPaymentInpu
|
|
|
201
201
|
createdAt
|
|
202
202
|
timezone
|
|
203
203
|
}
|
|
204
|
-
`,name:"GraphQL request",locationOffset:{line:1,column:1}};function Sn(e,n){if(e.kind==="FragmentSpread")n.add(e.name.value);else if(e.kind==="VariableDefinition"){var t=e.type;t.kind==="NamedType"&&n.add(t.name.value)}e.selectionSet&&e.selectionSet.selections.forEach(function(i){Sn(i,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(i){Sn(i,n)}),e.definitions&&e.definitions.forEach(function(i){Sn(i,n)})}var
|
|
204
|
+
`,name:"GraphQL request",locationOffset:{line:1,column:1}};function Sn(e,n){if(e.kind==="FragmentSpread")n.add(e.name.value);else if(e.kind==="VariableDefinition"){var t=e.type;t.kind==="NamedType"&&n.add(t.name.value)}e.selectionSet&&e.selectionSet.selections.forEach(function(i){Sn(i,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(i){Sn(i,n)}),e.definitions&&e.definitions.forEach(function(i){Sn(i,n)})}var tt={};(function(){kn.definitions.forEach(function(n){if(n.name){var t=new Set;Sn(n,t),tt[n.name.value]=t}})})();function Si(e,n){for(var t=0;t<e.definitions.length;t++){var i=e.definitions[t];if(i.name&&i.name.value==n)return i}}function Lr(e,n){var t={kind:e.kind,definitions:[Si(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var i=tt[n]||new Set,a=new Set,r=new Set;for(i.forEach(function(o){r.add(o)});r.size>0;){var u=r;r=new Set,u.forEach(function(o){if(!a.has(o)){a.add(o);var s=tt[o]||new Set;s.forEach(function(l){r.add(l)})}})}return a.forEach(function(o){var s=Si(e,o);s&&t.definitions.push(s)}),t}Lr(kn,"UserFragment");var Ie={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"CurrentUser"},variableDefinitions:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"me"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"UserFragment"},directives:[]}]}}]}}],loc:{start:0,end:95}};Ie.loc.source={body:`#import "./userFragment.graphql"
|
|
205
205
|
|
|
206
206
|
query CurrentUser {
|
|
207
207
|
me {
|
|
208
208
|
...UserFragment
|
|
209
209
|
}
|
|
210
210
|
}
|
|
211
|
-
`,name:"GraphQL request",locationOffset:{line:1,column:1}};var
|
|
211
|
+
`,name:"GraphQL request",locationOffset:{line:1,column:1}};var Ti={};function Rr(e){return e.filter(function(n){if(n.kind!=="FragmentDefinition")return!0;var t=n.name.value;return Ti[t]?!1:(Ti[t]=!0,!0)})}Ie.definitions=Ie.definitions.concat(Rr(kn.definitions));function Tn(e,n){if(e.kind==="FragmentSpread")n.add(e.name.value);else if(e.kind==="VariableDefinition"){var t=e.type;t.kind==="NamedType"&&n.add(t.name.value)}e.selectionSet&&e.selectionSet.selections.forEach(function(i){Tn(i,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(i){Tn(i,n)}),e.definitions&&e.definitions.forEach(function(i){Tn(i,n)})}var it={};(function(){Ie.definitions.forEach(function(n){if(n.name){var t=new Set;Tn(n,t),it[n.name.value]=t}})})();function Ni(e,n){for(var t=0;t<e.definitions.length;t++){var i=e.definitions[t];if(i.name&&i.name.value==n)return i}}function Pr(e,n){var t={kind:e.kind,definitions:[Ni(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var i=it[n]||new Set,a=new Set,r=new Set;for(i.forEach(function(o){r.add(o)});r.size>0;){var u=r;r=new Set,u.forEach(function(o){if(!a.has(o)){a.add(o);var s=it[o]||new Set;s.forEach(function(l){r.add(l)})}})}return a.forEach(function(o){var s=Ni(e,o);s&&t.definitions.push(s)}),t}Pr(Ie,"CurrentUser");var Nn={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"UserVerification"},variableDefinitions:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"verification"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"userId"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"identity"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"status"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"country"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"verificationUrl"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"user"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"firstName"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"lastName"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"email"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"completedAt"},arguments:[],directives:[]}]}}]}}]}}]}}],loc:{start:0,end:297}};Nn.loc.source={body:`query UserVerification {
|
|
212
212
|
verification {
|
|
213
213
|
userId
|
|
214
214
|
identity {
|
|
@@ -224,5 +224,5 @@ query CurrentUser {
|
|
|
224
224
|
}
|
|
225
225
|
}
|
|
226
226
|
}
|
|
227
|
-
`,name:"GraphQL request",locationOffset:{line:1,column:1}};function bn(e,n){if(e.kind==="FragmentSpread")n.add(e.name.value);else if(e.kind==="VariableDefinition"){var t=e.type;t.kind==="NamedType"&&n.add(t.name.value)}e.selectionSet&&e.selectionSet.selections.forEach(function(i){bn(i,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(i){bn(i,n)}),e.definitions&&e.definitions.forEach(function(i){bn(i,n)})}var
|
|
227
|
+
`,name:"GraphQL request",locationOffset:{line:1,column:1}};function bn(e,n){if(e.kind==="FragmentSpread")n.add(e.name.value);else if(e.kind==="VariableDefinition"){var t=e.type;t.kind==="NamedType"&&n.add(t.name.value)}e.selectionSet&&e.selectionSet.selections.forEach(function(i){bn(i,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(i){bn(i,n)}),e.definitions&&e.definitions.forEach(function(i){bn(i,n)})}var at={};(function(){Nn.definitions.forEach(function(n){if(n.name){var t=new Set;bn(n,t),at[n.name.value]=t}})})();function bi(e,n){for(var t=0;t<e.definitions.length;t++){var i=e.definitions[t];if(i.name&&i.name.value==n)return i}}function Ur(e,n){var t={kind:e.kind,definitions:[bi(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var i=at[n]||new Set,a=new Set,r=new Set;for(i.forEach(function(o){r.add(o)});r.size>0;){var u=r;r=new Set,u.forEach(function(o){if(!a.has(o)){a.add(o);var s=at[o]||new Set;s.forEach(function(l){r.add(l)})}})}return a.forEach(function(o){var s=bi(e,o);s&&t.definitions.push(s)}),t}Ur(Nn,"UserVerification");class Br{client;constructor(n){this.client=n}async createUser(n){const{data:t}=await this.client.baseClient.post("/users/integration",{email:n});return t}async getCurrentUser(){return(await this.client.query({query:Ie}))?.me??null}async getUserVerification(){return(await this.client.query({query:Nn}))?.verification??null}}class rt{constructor(n,t,i){this.apiKey=n,this.integrationKey=t,this.environment=i}client;user;bankAccount;paymentRequest;payment;static initialize({environment:n,apiKey:t="",integrationKey:i=""}){const a=new rt(t,i,n);return a.init(),a}init(){this.client=new Ka(this.environment,this.apiKey,this.integrationKey),this.user=new Br(this.client),this.bankAccount=new cr(this.client),this.paymentRequest=new Fr(this.client),this.payment=new mr(this.client)}setApiKey(n){return this.apiKey=n,this.init(),this}}var Ei=(e=>(e.Staging="staging",e.Production="production",e))(Ei||{}),Ii=(e=>(e.Ethereum="ethereum",e.Polygon="polygon",e.Optimism="optimism",e.Arbitrum="arbitrum",e.Binance="binance-smart-chain",e.Avalanche="avalanche",e.Bitcoin="bitcoin",e.BitcoinTestnet="bitcoin-testnet",e.Dash="dash",e.DashTestnet="dash-testnet",e))(Ii||{});export{Jn as AccountProvider,ai as BankAccountSubType,Hn as BankAccountType,ri as DirectPaymentStatus,Ei as Environment,oi as ModuleStatus,si as PayableAccountType,Ii as PaymentNetwork,ui as PaymentStatus,rt as SpritzApiClient};
|
|
228
228
|
//# sourceMappingURL=spritz-api-client.mjs.map
|