@tsed/schema 8.9.4 → 8.10.0-rc.1

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.
@@ -0,0 +1,15 @@
1
+ (function(a,V){typeof exports=="object"&&typeof module<"u"?V(exports,require("/home/runner/work/tsed/tsed/node_modules/change-case/dist/index.js"),require("/home/runner/work/tsed/tsed/node_modules/statuses/index.js"),require("/home/runner/work/tsed/tsed/node_modules/picomatch/index.js")):typeof define=="function"&&define.amd?define(["exports","/home/runner/work/tsed/tsed/node_modules/change-case/dist/index.js","/home/runner/work/tsed/tsed/node_modules/statuses/index.js","/home/runner/work/tsed/tsed/node_modules/picomatch/index.js"],V):(a=typeof globalThis<"u"?globalThis:a||self,V(a["@tsed/schema"]={},a.index_js,a.statuses,a.picomatch))})(this,function(a,V,fe,mt){"use strict";var li=a=>{throw TypeError(a)};var mi=(a,V,fe)=>V.has(a)||li("Cannot "+fe);var $=(a,V,fe)=>(mi(a,V,"read from private field"),fe?fe.call(a):V.get(a)),le=(a,V,fe)=>V.has(a)?li("Cannot add the same private member more than once"):V instanceof WeakSet?V.add(a):V.set(a,fe),q=(a,V,fe,mt)=>(mi(a,V,"write to private field"),mt?mt.call(a,fe):V.set(a,fe),fe);var Ie,Se,_e,$e,he,Ee,oe,Ne,Te,we,qe,He;var W=(r=>(r.ALL="ALL",r.GET="GET",r.POST="POST",r.PUT="PUT",r.PATCH="PATCH",r.HEAD="HEAD",r.DELETE="DELETE",r.OPTIONS="OPTIONS",r.TRACE="TRACE",r.PUBLISH="PUBLISH",r.SUBSCRIBE="SUBSCRIBE",r.CUSTOM="CUSTOM",r))(W||{});const di=["ALL","GET","POST","PUT","PATCH","HEAD","DELETE","OPTIONS","TRACE","CUSTOM"],yi=["PUBLISH","SUBSCRIBE"],We=new Map;function C(r,e,t){return We.set(t?`${t}:${r}`:r,e)}function Jr(r,e){const t=We.get(`${e==null?void 0:e.specType}:${r}`)||We.get(r);if(t)return t;throw new Error(`JsonSchema ${r} mapper doesn't exists`)}function I(r,e,t,n){return Jr(r,t)(...e,t,n)}function Jt(r){return We.has(r)}function Gr(r,e){return r.find(t=>We.has(`${e==null?void 0:e.specType}:${t}`))||r.find(t=>We.has(t))}function Gt(r){return r.split("/").filter(Boolean).join("/")}var Bt=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Xe={exports:{}},gi=Xe.exports,Br;function Oi(){return Br||(Br=1,function(r,e){(function(t,n){n(e)})(gi,function(t){var n=i=>{throw TypeError(i)},s=(i,u,h)=>u.has(i)||n("Cannot "+h),o=(i,u,h)=>(s(i,u,"read from private field"),h?h.call(i):u.get(i)),f=(i,u,h)=>u.has(i)?n("Cannot add the same private member more than once"):u instanceof WeakSet?u.add(i):u.set(i,h),m=(i,u,h,d)=>(s(i,u,"write to private field"),u.set(i,h),h),g,O,P,A,U=(i=>(i.PARAM="parameter",i.PARAM_CTOR="parameter.constructor",i.PARAM_STC="parameter.static",i.PROP="property",i.PROP_STC="property.static",i.METHOD="method",i.METHOD_STC="method.static",i.CLASS="class",i))(U||{});function ne(i){return i.prototype?i:i.constructor}function F(i){return ne(i)}function ve(i){const[u,h,d]=i,S=b=>u!==F(u)?b:`${b}.static`;return typeof d=="number"?h?S("parameter"):"parameter.constructor":d&&d.value?S("method"):h&&d===void 0||d?S("property"):U.CLASS}function Re(i){return i===Date||i instanceof Date&&!isNaN(+i)}function Le(i){return typeof i=="function"}function Q(i){return i==null}function k(i){return typeof i=="boolean"||i instanceof Boolean||i===Boolean}function N(i){return typeof i=="boolean"||i instanceof Boolean||i===Boolean}function z(i){return typeof i=="number"}function H(i){return typeof i=="number"||i instanceof Number||i===Number}function j(i){return typeof i=="string"}function pe(i){return typeof i=="string"||i instanceof String||i===String}function It(i){return pe(i)||H(i)||N(i)}function Sr(i){return j(i)||z(i)||k(i)}function Sc(i){return[String,Number,Boolean].includes(i)}function ds(i){return i instanceof RegExp}function Ve(i){return typeof i=="symbol"}function Pc(i){return typeof i=="symbol"||i instanceof Symbol||i===Symbol}const Mc=i=>Q(i)||Sr(i)||Ve(i)||Le(i),ke=(i,u=new WeakMap)=>{if(Mc(i))return i;const h=u.get(i);if(h)return h;if(ArrayBuffer.isView(i))return Buffer.isBuffer(i)?Buffer.from(i):new(F(i))(i.buffer.slice(0),i.byteOffset,i.byteLength);if(Re(i))return new Date(i);if(ds(i))return new RegExp(i);if(Array.isArray(i)){const S=[];return u.set(i,S),i.forEach((b,J)=>S[J]=ke(b,u)),S}if(i instanceof Map){const S=new Map;return u.set(i,S),i.forEach((b,J)=>S.set(ke(J,u),ke(b,u))),S}if(i instanceof Set){const S=new Set;return u.set(i,S),i.forEach(b=>S.add(ke(b,u))),S}const d=Object.create(Reflect.getPrototypeOf(i));return u.set(i,d),Reflect.ownKeys(i).forEach(S=>{const b=Object.getOwnPropertyDescriptor(i,S);b&&(Le(b.value)?Object.defineProperty(d,S,b):Object.defineProperty(d,S,{...b,value:ke(b.value,u)}))}),d};function ys(i){return i?F(i)!==Object?Object.create(i):{}:{}}function _t(i){return["__proto__","constructor","prototype"].includes(i)}function Pr(i){return Object.keys(i).filter(u=>!_t(u))}function gs(i){return(u,h,d)=>{const S=u.findIndex(b=>i(b,h));return S===-1?[...u,h]:(u[S]=ct(u[S],h,d),u)}}const Os=gs((i,u)=>i===u);function Ec({reducers:i,parentKey:u}){return i?u&&i[u]?i[u]:i.default||Os:Os}function Tc(i,u){return Sr(i)||Ve(i)||Le(i)||u===void 0}function wc(i,u){return i==null||i===""&&u!==""}function ct(i,u,h={}){if(wc(u,i))return i;if(Tc(u,i))return u;if(Array.isArray(i)){const S=Ec(h);return[].concat(u).reduce((b,J)=>S(b,J,h),[...i])}const d=ys(i);return[...Pr(i),...Pr(u)].reduce((S,b)=>{var J;const Z=i&&i[b],se=ct(Z,u&&u[b],{...h,parentKey:b});return h.cleanUndefinedProps&&se===void 0||(S[b]=((J=h.alter)==null?void 0:J.call(h,b,se))??se),S},d)}function Je(i,u){return Reflect.getOwnPropertyDescriptor(i&&i.prototype||i,u)}function vc(i,u){var h;return(h=Je(i,u))==null?void 0:h.value}function Ss(i){return typeof i=="function"?i.name:i.constructor.name}const Ps=i=>i.toString().replace("Symbol(","").replace(")","");function Ge(i){switch(typeof i){default:return""+i;case"symbol":return Ps(i);case"function":return Ss(i)}}var Ms=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof Bt<"u"?Bt:typeof self<"u"?self:{},Es={};/*! *****************************************************************************
2
+ Copyright (C) Microsoft. All rights reserved.
3
+ Licensed under the Apache License, Version 2.0 (the "License"); you may not use
4
+ this file except in compliance with the License. You may obtain a copy of the
5
+ License at http://www.apache.org/licenses/LICENSE-2.0
6
+
7
+ THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
8
+ KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
9
+ WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
10
+ MERCHANTABLITY OR NON-INFRINGEMENT.
11
+
12
+ See the Apache Version 2.0 License for specific language governing permissions
13
+ and limitations under the License.
14
+ ***************************************************************************** */var Ts;function Rc(){if(Ts)return Es;Ts=1;var i;return function(u){(function(h){var d=typeof globalThis=="object"?globalThis:typeof Ms=="object"?Ms:typeof self=="object"?self:typeof this=="object"?this:se(),S=b(u);typeof d.Reflect<"u"&&(S=b(d.Reflect,S)),h(S,d),typeof d.Reflect>"u"&&(d.Reflect=u);function b(Ae,je){return function(Be,ht){Object.defineProperty(Ae,Be,{configurable:!0,writable:!0,value:ht}),je&&je(Be,ht)}}function J(){try{return Function("return this;")()}catch{}}function Z(){try{return(0,eval)("(function() { return this; })()")}catch{}}function se(){return J()||Z()}})(function(h,d){var S=Object.prototype.hasOwnProperty,b=typeof Symbol=="function",J=b&&typeof Symbol.toPrimitive<"u"?Symbol.toPrimitive:"@@toPrimitive",Z=b&&typeof Symbol.iterator<"u"?Symbol.iterator:"@@iterator",se=typeof Object.create=="function",Ae={__proto__:[]}instanceof Array,je=!se&&!Ae,Be={create:se?function(){return kr(Object.create(null))}:Ae?function(){return kr({__proto__:null})}:function(){return kr({})},has:je?function(p,l){return S.call(p,l)}:function(p,l){return l in p},get:je?function(p,l){return S.call(p,l)?p[l]:void 0}:function(p,l){return p[l]}},ht=Object.getPrototypeOf(Function),pt=typeof Map=="function"&&typeof Map.prototype.entries=="function"?Map:Ru(),_r=typeof Set=="function"&&typeof Set.prototype.entries=="function"?Set:bu(),$r=typeof WeakMap=="function"?WeakMap:Au(),ze=b?Symbol.for("@reflect-metadata:registry"):void 0,Lt=Tu(),Xs=wu(Lt);function iu(p,l,y,M){if(_(y)){if(!ii(p))throw new TypeError;if(!ai(l))throw new TypeError;return du(p,l)}else{if(!ii(p))throw new TypeError;if(!te(l))throw new TypeError;if(!te(M)&&!_(M)&&!Ye(M))throw new TypeError;return Ye(M)&&(M=void 0),y=Ce(y),yu(p,l,y,M)}}h("decorate",iu);function au(p,l){function y(M,D){if(!te(M))throw new TypeError;if(!_(D)&&!Mu(D))throw new TypeError;ei(p,l,M,D)}return y}h("metadata",au);function ou(p,l,y,M){if(!te(y))throw new TypeError;return _(M)||(M=Ce(M)),ei(p,l,y,M)}h("defineMetadata",ou);function cu(p,l,y){if(!te(l))throw new TypeError;return _(y)||(y=Ce(y)),Qs(p,l,y)}h("hasMetadata",cu);function uu(p,l,y){if(!te(l))throw new TypeError;return _(y)||(y=Ce(y)),Nr(p,l,y)}h("hasOwnMetadata",uu);function fu(p,l,y){if(!te(l))throw new TypeError;return _(y)||(y=Ce(y)),Zs(p,l,y)}h("getMetadata",fu);function hu(p,l,y){if(!te(l))throw new TypeError;return _(y)||(y=Ce(y)),xs(p,l,y)}h("getOwnMetadata",hu);function pu(p,l){if(!te(p))throw new TypeError;return _(l)||(l=Ce(l)),ti(p,l)}h("getMetadataKeys",pu);function lu(p,l){if(!te(p))throw new TypeError;return _(l)||(l=Ce(l)),ri(p,l)}h("getOwnMetadataKeys",lu);function mu(p,l,y){if(!te(l))throw new TypeError;if(_(y)||(y=Ce(y)),!te(l))throw new TypeError;_(y)||(y=Ce(y));var M=lt(l,y,!1);return _(M)?!1:M.OrdinaryDeleteMetadata(p,l,y)}h("deleteMetadata",mu);function du(p,l){for(var y=p.length-1;y>=0;--y){var M=p[y],D=M(l);if(!_(D)&&!Ye(D)){if(!ai(D))throw new TypeError;l=D}}return l}function yu(p,l,y,M){for(var D=p.length-1;D>=0;--D){var ie=p[D],re=ie(l,y,M);if(!_(re)&&!Ye(re)){if(!te(re))throw new TypeError;M=re}}return M}function Qs(p,l,y){var M=Nr(p,l,y);if(M)return!0;var D=Lr(l);return Ye(D)?!1:Qs(p,D,y)}function Nr(p,l,y){var M=lt(l,y,!1);return _(M)?!1:si(M.OrdinaryHasOwnMetadata(p,l,y))}function Zs(p,l,y){var M=Nr(p,l,y);if(M)return xs(p,l,y);var D=Lr(l);if(!Ye(D))return Zs(p,D,y)}function xs(p,l,y){var M=lt(l,y,!1);if(!_(M))return M.OrdinaryGetOwnMetadata(p,l,y)}function ei(p,l,y,M){var D=lt(y,M,!0);D.OrdinaryDefineOwnMetadata(p,l,y,M)}function ti(p,l){var y=ri(p,l),M=Lr(p);if(M===null)return y;var D=ti(M,l);if(D.length<=0)return y;if(y.length<=0)return D;for(var ie=new _r,re=[],G=0,E=y;G<E.length;G++){var T=E[G],w=ie.has(T);w||(ie.add(T),re.push(T))}for(var v=0,B=D;v<B.length;v++){var T=B[v],w=ie.has(T);w||(ie.add(T),re.push(T))}return re}function ri(p,l){var y=lt(p,l,!1);return y?y.OrdinaryOwnMetadataKeys(p,l):[]}function ni(p){if(p===null)return 1;switch(typeof p){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return p===null?1:6;default:return 6}}function _(p){return p===void 0}function Ye(p){return p===null}function gu(p){return typeof p=="symbol"}function te(p){return typeof p=="object"?p!==null:typeof p=="function"}function Ou(p,l){switch(ni(p)){case 0:return p;case 1:return p;case 2:return p;case 3:return p;case 4:return p;case 5:return p}var y="string",M=oi(p,J);if(M!==void 0){var D=M.call(p,y);if(te(D))throw new TypeError;return D}return Su(p)}function Su(p,l){var y,M;{var D=p.toString;if(kt(D)){var M=D.call(p);if(!te(M))return M}var y=p.valueOf;if(kt(y)){var M=y.call(p);if(!te(M))return M}}throw new TypeError}function si(p){return!!p}function Pu(p){return""+p}function Ce(p){var l=Ou(p);return gu(l)?l:Pu(l)}function ii(p){return Array.isArray?Array.isArray(p):p instanceof Object?p instanceof Array:Object.prototype.toString.call(p)==="[object Array]"}function kt(p){return typeof p=="function"}function ai(p){return typeof p=="function"}function Mu(p){switch(ni(p)){case 3:return!0;case 4:return!0;default:return!1}}function qr(p,l){return p===l||p!==p&&l!==l}function oi(p,l){var y=p[l];if(y!=null){if(!kt(y))throw new TypeError;return y}}function ci(p){var l=oi(p,Z);if(!kt(l))throw new TypeError;var y=l.call(p);if(!te(y))throw new TypeError;return y}function ui(p){return p.value}function fi(p){var l=p.next();return l.done?!1:l}function hi(p){var l=p.return;l&&l.call(p)}function Lr(p){var l=Object.getPrototypeOf(p);if(typeof p!="function"||p===ht||l!==ht)return l;var y=p.prototype,M=y&&Object.getPrototypeOf(y);if(M==null||M===Object.prototype)return l;var D=M.constructor;return typeof D!="function"||D===p?l:D}function Eu(){var p;!_(ze)&&typeof d.Reflect<"u"&&!(ze in d.Reflect)&&typeof d.Reflect.defineMetadata=="function"&&(p=vu(d.Reflect));var l,y,M,D=new $r,ie={registerProvider:re,getProvider:E,setProvider:w};return ie;function re(v){if(!Object.isExtensible(ie))throw new Error("Cannot add provider to a frozen registry.");switch(!0){case p===v:break;case _(l):l=v;break;case l===v:break;case _(y):y=v;break;case y===v:break;default:M===void 0&&(M=new _r),M.add(v);break}}function G(v,B){if(!_(l)){if(l.isProviderFor(v,B))return l;if(!_(y)){if(y.isProviderFor(v,B))return l;if(!_(M))for(var Y=ci(M);;){var x=fi(Y);if(!x)return;var Pe=ui(x);if(Pe.isProviderFor(v,B))return hi(Y),Pe}}}if(!_(p)&&p.isProviderFor(v,B))return p}function E(v,B){var Y=D.get(v),x;return _(Y)||(x=Y.get(B)),_(x)&&(x=G(v,B),_(x)||(_(Y)&&(Y=new pt,D.set(v,Y)),Y.set(B,x))),x}function T(v){if(_(v))throw new TypeError;return l===v||y===v||!_(M)&&M.has(v)}function w(v,B,Y){if(!T(Y))throw new Error("Metadata provider not registered.");var x=E(v,B);if(x!==Y){if(!_(x))return!1;var Pe=D.get(v);_(Pe)&&(Pe=new pt,D.set(v,Pe)),Pe.set(B,Y)}return!0}}function Tu(){var p;return!_(ze)&&te(d.Reflect)&&Object.isExtensible(d.Reflect)&&(p=d.Reflect[ze]),_(p)&&(p=Eu()),!_(ze)&&te(d.Reflect)&&Object.isExtensible(d.Reflect)&&Object.defineProperty(d.Reflect,ze,{enumerable:!1,configurable:!1,writable:!1,value:p}),p}function wu(p){var l=new $r,y={isProviderFor:function(T,w){var v=l.get(T);return _(v)?!1:v.has(w)},OrdinaryDefineOwnMetadata:re,OrdinaryHasOwnMetadata:D,OrdinaryGetOwnMetadata:ie,OrdinaryOwnMetadataKeys:G,OrdinaryDeleteMetadata:E};return Lt.registerProvider(y),y;function M(T,w,v){var B=l.get(T),Y=!1;if(_(B)){if(!v)return;B=new pt,l.set(T,B),Y=!0}var x=B.get(w);if(_(x)){if(!v)return;if(x=new pt,B.set(w,x),!p.setProvider(T,w,y))throw B.delete(w),Y&&l.delete(T),new Error("Wrong provider for target.")}return x}function D(T,w,v){var B=M(w,v,!1);return _(B)?!1:si(B.has(T))}function ie(T,w,v){var B=M(w,v,!1);if(!_(B))return B.get(T)}function re(T,w,v,B){var Y=M(v,B,!0);Y.set(T,w)}function G(T,w){var v=[],B=M(T,w,!1);if(_(B))return v;for(var Y=B.keys(),x=ci(Y),Pe=0;;){var pi=fi(x);if(!pi)return v.length=Pe,v;var Cu=ui(pi);try{v[Pe]=Cu}catch(Du){try{hi(x)}finally{throw Du}}Pe++}}function E(T,w,v){var B=M(w,v,!1);if(_(B)||!B.delete(T))return!1;if(B.size===0){var Y=l.get(w);_(Y)||(Y.delete(v),Y.size===0&&l.delete(Y))}return!0}}function vu(p){var l=p.defineMetadata,y=p.hasOwnMetadata,M=p.getOwnMetadata,D=p.getOwnMetadataKeys,ie=p.deleteMetadata,re=new $r,G={isProviderFor:function(E,T){var w=re.get(E);return!_(w)&&w.has(T)?!0:D(E,T).length?(_(w)&&(w=new _r,re.set(E,w)),w.add(T),!0):!1},OrdinaryDefineOwnMetadata:l,OrdinaryHasOwnMetadata:y,OrdinaryGetOwnMetadata:M,OrdinaryOwnMetadataKeys:D,OrdinaryDeleteMetadata:ie};return G}function lt(p,l,y){var M=Lt.getProvider(p,l);if(!_(M))return M;if(y){if(Lt.setProvider(p,l,Xs))return Xs;throw new Error("Illegal state.")}}function Ru(){var p={},l=[],y=function(){function G(E,T,w){this._index=0,this._keys=E,this._values=T,this._selector=w}return G.prototype["@@iterator"]=function(){return this},G.prototype[Z]=function(){return this},G.prototype.next=function(){var E=this._index;if(E>=0&&E<this._keys.length){var T=this._selector(this._keys[E],this._values[E]);return E+1>=this._keys.length?(this._index=-1,this._keys=l,this._values=l):this._index++,{value:T,done:!1}}return{value:void 0,done:!0}},G.prototype.throw=function(E){throw this._index>=0&&(this._index=-1,this._keys=l,this._values=l),E},G.prototype.return=function(E){return this._index>=0&&(this._index=-1,this._keys=l,this._values=l),{value:E,done:!0}},G}(),M=function(){function G(){this._keys=[],this._values=[],this._cacheKey=p,this._cacheIndex=-2}return Object.defineProperty(G.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),G.prototype.has=function(E){return this._find(E,!1)>=0},G.prototype.get=function(E){var T=this._find(E,!1);return T>=0?this._values[T]:void 0},G.prototype.set=function(E,T){var w=this._find(E,!0);return this._values[w]=T,this},G.prototype.delete=function(E){var T=this._find(E,!1);if(T>=0){for(var w=this._keys.length,v=T+1;v<w;v++)this._keys[v-1]=this._keys[v],this._values[v-1]=this._values[v];return this._keys.length--,this._values.length--,qr(E,this._cacheKey)&&(this._cacheKey=p,this._cacheIndex=-2),!0}return!1},G.prototype.clear=function(){this._keys.length=0,this._values.length=0,this._cacheKey=p,this._cacheIndex=-2},G.prototype.keys=function(){return new y(this._keys,this._values,D)},G.prototype.values=function(){return new y(this._keys,this._values,ie)},G.prototype.entries=function(){return new y(this._keys,this._values,re)},G.prototype["@@iterator"]=function(){return this.entries()},G.prototype[Z]=function(){return this.entries()},G.prototype._find=function(E,T){if(!qr(this._cacheKey,E)){this._cacheIndex=-1;for(var w=0;w<this._keys.length;w++)if(qr(this._keys[w],E)){this._cacheIndex=w;break}}return this._cacheIndex<0&&T&&(this._cacheIndex=this._keys.length,this._keys.push(E),this._values.push(void 0)),this._cacheIndex},G}();return M;function D(G,E){return G}function ie(G,E){return E}function re(G,E){return[G,E]}}function bu(){var p=function(){function l(){this._map=new pt}return Object.defineProperty(l.prototype,"size",{get:function(){return this._map.size},enumerable:!0,configurable:!0}),l.prototype.has=function(y){return this._map.has(y)},l.prototype.add=function(y){return this._map.set(y,y),this},l.prototype.delete=function(y){return this._map.delete(y)},l.prototype.clear=function(){this._map.clear()},l.prototype.keys=function(){return this._map.keys()},l.prototype.values=function(){return this._map.keys()},l.prototype.entries=function(){return this._map.entries()},l.prototype["@@iterator"]=function(){return this.keys()},l.prototype[Z]=function(){return this.keys()},l}();return p}function Au(){var p=16,l=Be.create(),y=M();return function(){function E(){this._key=M()}return E.prototype.has=function(T){var w=D(T,!1);return w!==void 0?Be.has(w,this._key):!1},E.prototype.get=function(T){var w=D(T,!1);return w!==void 0?Be.get(w,this._key):void 0},E.prototype.set=function(T,w){var v=D(T,!0);return v[this._key]=w,this},E.prototype.delete=function(T){var w=D(T,!1);return w!==void 0?delete w[this._key]:!1},E.prototype.clear=function(){this._key=M()},E}();function M(){var E;do E="@@WeakMap@@"+G();while(Be.has(l,E));return l[E]=!0,E}function D(E,T){if(!S.call(E,y)){if(!T)return;Object.defineProperty(E,y,{value:Be.create()})}return E[y]}function ie(E,T){for(var w=0;w<T;++w)E[w]=Math.random()*255|0;return E}function re(E){if(typeof Uint8Array=="function"){var T=new Uint8Array(E);return typeof crypto<"u"?crypto.getRandomValues(T):typeof msCrypto<"u"?msCrypto.getRandomValues(T):ie(T,E),T}return ie(new Array(E),E)}function G(){var E=re(p);E[6]=E[6]&79|64,E[8]=E[8]&191|128;for(var T="",w=0;w<p;++w){var v=E[w];(w===4||w===6||w===8)&&(T+="-"),v<16&&(T+="0"),T+=v.toString(16).toLowerCase()}return T}}function kr(p){return p.__=void 0,delete p.__,p}})}(i||(i={})),Es}Rc();const Mr="design:paramtypes",ws="design:type",vs="design:returntype",ut=new Map,Rs=class{static get(u,h,d){return Reflect.getMetadata(u,F(h),d)}static getOwn(u,h,d){return Reflect.getOwnMetadata(u,F(h),d)}static getType(u,h){return Reflect.getMetadata(ws,u,h)}static getOwnType(u,h){return Reflect.getMetadata(ws,u,h)}static getReturnType(u,h){return Reflect.getMetadata(vs,u,h)}static getOwnReturnType(u,h){return Reflect.getOwnMetadata(vs,u,h)}static has(u,h,d){try{return Reflect.hasMetadata(u,F(h),d)}catch{}return!1}static hasOwn(u,h,d){return Reflect.hasOwnMetadata(u,F(h),d)}static delete(u,h,d){return Reflect.deleteMetadata(u,F(h),d)}static setParamTypes(u,h,d){return this.set(Mr,d,u.prototype,h)}static set(u,h,d,S){const b=ut.has(u)?ut.get(u)||[]:[],J=F(d);b.indexOf(J)===-1&&(b.push(J),ut.set(u,b)),Reflect.defineMetadata(u,h,F(d),S)}static getParamTypes(u,h){return Reflect.getMetadata(Mr,u,h)||[]}static getOwnParamTypes(u,h){return Reflect.getOwnMetadata(Mr,u,h)||[]}};Rs.getTargetsFromPropertyKey=i=>ut.has(i)?ut.get(i)||[]:[];let bs=Rs;const As="tsed:class:store",Cs="tsed:method:store",Ds="tsed:property:store",Is="tsed:param:store",Er=new Map;function $t(i,...u){if(Ve(u[0]))return Er.has(u[0])||Er.set(u[0],new be),Er.get(u[0]);{const h=bs;return h.hasOwn(i,...u)||h.set(i,new be,...u),h.getOwn(i,...u)}}function bc(i){const[u,h,d]=i;switch(ve(i)){case U.PARAM_CTOR:case U.PARAM_STC:case U.PARAM:const S=$t(Is,u,h);return S.has(""+d)||S.set(""+d,new be),S.get(""+d);case U.PROP:case U.PROP_STC:return $t(Ds,u,h);case U.METHOD:case U.METHOD_STC:return $t(Cs,u,h);case U.CLASS:return $t(As,u)}}class be{constructor(){this._entries=new Map}static from(...u){return bc(u)}static fromMethod(u,h){return be.from(u,h,Je(u,h))}static mergeStoreFrom(u,h,...d){const S=be.from(u,...d);return be.from(h,...d)._entries.forEach((b,J)=>{S.merge(J,b)}),S}static mergeStoreMethodFrom(u,h,d){return this.mergeStoreFrom(u,h,d,Je(u,d))}get(u,h){return this._entries.get(Ge(u))||h}has(u){return this._entries.has(Ge(u))}set(u,h){return this._entries.set(Ge(u),h),this}delete(u){return this._entries.delete(Ge(u))}merge(u,h,d=!1){let S=this.get(u);return S&&(h=ke(h),S=ke(S),h=d?ct(h,S):ct(S,h)),this.set(u,h),this}toJson(){return[...this._entries.entries()].reduce((u,[h,d])=>({...u,[h]:d}),{})}}function Tr(i){return(...u)=>{const h=be.from(...u),d=i(h,u);return typeof d=="function"&&d(...u),u[2]}}function Ac(i,u){return Tr(h=>{h.merge(i,u)})}function Cc(i,u){return Tr(h=>{h.set(i,u)})}class wr extends Error{constructor(u,h){super(wr.buildMessage(u,h))}static buildMessage(u,h){const[d,S,b]=h,J=ve(h),Z=J.split("/")[0],se=Z==="parameter"?".["+b+"]":"",Ae=S?"."+S:Z==="parameter"?".constructor":"",je=Ge(F(d))+Ae+se;return`${u.name} cannot be used as ${J} decorator on ${je}`}}var vr=(i=>(i.PROD="production",i.DEV="development",i.TEST="test",i))(vr||{});const Dc=vr,_s=Function;Bt.Type=_s;function Rr(i){return i&&Object.getPrototypeOf(i)}function $s(i){return Rr(i)}function br(i){const u=[];let h=F(i);for(;h&&Ge(h)!=="";)u.unshift(h),h=$s(h);return u}function Nt(i){return typeof i=="object"}function Ns(i){return!!i&&typeof i.lift=="function"&&typeof i.subscribe=="function"}function Ar(i){return i===Promise||i instanceof Promise||!!i&&typeof i.subscribe!="function"&&typeof i.then=="function"}function qt(i){return i!==null&&typeof i=="object"&&typeof i.pipe=="function"}function qs(i){return Nt(i)&&"data"in i&&"headers"in i&&"status"in i&&"statusText"in i}var Ls=(i=>(i.PENDING="PENDING",i.CANCELED="CANCELED",i.RESOLVED="RESOLVED",i.REJECTED="REJECTED",i))(Ls||{}),ks=(i=>(i.STREAM="STREAM",i.BUFFER="BUFFER",i.DATA="DATA",i))(ks||{});class Ic{constructor({hasNextFunction:u=!1}={}){f(this,g),f(this,O),f(this,P),f(this,A),this.status="PENDING",m(this,P,!1),m(this,P,u),m(this,A,new Promise((h,d)=>{m(this,g,h),m(this,O,d)}))}isDone(){return this.status!=="PENDING"}get next(){return m(this,P,!0),u=>{if(!this.isDone())return u?this.reject(u):this.resolve({type:"DATA"})}}call(u){if(this.isDone())return Promise.resolve(this);try{this.handle(u())}catch(h){this.reject(h)}return o(this,A)}reject(u){this.isDone()||(this.done("REJECTED"),o(this,O).call(this,u))}resolve(u={}){this.isDone()||(this.done("RESOLVED"),o(this,g).call(this,{...u,state:"RESOLVED"}))}destroy(){}cancel(){if(!this.isDone())return this.done("CANCELED"),o(this,g).call(this,{state:"CANCELED"})}done(u){this.destroy(),this.status=u}handle(u,h={}){if(!this.isDone()){if(u){if(this.isCanceledResponse(u))return this.cancel();if(Ns(u)&&(u=u.toPromise()),qs(u))return this.handle(u.data,{...h,status:u.status,headers:u.headers});if(qt(u))return this.resolve({...h,type:"STREAM",data:u});if(qt(u)||Buffer.isBuffer(u))return this.resolve({...h,type:"BUFFER",data:u});if(Ar(u))return u.then(d=>this.handle(d,h)).catch(d=>d.response&&qs(d.response)?this.handle(d.response):this.reject(d))}if(!o(this,P))return this.resolve({...h,data:u,type:"DATA"})}}isCanceledResponse(u){return u==="CANCELED"}}g=new WeakMap,O=new WeakMap,P=new WeakMap,A=new WeakMap;function _c(i){try{i()}catch(u){return u}}async function $c(i){try{await i()}catch(u){return u}}function Nc(i,u=[]){return Object.entries(i).reduce((h,[d,S])=>(_t(d)||u.includes(d)||S===void 0||(h[d]=S),h),{})}function Js(i){return typeof i=="function"?i:i.constructor}function Gs(i){return Js(i)}function ft(i){return F(i)===i?i.prototype:i}function Bs(i){const u=new Map;return i=F(i),br(i).forEach(h=>{Reflect.ownKeys(ft(h)).forEach(d=>{var S;Ve(d)||d==="constructor"||(S=Object.getOwnPropertyDescriptor(ft(h),d))!=null&&S.get||u.set(d,{target:h,propertyKey:d})})}),Array.from(u.values())}function qc(i,u){Bs(i).forEach(({target:h,propertyKey:d})=>{const S=ft(i);h!==F(i)&&(Object.defineProperty(S,d,{writable:!0,configurable:!0,value(...Z){return ft(h)[d].apply(this,Z)}}),be.mergeStoreMethodFrom(i,h,d));let b=Je(i,d);const J=u(S,d,b)||b;J&&Object.defineProperty(S,d,J)})}function Lc(i,u){return[i,u,Je(i,u)]}function Cr(i){return Array.isArray(i)}function Dr(i){return i===Array||Cr(i)}function Us(i){return i&&Le(i)&&!i.prototype}function Ks(i){return i&&"isBuffer"in i&&typeof i.isBuffer=="function"?!0:Fs(i)}function Fs(i){return!!(i&&(i===Uint8Array||i instanceof Uint8Array))}function Ir(i){return i===Object}function kc(i){return Ir(F(i))&&i!==Object}function Hs(i){return!i||Us(i)?!1:!(Ve(i)||It(i)||Ir(i)||Re(i)||Ar(i)||Dr(i)||Ks(i))}function Jc(i){return Hs(i)?F(i):i}function js(i){return`${(Gs(i).toString().split(`
15
+ `).find(u=>u.indexOf("constructor(")>-1)||"constructor()").replace("{","").trim()}`}function Gc(i){return js(i).split("constructor(")[1].split(")")[0].split(", ").filter(Boolean).map(u=>u.trim())}function Bc(){return`e${Math.random().toString(36).substring(7)}`}const Uc=i=>{const[u,h,d,S="."]=i;return Nt(h)||j(u)?{expression:u,scope:h,defaultValue:d,separator:S}:{expression:h,scope:u,defaultValue:d,separator:S}};function Kc(...i){const u=Uc(i);let h=u.scope;const{expression:d,defaultValue:S,separator:b}=u;if(!d)return h;if(!h)return S;const J=d.split(b),Z=se=>{if(h){if(h[se]!==void 0||Nt(h)&&se in h)return h[se];if(Le(h.get))return h.get(se)}};for(;(h=Z(J.shift()))&&J.length;);return h===void 0?S:h}function Ws(i){return i&&typeof i.toJSON=="function"}function Fc(i,u){let h="0.0.0.0",d=u;return typeof u=="string"&&u.indexOf(":")>-1&&([h,d]=u.split(":"),d=+d),{protocol:i,address:h,port:d,toString(){return[`${this.protocol}://${this.address}`,typeof this.port=="number"&&this.port].filter(Boolean).join(":")}}}function Vs(i,u){for(const h of br(i)){const d=Object.getOwnPropertyDescriptor(h&&h.prototype||h,u);if(d)return d}}function Hc(i){return Dr(i)||i===Map||i instanceof Map||i===Set||i instanceof Set||i===WeakMap||i instanceof WeakMap||i===WeakSet||i instanceof WeakSet}function jc(i){return i===""||Q(i)}function Wc(i,u){const h=F(i);if(h){const d=Vs(h,u);if(d)return d.enumerable}return Object.prototype.propertyIsEnumerable.call(i,u)}function Vc(i,u,h=5){if(!i||!u)return!1;for(i=F(i),u=F(u);Ge(i)!=="";){if(!h)return!1;if(i===u)return!0;i=Rr(i),h--}return!1}function zc(i){return!!(i&&i!=null&&i._isAMomentObject)}function zs(i){return i&&i._bsontype}function Yc(i){return!!(Ws(i)&&i.$isMongooseModelPrototype||zs(i))}function Xc(i){return!(Buffer.isBuffer(i)||qt(i)||k(i)||z(i)||j(i)||Q(i))}function Qc(i){return pe(i)?"string":H(i)?"number":N(i)?"boolean":"any"}function Zc(i,u,h,d="."){const S=u.split(d),b=(J,Z)=>_t(J)?!1:Z?(typeof i.set=="function"?i.set(J,h):i[J]=h,!1):(typeof i.set=="function"?(i.has(J)||i.set(J,{}),i=i.get(J)):i=i[J]=i[J]||{},!0);for(;b(S.shift(),!S.length););}function Ys(i){return i?j(i)?u=>u[i]:i:(u,h)=>String(h)}function xc(i,u){if(Cr(i)){const d=Ys(u||"id");return i.reduce((S,b,J)=>([].concat(d(b,J)).forEach(Z=>{var se;const Ae=S.get(Z);b=((se=Ae==null?void 0:Ae.merge)==null?void 0:se.call(Ae,b))||b,S.set(Z,b)}),S),new Map)}const h=Ys(u);return Object.entries(i).reduce((d,[S,b])=>d.set(h(b,S),b),new Map)}function eu(i){return Array.from(new Set(i).values())}function tu(i,u="id"){const h=new Map;return i.forEach(d=>{h.set(d[u],d)}),Array.from(h.values())}function ru(...i){return(...u)=>{const h=typeof u[2]=="object";if(i.filter(d=>!!d).forEach(d=>{const S=d(...u);h&&typeof S=="object"&&(u[2]=S)}),h)return u[2]}}function nu(i){return(u,h)=>i(u,h,Je(u,h))}function su(...i){return(u,h)=>{i.filter(Boolean).forEach(d=>d(u,h,Je(u,h)))}}t.AnyToPromise=Ic,t.AnyToPromiseResponseTypes=ks,t.AnyToPromiseStatus=Ls,t.CLASS_STORE=As,t.DecoratorTypes=U,t.Env=vr,t.EnvTypes=Dc,t.METHOD_STORE=Cs,t.Metadata=bs,t.PARAM_STORE=Is,t.PROPERTY_STORE=Ds,t.Store=be,t.StoreFn=Tr,t.StoreMerge=Ac,t.StoreSet=Cc,t.Type=_s,t.UnsupportedDecoratorType=wr,t.ancestorOf=Rr,t.ancestorsOf=br,t.catchAsyncError=$c,t.catchError=_c,t.classOf=F,t.cleanObject=Nc,t.constructorOf=Gs,t.createInstance=ys,t.decorateMethodsOf=qc,t.decoratorArgs=Lc,t.decoratorTypeOf=ve,t.deepClone=ke,t.deepMerge=ct,t.descriptorOf=Je,t.getClass=ne,t.getClassOrSymbol=Jc,t.getConstructor=Js,t.getConstructorArgNames=Gc,t.getHostInfoFromPort=Fc,t.getInheritedClass=$s,t.getRandomId=Bc,t.getValue=Kc,t.hasJsonMethod=Ws,t.inheritedDescriptorOf=Vs,t.isArray=Cr,t.isArrayOrArrayClass=Dr,t.isArrowFn=Us,t.isBoolean=k,t.isBooleanOrBooleanClass=N,t.isBuffer=Ks,t.isClass=Hs,t.isClassObject=Ir,t.isCollection=Hc,t.isDate=Re,t.isEmpty=jc,t.isEnumerable=Wc,t.isFunction=Le,t.isInheritedFrom=Vc,t.isMethodDescriptor=vc,t.isMomentObject=zc,t.isMongooseObject=Yc,t.isNil=Q,t.isNumber=z,t.isNumberOrNumberClass=H,t.isObject=Nt,t.isObjectID=zs,t.isObservable=Ns,t.isPlainObject=kc,t.isPrimitive=Sr,t.isPrimitiveClass=Sc,t.isPrimitiveOrPrimitiveClass=It,t.isPromise=Ar,t.isProtectedKey=_t,t.isRegExp=ds,t.isSerializable=Xc,t.isStream=qt,t.isString=j,t.isStringOrStringClass=pe,t.isSymbol=Ve,t.isSymbolOrSymbolClass=Pc,t.isUint8Array=Fs,t.mergeReducerBuilder=gs,t.methodsOf=Bs,t.nameOf=Ge,t.nameOfClass=Ss,t.nameOfSymbol=Ps,t.objectKeys=Pr,t.primitiveOf=Qc,t.prototypeOf=ft,t.setValue=Zc,t.toMap=xc,t.toStringConstructor=js,t.uniq=eu,t.uniqBy=tu,t.useDecorators=ru,t.useMethodDecorator=nu,t.useMethodDecorators=su,Object.defineProperty(t,Symbol.toStringTag,{value:"Module"})})}(Xe,Xe.exports)),Xe.exports}var c=Oi();const Ue=new Map;class K{constructor(e){this.isStore=!0;const{target:t,propertyKey:n,descriptor:s,index:o,decoratorType:f}=e;this.target=t,this.propertyKey=n,this.propertyName=String(n),this.descriptor=s,this.index=o,this.decoratorType=f,this.token=t,this.store=e.store,this.parent=this}get targetName(){return c.nameOf(this.token)}get isCollection(){return!!this.collectionType}get isArray(){return c.isArrayOrArrayClass(this.collectionType)}get discriminatorAncestor(){const t=c.ancestorsOf(this.target).find(n=>K.from(n).schema.isDiscriminator);return t&&K.from(t)}get isPrimitive(){return c.isPrimitiveOrPrimitiveClass(this._type)}get isDate(){return c.isDate(this.computedType)}get isObject(){return c.isObject(this.computedType)}get isClass(){return c.isClass(this.computedType)}get schema(){return this._schema}get nestedGenerics(){return this.schema.nestedGenerics}set nestedGenerics(e){this.schema.nestedGenerics=e}get type(){return this._type}set type(e){this._type=e,this.build()}get computedType(){return this.itemSchema.getComputedType()}get itemSchema(){return this.isCollection?this.schema.itemSchema():this.schema}get parentSchema(){return this.parent.schema}get isDiscriminatorChild(){var e;return this.schema.isDiscriminator&&((e=this.discriminatorAncestor)==null?void 0:e.schema.discriminator().base)!==this.target}static from(...e){if(e[0].isStore)return e[0];const t=e[0];e.length>1&&(e[0]=c.prototypeOf(e[0]));const n=c.Store.from(...e);if(!n.has("JsonEntityStore")){const s=c.decoratorTypeOf(e),o=Ue.get(s),f=new o({store:n,decoratorType:s,target:c.classOf(t),propertyKey:e[1],index:typeof e[2]=="number"?e[2]:void 0,descriptor:typeof e[2]=="object"?e[2]:void 0});f.build(),n.set("JsonEntityStore",f)}return n.get("JsonEntityStore")}static fromMethod(e,t){return this.from(e,t,c.descriptorOf(e,t))}static get(e,t,n){return K.from(c.prototypeOf(e),t,n)}isGetterOnly(){return c.isObject(this.descriptor)&&!this.descriptor.value&&this.descriptor.get&&!this.descriptor.set}get(e,t){return this.store.get(e,t)}set(e,t){return this.store.set(e,t)}toString(){return[this.targetName,this.propertyName,this.index].filter(e=>e!==void 0).join(":")}buildType(e){c.isCollection(e)?this.collectionType=e:(this._type=e,this._type&&c.isPlainObject(this._type)&&(this._type=String))}set path(e){this.store.set("path",e)}get path(){return this.store.get("path")}getBestType(){return this.itemSchema.hasDiscriminator?this.itemSchema.discriminator().base:c.isClassObject(this.type)?this.itemSchema.getTarget():c.isArrowFn(this.type)?this.type():this.type}}function Qe(r){return e=>{Ue.set(r,e)}}var Ze={exports:{}},Si=Ze.exports,Ur;function Pi(){return Ur||(Ur=1,function(r,e){(function(t,n){n(e)})(Si,function(t){var n=Q=>{throw TypeError(Q)},s=(Q,k,N)=>k.has(Q)||n("Cannot "+N),o=(Q,k,N)=>(s(Q,k,"read from private field"),N?N.call(Q):k.get(Q)),f=(Q,k,N)=>k.has(Q)?n("Cannot add the same private member more than once"):k instanceof WeakSet?k.add(Q):k.set(Q,N),m;function g(Q,k){return!Q||!k.ref||Q&&k.ref===Q}class O{constructor(){f(this,m,new Map)}has(k){var N;return!!((N=o(this,m).get(k))!=null&&N.length)}on(k,N,z){let H=N;z||(z=H,H=void 0);const j=o(this,m).get(k)||[];return j.push({cb:z,ref:H}),o(this,m).set(k,j),this}once(k,N,z){z||(z=N);const H=(...j)=>{z(...j),this.off(k,H)};return this.on(k,N,H),this}off(k,N){const z=(H,j)=>{j.length?o(this,m).set(H,j):o(this,m).delete(H)};if(typeof k=="string"&&N){let H=o(this,m).get(k);H&&z(k,H.filter(j=>j.cb!==N))}else{const H=k;o(this,m).forEach((j,pe)=>{z(pe,j.filter(It=>It.ref!==H))})}return this}emit(k,N,z){Array.isArray(N)&&(z=N,N=void 0),z||(z=[]);const H=o(this,m).get(k);if(H!=null&&H.length)for(const j of H)g(N,j)&&j.cb.apply(null,z)}async asyncEmit(k,N,z){Array.isArray(N)&&(z=N,N=void 0);const H=o(this,m).get(k);if(H!=null&&H.length){const j=H.filter(pe=>g(N,pe)).map(pe=>pe.cb.apply(null,z));await Promise.all(j)}}alter(k,N,z=[],H=null){const j=o(this,m).get(k);if(j!=null&&j.length)for(const{cb:pe}of j)N=pe.call(H,N,...z);return N}async asyncAlter(k,N,z=[],H=null){const j=o(this,m).get(k);if(j!=null&&j.length)for(const pe of j)N=await pe.cb.call(H,N,...z);return N}destroy(){o(this,m).clear()}}m=new WeakMap;const P=new O,A=P.on.bind(P),U=P.once.bind(P),ne=P.off.bind(P),F=P.emit.bind(P),ve=P.asyncEmit.bind(P),Re=P.alter.bind(P),Le=P.asyncAlter.bind(P);t.$alter=Re,t.$asyncAlter=Le,t.$asyncEmit=ve,t.$emit=F,t.$off=ne,t.$on=A,t.$once=U,t.Hooks=O,t.hooks=P,Object.defineProperty(t,Symbol.toStringTag,{value:"Module"})})}(Ze,Ze.exports)),Ze.exports}var Mi=Pi();const dt=new Map;function Kr(r){return c.isPromise(r)||r===Function?Object:c.isClass(r)||c.isSymbol(r)||c.isPrimitiveOrPrimitiveClass(r)||c.isClassObject(r)||c.isDate(r)||c.isCollection(r)?c.classOf(r):c.isArrowFn(r)?r():r}const Fr=["string","number","integer","boolean","object","array","null","any"];function Me(r){return r===null?"null":c.isPrimitiveOrPrimitiveClass(r)?Fr.indexOf(r)>-1?r:typeof r=="string"?r==="file"?"file":"generic":c.primitiveOf(r):r===Array?"array":c.isArray(r)?r.map(Me):r===Set?"array":c.isDate(r)||c.isBuffer(r)?"string":"object"}const Hr=r=>c.isObject(r)&&r!==null?Object.entries(r).reduce((e,[t,n])=>isNaN(+t)?e.concat(n):e,[]):r;function jr(r){const e=r.reduce((s,o)=>s.concat(Hr(o)),[]),t=s=>s===null?"null":typeof s,n=e.reduce((s,o)=>s.add(t(o)),new Set);return{values:c.uniq(e),types:n}}function Ut(r){return String(r).replace(/^(\/)(.*)(\/)$/,"$2")}class Kt{constructor({base:e,propertyName:t,types:n,values:s}={}){this.values=new Map,this.types=new Map,Object.assign(this,c.cleanObject({base:e,propertyName:t,types:n?new Map(n):void 0,values:s?new Map(s):void 0}))}add(e,t){return t.forEach(n=>{this.values.set(n,e)}),this.types.set(e,t),this}getType(e){return this.values.get(e)||this.base}getValues(e){return this.types.get(e)}getDefaultValue(e){const t=this.types.get(e);return t?t[0]:void 0}children(){return[...new Set([...this.types.keys()])]}}function xe(r){return r instanceof ae?r:Object.entries(r).reduce((e,[t,n])=>(e[Ut(t)]=me(n),e),{})}function me(r){return c.isArray(r)?r.map(me):r.isStore||r.$isJsonDocument||r.isLazyRef?r:c.classOf(r)!==Object&&c.isClass(r)?K.from(r).schema:c.isObject(r)?ae.from(r):c.isPrimitiveClass(r)?ae.from({type:r}):r}const De=class De extends Map{constructor(t={}){super();le(this,Ie);le(this,Se);le(this,_e);le(this,$e);le(this,he);le(this,Ee);le(this,oe);le(this,Ne);le(this,Te);le(this,we);this.$kind="schema",this.$isJsonDocument=!0,this.$hooks=new Mi.Hooks,this.$required=new Set,this.$allow=[],this.$forwardGroups=!1,this.$ignore=!1,this.isDiscriminatorKey=!1,this.isDiscriminator=!1,q(this,Ie,!1),q(this,Se,null),q(this,$e,[]),q(this,he,new Map),q(this,Ne,!1),q(this,Te,!1),q(this,we,!1),t&&this.assign(t)}get alias(){return $(this,he)}get nestedGenerics(){return $(this,$e)}set nestedGenerics(t){q(this,$e,t)}get genericLabels(){return $(this,_e)}set genericLabels(t){q(this,_e,t)}get isClass(){return c.isClass(this.class)&&![Map,Array,Set,Object,Date,Boolean,Number,String].includes($(this,oe))}get isCollection(){return $(this,Te)}get isGeneric(){return $(this,Ne)}get discriminatorAncestor(){const n=c.ancestorsOf($(this,oe)).find(s=>K.from(s).schema.isDiscriminator);return n&&K.from(n).schema}get hasGenerics(){return!!(this.nestedGenerics&&this.nestedGenerics.length)}get genericType(){return this.get("$ref")}get class(){return this.getComputedType()}get canRef(){return $(this,we)}get isNullable(){return $(this,Ie)}get isReadOnly(){return this.get("readOnly")}get isWriteOnly(){return this.get("writeOnly")}get hasDiscriminator(){return!!$(this,Se)}static from(t={}){return new De(t)}nullable(t){q(this,Ie,t)}itemSchema(t={}){return q(this,Ee,$(this,Ee)||me(t)),$(this,Ee).assign(t),$(this,Ee)}getAliasOf(t){return $(this,he).get(t)}addAlias(t,n){return $(this,he).set(t,n),$(this,he).set(n,t),this}removeAlias(t){const n=$(this,he).get(t);return n&&$(this,he).delete(n),$(this,he).delete(t),this}$id(t){return super.set("$id",t),this}$ref(t){return super.set("$ref",t),this}$schema(t){return super.set("$schema",t),this}label(t){return q(this,we,!0),super.set("name",t),this}name(t){return super.set("name",t),this}ignore(t){return typeof t!="boolean"&&this.$hooks.on("ignore",t),this.$ignore=t,this}default(t){return super.set("default",t),this}const(t){return super.set("const",t),this}description(t){return super.set("description",t),this}discriminator(){return this.isDiscriminator=!0,q(this,Se,$(this,Se)||new Kt({base:$(this,oe)}))}discriminatorKey(t){return this.discriminator().propertyName=t,this.isDiscriminator=!0,this}discriminatorValue(...t){const n=this.discriminatorAncestor.discriminator();n.add($(this,oe),t),this.isDiscriminator=!0;const s=this.get("properties"),o=s[n.propertyName]||new De({type:"string"});return t.length===1?(o.const(t[0]),o.examples([t[0]])):(o.enum(...t),o.examples(t)),s[n.propertyName]=o,this.set("properties",s),this}additionalItems(t){return super.set("additionalItems",me(t)),this}contains(t){return super.set("contains",me(t)),this}examples(t){return super.set("examples",t),this}example(...t){return this.examples(t)}items(t){return super.set("items",q(this,Ee,me(t))),this}maxItems(t){return super.set("maxItems",t),this}minItems(t){return super.set("minItems",t),this}uniqueItems(t){return super.set("uniqueItems",t),this}maxProperties(t){return super.set("maxProperties",t),this}minProperties(t){return super.set("minProperties",t),this}allow(...t){return[].concat(this.getJsonType()).includes("string")&&!this.has("minLength")&&this.minLength(1),t.forEach(n=>{switch(n){case"":this.set("minLength",void 0);break;case null:this.any(...["null"].concat(this.getJsonType(),this.$allow.map(s=>typeof s)));break}}),this.$allow.push(...t),this}required(t=!0){if(c.isArray(t))this.$required.clear(),t.forEach(n=>this.$required.add(n));else{const n=this.clone();return n.$selfRequired=t,[].concat(n.getJsonType()).includes("string")&&n.minLength(1),n}return this}addRequired(t){return this.$required.add(t),this}removeRequired(t){return this.$required.delete(t),this}isRequired(t){return this.$required.has(t)}properties(t){return super.set("properties",xe(t)),this}addProperty(t,n){const s=this.get("properties")||{};return s[t]=n,super.set("properties",xe(s)),this}patternProperties(t){return super.set("patternProperties",xe(t)),this}additionalProperties(t){return super.set("additionalProperties",me(t)),this}unknown(t=!0){return this.additionalProperties(t)}dependencies(t){return super.set("dependencies",xe(t)),this}propertyNames(t){return super.set("propertyNames",me(t)),this}enum(t,...n){if(dt.has(t))return this.enum(dt.get(t));if(t instanceof De)t.getName()?super.set("enum",t):super.set("enum",t.get("enum")).any(...t.get("enum").map(s=>typeof s));else{const{values:s,types:o}=jr([t,n].flat());super.set("enum",s).any(...o)}return this}definitions(t){return super.set("definitions",xe(t)),this}allOf(t){return this.setManyOf("allOf",t),this}anyOf(t){return this.setManyOf("anyOf",t),this}oneOf(t){return this.setManyOf("oneOf",t),this}not(t){return super.set("not",me(t)),this}multipleOf(t){return super.set("multipleOf",t),this}maximum(t){return super.set("maximum",t),this}exclusiveMaximum(t){return super.set("exclusiveMaximum",t),this}minimum(t){return super.set("minimum",t),this}exclusiveMinimum(t){return super.set("exclusiveMinimum",t),this}maxLength(t){return super.set("maxLength",t),this}minLength(t){return super.set("minLength",t),this}pattern(t){return super.set("pattern",Ut(t)),this}format(t){return super.set("format",t),this}type(t){switch(t){case"map":case Map:super.set("type",Me(t)),q(this,oe,t),q(this,Te,!0),this.has("additionalProperties")||super.set("additionalProperties",this.itemSchema({}));break;case"array":case Array:super.set("type",Me(t)),q(this,oe,t),q(this,Te,!0),this.has("items")||super.set("items",this.itemSchema({}));break;case"set":case Set:super.set("type",Me(t)),q(this,oe,t),q(this,Te,!0),this.uniqueItems(!0),this.has("items")||super.set("items",this.itemSchema({}));break;case"integer":this.integer();break;case"number":case"string":case"boolean":case"object":case Object:case Date:case Boolean:case Number:case String:super.set("type",Me(t)),q(this,oe,t),this.has("properties")||super.set("properties",{});break;default:if(c.isClass(t)||c.isFunction(t))super.set("type",void 0),q(this,oe,t),this.has("properties")||super.set("properties",{});else{const n=Me(t);n==="generic"?(q(this,Ne,!0),super.set("$ref",t)):super.set("type",n)}}return this}any(...t){var n;return t=t.length?t:["integer","number","string","boolean","array","object","null"],t=c.uniq(t).map(s=>c.isClass(s)?s:{type:Me(s)}),t.length>1?this.anyOf(t):this.type(((n=t[0])==null?void 0:n.type)||t[0]),this}integer(){return super.set("type","integer"),super.set("multipleOf",1),this}title(t){return super.set("title",t),this}readOnly(t){return super.set("readOnly",t),this}writeOnly(t){return super.set("writeOnly",t),this}customKey(t,n){return super.set(`#${t}`,n),this}toObject(t){return this.toJSON(t)}toJSON(t){return I("schema",[this],t)}assign(t={}){return(t instanceof De?[...t.entries()]:Object.entries(t)).forEach(([s,o])=>{this.set(s,o)}),t instanceof De&&(this.$selfRequired=t.$selfRequired,this.$allow.push(...t.$allow),t.$required.forEach(s=>{this.$required.add(s)}),q(this,Se,$(this,Se)?new Kt($(this,Se)):null),this.isDiscriminator=t.isDiscriminator,this.isDiscriminatorKey=t.isDiscriminatorKey,q(this,we,$(t,we)),q(this,he,new Map($(this,he).entries())),$(t,_e)&&q(this,_e,[...$(t,_e)]),q(this,$e,$(t,$e).map(s=>[...s])),q(this,oe,$(t,oe)),q(this,Ne,$(t,Ne)),q(this,Te,$(t,Te)),q(this,we,$(t,we)),q(this,Ie,$(t,Ie)),super.set("type",t.get("type"))),this}set(t,n){return t in this?c.isFunction(this[t])&&this[t](n):super.set(t,n),this}getComputedType(){return Kr($(this,oe))}getComputedItemType(){return $(this,Ee)?$(this,Ee).getComputedType():this.getComputedType()}getJsonType(){return this.get("anyOf")?this.get("anyOf").map(t=>t.getJsonType()):this.get("type")||Me(this.getComputedType())}getTarget(){return $(this,oe)}getName(){return this.get("name")||(c.isClass($(this,oe))?c.nameOf(c.classOf(this.getComputedType())):"")}clone(){return new De(this)}setManyOf(t,n){let s=n.filter(f=>(f==null?void 0:f.type)==="null"?(this.nullable(!0),!1):!0).map(me);if(s.length===1&&!(n[0]instanceof De)&&!this.isNullable){if(!s[0].hasDiscriminator)return this.type(n[0]);const f=s[0].discriminator().children();if(!f.length)return this.type(n[0]);s=f.map(me)}super.set(t,s);const o=s[0];if(o.isDiscriminator){const f=o.discriminatorAncestor.discriminator(),{propertyName:m}=f;super.set("discriminator",{propertyName:m,mapping:s.reduce((g,O)=>{var P;return(P=f.types.get(O.getTarget()))==null||P.forEach(A=>{g[A]=O}),g},{})}),this.isDiscriminator=!0,q(this,Se,f)}}};Ie=new WeakMap,Se=new WeakMap,_e=new WeakMap,$e=new WeakMap,he=new WeakMap,Ee=new WeakMap,oe=new WeakMap,Ne=new WeakMap,Te=new WeakMap,we=new WeakMap;let ae=De;var Ei=Object.getOwnPropertyDescriptor,Ti=(r,e,t,n)=>{for(var s=n>1?void 0:n?Ei(e,t):e,o=r.length-1,f;o>=0;o--)(f=r[o])&&(s=f(s)||s);return s};a.JsonClassStore=class extends K{constructor(){super(...arguments),this.children=new Map}get path(){return this.store.get("path","/")}set path(e){this.store.set("path",e)}build(){this._type||this.buildType(this.target),this._type=this._type||Object,this._schema=ae.from({type:this.type})}},a.JsonClassStore=Ti([Qe(c.DecoratorTypes.CLASS)],a.JsonClassStore);const Ft=r=>Number(r)&&200<=Number(r)&&Number(r)<300,Ht=r=>Number(r)&&300<=Number(r)&&Number(r)<400;class de extends Map{constructor(e={}){super(),this.$kind="map",this.$isJsonDocument=!0,this.assign(e)}assign(e={}){return Object.entries(e).forEach(([t,n])=>{c.isFunction(this[t])?this[t](n):this.set(t,n)}),this}toJSON(e){return I("map",[this],e)}}function jt(r){return Object.keys(r).reduce((e,t)=>{const n=r[t];let s=typeof n,o={example:n};return s==="object"&&(o=n,o.example=o.value===void 0?o.example:o.value,delete o.value,s=typeof o.example),o.type=o.type||s,e[t]=c.cleanObject(o),e},{})}function Wt(r,e=de){return Object.entries(r).reduce((t,[n,s])=>(t.set(n,new e(s)),t),new de)}class Vt extends de{constructor(){super(...arguments),this.$kind="operationMedia",this.groups=[]}schema(e){return this.set("schema",e),this}examples(e){return this.set("examples",e),this}}class Wr extends de{constructor(e={}){super(e),this.$kind="operationResponse",this.content(e.content||{})}description(e){return this.set("description",e),this}headers(e){return this.set("headers",jt(e)),this}content(e){return this.set("content",Wt(e,Vt)),this}getContent(){return this.get("content")}getMedia(e,t=!0){var n;return t&&this.addMedia(e),(n=this.getContent())==null?void 0:n.get(e)}addMedia(e){const t=this.get("content");return t.has(e)||t.set(e,new Vt),this}isBinary(){return this.getContent().has("application/octet-stream")}}class Vr extends de{constructor(e,t){super(),this.method=e,this.path=t}summary(e){return super.set("summary",e),this}description(e){return super.set("description",e),this}}class zr extends de{constructor(t={}){super({parameters:[],responses:new de,...t});le(this,qe);le(this,He);this.$kind="operation",this.operationPaths=new Map,q(this,He,!1)}get response(){return this.getResponses().get(this.getStatus().toString())}get status(){return $(this,qe)}tags(t){return super.set("tags",t),this}addTags(t){return t=c.uniqBy([...this.get("tags")||[],...t],"name"),this.tags(t)}summary(t){return super.set("summary",t),this}operationId(t){return this.set("operationId",t),this}responses(t){return this.set("responses",t),this}defaultStatus(t){return q(this,qe,t),this}getStatus(){return $(this,qe)||200}setRedirection(t=302){return q(this,He,!0),q(this,qe,t),this}isRedirection(t){return $(this,He)&&t?Ht(t):$(this,He)}addResponse(t,n){if((Ft(t)||Ht(t))&&!$(this,qe)){const f=this.getResponseOf(200);this.getResponses().set(t.toString(),f).delete("200"),this.defaultStatus(Number(t))}const s=t==="default"?this.getStatus().toString():t.toString(),o=this.getResponses().get(s);return o?(n.forEach((f,m)=>{["content"].includes(m)||o.set(m,c.deepMerge(o.get(m),f))}),o.status=Number(s)):(n.status=Number(s),this.getResponses().set(s,n)),this}getResponses(){return this.get("responses")}getResponseOf(t){return(t==="default"?this.response:this.getResponses().get(String(t)))||new Wr}ensureResponseOf(t){return this.addResponse(t,this.getResponseOf(t)),this.getResponseOf(t)}getHeadersOf(t){return this.getResponseOf(t).get("headers")||{}}getContentTypeOf(t){return[...this.getResponseOf(t).get("content").keys()].slice(-1)[0]}security(t){return this.set("security",t),this}addSecurityScopes(t,n){const s=this.get("security")||{};return s[t]=c.uniq([...s[t]||[],...n]),this.security(s)}description(t){return super.set("description",t),this}deprecated(t){return super.set("deprecated",t),this}parameters(t){return super.set("parameters",t),this}addParameter(t,n){t===-1&&(t=this.get("parameters").length),this.get("parameters")[t]=n}consumes(t){return super.set("consumes",t),this}produces(t){return super.set("produces",t),this}addProduce(t){const n=c.uniq([].concat(this.get("produces"),t)).filter(Boolean);this.set("produces",n)}addOperationPath(t,n){const s=new Vr(t,n);return this.operationPaths.set(String(t)+String(n),s),s}getAllowedOperationPath(t){return t?[...this.operationPaths.values()].filter(({method:n})=>n&&t.includes(n.toUpperCase())):[...this.operationPaths.values()]}}qe=new WeakMap,He=new WeakMap;var wi=Object.getOwnPropertyDescriptor,vi=(r,e,t,n)=>{for(var s=n>1?void 0:n?wi(e,t):e,o=r.length-1,f;o>=0;o--)(f=r[o])&&(s=f(s)||s);return s};a.JsonMethodStore=class extends K{constructor(e){super({store:c.Store.fromMethod(e.target,e.propertyKey),descriptor:c.descriptorOf(e.target,e.propertyKey),...e}),this.parent=K.from(this.target),this.middlewares=[],this.beforeMiddlewares=[],this.afterMiddlewares=[],this.operation=new zr,this.children=new Map;const{beforeMiddlewares:t=[],middlewares:n=[],afterMiddlewares:s=[]}=e;this.after(s),this.before(t),this.use(n)}get params(){return this.parameters}get view(){return this.store.get("view")}set view(e){this.store.set("view",e)}get acceptMimes(){return this.store.get("acceptMimes",[])}set acceptMimes(e){this.store.set("acceptMimes",e)}get parameters(){return[...this.children.values()]}get operationPaths(){return this.operation.operationPaths}static get(e,t,n){return n=n||c.descriptorOf(c.prototypeOf(e),t),K.from(c.prototypeOf(e),t,n)}getResponseOptions(e,{contentType:t="application/json",includes:n}={}){var o;const s=this.operation.getResponseOf(e).getMedia(t,!1);if(s&&s.has("schema")){const f=s.get("schema");let m=s.groups;return n&&((o=s.allowedGroups)!=null&&o.size)&&(m=[...m||[],...n.filter(g=>s.allowedGroups.has(g))]),{type:f.getComputedItemType(),groups:m}}return{type:this.type}}before(e){return this.beforeMiddlewares=this.beforeMiddlewares.concat(e).filter(c.isFunction),this}after(e){return this.afterMiddlewares=this.afterMiddlewares.concat(e).filter(c.isFunction),this}use(e){return this.middlewares=this.middlewares.concat(e).filter(c.isFunction),this}get(e){const t=c.Store.from(this.target).get(e);return c.deepMerge(t,this.store.get(e))}getParamTypes(){return[...this.children.values()].reduce((e,t)=>({...e,[t.paramType]:!0}),{})}build(){if(!this._type){let e=c.Metadata.getReturnType(this.target,this.propertyKey);e=c.isPromise(e)?void 0:e,this.buildType(e)}this._type=this._type||Object,this.parent.children.set(this.propertyName,this),c.isCollection(this._type)&&(this.collectionType=this._type,delete this._type),this._schema=ae.from({type:this.collectionType||this.type}),this.collectionType&&this._schema.itemSchema(this.type),this.parent.schema.addProperty(this.propertyName,this.schema)}},a.JsonMethodStore=vi([Qe(c.DecoratorTypes.METHOD)],a.JsonMethodStore);const Ri=a.JsonMethodStore;var ye=(r=>(r.BODY="body",r.PATH="path",r.QUERY="query",r.HEADER="header",r.COOKIES="cookie",r.FILES="files",r))(ye||{});function zt(r){return String(r).toLowerCase().replace("raw_","").replace("cookies","cookie")}function Yt(r){return Object.values(ye).includes(zt(r))}class yt extends de{constructor(){super(...arguments),this.$kind="operationInParameter",this.nestedGenerics=[],this.$schema=new ae}getName(){const e=this.get("name");return this.get("in")==="files"?e.split(".")[0]:e}name(e){return this.set("name",e),this}examples(e){return super.set("examples",e),this}description(e){return this.set("description",e),this}in(e,t=""){return this.set("in",zt(e)),this.expression=t,this}required(e){return this.set("required",e),this}schema(e){return e?(this.$schema=e,this):this.$schema}itemSchema(e){return this.$schema.isCollection?(e&&this.$schema.itemSchema(e),this.$schema.itemSchema()):(e&&this.schema(e),this.schema())}toJSON(e){return I("operationInParameter",[this],e)}}var bi=Object.getOwnPropertyDescriptor,Ai=(r,e,t,n)=>{for(var s=n>1?void 0:n?bi(e,t):e,o=r.length-1,f;o>=0;o--)(f=r[o])&&(s=f(s)||s);return s};a.JsonParameterStore=class extends K{constructor(e){super(e),this.parameter=new yt,this.parent=K.fromMethod(this.target,this.propertyKey),this.pipes=e.pipes||[],this.paramType=e.paramType||this.paramType,this.expression=e.expression||this.expression,this.dataPath=e.dataPath||this.dataPath}get nestedGenerics(){return this.parameter.nestedGenerics}set nestedGenerics(e){this.parameter.nestedGenerics=e}get required(){return!!this.parameter.get("required")}set required(e){this.parameter.required(e)}get allowedRequiredValues(){return this.schema.$allow}get schema(){return this.parameter.$schema}static getParams(e,t){const n=[],s=c.ancestorsOf(e).reverse().find(o=>c.isMethodDescriptor(o,t)&&K.fromMethod(o,t).children.size);return s?(K.fromMethod(s,t).children.forEach((o,f)=>{n[+f]=o}),n):[]}static get(e,t,n){return K.from(c.prototypeOf(e),t,n)}isRequired(e){return this.required&&[void 0,null,""].includes(e)&&!this.allowedRequiredValues.includes(e)}build(){if(!this._type){const e=c.Metadata.getParamTypes(c.prototypeOf(this.target),this.propertyKey)[this.index];this.buildType(e)}this._type=this._type||Object,this.parent.children.set(this.index,this),this.parent.operation.addParameter(this.index,this.parameter),this.collectionType&&this.parameter.schema().type(this.collectionType),c.isClass(this._type)?this.parameter.itemSchema(K.from(this._type).schema):this.parameter.itemSchema().type(this._type)}},a.JsonParameterStore=Ai([Qe(c.DecoratorTypes.PARAM)],a.JsonParameterStore);const Ci=a.JsonParameterStore;var Di=Object.getOwnPropertyDescriptor,Ii=(r,e,t,n)=>{for(var s=n>1?void 0:n?Di(e,t):e,o=r.length-1,f;o>=0;o--)(f=r[o])&&(s=f(s)||s);return s};a.JsonPropertyStore=class extends K{constructor(){super(...arguments),this.parent=K.from(this.target)}get required(){return this.parent.schema.isRequired(this.propertyKey)}set required(e){e?this.parent.schema.addRequired(this.propertyKey):this.parent.schema.removeRequired(this.propertyKey)}get allowedRequiredValues(){return this.schema.$allow}discriminatorKey(){return this.parent.schema.discriminatorKey(String(this.propertyKey)),this.itemSchema.isDiscriminatorKey=!0,this}isDiscriminatorKey(){return this.itemSchema.isDiscriminatorKey}isRequired(e){return this.required&&[void 0,null,""].includes(e)&&!this.allowedRequiredValues.includes(e)}build(){this._type||this.buildType(c.Metadata.getType(c.prototypeOf(this.target),this.propertyKey)),this._type=this._type||Object;let t=this.parent.schema.get("properties")[this.propertyName];t||(this.parent.children.set(this.propertyName,this),t=ae.from({type:this.collectionType||this.type}),this.collectionType&&t.itemSchema(this.type)),this.parent.schema.addProperty(this.propertyName,t),this._schema=t}static get(e,t){return K.from(c.prototypeOf(e),t)}},a.JsonPropertyStore=Ii([Qe(c.DecoratorTypes.PROP)],a.JsonPropertyStore);const _i=a.JsonPropertyStore;Ue.set(c.DecoratorTypes.CLASS,a.JsonClassStore),Ue.set(c.DecoratorTypes.PROP,a.JsonPropertyStore),Ue.set(c.DecoratorTypes.PARAM,a.JsonParameterStore),Ue.set(c.DecoratorTypes.METHOD,a.JsonMethodStore);function ce(...r){return K.from(...r)}class Yr extends Map{constructor(){super(...arguments),this.$kind="operationPaths",this.$isJsonDocument=!0,this.getKey=(e,t)=>`${e}-${t}`}setOperationPath(e){const t=this.getKey(e.method,e.path);this.set(t,e)}}function gt(r){const e=r.isStore?r:ce(r);return e.$inherited||(e.$inherited=c.ancestorsOf(e.target).reverse().reduce((t,n)=>t.set(n,ce(n)),new Map)),e.$inherited}function Ot(r){const e=r.isStore?r:ce(r);if(!e.$operations){const t=new Yr;e.$operations=new Map,gt(e).forEach(n=>{n.children.forEach(s=>{s instanceof a.JsonMethodStore&&!e.$operations.has(s.propertyKey)&&e.$operations.set(s.propertyKey,s)})}),e.$operations.forEach(n=>{n.operation.operationPaths.forEach(s=>{t.setOperationPath(s)})}),t.clear()}return e.$operations}function Xt(r){return!r.store.get("hidden")}const $i=[W.PUBLISH,W.SUBSCRIBE];function Ni(r){return(e,{operationPath:t,operationStore:n})=>{var g,O,P,A;const s=r.ctrlRootPath||"/",o=t.method.toLowerCase(),f=V.camelCase(`${o.toLowerCase()} ${n.parent.schema.getName()}`),m=I("message",[n,t],r);return{...e,[s]:{...e[s],[o]:{...(g=e[s])==null?void 0:g[o],operationId:f,message:{oneOf:[...((A=(P=(O=e[s])==null?void 0:O[o])==null?void 0:P.message)==null?void 0:A.oneOf)||[],m]}}}}}}function qi(r){return e=>{const t=e.operation.getAllowedOperationPath($i);return t.length===0?[]:t.map(n=>({operationPath:n,operationStore:e}))}}function Xr(r,{channels:e,rootPath:t,...n}){const o=ce(r).path,f=Gt(t+o);return n={...n,ctrlRootPath:f},[...Ot(r).values()].filter(Xt).flatMap(qi()).reduce(Ni(n),e)}C("channels",Xr);var L=(r=>(r.JSON="jsonschema",r.SWAGGER="swagger2",r.OPENAPI="openapi3",r.ASYNCAPI="asyncapi2",r))(L||{});function Li(r,e){var n;const t={channels:I("channels",[r],e)};return t.tags=c.uniqBy(e.tags,"name"),(n=e.components)!=null&&n.schemas&&Object.keys(e.components.schemas).length&&(t.components={...e.components,schemas:e.components.schemas}),t}C("generate",Li,L.ASYNCAPI);function et(r,e){return e.length?e.length===1?e[0]:{[r]:e}:null}function Qr(r,e,{tags:t=[],defaultTags:n=[],...s}={}){const{path:o,method:f}=e,m=String(o);let g=c.getValue(s.components,"messages."+o,c.cleanObject({description:r.operation.get("description"),summary:r.operation.get("summary")}));if(f.toUpperCase()===W.PUBLISH){const O=I("payload",[r,e],s);O&&(g.payload=O);const P=r.operation.getAllowedOperationPath([W.SUBSCRIBE]).map(U=>I("message",[r,U],s)).filter(Boolean),A=et("oneOf",P);A&&(g["x-response"]=A)}else{const O=I("response",[r,e],s);O&&(g["x-response"]=O)}return s.components.messages=s.components.messages||{},s.components.messages[m]=g,{$ref:`#/components/messages/${m}`}}C("message",Qr,L.ASYNCAPI);function Zr(r,e){return r.reduce((t,n,s)=>t.set(n,e[s]),new Map)}function tt(r){if(r.genericLabels&&r.genericTypes){const{genericLabels:e,genericTypes:t,...n}=r;return{...n,generics:Zr(e,t)}}return r}function rt(r){const[e,...t]=r.nestedGenerics;return{genericTypes:e,nestedGenerics:t}}function ki(r,e={}){return{...e,groups:r.groups,groupsName:r.groupsName}}function Ji(r,e){return r.get("parameters").filter(t=>Yt(t.get("in")))}function xr(r,e,t){const n=Ji(r.operation),s=V.pascalCase([e.path,e.method,"Payload"].join(" "));c.setValue(t,`components.schemas.${s}`,{});const o=n.map(f=>{const m=ki(f,t),g=I("item",[f.$schema],{...m,...rt(f)});switch(f.get("in")){case ye.BODY:return g;case ye.QUERY:case ye.PATH:case ye.HEADER:return{type:"object",properties:{[f.get("name")]:g}}}return g},{}).filter(Boolean);return et("allOf",o)}C("payload",xr,L.ASYNCAPI);function en(r,e,t){const n=r.operation.getResponses(),s=[],o=[],f=[],m=[];[...n.entries()].forEach(([U,ne])=>{const F=I("map",[ne],t);if(s.push(+U),o.push(F.description),+U!=204){const{content:ve}=F,Re=ve[Object.keys(ve)[0]];+U>=200&&+U<400,f.push(Re)}});const g=V.pascalCase([e.path,e.method,"Response"].join(" ")),O={type:"object",properties:{status:{type:"number",enum:s},statusText:{type:"string",enum:o}},required:["status"]},P=et("oneOf",f);P&&c.setValue(O,"properties.data",P);const A=et("oneOf",m);return m.length&&c.setValue(O,"properties.error",A),c.setValue(t,`components.schemas.${g}`,O),{$ref:`#/components/schemas/${g}`}}C("response",en,L.ASYNCAPI);class Qt{constructor(e){this.getType=e,this.isLazyRef=!0}get target(){return this.getType()}get schema(){return ce(this.getType()).schema}get name(){return c.nameOf(this.getType())}}function Gi(r){const{host:e=`#/${[L.OPENAPI,L.ASYNCAPI].includes(r.specType)?"components/schemas":"definitions"}`}=r;return e}function nt(r,e){return e.groups&&e.groups.length?V.pascalCase(`${r} ${e.groupsName||e.groups.join(" ")}`):r}function st(r,e,t){const s={$ref:`${Gi(t)}/${r}`},o=e.isReadOnly,f=e.isWriteOnly;return c.cleanObject({readOnly:o?!0:void 0,writeOnly:f?!0:void 0,...o||f?{anyOf:[s]}:s})}function it(r,e,t){const n=nt(r.getName(),t);return e&&c.setValue(t,`components.schemas.${n}`,e),st(n,r,t)}function tn(r,e={}){if(typeof r!="object"||r===null)return r;if(r instanceof Qt)return I("lazyRef",[r],e);if(r instanceof ae&&r.get("enum")instanceof ae){const t=r.get("enum");return it(t,t.toJSON(e),e)}if(r.$kind&&r.$isJsonDocument){const t=Gr([r.$kind,"map"],e),n=I(t,[r],tt(e));return r.canRef?it(r,n,e):n}return I("object",[r],e)}C("any",tn);function rn(r,e){const t=K.from(r.class),n=nt(t.schema.getName()||r.getName(),e);if(r.hasGenerics){const{type:s,properties:o,additionalProperties:f,items:m,...g}=r.toJSON(e),O={...I("any",[t.schema],{...e,...rt(r),root:!1}),...g};if(O.title){const P=nt(O.title,e);return c.setValue(e.components,`schemas.${P}`,O),delete O.title,st(P,r,e)}return O}return c.getValue(e,`components.schemas.${n}`)||(c.setValue(e,`components.schemas.${n}`,{}),e.components.schemas[n]=I("any",[t.schema],tt({...e,root:!1}))),st(n,r,e)}C("class",rn);function St(r,e,t){var n;if((n=r.discriminator)!=null&&n.mapping){const s=Object.entries(r.discriminator.mapping),o={};for(const[f,m]of s)o[f]=c.isString(m)?m:it(m,null,t).$ref;r.discriminator.mapping=o}return r}function Bi(r){var e;return(e=r.discriminator)!=null&&e.mapping&&delete r.discriminator.mapping,r}C("discriminatorMapping",Bi);function Zt(r,e,t){var n;return t.inlineEnums&&((n=r.enum)!=null&&n.$isJsonDocument)&&(r.enum=r.enum.toJSON().enum),r.enum&&(r.type=r.type==="object"||r.type===void 0?"string":r.type),r}C("enums",Zt);function nn(r,e){const{generics:t}=e;if(t&&r.$ref&&t.has(r.$ref)){let n=t.get(r.$ref);if(c.isPrimitiveClass(n))return{type:Me(n)};if(n===Date)return{type:"string",format:"date-time"};if(n.toJSON)return n.toJSON({...e,generics:void 0});if(n===Object)return{type:"object"};if(c.isClass(n)){const s={class:n};if(e.nestedGenerics.length===0)return I("class",[s],{...e,generics:void 0});const o=K.from(s.class);return I("schema",[o.schema],{...e,...rt(e),root:!1})}}return r}C("generics",nn);function sn(r,e){if(e!=null&&e.type&&(e!=null&&e.$ref)){const{$ref:t,...n}=e;e={allOf:[{$ref:t},n]}}return e}function an(r,{target:e,...t}){const n=Array.from(gt(e).entries()).filter(([s])=>c.classOf(s)!==c.classOf(e));if(n.length){const s=n.reduce((o,[,f])=>c.deepMerge(o,I("schema",[f.schema],t),{alter:sn}),{});return c.deepMerge(s,r,{alter:sn})}return r}C("inheritedClass",an);function on(r,e){return r&&r.isClass?I("class",[r],e):I("any",[r],e)}C("item",on);function cn(r,e){var s;const t=r.name;if((s=e.$refs)!=null&&s.find(o=>o===r.target))return st(t,r.schema,e);e.$refs=[...e.$refs||[],r.target];const n=r.getType()&&I("schema",[r.schema],tt(e));return it(r.schema,n,e)}C("lazyRef",cn);function un(r,{ignore:e=[],...t}={}){return t=tt(t),Array.from(r.entries()).reduce((n,[s,o])=>(e.includes(s)||(n[s]=I("item",[o],t)),n),{})}C("map",un);const Pt=["oneOf","allOf","anyOf"],fn=["minLength","maxLength","pattern","format"],hn=[],pn=["minimum","maximum","exclusiveMinimum","exclusiveMaximum","multipleOf"],ln=["maxItems","minItems","uniqueItems","items","contains","maxContains","minContains"],mn=["maxItems","minItems","uniqueItems","items","contains","maxContains","minContains","patternProperties","dependencies"],xt=["const","enum"];function dn(r,e){return e!=null&&e.isNullable&&(r.discriminator||(r.$ref?r=c.cleanObject({...r,$ref:void 0,anyOf:[{type:"null"},{$ref:r.$ref}]}):Pt.some(t=>{if(r[t])if(r[t]=r[t].filter(n=>n.type!=="null"),r[t].length===1){const n=r[t];r=c.cleanObject({...r,...n[0],[t]:void 0,type:["null",Number.isInteger(r.multipleOf)?"integer":n[0].type]})}else r[t]=[{type:"null"}].concat(r[t]).map(n=>(Number.isInteger(n.multipleOf)&&(n.type="integer"),n)),delete r.type}))),r}C("nullable",dn);function er(r,e){var n,s;if(c.isBoolean(r.$ignore)&&r.$ignore)return!0;let t=(n=r==null?void 0:r.$hooks)==null?void 0:n.alter("ignore",!1,[e]);return t||(e.groups!==!1?(s=r==null?void 0:r.$hooks)==null?void 0:s.alter("groups",!1,[e.groups]):t)}function yn(r,e){const{specType:t,operationIdFormatter:n,root:s,components:o,genericTypes:f,nestedGenerics:m,useAlias:g,genericLabels:O,...P}=e;return Object.entries(r).reduce((A,[U,ne])=>{if(e.withIgnoredProps!==!1&&!er(ne,P)){const F={...e,groups:r!=null&&r.$forwardGroups||ne!=null&&ne.$forwardGroups?e.groups:void 0};A[U]=I("item",[ne],F),A[U]=I("nullable",[A[U],ne],F)}return A},c.isArray(r)?[]:{})}C("object",yn);function Mt(r,e,t){return r.map(n=>I("item",[n],{...e,genericLabels:t.genericLabels}))}C("anyOf",Mt),C("allOf",Mt),C("oneOf",Mt);function ge(r,e,t){return r.isClass?I("class",[r],e):I("any",[r],{...e,genericLabels:t.genericLabels})}C("properties",ge),C("items",ge),C("additionalProperties",ge),C("propertyNames",ge),C("contains",ge),C("dependencies",ge),C("patternProperties",ge),C("additionalItems",ge),C("not",ge),C("definitions",ge);function gn(r,e,t){var n;return t.groups!==!1?(n=e==null?void 0:e.$hooks)==null?void 0:n.alter("requiredGroups",r,[t.groups]):r}function Ui(r,e,t={}){const{useAlias:n}=t,s=Object.keys(r.properties||{});return(o,f)=>{const m=n&&e.alias.get(f)||f;return s.includes(m)?o.concat(m):o}}function Ki(r,e,t){let n=r.required||[];return n=[...n,...e.$required],e.get("properties")&&(n=Object.entries(e.get("properties")).reduce((s,[o,f])=>f&&f.$selfRequired!==void 0?f.$selfRequired?s.concat(o):s.filter(m=>m===o):s,n)),gn(c.uniq(n),e,t)}function On(r,e,t){if(t.groups&&t.groups.includes("partial"))return r.discriminator?{...r,required:[r.discriminator.propertyName]}:r;let n=Ki(r,e,t);return n=c.uniq(n).reduce(Ui(r,e,t),[]),r.discriminator&&n.push(r.discriminator.propertyName),n.length&&(r.required=n),r}C("required",On);function Sn(r,e){return Object.entries(r).reduce((t,[n,s])=>(n=e.get(n)||n,t[n]=s,t),{})}function Fi(r){return Pt.find(e=>r[e])}const Hi={string:{properties:fn,is:c.isString},number:{properties:pn,is:c.isNumber},boolean:{properties:hn,is:c.isBoolean},array:{properties:ln,is:()=>!1},object:{properties:mn,is:()=>!1}};function ji(r,e,t){const n=Hi[r];n==null||n.properties.concat(xt).forEach(s=>{e[s]!==void 0&&(xt.includes(s)?t[s]=e[s].filter(n.is):(t[s]=e[s],delete e[s]))})}function Pn(r,e,t){const n=Fi(r);return n&&(r[n].forEach(s=>{ji(s.type,r,s)}),Pt.forEach(s=>{r[s]&&t.groups!==!1&&e.$hooks.has(s)&&(r={...r,[s]:e.$hooks.alter(s,r[s],[t.groups])})}),delete r.const,delete r.enum,r.items||r.properties||delete r.type),r}const Wi=["name","$required","$hooks","_nestedGenerics",L.OPENAPI,L.SWAGGER,L.JSON],Vi=[];function zi(r,e){return typeof e=="object"&&["items","properties","additionalProperties"].includes(r)&&Object.keys(e).length===0}function Yi(r,e,t){return typeof e=="object"&&t&&["properties","additionalProperties"].includes(r)}function Xi(r,{specType:e=L.JSON,customKeys:t=!1}){return Wi.includes(r)||r.startsWith("#")&&(t===!1||e!==L.JSON)||e!==L.JSON&&Vi.includes(r)}function Qi(r,e,t){return r==="examples"&&c.isObject(e)&&[L.OPENAPI,L.ASYNCAPI].includes(t.specType)}function Zi(r){let e=!1;r||(e=!0,r={components:{schemas:{}},inlineEnums:!0});const{useAlias:t=!0,components:n={schemas:{}}}=r;return r={...r,useAlias:t,components:n},{addDef:e,options:r}}function xi(r,e){const{useAlias:t}=e;return[...r.keys()].filter(n=>!Xi(n,e)).reduce((n,s)=>{let o=r.get(s);if(s=s.replace(/^#/,""),s==="type")return n[s]=r.getJsonType(),n;if(Qi(s,o,e)&&(s="example",o=Object.values(o)[0]),o&&typeof o=="object"&&Jt(s)){if(o=I(s,[o],e,r),zi(s,o))return n;Yi(s,o,t)&&(o=Sn(o,r.alias))}return n[s]=o,n},{})}function ea(r,e){let t=xi(r,e);return r.isClass&&(t=I("inheritedClass",[t],{...e,root:!1,target:r.getComputedType()})),t=I("generics",[t],{...e,root:!1}),r.has(e.specType)&&(t={...t,...r.get(e.specType).toJSON(e)}),c.isFunction(t.default)&&(t.default=t.default()),t=I("required",[t,r],e),t=I("nullable",[t,r],e),t=Pn(t,r,e),t=I("enums",[t,r],e),t=I("discriminatorMapping",[t,r],e),t}function Mn(r,e){const{options:t,addDef:n}=Zi(e),s=ea(r,t);return n&&Object.keys(c.getValue(t,"components.schemas",{})).length&&(s.definitions=t.components.schemas),s}C("schema",Mn),C("discriminatorMapping",St,L.OPENAPI),C("discriminatorMapping",St,L.SWAGGER),C("discriminatorMapping",St,L.ASYNCAPI);function Et(r,e,t){return r=Zt(r,e,t),r.const&&(r.enum=[r.const],delete r.const),r}C("enums",Et,L.OPENAPI),C("enums",Et,L.SWAGGER),C("enums",Et,L.ASYNCAPI);function En(r,e){e={...e,specType:L.OPENAPI};const t={paths:I("paths",[r],e)};return t.tags=c.uniqBy(e.tags,"name"),Object.keys(c.getValue(e,"components.schemas",{})).length&&(t.components={schemas:e.components.schemas}),t}C("generate",En,L.OPENAPI),C("generate",En,L.SWAGGER);function tr(r,e){var t,n,s,o;return e!=null&&e.isNullable?r.$ref?c.cleanObject({...r,...r.$ref&&{anyOf:[{$ref:r.$ref}],type:void 0},nullable:!0,$ref:void 0}):c.cleanObject({...r,...((t=r.anyOf)==null?void 0:t.length)===1?{...r.anyOf[0],anyOf:void 0,type:Number.isInteger(r.multipleOf)?"integer":(n=r.anyOf[0])==null?void 0:n.type}:{type:((s=r.anyOf)==null?void 0:s.length)>1?void 0:r.type,anyOf:(o=r.anyOf)==null?void 0:o.map(f=>(Number.isInteger(f.multipleOf)&&(f.type="integer"),f))},nullable:!0}):r}C("nullable",tr,L.OPENAPI),C("nullable",tr,L.SWAGGER);function Tn(r,{jsonSchema:e}){const t={type:"string",format:"binary",oneOf:void 0};return e.type==="array"?(e.items=c.cleanObject({...e.items,...t}),r.schema=e,r):(r.schema=c.cleanObject({...e,...t}),r)}C("operationInFiles",Tn);function ta(r,e={}){return{...e,groups:r.groups,groupsName:r.groupsName}}function wn(r,e){var P;const t=ta(r,e),n={...((P=t.components)==null?void 0:P.schemas)||{}},{type:s,schema:o,...f}=I("map",[r],t),m=I("item",[r.$schema],{...t,...rt(r)});f.required=f.required||r.get("in")===ye.PATH;const g={...t,jsonSchema:m,jsonParameter:r,oldSchemas:n},O=V.camelCase(`operationIn ${r.get("in")}`);return Jt(O)?I(O,[f],g):(f.schema=m,f)}C("operationInParameter",wn);function vn(r,e){return r.flatMap(t=>I("operationInParameter",[t],e)).filter(Boolean)}C("operationInParameters",vn);function ra(r,e){if(!e)return;let t=!1;const n=Object.entries(e).reduce((s,[o,{value:f,description:m,...g}])=>f[r]===void 0?s:(t=!0,{...s,[o]:{...g,value:f[r],description:m}}),{});return t?n:void 0}function na(r,{jsonParameter:e,...t}){var o,f,m;const n=nt(e.$schema.getName(),t),s=(f=(o=t.components)==null?void 0:o.schemas)==null?void 0:f[n];return s&&!((m=t.oldSchemas)!=null&&m[n])&&delete t.components.schemas[e.$schema.getName()],Object.entries((s==null?void 0:s.properties)||{}).reduce((g,[O,{description:P,...A}])=>[...g,c.cleanObject({...r,name:O,required:((s==null?void 0:s.required)||[]).includes(O),description:P,schema:A,style:A.$ref?"deepObject":void 0,examples:ra(O,r.examples)})],[])}function Rn(r,{jsonSchema:e,jsonParameters:t,...n}){if(e.$ref){if(!r.name)return na(r,n);r.style="deepObject"}return r.schema=e,r}C("operationInQuery",Rn);const at=fe.codes.reduce((r,e)=>{const t=String(fe(e));return{...r,[String(e)]:{label:t,code:V.constantCase(t)}}},{});at[200].label="Success",at[200].code="SUCCESS";function sa(r){var e;return(e=at[r])==null?void 0:e.code}function Tt(r){var e;return(e=at[r])==null?void 0:e.label}function ia(r,e){return r.get("parameters").filter(t=>Yt(t.get("in"))).reduce((t,n)=>{const[s,o]=t;return[ye.BODY,ye.FILES].includes(n.get("in"))?[s,[...o,n]]:[[...s,n],o]},[[],[]])}function bn(r,{tags:e=[],defaultTags:t=[],...n}={}){var A,U;const{consumes:s,produces:o,...f}=I("map",[r],{...n,ignore:["parameters"]});f.security&&(f.security=[].concat(f.security)),r.get("responses").size===0&&(f.responses={200:{description:Tt(200)}});const m={...n,consumes:(A=r.get("consumes"))!=null&&A.length?r.get("consumes"):["application/json"]},[g,O]=ia(r);f.parameters=I("operationInParameters",[g],n),O.length&&(f.requestBody=I("operationRequestBody",[O],m));const P=(U=f.tags)!=null&&U.length?f.tags:t;return P.length&&(f.tags=P.map(({name:ne})=>ne)),e.push(...P),f}C("operation",bn);function An(r,e){let t=[...r.groups||[]];return I("map",[r],{...e,groups:t,groupsName:r.groupsName})}C("operationMedia",An);class Cn extends de{constructor(e={}){super(e),this.$kind="operationRequestBody",this.content(e.content||{})}description(e){return this.set("description",e),this}content(e){return this.set("content",Wt(e)),this}addContent(e,t,n){const s=this.get("content"),o=new de;return o.set("schema",t),n&&o.set("examples",n),s.set(e,o),this}required(e){return this.set("required",e),this}}function aa(r,e){let t=new ae;const n={},s=[];let o=0;const f=r.some(m=>m.get("in")==="files");return r.forEach(m=>{const g=m.getName();[...m.entries()].filter(([P])=>!["in","name"].includes(P)).forEach(([P,A])=>{n[P]===void 0&&(n[P]=A)});const O=I("operationInParameter",[m],e);if(g){const P={...O.schema||{type:O.type}};f&&O.description&&(P.description=O.description),t.addProperty(g,P),m.get("required")&&t.addRequired(g),o++}else s.push(O)}),!o&&s.length===1?s[0]:(t.type("object"),n.description&&f&&delete n.description,{schema:t.toJSON(e),required:!1,...n})}function Dn(r,{consumes:e,...t}){const{schema:n,description:s,examples:o,in:f,...m}=aa(r,t),g=new Cn(m);return s&&g.description(s),e.forEach(O=>{g.addContent(O,n,o)}),I("map",[g],t)}C("operationRequestBody",Dn);function In(r,e={}){const t=I("map",[r],e);return r.status===204&&delete t.content,t.headers&&Object.entries(t.headers).forEach(([n,{type:s,...o}])=>{t.headers[n]={...o,schema:{type:s}}}),t}C("operationResponse",In);function _n(r,e){return r.map(t=>e.parameters.find(s=>s.in===t.in&&s.name===t.name)||t).concat(...e.parameters.filter(t=>t.in!=="path"))}function oa(r){const[e,t]=r.split("="),n=(t||e).split("."),s=n.splice(0,1)[0];return{prefix:t&&e?`${e}=`:"",name:s,postfix:n.length?`.${n.join(".")}`:""}}function ca(r){let e=0;return r.split("").filter(t=>{t==="("&&e++;const n=e===0;return t===")"&&e--,n}).join("").split("/").filter(t=>!!t)}function $n(r,e=""){e instanceof RegExp&&(e=e.toString().replace(/^\//g,"").replace(/\/$/g,"").replace(/\\/g,""));const t=[],n=[];let s=!1,o="";return ca(`${r}${e}`).map(f=>{const m=f.replace(":","").replace("?","");if(f.includes(":")){const g=f.includes("?");g&&!s&&(s=!0,n.push({path:o,parameters:[].concat(t)}));const{prefix:O,name:P,postfix:A}=oa(m);o+=`/${O}{${P}}${A}`,t.push({in:"path",name:P,type:"string",required:!0}),g&&s&&n.push({path:o,parameters:[].concat(t)})}else o+=`/${f}`}),n.length?n:[{path:o,parameters:[].concat(t)}]}const ua="%c.%m";function Nn(r=""){const e=new Map,t=(n,s)=>{const o=(r||ua).replace(/%c/,n).replace(/%m/,s);return r===""?V.camelCase(o):o};return(n,s,o="")=>{const f=t(n,s),m=n+s;if(!e.has(m))return e.set(m,0),f;const g=o.match(/{(\w+)}/gi);if(g){const P=n+s+g[0];if(!e.has(P))return e.set(P,0),V.camelCase(`${f} By ${g}`)}const O=e.get(m)+1;return e.set(m,O),`${f}_${O}`}}function qn(r,{store:e,operationIdFormatter:t}){return t(e.parent.schema.get("name")||e.parent.targetName,e.propertyName,r)}const Ln=[W.ALL,W.GET,W.POST,W.PUT,W.PATCH,W.HEAD,W.OPTIONS,W.DELETE,W.TRACE];function fa(r,{path:e,method:t,operation:n}){return{...r,[e]:{...r[e],[t.toLowerCase()]:n}}}function ha(r){return({operationPath:e,operation:t,operationStore:n})=>{const{path:s,method:o}=e;return $n(r.ctrlRootPath,s).map(({path:f,parameters:m})=>(f=f||"/",m=_n(m.map(({type:g,...O})=>({...O,schema:{type:g}})),t),{operation:{...t,...e.toJSON(r),parameters:m,operationId:t.operationId||qn(f,{...r,store:n})},method:o,path:f}))}}function pa(r){return e=>{const t=e.operation.getAllowedOperationPath(Ln);if(t.length===0)return[];const n=I("operation",[e.operation],r);return t.map(s=>({operationPath:s,operation:n,operationStore:e}))}}function kn(r,{paths:e,rootPath:t,...n}){const o=ce(r).path,f=Gt(t+o);return n={...n,ctrlRootPath:f},[...Ot(r).values()].filter(Xt).filter(m=>m.operation.getAllowedOperationPath(Ln).length>0).flatMap(pa(n)).flatMap(ha(n)).reduce(fa,e)}C("paths",kn);function R(r){return(...e)=>{const t=r(ce(...e),e);typeof t=="function"&&t(...e)}}function la(...r){return R(e=>{e.store.set("childrenControllers",r),r.forEach(t=>{c.Store.from(t).set("parentController",e.token)})})}function ma(r,...e){return R(t=>{r=r||V.snakeCase(t.targetName),t.discriminatorAncestor&&t.schema.discriminatorValue(r,...e)})}function wt(r,e){if(!r)throw new Error("A type is required on `@CollectionOf(type)` decorator. Please give a type or wrap it inside an arrow function if you have a circular reference.");const t={};let n=!1;const s=(...o)=>{const f=K.from(...o);e&&(f.collectionType=e,f.schema.type(e)),f.type=r,f.itemSchema.type(r),f.schema.assign(t),f.isArray&&n&&(f.schema.set("contains",f.schema.get("items")),f.schema.delete("items"))};return s.MinItems=o=>(t.minItems=o,s),s.MaxItems=o=>(t.maxItems=o,s),s.MinProperties=o=>(t.minProperties=o,s),s.MaxProperties=o=>(t.maxProperties=o,s),s.Contains=()=>(n=!0,s),s.UniqueItems=(o=!0)=>(t.uniqueItems=o,s),s}function da(r){return wt(r,Array)}function ya(r){return wt(r,Map)}function ga(r){return wt(r).Contains()}function X(r,e){const t={};return(...n)=>{const s=c.useDecorators(e(...n));return s.Error=o=>(t.message=o,c.useDecorators(s,t.message&&R(f=>{const m=f.parentSchema.get("#errorMessage")||{};r==="required"?f.parentSchema.customKey("errorMessage",c.deepMerge(m,{[r]:{[f.propertyName]:o}})):f.itemSchema.customKey("errorMessage",c.deepMerge(m,{[r]:o}))}))),s}}const Oa=X("maxItems",r=>{if(r<0)throw new Error("The value of maxItems MUST be a non-negative integer.");return R(e=>{e.schema.maxItems(r)})}),Sa=X("maxProperties",r=>{if(r<0)throw new Error("The value of maxProperties MUST be a non-negative integer.");return R(e=>{e.isCollection?e.schema.maxProperties(r):e.itemSchema.maxProperties(r)})}),Pa=X("minItems",r=>{if(r<0)throw new Error("The value of minItems MUST be a non-negative integer.");return R(e=>{e.schema.minItems(r)})}),Ma=X("minProperties",r=>{if(r<0)throw new Error("The value of minProperties MUST be a non-negative integer.");return R(e=>{e.isCollection?e.schema.minProperties(r):e.itemSchema.minProperties(r)})}),Ea=X("uniqueItems",(r=!0)=>R(e=>{e.schema.uniqueItems(r)}));function Ta(r){return R((e,t)=>{e.itemSchema.additionalProperties(r)})}function wa(...r){return R(e=>{e.itemSchema.allOf(r)})}function vt(r){return R(e=>{r&&((c.isClass(r)||c.isArrowFn(r))&&(e.type=r),e.itemSchema.type(r))})}function Jn(...r){const e=r.find(t=>c.isClass(t));return c.useDecorators(e&&vt(e),R((t,n)=>{t.decoratorType===c.DecoratorTypes.PARAM&&(t.required=!0),t.decoratorType===c.DecoratorTypes.PROP&&t.parentSchema.addRequired(t.propertyName),t.schema.allow(...r)}))}function Gn(...r){return R(e=>{e.itemSchema.any(...r)})}function va(...r){return R(e=>{e.itemSchema.anyOf(r)})}function Ra(r){return R(e=>{e.itemSchema.const(r)})}function Bn(r,e){return R(t=>{t.itemSchema.customKey(r,e)})}function ba(r){return R(e=>{Object.entries(r).forEach(([t,n])=>{e.itemSchema.customKey(t,n)})})}function Aa(r){return R(e=>{e.itemSchema.default(r)})}function rr(r){return R(e=>{const t=e.parentSchema.get("#errorMessage")||{};e.parentSchema.customKey("errorMessage",{...t,...r})})}function Ca(r){return c.useDecorators(rr({_:r}))}function Da(r){return R((e,t)=>{var n;switch(c.decoratorTypeOf(t)){case c.DecoratorTypes.PROP:case c.DecoratorTypes.CLASS:e.schema.description(r);break;case c.DecoratorTypes.PARAM:e.parameter.description(r);break;case c.DecoratorTypes.METHOD:(n=e.operation)==null||n.description(r);break}})}function Ia(){return c.useDecorators(vt(),R(r=>{r.discriminatorKey()}))}function _a(r,...e){return R(t=>{t.itemSchema.enum(r,...e)})}const $a=X("enum",_a);function Na(...r){return R(e=>{e.schema.examples(r)})}function qa(r){return R(e=>{e.parameter.examples(r)})}const nr=X("maximum",(r,e=!1)=>R(t=>{e?t.itemSchema.exclusiveMaximum(r):t.itemSchema.maximum(r)})),La=nr,ka=X("exclusiveMaximum",(r,e=!0)=>nr(r,e)),sr=X("minimum",(r,e=!1)=>R(t=>{e?t.itemSchema.exclusiveMinimum(r):t.itemSchema.minimum(r)})),Ja=sr,Ga=X("exclusiveMinimum",(r,e=!0)=>sr(r,e));var ue=(r=>(r.DATE_TIME="date-time",r.DATE="date",r.TIME="time",r.EMAIL="email",r.HOSTNAME="hostname",r.IPV4="ipv4",r.IPV6="ipv6",r.URI="uri",r.URL="url",r.URI_REF="uri-reference",r.URI_TEMPLATE="uri-template",r.JSON_POINTER="json-pointer",r.RELATIVE_JSON_POINTER="relative-json-pointer",r.UUID="uuid",r.REGEX="regex",r))(ue||{});const Ke=X("format",r=>R(e=>{e.itemSchema.format(r)})),Ba=X("format",()=>Ke(ue.EMAIL)),Ua=X("format",()=>Ke(ue.DATE_TIME)),Ka=X("format",()=>Ke(ue.DATE)),Fa=X("format",()=>Ke(ue.TIME)),Ha=X("format",()=>Ke(ue.URI)),ja=X("format",()=>Ke(ue.URL));function Wa(r=!0){return R(e=>{e.schema.$forwardGroups=r})}function Un(r,e){e=[].concat(e),r=[].concat(r);let t=new Set,n=new Set,s=new Set,o=0,f=g=>{s.add(g.output)};for(let g=0;g<e.length;g++){let O=mt(String(e[g]),{onResult:f},!0),P=O.state.negated||O.state.negatedExtglob;P&&o++;for(let A of r){let U=O(A,!0);(P?!U.isMatch:U.isMatch)&&(P?t.add(U.output):(t.delete(U.output),n.add(U.output)))}}return!!(o===e.length?[...s]:[...n]).filter(g=>!t.has(g)).length}function ir(r,e=[]){const t=r.filter(s=>s.startsWith("!")).map(s=>s.replace("!","")),n=r.filter(s=>!s.startsWith("!"));return t.length&&e.length&&Un(t,e)?!0:n.length?!Un(r.filter(s=>!s.startsWith("!")),e):!1}function Va(r,e){const t=Object.entries(r[0]);e.children.forEach(n=>{const s=t.filter(([,f])=>f.includes(n.propertyName)).map(([f])=>f);ar(...s)(n.target,n.propertyKey)})}function ar(...r){return R(e=>{switch(e.decoratorType){case c.DecoratorTypes.CLASS:Va(r,e);break;case c.DecoratorTypes.PROP:Bn("x-groups",r)(e.target,e.propertyKey),e.schema.$hooks.on("groups",(n,s)=>!n&&ir(r,s)?!0:n);break;case c.DecoratorTypes.PARAM:let t="";r.length==2&&c.isArray(r[1])&&(t=r[0],r=r[1]),e.parameter.groups=r,e.parameter.groupsName=t;break}})}function za(){return c.StoreSet("hidden",!0)}function Ya(r=!0){return R(e=>{e.schema.ignore(r)})}function Xa(){return R(r=>{r.itemSchema.type("integer")})}function Qa(r,e=!1){return R(t=>{e?t.schema.label(r):t.itemSchema.label(r)})}const Za=X("maxLength",r=>{if(r<0)throw new Error("The value of maxLength MUST be a non-negative integer.");return R(e=>{e.itemSchema.maxLength(r)})}),xa=X("minLength",r=>{if(r<0)throw new Error("The value of minLength MUST be a non-negative integer.");return R(e=>{e.itemSchema.minLength(r)})}),eo=X("multipleOf",r=>{if(r<=0)throw new Error("The value of multipleOf MUST be a number, strictly greater than 0.");return R(e=>{e.itemSchema.multipleOf(r)})});function Kn(r){return R((e,t)=>{switch(c.decoratorTypeOf(t)){case c.DecoratorTypes.CLASS:e.schema.name(r);break;case c.DecoratorTypes.PARAM:e.parameter.name(r);break;default:e.parent.schema.addAlias(t[1],r)}})}function to(r,...e){return e=[r,...e],c.useDecorators(e.length===1&&vt(e[0]),Gn(null,...e))}function ro(...r){return R(e=>{e.itemSchema.oneOf(r)})}function Fn(){return R(r=>{switch(r.decoratorType){case c.DecoratorTypes.PARAM:r.required=!1;break;case c.DecoratorTypes.PROP:r.parentSchema.removeRequired(r.propertyName);break}})}const no=X("pattern",r=>R(e=>{e.itemSchema.pattern(r)}));function so(r=!0){return R(e=>{e.itemSchema.readOnly(r)})}function Hn(r){return R(e=>{e.schema.assign(r)})}function io(r,e){return R(t=>{t.schema.set(r,e)})}function ao(r,...e){return Hn({properties:{...e.reduce((t,n)=>({...t,[n]:r}),{})}})}const oo=X("required",(r=!0,...e)=>r?Jn(...e):Fn());function co(...r){return R(e=>{e.parent.schema.$hooks.on("requiredGroups",(t,n)=>ir(r,n)?t.filter(s=>s!==e.propertyKey):t)})}function uo(r){return R(e=>{e.schema.title(r)})}function fo(r){return R(()=>c.useDecorators(rr({type:r})))}function ho(r=!0){return R(e=>{e.itemSchema.writeOnly(r)})}function ee(r=Object){if(c.isClass(r)){const{schema:e}=ce(r);return e.properties=function(n){return Object.entries(n).forEach(([s,o])=>{ce(r.prototype,s).schema.assign(o)}),this},e}return ae.from({type:r})}function Rt(){return ee(String)}function po(r){return c.isObject(r)&&!("toJSON"in r)}function lo(...r){const e=[r.map(n=>po(n)?Rt().enum(Object.values(n)):n)],t=(...n)=>{const s=K.from(...n);s.nestedGenerics=e};return t.Nested=(...n)=>(e.push(n),t),t}function mo(...r){return e=>{const t=K.from(e);t.schema.genericLabels=r}}function ot(...r){return R((e,t)=>{switch(e.decoratorType){case c.DecoratorTypes.METHOD:e.operation.consumes(r);break;case c.DecoratorTypes.CLASS:c.decorateMethodsOf(t[0],ot(...r));break;default:throw new c.UnsupportedDecoratorType(ot,t)}})}function yo(...r){return c.useDecorators(ot(...r),c.StoreSet("acceptMimes",r))}class or extends Map{constructor(e={}){super(),this.actions=[],Object.entries(e).forEach(([t,n])=>{this.set(t,n)})}addAction(e){return this.actions.push(e),this}build(){const e=(...s)=>this.bind(s,e),t=s=>(...o)=>(s(...o),e),n=s=>t((...o)=>{s in this?this[s](...o):this.set(s,o[0])});return this.methods.forEach(s=>{e[V.pascalCase(s)]=n(s)}),e}toObject(){return[...this.entries()].reduce((e,[t,n])=>({...e,[t]:n}),{})}getMergedKey(e,t){let n=this.get(e)||t;if(n)return this.decoratorType===c.DecoratorTypes.CLASS&&(n={...n,...t||{}}),{...t||{},...n}}bind(e,t){this.entity=K.from(...e),this.beforeInit(),this.onInit(e,t),this.afterInit()}onInit(e,t){this.forEach((n,s)=>{this.onMapKey(s,n)})}onMapKey(e,t){this.entity.set(e,t)}runActions(){return this.actions.forEach(e=>{e(this)}),this}beforeInit(){}afterInit(){}}const jn=new Map;function go(r,e){jn.set(r,e)}function Wn(r){return jn.get(r)}function Oo(r){return c.isObject(r)&&!("toJSON"in r)}function Vn(r){return r.map(e=>Oo(e)?Rt().enum(Object.values(e)):e)}class So extends or{constructor({status:e,model:t}){super(),this.methods=["contentType","description","examples","type","status","of","ofInteger","oneOf","allOf","anyOf","nested","header","headers","schema","title","groups","allowedGroups","location","binary"],this.model(t),this.status(e)}type(e){return this.model(e)}model(e){return e&&this.set("model",e),this}status(e){return this.set("status",e),e&&Tt(e)&&!this.get("description")&&(this.set("description",Tt(e)),this.get("model")||this.model(Wn(+e))),this}headers(e){return this.set("headers",{...this.get("headers")||{},...jt(e)}),this}header(e,t){return t===void 0&&c.isString(e)?this.headers({[e]:{type:"string"}}):this.headers({[e]:t})}location(e,t={}){return this.headers({Location:{...t,value:e}}),this}groups(...e){return e.length===2&&c.isArray(e[1])?(this.set("groupsName",e[0]),this.set("groups",e[1])):this.set("groups",e),this}allowedGroups(...e){return this.set("allowedGroups",new Set(e)),this}nested(...e){const t=this.get("model");return this.checkPrimitive(t),this.checkCollection(t),this.addAction(n=>{this.get("schema").nestedGenerics.push(Vn(e))}),this}of(...e){const t=this.get("model");return this.checkPrimitive(t),this.addAction(()=>{const n=this.get("schema");c.isCollection(t)?n==null||n.itemSchema({type:e[0]}):n==null||n.nestedGenerics.push(Vn(e))}),this}ofInteger(){return this.of("integer")}oneOf(...e){return this.manyOf("oneOf",e)}allOf(...e){return this.manyOf("allOf",e)}anyOf(...e){return this.manyOf("anyOf",e)}schema(e){return this.addAction(()=>{this.get("schema").assign(e)}),this}examples(e){return this.set("examples",c.isString(e)?[e]:e),this}title(e){return this.schema({title:e})}binary(){return this.type(String),this.set("contentType","application/octet-stream"),this.schema({format:"binary"}),this}checkPrimitive(e){if(c.isPrimitiveOrPrimitiveClass(e))throw new Error("Returns.Of cannot be used with the following primitive classes: String, Number, Boolean")}checkCollection(e){if(c.isCollection(e))throw new Error("Returns.Nested cannot be used with the following classes: Map, Set, Array, String, Number, Boolean")}getContentType(){const e=this.get("model");let t=this.get("contentType");return(e&&!c.isPlainObject(e)&&!c.isPrimitiveOrPrimitiveClass(e)||this.hasOfTypes)&&(t=t||"application/json"),t}getStatus(){return this.get("status")||"default"}onInit(e,t){switch(c.decoratorTypeOf(e)){case c.DecoratorTypes.METHOD:this.entity=K.from(...e),this.entity.operation&&this.map();break;case c.DecoratorTypes.CLASS:this.decoratorType=c.DecoratorTypes.CLASS,c.decorateMethodsOf(e[0],t);break}}map(){const e=this.get("model"),{entity:t,decoratorType:n}=this,s=this.entity.operation,o=this.getStatus(),f=s.ensureResponseOf(o),m=this.getContentType();let{description:g=f.get("description")}=this.toObject();g&&(g=n===c.DecoratorTypes.CLASS&&f.get("description")||g,f.description(g));const O=this.getMergedKey("headers",f.get("headers"));return O&&f.headers(O),this.mapMedia(f),(Ft(this.get("status"))||o==="default")&&e&&(t.type=e),m&&s.addProduce(m),this.runActions()}mapMedia(e){const t=this.getContentType(),n=this.get("model"),s=e.getMedia(t||"*/*"),o=s.get("schema")||new ae({type:n}),f=this.get("groups"),m=this.get("groupsName"),g=this.get("allowedGroups"),O=this.entity.operation;if(n&&(c.isArray(n)?o.oneOf(n.map(A=>({type:A}))):o.type(n)),this.set("schema",o),s.schema(o),s.groups=f,s.groupsName=m,g){s.allowedGroups=g;const A=new yt;A.in("query").name("includes"),A.schema(ae.from({type:"array",items:{type:"string",enum:[...g]}})),O.addParameter(-1,A)}const P=this.get("examples");return P&&s.examples(P),s}manyOf(e,t){const n=this.get("model");return this.hasOfTypes=!0,this.addAction(()=>{const s=this.get("schema");c.isCollection(n)?(s.type(n||Object),s.itemSchema().set(e,t)):s.set(e,t)}),this}}function Fe(r,e){return new So({status:r,model:e}).build()}function Po(r){return Fe().ContentType(r)}function cr(r=!0){return R((e,t)=>{switch(c.decoratorTypeOf(t)){case c.DecoratorTypes.METHOD:e.operation.deprecated(r);break;case c.DecoratorTypes.CLASS:c.decorateMethodsOf(t[0],cr(r));break;case c.DecoratorTypes.PARAM:e.parameter.set("deprecated",r);break;case c.DecoratorTypes.PROP:e.schema.set("deprecated",r);break;default:throw new c.UnsupportedDecoratorType(cr,t)}})}function Mo(r,e){return e!==void 0&&(r={[r]:e}),e===void 0&&c.isString(r)&&(r={[r]:{type:"string"}}),Fe().Headers(r)}function ur(r){const e=new yt,t={},n=(s,o,f)=>{const m=K.from(s,o,f);switch(m.decoratorType){case c.DecoratorTypes.PARAM:m.parameter.in(r);break;case c.DecoratorTypes.METHOD:e.in(r),m.operation.addParameter(-1,e),e.schema(ae.from(t));break;case c.DecoratorTypes.CLASS:c.decorateMethodsOf(s,n);break;default:throw new c.UnsupportedDecoratorType(ur,[s,o,f])}};return n.Type=s=>(t.type=s,n),n.Name=s=>(e.name(s),n),n.Description=s=>(e.description(s),n),n.Required=(s=!0)=>(e.required(s),n),n.Pattern=s=>n.Schema({pattern:s.toString()}),n.Schema=s=>(Object.assign(t,s.toJSON?s.toJSON():s),n),n}function Eo(r){return(...e)=>{const[t,n,s]=e,o=c.Metadata.getParamTypes(t,n)[s]===Array;r=typeof r=="object"?void 0:r;const f=[r,!o&&"0"].filter(Boolean).join(".");c.useDecorators(ur(ye.FILES),Kn(f),c.useMethodDecorators(Fe(400).Description("<File too long | Too many parts | Too many files | Field name too long | Field value too long | Too many fields | Unexpected field> [fieldName] Example: File too long file1"),ot("multipart/form-data")))(...e)}}function To(r,e){return Fe().Location(r,e)}const wo=new Set([...Object.keys(W).filter(r=>r!==W.CUSTOM).map(r=>r.toLowerCase())]);function zn(r){let e,t;const n=r.filter(s=>typeof s=="string"&&wo.has(s.toLowerCase())?(e=s.toLocaleUpperCase(),!1):typeof s=="string"||s instanceof RegExp?(t=s||"/",!1):!!s);return{path:t,method:e,use:n}}class vo extends or{constructor(){super(...arguments),this.methods=["name","description","summary","method","id","use","useAfter","useBefore"]}beforeInit(){const e=this.get("path"),t=W[this.get("method")]||W.CUSTOM;e&&(this.operationPath=this.entity.operation.addOperationPath(t,e))}onMapKey(e,t){var n,s;switch(e){case"name":case"id":this.entity.operation.operationId(t);return;case"summary":(n=this.operationPath)==null||n.summary(t),this.entity.operation.summary(t);return;case"description":(s=this.operationPath)==null||s.description(t),this.entity.operation.description(t);return;case"use":this.entity.use(t);return;case"useAfter":this.entity.after(t);return;case"useBefore":this.entity.before(t);return}return super.onMapKey(e,t)}}function Oe(...r){const e=zn(r);return new vo(e).build()}function Yn(r){return R((e,t)=>{if(e.decoratorType!==c.DecoratorTypes.METHOD)throw new c.UnsupportedDecoratorType(Yn,t);e.operation.operationId(r)})}function Xn(r,e="/"){return R((t,n)=>{if(t.decoratorType!==c.DecoratorTypes.METHOD)throw new c.UnsupportedDecoratorType(Xn,n);t.operation.addOperationPath(r.toUpperCase(),e)})}function Ro(){return ar("partial")}function Qn(r){return R((e,t)=>{if(e.decoratorType!==c.DecoratorTypes.CLASS)throw new c.UnsupportedDecoratorType(Qn,t);e.path=r})}function fr(...r){return R((e,t)=>{switch(e.decoratorType){case c.DecoratorTypes.METHOD:e.operation.produces(r);break;case c.DecoratorTypes.CLASS:c.decorateMethodsOf(t[0],fr(...r));break;default:throw new c.UnsupportedDecoratorType(fr,t)}})}function bo(r){return Oe(W.PUBLISH,r)}function Ao(...r){const{status:e,url:t,meta:n}=r.reduce((s,o)=>c.isNumber(o)?(s.status=o,s):c.isString(o)?(s.url=o,s):(s.meta=o,s),{status:302,url:"",meta:{}});return c.useDecorators(Fe(e).Location(t,n),R(s=>{var o;(o=s.operation)==null||o.setRedirection(e)}))}function Co(r="/",...e){return Oe(...[W.ALL,r].concat(e))}function Do(r="/",...e){return Oe(...[W.GET,r].concat(e))}function Io(r="/",...e){return Oe(...[W.POST,r].concat(e))}function _o(r="/",...e){return Oe(...[W.PUT,r].concat(e))}function $o(r="/",...e){return Oe(...[W.DELETE,r].concat(e))}function No(r="/",...e){return Oe(...[W.HEAD,r].concat(e))}function qo(r="/",...e){return Oe(...[W.PATCH,r].concat(e))}function Lo(r="/",...e){return Oe(...[W.OPTIONS,r].concat(e))}function bt(r,...e){return R((t,n)=>{switch(t.decoratorType){case c.DecoratorTypes.METHOD:Array.isArray(r)?t.operation.security(r):t.operation.addSecurityScopes(r,e);break;case c.DecoratorTypes.CLASS:Array.isArray(r)?c.decorateMethodsOf(n[0],bt(r)):c.decorateMethodsOf(n[0],bt(r,...e));break;default:throw new c.UnsupportedDecoratorType(bt,n)}})}function ko(r,e){return Fe(r,e)}function Jo(r){return Oe(W.SUBSCRIBE,r)}function Zn(r){return R((e,t)=>{if(e.decoratorType!==c.DecoratorTypes.METHOD)throw new c.UnsupportedDecoratorType(Zn,t);e.operation.summary(r)})}function Go(r){return r.map(e=>typeof e=="string"?{name:e}:e)}function hr(...r){return R((e,t)=>{switch(e.decoratorType){case c.DecoratorTypes.METHOD:e.operation.addTags(Go(r));break;case c.DecoratorTypes.CLASS:c.decorateMethodsOf(t[0],hr(...r));break;default:throw new c.UnsupportedDecoratorType(hr,t)}})}function Bo(r,e){return c.StoreSet("view",{path:r,options:e})}function pr(r,e){if(r instanceof RegExp||e instanceof RegExp){if(!r)return e;if(!e)return r;const n=r instanceof RegExp?r:new RegExp(r,"gi"),s=e instanceof RegExp?e:new RegExp(e,"gi");return new RegExp(n.source+s.source,(n.global?"g":"")+(n.ignoreCase?"i":"")+(n.multiline?"m":""))}r&&e&&r.endsWith("/")&&e.startsWith("/")&&(e=e.slice(1));const t=(r||"")+(e||"");return t.endsWith("/")&&t.length>1?t.slice(0,-1):t}class xn{constructor(e){Object.assign(this,e),this.paramsTypes=this.endpoint.getParamTypes()}get url(){return this.fullPath}get path(){var e;return(e=this.operationPath)==null?void 0:e.path}get fullPath(){return pr(this.basePath,this.path)}get method(){var e;return((e=this.operationPath)==null?void 0:e.method)||"USE"}get name(){return`${this.endpoint.targetName}.${this.methodClassName}()`}get className(){return this.endpoint.targetName}get methodClassName(){return this.propertyKey}get parameters(){return this.endpoint.parameters}get propertyKey(){return String(this.endpoint.propertyKey)}get propertyName(){return this.endpoint.propertyName}get store(){return this.endpoint.store}get operation(){return this.endpoint.operation}get operationId(){return this.operation.get("operationId")||this.endpoint.propertyKey}has(e){return this.paramsTypes[e]}}function Uo(...r){return ee().allOf(r)}function Ko(...r){return ee().any(...r)}function Fo(...r){return ee().anyOf(r)}function Ho(){return ee(Boolean)}function jo(){return ee(Array)}function Wo(){return ee(Map).unknown(!0)}function Vo(){return ee(Array).uniqueItems(!0)}function zo(){return ee(Date).format(ue.DATE)}function Yo(){return ee(Date).format(ue.DATE_TIME)}function Xo(){return ee(Date).format(ue.TIME)}function Qo(){return ee(String).format(ue.EMAIL)}function Zo(r){const e=Rt().enum(r);return dt.set(r,e),e}function xo(){return ee(Number).integer()}function ec(r){try{if(r())return K.from(r()).schema}catch{}return new Qt(r)}function tc(){return ee(Number)}function rc(r={}){return ee(Object).properties(r)}function nc(...r){return ee().oneOf(r)}function sc(){return ee(String).format(ue.URI)}function ic(){return ee(String).format(ue.URL)}const At=c.mergeReducerBuilder((r,e)=>r.type&&r.type&&r.type===e.type&&e.type==="array"?JSON.stringify(r.items)===JSON.stringify(e.items):r.type&&r.type===e.type||r.$ref&&r.$ref===e.$ref),es=c.mergeReducerBuilder((r,e)=>r.in===e.in&&r.name===e.name),ts=c.mergeReducerBuilder((r,e)=>!!Object.keys(e).find(t=>!!r[t])),rs=c.mergeReducerBuilder((r,e)=>r.name===e.name),ac={security:ts,parameters:es,oneOf:At,anyOf:At,allOf:At,tags:rs};function Ct(r,e){return c.deepMerge(r,e,{reducers:ac,cleanUndefinedProps:!0})}const lr=new Map;function oc(r,e,t){lr.has(r)||lr.set(r,new Map);const n=lr.get(r),s=JSON.stringify(e);return n.has(s)||n.set(s,t()),n.get(s)}function cc(r,e){const t=ce(r),{rootPath:n="/"}=e;return e={...e,rootPath:n,defaultTags:[c.cleanObject({name:t.schema.getName(),description:t.schema.get("description")})]},I("generate",[t],e)}function mr(r,e={}){if(e={specType:L.OPENAPI,...e,tags:[],paths:{},channels:{},components:{},operationIdFormatter:e.operationIdFormatter||Nn(e.operationIdPattern),root:!1},c.isArray(r)){let t={};return e={...e,append(n){t=Ct(t,n)}},r.forEach(({token:n,...s})=>{const o=mr(n,{...e,...s});e.append(o)}),t}return oc(r,e,()=>cc(r,e))}function ns(r){return r.startsWith("3.")?L.OPENAPI:L.SWAGGER}function ss(r){return"openapi"in r?L.OPENAPI:L.SWAGGER}function dr(r){const{title:e,description:t,version:n,termsOfService:s,contact:o,license:f}=r;return c.cleanObject({version:n,title:e,description:t,termsOfService:s,contact:o,license:f})}function yr(r,{version:e,specVersion:t,acceptMimes:n=["application/json"]}){const{paths:s,security:o,tags:f,host:m,basePath:g,schemes:O,consumes:P=[],produces:A=["application/json"],definitions:U,parameters:ne,responses:F,securityDefinitions:ve,externalDocs:Re}=r;return{swagger:t,consumes:c.uniq([...n,...P]),produces:c.uniq([...A]),info:dr(c.getValue(r,"info",{})),paths:s,host:m,basePath:g,schemes:O,definitions:U,parameters:ne,responses:F,security:o,securityDefinitions:ve,tags:f,externalDocs:Re}}function gr(r,{specVersion:e}){const{servers:t,paths:n,components:s,security:o,tags:f,externalDocs:m}=r;return{openapi:e,info:dr(c.getValue(r,"info",{})),servers:t,paths:n,components:s,security:o,tags:f,externalDocs:m}}function is(r,{fileSpec:e,acceptMimes:t,specVersion:n,version:s}){n=n||c.getValue(r,"openapi",c.getValue(r,"swagger","2.0"));const o={specVersion:n,acceptMimes:t};switch(ns(n)){case L.OPENAPI:r=gr(r,o),e=e&&gr(e,o);break;default:case L.SWAGGER:r=yr(r,o),e=e&&yr(e,o);break}return r=Ct(r,e),c.setValue(r,"info.title",c.getValue(r,"info.title","Api documentation")),c.setValue(r,"info.version",c.getValue(r,"info.version",s)),r}const uc=["get","put","post","delete","options","head","patch","trace"],fc=["format","minimum","maximum","exclusiveMinimum","exclusiveMaximum","minLength","maxLength","multipleOf","minItems","maxItems","uniqueItems","minProperties","maxProperties","additionalProperties","pattern","enum","default"],hc=["type","items"],pc=/^(application\/json|[^;\/ \t]+\/[^;\/ \t]+[+]json)[ \t]*(;.*)?$/,Dt={APPLICATION_X_WWW_URLENCODED:"application/x-www-form-urlencoded",MULTIPART_FORM_DATA:"multipart/form-data"};function lc(r){return r.replace("#/components/schemas/","#/definitions/").replace("#/components/","#/x-components/")}function Or(r){if(Array.isArray(r))r.forEach(Or);else if(typeof r=="object")for(let e in r)e==="$ref"?r.$ref=lc(r.$ref):Or(r[e])}function as(r){return new RegExp(pc,"i").test(r)}function os(r){const e=Object.keys(Dt).map(t=>Dt[t]);return Object.keys(r).filter(t=>e.indexOf(t)>-1||as(t))}function cs(r){function e(t){const{scheme:n,type:s,name:o,bearerFormat:f,flows:m,...g}=t;switch(s){case"http":if(n==="basic")return{...g,type:n};if(n==="bearer")return{...g,type:"apiKey",name:"Authorization",in:"header"};break;case"oauth2":const O=Object.keys(m)[0],P=m[O];let A=O;return A==="clientCredentials"?A="application":A==="authorizationCode"&&(A="accessCode"),{type:s,flow:A,authorizationUrl:P.authorizationUrl,tokenUrl:P.tokenUrl,scopes:P.scopes}}}return Object.entries(r).reduce((t,[n,s])=>{const o=e(s);return o&&(t[n]=o),t},{})}function us(r){let e=r.url;const t=r.variables||{};for(const s in t){const o=t[s]||{};if(o.default){const f=RegExp(`{${s}}`,"g");e=e.replace(f,o.default)}}const n=new URL(e);return{host:n.host?n.host:void 0,basePath:n.pathname,schemes:n.protocol!==null?[n.protocol.substring(0,n.protocol.length-1)]:void 0}}class fs{constructor(e){this.spec=JSON.parse(JSON.stringify(e))}convertInfos(){const e=this.spec.servers&&this.spec.servers[0];return e?us(e):{}}resolveReference(e,t,n){if(!t||!t.$ref)return t;const s=t.$ref;if(s.startsWith("#")){const o=s.split("/").map(m=>m.replace(/~1/g,"/").replace(/~0/g,"~"));o.shift();let f=e;return o.forEach(m=>{f=f[m]}),n?JSON.parse(JSON.stringify(f)):f}}convert(){const e={swagger:"2.0",...this.convertInfos(),paths:this.spec.paths?this.convertOperations(this.spec.paths,this.spec):void 0};return this.spec.components&&(this.convertSchemas(),this.convertSecurityDefinitions(),this.spec["x-components"]=this.spec.components,delete this.spec.components,Or(this.spec)),delete this.spec.servers,delete this.spec.openapi,delete this.spec["x-components"],c.cleanObject({...e,...this.spec})}convertOperations(e,t){return Object.entries(e).reduce((n,[s,o])=>{const f=n[s]=this.resolveReference({...t,paths:n},o,!0);return this.convertParameters(f),Object.keys(f).forEach(m=>{if(uc.indexOf(m)>=0){const g=f[m]=this.resolveReference({...t,paths:n},f[m],!0);this.convertOperationParameters(g),this.convertResponses(g)}}),n},e)}convertOperationParameters(e){let t,n,s,o;if(e.parameters=e.parameters||[],e.requestBody){let f=this.resolveReference(this.spec,e.requestBody,!0);if(e.requestBody.content){const m=os(e.requestBody.content)[0],g={content:{}},O=e.requestBody.content[m];O&&O.schema&&O.schema.$ref&&!O.schema.$ref.startsWith("#")&&(f=this.resolveReference(this.spec,O.schema,!0),g.content[`${m}`]={schema:f},f=g)}if(f.name="body",t=f.content,t&&Object.keys(t).length){if(s=Object.keys(t).filter(m=>m.indexOf("/")>0),o=s.filter(m=>m.indexOf("*")<0),n=os(t)[0],delete f.content,[Dt.APPLICATION_X_WWW_URLENCODED,Dt.MULTIPART_FORM_DATA].includes(n))if(e.consumes=o,f.in="formData",f.schema=t[n].schema,f.schema=this.resolveReference(this.spec,f.schema,!0),f.schema.type==="object"&&f.schema.properties){const m=f.schema.required||[];Object.keys(f.schema.properties).forEach(g=>{var P;const O=f.schema.properties[g];if(!O.readOnly){const A={name:g,in:"formData",schema:O};m.indexOf(g)>=0&&(A.required=!0),(P=e.parameters)==null||P.push(A)}})}else e.parameters.push(f);else n?(e.consumes=o,f.in="body",f.schema=t[n].schema,e.parameters.push(f)):s&&(e.consumes=o||["application/octet-stream"],f.in="body",f.name=f.name||"file",delete f.type,f.schema=t[s[0]].schema||{type:"string",format:"binary"},e.parameters.push(f));f.schema&&this.convertSchema(f.schema,"request")}delete e.requestBody}this.convertParameters(e)}convertParameters(e){e.parameters!==void 0&&(e.parameters=e.parameters||[],(e.parameters||[]).forEach((t,n)=>{if(t=e.parameters[n]=this.resolveReference(this.spec,t,!1),t.in!=="body"){if(this.copySchemaProperties(t,fc),this.copySchemaProperties(t,hc),this.copySchemaXProperties(t),!t.description){const s=this.resolveReference(this.spec,t.schema,!1);s&&s.description&&(t.description=s.description)}t.example!==void 0&&(t["x-example"]=t.example),delete t.schema,delete t.allowReserved,delete t.example}if(t.type==="array")switch(t.style||(t.in==="query"||t.in==="cookie"?"form":"simple")){case"matrix":t.collectionFormat=t.explode?void 0:"csv";break;case"label":t.collectionFormat=void 0;break;case"simple":t.collectionFormat="csv";break;case"spaceDelimited":t.collectionFormat="ssv";break;case"pipeDelimited":t.collectionFormat="pipes";break;case"deepOpbject":t.collectionFormat="multi";break;case"form":t.collectionFormat=t.explode===!1?"csv":"multi";break}delete t.style,delete t.explode}))}copySchemaProperties(e,t){let n=this.resolveReference(this.spec,e.schema,!0);n&&t.forEach(s=>{const o=n[s];s==="additionalProperties"&&typeof o=="boolean"||o!==void 0&&(e[s]=o)})}copySchemaXProperties(e){let t=this.resolveReference(this.spec,e.schema,!0);t&&Object.keys(t).forEach(n=>{Reflect.hasOwnProperty.call(t,n)&&!Reflect.hasOwnProperty.call(e,n)&&n.startsWith("x-")&&(e[n]=t[n])})}convertResponses(e){Object.keys(e.responses||{}).forEach(t=>{const n=e.responses[t]=this.resolveReference(this.spec,e.responses[t],!0);if(n.content){let s=null,o=null;if(Object.keys(n.content).forEach(f=>{const m=f.indexOf("*")<0?f:"application/octet-stream";e.produces?e.produces.indexOf(m)<0&&e.produces.push(m):e.produces=[m];const g=n.content[f];s=s||g.schema,!o&&as(m)&&(o=g.schema),g.example&&(n.examples=n.examples||{},n.examples[m]=g.example)}),s){n.schema=o||s;const f=this.resolveReference(this.spec,n.schema,!0);f&&n.schema.$ref&&!n.schema.$ref.startsWith("#")&&(n.schema=f),this.convertSchema(n.schema,"response")}}Object.keys(n.headers||{}).forEach(s=>{const o=this.resolveReference(this.spec,n.headers[s],!0);o.schema&&(o.type=o.schema.type,o.format=o.schema.format,delete o.schema),n.headers[s]=o}),delete n.content})}convertSchema(e,t){if(e.oneOf&&(delete e.oneOf,e.discriminator&&delete e.discriminator),e.anyOf&&(delete e.anyOf,e.discriminator&&delete e.discriminator),e.allOf)for(const n in e.allOf)this.convertSchema(e.allOf[n],t);switch(e.discriminator&&(e.discriminator.mapping&&this.convertDiscriminatorMapping(e.discriminator.mapping),e.discriminator=e.discriminator.propertyName),e.type){case"object":e.properties&&Object.keys(e.properties).forEach(n=>{e.properties[n].writeOnly===!0&&t==="response"?delete e.properties[n]:(this.convertSchema(e.properties[n],t),delete e.properties[n].writeOnly)});break;case"array":e.items&&this.convertSchema(e.items,t)}e.nullable&&(e["x-nullable"]=!0,delete e.nullable),e.deprecated!==void 0&&(e["x-deprecated"]===void 0&&(e["x-deprecated"]=e.deprecated),delete e.deprecated)}convertSchemas(){this.spec.definitions=this.spec.components.schemas,Object.keys(this.spec.definitions||{}).forEach(e=>{this.convertSchema(this.spec.definitions[e])}),delete this.spec.components.schemas}convertDiscriminatorMapping(e){Object.keys(e).forEach(t=>{const n=e[t];if(typeof n!="string"){console.warn(`Ignoring ${n} for ${t} in discriminator.mapping.`);return}let s;if(/^[a-zA-Z0-9._-]+$/.test(n))try{s=this.resolveReference(this.spec,{$ref:`#/components/schemas/${n}`},!1)}catch(o){console.debug(`Error resolving ${n} for ${t} as schema name in discriminator.mapping: ${o}`)}if(!s)try{s=this.resolveReference(this.spec,{$ref:n},!1)}catch(o){console.debug(`Error resolving ${n} for ${t} in discriminator.mapping: ${o}`)}s?(s["x-discriminator-value"]=t,s["x-ms-discriminator-value"]=t):console.warn(`Unable to resolve ${n} for ${t} in discriminator.mapping.`)})}convertSecurityDefinitions(){this.spec.components.securitySchemes&&(this.spec.securityDefinitions=cs(this.spec.components.securitySchemes),delete this.spec.components.securitySchemes)}}function hs(r){return new fs(r).convert()}function mc({tokens:r,...e}){const{version:t="1.0.0",acceptMimes:n,fileSpec:s={},specVersion:o}=e,f=is(c.getValue(e,"spec",{}),{fileSpec:s,version:t,specVersion:o,acceptMimes:n}),m=ss(f);let g=mr(r,e);const O=Ct(f,g);return e.sortPaths&&(O.paths=Object.fromEntries(Object.entries(O.paths).sort(([P],[A])=>P.localeCompare(A)))),m===L.SWAGGER?hs(O):O}const ps="$cache:schemes";function dc(r){return JSON.stringify(r)}function yc(r,e){const t=r.store.get(ps)||new Map,n=dc(e);if(!t.has(n)){const s=I("schema",[r.schema],e);Object.keys(c.getValue(e,"components.schemas",{})).length&&(s.definitions=e.components.schemas),t.set(n,s)}return r.store.set(ps,t),t.get(n)}function gc(r,e={}){var s;const t=ce(r),n=e.specType||L.JSON;return e={endpoint:!0,groups:[],inlineEnums:n===L.JSON,...e,specType:n,components:{schemas:{}}},t.decoratorType==="parameter"&&(e={...e,genericTypes:t.nestedGenerics[0],nestedGenerics:t.nestedGenerics,groups:(s=t.parameter)==null?void 0:s.groups}),yc(t,e)}function ls(r,e={}){const t=r.isStore?r:ce(r),n=pr(e.basePath,t.path);let s=[];return e.withChildren&&(s=t.get("childrenControllers",[]).reduce((f,m)=>f.concat(ls(m,{...e,basePath:n})),s)),[...Ot(r).values()].reduce((o,f)=>{const{operation:m}=f;return m&&m.getAllowedOperationPath(e.allowedVerbs).forEach(g=>{o.push(new xn({basePath:n,token:r,endpoint:f,operationPath:g}))}),o},s)}function ms(r){const e=r.isStore?r:ce(r);if(!e.$properties){const t=gt(e);e.$properties=new Map,t.forEach(n=>{n.children.forEach(s=>{e.$properties.has(s.propertyKey)||e.$properties.set(s.propertyKey,s)})})}return e.$properties}function Oc(r,e={}){const t=ms(r),n=new Map;return t.forEach((s,o)=>{!e.withIgnoredProps&&er(s.itemSchema,e)||n.set(o,s)}),n}a.ARRAY_PROPERTIES=ln,a.AcceptMime=yo,a.AdditionalProperties=Ta,a.All=Co,a.AllOf=wa,a.Allow=Jn,a.Any=Gn,a.AnyOf=va,a.ArrayOf=da,a.BOOLEAN_PROPERTIES=hn,a.COMMON_PROPERTIES=xt,a.Children=la,a.CollectionContains=ga,a.CollectionOf=wt,a.Const=Ra,a.Consumes=ot,a.ContentType=Po,a.Converter=fs,a.CustomKey=Bn,a.CustomKeys=ba,a.DateFormat=Ka,a.DateTime=Ua,a.DecoratorContext=or,a.Default=Aa,a.DefaultMsg=Ca,a.Delete=$o,a.Deprecated=cr,a.Description=Da,a.Discriminator=Kt,a.DiscriminatorKey=Ia,a.DiscriminatorValue=ma,a.Email=Ba,a.EndpointMetadata=Ri,a.Enum=$a,a.ErrorMsg=rr,a.Example=Na,a.Examples=qa,a.ExclusiveMaximum=ka,a.ExclusiveMinimum=Ga,a.For=io,a.Format=Ke,a.ForwardGroups=Wa,a.GenericOf=lo,a.Generics=mo,a.Get=Do,a.Groups=ar,a.HTTP_STATUS_MESSAGES=at,a.Head=No,a.Header=Mo,a.Hidden=za,a.Ignore=Ya,a.In=ur,a.InFile=Eo,a.Integer=Xa,a.JSON_TYPES=Fr,a.JsonEntitiesContainer=Ue,a.JsonEntityComponent=Qe,a.JsonEntityFn=R,a.JsonEntityStore=K,a.JsonFormatTypes=ue,a.JsonLazyRef=Qt,a.JsonMap=de,a.JsonMedia=Vt,a.JsonMethodPath=Vr,a.JsonOperation=zr,a.JsonOperationPathsMap=Yr,a.JsonOperationRoute=xn,a.JsonParameter=yt,a.JsonParameterTypes=ye,a.JsonRequestBody=Cn,a.JsonResponse=Wr,a.JsonSchema=ae,a.LabelledAs=Qa,a.Location=To,a.MANY_OF_PROPERTIES=Pt,a.MapOf=ya,a.Max=La,a.MaxItems=Oa,a.MaxLength=Za,a.MaxProperties=Sa,a.Maximum=nr,a.Min=Ja,a.MinItems=Pa,a.MinLength=xa,a.MinProperties=Ma,a.Minimum=sr,a.MultipleOf=eo,a.NUMBER_PROPERTIES=pn,a.Name=Kn,a.Nullable=to,a.OBJECT_PROPERTIES=mn,a.OPERATION_HTTP_VERBS=di,a.OPERATION_WS_VERBS=yi,a.OneOf=ro,a.Operation=Oe,a.OperationId=Yn,a.OperationPath=Xn,a.OperationVerbs=W,a.Optional=Fn,a.Options=Lo,a.ParamMetadata=Ci,a.Partial=Ro,a.Patch=qo,a.Path=Qn,a.Pattern=no,a.Post=Io,a.Produces=fr,a.Property=vt,a.PropertyMetadata=_i,a.Publish=bo,a.Put=_o,a.ReadOnly=so,a.RecordOf=ao,a.Redirect=Ao,a.Required=oo,a.RequiredGroups=co,a.Returns=Fe,a.STRING_PROPERTIES=fn,a.Schema=Hn,a.Security=bt,a.SpecTypes=L,a.Status=ko,a.Subscribe=Jo,a.Summary=Zn,a.Tags=hr,a.TimeFormat=Fa,a.Title=uo,a.TypeError=fo,a.UniqueItems=Ea,a.Uri=Ha,a.Url=ja,a.View=Bo,a.WriteOnly=ho,a.allOf=Uo,a.alterIgnore=er,a.alterOneOf=Pn,a.alterRequiredGroups=gn,a.any=Ko,a.anyMapper=tn,a.anyOf=Fo,a.array=jo,a.boolean=Ho,a.buildPath=Gt,a.channelsMapper=Xr,a.classMapper=rn,a.concatParameters=_n,a.concatPath=pr,a.createRef=st,a.createRefName=nt,a.date=zo,a.datetime=Yo,a.defineStatusModel=go,a.discriminatorMappingMapper=St,a.email=Qo,a.enums=Zo,a.enumsMapper=Zt,a.enumsRegistry=dt,a.execMapper=I,a.execOneOfMapper=Gr,a.formatParameterType=zt,a.from=ee,a.generateSpec=mc,a.genericsMapper=nn,a.getComputedType=Kr,a.getGenericsMap=Zr,a.getInheritedStores=gt,a.getJsonEntityStore=ce,a.getJsonPathParameters=$n,a.getJsonSchema=gc,a.getJsonSchemaMapper=Jr,a.getJsonType=Me,a.getOperationId=qn,a.getOperationsRoutes=ls,a.getOperationsStores=Ot,a.getProperties=Oc,a.getPropertiesStores=ms,a.getSpec=mr,a.getSpecType=ns,a.getSpecTypeFromSpec=ss,a.getStatusConstant=sa,a.getStatusMessage=Tt,a.getStatusModel=Wn,a.hasMapper=Jt,a.inheritedClassMapper=an,a.integer=xo,a.isParameterType=Yt,a.isRedirectionStatus=Ht,a.isSuccessStatus=Ft,a.itemMapper=on,a.lazyRef=ec,a.lazyRefMapper=cn,a.makeOf=et,a.map=Wo,a.mapAliasedProperties=Sn,a.mapGenericsOptions=tt,a.mapHeaders=jt,a.mapMapper=un,a.mapOpenSpec=is,a.mapOpenSpec2=yr,a.mapOpenSpec3=gr,a.mapOpenSpecInfo=dr,a.mapOperationOptions=zn,a.matchGroups=ir,a.mergeSpec=Ct,a.messageMapper=Qr,a.nullableMapper=dn,a.nullableMapperOpenApi=tr,a.number=tc,a.object=rc,a.objectMapper=yn,a.ofMapper=Mt,a.oneOf=nc,a.operationIdFormatter=Nn,a.operationInFilesMapper=Tn,a.operationInParameterMapper=wn,a.operationInParametersMapper=vn,a.operationInQueryMapper=Rn,a.operationMapper=bn,a.operationMediaMapper=An,a.operationRequestBodyMapper=Dn,a.operationResponseMapper=In,a.parameters=es,a.pathsMapper=kn,a.payloadMapper=xr,a.popGenerics=rt,a.propertiesMapper=ge,a.registerJsonSchemaMapper=C,a.removeHiddenOperation=Xt,a.requiredMapper=On,a.responsePayloadMapper=en,a.schemaMapper=Mn,a.schemesReducer=At,a.security=ts,a.serializeEnum=Hr,a.serializeEnumValues=jr,a.set=Vo,a.string=Rt,a.tagsReducer=rs,a.time=Xo,a.toJsonMapCollection=Wt,a.toJsonRegex=Ut,a.toRef=it,a.transformInformation=us,a.transformSecurity=cs,a.transformToOS2=hs,a.uri=sc,a.url=ic,a.withErrorMsg=X,a.wrapEnumsMapper=Et,Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})});
@@ -141,6 +141,12 @@ export class JsonEntityStore {
141
141
  }
142
142
  }
143
143
  }
144
+ set path(path) {
145
+ this.store.set("path", path);
146
+ }
147
+ get path() {
148
+ return this.store.get("path");
149
+ }
144
150
  getBestType() {
145
151
  return this.itemSchema.hasDiscriminator
146
152
  ? this.itemSchema.discriminator().base
@@ -1 +1 @@
1
- {"version":3,"file":"Json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,KAAK,GAAG,IAAI,CAAC;YAElB,wHAAwH;YACxH,IAAI,IAAI,CAAC,KAAK,IAAI,aAAa,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;gBAC5C,IAAI,CAAC,KAAK,GAAG,MAAM,CAAC;YACtB,CAAC;QACH,CAAC;IACH,CAAC;IAED,IAAI,IAAI,CAAC,IAAY;QACnB,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;IAC/B,CAAC;IAED,IAAI,IAAI;QACN,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IAChC,CAAC;IAED,WAAW;QACT,OAAO,IAAI,CAAC,UAAU,CAAC,gBAAgB;YACrC,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,aAAa,EAAE,CAAC,IAAI;YACtC,CAAC,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC;gBACxB,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,SAAS,EAAE;gBAC7B,CAAC,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC;oBACpB,CAAC,CAAC,IAAI,CAAC,IAAI,EAAE;oBACb,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;IACpB,CAAC;CACF"}
@@ -106,5 +106,7 @@ export declare abstract class JsonEntityStore implements JsonEntityStoreOptions
106
106
  toString(): string;
107
107
  protected abstract build(): void;
108
108
  protected buildType(type: any): void;
109
+ set path(path: string);
110
+ get path(): string;
109
111
  getBestType(): any;
110
112
  }
package/package.json CHANGED
@@ -2,17 +2,17 @@
2
2
  "name": "@tsed/schema",
3
3
  "description": "JsonSchema module for Ts.ED Framework",
4
4
  "type": "module",
5
- "version": "8.9.4",
5
+ "version": "8.10.0-rc.1",
6
6
  "source": "./src/index.ts",
7
7
  "main": "./lib/esm/index.js",
8
8
  "module": "./lib/esm/index.js",
9
9
  "typings": "./lib/types/index.d.ts",
10
- "browser": "./lib/browser/schema.umd.min.js",
10
+ "browser": "./lib/browser/schema.umd.cjs",
11
11
  "exports": {
12
12
  ".": {
13
13
  "tsed-source": "./src/index.ts",
14
14
  "types": "./lib/types/index.d.ts",
15
- "browser": "./lib/browser/schema.umd.min.js",
15
+ "browser": "./lib/browser/schema.umd.cjs",
16
16
  "import": "./lib/esm/index.js",
17
17
  "default": "./lib/esm/index.js"
18
18
  }
@@ -20,7 +20,7 @@
20
20
  "scripts": {
21
21
  "clean": "rm -rf lib",
22
22
  "build": "yarn clean && yarn barrels && yarn build:ts && yarn run build:browser",
23
- "build:browser": "webpack",
23
+ "build:browser": "vite build",
24
24
  "barrels": "barrels",
25
25
  "test": "vitest run",
26
26
  "build:ts": "tsc --build tsconfig.esm.json",
@@ -37,7 +37,7 @@
37
37
  "tsed"
38
38
  ],
39
39
  "dependencies": {
40
- "@tsed/openspec": "8.9.4",
40
+ "@tsed/openspec": "8.10.0-rc.1",
41
41
  "change-case": "^5.4.4",
42
42
  "json-schema": "0.4.0",
43
43
  "picomatch": "4.0.2",
@@ -46,11 +46,11 @@
46
46
  },
47
47
  "devDependencies": {
48
48
  "@apidevtools/swagger-parser": "10.1.0",
49
- "@tsed/barrels": "8.9.4",
50
- "@tsed/core": "8.9.4",
51
- "@tsed/hooks": "8.9.4",
52
- "@tsed/openspec": "8.9.4",
53
- "@tsed/typescript": "8.9.4",
49
+ "@tsed/barrels": "8.10.0-rc.1",
50
+ "@tsed/core": "8.10.0-rc.1",
51
+ "@tsed/hooks": "8.10.0-rc.1",
52
+ "@tsed/openspec": "8.10.0-rc.1",
53
+ "@tsed/typescript": "8.10.0-rc.1",
54
54
  "@types/fs-extra": "11.0.4",
55
55
  "@types/json-schema": "7.0.15",
56
56
  "@types/picomatch": "3.0.2",
@@ -58,13 +58,13 @@
58
58
  "ajv": "^8.17.1",
59
59
  "eslint": "9.12.0",
60
60
  "typescript": "5.4.5",
61
- "vitest": "3.1.1",
62
- "webpack": "^5.75.0"
61
+ "vite": "6.2.2",
62
+ "vitest": "3.1.4"
63
63
  },
64
64
  "peerDependencies": {
65
- "@tsed/core": ">=8.9.4",
66
- "@tsed/hooks": ">=8.9.4",
67
- "@tsed/openspec": ">=8.9.4"
65
+ "@tsed/core": ">=8.0.0",
66
+ "@tsed/hooks": ">=8.0.0",
67
+ "@tsed/openspec": ">=8.0.0"
68
68
  },
69
69
  "peerDependenciesMeta": {
70
70
  "@tsed/core": {
@@ -80,5 +80,8 @@
80
80
  },
81
81
  "homepage": "https://github.com/tsedio/tsed/tree/production/packages/specs/schema",
82
82
  "author": "Romain Lenzotti",
83
- "license": "MIT"
83
+ "license": "MIT",
84
+ "publishConfig": {
85
+ "tag": "rc"
86
+ }
84
87
  }
@@ -272,6 +272,14 @@ export abstract class JsonEntityStore implements JsonEntityStoreOptions {
272
272
  }
273
273
  }
274
274
 
275
+ set path(path: string) {
276
+ this.store.set("path", path);
277
+ }
278
+
279
+ get path() {
280
+ return this.store.get("path");
281
+ }
282
+
275
283
  getBestType() {
276
284
  return this.itemSchema.hasDiscriminator
277
285
  ? this.itemSchema.discriminator().base
@@ -0,0 +1,19 @@
1
+ import {defineConfig} from "vite";
2
+ import {join} from "node:path";
3
+
4
+ // https://vitejs.dev/config/
5
+ export default defineConfig({
6
+ plugins: [],
7
+ build: {
8
+ outDir: "lib/browser",
9
+ lib: {
10
+ entry: join(import.meta.dirname, "src/index.ts"),
11
+ formats: ["umd"],
12
+ name: "@tsed/schema",
13
+ fileName: "schema"
14
+ },
15
+ rollupOptions: {
16
+ external: /node_modules\/(.*)/
17
+ }
18
+ }
19
+ });