nuxt-graphql-middleware 4.0.0-beta.9 → 4.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (69) hide show
  1. package/README.md +10 -2
  2. package/dist/client/200.html +10 -16
  3. package/dist/client/404.html +10 -16
  4. package/dist/client/_nuxt/Bk31qVW4.js +1 -0
  5. package/dist/client/_nuxt/CHM3Rz8p.js +1 -0
  6. package/dist/client/_nuxt/CUKk0hSk.js +24 -0
  7. package/dist/client/_nuxt/Ca6k-hEN.js +2 -0
  8. package/dist/client/_nuxt/KmIjpfWJ.js +1 -0
  9. package/dist/client/_nuxt/builds/latest.json +1 -0
  10. package/dist/client/_nuxt/builds/meta/debd7d31-13de-43c8-a23f-9d618b1b6aee.json +1 -0
  11. package/dist/client/_nuxt/entry.BMcZ91J5.css +1 -0
  12. package/dist/client/_nuxt/error-404.CjTTbIxB.css +1 -0
  13. package/dist/client/_nuxt/error-500.B4KzowuE.css +1 -0
  14. package/dist/client/_nuxt/index.DCCKx2Zk.css +1 -0
  15. package/dist/client/index.html +10 -16
  16. package/dist/module.d.mts +71 -10
  17. package/dist/module.d.ts +71 -10
  18. package/dist/module.json +6 -2
  19. package/dist/module.mjs +241 -156
  20. package/dist/runtime/composables/nuxtApp.d.ts +9 -4
  21. package/dist/runtime/composables/nuxtApp.js +47 -0
  22. package/dist/runtime/composables/server.d.ts +4 -3
  23. package/dist/runtime/composables/{server.mjs → server.js} +2 -2
  24. package/dist/runtime/composables/shared.d.ts +12 -7
  25. package/dist/runtime/composables/useAsyncGraphqlQuery.d.ts +22 -0
  26. package/dist/runtime/composables/useAsyncGraphqlQuery.js +43 -0
  27. package/dist/runtime/composables/useGraphqlMutation.d.ts +3 -2
  28. package/dist/runtime/composables/{useGraphqlMutation.mjs → useGraphqlMutation.js} +2 -2
  29. package/dist/runtime/composables/useGraphqlQuery.d.ts +3 -2
  30. package/dist/runtime/composables/useGraphqlQuery.js +20 -0
  31. package/dist/runtime/composables/useGraphqlState.d.ts +1 -1
  32. package/dist/runtime/composables/{useGraphqlState.mjs → useGraphqlState.js} +1 -1
  33. package/dist/runtime/composables/useGraphqlUploadMutation.d.ts +7 -0
  34. package/dist/runtime/composables/useGraphqlUploadMutation.js +57 -0
  35. package/dist/runtime/helpers/ClientCache.d.ts +15 -0
  36. package/dist/runtime/helpers/ClientCache.js +40 -0
  37. package/dist/runtime/helpers/{index.mjs → index.js} +1 -1
  38. package/dist/runtime/plugins/provideState.d.ts +1 -1
  39. package/dist/runtime/plugins/provideState.js +17 -0
  40. package/dist/runtime/serverHandler/helpers/index.d.ts +6 -4
  41. package/dist/runtime/serverHandler/helpers/{index.mjs → index.js} +2 -2
  42. package/dist/runtime/serverHandler/{index.mjs → index.js} +3 -3
  43. package/dist/runtime/serverHandler/upload.d.ts +2 -0
  44. package/dist/runtime/serverHandler/upload.js +101 -0
  45. package/dist/runtime/serverOptions/defineGraphqlServerOptions.d.ts +2 -2
  46. package/dist/runtime/serverOptions/index.d.ts +1 -1
  47. package/dist/runtime/serverOptions/{index.mjs → index.js} +1 -1
  48. package/dist/runtime/types.d.ts +24 -0
  49. package/dist/runtime/types.js +0 -0
  50. package/dist/types.d.mts +2 -8
  51. package/dist/types.d.ts +2 -8
  52. package/package.json +50 -36
  53. package/dist/client/_nuxt/_plugin-vue_export-helper.c27b6911.js +0 -1
  54. package/dist/client/_nuxt/entry.1bc811cf.css +0 -1
  55. package/dist/client/_nuxt/entry.ea5ff097.js +0 -7
  56. package/dist/client/_nuxt/error-404.0c27f143.js +0 -1
  57. package/dist/client/_nuxt/error-404.a6f724cc.css +0 -1
  58. package/dist/client/_nuxt/error-500.0ea30584.js +0 -1
  59. package/dist/client/_nuxt/error-500.d92554dd.css +0 -1
  60. package/dist/client/_nuxt/index.3f9296a3.css +0 -1
  61. package/dist/client/_nuxt/index.e982558e.js +0 -2
  62. package/dist/client/_nuxt/vue.f36acd1f.b03bdbb5.js +0 -1
  63. package/dist/runtime/composables/nuxtApp.mjs +0 -15
  64. package/dist/runtime/composables/useGraphqlQuery.mjs +0 -9
  65. package/dist/runtime/plugins/provideState.mjs +0 -7
  66. /package/dist/runtime/composables/{shared.mjs → shared.js} +0 -0
  67. /package/dist/runtime/serverHandler/{debug.mjs → debug.js} +0 -0
  68. /package/dist/runtime/serverOptions/{defineGraphqlServerOptions.mjs → defineGraphqlServerOptions.js} +0 -0
  69. /package/dist/runtime/settings/{index.mjs → index.js} +0 -0
@@ -0,0 +1,2 @@
1
+ import{d as K,t as z,v as I,L as W,r as ne,G as xe,i as X,K as Pe,M as Ae,N as G,O as Se,P as We,Q as T,x as O,R as Ee,S as ze,T as j,U as R,y as Q,V as Ue,W as Re,X as ee,Y as ye,z as q,A as de,B as Fe,Z as Qe,C as Je,D as Ge,_ as Ke}from"./CUKk0hSk.js";const De=K({__name:"NIcon",props:{icon:{}},setup(o){return(e,t)=>(z(),I("div",{class:W(["n-icon",e.icon])},null,2))}});typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const Xe=o=>typeof o<"u";function He(o){return JSON.parse(JSON.stringify(o))}function Ve(o,e,t,i={}){var n,r,a;const{clone:u=!1,passive:l=!1,eventName:s,deep:c=!1,defaultValue:f,shouldEmit:h}=i,d=Pe(),y=t||(d==null?void 0:d.emit)||((n=d==null?void 0:d.$emit)==null?void 0:n.bind(d))||((a=(r=d==null?void 0:d.proxy)==null?void 0:r.$emit)==null?void 0:a.bind(d==null?void 0:d.proxy));let v=s;e||(e="modelValue"),v=v||`update:${e.toString()}`;const m=p=>u?typeof u=="function"?u(p):He(p):p,g=()=>Xe(o[e])?m(o[e]):f,x=p=>{h?h(p)&&y(v,p):y(v,p)};if(l){const p=g(),A=ne(p);let b=!1;return xe(()=>o[e],S=>{b||(b=!0,A.value=m(S),Ae(()=>b=!1))}),xe(A,S=>{!b&&(S!==o[e]||c)&&x(S)},{deep:c}),A}else return X({get(){return g()},set(p){x(p)}})}const Ye={class:"n-text-input flex flex items-center border n-border-base rounded py-1 pl-1 pr-2 focus-within:n-focus-base focus-within:border-context n-bg-base"},Ze=K({__name:"NTextInput",props:{modelValue:{default:""},icon:{},placeholder:{},disabled:{type:Boolean},autofocus:{type:Boolean},autocomplete:{},readonly:{type:Boolean},type:{default:"text"}},setup(o,{emit:e}){const n=Ve(o,"modelValue",e,{passive:!0});return(r,a)=>{const u=De;return z(),I("div",Ye,[G(r.$slots,"icon",{},()=>[r.icon?(z(),j(u,{key:0,icon:r.icon,class:"ml-0.3em mr-0.1em text-1.1em op50"},null,8,["icon"])):R("",!0)]),Se(O("input",Ee({"onUpdate:modelValue":a[0]||(a[0]=l=>ze(n)?n.value=l:null)},r.$props,{class:"ml-0.4em w-full flex-auto n-bg-base !outline-none"}),null,16),[[We,T(n)]])])}}}),Me=K({__name:"Tag",props:{green:{type:Boolean},orange:{type:Boolean},text:{}},setup(o){const e=o,t=X(()=>e.green?"bg-green-400:10 text-green-400":e.orange?"bg-orange-400:10 text-orange-400":"bg-gray-400:10 text-gray");return(i,n)=>(z(),I("span",{class:W(["mx-0.5 select-none whitespace-nowrap rounded px-1.5 py-0.5 text-xs inline-block",T(t)])},Q(i.text),3))}});let Z;const te=[];function Oe(o){if(te.push(o),!(typeof window>"u"))return window.__NUXT_DEVTOOLS__&&te.forEach(e=>e(window.__NUXT_DEVTOOLS__)),Object.defineProperty(window,"__NUXT_DEVTOOLS__",{set(e){e&&te.forEach(t=>t(e))},get(){return Z.value},configurable:!0}),()=>{te.splice(te.indexOf(o),1)}}function qe(){Z||(Z=Ue(),Oe(e));function o(){Re(Z)}function e(t){Z.value=t,t.host&&t.host.hooks.hook("host:update:reactivity",o)}return Z}const je=qe(),et=["innerHTML"],tt={class:"shiki"},rt=["textContent"],nt=O("br",null,null,-1),ot=K({__name:"NCodeBlock",props:{code:{},lang:{},lines:{type:Boolean,default:!0},transformRendered:{}},emits:["loaded"],setup(o,{emit:e}){const t=o,i=e,n=X(()=>{var a;const r=t.lang==="text"?{code:t.code,supported:!1}:((a=je.value)==null?void 0:a.devtools.renderCodeHighlight(t.code,t.lang))||{code:t.code,supported:!1};return r.supported&&t.transformRendered&&(r.code=t.transformRendered(r.code)),r.supported&&Ae(()=>i("loaded")),r});return(r,a)=>r.lang&&n.value.supported?(z(),I("pre",{key:0,class:W(["n-code-block",r.lines?"n-code-block-lines":""]),innerHTML:n.value.code},null,10,et)):(z(),I("pre",{key:1,class:W(["n-code-block",r.lines?"n-code-block-lines":""])},[O("pre",tt,[O("code",null,[(z(!0),I(ee,null,ye(r.code.split(`
2
+ `),(u,l)=>(z(),I(ee,{key:l},[O("span",{class:"line",textContent:Q(u)},null,8,rt),nt],64))),128))])])],2))}}),it={flex:"~ gap-3","items-center":""},at=K({__name:"NIconTitle",props:{icon:{},text:{}},setup(o){return(e,t)=>(z(),I("div",it,[e.icon?(z(),I("div",{key:0,class:W(e.icon)},null,2)):R("",!0),G(e.$slots,"default",{},()=>[O("div",null,Q(e.text),1)])]))}}),ke=o=>(Je("data-v-c51ec814"),o=o(),Ge(),o),ut=["open"],lt={"text-base":""},st={key:0,"text-sm":"",op50:""},ct=ke(()=>O("div",{class:"flex-auto"},null,-1)),ft=ke(()=>O("div",{class:"x-divider"},null,-1)),dt=K({__name:"NSectionBlock",props:{icon:{},text:{},description:{},containerClass:{default:""},headerClass:{},collapse:{type:Boolean,default:!0},open:{type:Boolean,default:!0},padding:{type:[Boolean,String],default:!0}},setup(o){const t=Ve(o,"open",void 0,{passive:!0});function i(n){t.value=n.target.open}return(n,r)=>{const a=De,u=at;return z(),I(ee,null,[O("details",{open:T(t),onToggle:r[0]||(r[0]=(...l)=>i&&i(...l))},[O("summary",{class:W(["cursor-pointer select-none hover:bg-active p4",n.collapse?"":"pointer-events-none"])},[q(u,{icon:n.icon,text:n.text,"text-xl":"",transition:"",class:W([T(t)?"op100":"op60",n.headerClass])},{default:de(()=>[O("div",null,[O("div",lt,[G(n.$slots,"text",{},()=>[Fe(Q(n.text),1)],!0)]),n.description||n.$slots.description?(z(),I("div",st,[G(n.$slots,"description",{},()=>[Fe(Q(n.description),1)],!0)])):R("",!0)]),ct,G(n.$slots,"actions",{},void 0,!0),n.collapse?(z(),j(a,{key:0,icon:"carbon-chevron-down",class:"chevron","cursor-pointer":"","place-self-start":"","text-base":"",op75:"",transition:"","duration-500":""})):R("",!0)]),_:3},8,["icon","text","class"])],2),r._lazyshow1||T(t)?(r._lazyshow1=!0,z(),I(ee,null,[Se(O("div",{class:W(["flex flex-col flex-gap2 pb6 pt2",typeof n.padding=="string"?n.padding:n.padding?"px4":""])},[G(n.$slots,"details",{},void 0,!0),O("div",{class:W([n.containerClass,"mt1"])},[G(n.$slots,"default",{},void 0,!0)],2),G(n.$slots,"footer",{},void 0,!0)],2),[[Qe,T(t)]])],64)):R("v-show-if",!0)],40,ut),ft],64)}}}),ht=Ke(dt,[["__scopeId","data-v-c51ec814"]]),vt={class:"h-full of-auto p2"},pt={class:"p5"},yt={class:"font-mono mb4 font-bold text-3xl"},mt={key:0,class:"mb3"},gt=["href"],xt={key:0,class:"font-mono bg-red-900 text-red-100 p2"},Ft=K({__name:"DocumentDetail",props:{id:{},content:{},isValid:{type:Boolean},errors:{},filename:{},relativePath:{},name:{},operation:{},serverApiPrefix:{}},setup(o){const e=o,t=X(()=>(e.errors||[]).map(n=>n.message)),i=X(()=>{if(e.operation)return`${e.serverApiPrefix}/${e.operation}/${e.name}`});return(n,r)=>{const a=Me,u=ot,l=ht;return z(),I("div",vt,[O("div",pt,[O("h2",yt,Q(n.name),1),T(i)?(z(),I("div",mt,[n.operation==="query"?(z(),j(a,{key:0,green:"",text:"GET"})):(z(),j(a,{key:1,orange:"",text:"POST"})),O("a",{class:"n-transition n-link n-link-base hover:n-link-hover ml2",target:"_blank",href:T(i)},Q(T(i)),9,gt)])):R("",!0)]),q(l,{text:"Document",description:n.relativePath,padding:"px4"},{default:de(()=>[q(u,{code:n.content,lang:"graphql"},null,8,["code"])]),_:1},8,["description"]),q(l,{text:"Errors",description:T(t).length+" errors",padding:"px4"},{default:de(()=>[T(t).length?(z(),I("div",xt,[(z(!0),I(ee,null,ye(T(t),(s,c)=>(z(),I("div",{key:c},Q(s),1))),128))])):R("",!0)]),_:1},8,["description"])])}}});var M=function(){return M=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++){t=arguments[i];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},M.apply(this,arguments)};function wt(o,e,t,i){function n(r){return r instanceof t?r:new t(function(a){a(r)})}return new(t||(t=Promise))(function(r,a){function u(c){try{s(i.next(c))}catch(f){a(f)}}function l(c){try{s(i.throw(c))}catch(f){a(f)}}function s(c){c.done?r(c.value):n(c.value).then(u,l)}s((i=i.apply(o,[])).next())})}function _t(o,e){var t={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},i,n,r,a;return a={next:u(0),throw:u(1),return:u(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function u(s){return function(c){return l([s,c])}}function l(s){if(i)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(t=0)),t;)try{if(i=1,n&&(r=s[0]&2?n.return:s[0]?n.throw||((r=n.return)&&r.call(n),0):n.next)&&!(r=r.call(n,s[1])).done)return r;switch(n=0,r&&(s=[s[0]&2,r.value]),s[0]){case 0:case 1:r=s;break;case 4:return t.label++,{value:s[1],done:!1};case 5:t.label++,n=s[1],s=[0];continue;case 7:s=t.ops.pop(),t.trys.pop();continue;default:if(r=t.trys,!(r=r.length>0&&r[r.length-1])&&(s[0]===6||s[0]===2)){t=0;continue}if(s[0]===3&&(!r||s[1]>r[0]&&s[1]<r[3])){t.label=s[1];break}if(s[0]===6&&t.label<r[1]){t.label=r[1],r=s;break}if(r&&t.label<r[2]){t.label=r[2],t.ops.push(s);break}r[2]&&t.ops.pop(),t.trys.pop();continue}s=e.call(o,t)}catch(c){s=[6,c],n=0}finally{i=r=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}}function F(o){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&o[e],i=0;if(t)return t.call(o);if(o&&typeof o.length=="number")return{next:function(){return o&&i>=o.length&&(o=void 0),{value:o&&o[i++],done:!o}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function B(o,e){var t=typeof Symbol=="function"&&o[Symbol.iterator];if(!t)return o;var i=t.call(o),n,r=[],a;try{for(;(e===void 0||e-- >0)&&!(n=i.next()).done;)r.push(n.value)}catch(u){a={error:u}}finally{try{n&&!n.done&&(t=i.return)&&t.call(i)}finally{if(a)throw a.error}}return r}var bt="ENTRIES",Le="KEYS",Be="VALUES",$="",ae=function(){function o(e,t){var i=e._tree,n=Array.from(i.keys());this.set=e,this._type=t,this._path=n.length>0?[{node:i,keys:n}]:[]}return o.prototype.next=function(){var e=this.dive();return this.backtrack(),e},o.prototype.dive=function(){if(this._path.length===0)return{done:!0,value:void 0};var e=Y(this._path),t=e.node,i=e.keys;if(Y(i)===$)return{done:!1,value:this.result()};var n=t.get(Y(i));return this._path.push({node:n,keys:Array.from(n.keys())}),this.dive()},o.prototype.backtrack=function(){if(this._path.length!==0){var e=Y(this._path).keys;e.pop(),!(e.length>0)&&(this._path.pop(),this.backtrack())}},o.prototype.key=function(){return this.set._prefix+this._path.map(function(e){var t=e.keys;return Y(t)}).filter(function(e){return e!==$}).join("")},o.prototype.value=function(){return Y(this._path).node.get($)},o.prototype.result=function(){switch(this._type){case Be:return this.value();case Le:return this.key();default:return[this.key(),this.value()]}},o.prototype[Symbol.iterator]=function(){return this},o}(),Y=function(o){return o[o.length-1]},Ct=function(o,e,t){var i=new Map;if(e===void 0)return i;for(var n=e.length+1,r=n+t,a=new Uint8Array(r*n).fill(t+1),u=0;u<n;++u)a[u]=u;for(var l=1;l<r;++l)a[l*n]=l;return Ie(o,e,t,i,a,1,n,""),i},Ie=function(o,e,t,i,n,r,a,u){var l,s,c=r*a;try{e:for(var f=F(o.keys()),h=f.next();!h.done;h=f.next()){var d=h.value;if(d===$){var y=n[c-1];y<=t&&i.set(u,[o.get(d),y])}else{for(var v=r,m=0;m<d.length;++m,++v){for(var g=d[m],x=a*v,p=x-a,A=n[x],b=Math.max(0,v-t-1),S=Math.min(a-1,v+t),w=b;w<S;++w){var C=g!==e[w],E=n[p+w]+ +C,D=n[p+w+1]+1,k=n[x+w]+1,_=n[x+w+1]=Math.min(E,D,k);_<A&&(A=_)}if(A>t)continue e}Ie(o.get(d),e,t,i,n,v,a,u+d)}}}catch(L){l={error:L}}finally{try{h&&!h.done&&(s=f.return)&&s.call(f)}finally{if(l)throw l.error}}},ue=function(){function o(e,t){e===void 0&&(e=new Map),t===void 0&&(t=""),this._size=void 0,this._tree=e,this._prefix=t}return o.prototype.atPrefix=function(e){var t,i;if(!e.startsWith(this._prefix))throw new Error("Mismatched prefix");var n=B(ie(this._tree,e.slice(this._prefix.length)),2),r=n[0],a=n[1];if(r===void 0){var u=B(me(a),2),l=u[0],s=u[1];try{for(var c=F(l.keys()),f=c.next();!f.done;f=c.next()){var h=f.value;if(h!==$&&h.startsWith(s)){var d=new Map;return d.set(h.slice(s.length),l.get(h)),new o(d,e)}}}catch(y){t={error:y}}finally{try{f&&!f.done&&(i=c.return)&&i.call(c)}finally{if(t)throw t.error}}}return new o(r,e)},o.prototype.clear=function(){this._size=void 0,this._tree.clear()},o.prototype.delete=function(e){return this._size=void 0,At(this._tree,e)},o.prototype.entries=function(){return new ae(this,bt)},o.prototype.forEach=function(e){var t,i;try{for(var n=F(this),r=n.next();!r.done;r=n.next()){var a=B(r.value,2),u=a[0],l=a[1];e(u,l,this)}}catch(s){t={error:s}}finally{try{r&&!r.done&&(i=n.return)&&i.call(n)}finally{if(t)throw t.error}}},o.prototype.fuzzyGet=function(e,t){return Ct(this._tree,e,t)},o.prototype.get=function(e){var t=he(this._tree,e);return t!==void 0?t.get($):void 0},o.prototype.has=function(e){var t=he(this._tree,e);return t!==void 0&&t.has($)},o.prototype.keys=function(){return new ae(this,Le)},o.prototype.set=function(e,t){if(typeof e!="string")throw new Error("key must be a string");this._size=void 0;var i=le(this._tree,e);return i.set($,t),this},Object.defineProperty(o.prototype,"size",{get:function(){if(this._size)return this._size;this._size=0;for(var e=this.entries();!e.next().done;)this._size+=1;return this._size},enumerable:!1,configurable:!0}),o.prototype.update=function(e,t){if(typeof e!="string")throw new Error("key must be a string");this._size=void 0;var i=le(this._tree,e);return i.set($,t(i.get($))),this},o.prototype.fetch=function(e,t){if(typeof e!="string")throw new Error("key must be a string");this._size=void 0;var i=le(this._tree,e),n=i.get($);return n===void 0&&i.set($,n=t()),n},o.prototype.values=function(){return new ae(this,Be)},o.prototype[Symbol.iterator]=function(){return this.entries()},o.from=function(e){var t,i,n=new o;try{for(var r=F(e),a=r.next();!a.done;a=r.next()){var u=B(a.value,2),l=u[0],s=u[1];n.set(l,s)}}catch(c){t={error:c}}finally{try{a&&!a.done&&(i=r.return)&&i.call(r)}finally{if(t)throw t.error}}return n},o.fromObject=function(e){return o.from(Object.entries(e))},o}(),ie=function(o,e,t){var i,n;if(t===void 0&&(t=[]),e.length===0||o==null)return[o,t];try{for(var r=F(o.keys()),a=r.next();!a.done;a=r.next()){var u=a.value;if(u!==$&&e.startsWith(u))return t.push([o,u]),ie(o.get(u),e.slice(u.length),t)}}catch(l){i={error:l}}finally{try{a&&!a.done&&(n=r.return)&&n.call(r)}finally{if(i)throw i.error}}return t.push([o,e]),ie(void 0,"",t)},he=function(o,e){var t,i;if(e.length===0||o==null)return o;try{for(var n=F(o.keys()),r=n.next();!r.done;r=n.next()){var a=r.value;if(a!==$&&e.startsWith(a))return he(o.get(a),e.slice(a.length))}}catch(u){t={error:u}}finally{try{r&&!r.done&&(i=n.return)&&i.call(n)}finally{if(t)throw t.error}}},le=function(o,e){var t,i,n=e.length;e:for(var r=0;o&&r<n;){try{for(var a=(t=void 0,F(o.keys())),u=a.next();!u.done;u=a.next()){var l=u.value;if(l!==$&&e[r]===l[0]){for(var s=Math.min(n-r,l.length),c=1;c<s&&e[r+c]===l[c];)++c;var f=o.get(l);if(c===l.length)o=f;else{var h=new Map;h.set(l.slice(c),f),o.set(e.slice(r,r+c),h),o.delete(l),o=h}r+=c;continue e}}}catch(y){t={error:y}}finally{try{u&&!u.done&&(i=a.return)&&i.call(a)}finally{if(t)throw t.error}}var d=new Map;return o.set(e.slice(r),d),d}return o},At=function(o,e){var t=B(ie(o,e),2),i=t[0],n=t[1];if(i!==void 0){if(i.delete($),i.size===0)$e(n);else if(i.size===1){var r=B(i.entries().next().value,2),a=r[0],u=r[1];Te(n,a,u)}}},$e=function(o){if(o.length!==0){var e=B(me(o),2),t=e[0],i=e[1];if(t.delete(i),t.size===0)$e(o.slice(0,-1));else if(t.size===1){var n=B(t.entries().next().value,2),r=n[0],a=n[1];r!==$&&Te(o.slice(0,-1),r,a)}}},Te=function(o,e,t){if(o.length!==0){var i=B(me(o),2),n=i[0],r=i[1];n.set(r+e,t),n.delete(r)}},me=function(o){return o[o.length-1]},re,ge="or",Ne="and",St="and_not",Et=function(){function o(e){if((e==null?void 0:e.fields)==null)throw new Error('MiniSearch: option "fields" must be provided');var t=e.autoVacuum==null||e.autoVacuum===!0?fe:e.autoVacuum;this._options=M(M(M({},ce),e),{autoVacuum:t,searchOptions:M(M({},we),e.searchOptions||{}),autoSuggestOptions:M(M({},Ot),e.autoSuggestOptions||{})}),this._index=new ue,this._documentCount=0,this._documentIds=new Map,this._idToShortId=new Map,this._fieldIds={},this._fieldLength=new Map,this._avgFieldLength=[],this._nextId=0,this._storedFields=new Map,this._dirtCount=0,this._currentVacuum=null,this._enqueuedVacuum=null,this._enqueuedVacuumConditions=pe,this.addFields(this._options.fields)}return o.prototype.add=function(e){var t,i,n,r,a,u,l=this._options,s=l.extractField,c=l.tokenize,f=l.processTerm,h=l.fields,d=l.idField,y=s(e,d);if(y==null)throw new Error('MiniSearch: document does not have ID field "'.concat(d,'"'));if(this._idToShortId.has(y))throw new Error("MiniSearch: duplicate ID ".concat(y));var v=this.addDocumentId(y);this.saveStoredFields(v,e);try{for(var m=F(h),g=m.next();!g.done;g=m.next()){var x=g.value,p=s(e,x);if(p!=null){var A=c(p.toString(),x),b=this._fieldIds[x],S=new Set(A).size;this.addFieldLength(v,b,this._documentCount-1,S);try{for(var w=(n=void 0,F(A)),C=w.next();!C.done;C=w.next()){var E=C.value,D=f(E,x);if(Array.isArray(D))try{for(var k=(a=void 0,F(D)),_=k.next();!_.done;_=k.next()){var L=_.value;this.addTerm(b,v,L)}}catch(V){a={error:V}}finally{try{_&&!_.done&&(u=k.return)&&u.call(k)}finally{if(a)throw a.error}}else D&&this.addTerm(b,v,D)}}catch(V){n={error:V}}finally{try{C&&!C.done&&(r=w.return)&&r.call(w)}finally{if(n)throw n.error}}}}}catch(V){t={error:V}}finally{try{g&&!g.done&&(i=m.return)&&i.call(m)}finally{if(t)throw t.error}}},o.prototype.addAll=function(e){var t,i;try{for(var n=F(e),r=n.next();!r.done;r=n.next()){var a=r.value;this.add(a)}}catch(u){t={error:u}}finally{try{r&&!r.done&&(i=n.return)&&i.call(n)}finally{if(t)throw t.error}}},o.prototype.addAllAsync=function(e,t){var i=this;t===void 0&&(t={});var n=t.chunkSize,r=n===void 0?10:n,a={chunk:[],promise:Promise.resolve()},u=e.reduce(function(c,f,h){var d=c.chunk,y=c.promise;return d.push(f),(h+1)%r===0?{chunk:[],promise:y.then(function(){return new Promise(function(v){return setTimeout(v,0)})}).then(function(){return i.addAll(d)})}:{chunk:d,promise:y}},a),l=u.chunk,s=u.promise;return s.then(function(){return i.addAll(l)})},o.prototype.remove=function(e){var t,i,n,r,a,u,l=this._options,s=l.tokenize,c=l.processTerm,f=l.extractField,h=l.fields,d=l.idField,y=f(e,d);if(y==null)throw new Error('MiniSearch: document does not have ID field "'.concat(d,'"'));var v=this._idToShortId.get(y);if(v==null)throw new Error("MiniSearch: cannot remove document with ID ".concat(y,": it is not in the index"));try{for(var m=F(h),g=m.next();!g.done;g=m.next()){var x=g.value,p=f(e,x);if(p!=null){var A=s(p.toString(),x),b=this._fieldIds[x],S=new Set(A).size;this.removeFieldLength(v,b,this._documentCount,S);try{for(var w=(n=void 0,F(A)),C=w.next();!C.done;C=w.next()){var E=C.value,D=c(E,x);if(Array.isArray(D))try{for(var k=(a=void 0,F(D)),_=k.next();!_.done;_=k.next()){var L=_.value;this.removeTerm(b,v,L)}}catch(V){a={error:V}}finally{try{_&&!_.done&&(u=k.return)&&u.call(k)}finally{if(a)throw a.error}}else D&&this.removeTerm(b,v,D)}}catch(V){n={error:V}}finally{try{C&&!C.done&&(r=w.return)&&r.call(w)}finally{if(n)throw n.error}}}}}catch(V){t={error:V}}finally{try{g&&!g.done&&(i=m.return)&&i.call(m)}finally{if(t)throw t.error}}this._storedFields.delete(v),this._documentIds.delete(v),this._idToShortId.delete(y),this._fieldLength.delete(v),this._documentCount-=1},o.prototype.removeAll=function(e){var t,i;if(e)try{for(var n=F(e),r=n.next();!r.done;r=n.next()){var a=r.value;this.remove(a)}}catch(u){t={error:u}}finally{try{r&&!r.done&&(i=n.return)&&i.call(n)}finally{if(t)throw t.error}}else{if(arguments.length>0)throw new Error("Expected documents to be present. Omit the argument to remove all documents.");this._index=new ue,this._documentCount=0,this._documentIds=new Map,this._idToShortId=new Map,this._fieldLength=new Map,this._avgFieldLength=[],this._storedFields=new Map,this._nextId=0}},o.prototype.discard=function(e){var t=this,i=this._idToShortId.get(e);if(i==null)throw new Error("MiniSearch: cannot discard document with ID ".concat(e,": it is not in the index"));this._idToShortId.delete(e),this._documentIds.delete(i),this._storedFields.delete(i),(this._fieldLength.get(i)||[]).forEach(function(n,r){t.removeFieldLength(i,r,t._documentCount,n)}),this._fieldLength.delete(i),this._documentCount-=1,this._dirtCount+=1,this.maybeAutoVacuum()},o.prototype.maybeAutoVacuum=function(){if(this._options.autoVacuum!==!1){var e=this._options.autoVacuum,t=e.minDirtFactor,i=e.minDirtCount,n=e.batchSize,r=e.batchWait;this.conditionalVacuum({batchSize:n,batchWait:r},{minDirtCount:i,minDirtFactor:t})}},o.prototype.discardAll=function(e){var t,i,n=this._options.autoVacuum;try{this._options.autoVacuum=!1;try{for(var r=F(e),a=r.next();!a.done;a=r.next()){var u=a.value;this.discard(u)}}catch(l){t={error:l}}finally{try{a&&!a.done&&(i=r.return)&&i.call(r)}finally{if(t)throw t.error}}}finally{this._options.autoVacuum=n}this.maybeAutoVacuum()},o.prototype.replace=function(e){var t=this._options,i=t.idField,n=t.extractField,r=n(e,i);this.discard(r),this.add(e)},o.prototype.vacuum=function(e){return e===void 0&&(e={}),this.conditionalVacuum(e)},o.prototype.conditionalVacuum=function(e,t){var i=this;return this._currentVacuum?(this._enqueuedVacuumConditions=this._enqueuedVacuumConditions&&t,this._enqueuedVacuum!=null?this._enqueuedVacuum:(this._enqueuedVacuum=this._currentVacuum.then(function(){var n=i._enqueuedVacuumConditions;return i._enqueuedVacuumConditions=pe,i.performVacuuming(e,n)}),this._enqueuedVacuum)):this.vacuumConditionsMet(t)===!1?Promise.resolve():(this._currentVacuum=this.performVacuuming(e),this._currentVacuum)},o.prototype.performVacuuming=function(e,t){return wt(this,void 0,void 0,function(){var i,n,r,a,u,l,s,c,f,h,d,y,v,m,g,x,p,A,b,S,w,C,E,D,k;return _t(this,function(_){switch(_.label){case 0:if(i=this._dirtCount,!this.vacuumConditionsMet(t))return[3,10];n=e.batchSize||ve.batchSize,r=e.batchWait||ve.batchWait,a=1,_.label=1;case 1:_.trys.push([1,7,8,9]),u=F(this._index),l=u.next(),_.label=2;case 2:if(l.done)return[3,6];s=B(l.value,2),c=s[0],f=s[1];try{for(h=(C=void 0,F(f)),d=h.next();!d.done;d=h.next()){y=B(d.value,2),v=y[0],m=y[1];try{for(g=(D=void 0,F(m)),x=g.next();!x.done;x=g.next())p=B(x.value,1),A=p[0],!this._documentIds.has(A)&&(m.size<=1?f.delete(v):m.delete(A))}catch(L){D={error:L}}finally{try{x&&!x.done&&(k=g.return)&&k.call(g)}finally{if(D)throw D.error}}}}catch(L){C={error:L}}finally{try{d&&!d.done&&(E=h.return)&&E.call(h)}finally{if(C)throw C.error}}return this._index.get(c).size===0&&this._index.delete(c),a%n!==0?[3,4]:[4,new Promise(function(L){return setTimeout(L,r)})];case 3:_.sent(),_.label=4;case 4:a+=1,_.label=5;case 5:return l=u.next(),[3,2];case 6:return[3,9];case 7:return b=_.sent(),S={error:b},[3,9];case 8:try{l&&!l.done&&(w=u.return)&&w.call(u)}finally{if(S)throw S.error}return[7];case 9:this._dirtCount-=i,_.label=10;case 10:return[4,null];case 11:return _.sent(),this._currentVacuum=this._enqueuedVacuum,this._enqueuedVacuum=null,[2]}})})},o.prototype.vacuumConditionsMet=function(e){if(e==null)return!0;var t=e.minDirtCount,i=e.minDirtFactor;return t=t||fe.minDirtCount,i=i||fe.minDirtFactor,this.dirtCount>=t&&this.dirtFactor>=i},Object.defineProperty(o.prototype,"isVacuuming",{get:function(){return this._currentVacuum!=null},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"dirtCount",{get:function(){return this._dirtCount},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"dirtFactor",{get:function(){return this._dirtCount/(1+this._documentCount+this._dirtCount)},enumerable:!1,configurable:!0}),o.prototype.has=function(e){return this._idToShortId.has(e)},o.prototype.getStoredFields=function(e){var t=this._idToShortId.get(e);if(t!=null)return this._storedFields.get(t)},o.prototype.search=function(e,t){var i,n;t===void 0&&(t={});var r=this.executeQuery(e,t),a=[];try{for(var u=F(r),l=u.next();!l.done;l=u.next()){var s=B(l.value,2),c=s[0],f=s[1],h=f.score,d=f.terms,y=f.match,v=d.length||1,m={id:this._documentIds.get(c),score:h*v,terms:Object.keys(y),queryTerms:d,match:y};Object.assign(m,this._storedFields.get(c)),(t.filter==null||t.filter(m))&&a.push(m)}}catch(g){i={error:g}}finally{try{l&&!l.done&&(n=u.return)&&n.call(u)}finally{if(i)throw i.error}}return e===o.wildcard&&t.boostDocument==null&&this._options.searchOptions.boostDocument==null||a.sort(be),a},o.prototype.autoSuggest=function(e,t){var i,n,r,a;t===void 0&&(t={}),t=M(M({},this._options.autoSuggestOptions),t);var u=new Map;try{for(var l=F(this.search(e,t)),s=l.next();!s.done;s=l.next()){var c=s.value,f=c.score,h=c.terms,d=h.join(" "),y=u.get(d);y!=null?(y.score+=f,y.count+=1):u.set(d,{score:f,terms:h,count:1})}}catch(b){i={error:b}}finally{try{s&&!s.done&&(n=l.return)&&n.call(l)}finally{if(i)throw i.error}}var v=[];try{for(var m=F(u),g=m.next();!g.done;g=m.next()){var x=B(g.value,2),y=x[0],p=x[1],f=p.score,h=p.terms,A=p.count;v.push({suggestion:y,terms:h,score:f/A})}}catch(b){r={error:b}}finally{try{g&&!g.done&&(a=m.return)&&a.call(m)}finally{if(r)throw r.error}}return v.sort(be),v},Object.defineProperty(o.prototype,"documentCount",{get:function(){return this._documentCount},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"termCount",{get:function(){return this._index.size},enumerable:!1,configurable:!0}),o.loadJSON=function(e,t){if(t==null)throw new Error("MiniSearch: loadJSON should be given the same options used when serializing the index");return this.loadJS(JSON.parse(e),t)},o.getDefault=function(e){if(ce.hasOwnProperty(e))return se(ce,e);throw new Error('MiniSearch: unknown option "'.concat(e,'"'))},o.loadJS=function(e,t){var i,n,r,a,u,l,s=e.index,c=e.documentCount,f=e.nextId,h=e.documentIds,d=e.fieldIds,y=e.fieldLength,v=e.averageFieldLength,m=e.storedFields,g=e.dirtCount,x=e.serializationVersion;if(x!==1&&x!==2)throw new Error("MiniSearch: cannot deserialize an index created with an incompatible version");var p=new o(t);p._documentCount=c,p._nextId=f,p._documentIds=oe(h),p._idToShortId=new Map,p._fieldIds=d,p._fieldLength=oe(y),p._avgFieldLength=v,p._storedFields=oe(m),p._dirtCount=g||0,p._index=new ue;try{for(var A=F(p._documentIds),b=A.next();!b.done;b=A.next()){var S=B(b.value,2),w=S[0],C=S[1];p._idToShortId.set(C,w)}}catch(U){i={error:U}}finally{try{b&&!b.done&&(n=A.return)&&n.call(A)}finally{if(i)throw i.error}}try{for(var E=F(s),D=E.next();!D.done;D=E.next()){var k=B(D.value,2),_=k[0],L=k[1],V=new Map;try{for(var P=(u=void 0,F(Object.keys(L))),N=P.next();!N.done;N=P.next()){var J=N.value,H=L[J];x===1&&(H=H.ds),V.set(parseInt(J,10),oe(H))}}catch(U){u={error:U}}finally{try{N&&!N.done&&(l=P.return)&&l.call(P)}finally{if(u)throw u.error}}p._index.set(_,V)}}catch(U){r={error:U}}finally{try{D&&!D.done&&(a=E.return)&&a.call(E)}finally{if(r)throw r.error}}return p},o.prototype.executeQuery=function(e,t){var i=this;if(t===void 0&&(t={}),e===o.wildcard)return this.executeWildcardQuery(t);if(typeof e!="string"){var n=M(M(M({},t),e),{queries:void 0}),r=e.queries.map(function(m){return i.executeQuery(m,n)});return this.combineResults(r,n.combineWith)}var a=this._options,u=a.tokenize,l=a.processTerm,s=a.searchOptions,c=M(M({tokenize:u,processTerm:l},s),t),f=c.tokenize,h=c.processTerm,d=f(e).flatMap(function(m){return h(m)}).filter(function(m){return!!m}),y=d.map(Mt(c)),v=y.map(function(m){return i.executeQuerySpec(m,c)});return this.combineResults(v,c.combineWith)},o.prototype.executeQuerySpec=function(e,t){var i,n,r,a,u=M(M({},this._options.searchOptions),t),l=(u.fields||this._options.fields).reduce(function(J,H){var U;return M(M({},J),(U={},U[H]=se(u.boost,H)||1,U))},{}),s=u.boostDocument,c=u.weights,f=u.maxFuzzy,h=u.bm25,d=M(M({},we.weights),c),y=d.fuzzy,v=d.prefix,m=this._index.get(e.term),g=this.termResults(e.term,e.term,1,m,l,s,h),x,p;if(e.prefix&&(x=this._index.atPrefix(e.term)),e.fuzzy){var A=e.fuzzy===!0?.2:e.fuzzy,b=A<1?Math.min(f,Math.round(e.term.length*A)):A;b&&(p=this._index.fuzzyGet(e.term,b))}if(x)try{for(var S=F(x),w=S.next();!w.done;w=S.next()){var C=B(w.value,2),E=C[0],D=C[1],k=E.length-e.term.length;if(k){p==null||p.delete(E);var _=v*E.length/(E.length+.3*k);this.termResults(e.term,E,_,D,l,s,h,g)}}}catch(J){i={error:J}}finally{try{w&&!w.done&&(n=S.return)&&n.call(S)}finally{if(i)throw i.error}}if(p)try{for(var L=F(p.keys()),V=L.next();!V.done;V=L.next()){var E=V.value,P=B(p.get(E),2),N=P[0],k=P[1];if(k){var _=y*E.length/(E.length+k);this.termResults(e.term,E,_,N,l,s,h,g)}}}catch(J){r={error:J}}finally{try{V&&!V.done&&(a=L.return)&&a.call(L)}finally{if(r)throw r.error}}return g},o.prototype.executeWildcardQuery=function(e){var t,i,n=new Map,r=M(M({},this._options.searchOptions),e);try{for(var a=F(this._documentIds),u=a.next();!u.done;u=a.next()){var l=B(u.value,2),s=l[0],c=l[1],f=r.boostDocument?r.boostDocument(c,"",this._storedFields.get(s)):1;n.set(s,{score:f,terms:[],match:{}})}}catch(h){t={error:h}}finally{try{u&&!u.done&&(i=a.return)&&i.call(a)}finally{if(t)throw t.error}}return n},o.prototype.combineResults=function(e,t){if(t===void 0&&(t=ge),e.length===0)return new Map;var i=t.toLowerCase();return e.reduce(zt[i])||new Map},o.prototype.toJSON=function(){var e,t,i,n,r=[];try{for(var a=F(this._index),u=a.next();!u.done;u=a.next()){var l=B(u.value,2),s=l[0],c=l[1],f={};try{for(var h=(i=void 0,F(c)),d=h.next();!d.done;d=h.next()){var y=B(d.value,2),v=y[0],m=y[1];f[v]=Object.fromEntries(m)}}catch(g){i={error:g}}finally{try{d&&!d.done&&(n=h.return)&&n.call(h)}finally{if(i)throw i.error}}r.push([s,f])}}catch(g){e={error:g}}finally{try{u&&!u.done&&(t=a.return)&&t.call(a)}finally{if(e)throw e.error}}return{documentCount:this._documentCount,nextId:this._nextId,documentIds:Object.fromEntries(this._documentIds),fieldIds:this._fieldIds,fieldLength:Object.fromEntries(this._fieldLength),averageFieldLength:this._avgFieldLength,storedFields:Object.fromEntries(this._storedFields),dirtCount:this._dirtCount,index:r,serializationVersion:2}},o.prototype.termResults=function(e,t,i,n,r,a,u,l){var s,c,f,h,d;if(l===void 0&&(l=new Map),n==null)return l;try{for(var y=F(Object.keys(r)),v=y.next();!v.done;v=y.next()){var m=v.value,g=r[m],x=this._fieldIds[m],p=n.get(x);if(p!=null){var A=p.size,b=this._avgFieldLength[x];try{for(var S=(f=void 0,F(p.keys())),w=S.next();!w.done;w=S.next()){var C=w.value;if(!this._documentIds.has(C)){this.removeTerm(x,C,t),A-=1;continue}var E=a?a(this._documentIds.get(C),t,this._storedFields.get(C)):1;if(E){var D=p.get(C),k=this._fieldLength.get(C)[x],_=Vt(D,A,this._documentCount,k,b,u),L=i*g*E*_,V=l.get(C);if(V){V.score+=L,kt(V.terms,e);var P=se(V.match,t);P?P.push(m):V.match[t]=[m]}else l.set(C,{score:L,terms:[e],match:(d={},d[t]=[m],d)})}}}catch(N){f={error:N}}finally{try{w&&!w.done&&(h=S.return)&&h.call(S)}finally{if(f)throw f.error}}}}}catch(N){s={error:N}}finally{try{v&&!v.done&&(c=y.return)&&c.call(y)}finally{if(s)throw s.error}}return l},o.prototype.addTerm=function(e,t,i){var n=this._index.fetch(i,Ce),r=n.get(e);if(r==null)r=new Map,r.set(t,1),n.set(e,r);else{var a=r.get(t);r.set(t,(a||0)+1)}},o.prototype.removeTerm=function(e,t,i){if(!this._index.has(i)){this.warnDocumentChanged(t,e,i);return}var n=this._index.fetch(i,Ce),r=n.get(e);r==null||r.get(t)==null?this.warnDocumentChanged(t,e,i):r.get(t)<=1?r.size<=1?n.delete(e):r.delete(t):r.set(t,r.get(t)-1),this._index.get(i).size===0&&this._index.delete(i)},o.prototype.warnDocumentChanged=function(e,t,i){var n,r;try{for(var a=F(Object.keys(this._fieldIds)),u=a.next();!u.done;u=a.next()){var l=u.value;if(this._fieldIds[l]===t){this._options.logger("warn","MiniSearch: document with ID ".concat(this._documentIds.get(e),' has changed before removal: term "').concat(i,'" was not present in field "').concat(l,'". Removing a document after it has changed can corrupt the index!'),"version_conflict");return}}}catch(s){n={error:s}}finally{try{u&&!u.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}},o.prototype.addDocumentId=function(e){var t=this._nextId;return this._idToShortId.set(e,t),this._documentIds.set(t,e),this._documentCount+=1,this._nextId+=1,t},o.prototype.addFields=function(e){for(var t=0;t<e.length;t++)this._fieldIds[e[t]]=t},o.prototype.addFieldLength=function(e,t,i,n){var r=this._fieldLength.get(e);r==null&&this._fieldLength.set(e,r=[]),r[t]=n;var a=this._avgFieldLength[t]||0,u=a*i+n;this._avgFieldLength[t]=u/(i+1)},o.prototype.removeFieldLength=function(e,t,i,n){if(i===1){this._avgFieldLength[t]=0;return}var r=this._avgFieldLength[t]*i-n;this._avgFieldLength[t]=r/(i-1)},o.prototype.saveStoredFields=function(e,t){var i,n,r=this._options,a=r.storeFields,u=r.extractField;if(!(a==null||a.length===0)){var l=this._storedFields.get(e);l==null&&this._storedFields.set(e,l={});try{for(var s=F(a),c=s.next();!c.done;c=s.next()){var f=c.value,h=u(t,f);h!==void 0&&(l[f]=h)}}catch(d){i={error:d}}finally{try{c&&!c.done&&(n=s.return)&&n.call(s)}finally{if(i)throw i.error}}}},o.wildcard=Symbol("*"),o}(),se=function(o,e){return Object.prototype.hasOwnProperty.call(o,e)?o[e]:void 0},zt=(re={},re[ge]=function(o,e){var t,i;try{for(var n=F(e.keys()),r=n.next();!r.done;r=n.next()){var a=r.value,u=o.get(a);if(u==null)o.set(a,e.get(a));else{var l=e.get(a),s=l.score,c=l.terms,f=l.match;u.score=u.score+s,u.match=Object.assign(u.match,f),_e(u.terms,c)}}}catch(h){t={error:h}}finally{try{r&&!r.done&&(i=n.return)&&i.call(n)}finally{if(t)throw t.error}}return o},re[Ne]=function(o,e){var t,i,n=new Map;try{for(var r=F(e.keys()),a=r.next();!a.done;a=r.next()){var u=a.value,l=o.get(u);if(l!=null){var s=e.get(u),c=s.score,f=s.terms,h=s.match;_e(l.terms,f),n.set(u,{score:l.score+c,terms:l.terms,match:Object.assign(l.match,h)})}}}catch(d){t={error:d}}finally{try{a&&!a.done&&(i=r.return)&&i.call(r)}finally{if(t)throw t.error}}return n},re[St]=function(o,e){var t,i;try{for(var n=F(e.keys()),r=n.next();!r.done;r=n.next()){var a=r.value;o.delete(a)}}catch(u){t={error:u}}finally{try{r&&!r.done&&(i=n.return)&&i.call(n)}finally{if(t)throw t.error}}return o},re),Dt={k:1.2,b:.7,d:.5},Vt=function(o,e,t,i,n,r){var a=r.k,u=r.b,l=r.d,s=Math.log(1+(t-e+.5)/(e+.5));return s*(l+o*(a+1)/(o+a*(1-u+u*i/n)))},Mt=function(o){return function(e,t,i){var n=typeof o.fuzzy=="function"?o.fuzzy(e,t,i):o.fuzzy||!1,r=typeof o.prefix=="function"?o.prefix(e,t,i):o.prefix===!0;return{term:e,fuzzy:n,prefix:r}}},ce={idField:"id",extractField:function(o,e){return o[e]},tokenize:function(o){return o.split(Lt)},processTerm:function(o){return o.toLowerCase()},fields:void 0,searchOptions:void 0,storeFields:[],logger:function(o,e){typeof(console==null?void 0:console[o])=="function"&&console[o](e)},autoVacuum:!0},we={combineWith:ge,prefix:!1,fuzzy:!1,maxFuzzy:6,boost:{},weights:{fuzzy:.45,prefix:.375},bm25:Dt},Ot={combineWith:Ne,prefix:function(o,e,t){return e===t.length-1}},ve={batchSize:1e3,batchWait:10},pe={minDirtFactor:.1,minDirtCount:20},fe=M(M({},ve),pe),kt=function(o,e){o.includes(e)||o.push(e)},_e=function(o,e){var t,i;try{for(var n=F(e),r=n.next();!r.done;r=n.next()){var a=r.value;o.includes(a)||o.push(a)}}catch(u){t={error:u}}finally{try{r&&!r.done&&(i=n.return)&&i.call(n)}finally{if(t)throw t.error}}},be=function(o,e){var t=o.score,i=e.score;return i-t},Ce=function(){return new Map},oe=function(o){var e,t,i=new Map;try{for(var n=F(Object.keys(o)),r=n.next();!r.done;r=n.next()){var a=r.value;i.set(parseInt(a,10),o[a])}}catch(u){e={error:u}}finally{try{r&&!r.done&&(t=n.return)&&t.call(n)}finally{if(e)throw e.error}}return i},Lt=/[\n\r -#%-*,-/:;?@[-\]_{}\u00A0\u00A1\u00A7\u00AB\u00B6\u00B7\u00BB\u00BF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u1680\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2000-\u200A\u2010-\u2029\u202F-\u2043\u2045-\u2051\u2053-\u205F\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u3000-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]+/u;const Bt={class:"relative",style:{height:"100vh"}},It={class:"flex h-full"},$t={class:"h-full border-r border-r-gray-800 of-auto","h-full":"",style:{width:"22rem","min-width":"0",flex:"0 0 auto"}},Tt={flex:"~ col gap2",border:"b base",class:"border-b-gray-800 p3 flex-1"},Nt=["onClick"],Pt={style:{width:"6rem"},class:"text-left"},Wt=["onClick"],Ut=O("span",null,"Copy",-1),Rt=[Ut],Qt=O("div",{class:"splitpanes__splitter"},null,-1),Jt={key:0,class:"h-full relative w-full of-auto"},Gt="nuxt-graphql-middleware",Xt=K({__name:"index",setup(o){let e=new Et({fields:["content","name","filename"],storeFields:["id","content","isValid","errors","filename","relativePath","name","operation"],searchOptions:{fuzzy:.7}});const t=ne(""),i=ne([]),n=ne(""),r=ne(""),a=X(()=>{if(t.value)return i.value.find(c=>c.id===t.value)});async function u(c){e.removeAll(),i.value=c.filter(f=>!!f.operation),await e.addAll(c)}Oe(async c=>{const f=c.devtools.extendClientRpc(Gt,{documentsUpdated(y){u(y)}}),h=await f.getDocuments();u(h);const d=await f.getModuleOptions();r.value=d.serverApiPrefix});function l(c){const f=document.createElement("textarea");f.value=c.content,f.style.top="0",f.style.left="0",f.style.position="fixed",document.body.appendChild(f),f.focus(),f.select();try{const h=document.execCommand("copy")}catch{}document.body.removeChild(f)}const s=X(()=>n.value?e.search(n.value):i.value);return(c,f)=>{const h=Ze,d=Me,y=Ft;return z(),I("div",Bt,[O("div",It,[O("div",$t,[O("div",Tt,[q(h,{modelValue:T(n),"onUpdate:modelValue":f[0]||(f[0]=v=>ze(n)?n.value=v:null),placeholder:"Search documents...",icon:"carbon-search",class:"w-full"},null,8,["modelValue"])]),(z(!0),I(ee,null,ye(T(s),v=>(z(),I("div",{key:v.content,class:"relative group"},[O("button",{class:W(["text-secondary hover:n-bg-hover flex select-none truncate px2 py2 font-mono text-sm w-full",{"text-red-500":!v.isValid}]),onClick:m=>t.value=v.id},[O("div",Pt,[v.operation==="query"?(z(),j(d,{key:0,green:"",text:"Query"})):v.operation==="mutation"?(z(),j(d,{key:1,orange:"",text:"Mutation"})):R("",!0)]),O("div",null,Q(v.name),1)],10,Nt),O("button",{class:"absolute right-0 top-0 text-sm h-full flex items-center opacity-0 group-hover:opacity-100 pr2",onClick:m=>l(v)},Rt,8,Wt)]))),128))]),Qt,T(a)?(z(),I("div",Jt,[q(y,Ee(T(a),{"server-api-prefix":T(r)}),null,16,["server-api-prefix"])])):R("",!0)])])}}});export{Xt as default};
@@ -0,0 +1 @@
1
+ import{u as o}from"./Bk31qVW4.js";import{_ as a,t as s,v as i,x as e,y as r,C as u,D as c}from"./CUKk0hSk.js";const l=t=>(u("data-v-2c66185b"),t=t(),c(),t),d={class:"font-sans antialiased bg-white dark:bg-black text-black dark:text-white grid min-h-screen place-content-center overflow-hidden"},p=l(()=>e("div",{class:"fixed -bottom-1/2 left-0 right-0 h-1/2 spotlight"},null,-1)),h={class:"max-w-520px text-center"},b=["textContent"],g=["textContent"],f={__name:"error-500",props:{appName:{type:String,default:"Nuxt"},version:{type:String,default:""},statusCode:{type:Number,default:500},statusMessage:{type:String,default:"Server error"},description:{type:String,default:"This page is temporarily unavailable."}},setup(t){const n=t;return o({title:`${n.statusCode} - ${n.statusMessage} | ${n.appName}`,script:[],style:[{children:'*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:var(--un-default-border-color, #e5e7eb)}:before,:after{--un-content:""}html{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}h1{font-size:inherit;font-weight:inherit}h1,p{margin:0}*,:before,:after{--un-rotate:0;--un-rotate-x:0;--un-rotate-y:0;--un-rotate-z:0;--un-scale-x:1;--un-scale-y:1;--un-scale-z:1;--un-skew-x:0;--un-skew-y:0;--un-translate-x:0;--un-translate-y:0;--un-translate-z:0;--un-pan-x: ;--un-pan-y: ;--un-pinch-zoom: ;--un-scroll-snap-strictness:proximity;--un-ordinal: ;--un-slashed-zero: ;--un-numeric-figure: ;--un-numeric-spacing: ;--un-numeric-fraction: ;--un-border-spacing-x:0;--un-border-spacing-y:0;--un-ring-offset-shadow:0 0 rgb(0 0 0 / 0);--un-ring-shadow:0 0 rgb(0 0 0 / 0);--un-shadow-inset: ;--un-shadow:0 0 rgb(0 0 0 / 0);--un-ring-inset: ;--un-ring-offset-width:0px;--un-ring-offset-color:#fff;--un-ring-width:0px;--un-ring-color:rgb(147 197 253 / .5);--un-blur: ;--un-brightness: ;--un-contrast: ;--un-drop-shadow: ;--un-grayscale: ;--un-hue-rotate: ;--un-invert: ;--un-saturate: ;--un-sepia: ;--un-backdrop-blur: ;--un-backdrop-brightness: ;--un-backdrop-contrast: ;--un-backdrop-grayscale: ;--un-backdrop-hue-rotate: ;--un-backdrop-invert: ;--un-backdrop-opacity: ;--un-backdrop-saturate: ;--un-backdrop-sepia: }'}]}),(m,x)=>(s(),i("div",d,[p,e("div",h,[e("h1",{class:"text-8xl sm:text-10xl font-medium mb-8",textContent:r(t.statusCode)},null,8,b),e("p",{class:"text-xl px-8 sm:px-0 sm:text-4xl font-light mb-16 leading-tight",textContent:r(t.description)},null,8,g)])]))}},w=a(f,[["__scopeId","data-v-2c66185b"]]);export{w as default};
@@ -0,0 +1 @@
1
+ {"id":"debd7d31-13de-43c8-a23f-9d618b1b6aee","timestamp":1720017684576}
@@ -0,0 +1 @@
1
+ {"id":"debd7d31-13de-43c8-a23f-9d618b1b6aee","timestamp":1720017684576,"matcher":{"static":{},"wildcard":{},"dynamic":{}},"prerendered":[]}
@@ -0,0 +1 @@
1
+ :root{--nui-c-context:125,125,125}html{background-color:#fff}html.dark{background-color:#151515;color:#fff;color-scheme:dark}::-moz-selection{background:#8884}::selection{background:#8884}.shiki .line{display:inline-block;position:relative;width:100%}.shiki.diff .line>span{filter:saturate(.75);opacity:.75}.shiki.diff .line-added,.shiki.diff .line-removed{scroll-margin:5em}.shiki.diff .line-added>span,.shiki.diff .line-removed>span{opacity:1!important;position:inherit;scroll-margin:20px;z-index:100}.shiki.diff .line-added>span{color:#218c3b!important}.shiki.diff .line-removed>span{color:#d15547!important}.shiki .line-added:after{background-color:#43885420}.shiki .line-added:after,.shiki .line-removed:after{bottom:0;content:"";display:block;left:0;position:absolute;right:0;top:0}.shiki .line-removed:after{background-color:#8f4c3926}::view-transition-new(root),::view-transition-old(root){animation:none;mix-blend-mode:normal}::view-transition-old(root){z-index:1}::view-transition-new(root){z-index:2147483646}.dark::view-transition-old(root){z-index:2147483646}.dark::view-transition-new(root){z-index:1}*,:after,:before{border-color:var(--un-default-border-color,#e5e7eb);border-style:solid;border-width:0;box-sizing:border-box}:after,:before{--un-content:""}:host,html{line-height:1.5;-webkit-text-size-adjust:100%;font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-feature-settings:normal;font-variation-settings:normal;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-tap-highlight-color:transparent}body{line-height:inherit;margin:0}hr{border-top-width:1px;color:inherit;height:0}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-size:1em;font-variation-settings:normal}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{border-collapse:collapse;border-color:inherit;text-indent:0}button,input,optgroup,select,textarea{color:inherit;font-family:inherit;font-feature-settings:inherit;font-size:100%;font-variation-settings:inherit;font-weight:inherit;line-height:inherit;margin:0;padding:0}button,select{text-transform:none}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{color:#9ca3af;opacity:1}input::placeholder,textarea::placeholder{color:#9ca3af;opacity:1}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{height:auto;max-width:100%}[hidden]{display:none}*,:after,:before{--un-rotate:0;--un-rotate-x:0;--un-rotate-y:0;--un-rotate-z:0;--un-scale-x:1;--un-scale-y:1;--un-scale-z:1;--un-skew-x:0;--un-skew-y:0;--un-translate-x:0;--un-translate-y:0;--un-translate-z:0;--un-pan-x: ;--un-pan-y: ;--un-pinch-zoom: ;--un-scroll-snap-strictness:proximity;--un-ordinal: ;--un-slashed-zero: ;--un-numeric-figure: ;--un-numeric-spacing: ;--un-numeric-fraction: ;--un-border-spacing-x:0;--un-border-spacing-y:0;--un-ring-offset-shadow:0 0 transparent;--un-ring-shadow:0 0 transparent;--un-shadow-inset: ;--un-shadow:0 0 transparent;--un-ring-inset: ;--un-ring-offset-width:0px;--un-ring-offset-color:#fff;--un-ring-width:0px;--un-ring-color:rgba(147,197,253,.5);--un-blur: ;--un-brightness: ;--un-contrast: ;--un-drop-shadow: ;--un-grayscale: ;--un-hue-rotate: ;--un-invert: ;--un-saturate: ;--un-sepia: ;--un-backdrop-blur: ;--un-backdrop-brightness: ;--un-backdrop-contrast: ;--un-backdrop-grayscale: ;--un-backdrop-hue-rotate: ;--un-backdrop-invert: ;--un-backdrop-opacity: ;--un-backdrop-saturate: ;--un-backdrop-sepia: }::backdrop{--un-rotate:0;--un-rotate-x:0;--un-rotate-y:0;--un-rotate-z:0;--un-scale-x:1;--un-scale-y:1;--un-scale-z:1;--un-skew-x:0;--un-skew-y:0;--un-translate-x:0;--un-translate-y:0;--un-translate-z:0;--un-pan-x: ;--un-pan-y: ;--un-pinch-zoom: ;--un-scroll-snap-strictness:proximity;--un-ordinal: ;--un-slashed-zero: ;--un-numeric-figure: ;--un-numeric-spacing: ;--un-numeric-fraction: ;--un-border-spacing-x:0;--un-border-spacing-y:0;--un-ring-offset-shadow:0 0 transparent;--un-ring-shadow:0 0 transparent;--un-shadow-inset: ;--un-shadow:0 0 transparent;--un-ring-inset: ;--un-ring-offset-width:0px;--un-ring-offset-color:#fff;--un-ring-width:0px;--un-ring-color:rgba(147,197,253,.5);--un-blur: ;--un-brightness: ;--un-contrast: ;--un-drop-shadow: ;--un-grayscale: ;--un-hue-rotate: ;--un-invert: ;--un-saturate: ;--un-sepia: ;--un-backdrop-blur: ;--un-backdrop-brightness: ;--un-backdrop-contrast: ;--un-backdrop-grayscale: ;--un-backdrop-hue-rotate: ;--un-backdrop-invert: ;--un-backdrop-opacity: ;--un-backdrop-saturate: ;--un-backdrop-sepia: }@font-face{font-display:swap;font-family:DM Mono;font-style:normal;font-weight:400;src:url(https://fonts.gstatic.com/s/dmmono/v14/aFTU7PB1QTsUX8KYthSQBLyM.woff2) format("woff2");unicode-range:u+0100-02af,u+0304,u+0308,u+0329,u+1e00-1e9f,u+1ef2-1eff,u+2020,u+20a0-20ab,u+20ad-20c0,u+2113,u+2c60-2c7f,u+a720-a7ff}@font-face{font-display:swap;font-family:DM Mono;font-style:normal;font-weight:400;src:url(https://fonts.gstatic.com/s/dmmono/v14/aFTU7PB1QTsUX8KYthqQBA.woff2) format("woff2");unicode-range:u+00??,u+0131,u+0152-0153,u+02bb-02bc,u+02c6,u+02da,u+02dc,u+0304,u+0308,u+0329,u+2000-206f,u+2074,u+20ac,u+2122,u+2191,u+2193,u+2212,u+2215,u+feff,u+fffd}@font-face{font-display:swap;font-family:DM Sans;font-style:normal;font-weight:400;src:url(https://fonts.gstatic.com/s/dmsans/v15/rP2tp2ywxg089UriI5-g4vlH9VoD8CmcqZG40F9JadbnoEwAopxRR232VGM.woff2) format("woff2");unicode-range:u+0100-02af,u+0304,u+0308,u+0329,u+1e00-1e9f,u+1ef2-1eff,u+2020,u+20a0-20ab,u+20ad-20c0,u+2113,u+2c60-2c7f,u+a720-a7ff}@font-face{font-display:swap;font-family:DM Sans;font-style:normal;font-weight:400;src:url(https://fonts.gstatic.com/s/dmsans/v15/rP2tp2ywxg089UriI5-g4vlH9VoD8CmcqZG40F9JadbnoEwAopxRSW32.woff2) format("woff2");unicode-range:u+00??,u+0131,u+0152-0153,u+02bb-02bc,u+02c6,u+02da,u+02dc,u+0304,u+0308,u+0329,u+2000-206f,u+2074,u+20ac,u+2122,u+2191,u+2193,u+2212,u+2215,u+feff,u+fffd}.carbon-chevron-down{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 32 32' display='inline-block' vertical-align='middle' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M16 22L6 12l1.4-1.4l8.6 8.6l8.6-8.6L26 12z'/%3E%3C/svg%3E")}.carbon-chevron-down,.carbon-search{background-color:currentColor;color:inherit;display:inline-block;height:1.2em;-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;vertical-align:middle;width:1.2em}.carbon-search{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 32 32' display='inline-block' vertical-align='middle' width='1.2em' height='1.2em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='m29 27.586l-7.552-7.552a11.018 11.018 0 1 0-1.414 1.414L27.586 29ZM4 13a9 9 0 1 1 9 9a9.01 9.01 0 0 1-9-9'/%3E%3C/svg%3E")}.n-icon{flex:none}.n-border-base{border-color:#9ca3af33}.dark .n-bg-base{--un-bg-opacity:1;background-color:rgb(21 21 21/var(--un-bg-opacity))}.n-bg-base,.n-code-block{--un-bg-opacity:1;background-color:rgb(255 255 255/var(--un-bg-opacity))}.dark .n-code-block{--un-bg-opacity:1;background-color:rgb(18 18 18/var(--un-bg-opacity))}.hover\:n-bg-hover:hover{background-color:#9ca3af08}.hover\:n-link-hover:hover{--un-text-opacity:1;color:rgba(var(--nui-c-context),var(--un-text-opacity));-webkit-text-decoration-color:rgba(var(--nui-c-context),var(--un-line-opacity))!important;--un-line-opacity:1!important;opacity:1!important;text-decoration-color:rgba(var(--nui-c-context),var(--un-line-opacity))!important;text-decoration-style:dotted}.n-link-base{text-decoration-color:#0003;text-decoration-line:underline;text-underline-offset:2px}.dark .n-link-base{text-decoration-color:#fff6}.focus-within\:n-focus-base:focus-within{--un-ring-width:2px;--un-ring-offset-shadow:var(--un-ring-inset) 0 0 0 var(--un-ring-offset-width) var(--un-ring-offset-color);--un-ring-shadow:var(--un-ring-inset) 0 0 0 calc(var(--un-ring-width) + var(--un-ring-offset-width)) var(--un-ring-color);box-shadow:var(--un-ring-offset-shadow),var(--un-ring-shadow),var(--un-shadow);--un-ring-color:rgba(var(--nui-c-context),.5)}.n-transition{transition-duration:.15s;transition-duration:.2s;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1)}.pointer-events-none{pointer-events:none}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.-bottom-1\/2{bottom:-50%}.left-0{left:0}.right-0{right:0}.top-0{top:0}.z-10{z-index:10}.z-20{z-index:20}.grid{display:grid}.mx-0\.5{margin-left:.125rem;margin-right:.125rem}.mb-16{margin-bottom:4rem}.mb-6{margin-bottom:1.5rem}.mb-8{margin-bottom:2rem}.mb3{margin-bottom:.75rem}.mb4{margin-bottom:1rem}.ml-0\.3em{margin-left:.3em}.ml-0\.4em{margin-left:.4em}.ml2{margin-left:.5rem}.mr-0\.1em{margin-right:.1em}.mt1{margin-top:.25rem}.inline-block{display:inline-block}.h-1\/2{height:50%}.h-auto{height:auto}.h-full,[h-full=""]{height:100%}.h1{height:.25rem}.h2{height:.5rem}.max-w-520px{max-width:520px}.min-h-screen{min-height:100vh}.w-full{width:100%}.flex,[flex~="~"]{display:flex}.flex-1{flex:1 1 0%}.flex-auto{flex:1 1 auto}.flex-col,[flex~=col]{flex-direction:column}.transform{transform:translate(var(--un-translate-x)) translateY(var(--un-translate-y)) translateZ(var(--un-translate-z)) rotate(var(--un-rotate)) rotateX(var(--un-rotate-x)) rotateY(var(--un-rotate-y)) rotate(var(--un-rotate-z)) skew(var(--un-skew-x)) skewY(var(--un-skew-y)) scaleX(var(--un-scale-x)) scaleY(var(--un-scale-y)) scaleZ(var(--un-scale-z))}.cursor-pointer,[cursor-pointer=""]{cursor:pointer}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.place-content-center{place-content:center}.place-self-start,[place-self-start=""]{place-self:start}.items-center,[items-center=""]{align-items:center}.justify-center{justify-content:center}.flex-gap2,.gap2,[flex~=gap2]{gap:.5rem}.gap-3,[flex~=gap-3]{gap:.75rem}.of-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-y-auto{overflow-y:auto}.truncate{overflow:hidden;text-overflow:ellipsis}.truncate,.whitespace-nowrap{white-space:nowrap}.b,.border{border-width:1px}.border-r{border-right-width:1px}[border~=b]{border-bottom-width:1px}.focus-within\:border-context:focus-within{--un-border-opacity:1;border-color:rgba(var(--nui-c-context),var(--un-border-opacity))}.border-b-gray-800{--un-border-opacity:1;--un-border-bottom-opacity:var(--un-border-opacity);border-bottom-color:rgb(31 41 55/var(--un-border-bottom-opacity))}.border-r-gray-800{--un-border-opacity:1;--un-border-right-opacity:var(--un-border-opacity);border-right-color:rgb(31 41 55/var(--un-border-right-opacity))}.rounded{border-radius:.25rem}.rounded-t-md{border-top-left-radius:.375rem;border-top-right-radius:.375rem}.border-none{border-style:none}.bg-black\/5{background-color:#0000000d}.bg-gray-400\:10{background-color:#9ca3af1a}.bg-green-400\:10{background-color:#4ade801a}.bg-orange-400\:10{background-color:#fb923c1a}.bg-red-900{--un-bg-opacity:1;background-color:rgb(127 29 29/var(--un-bg-opacity))}.bg-white{--un-bg-opacity:1;background-color:rgb(255 255 255/var(--un-bg-opacity))}.dark .dark\:bg-black{--un-bg-opacity:1;background-color:rgb(0 0 0/var(--un-bg-opacity))}.dark .dark\:bg-white\/10{background-color:#ffffff1a}.p-8{padding:2rem}.p2{padding:.5rem}.p3{padding:.75rem}.p4{padding:1rem}.p5{padding:1.25rem}.px-1\.5{padding-left:.375rem;padding-right:.375rem}.px-10{padding-left:2.5rem;padding-right:2.5rem}.px-4,.px4{padding-left:1rem;padding-right:1rem}.px-8{padding-left:2rem;padding-right:2rem}.px2{padding-left:.5rem;padding-right:.5rem}.py-0\.5{padding-bottom:.125rem;padding-top:.125rem}.py-1{padding-bottom:.25rem;padding-top:.25rem}.py-2,.py2{padding-bottom:.5rem;padding-top:.5rem}.pb6{padding-bottom:1.5rem}.pl-1{padding-left:.25rem}.pr-2,.pr2{padding-right:.5rem}.pt-14{padding-top:3.5rem}.pt2{padding-top:.5rem}.text-center{text-align:center}.text-left{text-align:left}.text-1\.1em{font-size:1.1em}.text-3xl{font-size:1.875rem;line-height:2.25rem}.text-6xl{font-size:3.75rem;line-height:1}.text-8xl{font-size:6rem;line-height:1}.text-base,[text-base=""]{font-size:1rem;line-height:1.5rem}.text-sm,[text-sm=""]{font-size:.875rem;line-height:1.25rem}.text-xl,[text-xl=""]{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:.75rem;line-height:1rem}.dark .dark\:text-white{--un-text-opacity:1;color:rgb(255 255 255/var(--un-text-opacity))}.text-black{--un-text-opacity:1;color:rgb(0 0 0/var(--un-text-opacity))}.text-gray{--un-text-opacity:1;color:rgb(156 163 175/var(--un-text-opacity))}.text-green-400{--un-text-opacity:1;color:rgb(74 222 128/var(--un-text-opacity))}.text-orange-400{--un-text-opacity:1;color:rgb(251 146 60/var(--un-text-opacity))}.text-red-100{--un-text-opacity:1;color:rgb(254 226 226/var(--un-text-opacity))}.text-red-500{--un-text-opacity:1;color:rgb(239 68 68/var(--un-text-opacity))}.text-truegray{--un-text-opacity:1;color:rgb(163 163 163/var(--un-text-opacity))}.font-bold{font-weight:700}.font-light{font-weight:300}.font-medium{font-weight:500}.leading-tight{line-height:1.25}.font-mono{font-family:DM Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.font-sans{font-family:DM Sans,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji}.antialiased{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.group:hover .group-hover\:opacity-100,.op100{opacity:1}.op50,[op50=""]{opacity:.5}.op60{opacity:.6}.op75,[op75=""]{opacity:.75}.opacity-0{opacity:0}.\!outline-none{outline:2px solid transparent!important;outline-offset:2px!important}.transition,[transition=""]{transition-duration:.15s;transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1)}.duration-500,[duration-500=""]{transition-duration:.5s}.ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}@media (min-width:640px){.sm\:px-0{padding-left:0;padding-right:0}.sm\:px-6{padding-left:1.5rem;padding-right:1.5rem}.sm\:py-3{padding-bottom:.75rem;padding-top:.75rem}.sm\:text-2xl{font-size:1.5rem;line-height:2rem}.sm\:text-4xl{font-size:2.25rem;line-height:2.5rem}.sm\:text-8xl{font-size:6rem;line-height:1}.sm\:text-xl{font-size:1.25rem;line-height:1.75rem}}
@@ -0,0 +1 @@
1
+ .spotlight[data-v-c6c1efc1]{background:linear-gradient(45deg,#00dc82,#36e4da 50%,#0047e1);bottom:-30vh;filter:blur(20vh);height:40vh}.gradient-border[data-v-c6c1efc1]{-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);border-radius:.5rem;position:relative}@media (prefers-color-scheme:light){.gradient-border[data-v-c6c1efc1]{background-color:#ffffff4d}.gradient-border[data-v-c6c1efc1]:before{background:linear-gradient(90deg,#e2e2e2,#e2e2e2 25%,#00dc82,#36e4da 75%,#0047e1)}}@media (prefers-color-scheme:dark){.gradient-border[data-v-c6c1efc1]{background-color:#1414144d}.gradient-border[data-v-c6c1efc1]:before{background:linear-gradient(90deg,#303030,#303030 25%,#00dc82,#36e4da 75%,#0047e1)}}.gradient-border[data-v-c6c1efc1]:before{background-size:400% auto;border-radius:.5rem;bottom:0;content:"";left:0;-webkit-mask:linear-gradient(#fff 0 0) content-box,linear-gradient(#fff 0 0);mask:linear-gradient(#fff 0 0) content-box,linear-gradient(#fff 0 0);-webkit-mask-composite:xor;mask-composite:exclude;opacity:.5;padding:2px;position:absolute;right:0;top:0;transition:background-position .3s ease-in-out,opacity .2s ease-in-out;width:100%}.gradient-border[data-v-c6c1efc1]:hover:before{background-position:-50% 0;opacity:1}.fixed[data-v-c6c1efc1]{position:fixed}.left-0[data-v-c6c1efc1]{left:0}.right-0[data-v-c6c1efc1]{right:0}.z-10[data-v-c6c1efc1]{z-index:10}.z-20[data-v-c6c1efc1]{z-index:20}.grid[data-v-c6c1efc1]{display:grid}.mb-16[data-v-c6c1efc1]{margin-bottom:4rem}.mb-8[data-v-c6c1efc1]{margin-bottom:2rem}.max-w-520px[data-v-c6c1efc1]{max-width:520px}.min-h-screen[data-v-c6c1efc1]{min-height:100vh}.w-full[data-v-c6c1efc1]{width:100%}.flex[data-v-c6c1efc1]{display:flex}.cursor-pointer[data-v-c6c1efc1]{cursor:pointer}.place-content-center[data-v-c6c1efc1]{place-content:center}.items-center[data-v-c6c1efc1]{align-items:center}.justify-center[data-v-c6c1efc1]{justify-content:center}.overflow-hidden[data-v-c6c1efc1]{overflow:hidden}.bg-white[data-v-c6c1efc1]{--un-bg-opacity:1;background-color:rgb(255 255 255/var(--un-bg-opacity))}.px-4[data-v-c6c1efc1]{padding-left:1rem;padding-right:1rem}.px-8[data-v-c6c1efc1]{padding-left:2rem;padding-right:2rem}.py-2[data-v-c6c1efc1]{padding-bottom:.5rem;padding-top:.5rem}.text-center[data-v-c6c1efc1]{text-align:center}.text-8xl[data-v-c6c1efc1]{font-size:6rem;line-height:1}.text-xl[data-v-c6c1efc1]{font-size:1.25rem;line-height:1.75rem}.text-black[data-v-c6c1efc1]{--un-text-opacity:1;color:rgb(0 0 0/var(--un-text-opacity))}.font-light[data-v-c6c1efc1]{font-weight:300}.font-medium[data-v-c6c1efc1]{font-weight:500}.leading-tight[data-v-c6c1efc1]{line-height:1.25}.font-sans[data-v-c6c1efc1]{font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji}.antialiased[data-v-c6c1efc1]{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}@media (prefers-color-scheme:dark){.dark\:bg-black[data-v-c6c1efc1]{--un-bg-opacity:1;background-color:rgb(0 0 0/var(--un-bg-opacity))}.dark\:text-white[data-v-c6c1efc1]{--un-text-opacity:1;color:rgb(255 255 255/var(--un-text-opacity))}}@media (min-width:640px){.sm\:px-0[data-v-c6c1efc1]{padding-left:0;padding-right:0}.sm\:px-6[data-v-c6c1efc1]{padding-left:1.5rem;padding-right:1.5rem}.sm\:py-3[data-v-c6c1efc1]{padding-bottom:.75rem;padding-top:.75rem}.sm\:text-4xl[data-v-c6c1efc1]{font-size:2.25rem;line-height:2.5rem}.sm\:text-xl[data-v-c6c1efc1]{font-size:1.25rem;line-height:1.75rem}}
@@ -0,0 +1 @@
1
+ .spotlight[data-v-2c66185b]{background:linear-gradient(45deg,#00dc82,#36e4da 50%,#0047e1);filter:blur(20vh)}.fixed[data-v-2c66185b]{position:fixed}.-bottom-1\/2[data-v-2c66185b]{bottom:-50%}.left-0[data-v-2c66185b]{left:0}.right-0[data-v-2c66185b]{right:0}.grid[data-v-2c66185b]{display:grid}.mb-16[data-v-2c66185b]{margin-bottom:4rem}.mb-8[data-v-2c66185b]{margin-bottom:2rem}.h-1\/2[data-v-2c66185b]{height:50%}.max-w-520px[data-v-2c66185b]{max-width:520px}.min-h-screen[data-v-2c66185b]{min-height:100vh}.place-content-center[data-v-2c66185b]{place-content:center}.overflow-hidden[data-v-2c66185b]{overflow:hidden}.bg-white[data-v-2c66185b]{--un-bg-opacity:1;background-color:rgb(255 255 255/var(--un-bg-opacity))}.px-8[data-v-2c66185b]{padding-left:2rem;padding-right:2rem}.text-center[data-v-2c66185b]{text-align:center}.text-8xl[data-v-2c66185b]{font-size:6rem;line-height:1}.text-xl[data-v-2c66185b]{font-size:1.25rem;line-height:1.75rem}.text-black[data-v-2c66185b]{--un-text-opacity:1;color:rgb(0 0 0/var(--un-text-opacity))}.font-light[data-v-2c66185b]{font-weight:300}.font-medium[data-v-2c66185b]{font-weight:500}.leading-tight[data-v-2c66185b]{line-height:1.25}.font-sans[data-v-2c66185b]{font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji}.antialiased[data-v-2c66185b]{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}@media (prefers-color-scheme:dark){.dark\:bg-black[data-v-2c66185b]{--un-bg-opacity:1;background-color:rgb(0 0 0/var(--un-bg-opacity))}.dark\:text-white[data-v-2c66185b]{--un-text-opacity:1;color:rgb(255 255 255/var(--un-text-opacity))}}@media (min-width:640px){.sm\:px-0[data-v-2c66185b]{padding-left:0;padding-right:0}.sm\:text-4xl[data-v-2c66185b]{font-size:2.25rem;line-height:2.5rem}}
@@ -0,0 +1 @@
1
+ .n-code-block-lines .shiki code{counter-increment:step calc(var(--start, 1) - 1);counter-reset:step}.n-code-block-lines .shiki code .line:before{content:counter(step);counter-increment:step;display:inline-block;margin-right:.5rem;padding-right:.5rem;text-align:right;width:2.5rem;color:#a3a3a380}details[data-v-c51ec814],summary[data-v-c51ec814]{border-style:none}summary[data-v-c51ec814]{list-style:none}details[open] summary[data-v-c51ec814]{border-style:none}details summary[data-v-c51ec814]::-webkit-details-marker{display:none}details[open] .chevron[data-v-c51ec814]{opacity:.75;transform:rotate(180deg)}
@@ -1,17 +1,11 @@
1
- <!DOCTYPE html>
2
- <html >
3
- <head><meta charset="utf-8">
1
+ <!DOCTYPE html><html data-capo=""><head><meta charset="utf-8">
4
2
  <meta name="viewport" content="width=device-width, initial-scale=1">
5
- <link rel="stylesheet" href="/__nuxt-graphql-middleware/_nuxt/entry.1bc811cf.css">
6
- <link rel="modulepreload" as="script" crossorigin href="/__nuxt-graphql-middleware/_nuxt/entry.ea5ff097.js">
7
- <link rel="prefetch" as="style" href="/__nuxt-graphql-middleware/_nuxt/error-404.a6f724cc.css">
8
- <link rel="prefetch" as="script" crossorigin href="/__nuxt-graphql-middleware/_nuxt/error-404.0c27f143.js">
9
- <link rel="prefetch" as="script" crossorigin href="/__nuxt-graphql-middleware/_nuxt/vue.f36acd1f.b03bdbb5.js">
10
- <link rel="prefetch" as="script" crossorigin href="/__nuxt-graphql-middleware/_nuxt/_plugin-vue_export-helper.c27b6911.js">
11
- <link rel="prefetch" as="style" href="/__nuxt-graphql-middleware/_nuxt/error-500.d92554dd.css">
12
- <link rel="prefetch" as="script" crossorigin href="/__nuxt-graphql-middleware/_nuxt/error-500.0ea30584.js">
13
- <script type="module" src="/__nuxt-graphql-middleware/_nuxt/entry.ea5ff097.js" crossorigin></script><script>"use strict";(()=>{const a=window,e=document.documentElement,m=["dark","light"],c=window.localStorage.getItem("nuxt-color-mode")||"system";let n=c==="system"?f():c;const l=e.getAttribute("data-color-mode-forced");l&&(n=l),i(n),a["__NUXT_COLOR_MODE__"]={preference:c,value:n,getColorScheme:f,addColorScheme:i,removeColorScheme:d};function i(o){const t=""+o+"",s="";e.classList?e.classList.add(t):e.className+=" "+t,s&&e.setAttribute("data-"+s,o)}function d(o){const t=""+o+"",s="";e.classList?e.classList.remove(t):e.className=e.className.replace(new RegExp(t,"g"),""),s&&e.removeAttribute("data-"+s)}function r(o){return a.matchMedia("(prefers-color-scheme"+o+")")}function f(){if(a.matchMedia&&r("").media!=="not all"){for(const o of m)if(r(":"+o).matches)return o}return"light"}})();
14
- </script></head>
15
- <body ><div id="__nuxt"></div><script type="application/json" id="__NUXT_DATA__" data-ssr="false">[{"_errors":1,"serverRendered":2,"data":3,"state":4},{},false,{},{}]</script>
16
- <script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__nuxt-graphql-middleware",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script></body>
17
- </html>
3
+ <link rel="stylesheet" href="/__nuxt-graphql-middleware/_nuxt/entry.BMcZ91J5.css">
4
+ <link rel="modulepreload" as="script" crossorigin href="/__nuxt-graphql-middleware/_nuxt/CUKk0hSk.js">
5
+ <link rel="prefetch" as="style" href="/__nuxt-graphql-middleware/_nuxt/error-404.CjTTbIxB.css">
6
+ <link rel="prefetch" as="script" crossorigin href="/__nuxt-graphql-middleware/_nuxt/CHM3Rz8p.js">
7
+ <link rel="prefetch" as="script" crossorigin href="/__nuxt-graphql-middleware/_nuxt/Bk31qVW4.js">
8
+ <link rel="prefetch" as="style" href="/__nuxt-graphql-middleware/_nuxt/error-500.B4KzowuE.css">
9
+ <link rel="prefetch" as="script" crossorigin href="/__nuxt-graphql-middleware/_nuxt/KmIjpfWJ.js">
10
+ <script type="module" src="/__nuxt-graphql-middleware/_nuxt/CUKk0hSk.js" crossorigin></script></head><body><div id="__nuxt"></div><div id="teleports"></div><script type="application/json" id="__NUXT_DATA__" data-ssr="false">[{"serverRendered":1},false]</script>
11
+ <script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__nuxt-graphql-middleware",buildId:"debd7d31-13de-43c8-a23f-9d618b1b6aee",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script></body></html>
package/dist/module.d.mts CHANGED
@@ -4,10 +4,12 @@ import { SchemaASTConfig } from '@graphql-codegen/schema-ast';
4
4
  import { TypeScriptDocumentsPluginConfig } from '@graphql-codegen/typescript-operations';
5
5
  import { H3Event } from 'h3';
6
6
  import { FetchOptions, FetchResponse, FetchError } from 'ofetch';
7
+ import { GraphqlServerResponse } from '#graphql-middleware/types';
8
+ import { GraphqlMiddlewareResponseUnion } from '#build/nuxt-graphql-middleware';
7
9
 
8
- type GraphqlMiddlewareGraphqlEndpointMethod = (event?: H3Event, operation?: string, operationName?: string) => string | Promise<string> | void;
10
+ type GraphqlMiddlewareGraphqlEndpointMethod = (event?: H3Event, operation?: string, operationName?: string) => string | Promise<string> | undefined;
9
11
  type GraphqlMiddlewareServerFetchOptionsMethod = (event?: H3Event, operation?: string, operationName?: string) => FetchOptions | Promise<FetchOptions>;
10
- type GraphqlMiddlewareOnServerResponseMethod = (event: H3Event, response: FetchResponse<any>, operation?: string, operationName?: string) => any | Promise<any>;
12
+ type GraphqlMiddlewareOnServerResponseMethod<ServerReponse, T> = (event: H3Event, response: FetchResponse<ServerReponse>, operation?: string, operationName?: string) => T | Promise<T>;
11
13
  type GraphqlMiddlewareOnServerErrorMethod = (event: H3Event, error: FetchError, operation?: string, operationName?: string) => any | Promise<any>;
12
14
  type GraphqlMiddlewareDoRequestMethodContext = {
13
15
  /**
@@ -30,18 +32,35 @@ type GraphqlMiddlewareDoRequestMethodContext = {
30
32
  * Variables for the operation.
31
33
  */
32
34
  variables: Record<string, any>;
35
+ /**
36
+ * For file uploads (which are done using FormData), this contains the full
37
+ * form data with these keys:
38
+ *
39
+ * - operations: string
40
+ * A JSON string of an object with "query", "variables" and "operationName" properties.
41
+ * Example:
42
+ * operations='{ "query": "mutation ($id: String!, $file: Upload!) { uploadFile(id: $id, file: $file) { id filename } }", "variables": { "file": null, "id": "1" } }'
43
+ * - map: string
44
+ * A JSON string of an object whose keys are strings starting at '0' and the values being an array with a single string:
45
+ * Example:
46
+ * map='{ "0": ["variables.file"] }'
47
+ * - [number]
48
+ * For every file there is a FormData entry with a name that matches the key in `map`.
49
+ * Example:
50
+ * 0=[Binary File]
51
+ */
52
+ formData?: FormData;
33
53
  };
34
- type GraphqlMiddlewareDoRequestMethod = (context: GraphqlMiddlewareDoRequestMethodContext) => Promise<{
35
- data: any;
36
- errors?: any[];
37
- }>;
54
+ type GraphqlMiddlewareDoRequestMethod<T> = (context: GraphqlMiddlewareDoRequestMethodContext) => Promise<T>;
38
55
  /**
39
56
  * Configuration options during runtime.
40
57
  */
41
- type GraphqlMiddlewareServerOptions = {
58
+ type GraphqlMiddlewareServerOptions<Additions extends object = object, CustomResponse = GraphqlServerResponse<GraphqlMiddlewareResponseUnion> & Additions> = {
42
59
  /**
43
60
  * Custom callback to return the GraphQL endpoint per request.
44
61
  *
62
+ * The method is only called if no `doGraphqlRequest` method is implemented.
63
+ *
45
64
  * @default undefined
46
65
  *
47
66
  * @example
@@ -56,6 +75,8 @@ type GraphqlMiddlewareServerOptions = {
56
75
  /**
57
76
  * Provide the options for the ofetch request to the GraphQL server.
58
77
  *
78
+ * The method is only called if no `doGraphqlRequest` method is implemented.
79
+ *
59
80
  * @default undefined
60
81
  *
61
82
  * @example
@@ -76,6 +97,8 @@ type GraphqlMiddlewareServerOptions = {
76
97
  /**
77
98
  * Handle the response from the GraphQL server.
78
99
  *
100
+ * The method is only called if no `doGraphqlRequest` method is implemented.
101
+ *
79
102
  * You can alter the response, add additional properties to the data, get
80
103
  * and set headers, etc.
81
104
  *
@@ -101,10 +124,12 @@ type GraphqlMiddlewareServerOptions = {
101
124
  * }
102
125
  * ```
103
126
  */
104
- onServerResponse?: GraphqlMiddlewareOnServerResponseMethod;
127
+ onServerResponse?: GraphqlMiddlewareOnServerResponseMethod<GraphqlServerResponse<GraphqlMiddlewareResponseUnion>, CustomResponse>;
105
128
  /**
106
129
  * Handle a fetch error from the GraphQL request.
107
130
  *
131
+ * The method is only called if no `doGraphqlRequest` method is implemented.
132
+ *
108
133
  * Note that errors are only thrown for responses that are not status
109
134
  * 200-299. See https://github.com/unjs/ofetch#%EF%B8%8F-handling-errors for
110
135
  * more information.
@@ -136,6 +161,8 @@ type GraphqlMiddlewareServerOptions = {
136
161
  * This can be used if onServerError, onServerResponse, serverFetchOptions
137
162
  * and graphqlEndpoint are not enough to meet your requirements.
138
163
  *
164
+ * When this method is implemented, all other methods are not called.
165
+ *
139
166
  * The method will be called in the /api/graphql server route and should
140
167
  * perform the GraphQL request and return the response.
141
168
  *
@@ -165,7 +192,7 @@ type GraphqlMiddlewareServerOptions = {
165
192
  * }
166
193
  * ```
167
194
  */
168
- doGraphqlRequest?: GraphqlMiddlewareDoRequestMethod;
195
+ doGraphqlRequest?: GraphqlMiddlewareDoRequestMethod<CustomResponse>;
169
196
  };
170
197
 
171
198
  interface ModuleOptions {
@@ -189,6 +216,15 @@ interface ModuleOptions {
189
216
  * ```
190
217
  */
191
218
  autoImportPatterns?: string[];
219
+ /**
220
+ * Automatically inline fragments.
221
+ *
222
+ * By default, fragments have to imported using the non-standard "#import"
223
+ * syntax.
224
+ *
225
+ * When enabling this feature, the module will automatically inline fragments by name.
226
+ */
227
+ autoInlineFragments?: boolean;
192
228
  /**
193
229
  * Additional raw documents to include.
194
230
  *
@@ -219,6 +255,14 @@ interface ModuleOptions {
219
255
  * ```
220
256
  */
221
257
  includeComposables?: boolean;
258
+ /**
259
+ * Enable support for uploading files via GraphQL.
260
+ *
261
+ * When enabled, an additional `useGraphqlUploadMutation` composable is
262
+ * included, in addition to a new server endpoint that handles multi part
263
+ * file uploads for GraphQL mutations.
264
+ */
265
+ enableFileUploads?: boolean;
222
266
  /**
223
267
  * Enable detailled debugging messages.
224
268
  *
@@ -311,8 +355,25 @@ interface ModuleOptions {
311
355
  * Enable Nuxt DevTools integration.
312
356
  */
313
357
  devtools?: boolean;
358
+ /**
359
+ * Client caching configuration.
360
+ */
361
+ clientCache?: {
362
+ enabled?: boolean;
363
+ maxSize?: number;
364
+ };
365
+ }
366
+ interface ModuleHooks {
314
367
  }
315
- type ModuleHooks = {};
316
368
  declare const _default: _nuxt_schema.NuxtModule<ModuleOptions>;
317
369
 
370
+ declare module 'nuxt/schema' {
371
+ interface AppConfig {
372
+ graphqlMiddleware: {
373
+ clientCacheEnabled: boolean;
374
+ clientCacheMaxSize: number;
375
+ };
376
+ }
377
+ }
378
+
318
379
  export { type GraphqlMiddlewareServerOptions, type ModuleHooks, type ModuleOptions, _default as default };
package/dist/module.d.ts CHANGED
@@ -4,10 +4,12 @@ import { SchemaASTConfig } from '@graphql-codegen/schema-ast';
4
4
  import { TypeScriptDocumentsPluginConfig } from '@graphql-codegen/typescript-operations';
5
5
  import { H3Event } from 'h3';
6
6
  import { FetchOptions, FetchResponse, FetchError } from 'ofetch';
7
+ import { GraphqlServerResponse } from '#graphql-middleware/types';
8
+ import { GraphqlMiddlewareResponseUnion } from '#build/nuxt-graphql-middleware';
7
9
 
8
- type GraphqlMiddlewareGraphqlEndpointMethod = (event?: H3Event, operation?: string, operationName?: string) => string | Promise<string> | void;
10
+ type GraphqlMiddlewareGraphqlEndpointMethod = (event?: H3Event, operation?: string, operationName?: string) => string | Promise<string> | undefined;
9
11
  type GraphqlMiddlewareServerFetchOptionsMethod = (event?: H3Event, operation?: string, operationName?: string) => FetchOptions | Promise<FetchOptions>;
10
- type GraphqlMiddlewareOnServerResponseMethod = (event: H3Event, response: FetchResponse<any>, operation?: string, operationName?: string) => any | Promise<any>;
12
+ type GraphqlMiddlewareOnServerResponseMethod<ServerReponse, T> = (event: H3Event, response: FetchResponse<ServerReponse>, operation?: string, operationName?: string) => T | Promise<T>;
11
13
  type GraphqlMiddlewareOnServerErrorMethod = (event: H3Event, error: FetchError, operation?: string, operationName?: string) => any | Promise<any>;
12
14
  type GraphqlMiddlewareDoRequestMethodContext = {
13
15
  /**
@@ -30,18 +32,35 @@ type GraphqlMiddlewareDoRequestMethodContext = {
30
32
  * Variables for the operation.
31
33
  */
32
34
  variables: Record<string, any>;
35
+ /**
36
+ * For file uploads (which are done using FormData), this contains the full
37
+ * form data with these keys:
38
+ *
39
+ * - operations: string
40
+ * A JSON string of an object with "query", "variables" and "operationName" properties.
41
+ * Example:
42
+ * operations='{ "query": "mutation ($id: String!, $file: Upload!) { uploadFile(id: $id, file: $file) { id filename } }", "variables": { "file": null, "id": "1" } }'
43
+ * - map: string
44
+ * A JSON string of an object whose keys are strings starting at '0' and the values being an array with a single string:
45
+ * Example:
46
+ * map='{ "0": ["variables.file"] }'
47
+ * - [number]
48
+ * For every file there is a FormData entry with a name that matches the key in `map`.
49
+ * Example:
50
+ * 0=[Binary File]
51
+ */
52
+ formData?: FormData;
33
53
  };
34
- type GraphqlMiddlewareDoRequestMethod = (context: GraphqlMiddlewareDoRequestMethodContext) => Promise<{
35
- data: any;
36
- errors?: any[];
37
- }>;
54
+ type GraphqlMiddlewareDoRequestMethod<T> = (context: GraphqlMiddlewareDoRequestMethodContext) => Promise<T>;
38
55
  /**
39
56
  * Configuration options during runtime.
40
57
  */
41
- type GraphqlMiddlewareServerOptions = {
58
+ type GraphqlMiddlewareServerOptions<Additions extends object = object, CustomResponse = GraphqlServerResponse<GraphqlMiddlewareResponseUnion> & Additions> = {
42
59
  /**
43
60
  * Custom callback to return the GraphQL endpoint per request.
44
61
  *
62
+ * The method is only called if no `doGraphqlRequest` method is implemented.
63
+ *
45
64
  * @default undefined
46
65
  *
47
66
  * @example
@@ -56,6 +75,8 @@ type GraphqlMiddlewareServerOptions = {
56
75
  /**
57
76
  * Provide the options for the ofetch request to the GraphQL server.
58
77
  *
78
+ * The method is only called if no `doGraphqlRequest` method is implemented.
79
+ *
59
80
  * @default undefined
60
81
  *
61
82
  * @example
@@ -76,6 +97,8 @@ type GraphqlMiddlewareServerOptions = {
76
97
  /**
77
98
  * Handle the response from the GraphQL server.
78
99
  *
100
+ * The method is only called if no `doGraphqlRequest` method is implemented.
101
+ *
79
102
  * You can alter the response, add additional properties to the data, get
80
103
  * and set headers, etc.
81
104
  *
@@ -101,10 +124,12 @@ type GraphqlMiddlewareServerOptions = {
101
124
  * }
102
125
  * ```
103
126
  */
104
- onServerResponse?: GraphqlMiddlewareOnServerResponseMethod;
127
+ onServerResponse?: GraphqlMiddlewareOnServerResponseMethod<GraphqlServerResponse<GraphqlMiddlewareResponseUnion>, CustomResponse>;
105
128
  /**
106
129
  * Handle a fetch error from the GraphQL request.
107
130
  *
131
+ * The method is only called if no `doGraphqlRequest` method is implemented.
132
+ *
108
133
  * Note that errors are only thrown for responses that are not status
109
134
  * 200-299. See https://github.com/unjs/ofetch#%EF%B8%8F-handling-errors for
110
135
  * more information.
@@ -136,6 +161,8 @@ type GraphqlMiddlewareServerOptions = {
136
161
  * This can be used if onServerError, onServerResponse, serverFetchOptions
137
162
  * and graphqlEndpoint are not enough to meet your requirements.
138
163
  *
164
+ * When this method is implemented, all other methods are not called.
165
+ *
139
166
  * The method will be called in the /api/graphql server route and should
140
167
  * perform the GraphQL request and return the response.
141
168
  *
@@ -165,7 +192,7 @@ type GraphqlMiddlewareServerOptions = {
165
192
  * }
166
193
  * ```
167
194
  */
168
- doGraphqlRequest?: GraphqlMiddlewareDoRequestMethod;
195
+ doGraphqlRequest?: GraphqlMiddlewareDoRequestMethod<CustomResponse>;
169
196
  };
170
197
 
171
198
  interface ModuleOptions {
@@ -189,6 +216,15 @@ interface ModuleOptions {
189
216
  * ```
190
217
  */
191
218
  autoImportPatterns?: string[];
219
+ /**
220
+ * Automatically inline fragments.
221
+ *
222
+ * By default, fragments have to imported using the non-standard "#import"
223
+ * syntax.
224
+ *
225
+ * When enabling this feature, the module will automatically inline fragments by name.
226
+ */
227
+ autoInlineFragments?: boolean;
192
228
  /**
193
229
  * Additional raw documents to include.
194
230
  *
@@ -219,6 +255,14 @@ interface ModuleOptions {
219
255
  * ```
220
256
  */
221
257
  includeComposables?: boolean;
258
+ /**
259
+ * Enable support for uploading files via GraphQL.
260
+ *
261
+ * When enabled, an additional `useGraphqlUploadMutation` composable is
262
+ * included, in addition to a new server endpoint that handles multi part
263
+ * file uploads for GraphQL mutations.
264
+ */
265
+ enableFileUploads?: boolean;
222
266
  /**
223
267
  * Enable detailled debugging messages.
224
268
  *
@@ -311,8 +355,25 @@ interface ModuleOptions {
311
355
  * Enable Nuxt DevTools integration.
312
356
  */
313
357
  devtools?: boolean;
358
+ /**
359
+ * Client caching configuration.
360
+ */
361
+ clientCache?: {
362
+ enabled?: boolean;
363
+ maxSize?: number;
364
+ };
365
+ }
366
+ interface ModuleHooks {
314
367
  }
315
- type ModuleHooks = {};
316
368
  declare const _default: _nuxt_schema.NuxtModule<ModuleOptions>;
317
369
 
370
+ declare module 'nuxt/schema' {
371
+ interface AppConfig {
372
+ graphqlMiddleware: {
373
+ clientCacheEnabled: boolean;
374
+ clientCacheMaxSize: number;
375
+ };
376
+ }
377
+ }
378
+
318
379
  export { type GraphqlMiddlewareServerOptions, type ModuleHooks, type ModuleOptions, _default as default };
package/dist/module.json CHANGED
@@ -1,8 +1,12 @@
1
1
  {
2
2
  "name": "nuxt-graphql-middleware",
3
3
  "configKey": "graphqlMiddleware",
4
- "version": "4.0.0-beta.9",
4
+ "version": "4.1.0",
5
5
  "compatibility": {
6
- "nuxt": "^3.1.0"
6
+ "nuxt": ">=3.1.0"
7
+ },
8
+ "builder": {
9
+ "@nuxt/module-builder": "0.8.1",
10
+ "unbuild": "2.0.0"
7
11
  }
8
12
  }