@serverless-devs/s 2.1.8-beta.2 → 2.1.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/edit/index.js CHANGED
@@ -1,33 +1,106 @@
1
- "use strict";var h=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports);var de=h((_c,xt)=>{var Ii="2.0.0",$i=Number.MAX_SAFE_INTEGER||9007199254740991,qi=16;xt.exports={SEMVER_SPEC_VERSION:Ii,MAX_LENGTH:256,MAX_SAFE_INTEGER:$i,MAX_SAFE_COMPONENT_LENGTH:qi}});var ge=h((wc,Dt)=>{var Ai=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...r)=>console.error("SEMVER",...r):()=>{};Dt.exports=Ai});var U=h((H,Nt)=>{var{MAX_SAFE_COMPONENT_LENGTH:Ye}=de(),Ti=ge();H=Nt.exports={};var ji=H.re=[],p=H.src=[],d=H.t={},xi=0,m=(r,e,t)=>{let n=xi++;Ti(r,n,e),d[r]=n,p[n]=e,ji[n]=new RegExp(e,t?"g":void 0)};m("NUMERICIDENTIFIER","0|[1-9]\\d*");m("NUMERICIDENTIFIERLOOSE","[0-9]+");m("NONNUMERICIDENTIFIER","\\d*[a-zA-Z-][a-zA-Z0-9-]*");m("MAINVERSION",`(${p[d.NUMERICIDENTIFIER]})\\.(${p[d.NUMERICIDENTIFIER]})\\.(${p[d.NUMERICIDENTIFIER]})`);m("MAINVERSIONLOOSE",`(${p[d.NUMERICIDENTIFIERLOOSE]})\\.(${p[d.NUMERICIDENTIFIERLOOSE]})\\.(${p[d.NUMERICIDENTIFIERLOOSE]})`);m("PRERELEASEIDENTIFIER",`(?:${p[d.NUMERICIDENTIFIER]}|${p[d.NONNUMERICIDENTIFIER]})`);m("PRERELEASEIDENTIFIERLOOSE",`(?:${p[d.NUMERICIDENTIFIERLOOSE]}|${p[d.NONNUMERICIDENTIFIER]})`);m("PRERELEASE",`(?:-(${p[d.PRERELEASEIDENTIFIER]}(?:\\.${p[d.PRERELEASEIDENTIFIER]})*))`);m("PRERELEASELOOSE",`(?:-?(${p[d.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${p[d.PRERELEASEIDENTIFIERLOOSE]})*))`);m("BUILDIDENTIFIER","[0-9A-Za-z-]+");m("BUILD",`(?:\\+(${p[d.BUILDIDENTIFIER]}(?:\\.${p[d.BUILDIDENTIFIER]})*))`);m("FULLPLAIN",`v?${p[d.MAINVERSION]}${p[d.PRERELEASE]}?${p[d.BUILD]}?`);m("FULL",`^${p[d.FULLPLAIN]}$`);m("LOOSEPLAIN",`[v=\\s]*${p[d.MAINVERSIONLOOSE]}${p[d.PRERELEASELOOSE]}?${p[d.BUILD]}?`);m("LOOSE",`^${p[d.LOOSEPLAIN]}$`);m("GTLT","((?:<|>)?=?)");m("XRANGEIDENTIFIERLOOSE",`${p[d.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);m("XRANGEIDENTIFIER",`${p[d.NUMERICIDENTIFIER]}|x|X|\\*`);m("XRANGEPLAIN",`[v=\\s]*(${p[d.XRANGEIDENTIFIER]})(?:\\.(${p[d.XRANGEIDENTIFIER]})(?:\\.(${p[d.XRANGEIDENTIFIER]})(?:${p[d.PRERELEASE]})?${p[d.BUILD]}?)?)?`);m("XRANGEPLAINLOOSE",`[v=\\s]*(${p[d.XRANGEIDENTIFIERLOOSE]})(?:\\.(${p[d.XRANGEIDENTIFIERLOOSE]})(?:\\.(${p[d.XRANGEIDENTIFIERLOOSE]})(?:${p[d.PRERELEASELOOSE]})?${p[d.BUILD]}?)?)?`);m("XRANGE",`^${p[d.GTLT]}\\s*${p[d.XRANGEPLAIN]}$`);m("XRANGELOOSE",`^${p[d.GTLT]}\\s*${p[d.XRANGEPLAINLOOSE]}$`);m("COERCE",`(^|[^\\d])(\\d{1,${Ye}})(?:\\.(\\d{1,${Ye}}))?(?:\\.(\\d{1,${Ye}}))?(?:$|[^\\d])`);m("COERCERTL",p[d.COERCE],!0);m("LONETILDE","(?:~>?)");m("TILDETRIM",`(\\s*)${p[d.LONETILDE]}\\s+`,!0);H.tildeTrimReplace="$1~";m("TILDE",`^${p[d.LONETILDE]}${p[d.XRANGEPLAIN]}$`);m("TILDELOOSE",`^${p[d.LONETILDE]}${p[d.XRANGEPLAINLOOSE]}$`);m("LONECARET","(?:\\^)");m("CARETTRIM",`(\\s*)${p[d.LONECARET]}\\s+`,!0);H.caretTrimReplace="$1^";m("CARET",`^${p[d.LONECARET]}${p[d.XRANGEPLAIN]}$`);m("CARETLOOSE",`^${p[d.LONECARET]}${p[d.XRANGEPLAINLOOSE]}$`);m("COMPARATORLOOSE",`^${p[d.GTLT]}\\s*(${p[d.LOOSEPLAIN]})$|^$`);m("COMPARATOR",`^${p[d.GTLT]}\\s*(${p[d.FULLPLAIN]})$|^$`);m("COMPARATORTRIM",`(\\s*)${p[d.GTLT]}\\s*(${p[d.LOOSEPLAIN]}|${p[d.XRANGEPLAIN]})`,!0);H.comparatorTrimReplace="$1$2$3";m("HYPHENRANGE",`^\\s*(${p[d.XRANGEPLAIN]})\\s+-\\s+(${p[d.XRANGEPLAIN]})\\s*$`);m("HYPHENRANGELOOSE",`^\\s*(${p[d.XRANGEPLAINLOOSE]})\\s+-\\s+(${p[d.XRANGEPLAINLOOSE]})\\s*$`);m("STAR","(<|>)?=?\\s*\\*");m("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");m("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var ve=h((bc,Lt)=>{var Di=["includePrerelease","loose","rtl"],Ni=r=>r?typeof r!="object"?{loose:!0}:Di.filter(e=>r[e]).reduce((e,t)=>(e[t]=!0,e),{}):{};Lt.exports=Ni});var Ze=h((Sc,Ft)=>{var Pt=/^[0-9]+$/,Ct=(r,e)=>{let t=Pt.test(r),n=Pt.test(e);return t&&n&&(r=+r,e=+e),r===e?0:t&&!n?-1:n&&!t?1:r<e?-1:1},Li=(r,e)=>Ct(e,r);Ft.exports={compareIdentifiers:Ct,rcompareIdentifiers:Li}});var O=h((Oc,Xt)=>{var qe=ge(),{MAX_LENGTH:Gt,MAX_SAFE_INTEGER:Ae}=de(),{re:Mt,t:Ht}=U(),Pi=ve(),{compareIdentifiers:K}=Ze(),j=class{constructor(e,t){if(t=Pi(t),e instanceof j){if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease)return e;e=e.version}else if(typeof e!="string")throw new TypeError(`Invalid Version: ${e}`);if(e.length>Gt)throw new TypeError(`version is longer than ${Gt} characters`);qe("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;let n=e.trim().match(t.loose?Mt[Ht.LOOSE]:Mt[Ht.FULL]);if(!n)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+n[1],this.minor=+n[2],this.patch=+n[3],this.major>Ae||this.major<0)throw new TypeError("Invalid major version");if(this.minor>Ae||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>Ae||this.patch<0)throw new TypeError("Invalid patch version");n[4]?this.prerelease=n[4].split(".").map(s=>{if(/^[0-9]+$/.test(s)){let i=+s;if(i>=0&&i<Ae)return i}return s}):this.prerelease=[],this.build=n[5]?n[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(e){if(qe("SemVer.compare",this.version,this.options,e),!(e instanceof j)){if(typeof e=="string"&&e===this.version)return 0;e=new j(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof j||(e=new j(e,this.options)),K(this.major,e.major)||K(this.minor,e.minor)||K(this.patch,e.patch)}comparePre(e){if(e instanceof j||(e=new j(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let t=0;do{let n=this.prerelease[t],s=e.prerelease[t];if(qe("prerelease compare",t,n,s),n===void 0&&s===void 0)return 0;if(s===void 0)return 1;if(n===void 0)return-1;if(n===s)continue;return K(n,s)}while(++t)}compareBuild(e){e instanceof j||(e=new j(e,this.options));let t=0;do{let n=this.build[t],s=e.build[t];if(qe("prerelease compare",t,n,s),n===void 0&&s===void 0)return 0;if(s===void 0)return 1;if(n===void 0)return-1;if(n===s)continue;return K(n,s)}while(++t)}inc(e,t){switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t),this.inc("pre",t);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",t),this.inc("pre",t);break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":if(this.prerelease.length===0)this.prerelease=[0];else{let n=this.prerelease.length;for(;--n>=0;)typeof this.prerelease[n]=="number"&&(this.prerelease[n]++,n=-2);n===-1&&this.prerelease.push(0)}t&&(K(this.prerelease[0],t)===0?isNaN(this.prerelease[1])&&(this.prerelease=[t,0]):this.prerelease=[t,0]);break;default:throw new Error(`invalid increment argument: ${e}`)}return this.format(),this.raw=this.version,this}};Xt.exports=j});var B=h((Rc,kt)=>{var{MAX_LENGTH:Ci}=de(),{re:Vt,t:Ut}=U(),Bt=O(),Fi=ve(),Gi=(r,e)=>{if(e=Fi(e),r instanceof Bt)return r;if(typeof r!="string"||r.length>Ci||!(e.loose?Vt[Ut.LOOSE]:Vt[Ut.FULL]).test(r))return null;try{return new Bt(r,e)}catch{return null}};kt.exports=Gi});var zt=h((Ic,Wt)=>{var Mi=B(),Hi=(r,e)=>{let t=Mi(r,e);return t?t.version:null};Wt.exports=Hi});var Zt=h(($c,Yt)=>{var Xi=B(),Vi=(r,e)=>{let t=Xi(r.trim().replace(/^[=v]+/,""),e);return t?t.version:null};Yt.exports=Vi});var Jt=h((qc,Qt)=>{var Kt=O(),Ui=(r,e,t,n)=>{typeof t=="string"&&(n=t,t=void 0);try{return new Kt(r instanceof Kt?r.version:r,t).inc(e,n).version}catch{return null}};Qt.exports=Ui});var D=h((Ac,tr)=>{var er=O(),Bi=(r,e,t)=>new er(r,t).compare(new er(e,t));tr.exports=Bi});var Te=h((Tc,rr)=>{var ki=D(),Wi=(r,e,t)=>ki(r,e,t)===0;rr.exports=Wi});var sr=h((jc,ir)=>{var nr=B(),zi=Te(),Yi=(r,e)=>{if(zi(r,e))return null;{let t=nr(r),n=nr(e),s=t.prerelease.length||n.prerelease.length,i=s?"pre":"",a=s?"prerelease":"";for(let l in t)if((l==="major"||l==="minor"||l==="patch")&&t[l]!==n[l])return i+l;return a}};ir.exports=Yi});var ar=h((xc,or)=>{var Zi=O(),Ki=(r,e)=>new Zi(r,e).major;or.exports=Ki});var cr=h((Dc,lr)=>{var Qi=O(),Ji=(r,e)=>new Qi(r,e).minor;lr.exports=Ji});var fr=h((Nc,ur)=>{var es=O(),ts=(r,e)=>new es(r,e).patch;ur.exports=ts});var pr=h((Lc,hr)=>{var rs=B(),ns=(r,e)=>{let t=rs(r,e);return t&&t.prerelease.length?t.prerelease:null};hr.exports=ns});var gr=h((Pc,dr)=>{var is=D(),ss=(r,e,t)=>is(e,r,t);dr.exports=ss});var mr=h((Cc,vr)=>{var os=D(),as=(r,e)=>os(r,e,!0);vr.exports=as});var je=h((Fc,yr)=>{var Er=O(),ls=(r,e,t)=>{let n=new Er(r,t),s=new Er(e,t);return n.compare(s)||n.compareBuild(s)};yr.exports=ls});var wr=h((Gc,_r)=>{var cs=je(),us=(r,e)=>r.sort((t,n)=>cs(t,n,e));_r.exports=us});var Sr=h((Mc,br)=>{var fs=je(),hs=(r,e)=>r.sort((t,n)=>fs(n,t,e));br.exports=hs});var me=h((Hc,Or)=>{var ps=D(),ds=(r,e,t)=>ps(r,e,t)>0;Or.exports=ds});var xe=h((Xc,Rr)=>{var gs=D(),vs=(r,e,t)=>gs(r,e,t)<0;Rr.exports=vs});var Ke=h((Vc,Ir)=>{var ms=D(),Es=(r,e,t)=>ms(r,e,t)!==0;Ir.exports=Es});var De=h((Uc,$r)=>{var ys=D(),_s=(r,e,t)=>ys(r,e,t)>=0;$r.exports=_s});var Ne=h((Bc,qr)=>{var ws=D(),bs=(r,e,t)=>ws(r,e,t)<=0;qr.exports=bs});var Qe=h((kc,Ar)=>{var Ss=Te(),Os=Ke(),Rs=me(),Is=De(),$s=xe(),qs=Ne(),As=(r,e,t,n)=>{switch(e){case"===":return typeof r=="object"&&(r=r.version),typeof t=="object"&&(t=t.version),r===t;case"!==":return typeof r=="object"&&(r=r.version),typeof t=="object"&&(t=t.version),r!==t;case"":case"=":case"==":return Ss(r,t,n);case"!=":return Os(r,t,n);case">":return Rs(r,t,n);case">=":return Is(r,t,n);case"<":return $s(r,t,n);case"<=":return qs(r,t,n);default:throw new TypeError(`Invalid operator: ${e}`)}};Ar.exports=As});var jr=h((Wc,Tr)=>{var Ts=O(),js=B(),{re:Le,t:Pe}=U(),xs=(r,e)=>{if(r instanceof Ts)return r;if(typeof r=="number"&&(r=String(r)),typeof r!="string")return null;e=e||{};let t=null;if(!e.rtl)t=r.match(Le[Pe.COERCE]);else{let n;for(;(n=Le[Pe.COERCERTL].exec(r))&&(!t||t.index+t[0].length!==r.length);)(!t||n.index+n[0].length!==t.index+t[0].length)&&(t=n),Le[Pe.COERCERTL].lastIndex=n.index+n[1].length+n[2].length;Le[Pe.COERCERTL].lastIndex=-1}return t===null?null:js(`${t[2]}.${t[3]||"0"}.${t[4]||"0"}`,e)};Tr.exports=xs});var Dr=h((zc,xr)=>{"use strict";xr.exports=function(r){r.prototype[Symbol.iterator]=function*(){for(let e=this.head;e;e=e.next)yield e.value}}});var Lr=h((Yc,Nr)=>{"use strict";Nr.exports=E;E.Node=k;E.create=E;function E(r){var e=this;if(e instanceof E||(e=new E),e.tail=null,e.head=null,e.length=0,r&&typeof r.forEach=="function")r.forEach(function(s){e.push(s)});else if(arguments.length>0)for(var t=0,n=arguments.length;t<n;t++)e.push(arguments[t]);return e}E.prototype.removeNode=function(r){if(r.list!==this)throw new Error("removing node which does not belong to this list");var e=r.next,t=r.prev;return e&&(e.prev=t),t&&(t.next=e),r===this.head&&(this.head=e),r===this.tail&&(this.tail=t),r.list.length--,r.next=null,r.prev=null,r.list=null,e};E.prototype.unshiftNode=function(r){if(r!==this.head){r.list&&r.list.removeNode(r);var e=this.head;r.list=this,r.next=e,e&&(e.prev=r),this.head=r,this.tail||(this.tail=r),this.length++}};E.prototype.pushNode=function(r){if(r!==this.tail){r.list&&r.list.removeNode(r);var e=this.tail;r.list=this,r.prev=e,e&&(e.next=r),this.tail=r,this.head||(this.head=r),this.length++}};E.prototype.push=function(){for(var r=0,e=arguments.length;r<e;r++)Ns(this,arguments[r]);return this.length};E.prototype.unshift=function(){for(var r=0,e=arguments.length;r<e;r++)Ls(this,arguments[r]);return this.length};E.prototype.pop=function(){if(!!this.tail){var r=this.tail.value;return this.tail=this.tail.prev,this.tail?this.tail.next=null:this.head=null,this.length--,r}};E.prototype.shift=function(){if(!!this.head){var r=this.head.value;return this.head=this.head.next,this.head?this.head.prev=null:this.tail=null,this.length--,r}};E.prototype.forEach=function(r,e){e=e||this;for(var t=this.head,n=0;t!==null;n++)r.call(e,t.value,n,this),t=t.next};E.prototype.forEachReverse=function(r,e){e=e||this;for(var t=this.tail,n=this.length-1;t!==null;n--)r.call(e,t.value,n,this),t=t.prev};E.prototype.get=function(r){for(var e=0,t=this.head;t!==null&&e<r;e++)t=t.next;if(e===r&&t!==null)return t.value};E.prototype.getReverse=function(r){for(var e=0,t=this.tail;t!==null&&e<r;e++)t=t.prev;if(e===r&&t!==null)return t.value};E.prototype.map=function(r,e){e=e||this;for(var t=new E,n=this.head;n!==null;)t.push(r.call(e,n.value,this)),n=n.next;return t};E.prototype.mapReverse=function(r,e){e=e||this;for(var t=new E,n=this.tail;n!==null;)t.push(r.call(e,n.value,this)),n=n.prev;return t};E.prototype.reduce=function(r,e){var t,n=this.head;if(arguments.length>1)t=e;else if(this.head)n=this.head.next,t=this.head.value;else throw new TypeError("Reduce of empty list with no initial value");for(var s=0;n!==null;s++)t=r(t,n.value,s),n=n.next;return t};E.prototype.reduceReverse=function(r,e){var t,n=this.tail;if(arguments.length>1)t=e;else if(this.tail)n=this.tail.prev,t=this.tail.value;else throw new TypeError("Reduce of empty list with no initial value");for(var s=this.length-1;n!==null;s--)t=r(t,n.value,s),n=n.prev;return t};E.prototype.toArray=function(){for(var r=new Array(this.length),e=0,t=this.head;t!==null;e++)r[e]=t.value,t=t.next;return r};E.prototype.toArrayReverse=function(){for(var r=new Array(this.length),e=0,t=this.tail;t!==null;e++)r[e]=t.value,t=t.prev;return r};E.prototype.slice=function(r,e){e=e||this.length,e<0&&(e+=this.length),r=r||0,r<0&&(r+=this.length);var t=new E;if(e<r||e<0)return t;r<0&&(r=0),e>this.length&&(e=this.length);for(var n=0,s=this.head;s!==null&&n<r;n++)s=s.next;for(;s!==null&&n<e;n++,s=s.next)t.push(s.value);return t};E.prototype.sliceReverse=function(r,e){e=e||this.length,e<0&&(e+=this.length),r=r||0,r<0&&(r+=this.length);var t=new E;if(e<r||e<0)return t;r<0&&(r=0),e>this.length&&(e=this.length);for(var n=this.length,s=this.tail;s!==null&&n>e;n--)s=s.prev;for(;s!==null&&n>r;n--,s=s.prev)t.push(s.value);return t};E.prototype.splice=function(r,e,...t){r>this.length&&(r=this.length-1),r<0&&(r=this.length+r);for(var n=0,s=this.head;s!==null&&n<r;n++)s=s.next;for(var i=[],n=0;s&&n<e;n++)i.push(s.value),s=this.removeNode(s);s===null&&(s=this.tail),s!==this.head&&s!==this.tail&&(s=s.prev);for(var n=0;n<t.length;n++)s=Ds(this,s,t[n]);return i};E.prototype.reverse=function(){for(var r=this.head,e=this.tail,t=r;t!==null;t=t.prev){var n=t.prev;t.prev=t.next,t.next=n}return this.head=e,this.tail=r,this};function Ds(r,e,t){var n=e===r.head?new k(t,null,e,r):new k(t,e,e.next,r);return n.next===null&&(r.tail=n),n.prev===null&&(r.head=n),r.length++,n}function Ns(r,e){r.tail=new k(e,r.tail,null,r),r.head||(r.head=r.tail),r.length++}function Ls(r,e){r.head=new k(e,null,r.head,r),r.tail||(r.tail=r.head),r.length++}function k(r,e,t,n){if(!(this instanceof k))return new k(r,e,t,n);this.list=n,this.value=r,e?(e.next=this,this.prev=e):this.prev=null,t?(t.prev=this,this.next=t):this.next=null}try{Dr()(E)}catch{}});var Mr=h((Zc,Gr)=>{"use strict";var Ps=Lr(),W=Symbol("max"),G=Symbol("length"),Q=Symbol("lengthCalculator"),ye=Symbol("allowStale"),z=Symbol("maxAge"),F=Symbol("dispose"),Pr=Symbol("noDisposeOnSet"),S=Symbol("lruList"),L=Symbol("cache"),Fr=Symbol("updateAgeOnGet"),Je=()=>1,tt=class{constructor(e){if(typeof e=="number"&&(e={max:e}),e||(e={}),e.max&&(typeof e.max!="number"||e.max<0))throw new TypeError("max must be a non-negative number");let t=this[W]=e.max||1/0,n=e.length||Je;if(this[Q]=typeof n!="function"?Je:n,this[ye]=e.stale||!1,e.maxAge&&typeof e.maxAge!="number")throw new TypeError("maxAge must be a number");this[z]=e.maxAge||0,this[F]=e.dispose,this[Pr]=e.noDisposeOnSet||!1,this[Fr]=e.updateAgeOnGet||!1,this.reset()}set max(e){if(typeof e!="number"||e<0)throw new TypeError("max must be a non-negative number");this[W]=e||1/0,Ee(this)}get max(){return this[W]}set allowStale(e){this[ye]=!!e}get allowStale(){return this[ye]}set maxAge(e){if(typeof e!="number")throw new TypeError("maxAge must be a non-negative number");this[z]=e,Ee(this)}get maxAge(){return this[z]}set lengthCalculator(e){typeof e!="function"&&(e=Je),e!==this[Q]&&(this[Q]=e,this[G]=0,this[S].forEach(t=>{t.length=this[Q](t.value,t.key),this[G]+=t.length})),Ee(this)}get lengthCalculator(){return this[Q]}get length(){return this[G]}get itemCount(){return this[S].length}rforEach(e,t){t=t||this;for(let n=this[S].tail;n!==null;){let s=n.prev;Cr(this,e,n,t),n=s}}forEach(e,t){t=t||this;for(let n=this[S].head;n!==null;){let s=n.next;Cr(this,e,n,t),n=s}}keys(){return this[S].toArray().map(e=>e.key)}values(){return this[S].toArray().map(e=>e.value)}reset(){this[F]&&this[S]&&this[S].length&&this[S].forEach(e=>this[F](e.key,e.value)),this[L]=new Map,this[S]=new Ps,this[G]=0}dump(){return this[S].map(e=>Ce(this,e)?!1:{k:e.key,v:e.value,e:e.now+(e.maxAge||0)}).toArray().filter(e=>e)}dumpLru(){return this[S]}set(e,t,n){if(n=n||this[z],n&&typeof n!="number")throw new TypeError("maxAge must be a number");let s=n?Date.now():0,i=this[Q](t,e);if(this[L].has(e)){if(i>this[W])return J(this,this[L].get(e)),!1;let c=this[L].get(e).value;return this[F]&&(this[Pr]||this[F](e,c.value)),c.now=s,c.maxAge=n,c.value=t,this[G]+=i-c.length,c.length=i,this.get(e),Ee(this),!0}let a=new rt(e,t,i,s,n);return a.length>this[W]?(this[F]&&this[F](e,t),!1):(this[G]+=a.length,this[S].unshift(a),this[L].set(e,this[S].head),Ee(this),!0)}has(e){if(!this[L].has(e))return!1;let t=this[L].get(e).value;return!Ce(this,t)}get(e){return et(this,e,!0)}peek(e){return et(this,e,!1)}pop(){let e=this[S].tail;return e?(J(this,e),e.value):null}del(e){J(this,this[L].get(e))}load(e){this.reset();let t=Date.now();for(let n=e.length-1;n>=0;n--){let s=e[n],i=s.e||0;if(i===0)this.set(s.k,s.v);else{let a=i-t;a>0&&this.set(s.k,s.v,a)}}}prune(){this[L].forEach((e,t)=>et(this,t,!1))}},et=(r,e,t)=>{let n=r[L].get(e);if(n){let s=n.value;if(Ce(r,s)){if(J(r,n),!r[ye])return}else t&&(r[Fr]&&(n.value.now=Date.now()),r[S].unshiftNode(n));return s.value}},Ce=(r,e)=>{if(!e||!e.maxAge&&!r[z])return!1;let t=Date.now()-e.now;return e.maxAge?t>e.maxAge:r[z]&&t>r[z]},Ee=r=>{if(r[G]>r[W])for(let e=r[S].tail;r[G]>r[W]&&e!==null;){let t=e.prev;J(r,e),e=t}},J=(r,e)=>{if(e){let t=e.value;r[F]&&r[F](t.key,t.value),r[G]-=t.length,r[L].delete(t.key),r[S].removeNode(e)}},rt=class{constructor(e,t,n,s,i){this.key=e,this.value=t,this.length=n,this.now=s,this.maxAge=i||0}},Cr=(r,e,t,n)=>{let s=t.value;Ce(r,s)&&(J(r,t),r[ye]||(s=void 0)),s&&e.call(n,s.value,s.key,r)};Gr.exports=tt});var N=h((Kc,Ur)=>{var Y=class{constructor(e,t){if(t=Fs(t),e instanceof Y)return e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease?e:new Y(e.raw,t);if(e instanceof nt)return this.raw=e.value,this.set=[[e]],this.format(),this;if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e,this.set=e.split("||").map(n=>this.parseRange(n.trim())).filter(n=>n.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${e}`);if(this.set.length>1){let n=this.set[0];if(this.set=this.set.filter(s=>!Xr(s[0])),this.set.length===0)this.set=[n];else if(this.set.length>1){for(let s of this.set)if(s.length===1&&Vs(s[0])){this.set=[s];break}}}this.format()}format(){return this.range=this.set.map(e=>e.join(" ").trim()).join("||").trim(),this.range}toString(){return this.range}parseRange(e){e=e.trim();let n=`parseRange:${Object.keys(this.options).join(",")}:${e}`,s=Hr.get(n);if(s)return s;let i=this.options.loose,a=i?A[I.HYPHENRANGELOOSE]:A[I.HYPHENRANGE];e=e.replace(a,Js(this.options.includePrerelease)),w("hyphen replace",e),e=e.replace(A[I.COMPARATORTRIM],Ms),w("comparator trim",e),e=e.replace(A[I.TILDETRIM],Hs),e=e.replace(A[I.CARETTRIM],Xs),e=e.split(/\s+/).join(" ");let l=e.split(" ").map(f=>Us(f,this.options)).join(" ").split(/\s+/).map(f=>Qs(f,this.options));i&&(l=l.filter(f=>(w("loose invalid filter",f,this.options),!!f.match(A[I.COMPARATORLOOSE])))),w("range list",l);let c=new Map,o=l.map(f=>new nt(f,this.options));for(let f of o){if(Xr(f))return[f];c.set(f.value,f)}c.size>1&&c.has("")&&c.delete("");let u=[...c.values()];return Hr.set(n,u),u}intersects(e,t){if(!(e instanceof Y))throw new TypeError("a Range is required");return this.set.some(n=>Vr(n,t)&&e.set.some(s=>Vr(s,t)&&n.every(i=>s.every(a=>i.intersects(a,t)))))}test(e){if(!e)return!1;if(typeof e=="string")try{e=new Gs(e,this.options)}catch{return!1}for(let t=0;t<this.set.length;t++)if(eo(this.set[t],e,this.options))return!0;return!1}};Ur.exports=Y;var Cs=Mr(),Hr=new Cs({max:1e3}),Fs=ve(),nt=_e(),w=ge(),Gs=O(),{re:A,t:I,comparatorTrimReplace:Ms,tildeTrimReplace:Hs,caretTrimReplace:Xs}=U(),Xr=r=>r.value==="<0.0.0-0",Vs=r=>r.value==="",Vr=(r,e)=>{let t=!0,n=r.slice(),s=n.pop();for(;t&&n.length;)t=n.every(i=>s.intersects(i,e)),s=n.pop();return t},Us=(r,e)=>(w("comp",r,e),r=Ws(r,e),w("caret",r),r=Bs(r,e),w("tildes",r),r=Ys(r,e),w("xrange",r),r=Ks(r,e),w("stars",r),r),$=r=>!r||r.toLowerCase()==="x"||r==="*",Bs=(r,e)=>r.trim().split(/\s+/).map(t=>ks(t,e)).join(" "),ks=(r,e)=>{let t=e.loose?A[I.TILDELOOSE]:A[I.TILDE];return r.replace(t,(n,s,i,a,l)=>{w("tilde",r,n,s,i,a,l);let c;return $(s)?c="":$(i)?c=`>=${s}.0.0 <${+s+1}.0.0-0`:$(a)?c=`>=${s}.${i}.0 <${s}.${+i+1}.0-0`:l?(w("replaceTilde pr",l),c=`>=${s}.${i}.${a}-${l} <${s}.${+i+1}.0-0`):c=`>=${s}.${i}.${a} <${s}.${+i+1}.0-0`,w("tilde return",c),c})},Ws=(r,e)=>r.trim().split(/\s+/).map(t=>zs(t,e)).join(" "),zs=(r,e)=>{w("caret",r,e);let t=e.loose?A[I.CARETLOOSE]:A[I.CARET],n=e.includePrerelease?"-0":"";return r.replace(t,(s,i,a,l,c)=>{w("caret",r,s,i,a,l,c);let o;return $(i)?o="":$(a)?o=`>=${i}.0.0${n} <${+i+1}.0.0-0`:$(l)?i==="0"?o=`>=${i}.${a}.0${n} <${i}.${+a+1}.0-0`:o=`>=${i}.${a}.0${n} <${+i+1}.0.0-0`:c?(w("replaceCaret pr",c),i==="0"?a==="0"?o=`>=${i}.${a}.${l}-${c} <${i}.${a}.${+l+1}-0`:o=`>=${i}.${a}.${l}-${c} <${i}.${+a+1}.0-0`:o=`>=${i}.${a}.${l}-${c} <${+i+1}.0.0-0`):(w("no pr"),i==="0"?a==="0"?o=`>=${i}.${a}.${l}${n} <${i}.${a}.${+l+1}-0`:o=`>=${i}.${a}.${l}${n} <${i}.${+a+1}.0-0`:o=`>=${i}.${a}.${l} <${+i+1}.0.0-0`),w("caret return",o),o})},Ys=(r,e)=>(w("replaceXRanges",r,e),r.split(/\s+/).map(t=>Zs(t,e)).join(" ")),Zs=(r,e)=>{r=r.trim();let t=e.loose?A[I.XRANGELOOSE]:A[I.XRANGE];return r.replace(t,(n,s,i,a,l,c)=>{w("xRange",r,n,s,i,a,l,c);let o=$(i),u=o||$(a),f=u||$(l),b=f;return s==="="&&b&&(s=""),c=e.includePrerelease?"-0":"",o?s===">"||s==="<"?n="<0.0.0-0":n="*":s&&b?(u&&(a=0),l=0,s===">"?(s=">=",u?(i=+i+1,a=0,l=0):(a=+a+1,l=0)):s==="<="&&(s="<",u?i=+i+1:a=+a+1),s==="<"&&(c="-0"),n=`${s+i}.${a}.${l}${c}`):u?n=`>=${i}.0.0${c} <${+i+1}.0.0-0`:f&&(n=`>=${i}.${a}.0${c} <${i}.${+a+1}.0-0`),w("xRange return",n),n})},Ks=(r,e)=>(w("replaceStars",r,e),r.trim().replace(A[I.STAR],"")),Qs=(r,e)=>(w("replaceGTE0",r,e),r.trim().replace(A[e.includePrerelease?I.GTE0PRE:I.GTE0],"")),Js=r=>(e,t,n,s,i,a,l,c,o,u,f,b,v)=>($(n)?t="":$(s)?t=`>=${n}.0.0${r?"-0":""}`:$(i)?t=`>=${n}.${s}.0${r?"-0":""}`:a?t=`>=${t}`:t=`>=${t}${r?"-0":""}`,$(o)?c="":$(u)?c=`<${+o+1}.0.0-0`:$(f)?c=`<${o}.${+u+1}.0-0`:b?c=`<=${o}.${u}.${f}-${b}`:r?c=`<${o}.${u}.${+f+1}-0`:c=`<=${c}`,`${t} ${c}`.trim()),eo=(r,e,t)=>{for(let n=0;n<r.length;n++)if(!r[n].test(e))return!1;if(e.prerelease.length&&!t.includePrerelease){for(let n=0;n<r.length;n++)if(w(r[n].semver),r[n].semver!==nt.ANY&&r[n].semver.prerelease.length>0){let s=r[n].semver;if(s.major===e.major&&s.minor===e.minor&&s.patch===e.patch)return!0}return!1}return!0}});var _e=h((Qc,Yr)=>{var we=Symbol("SemVer ANY"),ee=class{static get ANY(){return we}constructor(e,t){if(t=to(t),e instanceof ee){if(e.loose===!!t.loose)return e;e=e.value}st("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===we?this.value="":this.value=this.operator+this.semver.version,st("comp",this)}parse(e){let t=this.options.loose?Br[kr.COMPARATORLOOSE]:Br[kr.COMPARATOR],n=e.match(t);if(!n)throw new TypeError(`Invalid comparator: ${e}`);this.operator=n[1]!==void 0?n[1]:"",this.operator==="="&&(this.operator=""),n[2]?this.semver=new Wr(n[2],this.options.loose):this.semver=we}toString(){return this.value}test(e){if(st("Comparator.test",e,this.options.loose),this.semver===we||e===we)return!0;if(typeof e=="string")try{e=new Wr(e,this.options)}catch{return!1}return it(e,this.operator,this.semver,this.options)}intersects(e,t){if(!(e instanceof ee))throw new TypeError("a Comparator is required");if((!t||typeof t!="object")&&(t={loose:!!t,includePrerelease:!1}),this.operator==="")return this.value===""?!0:new zr(e.value,t).test(this.value);if(e.operator==="")return e.value===""?!0:new zr(this.value,t).test(e.semver);let n=(this.operator===">="||this.operator===">")&&(e.operator===">="||e.operator===">"),s=(this.operator==="<="||this.operator==="<")&&(e.operator==="<="||e.operator==="<"),i=this.semver.version===e.semver.version,a=(this.operator===">="||this.operator==="<=")&&(e.operator===">="||e.operator==="<="),l=it(this.semver,"<",e.semver,t)&&(this.operator===">="||this.operator===">")&&(e.operator==="<="||e.operator==="<"),c=it(this.semver,">",e.semver,t)&&(this.operator==="<="||this.operator==="<")&&(e.operator===">="||e.operator===">");return n||s||i&&a||l||c}};Yr.exports=ee;var to=ve(),{re:Br,t:kr}=U(),it=Qe(),st=ge(),Wr=O(),zr=N()});var be=h((Jc,Zr)=>{var ro=N(),no=(r,e,t)=>{try{e=new ro(e,t)}catch{return!1}return e.test(r)};Zr.exports=no});var Qr=h((eu,Kr)=>{var io=N(),so=(r,e)=>new io(r,e).set.map(t=>t.map(n=>n.value).join(" ").trim().split(" "));Kr.exports=so});var en=h((tu,Jr)=>{var oo=O(),ao=N(),lo=(r,e,t)=>{let n=null,s=null,i=null;try{i=new ao(e,t)}catch{return null}return r.forEach(a=>{i.test(a)&&(!n||s.compare(a)===-1)&&(n=a,s=new oo(n,t))}),n};Jr.exports=lo});var rn=h((ru,tn)=>{var co=O(),uo=N(),fo=(r,e,t)=>{let n=null,s=null,i=null;try{i=new uo(e,t)}catch{return null}return r.forEach(a=>{i.test(a)&&(!n||s.compare(a)===1)&&(n=a,s=new co(n,t))}),n};tn.exports=fo});var on=h((nu,sn)=>{var ot=O(),ho=N(),nn=me(),po=(r,e)=>{r=new ho(r,e);let t=new ot("0.0.0");if(r.test(t)||(t=new ot("0.0.0-0"),r.test(t)))return t;t=null;for(let n=0;n<r.set.length;++n){let s=r.set[n],i=null;s.forEach(a=>{let l=new ot(a.semver.version);switch(a.operator){case">":l.prerelease.length===0?l.patch++:l.prerelease.push(0),l.raw=l.format();case"":case">=":(!i||nn(l,i))&&(i=l);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${a.operator}`)}}),i&&(!t||nn(t,i))&&(t=i)}return t&&r.test(t)?t:null};sn.exports=po});var ln=h((iu,an)=>{var go=N(),vo=(r,e)=>{try{return new go(r,e).range||"*"}catch{return null}};an.exports=vo});var Fe=h((su,hn)=>{var mo=O(),fn=_e(),{ANY:Eo}=fn,yo=N(),_o=be(),cn=me(),un=xe(),wo=Ne(),bo=De(),So=(r,e,t,n)=>{r=new mo(r,n),e=new yo(e,n);let s,i,a,l,c;switch(t){case">":s=cn,i=wo,a=un,l=">",c=">=";break;case"<":s=un,i=bo,a=cn,l="<",c="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(_o(r,e,n))return!1;for(let o=0;o<e.set.length;++o){let u=e.set[o],f=null,b=null;if(u.forEach(v=>{v.semver===Eo&&(v=new fn(">=0.0.0")),f=f||v,b=b||v,s(v.semver,f.semver,n)?f=v:a(v.semver,b.semver,n)&&(b=v)}),f.operator===l||f.operator===c||(!b.operator||b.operator===l)&&i(r,b.semver))return!1;if(b.operator===c&&a(r,b.semver))return!1}return!0};hn.exports=So});var dn=h((ou,pn)=>{var Oo=Fe(),Ro=(r,e,t)=>Oo(r,e,">",t);pn.exports=Ro});var vn=h((au,gn)=>{var Io=Fe(),$o=(r,e,t)=>Io(r,e,"<",t);gn.exports=$o});var yn=h((lu,En)=>{var mn=N(),qo=(r,e,t)=>(r=new mn(r,t),e=new mn(e,t),r.intersects(e));En.exports=qo});var wn=h((cu,_n)=>{var Ao=be(),To=D();_n.exports=(r,e,t)=>{let n=[],s=null,i=null,a=r.sort((u,f)=>To(u,f,t));for(let u of a)Ao(u,e,t)?(i=u,s||(s=u)):(i&&n.push([s,i]),i=null,s=null);s&&n.push([s,null]);let l=[];for(let[u,f]of n)u===f?l.push(u):!f&&u===a[0]?l.push("*"):f?u===a[0]?l.push(`<=${f}`):l.push(`${u} - ${f}`):l.push(`>=${u}`);let c=l.join(" || "),o=typeof e.raw=="string"?e.raw:String(e);return c.length<o.length?c:e}});var In=h((uu,Rn)=>{var bn=N(),Ge=_e(),{ANY:at}=Ge,Se=be(),lt=D(),jo=(r,e,t={})=>{if(r===e)return!0;r=new bn(r,t),e=new bn(e,t);let n=!1;e:for(let s of r.set){for(let i of e.set){let a=xo(s,i,t);if(n=n||a!==null,a)continue e}if(n)return!1}return!0},xo=(r,e,t)=>{if(r===e)return!0;if(r.length===1&&r[0].semver===at){if(e.length===1&&e[0].semver===at)return!0;t.includePrerelease?r=[new Ge(">=0.0.0-0")]:r=[new Ge(">=0.0.0")]}if(e.length===1&&e[0].semver===at){if(t.includePrerelease)return!0;e=[new Ge(">=0.0.0")]}let n=new Set,s,i;for(let v of r)v.operator===">"||v.operator===">="?s=Sn(s,v,t):v.operator==="<"||v.operator==="<="?i=On(i,v,t):n.add(v.semver);if(n.size>1)return null;let a;if(s&&i){if(a=lt(s.semver,i.semver,t),a>0)return null;if(a===0&&(s.operator!==">="||i.operator!=="<="))return null}for(let v of n){if(s&&!Se(v,String(s),t)||i&&!Se(v,String(i),t))return null;for(let Ri of e)if(!Se(v,String(Ri),t))return!1;return!0}let l,c,o,u,f=i&&!t.includePrerelease&&i.semver.prerelease.length?i.semver:!1,b=s&&!t.includePrerelease&&s.semver.prerelease.length?s.semver:!1;f&&f.prerelease.length===1&&i.operator==="<"&&f.prerelease[0]===0&&(f=!1);for(let v of e){if(u=u||v.operator===">"||v.operator===">=",o=o||v.operator==="<"||v.operator==="<=",s){if(b&&v.semver.prerelease&&v.semver.prerelease.length&&v.semver.major===b.major&&v.semver.minor===b.minor&&v.semver.patch===b.patch&&(b=!1),v.operator===">"||v.operator===">="){if(l=Sn(s,v,t),l===v&&l!==s)return!1}else if(s.operator===">="&&!Se(s.semver,String(v),t))return!1}if(i){if(f&&v.semver.prerelease&&v.semver.prerelease.length&&v.semver.major===f.major&&v.semver.minor===f.minor&&v.semver.patch===f.patch&&(f=!1),v.operator==="<"||v.operator==="<="){if(c=On(i,v,t),c===v&&c!==i)return!1}else if(i.operator==="<="&&!Se(i.semver,String(v),t))return!1}if(!v.operator&&(i||s)&&a!==0)return!1}return!(s&&o&&!i&&a!==0||i&&u&&!s&&a!==0||b||f)},Sn=(r,e,t)=>{if(!r)return e;let n=lt(r.semver,e.semver,t);return n>0?r:n<0||e.operator===">"&&r.operator===">="?e:r},On=(r,e,t)=>{if(!r)return e;let n=lt(r.semver,e.semver,t);return n<0?r:n>0||e.operator==="<"&&r.operator==="<="?e:r};Rn.exports=jo});var An=h((fu,qn)=>{var ct=U(),Do=de(),No=O(),$n=Ze(),Lo=B(),Po=zt(),Co=Zt(),Fo=Jt(),Go=sr(),Mo=ar(),Ho=cr(),Xo=fr(),Vo=pr(),Uo=D(),Bo=gr(),ko=mr(),Wo=je(),zo=wr(),Yo=Sr(),Zo=me(),Ko=xe(),Qo=Te(),Jo=Ke(),ea=De(),ta=Ne(),ra=Qe(),na=jr(),ia=_e(),sa=N(),oa=be(),aa=Qr(),la=en(),ca=rn(),ua=on(),fa=ln(),ha=Fe(),pa=dn(),da=vn(),ga=yn(),va=wn(),ma=In();qn.exports={parse:Lo,valid:Po,clean:Co,inc:Fo,diff:Go,major:Mo,minor:Ho,patch:Xo,prerelease:Vo,compare:Uo,rcompare:Bo,compareLoose:ko,compareBuild:Wo,sort:zo,rsort:Yo,gt:Zo,lt:Ko,eq:Qo,neq:Jo,gte:ea,lte:ta,cmp:ra,coerce:na,Comparator:ia,Range:sa,satisfies:oa,toComparators:aa,maxSatisfying:la,minSatisfying:ca,minVersion:ua,validRange:fa,outside:ha,gtr:pa,ltr:da,intersects:ga,simplifyRange:va,subset:ma,SemVer:No,re:ct.re,src:ct.src,tokens:ct.t,SEMVER_SPEC_VERSION:Do.SEMVER_SPEC_VERSION,compareIdentifiers:$n.compareIdentifiers,rcompareIdentifiers:$n.rcompareIdentifiers}});var M=h(x=>{"use strict";var Ea=x&&x.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(r,n,s)}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),ya=x&&x.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),_a=x&&x.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&Ea(e,r,t);return ya(e,r),e},Tn=x&&x.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(x,"__esModule",{value:!0});x.getCoreVersion=void 0;var jn=Tn(require("path")),xn=Tn(require("fs")),ut=_a(require("@serverless-devs/core")),wa=An(),Dn=jn.default.join(ut.getRootHome(),"cache","core"),ft=jn.default.join(Dn,"package.json");function ba(){if(xn.default.existsSync(ft)){var r=require("@serverless-devs/core/package.json").version,e=Nn();return wa.gt(e,r)?require(Dn):ut}return ut}function Nn(){return xn.default.existsSync(ft)?require(ft).version:void 0}x.getCoreVersion=Nn;x.default=ba()});var Me=h(Oe=>{"use strict";var Sa=Oe&&Oe.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Oe,"__esModule",{value:!0});var Oa=Sa(M()),Ra=Oa.default.Logger,ht=new Ra("S-CLI");ht.success=function(r){return ht.log(r,"green")};Oe.default=ht});var gt=h(T=>{"use strict";var Ia=T&&T.__awaiter||function(r,e,t,n){function s(i){return i instanceof t?i:new t(function(a){a(i)})}return new(t||(t=Promise))(function(i,a){function l(u){try{o(n.next(u))}catch(f){a(f)}}function c(u){try{o(n.throw(u))}catch(f){a(f)}}function o(u){u.done?i(u.value):s(u.value).then(l,c)}o((n=n.apply(r,e||[])).next())})},$a=T&&T.__generator||function(r,e){var t={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},n,s,i,a;return a={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function l(o){return function(u){return c([o,u])}}function c(o){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,o[0]&&(t=0)),t;)try{if(n=1,s&&(i=o[0]&2?s.return:o[0]?s.throw||((i=s.return)&&i.call(s),0):s.next)&&!(i=i.call(s,o[1])).done)return i;switch(s=0,i&&(o=[o[0]&2,i.value]),o[0]){case 0:case 1:i=o;break;case 4:return t.label++,{value:o[1],done:!1};case 5:t.label++,s=o[1],o=[0];continue;case 7:o=t.ops.pop(),t.trys.pop();continue;default:if(i=t.trys,!(i=i.length>0&&i[i.length-1])&&(o[0]===6||o[0]===2)){t=0;continue}if(o[0]===3&&(!i||o[1]>i[0]&&o[1]<i[3])){t.label=o[1];break}if(o[0]===6&&t.label<i[1]){t.label=i[1],i=o;break}if(i&&t.label<i[2]){t.label=i[2],t.ops.push(o);break}i[2]&&t.ops.pop(),t.trys.pop();continue}o=e.call(r,t)}catch(u){o=[6,u],s=0}finally{n=i=0}if(o[0]&5)throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}},Ln=T&&T.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(T,"__esModule",{value:!0});T.handlerProfileFile=T.getConfig=T.setConfig=void 0;var Pn=Ln(require("path")),dt=Ln(M()),P=dt.default.fse,He=dt.default.jsyaml,pt=dt.default.getRootHome;function qa(r){var e=Fn();P.writeFileSync(e,He.dump(r))}function Cn(){var r=Fn();if(!P.existsSync(r))return{};try{var e=He.load(P.readFileSync(r,"utf8"))||{};return e}catch(t){throw t}}function Fn(){var r=Pn.default.join(pt(),"set-config.yml");return P.existsSync(r)||P.createFileSync(r),r}function Aa(r,e){var t=Cn();t[r]=e,qa(t)}T.setConfig=Aa;function Ta(r,e){var t=Cn();return t[r]||e}T.getConfig=Ta;function ja(r){return Ia(this,void 0,void 0,function(){var e,t,n,s,i,a,l;return $a(this,function(c){switch(c.label){case 0:if(e=r.filePath||"set-config.yml",t=Pn.default.join(pt(),e),n=P.existsSync(t),s={},n)return[3,5];i=pt(),c.label=1;case 1:return c.trys.push([1,2,,4]),P.statSync(i),[3,4];case 2:return a=c.sent(),[4,P.mkdirSync(i)];case 3:return c.sent(),[3,4];case 4:return[3,6];case 5:try{s=He.load(P.readFileSync(t,"utf8"))||{}}catch(o){throw o}c.label=6;case 6:return r.read?[2,s]:(l=r.configKey||"",s[l]=r.data,[4,P.writeFileSync(t,He.dump(s))]);case 7:return c.sent(),[2,s]}})})}T.handlerProfileFile=ja});var Gn=h((gu,xa)=>{xa.exports={name:"@serverless-devs/s",version:"2.1.8-beta.2",description:"Serverless devs tool, serverless developer tool, supports Alibaba cloud, AWS, azure, baidu cloud, Huawei cloud, Google cloud and Tencent cloud.",homepage:"https://www.serverless-devs.com",keywords:["serverless","alibaba","tencent","azure","baidu","huawei","google","function","faas","serverless-devs"],publishConfig:{access:"public",registry:"https://registry.npmjs.org"},license:"Apache 2.0",repository:{type:"git",url:"https://github.com/Serverless-Devs/Serverless-Devs"},bugs:{url:"https://github.com/Serverless-Devs/Serverless-Devs/issues"},scripts:{start:"npm run watch",prewatch:"rm -rf lib/* && cp -r ./src/daemon ./lib",watch:"tsc -w",test:"jest test/special-command.test",prebuild:"rm -rf lib/*",build:"tsc && cp -r ./src/daemon ./lib",postbuild:"./script/postbuild.sh","test:cov":"jest --coverage",lint:"npm run typecheck && f2elint scan -i src",fix:"f2elint fix",typecheck:"npx tsc -p tsconfig.json --noEmit",update:"rm -rf yarn.lock && rm -rf package-lock.json && rm -rf node_modules && yarn",beta:"npm publish --tag=beta",pkg:"tsc && pkg bin/s"},main:"./lib/index.js",bin:{s:"bin/s"},devDependencies:{"@serverless-devs/commander":"^6.2.6","@types/jest":"^27.4.0","@types/node":"^14.0.23","@typescript-eslint/eslint-plugin":"^4.14.1","@typescript-eslint/parser":"^4.14.1",ajv:"^8.10.0","babel-eslint":"^10.1.0",boxen:"^5.0.0",dotenv:"^10.0.0",esbuild:"^0.14.0",eslint:"^7.7.0","eslint-config-prettier":"^7.2.0","eslint-plugin-import":"^2.20.1","eslint-plugin-prettier":"^3.1.2","global-agent":"^3.0.0",husky:"^4.2.3",inquirer:"8.2.0","inquirer-autocomplete-prompt":"^1.3.0",jest:"^27.4.7","latest-version":"^5.1.0","lint-staged":"^10.0.8",open:"^8.4.0","os-locale":"5.0.0",pkg:"^5.8.0",prettier:"^2.2.1",semver:"^7.3.5","semver-diff":"^3.1.1","ts-jest":"^27.1.3","ts-node":"^9.1.1",typescript:"^4.1.3"},"lint-staged":{"**/*.{js,jsx,ts}":"f2elint exec eslint"},dependencies:{"@serverless-devs/core":"latest","@serverless-devs/ui":"latest"}}});var mt=h(g=>{"use strict";var Da=g&&g.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(r,n,s)}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),Na=g&&g.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),La=g&&g.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&Da(e,r,t);return Na(e,r),e},re=g&&g.__awaiter||function(r,e,t,n){function s(i){return i instanceof t?i:new t(function(a){a(i)})}return new(t||(t=Promise))(function(i,a){function l(u){try{o(n.next(u))}catch(f){a(f)}}function c(u){try{o(n.throw(u))}catch(f){a(f)}}function o(u){u.done?i(u.value):s(u.value).then(l,c)}o((n=n.apply(r,e||[])).next())})},ne=g&&g.__generator||function(r,e){var t={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},n,s,i,a;return a={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function l(o){return function(u){return c([o,u])}}function c(o){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,o[0]&&(t=0)),t;)try{if(n=1,s&&(i=o[0]&2?s.return:o[0]?s.throw||((i=s.return)&&i.call(s),0):s.next)&&!(i=i.call(s,o[1])).done)return i;switch(s=0,i&&(o=[o[0]&2,i.value]),o[0]){case 0:case 1:i=o;break;case 4:return t.label++,{value:o[1],done:!1};case 5:t.label++,s=o[1],o=[0];continue;case 7:o=t.ops.pop(),t.trys.pop();continue;default:if(i=t.trys,!(i=i.length>0&&i[i.length-1])&&(o[0]===6||o[0]===2)){t=0;continue}if(o[0]===3&&(!i||o[1]>i[0]&&o[1]<i[3])){t.label=o[1];break}if(o[0]===6&&t.label<i[1]){t.label=i[1],i=o;break}if(i&&t.label<i[2]){t.label=i[2],t.ops.push(o);break}i[2]&&t.ops.pop(),t.trys.pop();continue}o=e.call(r,t)}catch(u){o=[6,u],s=0}finally{n=i=0}if(o[0]&5)throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}},Xe=g&&g.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(g,"__esModule",{value:!0});g.specifyServiceHelp=g.getTempCommandStr=g.emoji=g.mark=g.replaceTemplate=g.replaceFun=g.getLang=g.printn=g.getFolderSize=g.getVersion=g.aiRequest=g.getCredentialWithAll=g.getCredentialWithExisted=g.getProcessArgv=g.bgRed=g.yellow=g.red=void 0;var Pa=Xe(require("path")),Re=Xe(require("fs")),Ca=Xe(require("os")),q=La(M()),Fa=gt(),te=Xe(Me()),Mn=Gn(),ie=q.default.colors,Ga=q.default.got,Ma=q.default.isDocker,Ha=q.default.isCiCdEnv,X=q.default.lodash,Hn=q.default.publishHelp,Xa=X.get,Va=X.trim,Ua=X.assign,Ba=X.filter,Xn=X.includes,ka=X.omit,Wa=X.isPlainObject,za=X.isEmpty,Ya=ie.underline,Za=ie.bold;g.red=ie.hex("#fd5750");g.yellow=ie.hex("#F3F99D");g.bgRed=ie.hex("#000").bgHex("#fd5750");var Ka=function(){var r=process.env.serverless_devs_temp_argv;try{var e=JSON.parse(r),t=q.default.getGlobalArgs(e);return process.argv=process.argv.slice(0,2).concat(t._argsObj),Ua({},t,{noHelpArgv:process.argv.slice(0,2).concat(Ba(t._argsObj,function(n){return!Xn(["-h","--help"],n)}))})}catch{return{}}};g.getProcessArgv=Ka;var Qa=function(r){return re(void 0,void 0,void 0,function(){var e,t;return ne(this,function(n){switch(n.label){case 0:return[4,q.default.getCredentialAliasList()];case 1:return e=n.sent(),Xn(e,r)?[4,q.default.getCredential(r)]:[3,3];case 2:return t=n.sent(),[2,t];case 3:return[2]}})})};g.getCredentialWithExisted=Qa;var Ja=function(){return re(void 0,void 0,void 0,function(){var r,e,t,n,s,i;return ne(this,function(a){switch(a.label){case 0:return[4,q.default.getCredentialAliasList()];case 1:if(r=a.sent(),!(r.length>0))return[3,6];e={},t=0,n=r,a.label=2;case 2:return t<n.length?(s=n[t],[4,q.default.getCredential(s)]):[3,5];case 3:i=a.sent(),e[i.Alias]=ka(i,"Alias"),a.label=4;case 4:return t++,[3,2];case 5:return[2,e];case 6:return[2]}})})};g.getCredentialWithAll=Ja;var el=function(r,e){return e===void 0&&(e="unknow"),re(void 0,void 0,void 0,function(){var t,n,s,i;return ne(this,function(a){switch(a.label){case 0:return a.trys.push([0,2,,3]),t=(0,Fa.getConfig)("analysis"),t!=="enable"?[2]:Ma()||Ha()?[2]:[4,Ga("http://qaapis.devsapp.cn/apis/v1/search?category=".concat(e,"&code=TypeError&s=").concat(r),{timeout:2e3,json:!0})];case 1:return n=a.sent(),s=Xa(n.body,"shorturl"),s&&te.default.log(`AI Tips:
2
- You can try to solve the problem through: `.concat(ie.underline(s),`
3
- `)),[3,3];case 2:return i=a.sent(),[3,3];case 3:return[2]}})})};g.aiRequest=el;function tl(){var r=(0,q.getCoreVersion)(),e=["".concat(Mn.name,": ").concat(Mn.version),r?"core: ".concat(r):void 0,"s-home: ".concat(q.default.getRootHome()),"".concat(process.platform,"-").concat(process.arch),"node-".concat(process.version)];return e.filter(function(t){return t}).join(", ")}g.getVersion=tl;function rl(r){return re(this,void 0,void 0,function(){function e(s){return re(this,void 0,void 0,function(){var i,a;return ne(this,function(l){switch(l.label){case 0:return i=Re.default.lstatSync(s),typeof i!="object"?[2]:(t.set(i.ino,i.size),i.isDirectory()?(a=Re.default.readdirSync(s),typeof a!="object"?[2]:[4,Promise.all(a.map(function(c){return e(Pa.default.join(s,c))}))]):[3,2]);case 1:l.sent(),l.label=2;case 2:return[2]}})})}var t,n;return ne(this,function(s){switch(s.label){case 0:return t=new Map,[4,e(r)];case 1:return s.sent(),n=Array.from(t.values()).reduce(function(i,a){return i+a},0),[2,n]}})})}g.getFolderSize=rl;function nl(r,e){e===void 0&&(e=" ");for(var t="",n=0;n<r;n++)t=t+e;return t}g.printn=nl;function il(){return"en"}g.getLang=il;function Vn(r,e){var t=/\{\{(.*?)\}\}/g,n=r.match(t);if(n)for(var s=0;s<n.length;s++){var i=n[s].replace(/{{|}}/g,""),a=Va(i.split("|")[0]);e[a]&&(r=r.replace(n[s],e[a]))}return r}g.replaceFun=Vn;function sl(r,e){r.forEach(function(t){if(Re.default.existsSync(t)){var n=Re.default.readFileSync(t,"utf-8"),s=Vn(n,e);Re.default.writeFileSync(t,s,"utf-8")}})}g.replaceTemplate=sl;function ol(r){if(!r)return r;var e=r.slice(-4);return"***********".concat(e)}g.mark=ol;function vt(r,e){return Ca.default.platform()==="win32"?e||"\u25C6":"".concat(r," ")}g.emoji=vt;function Un(r,e){var t=r.length,n=new Array(e-t).fill(" ");return"".concat(r).concat(n.join("")," : ")}g.getTempCommandStr=Un;function al(r){return re(this,void 0,void 0,function(){var e,t,n,s,i,l,a,l;return ne(this,function(c){switch(c.label){case 0:return[4,q.default.getYamlContent(r)];case 1:if(e=c.sent(),te.default.log(`
4
- `.concat(vt("\u{1F680}")," ").concat(e.Name,"@").concat(e.Version,": ").concat(e.Description,`
5
- `)),t=e.Commands,t){n=Hn.maxLen(t),s=[],i={};for(l in t)a=t[l],Wa(a)?s.push(Hn.helpInfo(a,Ya(Za(l)),n,4)):i[l]=a;if(s.length>0&&te.default.log(s.join(`
6
- `)),!za(i)){for(l in i)te.default.log(" ".concat(Un(l,n)," ").concat(i[l]));te.default.log("")}te.default.log(e.HomePage?" ".concat(vt("\u{1F9ED}")," ").concat(q.default.makeUnderLine("More information: "+e.HomePage)," ")+`
7
- `:"")}return[2]}})})}g.specifyServiceHelp=al});var Bn=h(Et=>{"use strict";Object.defineProperty(Et,"__esModule",{value:!0});Et.default={clean_up_the_environment:"\u6E05\u7406\u73AF\u5883",display_help_for_command:"\u663E\u793A\u547D\u4EE4\u5E2E\u52A9",remove_components:"\u5220\u9664\u7EC4\u4EF6",delete_the_file_under_the_cache:"\u5220\u9664\u7F13\u5B58\u91CC\u7684\u7684<dirname>\u6587\u4EF6",record_your_log_information:"\u662F\u5426\u8BB0\u5F55\u60A8\u7684\u65E5\u5FD7\u4FE1\u606F\uFF1F",init_pproject_deploy_tip:"\u662F\u5426\u7ACB\u5373\u90E8\u7F72\u8BE5\u9879\u76EE\uFF1F",tip_for_a_serverless_project:"\u68C0\u6D4B\u5230\u5F53\u524D\u76EE\u5F55\u4E0B\u5DF2\u5B58\u5728\u4E00\u4E2AServerless-Devs\u9879\u76EE\uFF0C\u8BF7\u901A\u8FC7 's deploy' \u8FDB\u884C\u90E8\u7F72\u6216\u901A\u8FC7 's -h' \u83B7\u53D6\u66F4\u591A\u4FE1\u606F",create_a_new_project:"\u672A\u68C0\u6D4B\u5230 Serverless-Devs \u9879\u76EE\uFF0C\u662F\u5426\u65B0\u5EFA\u4E00\u4E2A\u9879\u76EE\uFF1F",en:"English (en)",zh:"\u4E2D\u6587 (zh)",select_current_language:"\u8BF7\u9009\u62E9\u5F53\u524D\u8BED\u8A00","app-tip":"\u8BF7\u9009\u62E9\u60A8\u5E0C\u671B\u521B\u5EFA\u7684 Serverless-Devs \u5E94\u7528","template-tip":"\u8BF7\u9009\u62E9\u60A8\u559C\u6B22\u7684\u6A21\u7248","fc-runtime-starter":"fc-runtime-starter - \u5FEB\u901F\u90E8\u7F72\u4E00\u4E2A FC \u51FD\u6570","fc-custom-container-stater":"fc-custom-container-stater - \u5FEB\u901F\u90E8\u7F72\u4E00\u4E2A custom-container \u5E94\u7528",web:"web-framework-stater - \u5FEB\u901F\u90E8\u7F72\u4E00\u4E2A Web \u6846\u67B6","static-site":"static-website-stater - \u5FEB\u901F\u90E8\u7F72\u4E00\u4E2A\u9759\u6001\u7F51\u7AD9","best-practice":"serverless-best-practice - \u5FEB\u901F\u4F53\u9A8C Serverless \u6700\u4F73\u5B9E\u8DF5","devs-template":"Serverless Devs \u5F00\u53D1\u6A21\u677F","fc-http-nodejs":"fc-http-nodejs - \u5FEB\u901F\u90E8\u7F72\u4E00\u4E2A nodejs12 \u51FD\u6570","fc-http-python":"fc-http-python - \u5FEB\u901F\u90E8\u7F72\u4E00\u4E2A python3 \u51FD\u6570","fc-http-java":"fc-http-java - \u5FEB\u901F\u90E8\u7F72\u4E00\u4E2A java8 \u51FD\u6570","fc-custom-container-event-python3":"fc-custom-container-event-python3 - \u5FEB\u901F\u90E8\u7F72\u4E00\u4E2A\u901A\u8FC7\u4E8B\u4EF6\u89E6\u53D1\u7684 python3 \u5E94\u7528","fc-custom-container-event-cpp":"fc-custom-container-event-cpp - \u5FEB\u901F\u90E8\u7F72\u4E00\u4E2A\u901A\u8FC7\u4E8B\u4EF6\u89E6\u53D1\u7684 cpp \u5E94\u7528","fc-custom-container-http-springboot":"fc-custom-container-http-springboot - \u5FEB\u901F\u90E8\u7F72\u4E00\u4E2A\u901A\u8FC7 HTTP \u8BF7\u6C42\u89E6\u53D1\u7684 springboot \u5E94\u7528","fc-custom-container-http-aspdotnetcore":"fc-custom-container-http-aspdotnetcore - \u5FEB\u901F\u90E8\u7F72\u4E00\u4E2A\u901A\u8FC7 HTTP \u8BF7\u6C42\u89E6\u53D1\u7684 aspdotnetcore \u5E94\u7528","express-starter":"express-starter - \u5FEB\u901F\u90E8\u7F72\u4E00\u4E2A express \u57FA\u7840\u5E94\u7528","koa-starter":"koa-starter - \u5FEB\u901F\u90E8\u7F72\u4E00\u4E2A koa \u57FA\u7840\u5E94\u7528","nuxtjs-starter":"nuxtjs-starter - \u5FEB\u901F\u90E8\u7F72\u4E00\u4E2A nuxtjs \u57FA\u7840\u5E94\u7528","eggjs-starter":"eggjs-starter - \u5FEB\u901F\u90E8\u7F72\u4E00\u4E2A eggjs \u57FA\u7840\u5E94\u7528","flask-starter":"flask-starter - \u5FEB\u901F\u90E8\u7F72\u4E00\u4E2A flask \u57FA\u7840\u5E94\u7528","SpringBoot-starter":"SpringBoot-starter - \u5FEB\u901F\u90E8\u7F72\u4E00\u4E2A SpringBoot \u57FA\u7840\u5E94\u7528","Zblog-starter":"Zblog-starter - \u5FEB\u901F\u90E8\u7F72\u4E00\u4E2A Zblog \u57FA\u7840\u5E94\u7528","website-starter":"website-starter - \u5FEB\u901F\u90E8\u7F72\u4E00\u4E2A\u9759\u6001\u7F51\u7AD9","react-starter":"react-starter - \u5FEB\u901F\u90E8\u7F72\u4E00\u4E2A React.js \u5E94\u7528","vue-starter":"vue-starter - \u5FEB\u901F\u90E8\u7F72\u4E00\u4E2A Vue.js \u5E94\u7528",puppeteer:"puppeteer - \u5FEB\u901F\u90E8\u7F72\u4E00\u4E2A\u57FA\u4E8E puppeteer \u622A\u56FE\u7684 Web \u5E94\u7528",ffmpeg:"ffmpeg - \u5FEB\u901F\u90E8\u7F72\u4E00\u4E2A\u57FA\u4E8E ffmpeg \u5B9E\u73B0\u97F3\u89C6\u9891\u5904\u7406\u5E94\u7528",pdf2Img:"pdf2Img - \u5FEB\u901F\u90E8\u7F72\u4E00\u4E2A pdf \u8F6C\u56FE\u7247\u5E94\u7528",tensorflow:"tensorflow - \u5FEB\u901F\u90E8\u7F72\u4E00\u4E2A tensorflow \u5E94\u7528",todoList:"todoList - \u5FEB\u901F\u90E8\u7F72\u4E00\u4E2A\u57FA\u4E8E nodejs \u7684\u7F51\u9875 TodoList \u5E94\u7528"}});var kn=h(yt=>{"use strict";Object.defineProperty(yt,"__esModule",{value:!0});yt.default={clean_up_the_environment:"Clean up the environment",display_help_for_command:"Display help for command",remove_components:"Remove component (like: fc, fc@0.0.1)",delete_the_file_under_the_cache:"Delete the <dirname> file in the cache",record_your_log_information:"Do you record your log information?",init_pproject_deploy_tip:"Do you want to deploy the project immediately?",tip_for_a_serverless_project:"A Serverless-Devs project is detected in the current directory, please deploy via 's deploy' or get more information via 's -h'",create_a_new_project:"No Serverless-Devs project is currently detected. Do you want to create a new project?",en:"English (en)",zh:"Chinese (zh)",select_current_language:"Please select current language","app-tip":"Hello, serverlesser. Which template do you like?","template-tip":"Which template do you like?","fc-runtime-starter":"fc-runtime-starter - Deploy FC function in 5 minutes","fc-custom-container-stater":"fc-custom-container-stater - Deploy FC function with custom-container",web:"web-framework-stater-Quickly deploy a web framework","static-site":"static-website-stater-Quickly deploy a static website","best-practice":"serverless-best-practice-Quickly experience serverless best practices","devs-template":"Serverless Develop scaffold","fc-http-nodejs":"fc-http-nodejs - Deploy FC nodejs12 runtime function","fc-http-python":"fc-http-python - Deploy FC python3 runtime function","fc-http-java":"fc-http-java - Deploy FC java8 runtime function","fc-custom-container-event-python3":"fc-custom-container-event-python3 - Deploy python3 event-triggered application","fc-custom-container-event-cpp":"fc-custom-container-event-cpp - Deploy cpp event-triggered application","fc-custom-container-http-springboot":"fc-custom-container-http-springboot - Deploy springboot HTTP Request-triggered application","fc-custom-container-http-aspdotnetcore":"fc-custom-container-http-aspdotnetcore - Deploy dotnetcore HTTP Request-triggered application","express-starter":"express-starter - Deploy express application","koa-starter":"koa-starter - Deploy koa application","nuxtjs-starter":"nuxtjs-starter - Deploy nuxtjs application","eggjs-starter":"eggjs-starter - Deploy eggjs application","flask-starter":"flask-starter - Deploy flask application","SpringBoot-starter":"SpringBoot-starter - Deploy SpringBoot application","Zblog-starter":"Zblog-starter - Deploy Zblog application","website-starter":"website-starter - Deploy static website","react-starter":"react-starter - Deploy React.js application","vue-starter":"vue-starter - Deploy Vue.js application",puppeteer:"puppeteer - Deploy screenshot application base on puppeteer + fc",ffmpeg:"ffmpeg - Deploy audio and video processing application base on ffmpeg + fc",pdf2Img:"pdf2Img - Deploy pdf to images application",tensorflow:"tensorflow - Deploy tensorflow application",todoList:"todoList - Deploy todoList application"}});var zn=h(Ie=>{"use strict";var Wn=Ie&&Ie.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ie,"__esModule",{value:!0});var ll=mt(),cl=Wn(Bn()),ul=Wn(kn()),_t={en:ul.default,zh:cl.default},fl=function(r){var e=(0,ll.getLang)(),t=_t[e]?_t[e][r]:_t.en[r];return t||r};Ie.default=fl});var $e=h(R=>{"use strict";var hl=R&&R.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(r,n,s)}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),Yn=R&&R.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&hl(e,r,t)},wt=R&&R.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(R,"__esModule",{value:!0});R.registerCommandChecker=R.i18n=R.logger=void 0;var pl=wt(Me());Yn(mt(),R);Yn(gt(),R);var dl=Me();Object.defineProperty(R,"logger",{enumerable:!0,get:function(){return wt(dl).default}});var gl=zn();Object.defineProperty(R,"i18n",{enumerable:!0,get:function(){return wt(gl).default}});function vl(r){r.on("command:*",function(e){var t=r.commands.map(function(n){return n.name()});t.includes(e[0])||(pl.default.error(" error: unknown command ".concat(e[0])),r.help())})}R.registerCommandChecker=vl});var Z=h(se=>{"use strict";var ml=se&&se.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(se,"__esModule",{value:!0});se.ServerlessError=void 0;var El=ml(M()),yl=El.default.Logger,_l=new yl("S-CLI-ERROR"),wl=function(){function r(e,t,n){_l.error(e+": "+t,n),process.exit(1)}return r}();se.ServerlessError=wl});var Zn=h(oe=>{"use strict";var bl=oe&&oe.__extends||function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,s){n.__proto__=s}||function(n,s){for(var i in s)Object.prototype.hasOwnProperty.call(s,i)&&(n[i]=s[i])},r(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}();Object.defineProperty(oe,"__esModule",{value:!0});oe.CommandError=void 0;var Sl=Z(),Ol=function(r){bl(e,r);function e(t,n){return r.call(this,"Error",t,n)||this}return e}(Sl.ServerlessError);oe.CommandError=Ol});var Kn=h(ae=>{"use strict";var Rl=ae&&ae.__extends||function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,s){n.__proto__=s}||function(n,s){for(var i in s)Object.prototype.hasOwnProperty.call(s,i)&&(n[i]=s[i])},r(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}();Object.defineProperty(ae,"__esModule",{value:!0});ae.ConfigDeleteError=void 0;var Il=Z(),$l=function(r){Rl(e,r);function e(t,n){return r.call(this,"Deletion failed",t,n)||this}return e}(Il.ServerlessError);ae.ConfigDeleteError=$l});var Qn=h(le=>{"use strict";var ql=le&&le.__extends||function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,s){n.__proto__=s}||function(n,s){for(var i in s)Object.prototype.hasOwnProperty.call(s,i)&&(n[i]=s[i])},r(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}();Object.defineProperty(le,"__esModule",{value:!0});le.ConfigError=void 0;var Al=Z(),Tl=function(r){ql(e,r);function e(t,n){return r.call(this,"Config failed",t,n)||this}return e}(Al.ServerlessError);le.ConfigError=Tl});var Jn=h(ce=>{"use strict";var jl=ce&&ce.__extends||function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,s){n.__proto__=s}||function(n,s){for(var i in s)Object.prototype.hasOwnProperty.call(s,i)&&(n[i]=s[i])},r(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}();Object.defineProperty(ce,"__esModule",{value:!0});ce.ConfigGetError=void 0;var xl=Z(),Dl=function(r){jl(e,r);function e(t,n){return r.call(this,"Get failed",t,n)||this}return e}(xl.ServerlessError);ce.ConfigGetError=Dl});var ei=h(ue=>{"use strict";var Nl=ue&&ue.__extends||function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,s){n.__proto__=s}||function(n,s){for(var i in s)Object.prototype.hasOwnProperty.call(s,i)&&(n[i]=s[i])},r(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}();Object.defineProperty(ue,"__esModule",{value:!0});ue.InitError=void 0;var Ll=Z(),Pl=function(r){Nl(e,r);function e(t,n){return r.call(this,"Initialization failed",t,n)||this}return e}(Ll.ServerlessError);ue.InitError=Pl});var ri=h(C=>{"use strict";var Cl=C&&C.__awaiter||function(r,e,t,n){function s(i){return i instanceof t?i:new t(function(a){a(i)})}return new(t||(t=Promise))(function(i,a){function l(u){try{o(n.next(u))}catch(f){a(f)}}function c(u){try{o(n.throw(u))}catch(f){a(f)}}function o(u){u.done?i(u.value):s(u.value).then(l,c)}o((n=n.apply(r,e||[])).next())})},Fl=C&&C.__generator||function(r,e){var t={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},n,s,i,a;return a={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function l(o){return function(u){return c([o,u])}}function c(o){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,o[0]&&(t=0)),t;)try{if(n=1,s&&(i=o[0]&2?s.return:o[0]?s.throw||((i=s.return)&&i.call(s),0):s.next)&&!(i=i.call(s,o[1])).done)return i;switch(s=0,i&&(o=[o[0]&2,i.value]),o[0]){case 0:case 1:i=o;break;case 4:return t.label++,{value:o[1],done:!1};case 5:t.label++,s=o[1],o=[0];continue;case 7:o=t.ops.pop(),t.trys.pop();continue;default:if(i=t.trys,!(i=i.length>0&&i[i.length-1])&&(o[0]===6||o[0]===2)){t=0;continue}if(o[0]===3&&(!i||o[1]>i[0]&&o[1]<i[3])){t.label=o[1];break}if(o[0]===6&&t.label<i[1]){t.label=i[1],i=o;break}if(i&&t.label<i[2]){t.label=i[2],t.ops.push(o);break}i[2]&&t.ops.pop(),t.trys.pop();continue}o=e.call(r,t)}catch(u){o=[6,u],s=0}finally{n=i=0}if(o[0]&5)throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}},Gl=C&&C.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(C,"__esModule",{value:!0});C.HumanError=void 0;var ti=Gl(M()),Ve=$e(),Ml=ti.default.colors,Hl=function(){function r(e){var t=e.errorMessage,n=e.tips;this.errorMessage=t,Ve.logger.log(`
8
- `.concat((0,Ve.bgRed)("ERROR:"))),Ve.logger.log("TypeError: ".concat(t,`
9
- `)),n&&Ve.logger.log("".concat(Ml.gray(n),`
10
- `))}return r.prototype.report=function(e){return Cl(this,void 0,void 0,function(){var t;return Fl(this,function(n){switch(n.label){case 0:return t=e.error,[4,ti.default.report({type:"jsError",errorMessage:this.errorMessage,errorStack:t.stack})];case 1:return n.sent(),[2]}})})},r}();C.HumanError=Hl});var ii=h(fe=>{"use strict";var Xl=fe&&fe.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(fe,"__esModule",{value:!0});fe.HumanWarning=void 0;var Vl=Xl(M()),bt=$e(),ni=Vl.default.colors,Ul=function(){function r(e){var t=e.warningMessage,n=e.tips;bt.logger.log(`
11
- `.concat(ni.hex("#000").bgYellow("WARNING:"))),bt.logger.log("".concat(t,`
12
- `)),n&&bt.logger.log("".concat(ni.gray(n),`
13
- `))}return r}();fe.HumanWarning=Ul});var oi=h(_=>{"use strict";var Bl=_&&_.__awaiter||function(r,e,t,n){function s(i){return i instanceof t?i:new t(function(a){a(i)})}return new(t||(t=Promise))(function(i,a){function l(u){try{o(n.next(u))}catch(f){a(f)}}function c(u){try{o(n.throw(u))}catch(f){a(f)}}function o(u){u.done?i(u.value):s(u.value).then(l,c)}o((n=n.apply(r,e||[])).next())})},kl=_&&_.__generator||function(r,e){var t={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},n,s,i,a;return a={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function l(o){return function(u){return c([o,u])}}function c(o){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,o[0]&&(t=0)),t;)try{if(n=1,s&&(i=o[0]&2?s.return:o[0]?s.throw||((i=s.return)&&i.call(s),0):s.next)&&!(i=i.call(s,o[1])).done)return i;switch(s=0,i&&(o=[o[0]&2,i.value]),o[0]){case 0:case 1:i=o;break;case 4:return t.label++,{value:o[1],done:!1};case 5:t.label++,s=o[1],o=[0];continue;case 7:o=t.ops.pop(),t.trys.pop();continue;default:if(i=t.trys,!(i=i.length>0&&i[i.length-1])&&(o[0]===6||o[0]===2)){t=0;continue}if(o[0]===3&&(!i||o[1]>i[0]&&o[1]<i[3])){t.label=o[1];break}if(o[0]===6&&t.label<i[1]){t.label=i[1],i=o;break}if(i&&t.label<i[2]){t.label=i[2],t.ops.push(o);break}i[2]&&t.ops.pop(),t.trys.pop();continue}o=e.call(r,t)}catch(u){o=[6,u],s=0}finally{n=i=0}if(o[0]&5)throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}},si=_&&_.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(_,"__esModule",{value:!0});_.HandleError=_.HumanWarning=_.HumanError=_.ServerlessError=_.InitError=_.ConfigGetError=_.ConfigError=_.ConfigDeleteError=_.CommandError=void 0;var y=$e(),Wl=si(require("path")),he=si(M()),V=he.default.colors,zl=he.default.report,St=he.default.isDebugMode,Yl=he.default.makeUnderLine,Ot=he.default.isDocker,Zl=Zn();Object.defineProperty(_,"CommandError",{enumerable:!0,get:function(){return Zl.CommandError}});var Kl=Kn();Object.defineProperty(_,"ConfigDeleteError",{enumerable:!0,get:function(){return Kl.ConfigDeleteError}});var Ql=Qn();Object.defineProperty(_,"ConfigError",{enumerable:!0,get:function(){return Ql.ConfigError}});var Jl=Jn();Object.defineProperty(_,"ConfigGetError",{enumerable:!0,get:function(){return Jl.ConfigGetError}});var ec=ei();Object.defineProperty(_,"InitError",{enumerable:!0,get:function(){return ec.InitError}});var tc=Z();Object.defineProperty(_,"ServerlessError",{enumerable:!0,get:function(){return tc.ServerlessError}});var rc=ri();Object.defineProperty(_,"HumanError",{enumerable:!0,get:function(){return rc.HumanError}});var nc=ii();Object.defineProperty(_,"HumanWarning",{enumerable:!0,get:function(){return nc.HumanWarning}});function Ue(r,e){return"".concat(V.gray(r)).concat(V.gray.underline(e))}var ic=function(r){return Bl(void 0,void 0,void 0,function(){var e,t,n,s,i,a,l,c;return kl(this,function(o){switch(o.label){case 0:e="Message:",t={traceId:"",catchableError:!1},n=r,s=(0,y.getConfig)("analysis"),s!=="disable"&&(t.traceId=process.env.serverless_devs_trace_id),i=r.message?r.message:"";try{a=JSON.parse(i)}catch{}return a&&a.tips?(l=a.message?"Message: ".concat(a.message,`
14
- `):"",c=a.tips?"* ".concat(Yl(a.tips.replace(/\n/,`
15
- * `))):"",y.logger.log(`
16
- `.concat(V.hex("#000").bgYellow("WARNING:"),`
17
- ======================
18
- `).concat(c,`
19
- `),"yellow"),St()?y.logger.log(r.stack):y.logger.log(V.grey(l)),t.catchableError=!0,n=a,[3,5]):[3,1];case 1:return a&&a.code?(y.logger.log((0,y.red)("\u2716 ".concat(a.prefix||e,`
20
- `))),y.logger.log("".concat((0,y.bgRed)("ERROR:"),`
21
- `)),St()?y.logger.log("".concat(a.stack,`
22
- `)):y.logger.log("".concat(a.message,`
23
- `)),[4,(0,y.aiRequest)(a.message)]):[3,3];case 2:return o.sent(),n=a,[3,5];case 3:return y.logger.log((0,y.red)("\u2716 ".concat(e,`
24
- `))),y.logger.log("".concat((0,y.bgRed)("ERROR:"),`
25
- `)),y.logger.log(St()||Ot()?r.stack:"".concat(i,`
26
- `)),[4,(0,y.aiRequest)(i)];case 4:o.sent(),o.label=5;case 5:return t.catchableError||(t.traceId&&y.logger.log(V.gray("TraceId: ".concat(t.traceId))),Ot()||(y.logger.log(V.gray("Environment: ".concat((0,y.getVersion)()))),y.logger.log(Ue("Documents: ","https://www.serverless-devs.com")),y.logger.log(Ue("Discussions: ","https://github.com/Serverless-Devs/Serverless-Devs/discussions")),y.logger.log(Ue("Issues: ","https://github.com/Serverless-Devs/Serverless-Devs/issues")),y.logger.log(Ue("Regsitry: ",`https://registry.serverless-devs.com
27
- `)),t.traceId&&y.logger.log(V.gray("Please copy traceId: ".concat(t.traceId," and join Dingding group: 33947367 for consultation."))),process.env.serverless_devs_trace_id&&y.logger.log("A complete log of this run can be found in: ".concat(Wl.default.join(he.default.getRootHome(),"logs","".concat(process.env.serverless_devs_trace_id,".log")),`
28
- `)))),!Ot()&&y.logger.log(V.gray("You can run 's clean --all' to clean Serverless devs.")),t.traceId&&!t.catchableError?[4,zl({type:"jsError",errorMessage:n.message,errorStack:n.stack,traceId:t.traceId})]:[3,7];case 6:o.sent(),o.label=7;case 7:return process.exit(n.code||1),[2]}})})};_.HandleError=ic});var It=h((Tu,li)=>{"use strict";var ai=require("fs"),Rt;function sc(){try{return ai.statSync("/.dockerenv"),!0}catch{return!1}}function oc(){try{return ai.readFileSync("/proc/self/cgroup","utf8").includes("docker")}catch{return!1}}li.exports=()=>(Rt===void 0&&(Rt=sc()||oc()),Rt)});var fi=h((ju,$t)=>{"use strict";var ac=require("os"),lc=require("fs"),ci=It(),ui=()=>{if(process.platform!=="linux")return!1;if(ac.release().toLowerCase().includes("microsoft"))return!ci();try{return lc.readFileSync("/proc/version","utf8").toLowerCase().includes("microsoft")?!ci():!1}catch{return!1}};process.env.__IS_WSL_TEST__?$t.exports=ui:$t.exports=ui()});var pi=h((xu,hi)=>{"use strict";hi.exports=(r,e,t)=>{let n=s=>Object.defineProperty(r,e,{value:s,enumerable:!0,writable:!0});return Object.defineProperty(r,e,{configurable:!0,enumerable:!0,get(){let s=t();return n(s),s},set(s){n(s)}}),r}});var _i=h((Du,yi)=>{var cc=require("path"),uc=require("child_process"),{promises:qt,constants:Ei}=require("fs"),Be=fi(),fc=It(),At=pi(),di=cc.join(__dirname,"xdg-open"),{platform:pe,arch:gi}=process,hc=(()=>{let r="/mnt/",e;return async function(){if(e)return e;let t="/etc/wsl.conf",n=!1;try{await qt.access(t,Ei.F_OK),n=!0}catch{}if(!n)return r;let s=await qt.readFile(t,{encoding:"utf8"}),i=/(?<!#.*)root\s*=\s*(?<mountPoint>.*)/g.exec(s);return i?(e=i.groups.mountPoint.trim(),e=e.endsWith("/")?e:`${e}/`,e):r}})(),vi=async(r,e)=>{let t;for(let n of r)try{return await e(n)}catch(s){t=s}throw t},ke=async r=>{if(r={wait:!1,background:!1,newInstance:!1,allowNonzeroExitCode:!1,...r},Array.isArray(r.app))return vi(r.app,l=>ke({...r,app:l}));let{name:e,arguments:t=[]}=r.app||{};if(t=[...t],Array.isArray(e))return vi(e,l=>ke({...r,app:{name:l,arguments:t}}));let n,s=[],i={};if(pe==="darwin")n="open",r.wait&&s.push("--wait-apps"),r.background&&s.push("--background"),r.newInstance&&s.push("--new"),e&&s.push("-a",e);else if(pe==="win32"||Be&&!fc()){let l=await hc();n=Be?`${l}c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe`:`${process.env.SYSTEMROOT}\\System32\\WindowsPowerShell\\v1.0\\powershell`,s.push("-NoProfile","-NonInteractive","\u2013ExecutionPolicy","Bypass","-EncodedCommand"),Be||(i.windowsVerbatimArguments=!0);let c=["Start"];r.wait&&c.push("-Wait"),e?(c.push(`"\`"${e}\`""`,"-ArgumentList"),r.target&&t.unshift(r.target)):r.target&&c.push(`"${r.target}"`),t.length>0&&(t=t.map(o=>`"\`"${o}\`""`),c.push(t.join(","))),r.target=Buffer.from(c.join(" "),"utf16le").toString("base64")}else{if(e)n=e;else{let l=!__dirname||__dirname==="/",c=!1;try{await qt.access(di,Ei.X_OK),c=!0}catch{}n=process.versions.electron||pe==="android"||l||!c?"xdg-open":di}t.length>0&&s.push(...t),r.wait||(i.stdio="ignore",i.detached=!0)}r.target&&s.push(r.target),pe==="darwin"&&t.length>0&&s.push("--args",...t);let a=uc.spawn(n,s,i);return r.wait?new Promise((l,c)=>{a.once("error",c),a.once("close",o=>{if(r.allowNonzeroExitCode&&o>0){c(new Error(`Exited with code ${o}`));return}l(a)})}):(a.unref(),a)},Tt=(r,e)=>{if(typeof r!="string")throw new TypeError("Expected a `target`");return ke({...e,target:r})},pc=(r,e)=>{if(typeof r!="string")throw new TypeError("Expected a `name`");let{arguments:t=[]}=e||{};if(t!=null&&!Array.isArray(t))throw new TypeError("Expected `appArguments` as Array type");return ke({...e,app:{name:r,arguments:t}})};function mi(r){if(typeof r=="string"||Array.isArray(r))return r;let{[gi]:e}=r;if(!e)throw new Error(`${gi} is not supported`);return e}function jt({[pe]:r},{wsl:e}){if(e&&Be)return mi(e);if(!r)throw new Error(`${pe} is not supported`);return mi(r)}var We={};At(We,"chrome",()=>jt({darwin:"google chrome",win32:"chrome",linux:["google-chrome","google-chrome-stable","chromium"]},{wsl:{ia32:"/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe",x64:["/mnt/c/Program Files/Google/Chrome/Application/chrome.exe","/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe"]}}));At(We,"firefox",()=>jt({darwin:"firefox",win32:"C:\\Program Files\\Mozilla Firefox\\firefox.exe",linux:"firefox"},{wsl:"/mnt/c/Program Files/Mozilla Firefox/firefox.exe"}));At(We,"edge",()=>jt({darwin:"microsoft edge",win32:"msedge",linux:["microsoft-edge","microsoft-edge-dev"]},{wsl:"/mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe"}));Tt.apps=We;Tt.openApp=pc;yi.exports=Tt});var wi=exports&&exports.__awaiter||function(r,e,t,n){function s(i){return i instanceof t?i:new t(function(a){a(i)})}return new(t||(t=Promise))(function(i,a){function l(u){try{o(n.next(u))}catch(f){a(f)}}function c(u){try{o(n.throw(u))}catch(f){a(f)}}function o(u){u.done?i(u.value):s(u.value).then(l,c)}o((n=n.apply(r,e||[])).next())})},bi=exports&&exports.__generator||function(r,e){var t={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},n,s,i,a;return a={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function l(o){return function(u){return c([o,u])}}function c(o){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,o[0]&&(t=0)),t;)try{if(n=1,s&&(i=o[0]&2?s.return:o[0]?s.throw||((i=s.return)&&i.call(s),0):s.next)&&!(i=i.call(s,o[1])).done)return i;switch(s=0,i&&(o=[o[0]&2,i.value]),o[0]){case 0:case 1:i=o;break;case 4:return t.label++,{value:o[1],done:!1};case 5:t.label++,s=o[1],o=[0];continue;case 7:o=t.ops.pop(),t.trys.pop();continue;default:if(i=t.trys,!(i=i.length>0&&i[i.length-1])&&(o[0]===6||o[0]===2)){t=0;continue}if(o[0]===3&&(!i||o[1]>i[0]&&o[1]<i[3])){t.label=o[1];break}if(o[0]===6&&t.label<i[1]){t.label=i[1],i=o;break}if(i&&t.label<i[2]){t.label=i[2],t.ops.push(o);break}i[2]&&t.ops.pop(),t.trys.pop();continue}o=e.call(r,t)}catch(u){o=[6,u],s=0}finally{n=i=0}if(o[0]&5)throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}},Si=exports&&exports.__importDefault||function(r){return r&&r.__esModule?r:{default:r}},ze=Si(M()),Oi=$e(),dc=oi(),gc=Si(_i()),vc=ze.default.colors,mc=`Application editing.
29
-
30
- Example:
31
- $ s edit
32
-
33
- `.concat((0,Oi.emoji)("\u{1F4D6}")," Document: ").concat(vc.underline("https://github.com/Serverless-Devs/Serverless-Devs/tree/master/docs/zh/command/edit.md"));function Ec(r){var e=this,t=r.command("edit").usage("[options]").option("-t, --template <templatePath>","Specify the template file.").helpOption("-h, --help",(0,Oi.i18n)("display_help_for_command")).description(mc).addHelpCommand(!1).action(function(s){return wi(e,void 0,void 0,function(){var i;return bi(this,function(a){switch(a.label){case 0:return a.trys.push([0,2,,4]),[4,n(s)];case 1:return a.sent(),[3,4];case 2:return i=a.sent(),[4,(0,dc.HandleError)(i)];case 3:return a.sent(),[3,4];case 4:return[2]}})})}),n=function(s){return wi(e,void 0,void 0,function(){var i,a,l,c,o,u;return bi(this,function(f){switch(f.label){case 0:return i=ze.default.getGlobalArgs(process.argv.slice(2)),a=i.help,l=i.template,console.log({help:a,template:l}),a&&t.help(),[4,ze.default.getTemplatePath(l)];case 1:return c=f.sent(),console.log(c),process.env.template=c,[4,ze.default.getAvailablePort(7e3)];case 2:return o=f.sent(),u=require("@serverless-devs/ui"),u.listen(o,function(){console.log("server start at http://localhost:".concat(o)),(0,gc.default)("http://localhost:".concat(o))}),[2]}})})}}module.exports=Ec;
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ var __generator = (this && this.__generator) || function (thisArg, body) {
12
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
13
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
14
+ function verb(n) { return function (v) { return step([n, v]); }; }
15
+ function step(op) {
16
+ if (f) throw new TypeError("Generator is already executing.");
17
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
18
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
19
+ if (y = 0, t) op = [op[0] & 2, t.value];
20
+ switch (op[0]) {
21
+ case 0: case 1: t = op; break;
22
+ case 4: _.label++; return { value: op[1], done: false };
23
+ case 5: _.label++; y = op[1]; op = [0]; continue;
24
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
25
+ default:
26
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
27
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
28
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
29
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
30
+ if (t[2]) _.ops.pop();
31
+ _.trys.pop(); continue;
32
+ }
33
+ op = body.call(thisArg, _);
34
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
35
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
36
+ }
37
+ };
38
+ var __importDefault = (this && this.__importDefault) || function (mod) {
39
+ return (mod && mod.__esModule) ? mod : { "default": mod };
40
+ };
41
+ var core_1 = __importDefault(require("../utils/core"));
42
+ var utils_1 = require("../utils");
43
+ var error_1 = require("../error");
44
+ var open_1 = __importDefault(require("open"));
45
+ var colors = core_1.default.colors;
46
+ var description = "Application editing.\n \n Example:\n $ s edit\n\n".concat((0, utils_1.emoji)('📖'), " Document: ").concat(colors.underline('https://github.com/Serverless-Devs/Serverless-Devs/tree/master/docs/zh/command/edit.md'));
47
+ function run(program) {
48
+ var _this = this;
49
+ var command = program
50
+ .command('edit')
51
+ .usage('[options]')
52
+ .option('-t, --template <templatePath>', 'Specify the template file.')
53
+ .helpOption('-h, --help', (0, utils_1.i18n)('display_help_for_command'))
54
+ .description(description)
55
+ .addHelpCommand(false)
56
+ .action(function (options) { return __awaiter(_this, void 0, void 0, function () {
57
+ var error_2;
58
+ return __generator(this, function (_a) {
59
+ switch (_a.label) {
60
+ case 0:
61
+ _a.trys.push([0, 2, , 4]);
62
+ return [4 /*yield*/, doAction(options)];
63
+ case 1:
64
+ _a.sent();
65
+ return [3 /*break*/, 4];
66
+ case 2:
67
+ error_2 = _a.sent();
68
+ return [4 /*yield*/, (0, error_1.HandleError)(error_2)];
69
+ case 3:
70
+ _a.sent();
71
+ return [3 /*break*/, 4];
72
+ case 4: return [2 /*return*/];
73
+ }
74
+ });
75
+ }); });
76
+ var doAction = function (options) { return __awaiter(_this, void 0, void 0, function () {
77
+ var argvData, help, template, spath, port, app;
78
+ return __generator(this, function (_a) {
79
+ switch (_a.label) {
80
+ case 0:
81
+ argvData = core_1.default.getGlobalArgs(process.argv.slice(2));
82
+ help = argvData.help, template = argvData.template;
83
+ console.log({ help: help, template: template });
84
+ if (help) {
85
+ command.help();
86
+ }
87
+ return [4 /*yield*/, core_1.default.getTemplatePath(template)];
88
+ case 1:
89
+ spath = _a.sent();
90
+ console.log(spath);
91
+ process.env['template'] = spath;
92
+ return [4 /*yield*/, core_1.default.getAvailablePort(7000)];
93
+ case 2:
94
+ port = _a.sent();
95
+ app = require('@serverless-devs/ui');
96
+ app.listen(port, function () {
97
+ console.log("server start at http://localhost:".concat(port));
98
+ (0, open_1.default)("http://localhost:".concat(port));
99
+ });
100
+ return [2 /*return*/];
101
+ }
102
+ });
103
+ }); };
104
+ }
105
+ module.exports = run;
106
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvZWRpdC9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7O0FBQ0EsdURBQWlDO0FBQ2pDLGtDQUF1QztBQUN2QyxrQ0FBdUM7QUFDdkMsOENBQXdCO0FBRWhCLElBQUEsTUFBTSxHQUFLLGNBQUksT0FBVCxDQUFVO0FBRXhCLElBQU0sV0FBVyxHQUFHLHdFQUtsQixJQUFBLGFBQUssRUFBQyxJQUFJLENBQUMsd0JBQWMsTUFBTSxDQUFDLFNBQVMsQ0FDekMsd0ZBQXdGLENBQ3pGLENBQUUsQ0FBQztBQUVKLFNBQVMsR0FBRyxDQUFDLE9BQWdCO0lBQTdCLGlCQW9DQztJQW5DQyxJQUFNLE9BQU8sR0FBRyxPQUFPO1NBQ3BCLE9BQU8sQ0FBQyxNQUFNLENBQUM7U0FDZixLQUFLLENBQUMsV0FBVyxDQUFDO1NBQ2xCLE1BQU0sQ0FBQywrQkFBK0IsRUFBRSw0QkFBNEIsQ0FBQztTQUNyRSxVQUFVLENBQUMsWUFBWSxFQUFFLElBQUEsWUFBSSxFQUFDLDBCQUEwQixDQUFDLENBQUM7U0FDMUQsV0FBVyxDQUFDLFdBQVcsQ0FBQztTQUN4QixjQUFjLENBQUMsS0FBSyxDQUFDO1NBQ3JCLE1BQU0sQ0FBQyxVQUFNLE9BQU87Ozs7OztvQkFFakIscUJBQU0sUUFBUSxDQUFDLE9BQU8sQ0FBQyxFQUFBOztvQkFBdkIsU0FBdUIsQ0FBQzs7OztvQkFFeEIscUJBQU0sSUFBQSxtQkFBVyxFQUFDLE9BQUssQ0FBQyxFQUFBOztvQkFBeEIsU0FBd0IsQ0FBQzs7Ozs7U0FFNUIsQ0FBQyxDQUFDO0lBRUwsSUFBTSxRQUFRLEdBQUcsVUFBTSxPQUFPOzs7OztvQkFDdEIsUUFBUSxHQUFHLGNBQUksQ0FBQyxhQUFhLENBQUMsT0FBTyxDQUFDLElBQUksQ0FBQyxLQUFLLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQztvQkFDbkQsSUFBSSxHQUFlLFFBQVEsS0FBdkIsRUFBRSxRQUFRLEdBQUssUUFBUSxTQUFiLENBQWM7b0JBQ3BDLE9BQU8sQ0FBQyxHQUFHLENBQUMsRUFBRSxJQUFJLE1BQUEsRUFBRSxRQUFRLFVBQUEsRUFBRSxDQUFDLENBQUM7b0JBRWhDLElBQUksSUFBSSxFQUFFO3dCQUNSLE9BQU8sQ0FBQyxJQUFJLEVBQUUsQ0FBQztxQkFDaEI7b0JBQ2EscUJBQU0sY0FBSSxDQUFDLGVBQWUsQ0FBQyxRQUFRLENBQUMsRUFBQTs7b0JBQTVDLEtBQUssR0FBRyxTQUFvQztvQkFDbEQsT0FBTyxDQUFDLEdBQUcsQ0FBQyxLQUFLLENBQUMsQ0FBQztvQkFFbkIsT0FBTyxDQUFDLEdBQUcsQ0FBQyxVQUFVLENBQUMsR0FBRyxLQUFLLENBQUM7b0JBQ25CLHFCQUFNLGNBQUksQ0FBQyxnQkFBZ0IsQ0FBQyxJQUFJLENBQUMsRUFBQTs7b0JBQXhDLElBQUksR0FBRyxTQUFpQztvQkFFeEMsR0FBRyxHQUFHLE9BQU8sQ0FBQyxxQkFBcUIsQ0FBQyxDQUFDO29CQUMzQyxHQUFHLENBQUMsTUFBTSxDQUFDLElBQUksRUFBRTt3QkFDZixPQUFPLENBQUMsR0FBRyxDQUFDLDJDQUFvQyxJQUFJLENBQUUsQ0FBQyxDQUFDO3dCQUN4RCxJQUFBLGNBQUksRUFBQywyQkFBb0IsSUFBSSxDQUFFLENBQUMsQ0FBQztvQkFDbkMsQ0FBQyxDQUFDLENBQUM7Ozs7U0FDSixDQUFDO0FBQ0osQ0FBQztBQUVELGlCQUFTLEdBQUcsQ0FBQyJ9