@spritz-finance/api-client 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/spritz-api-client.d.ts +1 -1
- package/dist/spritz-api-client.js +32 -32
- package/dist/spritz-api-client.mjs +38 -38
- package/package.json +1 -1
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import _n from"axios";var
|
|
2
|
-
`),
|
|
3
|
-
`)}function Ge(e){return Array(e+1).join(" ")}function
|
|
1
|
+
import _n from"axios";var ji=Object.getOwnPropertyNames,Z=(e,n)=>function(){return n||(0,e[ji(e)[0]])((n={exports:{}}).exports,n),n.exports};function $e(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?$e=function(t){return typeof t}:$e=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},$e(e)}function oe(e){return $e(e)=="object"&&e!==null}var mt=typeof Symbol=="function"&&Symbol.iterator!=null?Symbol.iterator:"@@iterator",$=typeof Symbol=="function"&&Symbol.toStringTag!=null?Symbol.toStringTag:"@@toStringTag";function Rn(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 $i(e){return ht(e.source,Rn(e.source,e.start))}function ht(e,n){var t=e.locationOffset.column-1,i=Ge(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),f=s%80,N=[],w=0;w<E.length;w+=80)N.push(E.slice(w,w+80));return l+yt([["".concat(u),N[0]]].concat(N.slice(1,y+1).map(function(O){return["",O]}),[[" ",Ge(f-1)+"^"],["",N[y+1]]]))}return l+yt([["".concat(u-1),g[a-1]],["".concat(u),E],["",Ge(s-1)+"^"],["".concat(u+1),g[a+1]]])}function yt(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 Gi(t,a)+(r?" | "+r:" |")}).join(`
|
|
3
|
+
`)}function Ge(e){return Array(e+1).join(" ")}function Gi(e,n){return Ge(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 gt(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 Qi(e){for(var n=1;n<arguments.length;n++){var t=arguments[n]!=null?arguments[n]:{};n%2?gt(Object(t),!0).forEach(function(i){Ji(e,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):gt(Object(t)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(t,i))})}return e}function Ji(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function Hi(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}function kt(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&&kt(e.prototype,n),t&&kt(e,t),e}function Yi(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&&Fe(e,n)}function Ki(e){var n=bt();return function(){var i=Oe(e),a;if(n){var r=Oe(this).constructor;a=Reflect.construct(i,arguments,r)}else a=i.apply(this,arguments);return St(this,a)}}function St(e,n){return n&&(Qe(n)==="object"||typeof n=="function")?n:De(e)}function De(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Ln(e){var n=typeof Map=="function"?new Map:void 0;return Ln=function(i){if(i===null||!Xi(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,Oe(this).constructor)}return a.prototype=Object.create(i.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),Fe(a,i)},Ln(e)}function Je(e,n,t){return bt()?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&&Fe(l,u.prototype),l},Je.apply(null,arguments)}function bt(){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 Xi(e){return Function.toString.call(e).indexOf("[native code]")!==-1}function Fe(e,n){return Fe=Object.setPrototypeOf||function(i,a){return i.__proto__=a,i},Fe(e,n)}function Oe(e){return Oe=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},Oe(e)}var U=function(e){Yi(t,e);var n=Ki(t);function t(i,a,r,u,o,s,l){var g,E,y,f;Hi(this,t),f=n.call(this,i),f.name="GraphQLError",f.originalError=s??void 0,f.nodes=Nt(Array.isArray(a)?a:a?[a]:void 0);for(var N=[],w=0,O=(F=f.nodes)!==null&&F!==void 0?F:[];w<O.length;w++){var F,P=O[w],R=P.loc;R!=null&&N.push(R)}N=Nt(N),f.source=r??((g=N)===null||g===void 0?void 0:g[0].source),f.positions=u??((E=N)===null||E===void 0?void 0:E.map(function(c){return c.start})),f.locations=u&&r?u.map(function(c){return Rn(r,c)}):(y=N)===null||y===void 0?void 0:y.map(function(c){return Rn(c.source,c.start)}),f.path=o??void 0;var d=s?.extensions;return l==null&&oe(d)?f.extensions=Qi({},d):f.extensions=l??{},Object.defineProperties(De(f),{message:{enumerable:!0},locations:{enumerable:f.locations!=null},path:{enumerable:f.path!=null},extensions:{enumerable:f.extensions!=null&&Object.keys(f.extensions).length>0},name:{enumerable:!1},nodes:{enumerable:!1},source:{enumerable:!1},positions:{enumerable:!1},originalError:{enumerable:!1}}),s!=null&&s.stack?(Object.defineProperty(De(f),"stack",{value:s.stack,writable:!0,configurable:!0}),St(f)):(Error.captureStackTrace?Error.captureStackTrace(De(f),t):Object.defineProperty(De(f),"stack",{value:Error().stack,writable:!0,configurable:!0}),f)}return zi(t,[{key:"toString",value:function(){return Wi(this)}},{key:$,get:function(){return"Object"}}]),t}(Ln(Error));function Nt(e){return e===void 0||e.length===0?void 0:e}function Wi(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
|
+
`+$i(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
|
-
`+
|
|
7
|
+
`+ht(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 Ae(e,n){var t=!!e;if(!t)throw new Error(n??"Unexpected invariant triggered.")}var Zi=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):void 0,Pn=Zi;function H(e){var n=e.prototype.toJSON;typeof n=="function"||Ae(0),e.prototype.inspect=n,Pn&&(e.prototype[Pn]=n)}var ea=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(ea);var na=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(na);function Un(e){return e!=null&&typeof e.kind=="string"}function He(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?He=function(t){return typeof t}:He=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},He(e)}var ta=10,Tt=2;function _(e){return ze(e,[])}function ze(e,n){switch(He(e)){case"string":return JSON.stringify(e);case"function":return e.name?"[function ".concat(e.name,"]"):"[function]";case"object":return e===null?"null":ia(e,n);default:return String(e)}}function ia(e,n){if(n.indexOf(e)!==-1)return"[Circular]";var t=[].concat(n,[e]),i=oa(e);if(i!==void 0){var a=i.call(e);if(a!==e)return typeof a=="string"?a:ze(a,t)}else if(Array.isArray(e))return ra(e,t);return aa(e,t)}function aa(e,n){var t=Object.keys(e);if(t.length===0)return"{}";if(n.length>Tt)return"["+sa(e)+"]";var i=t.map(function(a){var r=ze(e[a],n);return a+": "+r});return"{ "+i.join(", ")+" }"}function ra(e,n){if(e.length===0)return"[]";if(n.length>Tt)return"[Array]";for(var t=Math.min(ta,e.length),i=e.length-t,a=[],r=0;r<t;++r)a.push(ze(e[r],n));return i===1?a.push("... 1 more item"):i>1&&a.push("... ".concat(i," more items")),"["+a.join(", ")+"]"}function oa(e){var n=e[String(Pn)];if(typeof n=="function")return n;if(typeof e.inspect=="function")return e.inspect}function sa(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 A(e,n){var t=!!e;if(!t)throw new Error(n)}function Ye(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Ye=function(t){return typeof t}:Ye=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ye(e)}var ee=function(n,t){if(n instanceof t)return!0;if(Ye(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=_(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
|
|
18
|
+
spurious results.`))}}return!1};function Et(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 ua(e,n,t){return n&&Et(e.prototype,n),t&&Et(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"||A(0,"Body must be a string. Received: ".concat(_(n),".")),this.body=n,this.name=t,this.locationOffset=i,this.locationOffset.line>0||A(0,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||A(0,"column in locationOffset is 1-indexed and must be positive.")}return ua(e,[{key:$,get:function(){return"Source"}}]),e})();var L=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 ca(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
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 la={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"]},da=Object.freeze({});function It(e,n){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:la,i=void 0,a=Array.isArray(e),r=[e],u=-1,o=[],s=void 0,l=void 0,g=void 0,E=[],y=[],f=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={},F=0,P=Object.keys(s);F<P.length;F++){var R=P[F];O[R]=s[R]}s=O}for(var d=0,c=0;c<o.length;c++){var S=o[c][0],v=o[c][1];a&&(S-=d),a&&v===null?(s.splice(S,1),d++):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]:f,s==null)continue;g&&E.push(l)}var T=void 0;if(!Array.isArray(s)){if(!Un(s))throw new Error("Invalid AST Node: ".concat(_(s),"."));var D=Vn(n,s.kind,N);if(D){if(T=D.call(n,s,l,g,E,y),T===da)break;if(T===!1){if(!N){E.pop();continue}}else if(T!==void 0&&(o.push([l,T]),!N))if(Un(T))s=T;else{E.pop();continue}}}if(T===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&&(f=o[o.length-1][1]),f}function Vn(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 fa=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}},wt=fa,va=Object.values||function(e){return Object.keys(e).map(function(n){return e[n]})},se=va,pa=Object.entries||function(e){return Object.keys(e).map(function(n){return[n,e[n]]})},_e=pa;function Dt(e,n){return e.reduce(function(t,i){return t[n(i)]=i,t},Object.create(null))}function Ke(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 Bn(e,n,t){return e.reduce(function(i,a){return i[n(a)]=t(a),i},Object.create(null))}var ma=5;function ha(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,ma),s=o.pop();return r+o.join(", ")+", or "+s+"?"}function Ft(e){return e}function ya(e,n){for(var t=0,i=0;t<e.length&&i<n.length;){var a=e.charCodeAt(t),r=n.charCodeAt(i);if(Xe(a)&&Xe(r)){var u=0;do++t,u=u*10+a-Cn,a=e.charCodeAt(t);while(Xe(a)&&u>0);var o=0;do++i,o=o*10+r-Cn,r=n.charCodeAt(i);while(Xe(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 Cn=48,ga=57;function Xe(e){return!isNaN(e)&&Cn<=e&&e<=ga}function ka(e,n){for(var t=Object.create(null),i=new Sa(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:ya(s,l)})}var Sa=function(){function e(t){this._input=t,this._inputLowerCase=t.toLowerCase(),this._inputArray=Ot(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=Ot(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 f=1;f<=l;f++){for(var N=E[(f-1)%3],w=E[f%3],O=w[0]=f,F=1;F<=g;F++){var P=u[f-1]===o[F-1]?0:1,R=Math.min(N[F]+1,w[F-1]+1,N[F-1]+P);if(f>1&&F>1&&u[f-1]===o[F-2]&&u[f-2]===o[F-1]){var d=E[(f-2)%3][F-2];R=Math.min(R,d+1)}R<O&&(O=R),w[F]=R}if(O>a)return}var c=E[l%3][g];return c<=a?c:void 0}},e}();function Ot(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 It(e,{leave:Na})}var ba=80,Na={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,a=V("(",
|
|
26
|
-
`,We(
|
|
25
|
+
`},OperationDefinition:function(n){var t=n.operation,i=n.name,a=V("(",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+V(" = ",a)+V(" ",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=V("",t,": ")+i,s=o+V("(",k(a,", "),")");return s.length>ba&&(s=o+V(`(
|
|
26
|
+
`,We(k(a,`
|
|
27
27
|
`)),`
|
|
28
|
-
)`)),
|
|
29
|
-
`,We(
|
|
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+V(" ",k(i," "))},InlineFragment:function(n){var t=n.typeCondition,i=n.directives,a=n.selectionSet;return k(["...",V("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(V("(",k(a,", "),")")," ")+"on ".concat(i," ").concat(V("",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?ca(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+V("(",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,V("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+(At(t)?V(`(
|
|
29
|
+
`,We(k(t,`
|
|
30
30
|
`)),`
|
|
31
|
-
)`):V("(",
|
|
32
|
-
`,We(
|
|
31
|
+
)`):V("(",k(t,", "),")"))+": "+i+V(" ",k(a," "))}),InputValueDefinition:z(function(e){var n=e.name,t=e.type,i=e.defaultValue,a=e.directives;return k([n+": "+t,V("= ",i),k(a," ")]," ")}),InterfaceTypeDefinition:z(function(e){var n=e.name,t=e.interfaces,i=e.directives,a=e.fields;return k(["interface",n,V("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+(At(t)?V(`(
|
|
32
|
+
`,We(k(t,`
|
|
33
33
|
`)),`
|
|
34
|
-
)`):V("(",
|
|
35
|
-
`)}}function
|
|
36
|
-
`,We(
|
|
34
|
+
)`):V("(",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,V("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,V("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
|
+
`)}}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 V(`{
|
|
36
|
+
`,We(k(e,`
|
|
37
37
|
`)),`
|
|
38
38
|
}`)}function V(e,n){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"";return n!=null&&n!==""?e+n+t:""}function We(e){return V(" ",e.replace(/\n/g,`
|
|
39
|
-
`))}function
|
|
40
|
-
`)!==-1}function Ft(e){return e!=null&&e.some(ga)}function Mn(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 Mn(t,n)});case h.OBJECT:return Bn(e.fields,function(t){return t.name.value},function(t){return Mn(t.value,n)});case h.VARIABLE:return n?.[e.name.value]}Ae(0,"Unexpected value node: "+_(e))}function Ot(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 de(e,n,t){return n&&Ot(e.prototype,n),t&&Ot(e,t),e}function At(e){return Re(e)||W(e)||G(e)||te(e)||ie(e)||ue(e)||Le(e)||fe(e)}function Sa(e){if(!At(e))throw new Error("Expected ".concat(_(e)," to be a GraphQL type."));return e}function Re(e){return ee(e,ce)}function W(e){return ee(e,ae)}function G(e){return ee(e,Ut)}function te(e){return ee(e,Vt)}function ie(e){return ee(e,nn)}function ue(e){return ee(e,Bt)}function Le(e){return ee(e,x)}function fe(e){return ee(e,I)}function ve(e){return Re(e)||ie(e)||ue(e)||qn(e)&&ve(e.ofType)}function Ze(e){return Re(e)||W(e)||G(e)||te(e)||ie(e)||qn(e)&&Ze(e.ofType)}function ba(e){return Re(e)||ie(e)}function xn(e){return W(e)||G(e)||te(e)}function Na(e){return G(e)||te(e)}function x(e){if(this instanceof x)this.ofType=Sa(e);else return new x(e)}x.prototype.toString=function(){return"["+String(this.ofType)+"]"},x.prototype.toJSON=function(){return this.toString()},Object.defineProperty(x.prototype,$,{get:function(){return"GraphQLList"}}),H(x);function I(e){if(this instanceof I)this.ofType=Ea(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,$,{get:function(){return"GraphQLNonNull"}}),H(I);function qn(e){return Le(e)||fe(e)}function Ta(e){return At(e)&&!fe(e)}function Ea(e){if(!Ta(e))throw new Error("Expected ".concat(_(e)," to be a GraphQL nullable type."));return e}function Ia(e){if(e)return fe(e)?e.ofType:e}function Pe(e){if(e){for(var n=e;qn(n);)n=n.ofType;return n}}function en(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:wt;this.name=t.name,this.description=t.description,this.specifiedByUrl=t.specifiedByUrl,this.serialize=(a=t.serialize)!==null&&a!==void 0?a:wt,this.parseValue=u,this.parseLiteral=(r=t.parseLiteral)!==null&&r!==void 0?r:function(o,s){return u(Mn(o,s))},this.extensions=t.extensions&&j(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=pe(t.extensionASTNodes),typeof t.name=="string"||A(0,"Must provide name."),t.specifiedByUrl==null||typeof t.specifiedByUrl=="string"||A(0,"".concat(this.name,' must provide "specifiedByUrl" as a string, ')+"but got: ".concat(_(t.specifiedByUrl),".")),t.serialize==null||typeof t.serialize=="function"||A(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"||A(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()},de(e,[{key:$,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=Rt.bind(void 0,t),this._interfaces=_t.bind(void 0,t),typeof t.name=="string"||A(0,"Must provide name."),t.isTypeOf==null||typeof t.isTypeOf=="function"||A(0,"".concat(this.name,' must provide "isTypeOf" as a function, ')+"but got: ".concat(_(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:Lt(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()},de(e,[{key:$,get:function(){return"GraphQLObjectType"}}]),e}();H(ae);function _t(e){var n,t=(n=en(e.interfaces))!==null&&n!==void 0?n:[];return Array.isArray(t)||A(0,"".concat(e.name," interfaces must be an Array or a function which returns an Array.")),t}function Rt(e){var n=en(e.fields);return me(n)||A(0,"".concat(e.name," fields must be an object with field names as keys or a function which returns such an object.")),Ke(n,function(t,i){var a;me(t)||A(0,"".concat(e.name,".").concat(i," field config must be an object.")),!("isDeprecated"in t)||A(0,"".concat(e.name,".").concat(i,' should provide "deprecationReason" instead of "isDeprecated".')),t.resolve==null||typeof t.resolve=="function"||A(0,"".concat(e.name,".").concat(i," field resolver must be a function if ")+"provided, but got: ".concat(_(t.resolve),"."));var r=(a=t.args)!==null&&a!==void 0?a:{};me(r)||A(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 Lt(e){return Ke(e,function(n){return{description:n.description,type:n.type,args:Pt(n.args),resolve:n.resolve,subscribe:n.subscribe,deprecationReason:n.deprecationReason,extensions:n.extensions,astNode:n.astNode}})}function Pt(e){return Bn(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 Ut=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=Rt.bind(void 0,t),this._interfaces=_t.bind(void 0,t),typeof t.name=="string"||A(0,"Must provide name."),t.resolveType==null||typeof t.resolveType=="function"||A(0,"".concat(this.name,' must provide "resolveType" as a function, ')+"but got: ".concat(_(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:Lt(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()},de(e,[{key:$,get:function(){return"GraphQLInterfaceType"}}]),e}();H(Ut);var Vt=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=wa.bind(void 0,t),typeof t.name=="string"||A(0,"Must provide name."),t.resolveType==null||typeof t.resolveType=="function"||A(0,"".concat(this.name,' must provide "resolveType" as a function, ')+"but got: ".concat(_(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()},de(e,[{key:$,get:function(){return"GraphQLUnionType"}}]),e}();H(Vt);function wa(e){var n=en(e.types);return Array.isArray(n)||A(0,"Must provide Array of types or a function which returns such an array for Union ".concat(e.name,".")),n}var nn=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=Da(this.name,t.values),this._valueLookup=new Map(this._values.map(function(i){return[i.value,i]})),this._nameLookup=It(this._values,function(i){return i.name}),typeof t.name=="string"||A(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(_(i)));return a.name},n.parseValue=function(i){if(typeof i!="string"){var a=_(i);throw new U('Enum "'.concat(this.name,'" cannot represent non-string value: ').concat(a,".")+tn(this,a))}var r=this.getValue(i);if(r==null)throw new U('Value "'.concat(i,'" does not exist in "').concat(this.name,'" enum.')+tn(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,".")+tn(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.')+tn(this,o),i)}return u.value},n.toConfig=function(){var i,a=Bn(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()},de(e,[{key:$,get:function(){return"GraphQLEnumType"}}]),e}();H(nn);function tn(e,n){var t=e.getValues().map(function(a){return a.name}),i=ma(n,t);return fa("the enum value",i)}function Da(e,n){return me(n)||A(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)||A(0,"".concat(e,".").concat(i,' must refer to an object with a "value" key ')+"representing an internal value but got: ".concat(_(a),".")),!("isDeprecated"in a)||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 Bt=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=Fa.bind(void 0,t),typeof t.name=="string"||A(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=Ke(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()},de(e,[{key:$,get:function(){return"GraphQLInputObjectType"}}]),e}();H(Bt);function Fa(e){var n=en(e.fields);return me(n)||A(0,"".concat(e.name," fields must be an object with field names as keys or a function which returns such an object.")),Ke(n,function(t,i){return!("resolve"in t)||A(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 Oa=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[vt];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=[],k=0;k<s;++k)Object.prototype.hasOwnProperty.call(e,k)&&l.push(n.call(t,e[k],k));return l}return[]},Aa=Oa,_a=Number.isFinite||function(e){return typeof e=="number"&&isFinite(e)},Ue=_a;function an(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?an=function(t){return typeof t}:an=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},an(e)}function Ra(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:function(k){return k};if(e==null||an(e)!=="object")return null;if(Array.isArray(e))return e.map(n);var t=e[vt];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 La=Number.isInteger||function(e){return typeof e=="number"&&isFinite(e)&&Math.floor(e)===e},rn=La,jn=2147483647,$n=-2147483648;function Pa(e){var n=Ve(e);if(typeof n=="boolean")return n?1:0;var t=n;if(typeof n=="string"&&n!==""&&(t=Number(n)),!rn(t))throw new U("Int cannot represent non-integer value: ".concat(_(n)));if(t>jn||t<$n)throw new U("Int cannot represent non 32-bit signed integer value: "+_(n));return t}function Ua(e){if(!rn(e))throw new U("Int cannot represent non-integer value: ".concat(_(e)));if(e>jn||e<$n)throw new U("Int cannot represent non 32-bit signed integer value: ".concat(e));return e}var Va=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:Pa,parseValue:Ua,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>jn||t<$n)throw new U("Int cannot represent non 32-bit signed integer value: ".concat(n.value),n);return t}});function Ba(e){var n=Ve(e);if(typeof n=="boolean")return n?1:0;var t=n;if(typeof n=="string"&&n!==""&&(t=Number(n)),!Ue(t))throw new U("Float cannot represent non numeric value: ".concat(_(n)));return t}function Ca(e){if(!Ue(e))throw new U("Float cannot represent non numeric value: ".concat(_(e)));return e}var Ma=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:Ba,parseValue:Ca,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 Ve(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 xa(e){var n=Ve(e);if(typeof n=="string")return n;if(typeof n=="boolean")return n?"true":"false";if(Ue(n))return n.toString();throw new U("String cannot represent value: ".concat(_(e)))}function qa(e){if(typeof e!="string")throw new U("String cannot represent a non string value: ".concat(_(e)));return e}var B=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:xa,parseValue:qa,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 ja(e){var n=Ve(e);if(typeof n=="boolean")return n;if(Ue(n))return n!==0;throw new U("Boolean cannot represent a non boolean value: ".concat(_(n)))}function $a(e){if(typeof e!="boolean")throw new U("Boolean cannot represent a non boolean value: ".concat(_(e)));return e}var Q=new ce({name:"Boolean",description:"The `Boolean` scalar type represents `true` or `false`.",serialize:ja,parseValue:$a,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 Ga(e){var n=Ve(e);if(typeof n=="string")return n;if(rn(n))return String(n);throw new U("ID cannot represent value: ".concat(_(e)))}function Qa(e){if(typeof e=="string")return e;if(rn(e))return e.toString();throw new U("ID cannot represent value: ".concat(_(e)))}var Ct=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:Ga,parseValue:Qa,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}}),Mt=Object.freeze([B,Va,Ma,Q,Ct]);function Be(e,n){if(fe(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=Ra(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=[],k=0,E=se(n.getFields());k<E.length;k++){var y=E[k],f=Be(e[y.name],y.type);f&&l.push({kind:h.OBJECT_FIELD,name:{kind:h.NAME,value:y.name},value:f})}return{kind:h.OBJECT,fields:l}}if(ba(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"&&Ue(N)){var w=String(N);return xt.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===Ct&&xt.test(N)?{kind:h.INT,value:N}:{kind:h.STRING,value:N};throw new TypeError("Cannot convert value to AST: ".concat(_(N),"."))}Ae(0,"Unexpected input type: "+_(n))}var xt=/^-?(?:0|[1-9][0-9]*)$/,Gn=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:B,resolve:function(t){return t.description}},types:{description:"A list of all types supported by this server.",type:new I(new x(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 x(new I(qt))),resolve:function(t){return t.getDirectives()}}}}}),qt=new ae({name:"__Directive",description:`A Directive provides a way to describe alternate runtime execution and type validation behavior in a GraphQL document.
|
|
39
|
+
`))}function Ta(e){return e.indexOf(`
|
|
40
|
+
`)!==-1}function At(e){return e!=null&&e.some(Ta)}function Mn(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 Mn(t,n)});case h.OBJECT:return Bn(e.fields,function(t){return t.name.value},function(t){return Mn(t.value,n)});case h.VARIABLE:return n?.[e.name.value]}Ae(0,"Unexpected value node: "+_(e))}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 de(e,n,t){return n&&_t(e.prototype,n),t&&_t(e,t),e}function Rt(e){return Re(e)||W(e)||G(e)||te(e)||ie(e)||ue(e)||Le(e)||fe(e)}function Ea(e){if(!Rt(e))throw new Error("Expected ".concat(_(e)," to be a GraphQL type."));return e}function Re(e){return ee(e,ce)}function W(e){return ee(e,ae)}function G(e){return ee(e,Bt)}function te(e){return ee(e,Ct)}function ie(e){return ee(e,nn)}function ue(e){return ee(e,Mt)}function Le(e){return ee(e,x)}function fe(e){return ee(e,I)}function ve(e){return Re(e)||ie(e)||ue(e)||qn(e)&&ve(e.ofType)}function Ze(e){return Re(e)||W(e)||G(e)||te(e)||ie(e)||qn(e)&&Ze(e.ofType)}function Ia(e){return Re(e)||ie(e)}function xn(e){return W(e)||G(e)||te(e)}function wa(e){return G(e)||te(e)}function x(e){if(this instanceof x)this.ofType=Ea(e);else return new x(e)}x.prototype.toString=function(){return"["+String(this.ofType)+"]"},x.prototype.toJSON=function(){return this.toString()},Object.defineProperty(x.prototype,$,{get:function(){return"GraphQLList"}}),H(x);function I(e){if(this instanceof I)this.ofType=Fa(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,$,{get:function(){return"GraphQLNonNull"}}),H(I);function qn(e){return Le(e)||fe(e)}function Da(e){return Rt(e)&&!fe(e)}function Fa(e){if(!Da(e))throw new Error("Expected ".concat(_(e)," to be a GraphQL nullable type."));return e}function Oa(e){if(e)return fe(e)?e.ofType:e}function Pe(e){if(e){for(var n=e;qn(n);)n=n.ofType;return n}}function en(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:Ft;this.name=t.name,this.description=t.description,this.specifiedByUrl=t.specifiedByUrl,this.serialize=(a=t.serialize)!==null&&a!==void 0?a:Ft,this.parseValue=u,this.parseLiteral=(r=t.parseLiteral)!==null&&r!==void 0?r:function(o,s){return u(Mn(o,s))},this.extensions=t.extensions&&j(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=pe(t.extensionASTNodes),typeof t.name=="string"||A(0,"Must provide name."),t.specifiedByUrl==null||typeof t.specifiedByUrl=="string"||A(0,"".concat(this.name,' must provide "specifiedByUrl" as a string, ')+"but got: ".concat(_(t.specifiedByUrl),".")),t.serialize==null||typeof t.serialize=="function"||A(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"||A(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()},de(e,[{key:$,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=Pt.bind(void 0,t),this._interfaces=Lt.bind(void 0,t),typeof t.name=="string"||A(0,"Must provide name."),t.isTypeOf==null||typeof t.isTypeOf=="function"||A(0,"".concat(this.name,' must provide "isTypeOf" as a function, ')+"but got: ".concat(_(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:Ut(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()},de(e,[{key:$,get:function(){return"GraphQLObjectType"}}]),e}();H(ae);function Lt(e){var n,t=(n=en(e.interfaces))!==null&&n!==void 0?n:[];return Array.isArray(t)||A(0,"".concat(e.name," interfaces must be an Array or a function which returns an Array.")),t}function Pt(e){var n=en(e.fields);return me(n)||A(0,"".concat(e.name," fields must be an object with field names as keys or a function which returns such an object.")),Ke(n,function(t,i){var a;me(t)||A(0,"".concat(e.name,".").concat(i," field config must be an object.")),!("isDeprecated"in t)||A(0,"".concat(e.name,".").concat(i,' should provide "deprecationReason" instead of "isDeprecated".')),t.resolve==null||typeof t.resolve=="function"||A(0,"".concat(e.name,".").concat(i," field resolver must be a function if ")+"provided, but got: ".concat(_(t.resolve),"."));var r=(a=t.args)!==null&&a!==void 0?a:{};me(r)||A(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 Ut(e){return Ke(e,function(n){return{description:n.description,type:n.type,args:Vt(n.args),resolve:n.resolve,subscribe:n.subscribe,deprecationReason:n.deprecationReason,extensions:n.extensions,astNode:n.astNode}})}function Vt(e){return Bn(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 Bt=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=Pt.bind(void 0,t),this._interfaces=Lt.bind(void 0,t),typeof t.name=="string"||A(0,"Must provide name."),t.resolveType==null||typeof t.resolveType=="function"||A(0,"".concat(this.name,' must provide "resolveType" as a function, ')+"but got: ".concat(_(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:Ut(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()},de(e,[{key:$,get:function(){return"GraphQLInterfaceType"}}]),e}();H(Bt);var Ct=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=Aa.bind(void 0,t),typeof t.name=="string"||A(0,"Must provide name."),t.resolveType==null||typeof t.resolveType=="function"||A(0,"".concat(this.name,' must provide "resolveType" as a function, ')+"but got: ".concat(_(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()},de(e,[{key:$,get:function(){return"GraphQLUnionType"}}]),e}();H(Ct);function Aa(e){var n=en(e.types);return Array.isArray(n)||A(0,"Must provide Array of types or a function which returns such an array for Union ".concat(e.name,".")),n}var nn=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=_a(this.name,t.values),this._valueLookup=new Map(this._values.map(function(i){return[i.value,i]})),this._nameLookup=Dt(this._values,function(i){return i.name}),typeof t.name=="string"||A(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(_(i)));return a.name},n.parseValue=function(i){if(typeof i!="string"){var a=_(i);throw new U('Enum "'.concat(this.name,'" cannot represent non-string value: ').concat(a,".")+tn(this,a))}var r=this.getValue(i);if(r==null)throw new U('Value "'.concat(i,'" does not exist in "').concat(this.name,'" enum.')+tn(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,".")+tn(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.')+tn(this,o),i)}return u.value},n.toConfig=function(){var i,a=Bn(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()},de(e,[{key:$,get:function(){return"GraphQLEnumType"}}]),e}();H(nn);function tn(e,n){var t=e.getValues().map(function(a){return a.name}),i=ka(n,t);return ha("the enum value",i)}function _a(e,n){return me(n)||A(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)||A(0,"".concat(e,".").concat(i,' must refer to an object with a "value" key ')+"representing an internal value but got: ".concat(_(a),".")),!("isDeprecated"in a)||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 Mt=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=Ra.bind(void 0,t),typeof t.name=="string"||A(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=Ke(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()},de(e,[{key:$,get:function(){return"GraphQLInputObjectType"}}]),e}();H(Mt);function Ra(e){var n=en(e.fields);return me(n)||A(0,"".concat(e.name," fields must be an object with field names as keys or a function which returns such an object.")),Ke(n,function(t,i){return!("resolve"in t)||A(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 La=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[mt];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[]},Pa=La,Ua=Number.isFinite||function(e){return typeof e=="number"&&isFinite(e)},Ue=Ua;function an(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?an=function(t){return typeof t}:an=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},an(e)}function Va(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:function(g){return g};if(e==null||an(e)!=="object")return null;if(Array.isArray(e))return e.map(n);var t=e[mt];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},rn=Ba,jn=2147483647,$n=-2147483648;function Ca(e){var n=Ve(e);if(typeof n=="boolean")return n?1:0;var t=n;if(typeof n=="string"&&n!==""&&(t=Number(n)),!rn(t))throw new U("Int cannot represent non-integer value: ".concat(_(n)));if(t>jn||t<$n)throw new U("Int cannot represent non 32-bit signed integer value: "+_(n));return t}function Ma(e){if(!rn(e))throw new U("Int cannot represent non-integer value: ".concat(_(e)));if(e>jn||e<$n)throw new U("Int cannot represent non 32-bit signed integer value: ".concat(e));return e}var xa=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:Ca,parseValue:Ma,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>jn||t<$n)throw new U("Int cannot represent non 32-bit signed integer value: ".concat(n.value),n);return t}});function qa(e){var n=Ve(e);if(typeof n=="boolean")return n?1:0;var t=n;if(typeof n=="string"&&n!==""&&(t=Number(n)),!Ue(t))throw new U("Float cannot represent non numeric value: ".concat(_(n)));return t}function ja(e){if(!Ue(e))throw new U("Float cannot represent non numeric value: ".concat(_(e)));return e}var $a=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:qa,parseValue:ja,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 Ve(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 Ga(e){var n=Ve(e);if(typeof n=="string")return n;if(typeof n=="boolean")return n?"true":"false";if(Ue(n))return n.toString();throw new U("String cannot represent value: ".concat(_(e)))}function Qa(e){if(typeof e!="string")throw new U("String cannot represent a non string value: ".concat(_(e)));return e}var B=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:Ga,parseValue:Qa,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 Ja(e){var n=Ve(e);if(typeof n=="boolean")return n;if(Ue(n))return n!==0;throw new U("Boolean cannot represent a non boolean value: ".concat(_(n)))}function Ha(e){if(typeof e!="boolean")throw new U("Boolean cannot represent a non boolean value: ".concat(_(e)));return e}var Q=new ce({name:"Boolean",description:"The `Boolean` scalar type represents `true` or `false`.",serialize:Ja,parseValue:Ha,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 za(e){var n=Ve(e);if(typeof n=="string")return n;if(rn(n))return String(n);throw new U("ID cannot represent value: ".concat(_(e)))}function Ya(e){if(typeof e=="string")return e;if(rn(e))return e.toString();throw new U("ID cannot represent value: ".concat(_(e)))}var xt=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:za,parseValue:Ya,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}}),qt=Object.freeze([B,xa,$a,Q,xt]);function Be(e,n){if(fe(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=Va(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],f=Be(e[y.name],y.type);f&&l.push({kind:h.OBJECT_FIELD,name:{kind:h.NAME,value:y.name},value:f})}return{kind:h.OBJECT,fields:l}}if(Ia(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"&&Ue(N)){var w=String(N);return jt.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===xt&&jt.test(N)?{kind:h.INT,value:N}:{kind:h.STRING,value:N};throw new TypeError("Cannot convert value to AST: ".concat(_(N),"."))}Ae(0,"Unexpected input type: "+_(n))}var jt=/^-?(?:0|[1-9][0-9]*)$/,Gn=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:B,resolve:function(t){return t.description}},types:{description:"A list of all types supported by this server.",type:new I(new x(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 x(new I($t))),resolve:function(t){return t.getDirectives()}}}}}),$t=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(B),resolve:function(t){return t.name}},description:{type:B,resolve:function(t){return t.description}},isRepeatable:{type:new I(Q),resolve:function(t){return t.isRepeatable}},locations:{type:new I(new x(new I(jt))),resolve:function(t){return t.locations}},args:{type:new I(new x(new I(on))),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})}}}}}),jt=new nn({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:L.QUERY,description:"Location adjacent to a query operation."},MUTATION:{value:L.MUTATION,description:"Location adjacent to a mutation operation."},SUBSCRIPTION:{value:L.SUBSCRIPTION,description:"Location adjacent to a subscription operation."},FIELD:{value:L.FIELD,description:"Location adjacent to a field."},FRAGMENT_DEFINITION:{value:L.FRAGMENT_DEFINITION,description:"Location adjacent to a fragment definition."},FRAGMENT_SPREAD:{value:L.FRAGMENT_SPREAD,description:"Location adjacent to a fragment spread."},INLINE_FRAGMENT:{value:L.INLINE_FRAGMENT,description:"Location adjacent to an inline fragment."},VARIABLE_DEFINITION:{value:L.VARIABLE_DEFINITION,description:"Location adjacent to a variable definition."},SCHEMA:{value:L.SCHEMA,description:"Location adjacent to a schema definition."},SCALAR:{value:L.SCALAR,description:"Location adjacent to a scalar definition."},OBJECT:{value:L.OBJECT,description:"Location adjacent to an object type definition."},FIELD_DEFINITION:{value:L.FIELD_DEFINITION,description:"Location adjacent to a field definition."},ARGUMENT_DEFINITION:{value:L.ARGUMENT_DEFINITION,description:"Location adjacent to an argument definition."},INTERFACE:{value:L.INTERFACE,description:"Location adjacent to an interface definition."},UNION:{value:L.UNION,description:"Location adjacent to a union definition."},ENUM:{value:L.ENUM,description:"Location adjacent to an enum definition."},ENUM_VALUE:{value:L.ENUM_VALUE,description:"Location adjacent to an enum value definition."},INPUT_OBJECT:{value:L.INPUT_OBJECT,description:"Location adjacent to an input object type definition."},INPUT_FIELD_DEFINITION:{value:L.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(Qt),resolve:function(t){if(Re(t))return q.SCALAR;if(W(t))return q.OBJECT;if(G(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(fe(t))return q.NON_NULL;Ae(0,'Unexpected type: "'.concat(_(t),'".'))}},name:{type:B,resolve:function(t){return t.name!==void 0?t.name:void 0}},description:{type:B,resolve:function(t){return t.description!==void 0?t.description:void 0}},specifiedByUrl:{type:B,resolve:function(t){return t.specifiedByUrl!==void 0?t.specifiedByUrl:void 0}},fields:{type:new x(new I($t)),args:{includeDeprecated:{type:Q,defaultValue:!1}},resolve:function(t,i){var a=i.includeDeprecated;if(W(t)||G(t)){var r=se(t.getFields());return a?r:r.filter(function(u){return u.deprecationReason==null})}}},interfaces:{type:new x(new I(K)),resolve:function(t){if(W(t)||G(t))return t.getInterfaces()}},possibleTypes:{type:new x(new I(K)),resolve:function(t,i,a,r){var u=r.schema;if(Na(t))return u.getPossibleTypes(t)}},enumValues:{type:new x(new I(Gt)),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 x(new I(on)),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}}}}}),$t=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(B),resolve:function(t){return t.name}},description:{type:B,resolve:function(t){return t.description}},args:{type:new I(new x(new I(on))),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:B,resolve:function(t){return t.deprecationReason}}}}}),on=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(B),resolve:function(t){return t.name}},description:{type:B,resolve:function(t){return t.description}},type:{type:new I(K),resolve:function(t){return t.type}},defaultValue:{type:B,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:B,resolve:function(t){return t.deprecationReason}}}}}),Gt=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(B),resolve:function(t){return t.name}},description:{type:B,resolve:function(t){return t.description}},isDeprecated:{type:new I(Q),resolve:function(t){return t.deprecationReason!=null}},deprecationReason:{type:B,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"}),Qt=new nn({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."}}}),Jt={name:"__schema",type:new I(Gn),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},Ht={name:"__type",type:K,description:"Request the type information of a single type.",args:[{name:"name",description:void 0,type:new I(B),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},zt={name:"__typename",type:new I(B),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},Yt=Object.freeze([Gn,qt,jt,K,$t,on,Gt,Qt]);function Kt(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 Ja(e,n,t){return n&&Kt(e.prototype,n),t&&Kt(e,t),e}function Ha(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||A(0,"Directive must be named."),Array.isArray(t.locations)||A(0,"@".concat(t.name," locations must be an Array."));var r=(a=t.args)!==null&&a!==void 0?a:{};oe(r)&&!Array.isArray(r)||A(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:Pt(this.args),isRepeatable:this.isRepeatable,extensions:this.extensions,astNode:this.astNode}},n.toString=function(){return"@"+this.name},n.toJSON=function(){return this.toString()},Ja(e,[{key:$,get:function(){return"GraphQLDirective"}}]),e}();H(he);var za=new he({name:"include",description:"Directs the executor to include this field or fragment only when the `if` argument is true.",locations:[L.FIELD,L.FRAGMENT_SPREAD,L.INLINE_FRAGMENT],args:{if:{type:new I(Q),description:"Included when true."}}}),Ya=new he({name:"skip",description:"Directs the executor to skip this field or fragment when the `if` argument is true.",locations:[L.FIELD,L.FRAGMENT_SPREAD,L.INLINE_FRAGMENT],args:{if:{type:new I(Q),description:"Skipped when true."}}}),Ka="No longer supported",Xa=new he({name:"deprecated",description:"Marks an element of a GraphQL schema as no longer supported.",locations:[L.FIELD_DEFINITION,L.ARGUMENT_DEFINITION,L.INPUT_FIELD_DEFINITION,L.ENUM_VALUE],args:{reason:{type:B,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:Ka}}}),Wa=new he({name:"specifiedBy",description:"Exposes a URL that specifies the behaviour of this scalar.",locations:[L.SCALAR],args:{url:{type:new I(B),description:"The URL that specifies the behaviour of this scalar."}}}),Za=Object.freeze([za,Ya,Xa,Wa]);function Xt(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 er(e,n,t){return n&&Xt(e.prototype,n),t&&Xt(e,t),e}(function(){function e(t){var i;this.__validationErrors=t.assumeValid===!0?[]:void 0,oe(t)||A(0,"Must provide configuration object."),!t.types||Array.isArray(t.types)||A(0,'"types" must be Array if provided but got: '.concat(_(t.types),".")),!t.directives||Array.isArray(t.directives)||A(0,'"directives" must be Array if provided but got: '+"".concat(_(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:Za;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 k=l[s];if(Ha(k))for(var E=0,y=k.args;E<y.length;E++){var f=y[E];X(f.type,a)}}X(Gn,a),this._typeMap=Object.create(null),this._subTypeMap=Object.create(null),this._implementationsMap=Object.create(null);for(var N=0,w=Aa(a);N<w.length;N++){var O=w[N];if(O!=null){var F=O.name;if(F||A(0,"One of the provided types for building the Schema is missing a name."),this._typeMap[F]!==void 0)throw new Error('Schema must contain uniquely named types but contains multiple types named "'.concat(F,'".'));if(this._typeMap[F]=O,G(O))for(var P=0,R=O.getInterfaces();P<R.length;P++){var d=R[P];if(G(d)){var c=this._implementationsMap[d.name];c===void 0&&(c=this._implementationsMap[d.name]={objects:[],interfaces:[]}),c.interfaces.push(O)}}else if(W(O))for(var S=0,v=O.getInterfaces();S<v.length;S++){var T=v[S];if(G(T)){var D=this._implementationsMap[T.name];D===void 0&&(D=this._implementationsMap[T.name]={objects:[],interfaces:[]}),D.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),k=0,E=l.objects;k<E.length;k++){var y=E[k];r[y.name]=!0}for(var f=0,N=l.interfaces;f<N.length;f++){var w=N[f];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 Et(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}},er(e,[{key:$,get:function(){return"GraphQLSchema"}}]),e})();function X(e,n){var t=Pe(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)||G(t)){for(var u=0,o=t.getInterfaces();u<o.length;u++){var s=o[u];X(s,n)}for(var l=0,k=se(t.getFields());l<k.length;l++){var E=k[l];X(E.type,n);for(var y=0,f=E.args;y<f.length;y++){var N=f[y];X(N.type,n)}}}else if(ue(t))for(var w=0,O=se(t.getFields());w<O.length;w++){var F=O[w];X(F.type,n)}}return n}function sn(e,n){var t;if(n.kind===h.LIST_TYPE)return t=sn(e,n.type),t&&new x(t);if(n.kind===h.NON_NULL_TYPE)return t=sn(e,n.type),t&&new I(t);if(n.kind===h.NAMED_TYPE)return e.getType(n.name.value);Ae(0,"Unexpected type node: "+_(n))}var nr=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??tr,a&&(ve(a)&&this._inputTypeStack.push(a),xn(a)&&this._parentTypeStack.push(a),Ze(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=Pe(this.getType());this._parentTypeStack.push(xn(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(Ze(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 k=i.typeCondition,E=k?sn(a,k):Pe(this.getType());this._typeStack.push(Ze(E)?E:void 0);break}case h.VARIABLE_DEFINITION:{var y=sn(a,i.type);this._inputTypeStack.push(ve(y)?y:void 0);break}case h.ARGUMENT:{var f,N,w,O=(f=this.getDirective())!==null&&f!==void 0?f:this.getFieldDef();O&&(N=Et(O.args,function(T){return T.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 F=Ia(this.getInputType()),P=Le(F)?F.ofType:F;this._defaultValueStack.push(void 0),this._inputTypeStack.push(ve(P)?P:void 0);break}case h.OBJECT_FIELD:{var R=Pe(this.getInputType()),d,c;ue(R)&&(c=R.getFields()[i.name.value],c&&(d=c.type)),this._defaultValueStack.push(c?c.defaultValue:void 0),this._inputTypeStack.push(ve(d)?d:void 0);break}case h.ENUM:{var S=Pe(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 tr(e,n,t){var i=t.name.value;if(i===Jt.name&&e.getQueryType()===n)return Jt;if(i===Ht.name&&e.getQueryType()===n)return Ht;if(i===zt.name&&xn(n))return zt;if(W(n)||G(n))return n.getFields()[i]}function ir(e,n){return{enter:function(i){e.enter(i);var a=Vn(n,i.kind,!1);if(a){var r=a.apply(n,arguments);return r!==void 0&&(e.leave(i),Un(r)&&e.enter(r)),r}},leave:function(i){var a=Vn(n,i.kind,!0),r;return a&&(r=a.apply(n,arguments)),e.leave(i),r}}}[].concat(Mt,Yt).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 Wt(e,n){e.prototype=Object.create(n.prototype),e.prototype.constructor=e,e.__proto__=n}var Zt=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 k=l[s],E=k.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){Wt(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})(Zt),function(e){Wt(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 nr(this._schema);Tt(a,ir(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}(Zt),It(Mt.concat(Yt),function(e){return e.name});const ei={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 Qn=class Vi extends Error{date;constructor(n,...t){super(...t),Error.captureStackTrace&&Error.captureStackTrace(this,Vi),this.name="SpritzApiError",this.message=n,this.date=new Date}};const ar=e=>_n.create(e),rr=e=>_n.create(e);class or{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=ar({baseURL:ei[n].graphEndpoint,headers:a}),this.baseClient=rr({baseURL:ei[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 Qn(`Spritz GraphQL Error: ${i.data.errors[0].message}`);return i.data.data}catch(i){if(_n.isAxiosError(i)){const a=i.response?.data.Message??i.response?.data.message;throw new Qn(`Spritz Request Error: ${a}`)}else throw new Qn(`Spritz Request Error: ${i.message}`)}}}var Ce={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:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"VirtualCard"}},directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"mask"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"balance"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"renderSecret"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"virtualCardType"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"billingInfo"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"holder"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"phone"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"email"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"address"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"street"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"street2"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"city"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"subdivision"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"postalCode"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"countryCode"},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:880}};Ce.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(B),resolve:function(t){return t.name}},description:{type:B,resolve:function(t){return t.description}},isRepeatable:{type:new I(Q),resolve:function(t){return t.isRepeatable}},locations:{type:new I(new x(new I(Gt))),resolve:function(t){return t.locations}},args:{type:new I(new x(new I(on))),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})}}}}}),Gt=new nn({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:L.QUERY,description:"Location adjacent to a query operation."},MUTATION:{value:L.MUTATION,description:"Location adjacent to a mutation operation."},SUBSCRIPTION:{value:L.SUBSCRIPTION,description:"Location adjacent to a subscription operation."},FIELD:{value:L.FIELD,description:"Location adjacent to a field."},FRAGMENT_DEFINITION:{value:L.FRAGMENT_DEFINITION,description:"Location adjacent to a fragment definition."},FRAGMENT_SPREAD:{value:L.FRAGMENT_SPREAD,description:"Location adjacent to a fragment spread."},INLINE_FRAGMENT:{value:L.INLINE_FRAGMENT,description:"Location adjacent to an inline fragment."},VARIABLE_DEFINITION:{value:L.VARIABLE_DEFINITION,description:"Location adjacent to a variable definition."},SCHEMA:{value:L.SCHEMA,description:"Location adjacent to a schema definition."},SCALAR:{value:L.SCALAR,description:"Location adjacent to a scalar definition."},OBJECT:{value:L.OBJECT,description:"Location adjacent to an object type definition."},FIELD_DEFINITION:{value:L.FIELD_DEFINITION,description:"Location adjacent to a field definition."},ARGUMENT_DEFINITION:{value:L.ARGUMENT_DEFINITION,description:"Location adjacent to an argument definition."},INTERFACE:{value:L.INTERFACE,description:"Location adjacent to an interface definition."},UNION:{value:L.UNION,description:"Location adjacent to a union definition."},ENUM:{value:L.ENUM,description:"Location adjacent to an enum definition."},ENUM_VALUE:{value:L.ENUM_VALUE,description:"Location adjacent to an enum value definition."},INPUT_OBJECT:{value:L.INPUT_OBJECT,description:"Location adjacent to an input object type definition."},INPUT_FIELD_DEFINITION:{value:L.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(Ht),resolve:function(t){if(Re(t))return q.SCALAR;if(W(t))return q.OBJECT;if(G(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(fe(t))return q.NON_NULL;Ae(0,'Unexpected type: "'.concat(_(t),'".'))}},name:{type:B,resolve:function(t){return t.name!==void 0?t.name:void 0}},description:{type:B,resolve:function(t){return t.description!==void 0?t.description:void 0}},specifiedByUrl:{type:B,resolve:function(t){return t.specifiedByUrl!==void 0?t.specifiedByUrl:void 0}},fields:{type:new x(new I(Qt)),args:{includeDeprecated:{type:Q,defaultValue:!1}},resolve:function(t,i){var a=i.includeDeprecated;if(W(t)||G(t)){var r=se(t.getFields());return a?r:r.filter(function(u){return u.deprecationReason==null})}}},interfaces:{type:new x(new I(K)),resolve:function(t){if(W(t)||G(t))return t.getInterfaces()}},possibleTypes:{type:new x(new I(K)),resolve:function(t,i,a,r){var u=r.schema;if(wa(t))return u.getPossibleTypes(t)}},enumValues:{type:new x(new I(Jt)),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 x(new I(on)),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}}}}}),Qt=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(B),resolve:function(t){return t.name}},description:{type:B,resolve:function(t){return t.description}},args:{type:new I(new x(new I(on))),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:B,resolve:function(t){return t.deprecationReason}}}}}),on=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(B),resolve:function(t){return t.name}},description:{type:B,resolve:function(t){return t.description}},type:{type:new I(K),resolve:function(t){return t.type}},defaultValue:{type:B,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:B,resolve:function(t){return t.deprecationReason}}}}}),Jt=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(B),resolve:function(t){return t.name}},description:{type:B,resolve:function(t){return t.description}},isDeprecated:{type:new I(Q),resolve:function(t){return t.deprecationReason!=null}},deprecationReason:{type:B,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"}),Ht=new nn({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."}}}),zt={name:"__schema",type:new I(Gn),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},Yt={name:"__type",type:K,description:"Request the type information of a single type.",args:[{name:"name",description:void 0,type:new I(B),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},Kt={name:"__typename",type:new I(B),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},Xt=Object.freeze([Gn,$t,Gt,K,Qt,on,Jt,Ht]);function Wt(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 Ka(e,n,t){return n&&Wt(e.prototype,n),t&&Wt(e,t),e}function Xa(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||A(0,"Directive must be named."),Array.isArray(t.locations)||A(0,"@".concat(t.name," locations must be an Array."));var r=(a=t.args)!==null&&a!==void 0?a:{};oe(r)&&!Array.isArray(r)||A(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:Vt(this.args),isRepeatable:this.isRepeatable,extensions:this.extensions,astNode:this.astNode}},n.toString=function(){return"@"+this.name},n.toJSON=function(){return this.toString()},Ka(e,[{key:$,get:function(){return"GraphQLDirective"}}]),e}();H(he);var Wa=new he({name:"include",description:"Directs the executor to include this field or fragment only when the `if` argument is true.",locations:[L.FIELD,L.FRAGMENT_SPREAD,L.INLINE_FRAGMENT],args:{if:{type:new I(Q),description:"Included when true."}}}),Za=new he({name:"skip",description:"Directs the executor to skip this field or fragment when the `if` argument is true.",locations:[L.FIELD,L.FRAGMENT_SPREAD,L.INLINE_FRAGMENT],args:{if:{type:new I(Q),description:"Skipped when true."}}}),er="No longer supported",nr=new he({name:"deprecated",description:"Marks an element of a GraphQL schema as no longer supported.",locations:[L.FIELD_DEFINITION,L.ARGUMENT_DEFINITION,L.INPUT_FIELD_DEFINITION,L.ENUM_VALUE],args:{reason:{type:B,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:er}}}),tr=new he({name:"specifiedBy",description:"Exposes a URL that specifies the behaviour of this scalar.",locations:[L.SCALAR],args:{url:{type:new I(B),description:"The URL that specifies the behaviour of this scalar."}}}),ir=Object.freeze([Wa,Za,nr,tr]);function Zt(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 ar(e,n,t){return n&&Zt(e.prototype,n),t&&Zt(e,t),e}(function(){function e(t){var i;this.__validationErrors=t.assumeValid===!0?[]:void 0,oe(t)||A(0,"Must provide configuration object."),!t.types||Array.isArray(t.types)||A(0,'"types" must be Array if provided but got: '.concat(_(t.types),".")),!t.directives||Array.isArray(t.directives)||A(0,'"directives" must be Array if provided but got: '+"".concat(_(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:ir;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(Xa(g))for(var E=0,y=g.args;E<y.length;E++){var f=y[E];X(f.type,a)}}X(Gn,a),this._typeMap=Object.create(null),this._subTypeMap=Object.create(null),this._implementationsMap=Object.create(null);for(var N=0,w=Pa(a);N<w.length;N++){var O=w[N];if(O!=null){var F=O.name;if(F||A(0,"One of the provided types for building the Schema is missing a name."),this._typeMap[F]!==void 0)throw new Error('Schema must contain uniquely named types but contains multiple types named "'.concat(F,'".'));if(this._typeMap[F]=O,G(O))for(var P=0,R=O.getInterfaces();P<R.length;P++){var d=R[P];if(G(d)){var c=this._implementationsMap[d.name];c===void 0&&(c=this._implementationsMap[d.name]={objects:[],interfaces:[]}),c.interfaces.push(O)}}else if(W(O))for(var S=0,v=O.getInterfaces();S<v.length;S++){var T=v[S];if(G(T)){var D=this._implementationsMap[T.name];D===void 0&&(D=this._implementationsMap[T.name]={objects:[],interfaces:[]}),D.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 f=0,N=l.interfaces;f<N.length;f++){var w=N[f];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 wt(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}},ar(e,[{key:$,get:function(){return"GraphQLSchema"}}]),e})();function X(e,n){var t=Pe(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)||G(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,f=E.args;y<f.length;y++){var N=f[y];X(N.type,n)}}}else if(ue(t))for(var w=0,O=se(t.getFields());w<O.length;w++){var F=O[w];X(F.type,n)}}return n}function sn(e,n){var t;if(n.kind===h.LIST_TYPE)return t=sn(e,n.type),t&&new x(t);if(n.kind===h.NON_NULL_TYPE)return t=sn(e,n.type),t&&new I(t);if(n.kind===h.NAMED_TYPE)return e.getType(n.name.value);Ae(0,"Unexpected type node: "+_(n))}var rr=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??or,a&&(ve(a)&&this._inputTypeStack.push(a),xn(a)&&this._parentTypeStack.push(a),Ze(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=Pe(this.getType());this._parentTypeStack.push(xn(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(Ze(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?sn(a,g):Pe(this.getType());this._typeStack.push(Ze(E)?E:void 0);break}case h.VARIABLE_DEFINITION:{var y=sn(a,i.type);this._inputTypeStack.push(ve(y)?y:void 0);break}case h.ARGUMENT:{var f,N,w,O=(f=this.getDirective())!==null&&f!==void 0?f:this.getFieldDef();O&&(N=wt(O.args,function(T){return T.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 F=Oa(this.getInputType()),P=Le(F)?F.ofType:F;this._defaultValueStack.push(void 0),this._inputTypeStack.push(ve(P)?P:void 0);break}case h.OBJECT_FIELD:{var R=Pe(this.getInputType()),d,c;ue(R)&&(c=R.getFields()[i.name.value],c&&(d=c.type)),this._defaultValueStack.push(c?c.defaultValue:void 0),this._inputTypeStack.push(ve(d)?d:void 0);break}case h.ENUM:{var S=Pe(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 or(e,n,t){var i=t.name.value;if(i===zt.name&&e.getQueryType()===n)return zt;if(i===Yt.name&&e.getQueryType()===n)return Yt;if(i===Kt.name&&xn(n))return Kt;if(W(n)||G(n))return n.getFields()[i]}function sr(e,n){return{enter:function(i){e.enter(i);var a=Vn(n,i.kind,!1);if(a){var r=a.apply(n,arguments);return r!==void 0&&(e.leave(i),Un(r)&&e.enter(r)),r}},leave:function(i){var a=Vn(n,i.kind,!0),r;return a&&(r=a.apply(n,arguments)),e.leave(i),r}}}[].concat(qt,Xt).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 ei(e,n){e.prototype=Object.create(n.prototype),e.prototype.constructor=e,e.__proto__=n}var ni=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){ei(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})(ni),function(e){ei(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 rr(this._schema);It(a,sr(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}(ni),Dt(qt.concat(Xt),function(e){return e.name});const ti={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 Qn=class xi extends Error{date;constructor(n,...t){super(...t),Error.captureStackTrace&&Error.captureStackTrace(this,xi),this.name="SpritzApiError",this.message=n,this.date=new Date}};const ur=e=>_n.create(e),cr=e=>_n.create(e);class lr{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=ur({baseURL:ti[n].graphEndpoint,headers:a}),this.baseClient=cr({baseURL:ti[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 Qn(`Spritz GraphQL Error: ${i.data.errors[0].message}`);return i.data.data}catch(i){if(_n.isAxiosError(i)){const a=i.response?.data.Message??i.response?.data.message;throw new Qn(`Spritz Request Error: ${a}`)}else throw new Qn(`Spritz Request Error: ${i.message}`)}}}var Ce={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:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"VirtualCard"}},directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"mask"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"balance"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"renderSecret"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"virtualCardType"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"billingInfo"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"holder"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"phone"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"email"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"address"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"street"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"street2"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"city"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"subdivision"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"postalCode"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"countryCode"},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:880}};Ce.loc.source={body:`fragment PayableAccountFragment on PayableAccount {
|
|
43
43
|
id
|
|
44
44
|
name
|
|
45
45
|
userId
|
|
@@ -87,21 +87,21 @@ In some cases, you need to provide options to alter GraphQL's execution behavior
|
|
|
87
87
|
currency
|
|
88
88
|
}
|
|
89
89
|
}
|
|
90
|
-
`,name:"GraphQL request",locationOffset:{line:1,column:1}};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 Jn={};(function(){Ce.definitions.forEach(function(n){if(n.name){var t=new Set;un(n,t),Jn[n.name.value]=t}})})();function
|
|
90
|
+
`,name:"GraphQL request",locationOffset:{line:1,column:1}};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 Jn={};(function(){Ce.definitions.forEach(function(n){if(n.name){var t=new Set;un(n,t),Jn[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 dr(e,n){var t={kind:e.kind,definitions:[ii(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=ii(e,o);s&&t.definitions.push(s)}),t}dr(Ce,"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"
|
|
91
91
|
|
|
92
92
|
mutation CreateUSBankAccount($createUSAccountInput: USBankAccountInput!) {
|
|
93
93
|
createUSBankAccount(createUSAccountInput: $createUSAccountInput) {
|
|
94
94
|
...PayableAccountFragment
|
|
95
95
|
}
|
|
96
96
|
}
|
|
97
|
-
`,name:"GraphQL request",locationOffset:{line:1,column:1}};var
|
|
97
|
+
`,name:"GraphQL request",locationOffset:{line:1,column:1}};var ai={};function fr(e){return e.filter(function(n){if(n.kind!=="FragmentDefinition")return!0;var t=n.name.value;return ai[t]?!1:(ai[t]=!0,!0)})}ge.definitions=ge.definitions.concat(fr(Ce.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 Hn={};(function(){ge.definitions.forEach(function(n){if(n.name){var t=new Set;cn(n,t),Hn[n.name.value]=t}})})();function ri(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 vr(e,n){var t={kind:e.kind,definitions:[ri(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var i=Hn[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=Hn[o]||new Set;s.forEach(function(l){r.add(l)})}})}return a.forEach(function(o){var s=ri(e,o);s&&t.definitions.push(s)}),t}vr(ge,"CreateUSBankAccount");var ke={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"DeletePayableAccount"},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:"PayableAccountFragment"},directives:[]}]}}]}}],loc:{start:0,end:198}};ke.loc.source={body:`#import "../queries/payableAccountFragment.graphql"
|
|
98
98
|
|
|
99
99
|
mutation DeletePayableAccount($accountId: String!) {
|
|
100
100
|
deletePayableAccount(accountId: $accountId) {
|
|
101
101
|
...PayableAccountFragment
|
|
102
102
|
}
|
|
103
103
|
}
|
|
104
|
-
`,name:"GraphQL request",locationOffset:{line:1,column:1}};var
|
|
104
|
+
`,name:"GraphQL request",locationOffset:{line:1,column:1}};var oi={};function pr(e){return e.filter(function(n){if(n.kind!=="FragmentDefinition")return!0;var t=n.name.value;return oi[t]?!1:(oi[t]=!0,!0)})}ke.definitions=ke.definitions.concat(pr(Ce.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 zn={};(function(){ke.definitions.forEach(function(n){if(n.name){var t=new Set;ln(n,t),zn[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 mr(e,n){var t={kind:e.kind,definitions:[si(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=si(e,o);s&&t.definitions.push(s)}),t}mr(ke,"DeletePayableAccount");var Me={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}};Me.loc.source={body:`fragment BankAccountFragment on BankAccount {
|
|
105
105
|
id
|
|
106
106
|
name
|
|
107
107
|
userId
|
|
@@ -130,21 +130,21 @@ mutation DeletePayableAccount($accountId: String!) {
|
|
|
130
130
|
currency
|
|
131
131
|
}
|
|
132
132
|
}
|
|
133
|
-
`,name:"GraphQL request",locationOffset:{line:1,column:1}};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(){Me.definitions.forEach(function(n){if(n.name){var t=new Set;dn(n,t),Yn[n.name.value]=t}})})();function
|
|
133
|
+
`,name:"GraphQL request",locationOffset:{line:1,column:1}};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(){Me.definitions.forEach(function(n){if(n.name){var t=new Set;dn(n,t),Yn[n.name.value]=t}})})();function ui(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:[ui(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=ui(e,o);s&&t.definitions.push(s)}),t}hr(Me,"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"
|
|
134
134
|
|
|
135
135
|
mutation RenameBankAccount($accountId: String!, $name: String!) {
|
|
136
136
|
renamePayableAccount(accountId: $accountId, name: $name) {
|
|
137
137
|
...BankAccountFragment
|
|
138
138
|
}
|
|
139
139
|
}
|
|
140
|
-
`,name:"GraphQL request",locationOffset:{line:1,column:1}};var
|
|
140
|
+
`,name:"GraphQL request",locationOffset:{line:1,column:1}};var ci={};function yr(e){return e.filter(function(n){if(n.kind!=="FragmentDefinition")return!0;var t=n.name.value;return ci[t]?!1:(ci[t]=!0,!0)})}Se.definitions=Se.definitions.concat(yr(Me.definitions));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 Kn={};(function(){Se.definitions.forEach(function(n){if(n.name){var t=new Set;fn(n,t),Kn[n.name.value]=t}})})();function li(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:[li(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=li(e,o);s&&t.definitions.push(s)}),t}gr(Se,"RenameBankAccount");var be={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"UserBankAccounts"},variableDefinitions:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"bankAccounts"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"BankAccountFragment"},directives:[]}]}}]}}],loc:{start:0,end:124}};be.loc.source={body:`#import "./bankAccountFragment.graphql"
|
|
141
141
|
|
|
142
142
|
query UserBankAccounts {
|
|
143
143
|
bankAccounts {
|
|
144
144
|
...BankAccountFragment
|
|
145
145
|
}
|
|
146
146
|
}
|
|
147
|
-
`,name:"GraphQL request",locationOffset:{line:1,column:1}};var
|
|
147
|
+
`,name:"GraphQL request",locationOffset:{line:1,column:1}};var di={};function kr(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)})}be.definitions=be.definitions.concat(kr(Me.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 Xn={};(function(){be.definitions.forEach(function(n){if(n.name){var t=new Set;vn(n,t),Xn[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 Sr(e,n){var t={kind:e.kind,definitions:[fi(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=fi(e,o);s&&t.definitions.push(s)}),t}Sr(be,"UserBankAccounts");var vi=(e=>(e.CHECKBOOK="CHECKBOOK",e.METHOD_FI="METHOD_FI",e))(vi||{}),pi=(e=>(e.Business="Business",e.Checking="Checking",e.Savings="Savings",e))(pi||{}),Wn=(e=>(e.USBankAccount="USBankAccount",e))(Wn||{}),mi=(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))(mi||{}),br=(e=>(e.ACTIVE="ACTIVE",e.DISABLED="DISABLED",e.FAILED="FAILED",e.INITIALIZED="INITIALIZED",e.LOADING="LOADING",e.RETRY="RETRY",e.UNAVAILABLE="UNAVAILABLE",e.UNINITIALIZED="UNINITIALIZED",e))(br||{}),hi=(e=>(e.BankAccount="BankAccount",e.Bill="Bill",e.VirtualCard="VirtualCard",e))(hi||{}),yi=(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))(yi||{}),Zn=(e=>(e.USVirtualDebitCard="USVirtualDebitCard",e))(Zn||{});const Nr={[Wn.USBankAccount]:e=>({query:ge,variables:{createUSAccountInput:e},response:"createUSBankAccount"})},Tr=(e,n)=>Nr[e]?.(n)??null;class Er{client;constructor(n){this.client=n}async list(){return(await this.client.query({query:be}))?.bankAccounts??[]}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:ke,variables:{accountId:n}}))?.deletePayableAccount??null}async create(n,t){const i=Tr(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 xe={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}};xe.loc.source={body:`fragment PaymentFragment on Payment {
|
|
148
148
|
id
|
|
149
149
|
userId
|
|
150
150
|
status
|
|
@@ -153,21 +153,21 @@ query UserBankAccounts {
|
|
|
153
153
|
feeAmount
|
|
154
154
|
createdAt
|
|
155
155
|
}
|
|
156
|
-
`,name:"GraphQL request",locationOffset:{line:1,column:1}};function pn(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){pn(i,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(i){pn(i,n)}),e.definitions&&e.definitions.forEach(function(i){pn(i,n)})}var
|
|
156
|
+
`,name:"GraphQL request",locationOffset:{line:1,column:1}};function pn(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){pn(i,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(i){pn(i,n)}),e.definitions&&e.definitions.forEach(function(i){pn(i,n)})}var et={};(function(){xe.definitions.forEach(function(n){if(n.name){var t=new Set;pn(n,t),et[n.name.value]=t}})})();function gi(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 Ir(e,n){var t={kind:e.kind,definitions:[gi(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var i=et[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=et[o]||new Set;s.forEach(function(l){r.add(l)})}})}return a.forEach(function(o){var s=gi(e,o);s&&t.definitions.push(s)}),t}Ir(xe,"PaymentFragment");var Ne={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}};Ne.loc.source={body:`#import "./paymentFragment.graphql"
|
|
157
157
|
|
|
158
158
|
query PaymentRequestPayment($paymentRequestId: String!) {
|
|
159
159
|
paymentForPaymentRequest(paymentRequestId: $paymentRequestId) {
|
|
160
160
|
...PaymentFragment
|
|
161
161
|
}
|
|
162
162
|
}
|
|
163
|
-
`,name:"GraphQL request",locationOffset:{line:1,column:1}};var
|
|
163
|
+
`,name:"GraphQL request",locationOffset:{line:1,column:1}};var ki={};function wr(e){return e.filter(function(n){if(n.kind!=="FragmentDefinition")return!0;var t=n.name.value;return ki[t]?!1:(ki[t]=!0,!0)})}Ne.definitions=Ne.definitions.concat(wr(xe.definitions));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 nt={};(function(){Ne.definitions.forEach(function(n){if(n.name){var t=new Set;mn(n,t),nt[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 Dr(e,n){var t={kind:e.kind,definitions:[Si(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var i=nt[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=nt[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}Dr(Ne,"PaymentRequestPayment");var Te={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}};Te.loc.source={body:`#import "./paymentFragment.graphql"
|
|
164
164
|
|
|
165
165
|
query AccountPayments($accountId: String!) {
|
|
166
166
|
paymentsForAccount(accountId: $accountId) {
|
|
167
167
|
...PaymentFragment
|
|
168
168
|
}
|
|
169
169
|
}
|
|
170
|
-
`,name:"GraphQL request",locationOffset:{line:1,column:1}};var
|
|
170
|
+
`,name:"GraphQL request",locationOffset:{line:1,column:1}};var bi={};function Fr(e){return e.filter(function(n){if(n.kind!=="FragmentDefinition")return!0;var t=n.name.value;return bi[t]?!1:(bi[t]=!0,!0)})}Te.definitions=Te.definitions.concat(Fr(xe.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 tt={};(function(){Te.definitions.forEach(function(n){if(n.name){var t=new Set;hn(n,t),tt[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 Or(e,n){var t={kind:e.kind,definitions:[Ni(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=Ni(e,o);s&&t.definitions.push(s)}),t}Or(Te,"AccountPayments");class Ar{client;constructor(n){this.client=n}async listForAccount(n){return(await this.client.query({query:Te,variables:{accountId:n}}))?.paymentsForAccount??[]}async getForPaymentRequest(n){return(await this.client.query({query:Ne,variables:{paymentRequestId:n}}))?.paymentForPaymentRequest??null}}var yn={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}};yn.loc.source={body:`fragment PaymentRequestFragment on DirectPayment {
|
|
171
171
|
id
|
|
172
172
|
userId
|
|
173
173
|
accountId
|
|
@@ -178,14 +178,14 @@ query AccountPayments($accountId: String!) {
|
|
|
178
178
|
network
|
|
179
179
|
createdAt
|
|
180
180
|
}
|
|
181
|
-
`,name:"GraphQL request",locationOffset:{line:1,column:1}};function
|
|
181
|
+
`,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 it={};(function(){yn.definitions.forEach(function(n){if(n.name){var t=new Set;gn(n,t),it[n.name.value]=t}})})();function Ti(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 _r(e,n){var t={kind:e.kind,definitions:[Ti(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=Ti(e,o);s&&t.definitions.push(s)}),t}_r(yn,"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"
|
|
182
182
|
|
|
183
183
|
mutation CreatePaymentRequest($createDirectPaymentInput: CreateDirectPaymentInput!) {
|
|
184
184
|
createDirectPayment(createDirectPaymentInput: $createDirectPaymentInput) {
|
|
185
185
|
...PaymentRequestFragment
|
|
186
186
|
}
|
|
187
187
|
}
|
|
188
|
-
`,name:"GraphQL request",locationOffset:{line:1,column:1}};var
|
|
188
|
+
`,name:"GraphQL request",locationOffset:{line:1,column:1}};var Ei={};function Rr(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)})}le.definitions=le.definitions.concat(Rr(yn.definitions));function kn(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){kn(i,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(i){kn(i,n)}),e.definitions&&e.definitions.forEach(function(i){kn(i,n)})}var at={};(function(){le.definitions.forEach(function(n){if(n.name){var t=new Set;kn(n,t),at[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 Lr(e,n){var t={kind:e.kind,definitions:[Ii(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=Ii(e,o);s&&t.definitions.push(s)}),t}Lr(le,"CreatePaymentRequest");var Sn={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}};Sn.loc.source={body:`query GetSpritzPayParams(
|
|
189
189
|
$tokenAddress: String!
|
|
190
190
|
$amount: Float!
|
|
191
191
|
$reference: String!
|
|
@@ -205,11 +205,11 @@ mutation CreatePaymentRequest($createDirectPaymentInput: CreateDirectPaymentInpu
|
|
|
205
205
|
suggestedGasLimit
|
|
206
206
|
}
|
|
207
207
|
}
|
|
208
|
-
`,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
|
|
208
|
+
`,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 rt={};(function(){Sn.definitions.forEach(function(n){if(n.name){var t=new Set;bn(n,t),rt[n.name.value]=t}})})();function wi(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:[wi(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var i=rt[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=rt[o]||new Set;s.forEach(function(l){r.add(l)})}})}return a.forEach(function(o){var s=wi(e,o);s&&t.definitions.push(s)}),t}Pr(Sn,"GetSpritzPayParams");var Di=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}}),Ur=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}}),ot=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=Ur(),t=d=>new Uint8Array(d.buffer,d.byteOffset,d.byteLength);e.u8=t;var i=d=>new Uint32Array(d.buffer,d.byteOffset,Math.floor(d.byteLength/4));e.u32=i;var a=d=>new DataView(d.buffer,d.byteOffset,d.byteLength);e.createView=a;var r=(d,c)=>d<<32-c|d>>>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},(d,c)=>c.toString(16).padStart(2,"0"));function o(d){if(!(d instanceof Uint8Array))throw new Error("Uint8Array expected");let c="";for(let S=0;S<d.length;S++)c+=u[d[S]];return c}e.bytesToHex=o;function s(d){if(typeof d!="string")throw new TypeError("hexToBytes: expected string, got "+typeof d);if(d.length%2)throw new Error("hexToBytes: received invalid unpadded hex");const c=new Uint8Array(d.length/2);for(let S=0;S<c.length;S++){const v=S*2,T=d.slice(v,v+2),D=Number.parseInt(T,16);if(Number.isNaN(D)||D<0)throw new Error("Invalid byte sequence");c[S]=D}return c}e.hexToBytes=s;var l=async()=>{};e.nextTick=l;async function g(d,c,S){let v=Date.now();for(let T=0;T<d;T++){S(T);const D=Date.now()-v;D>=0&&D<c||(await(0,e.nextTick)(),v+=D)}}e.asyncLoop=g;function E(d){if(typeof d!="string")throw new TypeError(`utf8ToBytes expected string, got ${typeof d}`);return new TextEncoder().encode(d)}e.utf8ToBytes=E;function y(d){if(typeof d=="string"&&(d=E(d)),!(d instanceof Uint8Array))throw new TypeError(`Expected input type is Uint8Array (got ${typeof d})`);return d}e.toBytes=y;function f(...d){if(!d.every(v=>v instanceof Uint8Array))throw new Error("Uint8Array list expected");if(d.length===1)return d[0];const c=d.reduce((v,T)=>v+T.length,0),S=new Uint8Array(c);for(let v=0,T=0;v<d.length;v++){const D=d[v];S.set(D,T),T+=D.length}return S}e.concatBytes=f;var N=class{clone(){return this._cloneInto()}};e.Hash=N;var w=d=>Object.prototype.toString.call(d)==="[object Object]"&&d.constructor===Object;function O(d,c){if(c!==void 0&&(typeof c!="object"||!w(c)))throw new TypeError("Options should be object or undefined");return Object.assign(d,c)}e.checkOpts=O;function F(d){const c=v=>d().update(y(v)).digest(),S=d();return c.outputLen=S.outputLen,c.blockLen=S.blockLen,c.create=()=>d(),c}e.wrapConstructor=F;function P(d){const c=(v,T)=>d(T).update(y(v)).digest(),S=d({});return c.outputLen=S.outputLen,c.blockLen=S.blockLen,c.create=v=>d(v),c}e.wrapConstructorWithOpts=P;function R(d=32){if(n.crypto&&typeof n.crypto.getRandomValues=="function")return n.crypto.getRandomValues(new Uint8Array(d));throw new Error("crypto.getRandomValues must be defined")}e.randomBytes=R}}),Fi=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(Di()),a=ot(),r=i.default.bool;e.assertBool=r;var u=i.default.bytes;e.assertBytes=u;var o=ot();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 f=y.startsWith("0x")?y.substring(2):y;return(0,a.hexToBytes)(f)}e.hexToBytes=l;function g(y,f){if(y.length!==f.length)return!1;for(let N=0;N<y.length;N++)if(y[N]!==f[N])return!1;return!0}e.equalsBytes=g;function E(y){return f=>(i.default.bytes(f),y(f))}e.wrapHash=E,e.crypto=(()=>{const y=typeof self=="object"&&"crypto"in self?self.crypto:void 0,f=typeof n<"u"&&typeof n.require=="function"&&n.require.bind(n);return{node:f&&!y?f("crypto"):void 0,web:y}})()}});/*! Bundled license information:
|
|
209
209
|
|
|
210
210
|
@noble/hashes/utils.js:
|
|
211
211
|
(*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) *)
|
|
212
|
-
*/var Vr=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 b=new Uint32Array(m.length),C=new Uint32Array(m.length);for(let M=0;M<m.length;M++){const{h:J,l:An}=i(m[M],p);[b[M],C[M]]=[J,An]}return[b,C]}e.split=a;var r=(m,p)=>BigInt(m>>>0)<<t|BigInt(p>>>0);e.toBig=r;var u=(m,p,b)=>m>>>b,o=(m,p,b)=>m<<32-b|p>>>b,s=(m,p,b)=>m>>>b|p<<32-b,l=(m,p,b)=>m<<32-b|p>>>b,
|
|
212
|
+
*/var Vr=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 b=new Uint32Array(m.length),C=new Uint32Array(m.length);for(let M=0;M<m.length;M++){const{h:J,l:An}=i(m[M],p);[b[M],C[M]]=[J,An]}return[b,C]}e.split=a;var r=(m,p)=>BigInt(m>>>0)<<t|BigInt(p>>>0);e.toBig=r;var u=(m,p,b)=>m>>>b,o=(m,p,b)=>m<<32-b|p>>>b,s=(m,p,b)=>m>>>b|p<<32-b,l=(m,p,b)=>m<<32-b|p>>>b,g=(m,p,b)=>m<<64-b|p>>>b-32,E=(m,p,b)=>m>>>b-32|p<<64-b,y=(m,p)=>p,f=(m,p)=>m,N=(m,p,b)=>m<<b|p>>>32-b,w=(m,p,b)=>p<<b|m>>>32-b,O=(m,p,b)=>p<<b-32|m>>>64-b,F=(m,p,b)=>m<<b-32|p>>>64-b;function P(m,p,b,C){const M=(p>>>0)+(C>>>0);return{h:m+b+(M/2**32|0)|0,l:M|0}}e.add=P;var R=(m,p,b)=>(m>>>0)+(p>>>0)+(b>>>0),d=(m,p,b,C)=>p+b+C+(m/2**32|0)|0,c=(m,p,b,C)=>(m>>>0)+(p>>>0)+(b>>>0)+(C>>>0),S=(m,p,b,C,M)=>p+b+C+M+(m/2**32|0)|0,v=(m,p,b,C,M)=>(m>>>0)+(p>>>0)+(b>>>0)+(C>>>0)+(M>>>0),T=(m,p,b,C,M,J)=>p+b+C+M+J+(m/2**32|0)|0,D={fromBig:i,split:a,toBig:e.toBig,shrSH:u,shrSL:o,rotrSH:s,rotrSL:l,rotrBH:g,rotrBL:E,rotr32H:y,rotr32L:f,rotlSH:N,rotlSL:w,rotlBH:O,rotlBL:F,add:P,add3L:R,add3H:d,add4L:c,add4H:S,add5H:T,add5L:v};e.default=D}}),Br=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=Di(),t=Vr(),i=ot(),[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,T=0;c<24;c++){[v,T]=[T,(2*v+3*T)%5],a.push(2*(5*T+v)),r.push((c+1)*(c+2)/2%64);let D=o;for(let m=0;m<7;m++)S=(S<<s^(S>>g)*y)%E,S&l&&(D^=s<<(s<<BigInt(m))-s);u.push(D)}var[f,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 F(c,S=24){const v=new Uint32Array(10);for(let T=24-S;T<24;T++){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 b=(p+8)%10,C=(p+2)%10,M=v[C],J=v[C+1],An=w(M,J,1)^v[b],qi=O(M,J,1)^v[b+1];for(let je=0;je<50;je+=10)c[p+je]^=An,c[p+je+1]^=qi}let D=c[2],m=c[3];for(let p=0;p<24;p++){const b=r[p],C=w(D,m,b),M=O(D,m,b),J=a[p];D=c[J],m=c[J+1],c[J]=C,c[J+1]=M}for(let p=0;p<50;p+=10){for(let b=0;b<10;b++)v[b]=c[p+b];for(let b=0;b<10;b++)c[p+b]^=~v[(b+2)%10]&v[(b+4)%10]}c[0]^=f[T],c[1]^=N[T]}v.fill(0)}e.keccakP=F;var P=class extends i.Hash{constructor(c,S,v,T=!1,D=24){if(super(),this.blockLen=c,this.suffix=S,this.outputLen=v,this.enableXOF=T,this.rounds=D,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(){F(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 T=c.length;for(let D=0;D<T;){const m=Math.min(S-this.pos,T-D);for(let p=0;p<m;p++)v[this.pos++]^=c[D++];this.pos===S&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:c,suffix:S,pos:v,blockLen:T}=this;c[v]^=S,S&128&&v===T-1&&this.keccak(),c[T-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 T=0,D=c.length;T<D;){this.posOut>=v&&this.keccak();const m=Math.min(v-this.posOut,D-T);c.set(S.subarray(this.posOut,this.posOut+m),T),this.posOut+=m,T+=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:T,rounds:D,enableXOF:m}=this;return c||(c=new P(S,v,T,m,D)),c.state32.set(this.state32),c.pos=this.pos,c.posOut=this.posOut,c.finished=this.finished,c.rounds=D,c.suffix=v,c.outputLen=T,c.enableXOF=m,c.destroyed=this.destroyed,c}};e.Keccak=P;var R=(c,S,v)=>(0,i.wrapConstructor)(()=>new P(S,c,v));e.sha3_224=R(6,144,224/8),e.sha3_256=R(6,136,256/8),e.sha3_384=R(6,104,384/8),e.sha3_512=R(6,72,512/8),e.keccak_224=R(1,144,224/8),e.keccak_256=R(1,136,256/8),e.keccak_384=R(1,104,384/8),e.keccak_512=R(1,72,512/8);var d=(c,S,v)=>(0,i.wrapConstructorWithOpts)((T={})=>new P(S,c,T.dkLen===void 0?v:T.dkLen,!0));e.shake128=d(31,168,128/8),e.shake256=d(31,136,256/8)}}),Cr=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=Br(),t=Fi();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)}}),Mr=Z({"optimize-deps:ethereum-cryptography/keccak"(e,n){n.exports=Cr()}}),xr=Mr(),qr=Z({"optimize-deps:ethereum-cryptography/utils"(e,n){n.exports=Fi()}}),jr=qr();function $r(e){let n="0x";for(const t of e){const i=t.toString(16);n+=i.length===1?`0${i}`:i}return n}const Gr=e=>{if(!/^(0x)?[0-9a-f]{40}$/i.test(e))return!1;const n=e.slice(2),t=jr.utf8ToBytes(n.toLowerCase()),i=$r(xr.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 Qr(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:Gr(e):!1}const st=e=>Math.round((e+Number.EPSILON)*100)/100;class Jr{client;constructor(n){this.client=n}async create(n){return(await this.client.query({query:le,variables:{createDirectPaymentInput:{...n,amount:st(n.amount),provider:vi.CHECKBOOK}}}))?.createDirectPayment}async transactionPrice(n){return(await this.client.query({query:le,variables:{amount:st(n)}}))?.transactionPrice??0}async getWeb3PaymentParams(n){if(!Qr(n.paymentTokenAddress))throw new Error("Invalid token address");return(await this.client.query({query:Sn,variables:{amount:st(n.paymentRequest.amountDue),network:n.paymentRequest.network,tokenAddress:n.paymentTokenAddress,reference:n.paymentRequest.id}}))?.spritzPayParams}}var Nn={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}};Nn.loc.source={body:`fragment UserFragment on User {
|
|
213
213
|
id
|
|
214
214
|
sub
|
|
215
215
|
email
|
|
@@ -220,14 +220,14 @@ mutation CreatePaymentRequest($createDirectPaymentInput: CreateDirectPaymentInpu
|
|
|
220
220
|
createdAt
|
|
221
221
|
timezone
|
|
222
222
|
}
|
|
223
|
-
`,name:"GraphQL request",locationOffset:{line:1,column:1}};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
|
|
223
|
+
`,name:"GraphQL request",locationOffset:{line:1,column:1}};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 ut={};(function(){Nn.definitions.forEach(function(n){if(n.name){var t=new Set;Tn(n,t),ut[n.name.value]=t}})})();function Oi(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:[Oi(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var i=ut[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=ut[o]||new Set;s.forEach(function(l){r.add(l)})}})}return a.forEach(function(o){var s=Oi(e,o);s&&t.definitions.push(s)}),t}Hr(Nn,"UserFragment");var Ee={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}};Ee.loc.source={body:`#import "./userFragment.graphql"
|
|
224
224
|
|
|
225
225
|
query CurrentUser {
|
|
226
226
|
me {
|
|
227
227
|
...UserFragment
|
|
228
228
|
}
|
|
229
229
|
}
|
|
230
|
-
`,name:"GraphQL request",locationOffset:{line:1,column:1}};var
|
|
230
|
+
`,name:"GraphQL request",locationOffset:{line:1,column:1}};var Ai={};function zr(e){return e.filter(function(n){if(n.kind!=="FragmentDefinition")return!0;var t=n.name.value;return Ai[t]?!1:(Ai[t]=!0,!0)})}Ee.definitions=Ee.definitions.concat(zr(Nn.definitions));function En(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){En(i,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(i){En(i,n)}),e.definitions&&e.definitions.forEach(function(i){En(i,n)})}var ct={};(function(){Ee.definitions.forEach(function(n){if(n.name){var t=new Set;En(n,t),ct[n.name.value]=t}})})();function _i(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 Yr(e,n){var t={kind:e.kind,definitions:[_i(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var i=ct[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=ct[o]||new Set;s.forEach(function(l){r.add(l)})}})}return a.forEach(function(o){var s=_i(e,o);s&&t.definitions.push(s)}),t}Yr(Ee,"CurrentUser");var In={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}};In.loc.source={body:`query UserVerification {
|
|
231
231
|
verification {
|
|
232
232
|
userId
|
|
233
233
|
identity {
|
|
@@ -243,7 +243,7 @@ query CurrentUser {
|
|
|
243
243
|
}
|
|
244
244
|
}
|
|
245
245
|
}
|
|
246
|
-
`,name:"GraphQL request",locationOffset:{line:1,column:1}};function wn(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){wn(i,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(i){wn(i,n)}),e.definitions&&e.definitions.forEach(function(i){wn(i,n)})}var
|
|
246
|
+
`,name:"GraphQL request",locationOffset:{line:1,column:1}};function wn(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){wn(i,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(i){wn(i,n)}),e.definitions&&e.definitions.forEach(function(i){wn(i,n)})}var lt={};(function(){In.definitions.forEach(function(n){if(n.name){var t=new Set;wn(n,t),lt[n.name.value]=t}})})();function Ri(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:[Ri(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var i=lt[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=lt[o]||new Set;s.forEach(function(l){r.add(l)})}})}return a.forEach(function(o){var s=Ri(e,o);s&&t.definitions.push(s)}),t}Kr(In,"UserVerification");class Xr{client;constructor(n){this.client=n}async createUser(n){const{data:t}=await this.client.baseClient.post("/users/integration",n);return t}async create(n){try{const{data:t}=await this.client.baseClient.post("/users/integration",n);return t}catch(t){console.log(t.message)}}async getCurrentUser(){return(await this.client.query({query:Ee}))?.me??null}async getUserVerification(){return(await this.client.query({query:In}))?.verification??null}}var qe={kind:"Document",definitions:[{kind:"FragmentDefinition",name:{kind:"Name",value:"VirtualDebitCardFragment"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"VirtualCard"}},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:"Field",name:{kind:"Name",value:"mask"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"balance"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"renderSecret"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"virtualCardType"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"billingInfo"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"holder"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"phone"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"email"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"address"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"street"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"street2"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"city"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"subdivision"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"postalCode"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"countryCode"},arguments:[],directives:[]}]}}]}}]}}],loc:{start:0,end:408}};qe.loc.source={body:`fragment VirtualDebitCardFragment on VirtualCard {
|
|
247
247
|
id
|
|
248
248
|
name
|
|
249
249
|
userId
|
|
@@ -269,18 +269,18 @@ query CurrentUser {
|
|
|
269
269
|
}
|
|
270
270
|
}
|
|
271
271
|
}
|
|
272
|
-
`,name:"GraphQL request",locationOffset:{line:1,column:1}};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
|
|
272
|
+
`,name:"GraphQL request",locationOffset:{line:1,column:1}};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 dt={};(function(){qe.definitions.forEach(function(n){if(n.name){var t=new Set;Dn(n,t),dt[n.name.value]=t}})})();function Li(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 Wr(e,n){var t={kind:e.kind,definitions:[Li(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var i=dt[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=dt[o]||new Set;s.forEach(function(l){r.add(l)})}})}return a.forEach(function(o){var s=Li(e,o);s&&t.definitions.push(s)}),t}Wr(qe,"VirtualDebitCardFragment");var Ie={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"CreateUSVirtualDebitCard"},variableDefinitions:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"createUSVirtualDebitCard"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"VirtualDebitCardFragment"},directives:[]}]}}]}}],loc:{start:0,end:166}};Ie.loc.source={body:`#import "../queries/virtualDebitCardFragment.graphql"
|
|
273
273
|
|
|
274
274
|
mutation CreateUSVirtualDebitCard {
|
|
275
275
|
createUSVirtualDebitCard {
|
|
276
276
|
...VirtualDebitCardFragment
|
|
277
277
|
}
|
|
278
278
|
}
|
|
279
|
-
`,name:"GraphQL request",locationOffset:{line:1,column:1}};var
|
|
279
|
+
`,name:"GraphQL request",locationOffset:{line:1,column:1}};var Pi={};function Zr(e){return e.filter(function(n){if(n.kind!=="FragmentDefinition")return!0;var t=n.name.value;return Pi[t]?!1:(Pi[t]=!0,!0)})}Ie.definitions=Ie.definitions.concat(Zr(qe.definitions));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 ft={};(function(){Ie.definitions.forEach(function(n){if(n.name){var t=new Set;Fn(n,t),ft[n.name.value]=t}})})();function Ui(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 eo(e,n){var t={kind:e.kind,definitions:[Ui(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var i=ft[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=ft[o]||new Set;s.forEach(function(l){r.add(l)})}})}return a.forEach(function(o){var s=Ui(e,o);s&&t.definitions.push(s)}),t}eo(Ie,"CreateUSVirtualDebitCard");var we={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"UserVirtualDebitCard"},variableDefinitions:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"virtualDebitCard"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"VirtualDebitCardFragment"},directives:[]}]}}]}}],loc:{start:0,end:142}};we.loc.source={body:`#import "./virtualDebitCardFragment.graphql"
|
|
280
280
|
|
|
281
281
|
query UserVirtualDebitCard {
|
|
282
282
|
virtualDebitCard {
|
|
283
283
|
...VirtualDebitCardFragment
|
|
284
284
|
}
|
|
285
285
|
}
|
|
286
|
-
`,name:"GraphQL request",locationOffset:{line:1,column:1}};var
|
|
286
|
+
`,name:"GraphQL request",locationOffset:{line:1,column:1}};var Vi={};function no(e){return e.filter(function(n){if(n.kind!=="FragmentDefinition")return!0;var t=n.name.value;return Vi[t]?!1:(Vi[t]=!0,!0)})}we.definitions=we.definitions.concat(no(qe.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 vt={};(function(){we.definitions.forEach(function(n){if(n.name){var t=new Set;On(n,t),vt[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 to(e,n){var t={kind:e.kind,definitions:[Bi(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var i=vt[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=vt[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}to(we,"UserVirtualDebitCard");const io={[Zn.USVirtualDebitCard]:e=>({query:Ie,variables:void 0,response:"createUSVirtualDebitCard"})},ao=(e,n)=>io[e]?.(n)??null;class ro{client;constructor(n){this.client=n}async fetch(){return(await this.client.query({query:we}))?.virtualDebitCard??null}async create(n,t){const i=ao(n,t);if(!i)throw new Error("Invalid virtual card type");return(await this.client.query({query:i.query,variables:i.variables}))?.[i.response]??null}}class pt{constructor(n,t,i){this.apiKey=n,this.integrationKey=t,this.environment=i}client;user;bankAccount;paymentRequest;payment;virtualCard;static initialize({environment:n,apiKey:t="",integrationKey:i=""}){const a=new pt(t,i,n);return a.init(),a}init(){this.client=new lr(this.environment,this.apiKey,this.integrationKey),this.user=new Xr(this.client),this.bankAccount=new Er(this.client),this.paymentRequest=new Jr(this.client),this.payment=new Ar(this.client),this.virtualCard=new ro(this.client)}setApiKey(n){return this.apiKey=n,this.init(),this}}var Ci=(e=>(e.Staging="staging",e.Production="production",e))(Ci||{}),Mi=(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))(Mi||{});export{pi as BankAccountSubType,Wn as BankAccountType,Ci as Environment,hi as PayableAccountType,Mi as PaymentNetwork,mi as PaymentRequestStatus,yi as PaymentStatus,pt as SpritzApiClient,Zn as VirtualCardType};
|