@serverless-devs/s 2.0.94 → 2.0.95-beta.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.
Files changed (35) hide show
  1. package/lib/clean/index.js +12 -12
  2. package/lib/cli/cli-manager.js +9 -9
  3. package/lib/cli/index.js +42 -42
  4. package/lib/component/index.js +81 -81
  5. package/lib/config/add/index.js +13 -13
  6. package/lib/config/delete/index.js +34 -34
  7. package/lib/config/get/index.js +20 -20
  8. package/lib/config/index.js +12 -12
  9. package/lib/core/command/command-manager.js +4 -4
  10. package/lib/core/component/hook.js +4 -4
  11. package/lib/core/component/index.js +9 -9
  12. package/lib/error/human-error.js +5 -5
  13. package/lib/error/human-warning.js +4 -4
  14. package/lib/error/index.js +9 -9
  15. package/lib/index.js +121 -101
  16. package/lib/init/index.js +97 -82
  17. package/lib/init/init-manager.js +11 -11
  18. package/lib/onboarding/index.js +5 -5
  19. package/lib/set/analysis/index.js +15 -15
  20. package/lib/set/index.js +12 -12
  21. package/lib/set/locale/index.js +26 -26
  22. package/lib/set/registry/index.js +26 -26
  23. package/lib/set/workspace/index.js +15 -15
  24. package/lib/specification/parse.js +10 -10
  25. package/lib/update-notifier/index.js +19 -19
  26. package/lib/utils/command-util.js +9 -9
  27. package/lib/utils/common.js +6 -6
  28. package/lib/utils/index.js +3 -3
  29. package/package.json +2 -2
  30. package/spec/zh/0.0.1/serverless_registry_model/2.overview_and_terminology.md +1 -1
  31. package/spec/zh/0.0.1/serverless_registry_model/3.registry_model.md +2 -2
  32. package/spec/zh/0.0.1/serverless_registry_model/5.design_principles.md +1 -1
  33. package/test/ci.sh +33 -0
  34. package/test/start-fc-http-nodejs12/code/index.js +47 -0
  35. package/test/start-fc-http-nodejs12/s.yaml +38 -0
@@ -32,38 +32,38 @@ function print() { __p += __j.call(arguments, '') }
32
32
  `:`;
33
33
  `)+A+`return __p
34
34
  }`;var W=hc(function(){return J(p,q+"return "+A).apply(n,g)});if(W.source=A,Po(W))throw W;return W}function oy(e){return Q(e).toLowerCase()}function uy(e){return Q(e).toUpperCase()}function ay(e,t,s){if(e=Q(e),e&&(s||t===n))return wa(e);if(!e||!(t=Ve(t)))return e;var l=ht(e),f=ht(t),p=ba(l,f),g=Ca(l,f)+1;return Qt(l,p,g).join("")}function ly(e,t,s){if(e=Q(e),e&&(s||t===n))return e.slice(0,xa(e)+1);if(!e||!(t=Ve(t)))return e;var l=ht(e),f=Ca(l,ht(t))+1;return Qt(l,0,f).join("")}function cy(e,t,s){if(e=Q(e),e&&(s||t===n))return e.replace(Ts,"");if(!e||!(t=Ve(t)))return e;var l=ht(e),f=ba(l,ht(t));return Qt(l,f).join("")}function fy(e,t){var s=It,l=sd;if(ae(t)){var f="separator"in t?t.separator:f;s="length"in t?G(t.length):s,l="omission"in t?Ve(t.omission):l}e=Q(e);var p=e.length;if(Pr(e)){var g=ht(e);p=g.length}if(s>=p)return e;var y=s-Lr(l);if(y<1)return l;var w=g?Qt(g,0,y).join(""):e.slice(0,y);if(f===n)return w+l;if(g&&(y+=w.length-y),Lo(f)){if(e.slice(y).search(f)){var x,O=w;for(f.global||(f=zs(f.source,Q(Wu.exec(f))+"g")),f.lastIndex=0;x=f.exec(O);)var A=x.index;w=w.slice(0,A===n?y:A)}}else if(e.indexOf(Ve(f),y)!=y){var T=w.lastIndexOf(f);T>-1&&(w=w.slice(0,T))}return w+l}function hy(e){return e=Q(e),e&&Cd.test(e)?e.replace(Hu,Ug):e}var py=Mr(function(e,t,s){return e+(s?" ":"")+t.toUpperCase()}),qo=pl("toUpperCase");function fc(e,t,s){return e=Q(e),t=s?n:t,t===n?$g(e)?Bg(e):Ag(e):e.match(t)||[]}var hc=k(function(e,t){try{return Be(e,n,t)}catch(s){return Po(s)?s:new j(s)}}),dy=qt(function(e,t){return Qe(t,function(s){s=Et(s),Dt(e,s,Io(e[s],e))}),e});function gy(e){var t=e==null?0:e.length,s=$();return e=t?ue(e,function(l){if(typeof l[1]!="function")throw new et(a);return[s(l[0]),l[1]]}):[],k(function(l){for(var f=-1;++f<t;){var p=e[f];if(Be(p[0],this,l))return Be(p[1],this,l)}})}function my(e){return Um(rt(e,c))}function $o(e){return function(){return e}}function vy(e,t){return e==null||e!==e?t:e}var _y=gl(),yy=gl(!0);function Ue(e){return e}function Fo(e){return ka(typeof e=="function"?e:rt(e,c))}function Ey(e){return za(rt(e,c))}function wy(e,t){return Xa(e,rt(t,c))}var by=k(function(e,t){return function(s){return yn(s,e,t)}}),Cy=k(function(e,t){return function(s){return yn(e,s,t)}});function Mo(e,t,s){var l=ye(t),f=Si(t,l);s==null&&!(ae(t)&&(f.length||!l.length))&&(s=t,t=e,e=this,f=Si(t,ye(t)));var p=!(ae(s)&&"chain"in s)||!!s.chain,g=Ft(e);return Qe(f,function(y){var w=t[y];e[y]=w,g&&(e.prototype[y]=function(){var x=this.__chain__;if(p||x){var O=e(this.__wrapped__),A=O.__actions__=Me(this.__actions__);return A.push({func:w,args:arguments,thisArg:e}),O.__chain__=x,O}return w.apply(e,Vt([this.value()],arguments))})}),e}function Sy(){return _e._===this&&(_e._=Kg),this}function jo(){}function xy(e){return e=G(e),k(function(t){return Ya(t,e)})}var Oy=mo(ue),Ay=mo(ma),Ry=mo(Hs);function pc(e){return Co(e)?Us(Et(e)):iv(e)}function Iy(e){return function(t){return e==null?n:cr(e,t)}}var Ty=vl(),Py=vl(!0);function Ho(){return[]}function Uo(){return!1}function Ly(){return{}}function Dy(){return""}function Ny(){return!0}function qy(e,t){if(e=G(e),e<1||e>Bt)return[];var s=vt,l=Oe(e,vt);t=$(t),e-=vt;for(var f=Bs(l,t);++s<e;)t(s);return f}function $y(e){return H(e)?ue(e,Et):ze(e)?[e]:Me(Dl(Q(e)))}function Fy(e){var t=++Xg;return Q(e)+t}var My=Ti(function(e,t){return e+t},0),jy=vo("ceil"),Hy=Ti(function(e,t){return e/t},1),Uy=vo("floor");function Gy(e){return e&&e.length?Ci(e,Ue,to):n}function Wy(e,t){return e&&e.length?Ci(e,$(t,2),to):n}function By(e){return ya(e,Ue)}function ky(e,t){return ya(e,$(t,2))}function Vy(e){return e&&e.length?Ci(e,Ue,so):n}function zy(e,t){return e&&e.length?Ci(e,$(t,2),so):n}var Xy=Ti(function(e,t){return e*t},1),Yy=vo("round"),Ky=Ti(function(e,t){return e-t},0);function Zy(e){return e&&e.length?Ws(e,Ue):0}function Jy(e,t){return e&&e.length?Ws(e,$(t,2)):0}return h.after=E0,h.ary=Bl,h.assign=u1,h.assignIn=ic,h.assignInWith=Wi,h.assignWith=a1,h.at=l1,h.before=kl,h.bind=Io,h.bindAll=dy,h.bindKey=Vl,h.castArray=L0,h.chain=Ul,h.chunk=Uv,h.compact=Gv,h.concat=Wv,h.cond=gy,h.conforms=my,h.constant=$o,h.countBy=Z_,h.create=c1,h.curry=zl,h.curryRight=Xl,h.debounce=Yl,h.defaults=f1,h.defaultsDeep=h1,h.defer=w0,h.delay=b0,h.difference=Bv,h.differenceBy=kv,h.differenceWith=Vv,h.drop=zv,h.dropRight=Xv,h.dropRightWhile=Yv,h.dropWhile=Kv,h.fill=Zv,h.filter=Q_,h.flatMap=r0,h.flatMapDeep=n0,h.flatMapDepth=i0,h.flatten=Fl,h.flattenDeep=Jv,h.flattenDepth=Qv,h.flip=C0,h.flow=_y,h.flowRight=yy,h.fromPairs=e_,h.functions=y1,h.functionsIn=E1,h.groupBy=s0,h.initial=r_,h.intersection=n_,h.intersectionBy=i_,h.intersectionWith=s_,h.invert=b1,h.invertBy=C1,h.invokeMap=u0,h.iteratee=Fo,h.keyBy=a0,h.keys=ye,h.keysIn=He,h.map=Fi,h.mapKeys=x1,h.mapValues=O1,h.matches=Ey,h.matchesProperty=wy,h.memoize=ji,h.merge=A1,h.mergeWith=sc,h.method=by,h.methodOf=Cy,h.mixin=Mo,h.negate=Hi,h.nthArg=xy,h.omit=R1,h.omitBy=I1,h.once=S0,h.orderBy=l0,h.over=Oy,h.overArgs=x0,h.overEvery=Ay,h.overSome=Ry,h.partial=To,h.partialRight=Kl,h.partition=c0,h.pick=T1,h.pickBy=oc,h.property=pc,h.propertyOf=Iy,h.pull=l_,h.pullAll=jl,h.pullAllBy=c_,h.pullAllWith=f_,h.pullAt=h_,h.range=Ty,h.rangeRight=Py,h.rearg=O0,h.reject=p0,h.remove=p_,h.rest=A0,h.reverse=Ao,h.sampleSize=g0,h.set=L1,h.setWith=D1,h.shuffle=m0,h.slice=d_,h.sortBy=y0,h.sortedUniq=w_,h.sortedUniqBy=b_,h.split=ry,h.spread=R0,h.tail=C_,h.take=S_,h.takeRight=x_,h.takeRightWhile=O_,h.takeWhile=A_,h.tap=G_,h.throttle=I0,h.thru=$i,h.toArray=tc,h.toPairs=uc,h.toPairsIn=ac,h.toPath=$y,h.toPlainObject=nc,h.transform=N1,h.unary=T0,h.union=R_,h.unionBy=I_,h.unionWith=T_,h.uniq=P_,h.uniqBy=L_,h.uniqWith=D_,h.unset=q1,h.unzip=Ro,h.unzipWith=Hl,h.update=$1,h.updateWith=F1,h.values=Ur,h.valuesIn=M1,h.without=N_,h.words=fc,h.wrap=P0,h.xor=q_,h.xorBy=$_,h.xorWith=F_,h.zip=M_,h.zipObject=j_,h.zipObjectDeep=H_,h.zipWith=U_,h.entries=uc,h.entriesIn=ac,h.extend=ic,h.extendWith=Wi,Mo(h,h),h.add=My,h.attempt=hc,h.camelCase=G1,h.capitalize=lc,h.ceil=jy,h.clamp=j1,h.clone=D0,h.cloneDeep=q0,h.cloneDeepWith=$0,h.cloneWith=N0,h.conformsTo=F0,h.deburr=cc,h.defaultTo=vy,h.divide=Hy,h.endsWith=W1,h.eq=dt,h.escape=B1,h.escapeRegExp=k1,h.every=J_,h.find=e0,h.findIndex=ql,h.findKey=p1,h.findLast=t0,h.findLastIndex=$l,h.findLastKey=d1,h.floor=Uy,h.forEach=Gl,h.forEachRight=Wl,h.forIn=g1,h.forInRight=m1,h.forOwn=v1,h.forOwnRight=_1,h.get=Do,h.gt=M0,h.gte=j0,h.has=w1,h.hasIn=No,h.head=Ml,h.identity=Ue,h.includes=o0,h.indexOf=t_,h.inRange=H1,h.invoke=S1,h.isArguments=pr,h.isArray=H,h.isArrayBuffer=H0,h.isArrayLike=je,h.isArrayLikeObject=ce,h.isBoolean=U0,h.isBuffer=er,h.isDate=G0,h.isElement=W0,h.isEmpty=B0,h.isEqual=k0,h.isEqualWith=V0,h.isError=Po,h.isFinite=z0,h.isFunction=Ft,h.isInteger=Zl,h.isLength=Ui,h.isMap=Jl,h.isMatch=X0,h.isMatchWith=Y0,h.isNaN=K0,h.isNative=Z0,h.isNil=Q0,h.isNull=J0,h.isNumber=Ql,h.isObject=ae,h.isObjectLike=le,h.isPlainObject=xn,h.isRegExp=Lo,h.isSafeInteger=e1,h.isSet=ec,h.isString=Gi,h.isSymbol=ze,h.isTypedArray=Hr,h.isUndefined=t1,h.isWeakMap=r1,h.isWeakSet=n1,h.join=o_,h.kebabCase=V1,h.last=it,h.lastIndexOf=u_,h.lowerCase=z1,h.lowerFirst=X1,h.lt=i1,h.lte=s1,h.max=Gy,h.maxBy=Wy,h.mean=By,h.meanBy=ky,h.min=Vy,h.minBy=zy,h.stubArray=Ho,h.stubFalse=Uo,h.stubObject=Ly,h.stubString=Dy,h.stubTrue=Ny,h.multiply=Xy,h.nth=a_,h.noConflict=Sy,h.noop=jo,h.now=Mi,h.pad=Y1,h.padEnd=K1,h.padStart=Z1,h.parseInt=J1,h.random=U1,h.reduce=f0,h.reduceRight=h0,h.repeat=Q1,h.replace=ey,h.result=P1,h.round=Yy,h.runInContext=E,h.sample=d0,h.size=v0,h.snakeCase=ty,h.some=_0,h.sortedIndex=g_,h.sortedIndexBy=m_,h.sortedIndexOf=v_,h.sortedLastIndex=__,h.sortedLastIndexBy=y_,h.sortedLastIndexOf=E_,h.startCase=ny,h.startsWith=iy,h.subtract=Ky,h.sum=Zy,h.sumBy=Jy,h.template=sy,h.times=qy,h.toFinite=Mt,h.toInteger=G,h.toLength=rc,h.toLower=oy,h.toNumber=st,h.toSafeInteger=o1,h.toString=Q,h.toUpper=uy,h.trim=ay,h.trimEnd=ly,h.trimStart=cy,h.truncate=fy,h.unescape=hy,h.uniqueId=Fy,h.upperCase=py,h.upperFirst=qo,h.each=Gl,h.eachRight=Wl,h.first=Ml,Mo(h,function(){var e={};return _t(h,function(t,s){ee.call(h.prototype,s)||(e[s]=t)}),e}(),{chain:!1}),h.VERSION=r,Qe(["bind","bindKey","curry","curryRight","partial","partialRight"],function(e){h[e].placeholder=h}),Qe(["drop","take"],function(e,t){z.prototype[e]=function(s){s=s===n?1:me(G(s),0);var l=this.__filtered__&&!t?new z(this):this.clone();return l.__filtered__?l.__takeCount__=Oe(s,l.__takeCount__):l.__views__.push({size:Oe(s,vt),type:e+(l.__dir__<0?"Right":"")}),l},z.prototype[e+"Right"]=function(s){return this.reverse()[e](s).reverse()}}),Qe(["filter","map","takeWhile"],function(e,t){var s=t+1,l=s==Fu||s==ld;z.prototype[e]=function(f){var p=this.clone();return p.__iteratees__.push({iteratee:$(f,3),type:s}),p.__filtered__=p.__filtered__||l,p}}),Qe(["head","last"],function(e,t){var s="take"+(t?"Right":"");z.prototype[e]=function(){return this[s](1).value()[0]}}),Qe(["initial","tail"],function(e,t){var s="drop"+(t?"":"Right");z.prototype[e]=function(){return this.__filtered__?new z(this):this[s](1)}}),z.prototype.compact=function(){return this.filter(Ue)},z.prototype.find=function(e){return this.filter(e).head()},z.prototype.findLast=function(e){return this.reverse().find(e)},z.prototype.invokeMap=k(function(e,t){return typeof e=="function"?new z(this):this.map(function(s){return yn(s,e,t)})}),z.prototype.reject=function(e){return this.filter(Hi($(e)))},z.prototype.slice=function(e,t){e=G(e);var s=this;return s.__filtered__&&(e>0||t<0)?new z(s):(e<0?s=s.takeRight(-e):e&&(s=s.drop(e)),t!==n&&(t=G(t),s=t<0?s.dropRight(-t):s.take(t-e)),s)},z.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},z.prototype.toArray=function(){return this.take(vt)},_t(z.prototype,function(e,t){var s=/^(?:filter|find|map|reject)|While$/.test(t),l=/^(?:head|last)$/.test(t),f=h[l?"take"+(t=="last"?"Right":""):t],p=l||/^find/.test(t);!f||(h.prototype[t]=function(){var g=this.__wrapped__,y=l?[1]:arguments,w=g instanceof z,x=y[0],O=w||H(g),A=function(V){var X=f.apply(h,Vt([V],y));return l&&T?X[0]:X};O&&s&&typeof x=="function"&&x.length!=1&&(w=O=!1);var T=this.__chain__,q=!!this.__actions__.length,F=p&&!T,W=w&&!q;if(!p&&O){g=W?g:new z(this);var M=e.apply(g,y);return M.__actions__.push({func:$i,args:[A],thisArg:n}),new tt(M,T)}return F&&W?e.apply(this,y):(M=this.thru(A),F?l?M.value()[0]:M.value():M)})}),Qe(["pop","push","shift","sort","splice","unshift"],function(e){var t=ai[e],s=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",l=/^(?:pop|shift)$/.test(e);h.prototype[e]=function(){var f=arguments;if(l&&!this.__chain__){var p=this.value();return t.apply(H(p)?p:[],f)}return this[s](function(g){return t.apply(H(g)?g:[],f)})}}),_t(z.prototype,function(e,t){var s=h[t];if(s){var l=s.name+"";ee.call(qr,l)||(qr[l]=[]),qr[l].push({name:t,func:s})}}),qr[Ii(n,oe).name]=[{name:"wrapper",func:n}],z.prototype.clone=hm,z.prototype.reverse=pm,z.prototype.value=dm,h.prototype.at=W_,h.prototype.chain=B_,h.prototype.commit=k_,h.prototype.next=V_,h.prototype.plant=X_,h.prototype.reverse=Y_,h.prototype.toJSON=h.prototype.valueOf=h.prototype.value=K_,h.prototype.first=h.prototype.head,hn&&(h.prototype[hn]=z_),h},Xt=kg();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(_e._=Xt,define(function(){return Xt})):sr?((sr.exports=Xt)._=Xt,$s._=Xt):_e._=Xt}).call(kr)});var os=I(Gt=>{"use strict";var xh=Gt&&Gt.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(Gt,"__esModule",{value:!0});Gt.getHistoryFile=Gt.getHomeDir=void 0;var hb=xh(require("path")),Oh=xh(Te()),ss=Oh.default.fse,pb=Oh.default.getRootHome;function su(){var n=pb();return ss.existsSync(n)||ss.mkdirSync(n),n}Gt.getHomeDir=su;function Ah(){var n=hb.default.join(su(),"history");return ss.existsSync(n)||ss.createFileSync(n),n}Gt.getHistoryFile=Ah;Gt.default={getHomeDir:su,getHistoryFile:Ah}});var as=I($e=>{"use strict";var db=$e&&$e.__awaiter||function(n,r,i,o){function a(u){return u instanceof i?u:new i(function(d){d(u)})}return new(i||(i=Promise))(function(u,d){function m(v){try{c(o.next(v))}catch(C){d(C)}}function _(v){try{c(o.throw(v))}catch(C){d(C)}}function c(v){v.done?u(v.value):a(v.value).then(m,_)}c((o=o.apply(n,r||[])).next())})},gb=$e&&$e.__generator||function(n,r){var i={label:0,sent:function(){if(u[0]&1)throw u[1];return u[1]},trys:[],ops:[]},o,a,u,d;return d={next:m(0),throw:m(1),return:m(2)},typeof Symbol=="function"&&(d[Symbol.iterator]=function(){return this}),d;function m(c){return function(v){return _([c,v])}}function _(c){if(o)throw new TypeError("Generator is already executing.");for(;i;)try{if(o=1,a&&(u=c[0]&2?a.return:c[0]?a.throw||((u=a.return)&&u.call(a),0):a.next)&&!(u=u.call(a,c[1])).done)return u;switch(a=0,u&&(c=[c[0]&2,u.value]),c[0]){case 0:case 1:u=c;break;case 4:return i.label++,{value:c[1],done:!1};case 5:i.label++,a=c[1],c=[0];continue;case 7:c=i.ops.pop(),i.trys.pop();continue;default:if(u=i.trys,!(u=u.length>0&&u[u.length-1])&&(c[0]===6||c[0]===2)){i=0;continue}if(c[0]===3&&(!u||c[1]>u[0]&&c[1]<u[3])){i.label=c[1];break}if(c[0]===6&&i.label<u[1]){i.label=u[1],u=c;break}if(u&&i.label<u[2]){i.label=u[2],i.ops.push(c);break}u[2]&&i.ops.pop(),i.trys.pop();continue}c=r.call(n,i)}catch(v){c=[6,v],a=0}finally{o=u=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}},ou=$e&&$e.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty($e,"__esModule",{value:!0});$e.handlerProfileFile=$e.getConfig=$e.setConfig=void 0;var Rh=ou(require("path")),mb=ou(os()),uu=ou(Te()),wt=uu.default.fse,us=uu.default.jsyaml,Ih=uu.default.getRootHome;function vb(n){var r=Ph();wt.writeFileSync(r,us.dump(n))}function Th(){var n=Ph();if(!wt.existsSync(n))return{};try{var r=us.load(wt.readFileSync(n,"utf8"))||{};return r}catch(i){throw i}}function Ph(){var n=Rh.default.join(mb.default.getHomeDir(),"set-config.yml");return wt.existsSync(n)||wt.createFileSync(n),n}function Lh(n,r){var i=Th();i[n]=r,vb(i)}$e.setConfig=Lh;function Dh(n,r){var i=Th();return i[n]||r}$e.getConfig=Dh;function Nh(n){return db(this,void 0,void 0,function(){var r,i,o,a,u,d,m;return gb(this,function(_){switch(_.label){case 0:if(r=n.filePath||"set-config.yml",i=Rh.default.join(Ih(),r),o=wt.existsSync(i),a={},o)return[3,5];u=Ih(),_.label=1;case 1:return _.trys.push([1,2,,4]),wt.statSync(u),[3,4];case 2:return d=_.sent(),[4,wt.mkdirSync(u)];case 3:return _.sent(),[3,4];case 4:return[3,6];case 5:try{a=us.load(wt.readFileSync(i,"utf8"))||{}}catch(c){throw c}_.label=6;case 6:return n.read?[2,a]:(m=n.configKey||"",a[m]=n.data,[4,wt.writeFileSync(i,us.dump(a))]);case 7:return _.sent(),[2,a]}})})}$e.handlerProfileFile=Nh;$e.default={setConfig:Lh,getConfig:Dh,handlerProfileFile:Nh}});var br=I(Vr=>{"use strict";var _b=Vr&&Vr.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(Vr,"__esModule",{value:!0});Vr.ServerlessError=void 0;var yb=_b(Te()),Eb=yb.default.Logger,wb=new Eb("S-CLI-ERROR"),bb=function(){function n(r,i,o){wb.error(r+": "+i,o),process.exit(1)}return n}();Vr.ServerlessError=bb});var qh=I(zr=>{"use strict";var Cb=zr&&zr.__extends||function(){var n=function(r,i){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,a){o.__proto__=a}||function(o,a){for(var u in a)Object.prototype.hasOwnProperty.call(a,u)&&(o[u]=a[u])},n(r,i)};return function(r,i){if(typeof i!="function"&&i!==null)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");n(r,i);function o(){this.constructor=r}r.prototype=i===null?Object.create(i):(o.prototype=i.prototype,new o)}}();Object.defineProperty(zr,"__esModule",{value:!0});zr.CommandError=void 0;var Sb=br(),xb=function(n){Cb(r,n);function r(i,o){return n.call(this,"Error",i,o)||this}return r}(Sb.ServerlessError);zr.CommandError=xb});var $h=I(Xr=>{"use strict";var Ob=Xr&&Xr.__extends||function(){var n=function(r,i){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,a){o.__proto__=a}||function(o,a){for(var u in a)Object.prototype.hasOwnProperty.call(a,u)&&(o[u]=a[u])},n(r,i)};return function(r,i){if(typeof i!="function"&&i!==null)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");n(r,i);function o(){this.constructor=r}r.prototype=i===null?Object.create(i):(o.prototype=i.prototype,new o)}}();Object.defineProperty(Xr,"__esModule",{value:!0});Xr.ConfigDeleteError=void 0;var Ab=br(),Rb=function(n){Ob(r,n);function r(i,o){return n.call(this,"Deletion failed",i,o)||this}return r}(Ab.ServerlessError);Xr.ConfigDeleteError=Rb});var Fh=I(Yr=>{"use strict";var Ib=Yr&&Yr.__extends||function(){var n=function(r,i){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,a){o.__proto__=a}||function(o,a){for(var u in a)Object.prototype.hasOwnProperty.call(a,u)&&(o[u]=a[u])},n(r,i)};return function(r,i){if(typeof i!="function"&&i!==null)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");n(r,i);function o(){this.constructor=r}r.prototype=i===null?Object.create(i):(o.prototype=i.prototype,new o)}}();Object.defineProperty(Yr,"__esModule",{value:!0});Yr.ConfigError=void 0;var Tb=br(),Pb=function(n){Ib(r,n);function r(i,o){return n.call(this,"Config failed",i,o)||this}return r}(Tb.ServerlessError);Yr.ConfigError=Pb});var Mh=I(Kr=>{"use strict";var Lb=Kr&&Kr.__extends||function(){var n=function(r,i){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,a){o.__proto__=a}||function(o,a){for(var u in a)Object.prototype.hasOwnProperty.call(a,u)&&(o[u]=a[u])},n(r,i)};return function(r,i){if(typeof i!="function"&&i!==null)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");n(r,i);function o(){this.constructor=r}r.prototype=i===null?Object.create(i):(o.prototype=i.prototype,new o)}}();Object.defineProperty(Kr,"__esModule",{value:!0});Kr.ConfigGetError=void 0;var Db=br(),Nb=function(n){Lb(r,n);function r(i,o){return n.call(this,"Get failed",i,o)||this}return r}(Db.ServerlessError);Kr.ConfigGetError=Nb});var jh=I(Zr=>{"use strict";var qb=Zr&&Zr.__extends||function(){var n=function(r,i){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,a){o.__proto__=a}||function(o,a){for(var u in a)Object.prototype.hasOwnProperty.call(a,u)&&(o[u]=a[u])},n(r,i)};return function(r,i){if(typeof i!="function"&&i!==null)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");n(r,i);function o(){this.constructor=r}r.prototype=i===null?Object.create(i):(o.prototype=i.prototype,new o)}}();Object.defineProperty(Zr,"__esModule",{value:!0});Zr.InitError=void 0;var $b=br(),Fb=function(n){qb(r,n);function r(i,o){return n.call(this,"Initialization failed",i,o)||this}return r}($b.ServerlessError);Zr.InitError=Fb});var Uh=I(bt=>{"use strict";var Mb=bt&&bt.__awaiter||function(n,r,i,o){function a(u){return u instanceof i?u:new i(function(d){d(u)})}return new(i||(i=Promise))(function(u,d){function m(v){try{c(o.next(v))}catch(C){d(C)}}function _(v){try{c(o.throw(v))}catch(C){d(C)}}function c(v){v.done?u(v.value):a(v.value).then(m,_)}c((o=o.apply(n,r||[])).next())})},jb=bt&&bt.__generator||function(n,r){var i={label:0,sent:function(){if(u[0]&1)throw u[1];return u[1]},trys:[],ops:[]},o,a,u,d;return d={next:m(0),throw:m(1),return:m(2)},typeof Symbol=="function"&&(d[Symbol.iterator]=function(){return this}),d;function m(c){return function(v){return _([c,v])}}function _(c){if(o)throw new TypeError("Generator is already executing.");for(;i;)try{if(o=1,a&&(u=c[0]&2?a.return:c[0]?a.throw||((u=a.return)&&u.call(a),0):a.next)&&!(u=u.call(a,c[1])).done)return u;switch(a=0,u&&(c=[c[0]&2,u.value]),c[0]){case 0:case 1:u=c;break;case 4:return i.label++,{value:c[1],done:!1};case 5:i.label++,a=c[1],c=[0];continue;case 7:c=i.ops.pop(),i.trys.pop();continue;default:if(u=i.trys,!(u=u.length>0&&u[u.length-1])&&(c[0]===6||c[0]===2)){i=0;continue}if(c[0]===3&&(!u||c[1]>u[0]&&c[1]<u[3])){i.label=c[1];break}if(c[0]===6&&i.label<u[1]){i.label=u[1],u=c;break}if(u&&i.label<u[2]){i.label=u[2],i.ops.push(c);break}u[2]&&i.ops.pop(),i.trys.pop();continue}c=r.call(n,i)}catch(v){c=[6,v],a=0}finally{o=u=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}},Hb=bt&&bt.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(bt,"__esModule",{value:!0});bt.HumanError=void 0;var Hh=Hb(Te()),Ub=rr(),Gb=Hh.default.colors,Wb=function(){function n(r){var i=r.errorMessage,o=r.tips;this.errorMessage=i,console.log(`
35
- `.concat((0,Ub.bgRed)("ERROR:"))),console.log("TypeError: ".concat(i,`
36
- `)),console.log("".concat(Gb.gray(o),`
37
- `))}return n.prototype.report=function(r){return Mb(this,void 0,void 0,function(){var i;return jb(this,function(o){switch(o.label){case 0:return i=r.error,[4,Hh.default.report({type:"jsError",content:"".concat(this.errorMessage,"||").concat(i.stack)})];case 1:return o.sent(),[2]}})})},n}();bt.HumanError=Wb});var Wh=I(Jr=>{"use strict";var Bb=Jr&&Jr.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(Jr,"__esModule",{value:!0});Jr.HumanWarning=void 0;var kb=Bb(Te()),Gh=kb.default.colors,Vb=function(){function n(r){var i=r.warningMessage,o=r.tips;console.log(`
38
- `.concat(Gh.hex("#000").bgYellow("WARNING:"))),console.log("".concat(i,`
39
- `)),o&&console.log("".concat(Gh.gray(o),`
40
- `))}return n}();Jr.HumanWarning=Vb});var Qr=I(ie=>{"use strict";var zb=ie&&ie.__awaiter||function(n,r,i,o){function a(u){return u instanceof i?u:new i(function(d){d(u)})}return new(i||(i=Promise))(function(u,d){function m(v){try{c(o.next(v))}catch(C){d(C)}}function _(v){try{c(o.throw(v))}catch(C){d(C)}}function c(v){v.done?u(v.value):a(v.value).then(m,_)}c((o=o.apply(n,r||[])).next())})},Xb=ie&&ie.__generator||function(n,r){var i={label:0,sent:function(){if(u[0]&1)throw u[1];return u[1]},trys:[],ops:[]},o,a,u,d;return d={next:m(0),throw:m(1),return:m(2)},typeof Symbol=="function"&&(d[Symbol.iterator]=function(){return this}),d;function m(c){return function(v){return _([c,v])}}function _(c){if(o)throw new TypeError("Generator is already executing.");for(;i;)try{if(o=1,a&&(u=c[0]&2?a.return:c[0]?a.throw||((u=a.return)&&u.call(a),0):a.next)&&!(u=u.call(a,c[1])).done)return u;switch(a=0,u&&(c=[c[0]&2,u.value]),c[0]){case 0:case 1:u=c;break;case 4:return i.label++,{value:c[1],done:!1};case 5:i.label++,a=c[1],c=[0];continue;case 7:c=i.ops.pop(),i.trys.pop();continue;default:if(u=i.trys,!(u=u.length>0&&u[u.length-1])&&(c[0]===6||c[0]===2)){i=0;continue}if(c[0]===3&&(!u||c[1]>u[0]&&c[1]<u[3])){i.label=c[1];break}if(c[0]===6&&i.label<u[1]){i.label=u[1],u=c;break}if(u&&i.label<u[2]){i.label=u[2],i.ops.push(c);break}u[2]&&i.ops.pop(),i.trys.pop();continue}c=r.call(n,i)}catch(v){c=[6,v],a=0}finally{o=u=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}},Yb=ie&&ie.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(ie,"__esModule",{value:!0});ie.HandleError=ie.HumanWarning=ie.HumanError=ie.ServerlessError=ie.InitError=ie.ConfigGetError=ie.ConfigError=ie.ConfigDeleteError=ie.CommandError=void 0;var au=rr(),Kb=as(),lu=Yb(Te()),Cr=lu.default.colors,Zb=lu.default.report,Jb=lu.default.getMAC,Qb=qh();Object.defineProperty(ie,"CommandError",{enumerable:!0,get:function(){return Qb.CommandError}});var eC=$h();Object.defineProperty(ie,"ConfigDeleteError",{enumerable:!0,get:function(){return eC.ConfigDeleteError}});var tC=Fh();Object.defineProperty(ie,"ConfigError",{enumerable:!0,get:function(){return tC.ConfigError}});var rC=Mh();Object.defineProperty(ie,"ConfigGetError",{enumerable:!0,get:function(){return rC.ConfigGetError}});var nC=jh();Object.defineProperty(ie,"InitError",{enumerable:!0,get:function(){return nC.InitError}});var iC=br();Object.defineProperty(ie,"ServerlessError",{enumerable:!0,get:function(){return iC.ServerlessError}});var sC=Uh();Object.defineProperty(ie,"HumanError",{enumerable:!0,get:function(){return sC.HumanError}});var oC=Wh();Object.defineProperty(ie,"HumanWarning",{enumerable:!0,get:function(){return oC.HumanWarning}});function uC(){try{return Jb().replace(/:/g,"")}catch{return"unknown"}}function cu(n,r){return"".concat(Cr.gray(n)).concat(Cr.gray.underline(r))}var aC=function(){function n(r){var i=r.error,o=r.prefix,a=o===void 0?"Message:":o;this.traceId="".concat(uC()).concat(Date.now()),console.log((0,au.red)("\u2716 ".concat(a,`
41
- `)));var u=(0,Kb.getConfig)("analysis");u!=="disable"&&console.log(Cr.gray("TraceId: ".concat(this.traceId))),console.log(Cr.gray("Environment: ".concat((0,au.getVersion)()))),console.log(cu("Documents: ","https://www.serverless-devs.com")),console.log(cu("Discussions: ","https://github.com/Serverless-Devs/Serverless-Devs/discussions")),console.log(cu("Issues: ",`https://github.com/Serverless-Devs/Serverless-Devs/issues
42
- `)),console.log("".concat((0,au.bgRed)("ERROR:"),`
43
- `).concat(i,`
44
- `)),u!=="disable"&&console.log(Cr.gray("Please copy traceId: ".concat(this.traceId," and join Dingding group: 33947367 for consultation."))),console.log(Cr.gray("You can run 's clean --cache' to prune Serverless devs.")),console.log(Cr.gray(`And run again with the '--debug' option or 's -h' to get more logs.
45
- `))}return n.prototype.report=function(r){return zb(this,void 0,void 0,function(){return Xb(this,function(i){return Zb({type:"jsError",content:"".concat(r.message,"||").concat(r.stack),traceId:this.traceId}),[2]})})},n}();ie.HandleError=aC});var Bh=I((Gx,lC)=>{lC.exports={name:"@serverless-devs/s",version:"2.0.94",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:"MIT",repository:{type:"git",url:"https://github.com/Serverless-Devs/Serverless-Devs"},bugs:{url:"https://github.com/Serverless-Devs/Serverless-Devs/issues"},scripts:{prewatch:"rm -rf lib/* && cp -r ./src/daemon ./lib",watch:"tsc -w",test:"npx jest",prebuild:"rm -rf lib",build:"tsc && cp -r ./src/daemon ./lib",postbuild:"./shell/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"},main:"./lib/index.js",bin:{s:"bin/s"},devDependencies:{"@types/jest":"^27.0.1","@types/lodash":"^4.14.168","@types/node":"^14.0.23","@typescript-eslint/eslint-plugin":"^4.14.1","@typescript-eslint/parser":"^4.14.1","babel-eslint":"^10.1.0",boxen:"^5.0.0",commander:"^6.0.0",dotenv:"^10.0.0",esbuild:"^0.13.6",eslint:"^7.7.0","eslint-config-prettier":"^7.2.0","eslint-plugin-import":"^2.20.1","eslint-plugin-prettier":"^3.1.2",husky:"^4.2.3",inquirer:"^8.2.0","inquirer-autocomplete-prompt":"^1.3.0",jest:"^27.1.0","latest-version":"^5.1.0","lint-staged":"^10.0.8",lodash:"^4.17.20","os-locale":"5.0.0",prettier:"^2.2.1",semver:"^7.3.5","semver-diff":"^3.1.1","ts-jest":"^27.0.1","ts-node":"^9.1.1","tty-table":"^4.1.5",typescript:"^4.1.3"},"lint-staged":{"**/*.{js,jsx,ts}":"f2elint exec eslint"},jest:{coverageDirectory:"coverage",testEnvironment:"node",coverageProvider:"v8",preset:"ts-jest",testMatch:["**/test/**/*test.[jt]s"],setupFilesAfterEnv:["./jest.setup.ts"]},dependencies:{"@serverless-devs/core":"latest"}}});var rr=I(U=>{"use strict";var cC=U&&U.__createBinding||(Object.create?function(n,r,i,o){o===void 0&&(o=i),Object.defineProperty(n,o,{enumerable:!0,get:function(){return r[i]}})}:function(n,r,i,o){o===void 0&&(o=i),n[o]=r[i]}),fC=U&&U.__setModuleDefault||(Object.create?function(n,r){Object.defineProperty(n,"default",{enumerable:!0,value:r})}:function(n,r){n.default=r}),hC=U&&U.__importStar||function(n){if(n&&n.__esModule)return n;var r={};if(n!=null)for(var i in n)i!=="default"&&Object.prototype.hasOwnProperty.call(n,i)&&cC(r,n,i);return fC(r,n),r},kh=U&&U.__awaiter||function(n,r,i,o){function a(u){return u instanceof i?u:new i(function(d){d(u)})}return new(i||(i=Promise))(function(u,d){function m(v){try{c(o.next(v))}catch(C){d(C)}}function _(v){try{c(o.throw(v))}catch(C){d(C)}}function c(v){v.done?u(v.value):a(v.value).then(m,_)}c((o=o.apply(n,r||[])).next())})},Vh=U&&U.__generator||function(n,r){var i={label:0,sent:function(){if(u[0]&1)throw u[1];return u[1]},trys:[],ops:[]},o,a,u,d;return d={next:m(0),throw:m(1),return:m(2)},typeof Symbol=="function"&&(d[Symbol.iterator]=function(){return this}),d;function m(c){return function(v){return _([c,v])}}function _(c){if(o)throw new TypeError("Generator is already executing.");for(;i;)try{if(o=1,a&&(u=c[0]&2?a.return:c[0]?a.throw||((u=a.return)&&u.call(a),0):a.next)&&!(u=u.call(a,c[1])).done)return u;switch(a=0,u&&(c=[c[0]&2,u.value]),c[0]){case 0:case 1:u=c;break;case 4:return i.label++,{value:c[1],done:!1};case 5:i.label++,a=c[1],c=[0];continue;case 7:c=i.ops.pop(),i.trys.pop();continue;default:if(u=i.trys,!(u=u.length>0&&u[u.length-1])&&(c[0]===6||c[0]===2)){i=0;continue}if(c[0]===3&&(!u||c[1]>u[0]&&c[1]<u[3])){i.label=c[1];break}if(c[0]===6&&i.label<u[1]){i.label=u[1],u=c;break}if(u&&i.label<u[2]){i.label=u[2],i.ops.push(c);break}u[2]&&i.ops.pop(),i.trys.pop();continue}c=r.call(n,i)}catch(v){c=[6,v],a=0}finally{o=u=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}},ls=U&&U.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(U,"__esModule",{value:!0});U.emoji=U.mark=U.replaceTemplate=U.getTemplatekey=U.replaceFun=U.getLang=U.printn=U.checkTemplateFile=U.checkAndReturnTemplateFile=U.yamlLoad=U.getFolderSize=U.getVersion=U.bgRed=U.red=void 0;var we=ls(require("path")),Ke=ls(require("fs")),fu=ls(is()),pC=ls(require("os")),dC=Qr(),cs=hC(Te()),hu=cs.default.colors,gC=cs.default.jsyaml,fs=Bh();U.red=hu.hex("#fd5750");U.bgRed=hu.hex("#000").bgHex("#fd5750");function mC(){return(0,cs.getCoreVersion)()?"".concat(fs.name,": ").concat(fs.version,", @serverless-devs/core: ").concat((0,cs.getCoreVersion)(),", ").concat(process.platform,"-").concat(process.arch,", node-").concat(process.version):"".concat(fs.name,": ").concat(fs.version,", ").concat(process.platform,"-").concat(process.arch,", node-").concat(process.version)}U.getVersion=mC;function vC(n){return kh(this,void 0,void 0,function(){function r(a){return kh(this,void 0,void 0,function(){var u,d;return Vh(this,function(m){switch(m.label){case 0:return u=Ke.default.lstatSync(a),typeof u!="object"?[2]:(i.set(u.ino,u.size),u.isDirectory()?(d=Ke.default.readdirSync(a),typeof d!="object"?[2]:[4,Promise.all(d.map(function(_){return r(we.default.join(a,_))}))]):[3,2]);case 1:m.sent(),m.label=2;case 2:return[2]}})})}var i,o;return Vh(this,function(a){switch(a.label){case 0:return i=new Map,[4,r(n)];case 1:return a.sent(),o=Array.from(i.values()).reduce(function(u,d){return u+d},0),[2,o]}})})}U.getFolderSize=vC;function zh(n){var r=Ke.default.readFileSync(n,"utf8");try{return gC.load(r)}catch{if(["-h","--help"].includes(process.argv[2]))return;var i=we.default.basename(n);new dC.HumanError({errorMessage:"".concat(i," format is incorrect"),tips:"Please check the configuration of ".concat(i,", Serverless Devs' Yaml specification document can refer to\uFF1A").concat(hu.underline("https://github.com/Serverless-Devs/Serverless-Devs/blob/master/docs/zh/yaml.md"))}),process.exit(1)}}U.yamlLoad=zh;function Un(n,r){r===void 0&&(r=!1);var i=Ke.default.readFileSync(n,"utf8"),o=r?JSON.parse(i):zh(n);if(!o)return!1;for(var a in o)if(o[a].Component&&o[a].Provider&&o[a].Properties)return!0;return o.hasOwnProperty("edition")}function Xh(){if(process.env.serverless_devs_temp_template)return process.env.serverless_devs_temp_template;var n=process.cwd(),r=process.argv.includes("-t")?"-t":process.argv.includes("--template")?"--template":null,i=r?process.argv.indexOf(r):-1;if(i!==-1){var o=i+1,a=process.argv[o];if(a&&(a.endsWith(".yaml")||a.endsWith(".yml")||a.endsWith(".json"))){var u=!!a.endsWith(".json");if(Ke.default.existsSync(we.default.join(n,a))&&Un(we.default.join(n,a),u)){process.argv.splice(i,2);var d=JSON.parse(process.env.serverless_devs_temp_argv);return d.splice(d.indexOf(r),2),process.env.serverless_devs_temp_argv=JSON.stringify(d),process.env.serverless_devs_temp_template=we.default.join(n,a),we.default.join(n,a)}else if(Ke.default.existsSync(a)&&Un(a,u)){process.argv.splice(i,2);var d=JSON.parse(process.env.serverless_devs_temp_argv);return d.splice(d.indexOf(r),2),process.env.serverless_devs_temp_argv=JSON.stringify(d),process.env.serverless_devs_temp_template=a,a}}}return Ke.default.existsSync(we.default.join(n,"s.yaml"))&&Un(we.default.join(n,"s.yaml"))?(process.env.serverless_devs_temp_template=we.default.join(n,"s.yaml"),we.default.join(n,"s.yaml")):Ke.default.existsSync(we.default.join(n,"s.yml"))&&Un(we.default.join(n,"s.yml"))?(process.env.serverless_devs_temp_template=we.default.join(n,"s.yml"),we.default.join(n,"s.yml")):Ke.default.existsSync(we.default.join(n,"s.json"))&&Un(we.default.join(n,"s.json"),!0)?(process.env.serverless_devs_temp_template=we.default.join(n,"s.json"),we.default.join(n,"s.json")):null}U.checkAndReturnTemplateFile=Xh;function Yh(n){return Ke.default.existsSync(n)?n:null}U.checkTemplateFile=Yh;function Kh(n,r){r===void 0&&(r=" ");for(var i="",o=0;o<n;o++)i=i+r;return i}U.printn=Kh;function Zh(){return"en"}U.getLang=Zh;function pu(n,r){var i=/\{\{(.*?)\}\}/g,o=n.match(i);if(o)for(var a=0;a<o.length;a++){var u=o[a].replace(/{{|}}/g,""),d=fu.default.trim(u.split("|")[0]);r[d]&&(n=n.replace(o[a],r[d]))}return n}U.replaceFun=pu;function Jh(n){var r=/\{\{(.*?)\}\}/g,i=n.match(r);return i?i.filter(function(o){return o}).map(function(o){var a=o.replace(/{{|}}/g,""),u=a.split("|");return{name:fu.default.trim(u[0]),desc:fu.default.trim(u[1])}}):[]}U.getTemplatekey=Jh;function Qh(n,r){n.forEach(function(i){if(Ke.default.existsSync(i)){var o=Ke.default.readFileSync(i,"utf-8"),a=pu(o,r);Ke.default.writeFileSync(i,a,"utf-8")}})}U.replaceTemplate=Qh;function ep(n){if(!n)return n;var r=n.slice(-4);return"***********".concat(r)}U.mark=ep;function _C(n){return pC.default.platform()==="win32"?"":n}U.emoji=_C;U.default={checkAndReturnTemplateFile:Xh,checkTemplateFile:Yh,printn:Kh,mark:ep,getLang:Zh,replaceTemplate:Qh,replaceFun:pu,getTemplatekey:Jh}});var sp=I(Ze=>{"use strict";var yC=Ze&&Ze.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(Ze,"__esModule",{value:!0});Ze.extractTemplateInfo=Ze.isUrlFormat=Ze.getProjectNameFromUrl=Ze.parse=void 0;var EC=yC(require("url"));function tp(n){return EC.default.parse(n)}Ze.parse=tp;function rp(n){var r=n.lastIndexOf("/");return r&&r>=0&&(n=n.substr(r+1)),n.endsWith(".git")?n.substr(0,n.length-4):n}Ze.getProjectNameFromUrl=rp;function np(n){return n.includes(":")||n.includes("/")}Ze.isUrlFormat=np;function ip(n){var r=n.pathname||"",i=r.split("/"),o=i[1],a=i[3];return{host:n.host,ownerName:o,repoName:a,branch:"",hasSubPath:!1,subPath:"",zipFile:""}}Ze.extractTemplateInfo=ip;Ze.default={extractTemplateInfo:ip,getProjectNameFromUrl:rp,isUrlFormat:np,parse:tp}});var hs=I(Fe=>{"use strict";Object.defineProperty(Fe,"__esModule",{value:!0});Fe.getServiceList=Fe.getServiceActions=Fe.getServiceInputs=Fe.getServiceConfigDetail=Fe.getServiceConfig=Fe.getSubcommand=void 0;function op(n){var r=n.edition||"0.0.1";if(r==="0.0.1")return Object.keys(n).filter(function(o){return o!=="Global"});var i=n.services||{};return Object.keys(i)}Fe.getSubcommand=op;function up(n,r){var i=n.edition||"0.0.1";if(i==="0.0.1")return n[r];var o=n.services||{},a=o[r],u=a.provider?a.provider:n.provider,d=a.access?a.access:n.access,m=Object.assign({},a,{access:d,provider:u});return m}Fe.getServiceConfig=up;function ap(n){var r=n.Component||n.component,i=n.Provider||n.provider,o=n.Access||n.access||"default",a=n.autoCredential;return{name:r,provider:i,access:o,autoCredential:a}}Fe.getServiceConfigDetail=ap;function lp(n,r,i){if(r==="0.0.1"){var o=n.Properties,a=n.Params,u=n.Provider,d=n.Access,m=n.Component,_=n.ProjectName,c=i.credentials,v=i.method,C={Properties:o,Credentials:c,Project:{ProjectName:_,Component:m,Provider:u,AccessAlias:d||""},Command:v,Args:a||"",Path:{ConfigPath:process.env.templateFile||""}};return C}var R=n.props,P=n.params,Z=n.provider,oe=n.access,be=n.component,Y=n.ProjectName,lt=n.appName,ve=i.credentials,pe=i.method,xe={props:R,Properties:R,Credentials:ve,credentials:ve,appName:lt,Project:{ProjectName:Y,projectName:Y,component:be,Component:be,provider:Z,Provider:Z,accessAlias:oe||"",AccessAlias:oe||""},project:{component:be,access:oe||"",projectName:Y},command:pe,Command:pe,args:P||"",Args:P||"",argsObj:process.temp_params||[],ArgsObj:process.temp_params||[],path:{configPath:process.env.templateFile||""},Path:{ConfigPath:process.env.templateFile||""}};return xe}Fe.getServiceInputs=lp;function cp(n,r,i){var o=i.method;if(r==="0.0.1"){var a=n.Extends,u=a===void 0?{}:a,d=u[o];return d}var m=n.actions,_=m===void 0?{}:m,c=[];return Object.keys(_).forEach(function(v){var C=v.split("-"),R=_[v];if(C.length>1){var P=C[1];if(P===o){var Z=C[0];R.forEach(function(oe){var be={Hook:oe.run,Path:oe.path,Pre:Z==="pre"};c.push(be)})}}else v===o&&R.forEach(function(oe){var be={Hook:oe.run,Path:oe.path,Pre:!1};c.push(be)})}),c}Fe.getServiceActions=cp;function fp(n){var r=n.edition||"0.0.1";return r==="0.0.1"?n:n.services}Fe.getServiceList=fp;Fe.default={getSubcommand:op,getServiceConfig:up,getServiceConfigDetail:ap,getServiceInputs:lp,getServiceActions:cp,getServiceList:fp}});var _p=I(Pe=>{"use strict";var wC=Pe&&Pe.__createBinding||(Object.create?function(n,r,i,o){o===void 0&&(o=i),Object.defineProperty(n,o,{enumerable:!0,get:function(){return r[i]}})}:function(n,r,i,o){o===void 0&&(o=i),n[o]=r[i]}),bC=Pe&&Pe.__setModuleDefault||(Object.create?function(n,r){Object.defineProperty(n,"default",{enumerable:!0,value:r})}:function(n,r){n.default=r}),hp=Pe&&Pe.__importStar||function(n){if(n&&n.__esModule)return n;var r={};if(n!=null)for(var i in n)i!=="default"&&Object.prototype.hasOwnProperty.call(n,i)&&wC(r,n,i);return bC(r,n),r},pp=Pe&&Pe.__awaiter||function(n,r,i,o){function a(u){return u instanceof i?u:new i(function(d){d(u)})}return new(i||(i=Promise))(function(u,d){function m(v){try{c(o.next(v))}catch(C){d(C)}}function _(v){try{c(o.throw(v))}catch(C){d(C)}}function c(v){v.done?u(v.value):a(v.value).then(m,_)}c((o=o.apply(n,r||[])).next())})},dp=Pe&&Pe.__generator||function(n,r){var i={label:0,sent:function(){if(u[0]&1)throw u[1];return u[1]},trys:[],ops:[]},o,a,u,d;return d={next:m(0),throw:m(1),return:m(2)},typeof Symbol=="function"&&(d[Symbol.iterator]=function(){return this}),d;function m(c){return function(v){return _([c,v])}}function _(c){if(o)throw new TypeError("Generator is already executing.");for(;i;)try{if(o=1,a&&(u=c[0]&2?a.return:c[0]?a.throw||((u=a.return)&&u.call(a),0):a.next)&&!(u=u.call(a,c[1])).done)return u;switch(a=0,u&&(c=[c[0]&2,u.value]),c[0]){case 0:case 1:u=c;break;case 4:return i.label++,{value:c[1],done:!1};case 5:i.label++,a=c[1],c=[0];continue;case 7:c=i.ops.pop(),i.trys.pop();continue;default:if(u=i.trys,!(u=u.length>0&&u[u.length-1])&&(c[0]===6||c[0]===2)){i=0;continue}if(c[0]===3&&(!u||c[1]>u[0]&&c[1]<u[3])){i.label=c[1];break}if(c[0]===6&&i.label<u[1]){i.label=u[1],u=c;break}if(u&&i.label<u[2]){i.label=u[2],i.ops.push(c);break}u[2]&&i.ops.pop(),i.trys.pop();continue}c=r.call(n,i)}catch(v){c=[6,v],a=0}finally{o=u=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}},CC=Pe&&Pe.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(Pe,"__esModule",{value:!0});Pe.Parse=void 0;var du=hp(require("fs")),gp=hp(require("path")),SC=hs(),xC=Qr(),mp=is(),OC=CC(Te()),AC=OC.default.jsyaml,RC=is(),vp=new RegExp(/\$\{(.*)\}/,"i"),IC=new RegExp(/(.*)\((.*)\)/,"i"),TC=["[object Number]","[object Boolean]"],PC=function(){function n(r){if(this.path=r,this.parsedObj={},this.dependenciesMap={},this.globalJsonKeyMap={},this.globalKeyArr=[],this.magicVariablesArray=[],du.existsSync(r))try{this.init(r)}catch(i){throw new Error(i.message)}}return n.prototype.getFileObj=function(r){var i={};try{var o=gp.extname(r);(o.indexOf(".yaml")!==-1||o.indexOf(".yml")!==-1)&&(i=AC.load(du.readFileSync(r,"utf8"))),o.indexOf(".json")!==-1&&(i=JSON.parse(du.readFileSync(r).toString()))}catch(a){new xC.HandleError({error:a}).report(a).then(function(){return process.exit(1)})}return i},n.prototype.init=function(r){return pp(this,void 0,void 0,function(){return dp(this,function(i){return this.parsedObj=this.getFileObj(r),[2]})})},n.prototype.getOriginalParsedObj=function(){return this.parsedObj},n.prototype.findVariableValue=function(r){var i=r.variableName,o=r.type,a=r.funName,u=r.funVariable,d="";return o==="Literal"?this.globalJsonKeyMap[i]||this.globalJsonKeyMap["services.".concat(i)]||"${"+i+"}":o==="Fun"&&(a==="Env"||a==="env")?process.env[u]:o==="Fun"&&(a==="Path"||a==="path")?gp.join(process.cwd(),u):o==="Fun"&&(a==="File"||a==="file")?this.getFileObj(u):d},n.prototype.generateMagicVariables=function(r,i,o){var a=this;return i===void 0&&(i=[]),o===void 0&&(o=""),Object.prototype.toString.call(r)==="[object Object]"?(o!==""&&(o="".concat(o,".")),Object.keys(r).map(function(u){var d="".concat(o).concat(u),m=r[u];i.push(d),i.concat(a.generateMagicVariables(m,i,"".concat(d))),a.globalJsonKeyMap[d]=m})):Object.prototype.toString.call(r)==="[object Array]"?r.forEach(function(u,d){var m="".concat(o,"[").concat(d,"]"),_="".concat(o,"[").concat(d-r.length,"]");i.push(m),i.push(_),i.concat(a.generateMagicVariables(u,i,"".concat(m))),i.concat(a.generateMagicVariables(u,i,"".concat(_))),a.globalJsonKeyMap[m]=u,a.globalJsonKeyMap[_]=u}):i=[],i},n.prototype.isProjectProperties=function(r,i){var o=!1;return i==="Properties"&&this.globalJsonKeyMap["".concat(r,".").concat(i)]&&(o=!0),o},n.prototype.iteratorToSetValue=function(r,i,o){var a=this;if(TC.includes(Object.prototype.toString.call(r)))return r;if(Object.prototype.toString.call(r)==="[object String]"){var u=r.match(vp);if(u){var d=u[1],m={variableName:d,type:"Literal",funName:null,funVariable:""},_=d.match(IC);if(_)m.funName=_[1],m.funVariable=_[2],m.type="Fun";else{var c=this.dependenciesMap[i];c||(c={});var v=d.split(".")[0];c[v]=1,this.dependenciesMap[i]=c}var C=(0,mp.startsWith)(d,"env.")?(0,mp.get)(process,d):this.findVariableValue(m);return Object.prototype.toString.call(C)==="[object String]"?r.replace(vp,C):C}return(!this.dependenciesMap[i]||Object.keys(this.dependenciesMap[i]).length==0)&&(this.dependenciesMap[i]={}),r}if(Object.prototype.toString.call(r)==="[object Array]")return r.map(function(R){return a.iteratorToSetValue(R,i)});if(Object.prototype.toString.call(r)==="[object Object]")return Object.keys(r).forEach(function(R){r[R]=a.iteratorToSetValue(r[R],i,o||R)}),r},n.prototype.replaceVariable=function(r){var i=this,o=(0,SC.getServiceList)(r);return Object.keys(o).forEach(function(a){var u=o[a];o[a]=i.iteratorToSetValue(u,a)}),r.services?r.services=o:r=o,(0,RC.cloneDeep)(r)},n.prototype.getRealVariables=function(r){return pp(this,void 0,void 0,function(){return dp(this,function(i){return this.globalKeyArr=this.generateMagicVariables(r),[2,this.replaceVariable(r)]})})},n}();Pe.Parse=PC});var yp=I(ps=>{"use strict";Object.defineProperty(ps,"__esModule",{value:!0});ps.Analysis=void 0;var LC=function(){function n(r,i){this.parsedObj=r,this.dependenciesMap=i,this.componentOrderKeyMap={}}return n.prototype.getComponentOrderKeyMap=function(r){var i=this;r.forEach(function(o){i.componentOrderKeyMap[o]=1})},n.prototype.calculateOrderNumber=function(r){var i=this;r.forEach(function(o){var a=i.dependenciesMap[o];Object.keys(a).forEach(function(u){i.componentOrderKeyMap[u]&&(i.componentOrderKeyMap[u]+=a[u])})})},n.prototype.getProjectOrder=function(){var r=this,i=Object.keys(this.dependenciesMap).filter(function(a){return a!=="Global"});this.getComponentOrderKeyMap(i),this.calculateOrderNumber(i);var o=Object.keys(this.componentOrderKeyMap).map(function(a){return{name:a,order:r.componentOrderKeyMap[a]}});return o.sort(function(a,u){return u.order-a.order}).map(function(a){return a.name})},n}();ps.Analysis=LC});var ds=I(Ct=>{"use strict";var DC=Ct&&Ct.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(Ct,"__esModule",{value:!0});Ct.version=Ct.Analysis=Ct.Parse=void 0;var NC=_p();Object.defineProperty(Ct,"Parse",{enumerable:!0,get:function(){return NC.Parse}});var qC=yp();Object.defineProperty(Ct,"Analysis",{enumerable:!0,get:function(){return qC.Analysis}});var $C=hs();Object.defineProperty(Ct,"version",{enumerable:!0,get:function(){return DC($C).default}})});var gu=I(nr=>{"use strict";Object.defineProperty(nr,"__esModule",{value:!0});nr.UPDATE_CHECK_INTERVAL=nr.DEFAULT_REGIRSTRY=nr.PROCESS_ENV_TEMPLATE_NAME=void 0;nr.PROCESS_ENV_TEMPLATE_NAME="templateFile";nr.DEFAULT_REGIRSTRY="http://registry.devsapp.cn/simple";nr.UPDATE_CHECK_INTERVAL=1e3*60*60*12});var Ep=I(St=>{"use strict";var mu=St&&St.__awaiter||function(n,r,i,o){function a(u){return u instanceof i?u:new i(function(d){d(u)})}return new(i||(i=Promise))(function(u,d){function m(v){try{c(o.next(v))}catch(C){d(C)}}function _(v){try{c(o.throw(v))}catch(C){d(C)}}function c(v){v.done?u(v.value):a(v.value).then(m,_)}c((o=o.apply(n,r||[])).next())})},vu=St&&St.__generator||function(n,r){var i={label:0,sent:function(){if(u[0]&1)throw u[1];return u[1]},trys:[],ops:[]},o,a,u,d;return d={next:m(0),throw:m(1),return:m(2)},typeof Symbol=="function"&&(d[Symbol.iterator]=function(){return this}),d;function m(c){return function(v){return _([c,v])}}function _(c){if(o)throw new TypeError("Generator is already executing.");for(;i;)try{if(o=1,a&&(u=c[0]&2?a.return:c[0]?a.throw||((u=a.return)&&u.call(a),0):a.next)&&!(u=u.call(a,c[1])).done)return u;switch(a=0,u&&(c=[c[0]&2,u.value]),c[0]){case 0:case 1:u=c;break;case 4:return i.label++,{value:c[1],done:!1};case 5:i.label++,a=c[1],c=[0];continue;case 7:c=i.ops.pop(),i.trys.pop();continue;default:if(u=i.trys,!(u=u.length>0&&u[u.length-1])&&(c[0]===6||c[0]===2)){i=0;continue}if(c[0]===3&&(!u||c[1]>u[0]&&c[1]<u[3])){i.label=c[1];break}if(c[0]===6&&i.label<u[1]){i.label=u[1],u=c;break}if(u&&i.label<u[2]){i.label=u[2],i.ops.push(c);break}u[2]&&i.ops.pop(),i.trys.pop();continue}c=r.call(n,i)}catch(v){c=[6,v],a=0}finally{o=u=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}},_u=St&&St.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(St,"__esModule",{value:!0});St.PluginExeCute=void 0;var Gn=_u(require("fs")),yu=_u(require("path")),FC=_u(Te()),MC=FC.default.getRootHome,gs=yu.default.join(MC(),"plugins"),jC=function(){function n(r){this.pluginConfig=r,Gn.default.existsSync(gs)||Gn.default.mkdirSync(gs);var i=this.pluginConfig.name;this.pluginPath=yu.default.join(gs,i)}return n.prototype.init=function(){return mu(this,void 0,void 0,function(){var r;return vu(this,function(i){switch(i.label){case 0:return r=this.pluginConfig.name,this.pluginExist()?[3,2]:[4,this.downLoadPlugin(r)];case 1:i.sent(),i.label=2;case 2:return[2]}})})},n.prototype.pluginExist=function(){return Gn.default.existsSync(this.pluginPath)},n.prototype.downLoadPlugin=function(r){return mu(this,void 0,void 0,function(){var i;return vu(this,function(o){return i=yu.default.join(gs,r),Gn.default.existsSync(i)||Gn.default.mkdirSync(i),[2]})})},n.prototype.loadPlugin=function(){return mu(this,void 0,void 0,function(){var r;return vu(this,function(i){return r=require(this.pluginPath),[2,r]})})},n}();St.PluginExeCute=jC});var Cp=I(xt=>{"use strict";var Wn=xt&&xt.__awaiter||function(n,r,i,o){function a(u){return u instanceof i?u:new i(function(d){d(u)})}return new(i||(i=Promise))(function(u,d){function m(v){try{c(o.next(v))}catch(C){d(C)}}function _(v){try{c(o.throw(v))}catch(C){d(C)}}function c(v){v.done?u(v.value):a(v.value).then(m,_)}c((o=o.apply(n,r||[])).next())})},Bn=xt&&xt.__generator||function(n,r){var i={label:0,sent:function(){if(u[0]&1)throw u[1];return u[1]},trys:[],ops:[]},o,a,u,d;return d={next:m(0),throw:m(1),return:m(2)},typeof Symbol=="function"&&(d[Symbol.iterator]=function(){return this}),d;function m(c){return function(v){return _([c,v])}}function _(c){if(o)throw new TypeError("Generator is already executing.");for(;i;)try{if(o=1,a&&(u=c[0]&2?a.return:c[0]?a.throw||((u=a.return)&&u.call(a),0):a.next)&&!(u=u.call(a,c[1])).done)return u;switch(a=0,u&&(c=[c[0]&2,u.value]),c[0]){case 0:case 1:u=c;break;case 4:return i.label++,{value:c[1],done:!1};case 5:i.label++,a=c[1],c=[0];continue;case 7:c=i.ops.pop(),i.trys.pop();continue;default:if(u=i.trys,!(u=u.length>0&&u[u.length-1])&&(c[0]===6||c[0]===2)){i=0;continue}if(c[0]===3&&(!u||c[1]>u[0]&&c[1]<u[3])){i.label=c[1];break}if(c[0]===6&&i.label<u[1]){i.label=u[1],u=c;break}if(u&&i.label<u[2]){i.label=u[2],i.ops.push(c);break}u[2]&&i.ops.pop(),i.trys.pop();continue}c=r.call(n,i)}catch(v){c=[6,v],a=0}finally{o=u=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}},wp=xt&&xt.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(xt,"__esModule",{value:!0});xt.Hook=void 0;var bp=wp(require("fs")),HC=wp(require("path")),en=kn(),UC=Ep(),GC=require("child_process").spawnSync,WC=function(){function n(r){var i=this;r===void 0&&(r=[]),this.preHooks=[],this.afterHooks=[],r.forEach(function(o){o.Pre?i.preHooks.push(o):i.afterHooks.push(o)})}return n.prototype.executePreHook=function(){return Wn(this,void 0,void 0,function(){var r,i;return Bn(this,function(o){switch(o.label){case 0:if(!(this.preHooks.length>0))return[3,5];en.logger.info("Start the pre-action"),r=0,o.label=1;case 1:return r<this.preHooks.length?(i=r,en.logger.info("Action: ".concat(this.preHooks[i].Hook||this.preHooks[i].Plugin)),[4,this.executeByConfig(this.preHooks[i])]):[3,4];case 2:o.sent(),o.label=3;case 3:return r++,[3,1];case 4:en.logger.info("End the pre-action"),o.label=5;case 5:return[2]}})})},n.prototype.executeAfterHook=function(){return Wn(this,void 0,void 0,function(){var r,i;return Bn(this,function(o){switch(o.label){case 0:if(!(this.afterHooks.length>0))return[3,5];en.logger.info("Start the after-action"),r=0,o.label=1;case 1:return r<this.afterHooks.length?(i=r,en.logger.info("Action: ".concat(this.afterHooks[i].Hook||this.afterHooks[i].Plugin)),[4,this.executeByConfig(this.afterHooks[i])]):[3,4];case 2:o.sent(),o.label=3;case 3:return r++,[3,1];case 4:en.logger.info("End the after-action"),o.label=5;case 5:return[2]}})})},n.prototype.commandExecute=function(r,i){return Wn(this,void 0,void 0,function(){var o,a,u;return Bn(this,function(d){if(o=process.cwd(),a=i?HC.default.resolve(o,i):o,bp.default.existsSync(a)&&bp.default.lstatSync(a).isDirectory()&&(process.env["next-command-execute-flag"]="true",u=GC(r,[],{cwd:a,stdio:"inherit",shell:!0}),u&&u.status!==0))throw new Error("Action [".concat(r,"] run error."));return[2]})})},n.prototype.pluginExecute=function(r){return Wn(this,void 0,void 0,function(){var i,o;return Bn(this,function(a){switch(a.label){case 0:return i=new UC.PluginExeCute({name:r}),[4,i.init()];case 1:return a.sent(),[4,i.loadPlugin()];case 2:return o=a.sent(),o.apply(null,[]),[2]}})})},n.prototype.executeByConfig=function(r){return Wn(this,void 0,void 0,function(){return Bn(this,function(i){switch(i.label){case 0:return r.Hook?[4,this.commandExecute(r.Hook,r.Path)]:[3,2];case 1:return i.sent(),[3,4];case 2:return r.Plugin?[4,this.pluginExecute(r.Plugin)]:[3,4];case 3:i.sent(),i.label=4;case 4:return[2]}})})},n}();xt.Hook=WC});var Pp=I(Ge=>{"use strict";var Ot=Ge&&Ge.__awaiter||function(n,r,i,o){function a(u){return u instanceof i?u:new i(function(d){d(u)})}return new(i||(i=Promise))(function(u,d){function m(v){try{c(o.next(v))}catch(C){d(C)}}function _(v){try{c(o.throw(v))}catch(C){d(C)}}function c(v){v.done?u(v.value):a(v.value).then(m,_)}c((o=o.apply(n,r||[])).next())})},At=Ge&&Ge.__generator||function(n,r){var i={label:0,sent:function(){if(u[0]&1)throw u[1];return u[1]},trys:[],ops:[]},o,a,u,d;return d={next:m(0),throw:m(1),return:m(2)},typeof Symbol=="function"&&(d[Symbol.iterator]=function(){return this}),d;function m(c){return function(v){return _([c,v])}}function _(c){if(o)throw new TypeError("Generator is already executing.");for(;i;)try{if(o=1,a&&(u=c[0]&2?a.return:c[0]?a.throw||((u=a.return)&&u.call(a),0):a.next)&&!(u=u.call(a,c[1])).done)return u;switch(a=0,u&&(c=[c[0]&2,u.value]),c[0]){case 0:case 1:u=c;break;case 4:return i.label++,{value:c[1],done:!1};case 5:i.label++,a=c[1],c=[0];continue;case 7:c=i.ops.pop(),i.trys.pop();continue;default:if(u=i.trys,!(u=u.length>0&&u[u.length-1])&&(c[0]===6||c[0]===2)){i=0;continue}if(c[0]===3&&(!u||c[1]>u[0]&&c[1]<u[3])){i.label=c[1];break}if(c[0]===6&&i.label<u[1]){i.label=u[1],u=c;break}if(u&&i.label<u[2]){i.label=u[2],i.ops.push(c);break}u[2]&&i.ops.pop(),i.trys.pop();continue}c=r.call(n,i)}catch(v){c=[6,v],a=0}finally{o=u=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}},Eu=Ge&&Ge.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(Ge,"__esModule",{value:!0});Ge.ComponentExeCute=Ge.generateSynchronizeComponentExeList=Ge.synchronizeExecuteComponentList=void 0;var wu=Eu(require("fs")),Sp=Eu(require("path")),BC=gu(),bu=ds(),Cu=kn(),kC=Cp(),ms=Qr(),Vn=Eu(Te()),VC=Vn.default.getCredential,zC=Vn.default.loadComponent,XC=Vn.default.jsyaml,xp=Vn.default.colors,Op=Vn.default.getRootHome,Ap=bu.version.getServiceConfigDetail,YC=bu.version.getServiceInputs,KC=bu.version.getServiceActions,Rp=Sp.default.join(Op(),"components");function Ip(n,r,i){return n===void 0&&(n=[]),r===void 0&&(r=0),i===void 0&&(i={}),Ot(this,void 0,void 0,function(){var o=this;return At(this,function(a){switch(a.label){case 0:return r>=0&&r<n.length?[4,n[r]().then(function(u){var d=u.name,m=u.data;return Ot(o,void 0,void 0,function(){return At(this,function(_){switch(_.label){case 0:return d&&(i[d]=m),[4,Ip(n,r+1,i)];case 1:return[2,_.sent()]}})})})]:[3,2];case 1:return[2,a.sent()];case 2:return[2,i]}})})}Ge.synchronizeExecuteComponentList=Ip;function ZC(n,r){var i=this,o=n.list,a=n.parse,u=n.parsedObj,d=n.method,m=n.params;return o.map(function(_){return function(){return new Promise(function(c,v){return Ot(i,void 0,void 0,function(){var C,R,P;return At(this,function(Z){switch(Z.label){case 0:return u.Params=m||"",Cu.logger.info("Start executing project ".concat(_)),[4,r(a,_,u)];case 1:return C=Z.sent(),process.env.serverless_devs_temp_access&&(C.Access=process.env.serverless_devs_temp_access,C.access=process.env.serverless_devs_temp_access),R=new Tp({componentConfig:C,method:d,version:u.edition}),[4,R.init()];case 2:return P=Z.sent(),u.edition?u.services[_].output=P:u[_].Output=P,Cu.logger.info("Project ".concat(_,` successfully to execute
46
- `)),c({name:_,data:P}),[2]}})})})}})}Ge.generateSynchronizeComponentExeList=ZC;var Tp=function(){function n(r){this.version="0.0.1",this.componentConfig=r.componentConfig,this.method=r.method,this.version=r.version,this.customerCommandName=r.customerCommandName,wu.default.existsSync(Rp)||wu.default.mkdirSync(Rp)}return n.prototype.init=function(){return Ot(this,void 0,void 0,function(){var r;return At(this,function(i){switch(i.label){case 0:return r=this,[4,this.getCredentials()];case 1:return r.credentials=i.sent()||{},[4,this.startExecute()];case 2:return[2,i.sent()]}})})},n.prototype.getCredentials=function(){return Ot(this,void 0,void 0,function(){var r,i,o,a,u,d,m,_;return At(this,function(c){switch(c.label){case 0:if(r=Ap(this.componentConfig),i=r.access,o=r.autoCredential,o===!1)return[2,null];c.label=1;case 1:return c.trys.push([1,5,,6]),a=Sp.default.join(Op(),"access.yaml"),u=XC.load(wu.default.readFileSync(a,"utf8")||"{}"),u[i]?[4,VC(i)]:[3,3];case 2:return m=c.sent(),[3,4];case 3:m={},c.label=4;case 4:return d=m,this.componentConfig.access=i,[2,d];case 5:return _=c.sent(),[3,6];case 6:return[2,{}]}})})},n.prototype.loadExtends=function(){var r=KC(this.componentConfig,this.version,{method:this.method}),i=null;return r&&(i=new kC.Hook(r)),i},n.prototype.loadPreExtends=function(r){return Ot(this,void 0,void 0,function(){return At(this,function(i){switch(i.label){case 0:return r?[4,r.executePreHook()]:[3,2];case 1:i.sent(),i.label=2;case 2:return[2]}})})},n.prototype.loadAfterExtend=function(r){return Ot(this,void 0,void 0,function(){return At(this,function(i){switch(i.label){case 0:return r?[4,r.executeAfterHook()]:[3,2];case 1:i.sent(),i.label=2;case 2:return[2]}})})},n.prototype.invokeMethod=function(r,i,o){return Ot(this,void 0,void 0,function(){var a,u,a,d;return At(this,function(m){switch(m.label){case 0:if(!this.customerCommandName)return[3,6];if(!r[i])return[3,5];m.label=1;case 1:return m.trys.push([1,3,,5]),[4,r[i](o)];case 2:return a=m.sent(),[2,a];case 3:return u=m.sent(),[4,new ms.HandleError({error:u,prefix:"Project ".concat(this.componentConfig.ProjectName," failed to execute:")}).report(u)];case 4:return m.sent(),process.exit(101),[3,5];case 5:new ms.HumanError({errorMessage:"The [".concat(this.method,"] command was not found."),tips:"Please check the component ".concat(this.componentConfig.component," has the ").concat(this.method," method. Serverless Devs documents\uFF1A").concat(xp.underline("https://github.com/Serverless-Devs/Serverless-Devs/blob/master/docs/zh/command"))}),process.exit(100),m.label=6;case 6:if(!r[i])return[3,12];m.label=7;case 7:return m.trys.push([7,9,,11]),[4,r[i](o)];case 8:return a=m.sent(),[2,a];case 9:return d=m.sent(),[4,new ms.HandleError({error:d,prefix:"Project ".concat(this.componentConfig.ProjectName," failed to execute:")}).report(d)];case 10:return m.sent(),process.exit(101),[3,11];case 11:return[3,13];case 12:new ms.HumanWarning({warningMessage:"The [".concat(this.method,"] command was not found."),tips:"Please check the component ".concat(this.componentConfig.component," has the ").concat(this.method," method, Serverless Devs documents\uFF1A").concat(xp.underline("https://github.com/Serverless-Devs/Serverless-Devs/blob/master/docs/zh/command"))}),m.label=13;case 13:return[2]}})})},n.prototype.executeCommand=function(){return Ot(this,void 0,void 0,function(){var r,i,o,a,u;return At(this,function(d){switch(d.label){case 0:return r=YC(this.componentConfig,this.version,{method:this.method,credentials:this.credentials}),i=Ap(this.componentConfig).name,o=Cu.configSet.getConfig("registry")||BC.DEFAULT_REGIRSTRY,[4,zC(i,o)];case 1:return a=d.sent(),[4,this.invokeMethod(a,this.method,r)];case 2:return u=d.sent(),[2,u]}})})},n.prototype.startExecute=function(){return Ot(this,void 0,void 0,function(){var r,i,o,a,u;return At(this,function(d){switch(d.label){case 0:return r={},i=process.env.temp_params||"",o=i.includes("--help")||i.includes("-h"),process.env["skip-actions"]==="true"||o?(u=null,[3,3]):[3,1];case 1:return[4,this.loadExtends()];case 2:u=d.sent(),d.label=3;case 3:return a=u,[4,this.loadPreExtends(a)];case 4:return d.sent(),[4,this.executeCommand()];case 5:return r=d.sent(),[4,this.loadAfterExtend(a)];case 6:return d.sent(),[2,r]}})})},n}();Ge.ComponentExeCute=Tp});var $p=I(Rt=>{"use strict";var Lp=Rt&&Rt.__awaiter||function(n,r,i,o){function a(u){return u instanceof i?u:new i(function(d){d(u)})}return new(i||(i=Promise))(function(u,d){function m(v){try{c(o.next(v))}catch(C){d(C)}}function _(v){try{c(o.throw(v))}catch(C){d(C)}}function c(v){v.done?u(v.value):a(v.value).then(m,_)}c((o=o.apply(n,r||[])).next())})},Dp=Rt&&Rt.__generator||function(n,r){var i={label:0,sent:function(){if(u[0]&1)throw u[1];return u[1]},trys:[],ops:[]},o,a,u,d;return d={next:m(0),throw:m(1),return:m(2)},typeof Symbol=="function"&&(d[Symbol.iterator]=function(){return this}),d;function m(c){return function(v){return _([c,v])}}function _(c){if(o)throw new TypeError("Generator is already executing.");for(;i;)try{if(o=1,a&&(u=c[0]&2?a.return:c[0]?a.throw||((u=a.return)&&u.call(a),0):a.next)&&!(u=u.call(a,c[1])).done)return u;switch(a=0,u&&(c=[c[0]&2,u.value]),c[0]){case 0:case 1:u=c;break;case 4:return i.label++,{value:c[1],done:!1};case 5:i.label++,a=c[1],c=[0];continue;case 7:c=i.ops.pop(),i.trys.pop();continue;default:if(u=i.trys,!(u=u.length>0&&u[u.length-1])&&(c[0]===6||c[0]===2)){i=0;continue}if(c[0]===3&&(!u||c[1]>u[0]&&c[1]<u[3])){i.label=c[1];break}if(c[0]===6&&i.label<u[1]){i.label=u[1],u=c;break}if(u&&i.label<u[2]){i.label=u[2],i.ops.push(c);break}u[2]&&i.ops.pop(),i.trys.pop();continue}c=r.call(n,i)}catch(v){c=[6,v],a=0}finally{o=u=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}},JC=Rt&&Rt.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(Rt,"__esModule",{value:!0});Rt.CommandManager=void 0;var Np=ds(),QC=hs(),zn=kn(),Su=Pp(),tn=rr(),eS=JC(Te()),qp=eS.default.colors,tS=Qr(),rS=function(){function n(r,i,o,a){this.templateFile=r,this.method=i,this.customerCommandName=o,this.deployParams=a}return n.prototype.assemblyProjectConfig=function(r,i,o){return Lp(this,void 0,void 0,function(){var a,u;return Dp(this,function(d){switch(d.label){case 0:return[4,r.getRealVariables(o)];case 1:return a=d.sent(),u=(0,QC.getServiceConfig)(a,i),u.appName=a.name,u.ProjectName=i,this.deployParams&&(u.params=this.deployParams),[2,u]}})})},n.prototype.init=function(){return Lp(this,void 0,void 0,function(){var r,i,o,a,u,d,m,_,c,v,C,R,P,C,Z,oe,be;return Dp(this,function(Y){switch(Y.label){case 0:return Y.trys.push([0,9,,11]),zn.logger.info("Start ..."),r=(0,tn.checkTemplateFile)(this.templateFile),r?(i={},o=new Np.Parse(r),a=o.getOriginalParsedObj(),[4,o.getRealVariables(a)]):[3,7];case 1:return u=Y.sent(),d=new Np.Analysis(u,o.dependenciesMap),m=d.getProjectOrder(),this.customerCommandName||m.length===1?(_=m[0],[4,this.assemblyProjectConfig(o,this.customerCommandName||_,a)]):[3,4];case 2:return c=Y.sent(),process.env.serverless_devs_temp_access&&(c.Access=process.env.serverless_devs_temp_access,c.access=process.env.serverless_devs_temp_access),v=new Su.ComponentExeCute({componentConfig:c,method:this.method,version:a.edition,customerCommandName:this.customerCommandName}),[4,v.init()];case 3:return C=Y.sent(),C&&(i[c.ProjectName]=C),[3,6];case 4:return R=this.deployParams||"",zn.logger.info("It is detected that your project has the following projects < ".concat(m.join(",")," > to be execute")),P=(0,Su.generateSynchronizeComponentExeList)({list:m,parse:o,parsedObj:a,method:this.method,params:R},this.assemblyProjectConfig.bind(this)),[4,(0,Su.synchronizeExecuteComponentList)(P)];case 5:C=Y.sent();for(Z in C)m.includes(Z)&&C[Z]&&(i[Z]=C[Z]);Y.label=6;case 6:return oe=JSON.parse(JSON.stringify(i)),Object.keys(i).length===0?zn.logger.success("End of method: ".concat(this.method)):zn.logger.output(oe),[3,8];case 7:zn.logger.error(`Failed to execute:
35
+ `+(0,Ub.bgRed)("ERROR:")),console.log("TypeError: "+i+`
36
+ `),console.log(Gb.gray(o)+`
37
+ `)}return n.prototype.report=function(r){return Mb(this,void 0,void 0,function(){var i;return jb(this,function(o){switch(o.label){case 0:return i=r.error,[4,Hh.default.report({type:"jsError",content:this.errorMessage+"||"+i.stack})];case 1:return o.sent(),[2]}})})},n}();bt.HumanError=Wb});var Wh=I(Jr=>{"use strict";var Bb=Jr&&Jr.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(Jr,"__esModule",{value:!0});Jr.HumanWarning=void 0;var kb=Bb(Te()),Gh=kb.default.colors,Vb=function(){function n(r){var i=r.warningMessage,o=r.tips;console.log(`
38
+ `+Gh.hex("#000").bgYellow("WARNING:")),console.log(i+`
39
+ `),o&&console.log(Gh.gray(o)+`
40
+ `)}return n}();Jr.HumanWarning=Vb});var Qr=I(ie=>{"use strict";var zb=ie&&ie.__awaiter||function(n,r,i,o){function a(u){return u instanceof i?u:new i(function(d){d(u)})}return new(i||(i=Promise))(function(u,d){function m(v){try{c(o.next(v))}catch(C){d(C)}}function _(v){try{c(o.throw(v))}catch(C){d(C)}}function c(v){v.done?u(v.value):a(v.value).then(m,_)}c((o=o.apply(n,r||[])).next())})},Xb=ie&&ie.__generator||function(n,r){var i={label:0,sent:function(){if(u[0]&1)throw u[1];return u[1]},trys:[],ops:[]},o,a,u,d;return d={next:m(0),throw:m(1),return:m(2)},typeof Symbol=="function"&&(d[Symbol.iterator]=function(){return this}),d;function m(c){return function(v){return _([c,v])}}function _(c){if(o)throw new TypeError("Generator is already executing.");for(;i;)try{if(o=1,a&&(u=c[0]&2?a.return:c[0]?a.throw||((u=a.return)&&u.call(a),0):a.next)&&!(u=u.call(a,c[1])).done)return u;switch(a=0,u&&(c=[c[0]&2,u.value]),c[0]){case 0:case 1:u=c;break;case 4:return i.label++,{value:c[1],done:!1};case 5:i.label++,a=c[1],c=[0];continue;case 7:c=i.ops.pop(),i.trys.pop();continue;default:if(u=i.trys,!(u=u.length>0&&u[u.length-1])&&(c[0]===6||c[0]===2)){i=0;continue}if(c[0]===3&&(!u||c[1]>u[0]&&c[1]<u[3])){i.label=c[1];break}if(c[0]===6&&i.label<u[1]){i.label=u[1],u=c;break}if(u&&i.label<u[2]){i.label=u[2],i.ops.push(c);break}u[2]&&i.ops.pop(),i.trys.pop();continue}c=r.call(n,i)}catch(v){c=[6,v],a=0}finally{o=u=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}},Yb=ie&&ie.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(ie,"__esModule",{value:!0});ie.HandleError=ie.HumanWarning=ie.HumanError=ie.ServerlessError=ie.InitError=ie.ConfigGetError=ie.ConfigError=ie.ConfigDeleteError=ie.CommandError=void 0;var au=rr(),Kb=as(),lu=Yb(Te()),Cr=lu.default.colors,Zb=lu.default.report,Jb=lu.default.getMAC,Qb=qh();Object.defineProperty(ie,"CommandError",{enumerable:!0,get:function(){return Qb.CommandError}});var eC=$h();Object.defineProperty(ie,"ConfigDeleteError",{enumerable:!0,get:function(){return eC.ConfigDeleteError}});var tC=Fh();Object.defineProperty(ie,"ConfigError",{enumerable:!0,get:function(){return tC.ConfigError}});var rC=Mh();Object.defineProperty(ie,"ConfigGetError",{enumerable:!0,get:function(){return rC.ConfigGetError}});var nC=jh();Object.defineProperty(ie,"InitError",{enumerable:!0,get:function(){return nC.InitError}});var iC=br();Object.defineProperty(ie,"ServerlessError",{enumerable:!0,get:function(){return iC.ServerlessError}});var sC=Uh();Object.defineProperty(ie,"HumanError",{enumerable:!0,get:function(){return sC.HumanError}});var oC=Wh();Object.defineProperty(ie,"HumanWarning",{enumerable:!0,get:function(){return oC.HumanWarning}});function uC(){try{return Jb().replace(/:/g,"")}catch{return"unknown"}}function cu(n,r){return""+Cr.gray(n)+Cr.gray.underline(r)}var aC=function(){function n(r){var i=r.error,o=r.prefix,a=o===void 0?"Message:":o;this.traceId=""+uC()+Date.now(),console.log((0,au.red)("\u2716 "+a+`
41
+ `));var u=(0,Kb.getConfig)("analysis");u!=="disable"&&console.log(Cr.gray("TraceId: "+this.traceId)),console.log(Cr.gray("Environment: "+(0,au.getVersion)())),console.log(cu("Documents: ","https://www.serverless-devs.com")),console.log(cu("Discussions: ","https://github.com/Serverless-Devs/Serverless-Devs/discussions")),console.log(cu("Issues: ",`https://github.com/Serverless-Devs/Serverless-Devs/issues
42
+ `)),console.log((0,au.bgRed)("ERROR:")+`
43
+ `+i+`
44
+ `),u!=="disable"&&console.log(Cr.gray("Please copy traceId: "+this.traceId+" and join Dingding group: 33947367 for consultation.")),console.log(Cr.gray("You can run 's clean --cache' to prune Serverless devs.")),console.log(Cr.gray(`And run again with the '--debug' option or 's -h' to get more logs.
45
+ `))}return n.prototype.report=function(r){return zb(this,void 0,void 0,function(){return Xb(this,function(i){return Zb({type:"jsError",content:r.message+"||"+r.stack,traceId:this.traceId}),[2]})})},n}();ie.HandleError=aC});var Bh=I((Gx,lC)=>{lC.exports={name:"@serverless-devs/s",version:"2.0.95-beta.1",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:"MIT",repository:{type:"git",url:"https://github.com/Serverless-Devs/Serverless-Devs"},bugs:{url:"https://github.com/Serverless-Devs/Serverless-Devs/issues"},scripts:{prewatch:"rm -rf lib/* && cp -r ./src/daemon ./lib",watch:"tsc -w",test:"npx jest",prebuild:"rm -rf lib",build:"tsc && cp -r ./src/daemon ./lib",postbuild:"./shell/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"},main:"./lib/index.js",bin:{s:"bin/s"},devDependencies:{"@types/jest":"^27.0.1","@types/lodash":"^4.14.168","@types/node":"^14.0.23","@typescript-eslint/eslint-plugin":"^4.14.1","@typescript-eslint/parser":"^4.14.1","babel-eslint":"^10.1.0",boxen:"^5.0.0",commander:"^6.0.0",dotenv:"^10.0.0",esbuild:"^0.13.6",eslint:"^7.7.0","eslint-config-prettier":"^7.2.0","eslint-plugin-import":"^2.20.1","eslint-plugin-prettier":"^3.1.2",husky:"^4.2.3",inquirer:"^8.2.0","inquirer-autocomplete-prompt":"^1.3.0",jest:"^27.1.0","latest-version":"^5.1.0","lint-staged":"^10.0.8",lodash:"^4.17.20","os-locale":"5.0.0",prettier:"^2.2.1",semver:"^7.3.5","semver-diff":"^3.1.1","ts-jest":"^27.0.1","ts-node":"^9.1.1","tty-table":"^4.1.5",typescript:"^4.1.3"},"lint-staged":{"**/*.{js,jsx,ts}":"f2elint exec eslint"},jest:{coverageDirectory:"coverage",testEnvironment:"node",coverageProvider:"v8",preset:"ts-jest",testMatch:["**/test/**/*test.[jt]s"],setupFilesAfterEnv:["./jest.setup.ts"]},dependencies:{"@serverless-devs/core":"^0.1.15-beta.2"}}});var rr=I(U=>{"use strict";var cC=U&&U.__createBinding||(Object.create?function(n,r,i,o){o===void 0&&(o=i),Object.defineProperty(n,o,{enumerable:!0,get:function(){return r[i]}})}:function(n,r,i,o){o===void 0&&(o=i),n[o]=r[i]}),fC=U&&U.__setModuleDefault||(Object.create?function(n,r){Object.defineProperty(n,"default",{enumerable:!0,value:r})}:function(n,r){n.default=r}),hC=U&&U.__importStar||function(n){if(n&&n.__esModule)return n;var r={};if(n!=null)for(var i in n)i!=="default"&&Object.prototype.hasOwnProperty.call(n,i)&&cC(r,n,i);return fC(r,n),r},kh=U&&U.__awaiter||function(n,r,i,o){function a(u){return u instanceof i?u:new i(function(d){d(u)})}return new(i||(i=Promise))(function(u,d){function m(v){try{c(o.next(v))}catch(C){d(C)}}function _(v){try{c(o.throw(v))}catch(C){d(C)}}function c(v){v.done?u(v.value):a(v.value).then(m,_)}c((o=o.apply(n,r||[])).next())})},Vh=U&&U.__generator||function(n,r){var i={label:0,sent:function(){if(u[0]&1)throw u[1];return u[1]},trys:[],ops:[]},o,a,u,d;return d={next:m(0),throw:m(1),return:m(2)},typeof Symbol=="function"&&(d[Symbol.iterator]=function(){return this}),d;function m(c){return function(v){return _([c,v])}}function _(c){if(o)throw new TypeError("Generator is already executing.");for(;i;)try{if(o=1,a&&(u=c[0]&2?a.return:c[0]?a.throw||((u=a.return)&&u.call(a),0):a.next)&&!(u=u.call(a,c[1])).done)return u;switch(a=0,u&&(c=[c[0]&2,u.value]),c[0]){case 0:case 1:u=c;break;case 4:return i.label++,{value:c[1],done:!1};case 5:i.label++,a=c[1],c=[0];continue;case 7:c=i.ops.pop(),i.trys.pop();continue;default:if(u=i.trys,!(u=u.length>0&&u[u.length-1])&&(c[0]===6||c[0]===2)){i=0;continue}if(c[0]===3&&(!u||c[1]>u[0]&&c[1]<u[3])){i.label=c[1];break}if(c[0]===6&&i.label<u[1]){i.label=u[1],u=c;break}if(u&&i.label<u[2]){i.label=u[2],i.ops.push(c);break}u[2]&&i.ops.pop(),i.trys.pop();continue}c=r.call(n,i)}catch(v){c=[6,v],a=0}finally{o=u=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}},ls=U&&U.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(U,"__esModule",{value:!0});U.emoji=U.mark=U.replaceTemplate=U.getTemplatekey=U.replaceFun=U.getLang=U.printn=U.checkTemplateFile=U.checkAndReturnTemplateFile=U.yamlLoad=U.getFolderSize=U.getVersion=U.bgRed=U.red=void 0;var we=ls(require("path")),Ke=ls(require("fs")),fu=ls(is()),pC=ls(require("os")),dC=Qr(),cs=hC(Te()),hu=cs.default.colors,gC=cs.default.jsyaml,fs=Bh();U.red=hu.hex("#fd5750");U.bgRed=hu.hex("#000").bgHex("#fd5750");function mC(){return(0,cs.getCoreVersion)()?fs.name+": "+fs.version+", @serverless-devs/core: "+(0,cs.getCoreVersion)()+", "+process.platform+"-"+process.arch+", node-"+process.version:fs.name+": "+fs.version+", "+process.platform+"-"+process.arch+", node-"+process.version}U.getVersion=mC;function vC(n){return kh(this,void 0,void 0,function(){function r(a){return kh(this,void 0,void 0,function(){var u,d;return Vh(this,function(m){switch(m.label){case 0:return u=Ke.default.lstatSync(a),typeof u!="object"?[2]:(i.set(u.ino,u.size),u.isDirectory()?(d=Ke.default.readdirSync(a),typeof d!="object"?[2]:[4,Promise.all(d.map(function(_){return r(we.default.join(a,_))}))]):[3,2]);case 1:m.sent(),m.label=2;case 2:return[2]}})})}var i,o;return Vh(this,function(a){switch(a.label){case 0:return i=new Map,[4,r(n)];case 1:return a.sent(),o=Array.from(i.values()).reduce(function(u,d){return u+d},0),[2,o]}})})}U.getFolderSize=vC;function zh(n){var r=Ke.default.readFileSync(n,"utf8");try{return gC.load(r)}catch{if(["-h","--help"].includes(process.argv[2]))return;var i=we.default.basename(n);new dC.HumanError({errorMessage:i+" format is incorrect",tips:"Please check the configuration of "+i+", Serverless Devs' Yaml specification document can refer to\uFF1A"+hu.underline("https://github.com/Serverless-Devs/Serverless-Devs/blob/master/docs/zh/yaml.md")}),process.exit(1)}}U.yamlLoad=zh;function Un(n,r){r===void 0&&(r=!1);var i=Ke.default.readFileSync(n,"utf8"),o=r?JSON.parse(i):zh(n);if(!o)return!1;for(var a in o)if(o[a].Component&&o[a].Provider&&o[a].Properties)return!0;return o.hasOwnProperty("edition")}function Xh(){if(process.env.serverless_devs_temp_template)return process.env.serverless_devs_temp_template;var n=process.cwd(),r=process.argv.includes("-t")?"-t":process.argv.includes("--template")?"--template":null,i=r?process.argv.indexOf(r):-1;if(i!==-1){var o=i+1,a=process.argv[o];if(a&&(a.endsWith(".yaml")||a.endsWith(".yml")||a.endsWith(".json"))){var u=!!a.endsWith(".json");if(Ke.default.existsSync(we.default.join(n,a))&&Un(we.default.join(n,a),u)){process.argv.splice(i,2);var d=JSON.parse(process.env.serverless_devs_temp_argv);return d.splice(d.indexOf(r),2),process.env.serverless_devs_temp_argv=JSON.stringify(d),process.env.serverless_devs_temp_template=we.default.join(n,a),we.default.join(n,a)}else if(Ke.default.existsSync(a)&&Un(a,u)){process.argv.splice(i,2);var d=JSON.parse(process.env.serverless_devs_temp_argv);return d.splice(d.indexOf(r),2),process.env.serverless_devs_temp_argv=JSON.stringify(d),process.env.serverless_devs_temp_template=a,a}}}return Ke.default.existsSync(we.default.join(n,"s.yaml"))&&Un(we.default.join(n,"s.yaml"))?(process.env.serverless_devs_temp_template=we.default.join(n,"s.yaml"),we.default.join(n,"s.yaml")):Ke.default.existsSync(we.default.join(n,"s.yml"))&&Un(we.default.join(n,"s.yml"))?(process.env.serverless_devs_temp_template=we.default.join(n,"s.yml"),we.default.join(n,"s.yml")):Ke.default.existsSync(we.default.join(n,"s.json"))&&Un(we.default.join(n,"s.json"),!0)?(process.env.serverless_devs_temp_template=we.default.join(n,"s.json"),we.default.join(n,"s.json")):null}U.checkAndReturnTemplateFile=Xh;function Yh(n){return Ke.default.existsSync(n)?n:null}U.checkTemplateFile=Yh;function Kh(n,r){r===void 0&&(r=" ");for(var i="",o=0;o<n;o++)i=i+r;return i}U.printn=Kh;function Zh(){return"en"}U.getLang=Zh;function pu(n,r){var i=/\{\{(.*?)\}\}/g,o=n.match(i);if(o)for(var a=0;a<o.length;a++){var u=o[a].replace(/{{|}}/g,""),d=fu.default.trim(u.split("|")[0]);r[d]&&(n=n.replace(o[a],r[d]))}return n}U.replaceFun=pu;function Jh(n){var r=/\{\{(.*?)\}\}/g,i=n.match(r);return i?i.filter(function(o){return o}).map(function(o){var a=o.replace(/{{|}}/g,""),u=a.split("|");return{name:fu.default.trim(u[0]),desc:fu.default.trim(u[1])}}):[]}U.getTemplatekey=Jh;function Qh(n,r){n.forEach(function(i){if(Ke.default.existsSync(i)){var o=Ke.default.readFileSync(i,"utf-8"),a=pu(o,r);Ke.default.writeFileSync(i,a,"utf-8")}})}U.replaceTemplate=Qh;function ep(n){if(!n)return n;var r=n.slice(-4);return"***********"+r}U.mark=ep;function _C(n){return pC.default.platform()==="win32"?"":n}U.emoji=_C;U.default={checkAndReturnTemplateFile:Xh,checkTemplateFile:Yh,printn:Kh,mark:ep,getLang:Zh,replaceTemplate:Qh,replaceFun:pu,getTemplatekey:Jh}});var sp=I(Ze=>{"use strict";var yC=Ze&&Ze.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(Ze,"__esModule",{value:!0});Ze.extractTemplateInfo=Ze.isUrlFormat=Ze.getProjectNameFromUrl=Ze.parse=void 0;var EC=yC(require("url"));function tp(n){return EC.default.parse(n)}Ze.parse=tp;function rp(n){var r=n.lastIndexOf("/");return r&&r>=0&&(n=n.substr(r+1)),n.endsWith(".git")?n.substr(0,n.length-4):n}Ze.getProjectNameFromUrl=rp;function np(n){return n.includes(":")||n.includes("/")}Ze.isUrlFormat=np;function ip(n){var r=n.pathname||"",i=r.split("/"),o=i[1],a=i[3];return{host:n.host,ownerName:o,repoName:a,branch:"",hasSubPath:!1,subPath:"",zipFile:""}}Ze.extractTemplateInfo=ip;Ze.default={extractTemplateInfo:ip,getProjectNameFromUrl:rp,isUrlFormat:np,parse:tp}});var hs=I(Fe=>{"use strict";Object.defineProperty(Fe,"__esModule",{value:!0});Fe.getServiceList=Fe.getServiceActions=Fe.getServiceInputs=Fe.getServiceConfigDetail=Fe.getServiceConfig=Fe.getSubcommand=void 0;function op(n){var r=n.edition||"0.0.1";if(r==="0.0.1")return Object.keys(n).filter(function(o){return o!=="Global"});var i=n.services||{};return Object.keys(i)}Fe.getSubcommand=op;function up(n,r){var i=n.edition||"0.0.1";if(i==="0.0.1")return n[r];var o=n.services||{},a=o[r],u=a.provider?a.provider:n.provider,d=a.access?a.access:n.access,m=Object.assign({},a,{access:d,provider:u});return m}Fe.getServiceConfig=up;function ap(n){var r=n.Component||n.component,i=n.Provider||n.provider,o=n.Access||n.access||"default",a=n.autoCredential;return{name:r,provider:i,access:o,autoCredential:a}}Fe.getServiceConfigDetail=ap;function lp(n,r,i){if(r==="0.0.1"){var o=n.Properties,a=n.Params,u=n.Provider,d=n.Access,m=n.Component,_=n.ProjectName,c=i.credentials,v=i.method,C={Properties:o,Credentials:c,Project:{ProjectName:_,Component:m,Provider:u,AccessAlias:d||""},Command:v,Args:a||"",Path:{ConfigPath:process.env.templateFile||""}};return C}var R=n.props,P=n.params,Z=n.provider,oe=n.access,be=n.component,Y=n.ProjectName,lt=n.appName,ve=i.credentials,pe=i.method,xe={props:R,Properties:R,Credentials:ve,credentials:ve,appName:lt,Project:{ProjectName:Y,projectName:Y,component:be,Component:be,provider:Z,Provider:Z,accessAlias:oe||"",AccessAlias:oe||""},project:{component:be,access:oe||"",projectName:Y},command:pe,Command:pe,args:P||"",Args:P||"",argsObj:process.temp_params||[],ArgsObj:process.temp_params||[],path:{configPath:process.env.templateFile||""},Path:{ConfigPath:process.env.templateFile||""}};return xe}Fe.getServiceInputs=lp;function cp(n,r,i){var o=i.method;if(r==="0.0.1"){var a=n.Extends,u=a===void 0?{}:a,d=u[o];return d}var m=n.actions,_=m===void 0?{}:m,c=[];return Object.keys(_).forEach(function(v){var C=v.split("-"),R=_[v];if(C.length>1){var P=C[1];if(P===o){var Z=C[0];R.forEach(function(oe){var be={Hook:oe.run,Path:oe.path,Pre:Z==="pre"};c.push(be)})}}else v===o&&R.forEach(function(oe){var be={Hook:oe.run,Path:oe.path,Pre:!1};c.push(be)})}),c}Fe.getServiceActions=cp;function fp(n){var r=n.edition||"0.0.1";return r==="0.0.1"?n:n.services}Fe.getServiceList=fp;Fe.default={getSubcommand:op,getServiceConfig:up,getServiceConfigDetail:ap,getServiceInputs:lp,getServiceActions:cp,getServiceList:fp}});var _p=I(Pe=>{"use strict";var wC=Pe&&Pe.__createBinding||(Object.create?function(n,r,i,o){o===void 0&&(o=i),Object.defineProperty(n,o,{enumerable:!0,get:function(){return r[i]}})}:function(n,r,i,o){o===void 0&&(o=i),n[o]=r[i]}),bC=Pe&&Pe.__setModuleDefault||(Object.create?function(n,r){Object.defineProperty(n,"default",{enumerable:!0,value:r})}:function(n,r){n.default=r}),hp=Pe&&Pe.__importStar||function(n){if(n&&n.__esModule)return n;var r={};if(n!=null)for(var i in n)i!=="default"&&Object.prototype.hasOwnProperty.call(n,i)&&wC(r,n,i);return bC(r,n),r},pp=Pe&&Pe.__awaiter||function(n,r,i,o){function a(u){return u instanceof i?u:new i(function(d){d(u)})}return new(i||(i=Promise))(function(u,d){function m(v){try{c(o.next(v))}catch(C){d(C)}}function _(v){try{c(o.throw(v))}catch(C){d(C)}}function c(v){v.done?u(v.value):a(v.value).then(m,_)}c((o=o.apply(n,r||[])).next())})},dp=Pe&&Pe.__generator||function(n,r){var i={label:0,sent:function(){if(u[0]&1)throw u[1];return u[1]},trys:[],ops:[]},o,a,u,d;return d={next:m(0),throw:m(1),return:m(2)},typeof Symbol=="function"&&(d[Symbol.iterator]=function(){return this}),d;function m(c){return function(v){return _([c,v])}}function _(c){if(o)throw new TypeError("Generator is already executing.");for(;i;)try{if(o=1,a&&(u=c[0]&2?a.return:c[0]?a.throw||((u=a.return)&&u.call(a),0):a.next)&&!(u=u.call(a,c[1])).done)return u;switch(a=0,u&&(c=[c[0]&2,u.value]),c[0]){case 0:case 1:u=c;break;case 4:return i.label++,{value:c[1],done:!1};case 5:i.label++,a=c[1],c=[0];continue;case 7:c=i.ops.pop(),i.trys.pop();continue;default:if(u=i.trys,!(u=u.length>0&&u[u.length-1])&&(c[0]===6||c[0]===2)){i=0;continue}if(c[0]===3&&(!u||c[1]>u[0]&&c[1]<u[3])){i.label=c[1];break}if(c[0]===6&&i.label<u[1]){i.label=u[1],u=c;break}if(u&&i.label<u[2]){i.label=u[2],i.ops.push(c);break}u[2]&&i.ops.pop(),i.trys.pop();continue}c=r.call(n,i)}catch(v){c=[6,v],a=0}finally{o=u=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}},CC=Pe&&Pe.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(Pe,"__esModule",{value:!0});Pe.Parse=void 0;var du=hp(require("fs")),gp=hp(require("path")),SC=hs(),xC=Qr(),mp=is(),OC=CC(Te()),AC=OC.default.jsyaml,RC=is(),vp=new RegExp(/\$\{(.*)\}/,"i"),IC=new RegExp(/(.*)\((.*)\)/,"i"),TC=["[object Number]","[object Boolean]"],PC=function(){function n(r){if(this.path=r,this.parsedObj={},this.dependenciesMap={},this.globalJsonKeyMap={},this.globalKeyArr=[],this.magicVariablesArray=[],du.existsSync(r))try{this.init(r)}catch(i){throw new Error(i.message)}}return n.prototype.getFileObj=function(r){var i={};try{var o=gp.extname(r);(o.indexOf(".yaml")!==-1||o.indexOf(".yml")!==-1)&&(i=AC.load(du.readFileSync(r,"utf8"))),o.indexOf(".json")!==-1&&(i=JSON.parse(du.readFileSync(r).toString()))}catch(a){new xC.HandleError({error:a}).report(a).then(function(){return process.exit(1)})}return i},n.prototype.init=function(r){return pp(this,void 0,void 0,function(){return dp(this,function(i){return this.parsedObj=this.getFileObj(r),[2]})})},n.prototype.getOriginalParsedObj=function(){return this.parsedObj},n.prototype.findVariableValue=function(r){var i=r.variableName,o=r.type,a=r.funName,u=r.funVariable,d="";return o==="Literal"?this.globalJsonKeyMap[i]||this.globalJsonKeyMap["services."+i]||"${"+i+"}":o==="Fun"&&(a==="Env"||a==="env")?process.env[u]:o==="Fun"&&(a==="Path"||a==="path")?gp.join(process.cwd(),u):o==="Fun"&&(a==="File"||a==="file")?this.getFileObj(u):d},n.prototype.generateMagicVariables=function(r,i,o){var a=this;return i===void 0&&(i=[]),o===void 0&&(o=""),Object.prototype.toString.call(r)==="[object Object]"?(o!==""&&(o=o+"."),Object.keys(r).map(function(u){var d=""+o+u,m=r[u];i.push(d),i.concat(a.generateMagicVariables(m,i,""+d)),a.globalJsonKeyMap[d]=m})):Object.prototype.toString.call(r)==="[object Array]"?r.forEach(function(u,d){var m=o+"["+d+"]",_=o+"["+(d-r.length)+"]";i.push(m),i.push(_),i.concat(a.generateMagicVariables(u,i,""+m)),i.concat(a.generateMagicVariables(u,i,""+_)),a.globalJsonKeyMap[m]=u,a.globalJsonKeyMap[_]=u}):i=[],i},n.prototype.isProjectProperties=function(r,i){var o=!1;return i==="Properties"&&this.globalJsonKeyMap[r+"."+i]&&(o=!0),o},n.prototype.iteratorToSetValue=function(r,i,o){var a=this;if(TC.includes(Object.prototype.toString.call(r)))return r;if(Object.prototype.toString.call(r)==="[object String]"){var u=r.match(vp);if(u){var d=u[1],m={variableName:d,type:"Literal",funName:null,funVariable:""},_=d.match(IC);if(_)m.funName=_[1],m.funVariable=_[2],m.type="Fun";else{var c=this.dependenciesMap[i];c||(c={});var v=d.split(".")[0];c[v]=1,this.dependenciesMap[i]=c}var C=(0,mp.startsWith)(d,"env.")?(0,mp.get)(process,d):this.findVariableValue(m);return Object.prototype.toString.call(C)==="[object String]"?r.replace(vp,C):C}return(!this.dependenciesMap[i]||Object.keys(this.dependenciesMap[i]).length==0)&&(this.dependenciesMap[i]={}),r}if(Object.prototype.toString.call(r)==="[object Array]")return r.map(function(R){return a.iteratorToSetValue(R,i)});if(Object.prototype.toString.call(r)==="[object Object]")return Object.keys(r).forEach(function(R){r[R]=a.iteratorToSetValue(r[R],i,o||R)}),r},n.prototype.replaceVariable=function(r){var i=this,o=(0,SC.getServiceList)(r);return Object.keys(o).forEach(function(a){var u=o[a];o[a]=i.iteratorToSetValue(u,a)}),r.services?r.services=o:r=o,(0,RC.cloneDeep)(r)},n.prototype.getRealVariables=function(r){return pp(this,void 0,void 0,function(){return dp(this,function(i){return this.globalKeyArr=this.generateMagicVariables(r),[2,this.replaceVariable(r)]})})},n}();Pe.Parse=PC});var yp=I(ps=>{"use strict";Object.defineProperty(ps,"__esModule",{value:!0});ps.Analysis=void 0;var LC=function(){function n(r,i){this.parsedObj=r,this.dependenciesMap=i,this.componentOrderKeyMap={}}return n.prototype.getComponentOrderKeyMap=function(r){var i=this;r.forEach(function(o){i.componentOrderKeyMap[o]=1})},n.prototype.calculateOrderNumber=function(r){var i=this;r.forEach(function(o){var a=i.dependenciesMap[o];Object.keys(a).forEach(function(u){i.componentOrderKeyMap[u]&&(i.componentOrderKeyMap[u]+=a[u])})})},n.prototype.getProjectOrder=function(){var r=this,i=Object.keys(this.dependenciesMap).filter(function(a){return a!=="Global"});this.getComponentOrderKeyMap(i),this.calculateOrderNumber(i);var o=Object.keys(this.componentOrderKeyMap).map(function(a){return{name:a,order:r.componentOrderKeyMap[a]}});return o.sort(function(a,u){return u.order-a.order}).map(function(a){return a.name})},n}();ps.Analysis=LC});var ds=I(Ct=>{"use strict";var DC=Ct&&Ct.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(Ct,"__esModule",{value:!0});Ct.version=Ct.Analysis=Ct.Parse=void 0;var NC=_p();Object.defineProperty(Ct,"Parse",{enumerable:!0,get:function(){return NC.Parse}});var qC=yp();Object.defineProperty(Ct,"Analysis",{enumerable:!0,get:function(){return qC.Analysis}});var $C=hs();Object.defineProperty(Ct,"version",{enumerable:!0,get:function(){return DC($C).default}})});var gu=I(nr=>{"use strict";Object.defineProperty(nr,"__esModule",{value:!0});nr.UPDATE_CHECK_INTERVAL=nr.DEFAULT_REGIRSTRY=nr.PROCESS_ENV_TEMPLATE_NAME=void 0;nr.PROCESS_ENV_TEMPLATE_NAME="templateFile";nr.DEFAULT_REGIRSTRY="http://registry.devsapp.cn/simple";nr.UPDATE_CHECK_INTERVAL=1e3*60*60*12});var Ep=I(St=>{"use strict";var mu=St&&St.__awaiter||function(n,r,i,o){function a(u){return u instanceof i?u:new i(function(d){d(u)})}return new(i||(i=Promise))(function(u,d){function m(v){try{c(o.next(v))}catch(C){d(C)}}function _(v){try{c(o.throw(v))}catch(C){d(C)}}function c(v){v.done?u(v.value):a(v.value).then(m,_)}c((o=o.apply(n,r||[])).next())})},vu=St&&St.__generator||function(n,r){var i={label:0,sent:function(){if(u[0]&1)throw u[1];return u[1]},trys:[],ops:[]},o,a,u,d;return d={next:m(0),throw:m(1),return:m(2)},typeof Symbol=="function"&&(d[Symbol.iterator]=function(){return this}),d;function m(c){return function(v){return _([c,v])}}function _(c){if(o)throw new TypeError("Generator is already executing.");for(;i;)try{if(o=1,a&&(u=c[0]&2?a.return:c[0]?a.throw||((u=a.return)&&u.call(a),0):a.next)&&!(u=u.call(a,c[1])).done)return u;switch(a=0,u&&(c=[c[0]&2,u.value]),c[0]){case 0:case 1:u=c;break;case 4:return i.label++,{value:c[1],done:!1};case 5:i.label++,a=c[1],c=[0];continue;case 7:c=i.ops.pop(),i.trys.pop();continue;default:if(u=i.trys,!(u=u.length>0&&u[u.length-1])&&(c[0]===6||c[0]===2)){i=0;continue}if(c[0]===3&&(!u||c[1]>u[0]&&c[1]<u[3])){i.label=c[1];break}if(c[0]===6&&i.label<u[1]){i.label=u[1],u=c;break}if(u&&i.label<u[2]){i.label=u[2],i.ops.push(c);break}u[2]&&i.ops.pop(),i.trys.pop();continue}c=r.call(n,i)}catch(v){c=[6,v],a=0}finally{o=u=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}},_u=St&&St.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(St,"__esModule",{value:!0});St.PluginExeCute=void 0;var Gn=_u(require("fs")),yu=_u(require("path")),FC=_u(Te()),MC=FC.default.getRootHome,gs=yu.default.join(MC(),"plugins"),jC=function(){function n(r){this.pluginConfig=r,Gn.default.existsSync(gs)||Gn.default.mkdirSync(gs);var i=this.pluginConfig.name;this.pluginPath=yu.default.join(gs,i)}return n.prototype.init=function(){return mu(this,void 0,void 0,function(){var r;return vu(this,function(i){switch(i.label){case 0:return r=this.pluginConfig.name,this.pluginExist()?[3,2]:[4,this.downLoadPlugin(r)];case 1:i.sent(),i.label=2;case 2:return[2]}})})},n.prototype.pluginExist=function(){return Gn.default.existsSync(this.pluginPath)},n.prototype.downLoadPlugin=function(r){return mu(this,void 0,void 0,function(){var i;return vu(this,function(o){return i=yu.default.join(gs,r),Gn.default.existsSync(i)||Gn.default.mkdirSync(i),[2]})})},n.prototype.loadPlugin=function(){return mu(this,void 0,void 0,function(){var r;return vu(this,function(i){return r=require(this.pluginPath),[2,r]})})},n}();St.PluginExeCute=jC});var Cp=I(xt=>{"use strict";var Wn=xt&&xt.__awaiter||function(n,r,i,o){function a(u){return u instanceof i?u:new i(function(d){d(u)})}return new(i||(i=Promise))(function(u,d){function m(v){try{c(o.next(v))}catch(C){d(C)}}function _(v){try{c(o.throw(v))}catch(C){d(C)}}function c(v){v.done?u(v.value):a(v.value).then(m,_)}c((o=o.apply(n,r||[])).next())})},Bn=xt&&xt.__generator||function(n,r){var i={label:0,sent:function(){if(u[0]&1)throw u[1];return u[1]},trys:[],ops:[]},o,a,u,d;return d={next:m(0),throw:m(1),return:m(2)},typeof Symbol=="function"&&(d[Symbol.iterator]=function(){return this}),d;function m(c){return function(v){return _([c,v])}}function _(c){if(o)throw new TypeError("Generator is already executing.");for(;i;)try{if(o=1,a&&(u=c[0]&2?a.return:c[0]?a.throw||((u=a.return)&&u.call(a),0):a.next)&&!(u=u.call(a,c[1])).done)return u;switch(a=0,u&&(c=[c[0]&2,u.value]),c[0]){case 0:case 1:u=c;break;case 4:return i.label++,{value:c[1],done:!1};case 5:i.label++,a=c[1],c=[0];continue;case 7:c=i.ops.pop(),i.trys.pop();continue;default:if(u=i.trys,!(u=u.length>0&&u[u.length-1])&&(c[0]===6||c[0]===2)){i=0;continue}if(c[0]===3&&(!u||c[1]>u[0]&&c[1]<u[3])){i.label=c[1];break}if(c[0]===6&&i.label<u[1]){i.label=u[1],u=c;break}if(u&&i.label<u[2]){i.label=u[2],i.ops.push(c);break}u[2]&&i.ops.pop(),i.trys.pop();continue}c=r.call(n,i)}catch(v){c=[6,v],a=0}finally{o=u=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}},wp=xt&&xt.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(xt,"__esModule",{value:!0});xt.Hook=void 0;var bp=wp(require("fs")),HC=wp(require("path")),en=kn(),UC=Ep(),GC=require("child_process").spawnSync,WC=function(){function n(r){var i=this;r===void 0&&(r=[]),this.preHooks=[],this.afterHooks=[],r.forEach(function(o){o.Pre?i.preHooks.push(o):i.afterHooks.push(o)})}return n.prototype.executePreHook=function(){return Wn(this,void 0,void 0,function(){var r,i;return Bn(this,function(o){switch(o.label){case 0:if(!(this.preHooks.length>0))return[3,5];en.logger.info("Start the pre-action"),r=0,o.label=1;case 1:return r<this.preHooks.length?(i=r,en.logger.info("Action: "+(this.preHooks[i].Hook||this.preHooks[i].Plugin)),[4,this.executeByConfig(this.preHooks[i])]):[3,4];case 2:o.sent(),o.label=3;case 3:return r++,[3,1];case 4:en.logger.info("End the pre-action"),o.label=5;case 5:return[2]}})})},n.prototype.executeAfterHook=function(){return Wn(this,void 0,void 0,function(){var r,i;return Bn(this,function(o){switch(o.label){case 0:if(!(this.afterHooks.length>0))return[3,5];en.logger.info("Start the after-action"),r=0,o.label=1;case 1:return r<this.afterHooks.length?(i=r,en.logger.info("Action: "+(this.afterHooks[i].Hook||this.afterHooks[i].Plugin)),[4,this.executeByConfig(this.afterHooks[i])]):[3,4];case 2:o.sent(),o.label=3;case 3:return r++,[3,1];case 4:en.logger.info("End the after-action"),o.label=5;case 5:return[2]}})})},n.prototype.commandExecute=function(r,i){return Wn(this,void 0,void 0,function(){var o,a,u;return Bn(this,function(d){if(o=process.cwd(),a=i?HC.default.resolve(o,i):o,bp.default.existsSync(a)&&bp.default.lstatSync(a).isDirectory()&&(process.env["next-command-execute-flag"]="true",u=GC(r,[],{cwd:a,stdio:"inherit",shell:!0}),u&&u.status!==0))throw new Error("Action ["+r+"] run error.");return[2]})})},n.prototype.pluginExecute=function(r){return Wn(this,void 0,void 0,function(){var i,o;return Bn(this,function(a){switch(a.label){case 0:return i=new UC.PluginExeCute({name:r}),[4,i.init()];case 1:return a.sent(),[4,i.loadPlugin()];case 2:return o=a.sent(),o.apply(null,[]),[2]}})})},n.prototype.executeByConfig=function(r){return Wn(this,void 0,void 0,function(){return Bn(this,function(i){switch(i.label){case 0:return r.Hook?[4,this.commandExecute(r.Hook,r.Path)]:[3,2];case 1:return i.sent(),[3,4];case 2:return r.Plugin?[4,this.pluginExecute(r.Plugin)]:[3,4];case 3:i.sent(),i.label=4;case 4:return[2]}})})},n}();xt.Hook=WC});var Pp=I(Ge=>{"use strict";var Ot=Ge&&Ge.__awaiter||function(n,r,i,o){function a(u){return u instanceof i?u:new i(function(d){d(u)})}return new(i||(i=Promise))(function(u,d){function m(v){try{c(o.next(v))}catch(C){d(C)}}function _(v){try{c(o.throw(v))}catch(C){d(C)}}function c(v){v.done?u(v.value):a(v.value).then(m,_)}c((o=o.apply(n,r||[])).next())})},At=Ge&&Ge.__generator||function(n,r){var i={label:0,sent:function(){if(u[0]&1)throw u[1];return u[1]},trys:[],ops:[]},o,a,u,d;return d={next:m(0),throw:m(1),return:m(2)},typeof Symbol=="function"&&(d[Symbol.iterator]=function(){return this}),d;function m(c){return function(v){return _([c,v])}}function _(c){if(o)throw new TypeError("Generator is already executing.");for(;i;)try{if(o=1,a&&(u=c[0]&2?a.return:c[0]?a.throw||((u=a.return)&&u.call(a),0):a.next)&&!(u=u.call(a,c[1])).done)return u;switch(a=0,u&&(c=[c[0]&2,u.value]),c[0]){case 0:case 1:u=c;break;case 4:return i.label++,{value:c[1],done:!1};case 5:i.label++,a=c[1],c=[0];continue;case 7:c=i.ops.pop(),i.trys.pop();continue;default:if(u=i.trys,!(u=u.length>0&&u[u.length-1])&&(c[0]===6||c[0]===2)){i=0;continue}if(c[0]===3&&(!u||c[1]>u[0]&&c[1]<u[3])){i.label=c[1];break}if(c[0]===6&&i.label<u[1]){i.label=u[1],u=c;break}if(u&&i.label<u[2]){i.label=u[2],i.ops.push(c);break}u[2]&&i.ops.pop(),i.trys.pop();continue}c=r.call(n,i)}catch(v){c=[6,v],a=0}finally{o=u=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}},Eu=Ge&&Ge.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(Ge,"__esModule",{value:!0});Ge.ComponentExeCute=Ge.generateSynchronizeComponentExeList=Ge.synchronizeExecuteComponentList=void 0;var wu=Eu(require("fs")),Sp=Eu(require("path")),BC=gu(),bu=ds(),Cu=kn(),kC=Cp(),ms=Qr(),Vn=Eu(Te()),VC=Vn.default.getCredential,zC=Vn.default.loadComponent,XC=Vn.default.jsyaml,xp=Vn.default.colors,Op=Vn.default.getRootHome,Ap=bu.version.getServiceConfigDetail,YC=bu.version.getServiceInputs,KC=bu.version.getServiceActions,Rp=Sp.default.join(Op(),"components");function Ip(n,r,i){return n===void 0&&(n=[]),r===void 0&&(r=0),i===void 0&&(i={}),Ot(this,void 0,void 0,function(){var o=this;return At(this,function(a){switch(a.label){case 0:return r>=0&&r<n.length?[4,n[r]().then(function(u){var d=u.name,m=u.data;return Ot(o,void 0,void 0,function(){return At(this,function(_){switch(_.label){case 0:return d&&(i[d]=m),[4,Ip(n,r+1,i)];case 1:return[2,_.sent()]}})})})]:[3,2];case 1:return[2,a.sent()];case 2:return[2,i]}})})}Ge.synchronizeExecuteComponentList=Ip;function ZC(n,r){var i=this,o=n.list,a=n.parse,u=n.parsedObj,d=n.method,m=n.params;return o.map(function(_){return function(){return new Promise(function(c,v){return Ot(i,void 0,void 0,function(){var C,R,P;return At(this,function(Z){switch(Z.label){case 0:return u.Params=m||"",Cu.logger.info("Start executing project "+_),[4,r(a,_,u)];case 1:return C=Z.sent(),process.env.serverless_devs_temp_access&&(C.Access=process.env.serverless_devs_temp_access,C.access=process.env.serverless_devs_temp_access),R=new Tp({componentConfig:C,method:d,version:u.edition}),[4,R.init()];case 2:return P=Z.sent(),u.edition?u.services[_].output=P:u[_].Output=P,Cu.logger.info("Project "+_+` successfully to execute
46
+ `),c({name:_,data:P}),[2]}})})})}})}Ge.generateSynchronizeComponentExeList=ZC;var Tp=function(){function n(r){this.version="0.0.1",this.componentConfig=r.componentConfig,this.method=r.method,this.version=r.version,this.customerCommandName=r.customerCommandName,wu.default.existsSync(Rp)||wu.default.mkdirSync(Rp)}return n.prototype.init=function(){return Ot(this,void 0,void 0,function(){var r;return At(this,function(i){switch(i.label){case 0:return r=this,[4,this.getCredentials()];case 1:return r.credentials=i.sent()||{},[4,this.startExecute()];case 2:return[2,i.sent()]}})})},n.prototype.getCredentials=function(){return Ot(this,void 0,void 0,function(){var r,i,o,a,u,d,m,_;return At(this,function(c){switch(c.label){case 0:if(r=Ap(this.componentConfig),i=r.access,o=r.autoCredential,o===!1)return[2,null];c.label=1;case 1:return c.trys.push([1,5,,6]),a=Sp.default.join(Op(),"access.yaml"),u=XC.load(wu.default.readFileSync(a,"utf8")||"{}"),u[i]?[4,VC(i)]:[3,3];case 2:return m=c.sent(),[3,4];case 3:m={},c.label=4;case 4:return d=m,this.componentConfig.access=i,[2,d];case 5:return _=c.sent(),[3,6];case 6:return[2,{}]}})})},n.prototype.loadExtends=function(){var r=KC(this.componentConfig,this.version,{method:this.method}),i=null;return r&&(i=new kC.Hook(r)),i},n.prototype.loadPreExtends=function(r){return Ot(this,void 0,void 0,function(){return At(this,function(i){switch(i.label){case 0:return r?[4,r.executePreHook()]:[3,2];case 1:i.sent(),i.label=2;case 2:return[2]}})})},n.prototype.loadAfterExtend=function(r){return Ot(this,void 0,void 0,function(){return At(this,function(i){switch(i.label){case 0:return r?[4,r.executeAfterHook()]:[3,2];case 1:i.sent(),i.label=2;case 2:return[2]}})})},n.prototype.invokeMethod=function(r,i,o){return Ot(this,void 0,void 0,function(){var a,u,a,d;return At(this,function(m){switch(m.label){case 0:if(!this.customerCommandName)return[3,6];if(!r[i])return[3,5];m.label=1;case 1:return m.trys.push([1,3,,5]),[4,r[i](o)];case 2:return a=m.sent(),[2,a];case 3:return u=m.sent(),[4,new ms.HandleError({error:u,prefix:"Project "+this.componentConfig.ProjectName+" failed to execute:"}).report(u)];case 4:return m.sent(),process.exit(101),[3,5];case 5:new ms.HumanError({errorMessage:"The ["+this.method+"] command was not found.",tips:"Please check the component "+this.componentConfig.component+" has the "+this.method+" method. Serverless Devs documents\uFF1A"+xp.underline("https://github.com/Serverless-Devs/Serverless-Devs/blob/master/docs/zh/command")}),process.exit(100),m.label=6;case 6:if(!r[i])return[3,12];m.label=7;case 7:return m.trys.push([7,9,,11]),[4,r[i](o)];case 8:return a=m.sent(),[2,a];case 9:return d=m.sent(),[4,new ms.HandleError({error:d,prefix:"Project "+this.componentConfig.ProjectName+" failed to execute:"}).report(d)];case 10:return m.sent(),process.exit(101),[3,11];case 11:return[3,13];case 12:new ms.HumanWarning({warningMessage:"The ["+this.method+"] command was not found.",tips:"Please check the component "+this.componentConfig.component+" has the "+this.method+" method, Serverless Devs documents\uFF1A"+xp.underline("https://github.com/Serverless-Devs/Serverless-Devs/blob/master/docs/zh/command")}),m.label=13;case 13:return[2]}})})},n.prototype.executeCommand=function(){return Ot(this,void 0,void 0,function(){var r,i,o,a,u;return At(this,function(d){switch(d.label){case 0:return r=YC(this.componentConfig,this.version,{method:this.method,credentials:this.credentials}),i=Ap(this.componentConfig).name,o=Cu.configSet.getConfig("registry")||BC.DEFAULT_REGIRSTRY,[4,zC(i,o)];case 1:return a=d.sent(),[4,this.invokeMethod(a,this.method,r)];case 2:return u=d.sent(),[2,u]}})})},n.prototype.startExecute=function(){return Ot(this,void 0,void 0,function(){var r,i,o,a,u;return At(this,function(d){switch(d.label){case 0:return r={},i=process.env.temp_params||"",o=i.includes("--help")||i.includes("-h"),process.env["skip-actions"]==="true"||o?(u=null,[3,3]):[3,1];case 1:return[4,this.loadExtends()];case 2:u=d.sent(),d.label=3;case 3:return a=u,[4,this.loadPreExtends(a)];case 4:return d.sent(),[4,this.executeCommand()];case 5:return r=d.sent(),[4,this.loadAfterExtend(a)];case 6:return d.sent(),[2,r]}})})},n}();Ge.ComponentExeCute=Tp});var $p=I(Rt=>{"use strict";var Lp=Rt&&Rt.__awaiter||function(n,r,i,o){function a(u){return u instanceof i?u:new i(function(d){d(u)})}return new(i||(i=Promise))(function(u,d){function m(v){try{c(o.next(v))}catch(C){d(C)}}function _(v){try{c(o.throw(v))}catch(C){d(C)}}function c(v){v.done?u(v.value):a(v.value).then(m,_)}c((o=o.apply(n,r||[])).next())})},Dp=Rt&&Rt.__generator||function(n,r){var i={label:0,sent:function(){if(u[0]&1)throw u[1];return u[1]},trys:[],ops:[]},o,a,u,d;return d={next:m(0),throw:m(1),return:m(2)},typeof Symbol=="function"&&(d[Symbol.iterator]=function(){return this}),d;function m(c){return function(v){return _([c,v])}}function _(c){if(o)throw new TypeError("Generator is already executing.");for(;i;)try{if(o=1,a&&(u=c[0]&2?a.return:c[0]?a.throw||((u=a.return)&&u.call(a),0):a.next)&&!(u=u.call(a,c[1])).done)return u;switch(a=0,u&&(c=[c[0]&2,u.value]),c[0]){case 0:case 1:u=c;break;case 4:return i.label++,{value:c[1],done:!1};case 5:i.label++,a=c[1],c=[0];continue;case 7:c=i.ops.pop(),i.trys.pop();continue;default:if(u=i.trys,!(u=u.length>0&&u[u.length-1])&&(c[0]===6||c[0]===2)){i=0;continue}if(c[0]===3&&(!u||c[1]>u[0]&&c[1]<u[3])){i.label=c[1];break}if(c[0]===6&&i.label<u[1]){i.label=u[1],u=c;break}if(u&&i.label<u[2]){i.label=u[2],i.ops.push(c);break}u[2]&&i.ops.pop(),i.trys.pop();continue}c=r.call(n,i)}catch(v){c=[6,v],a=0}finally{o=u=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}},JC=Rt&&Rt.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(Rt,"__esModule",{value:!0});Rt.CommandManager=void 0;var Np=ds(),QC=hs(),zn=kn(),Su=Pp(),tn=rr(),eS=JC(Te()),qp=eS.default.colors,tS=Qr(),rS=function(){function n(r,i,o,a){this.templateFile=r,this.method=i,this.customerCommandName=o,this.deployParams=a}return n.prototype.assemblyProjectConfig=function(r,i,o){return Lp(this,void 0,void 0,function(){var a,u;return Dp(this,function(d){switch(d.label){case 0:return[4,r.getRealVariables(o)];case 1:return a=d.sent(),u=(0,QC.getServiceConfig)(a,i),u.appName=a.name,u.ProjectName=i,this.deployParams&&(u.params=this.deployParams),[2,u]}})})},n.prototype.init=function(){return Lp(this,void 0,void 0,function(){var r,i,o,a,u,d,m,_,c,v,C,R,P,C,Z,oe,be;return Dp(this,function(Y){switch(Y.label){case 0:return Y.trys.push([0,9,,11]),zn.logger.info("Start ..."),r=(0,tn.checkTemplateFile)(this.templateFile),r?(i={},o=new Np.Parse(r),a=o.getOriginalParsedObj(),[4,o.getRealVariables(a)]):[3,7];case 1:return u=Y.sent(),d=new Np.Analysis(u,o.dependenciesMap),m=d.getProjectOrder(),this.customerCommandName||m.length===1?(_=m[0],[4,this.assemblyProjectConfig(o,this.customerCommandName||_,a)]):[3,4];case 2:return c=Y.sent(),process.env.serverless_devs_temp_access&&(c.Access=process.env.serverless_devs_temp_access,c.access=process.env.serverless_devs_temp_access),v=new Su.ComponentExeCute({componentConfig:c,method:this.method,version:a.edition,customerCommandName:this.customerCommandName}),[4,v.init()];case 3:return C=Y.sent(),C&&(i[c.ProjectName]=C),[3,6];case 4:return R=this.deployParams||"",zn.logger.info("It is detected that your project has the following projects < "+m.join(",")+" > to be execute"),P=(0,Su.generateSynchronizeComponentExeList)({list:m,parse:o,parsedObj:a,method:this.method,params:R},this.assemblyProjectConfig.bind(this)),[4,(0,Su.synchronizeExecuteComponentList)(P)];case 5:C=Y.sent();for(Z in C)m.includes(Z)&&C[Z]&&(i[Z]=C[Z]);Y.label=6;case 6:return oe=JSON.parse(JSON.stringify(i)),Object.keys(i).length===0?zn.logger.success("End of method: "+this.method):zn.logger.output(oe),[3,8];case 7:zn.logger.error(`Failed to execute:
47
47
 
48
- `.concat((0,tn.emoji)("\u274C")," Message: Cannot find s.yaml / s.yml / template.yaml / template.yml file, please check the directory ").concat(this.templateFile,`
49
- `).concat((0,tn.emoji)("\u{1F9ED}"),` If you want to use Serverless Devs, you should have a s.yaml or use [s cli] command.
50
- `).concat((0,tn.emoji)("1\uFE0F\u20E3")," Yaml document: ").concat(qp.underline("https://github.com/Serverless-Devs/docs/blob/master/zh/yaml.md"),`
51
- `).concat((0,tn.emoji)("2\uFE0F\u20E3"),` Cli document: [s cli -h]
52
- `).concat((0,tn.emoji)("\u{1F608}")," If you have questions, please tell us: ").concat(qp.underline("https://github.com/Serverless-Devs/Serverless-Devs/issues"),`
53
- `)),process.exit(1),Y.label=8;case 8:return[3,11];case 9:return be=Y.sent(),[4,new tS.HandleError({error:be,prefix:"Failed to execute:"}).report(be)];case 10:return Y.sent(),process.exit(1),[3,11];case 11:return[2]}})})},n}();Rt.CommandManager=rS});var Fp=I(vs=>{"use strict";Object.defineProperty(vs,"__esModule",{value:!0});vs.CommandManager=void 0;var nS=$p();Object.defineProperty(vs,"CommandManager",{enumerable:!0,get:function(){return nS.CommandManager}})});var xu=I(Xn=>{"use strict";var iS=Xn&&Xn.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(Xn,"__esModule",{value:!0});var Mp=iS(Te()),sS=Mp.default.Logger,oS=Mp.default.spinner,Sr=new sS("S-CLI"),uS=function(){function n(){}return n.log=function(r){Sr.log(r)},n.info=function(r){Sr.info(r)},n.debug=function(r){Sr.debug(r)},n.error=function(r){Sr.error(r)},n.warning=function(r){Sr.warn(r)},n.success=function(r){Sr.log(r,"green")},n.spinner=function(r){return oS(r)},n.output=function(r){return Sr.output(r)},n}();Xn.default=uS});var zp=I(te=>{"use strict";var xr=te&&te.__awaiter||function(n,r,i,o){function a(u){return u instanceof i?u:new i(function(d){d(u)})}return new(i||(i=Promise))(function(u,d){function m(v){try{c(o.next(v))}catch(C){d(C)}}function _(v){try{c(o.throw(v))}catch(C){d(C)}}function c(v){v.done?u(v.value):a(v.value).then(m,_)}c((o=o.apply(n,r||[])).next())})},Or=te&&te.__generator||function(n,r){var i={label:0,sent:function(){if(u[0]&1)throw u[1];return u[1]},trys:[],ops:[]},o,a,u,d;return d={next:m(0),throw:m(1),return:m(2)},typeof Symbol=="function"&&(d[Symbol.iterator]=function(){return this}),d;function m(c){return function(v){return _([c,v])}}function _(c){if(o)throw new TypeError("Generator is already executing.");for(;i;)try{if(o=1,a&&(u=c[0]&2?a.return:c[0]?a.throw||((u=a.return)&&u.call(a),0):a.next)&&!(u=u.call(a,c[1])).done)return u;switch(a=0,u&&(c=[c[0]&2,u.value]),c[0]){case 0:case 1:u=c;break;case 4:return i.label++,{value:c[1],done:!1};case 5:i.label++,a=c[1],c=[0];continue;case 7:c=i.ops.pop(),i.trys.pop();continue;default:if(u=i.trys,!(u=u.length>0&&u[u.length-1])&&(c[0]===6||c[0]===2)){i=0;continue}if(c[0]===3&&(!u||c[1]>u[0]&&c[1]<u[3])){i.label=c[1];break}if(c[0]===6&&i.label<u[1]){i.label=u[1],u=c;break}if(u&&i.label<u[2]){i.label=u[2],i.ops.push(c);break}u[2]&&i.ops.pop(),i.trys.pop();continue}c=r.call(n,i)}catch(v){c=[6,v],a=0}finally{o=u=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}},Yn=te&&te.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(te,"__esModule",{value:!0});te.recordCommandHistory=te.registerVerbose=te.registerUniversalCommand=te.registerCustomerCommand=te.registerCommandChecker=te.createCustomerCommand=te.getCustomerCommandInfo=te.getParsedTemplateObj=te.getCommandDetail=te.createUniversalCommand=void 0;var aS=Yn(require("os")),jp=Yn(require("path")),Hp=ko(),lS=Fp(),Ou=ds(),cS=gu(),fS=Yn(os()),_s=Yn(xu()),Up=rr(),Au=Yn(Te()),hS=Au.default.loadComponent,Ru=Au.default.fse,pS=Au.default.jsyaml,dS=Ou.version.getSubcommand,gS=Ou.version.getServiceConfig;function Iu(n,r,i){for(var o=new Hp.Command(n),a=[],u=[],d=r,m=!1,_=0;_<process.argv.length;_++)m?u.push(process.argv[_]):a.push(process.argv[_]),process.argv[_]===n&&(m=!0);return u.length!==0&&(process.env.temp_params=u.join(" "),process.temp_params=u),process.argv=a,o.description(i||"").action(function(){var c=process.env[cS.PROCESS_ENV_TEMPLATE_NAME];if(c){var v=new lS.CommandManager(c,n,d,process.env.temp_params);v.init()}}),o}te.createUniversalCommand=Iu;function mS(n,r,i){return xr(this,void 0,void 0,function(){var o;return Or(this,function(a){return o=[],[2,o]})})}te.getCommandDetail=mS;function Tu(n){return xr(this,void 0,void 0,function(){var r,i,o;return Or(this,function(a){switch(a.label){case 0:return r=new Ou.Parse(n),i=r.getOriginalParsedObj(),[4,r.getRealVariables(i)];case 1:return o=a.sent(),[2,o]}})})}te.getParsedTemplateObj=Tu;function Pu(n){return dS(n)}te.getCustomerCommandInfo=Pu;function vS(n,r){var i=n.length,o=new Array(r-i).fill(" ");return"".concat(n).concat(o.join("")," : ")}function Gp(n){return xr(this,void 0,void 0,function(){var r,i,o,a,u,d=this;return Or(this,function(m){switch(m.label){case 0:return r=[],[4,Tu(n)];case 1:return i=m.sent(),o=Pu(i),a=o.map(function(_){return xr(d,void 0,void 0,function(){var c;return Or(this,function(v){return c=gS(i,_),[2,{projectName:_,projectDocDetail:c}]})})}),[4,Promise.all(a)];case 2:return u=m.sent(),u.forEach(function(_){var c=_.projectName,v=_.projectDocDetail,C=new Hp.Command(c),R="".concat((0,Up.emoji)("\u{1F449}")," This is a customer command please use [s ").concat(c," -h] obtain the documentation");C.description(R);var P=process.argv.slice(2),Z=P[0],oe=P[1];Z===c&&oe&&oe.indexOf("-")!==0&&C.addCommand(Iu(oe,c)),C.option("-h, --help","Print usage document"),C.action(function(){return xr(d,void 0,void 0,function(){var be,Y,lt,ve,pe,xe,We,We,rn;return Or(this,function(It){switch(It.label){case 0:return be=v.component,[4,hS(be)];case 1:return Y=It.sent(),Y?Y.__doc&&Y.__doc().length>1685?(lt=Y.__doc(c),_s.default.info(`
54
- `.concat(lt)),[3,6]):[3,2]:[3,7];case 2:return It.trys.push([2,5,,6]),ve=jp.default.join(Y.__path,"publish.yml"),[4,Ru.existsSync(ve)];case 3:return It.sent()||(ve=jp.default.join(Y.__path,"publish.yaml")),[4,pS.load(Ru.readFileSync(ve,"utf8"))];case 4:if(pe=It.sent(),console.log(`
55
- `.concat(pe.Name,"@").concat(pe.Version,": ").concat(pe.Description,`
56
- `)),xe=0,pe.Commands){for(We in pe.Commands)We.length>xe&&(xe=We.length);for(We in pe.Commands)console.log(" ".concat(vS(We,xe)," ").concat(pe.Commands[We]));console.log(`
57
- `.concat(pe.HomePage?"".concat((0,Up.emoji)("\u{1F9ED}")," More information: ")+pe.HomePage+`
58
- `:""))}return[3,6];case 5:return rn=It.sent(),_s.default.error("Help information could not be found"),[3,6];case 6:return[3,8];case 7:_s.default.error("Help information could not be found"),It.label=8;case 8:return[2]}})})}),r.push(C)}),[2,r]}})})}te.createCustomerCommand=Gp;function Wp(n){n.on("command:*",function(r){var i=n.commands.map(function(o){return o.name()});i.includes(r[0])||(_s.default.error(" error: unknown command ".concat(r[0])),n.help())})}te.registerCommandChecker=Wp;function Bp(n,r){return xr(this,void 0,void 0,function(){var i;return Or(this,function(o){switch(o.label){case 0:return r?[4,Gp(r)]:[3,2];case 1:i=o.sent(),i.forEach(function(a){n.addCommand(a)}),o.label=2;case 2:return[2]}})})}te.registerCustomerCommand=Bp;function kp(n,r){return xr(this,void 0,void 0,function(){var i,o;return Or(this,function(a){switch(a.label){case 0:return r?[4,Tu(r)]:[3,2];case 1:i=a.sent(),o=Pu(i),process.argv[2]&&!o.includes(process.argv[2])&&!["-h","--help"].includes(process.argv[2])&&n.addCommand(Iu(process.argv[2])),a.label=2;case 2:return[2]}})})}te.registerUniversalCommand=kp;function _S(n){process.argv.includes("--verbose")&&(process.env.VERBOSE=n.verbose)}te.registerVerbose=_S;function Vp(n){var r=fS.default.getHistoryFile();Ru.appendFileSync(r,n.join(",")+aS.default.EOL)}te.recordCommandHistory=Vp;te.default={registerCommandChecker:Wp,recordCommandHistory:Vp,registerCustomerCommand:Bp,registerUniversalCommand:kp}});var Xp=I(Lu=>{"use strict";Object.defineProperty(Lu,"__esModule",{value:!0});Lu.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 Yp=I(Du=>{"use strict";Object.defineProperty(Du,"__esModule",{value:!0});Du.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 Zp=I(Kn=>{"use strict";var Kp=Kn&&Kn.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(Kn,"__esModule",{value:!0});var yS=rr(),ES=Kp(Xp()),wS=Kp(Yp()),Nu={en:wS.default,zh:ES.default},bS=function(n){var r=(0,yS.getLang)(),i=Nu[r]?Nu[r][n]:Nu.en[n];return i||n};Kn.default=bS});var kn=I(de=>{"use strict";var Wt=de&&de.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(de,"__esModule",{value:!0});de.getYamlPath=de.i18n=de.logger=de.registerAction=de.urlParser=de.storage=de.configSet=de.common=void 0;var Jp=Wt(require("path")),CS=Wt(Te()),Qp=CS.default.fse,SS=rr();Object.defineProperty(de,"common",{enumerable:!0,get:function(){return Wt(SS).default}});var xS=as();Object.defineProperty(de,"configSet",{enumerable:!0,get:function(){return Wt(xS).default}});var OS=os();Object.defineProperty(de,"storage",{enumerable:!0,get:function(){return Wt(OS).default}});var AS=sp();Object.defineProperty(de,"urlParser",{enumerable:!0,get:function(){return Wt(AS).default}});var RS=zp();Object.defineProperty(de,"registerAction",{enumerable:!0,get:function(){return Wt(RS).default}});var IS=xu();Object.defineProperty(de,"logger",{enumerable:!0,get:function(){return Wt(IS).default}});var TS=Zp();Object.defineProperty(de,"i18n",{enumerable:!0,get:function(){return Wt(TS).default}});var PS=function(n,r){var i=Jp.default.join(n,"".concat(r,".yaml")),o=Jp.default.join(n,"".concat(r,".yml")),a=Qp.existsSync(i)?i:Qp.existsSync(o)?o:void 0;return a};de.getYamlPath=PS});"use strict";var LS=exports&&exports.__awaiter||function(n,r,i,o){function a(u){return u instanceof i?u:new i(function(d){d(u)})}return new(i||(i=Promise))(function(u,d){function m(v){try{c(o.next(v))}catch(C){d(C)}}function _(v){try{c(o.throw(v))}catch(C){d(C)}}function c(v){v.done?u(v.value):a(v.value).then(m,_)}c((o=o.apply(n,r||[])).next())})},DS=exports&&exports.__generator||function(n,r){var i={label:0,sent:function(){if(u[0]&1)throw u[1];return u[1]},trys:[],ops:[]},o,a,u,d;return d={next:m(0),throw:m(1),return:m(2)},typeof Symbol=="function"&&(d[Symbol.iterator]=function(){return this}),d;function m(c){return function(v){return _([c,v])}}function _(c){if(o)throw new TypeError("Generator is already executing.");for(;i;)try{if(o=1,a&&(u=c[0]&2?a.return:c[0]?a.throw||((u=a.return)&&u.call(a),0):a.next)&&!(u=u.call(a,c[1])).done)return u;switch(a=0,u&&(c=[c[0]&2,u.value]),c[0]){case 0:case 1:u=c;break;case 4:return i.label++,{value:c[1],done:!1};case 5:i.label++,a=c[1],c=[0];continue;case 7:c=i.ops.pop(),i.trys.pop();continue;default:if(u=i.trys,!(u=u.length>0&&u[u.length-1])&&(c[0]===6||c[0]===2)){i=0;continue}if(c[0]===3&&(!u||c[1]>u[0]&&c[1]<u[3])){i.label=c[1];break}if(c[0]===6&&i.label<u[1]){i.label=u[1],u=c;break}if(u&&i.label<u[2]){i.label=u[2],i.ops.push(c);break}u[2]&&i.ops.pop(),i.trys.pop();continue}c=r.call(n,i)}catch(v){c=[6,v],a=0}finally{o=u=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}},ed=exports&&exports.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(exports,"__esModule",{value:!0});exports.registryInquire=void 0;var ys=ed(ko()),td=kn(),NS=Qr(),rd=ed(Te()),nd=rr(),id=rd.default.inquirer,qu=as(),qS=rd.default.colors,$u="custom",$S=[{key:"http://registry.devsapp.cn/simple",name:"serverless registry [http://registry.devsapp.cn/simple]",value:"http://registry.devsapp.cn/simple"},{key:"https://api.github.com/repos",name:"github registry [https://api.github.com/repos]",value:"https://api.github.com/repos"},{key:"http://gitee.registry.devsapp.cn/simple",name:"gitee registry [http://gitee.registry.devsapp.cn/simple] ",value:"http://gitee.registry.devsapp.cn/simple"},{key:$u,name:"custom registry",value:$u}];exports.registryInquire=[{type:"list",name:"registry",message:"Choose a registry?",choices:$S}];ys.default.name("s set registry").usage("[options]").helpOption("-h, --help","Display help for command").addHelpCommand(!1).description(`Set registry information.
48
+ `+(0,tn.emoji)("\u274C")+" Message: Cannot find s.yaml / s.yml / template.yaml / template.yml file, please check the directory "+this.templateFile+`
49
+ `+(0,tn.emoji)("\u{1F9ED}")+` If you want to use Serverless Devs, you should have a s.yaml or use [s cli] command.
50
+ `+(0,tn.emoji)("1\uFE0F\u20E3")+" Yaml document: "+qp.underline("https://github.com/Serverless-Devs/docs/blob/master/zh/yaml.md")+`
51
+ `+(0,tn.emoji)("2\uFE0F\u20E3")+` Cli document: [s cli -h]
52
+ `+(0,tn.emoji)("\u{1F608}")+" If you have questions, please tell us: "+qp.underline("https://github.com/Serverless-Devs/Serverless-Devs/issues")+`
53
+ `),process.exit(1),Y.label=8;case 8:return[3,11];case 9:return be=Y.sent(),[4,new tS.HandleError({error:be,prefix:"Failed to execute:"}).report(be)];case 10:return Y.sent(),process.exit(1),[3,11];case 11:return[2]}})})},n}();Rt.CommandManager=rS});var Fp=I(vs=>{"use strict";Object.defineProperty(vs,"__esModule",{value:!0});vs.CommandManager=void 0;var nS=$p();Object.defineProperty(vs,"CommandManager",{enumerable:!0,get:function(){return nS.CommandManager}})});var xu=I(Xn=>{"use strict";var iS=Xn&&Xn.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(Xn,"__esModule",{value:!0});var Mp=iS(Te()),sS=Mp.default.Logger,oS=Mp.default.spinner,Sr=new sS("S-CLI"),uS=function(){function n(){}return n.log=function(r){Sr.log(r)},n.info=function(r){Sr.info(r)},n.debug=function(r){Sr.debug(r)},n.error=function(r){Sr.error(r)},n.warning=function(r){Sr.warn(r)},n.success=function(r){Sr.log(r,"green")},n.spinner=function(r){return oS(r)},n.output=function(r){return Sr.output(r)},n}();Xn.default=uS});var zp=I(te=>{"use strict";var xr=te&&te.__awaiter||function(n,r,i,o){function a(u){return u instanceof i?u:new i(function(d){d(u)})}return new(i||(i=Promise))(function(u,d){function m(v){try{c(o.next(v))}catch(C){d(C)}}function _(v){try{c(o.throw(v))}catch(C){d(C)}}function c(v){v.done?u(v.value):a(v.value).then(m,_)}c((o=o.apply(n,r||[])).next())})},Or=te&&te.__generator||function(n,r){var i={label:0,sent:function(){if(u[0]&1)throw u[1];return u[1]},trys:[],ops:[]},o,a,u,d;return d={next:m(0),throw:m(1),return:m(2)},typeof Symbol=="function"&&(d[Symbol.iterator]=function(){return this}),d;function m(c){return function(v){return _([c,v])}}function _(c){if(o)throw new TypeError("Generator is already executing.");for(;i;)try{if(o=1,a&&(u=c[0]&2?a.return:c[0]?a.throw||((u=a.return)&&u.call(a),0):a.next)&&!(u=u.call(a,c[1])).done)return u;switch(a=0,u&&(c=[c[0]&2,u.value]),c[0]){case 0:case 1:u=c;break;case 4:return i.label++,{value:c[1],done:!1};case 5:i.label++,a=c[1],c=[0];continue;case 7:c=i.ops.pop(),i.trys.pop();continue;default:if(u=i.trys,!(u=u.length>0&&u[u.length-1])&&(c[0]===6||c[0]===2)){i=0;continue}if(c[0]===3&&(!u||c[1]>u[0]&&c[1]<u[3])){i.label=c[1];break}if(c[0]===6&&i.label<u[1]){i.label=u[1],u=c;break}if(u&&i.label<u[2]){i.label=u[2],i.ops.push(c);break}u[2]&&i.ops.pop(),i.trys.pop();continue}c=r.call(n,i)}catch(v){c=[6,v],a=0}finally{o=u=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}},Yn=te&&te.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(te,"__esModule",{value:!0});te.recordCommandHistory=te.registerVerbose=te.registerUniversalCommand=te.registerCustomerCommand=te.registerCommandChecker=te.createCustomerCommand=te.getCustomerCommandInfo=te.getParsedTemplateObj=te.getCommandDetail=te.createUniversalCommand=void 0;var aS=Yn(require("os")),jp=Yn(require("path")),Hp=ko(),lS=Fp(),Ou=ds(),cS=gu(),fS=Yn(os()),_s=Yn(xu()),Up=rr(),Au=Yn(Te()),hS=Au.default.loadComponent,Ru=Au.default.fse,pS=Au.default.jsyaml,dS=Ou.version.getSubcommand,gS=Ou.version.getServiceConfig;function Iu(n,r,i){for(var o=new Hp.Command(n),a=[],u=[],d=r,m=!1,_=0;_<process.argv.length;_++)m?u.push(process.argv[_]):a.push(process.argv[_]),process.argv[_]===n&&(m=!0);return u.length!==0&&(process.env.temp_params=u.join(" "),process.temp_params=u),process.argv=a,o.description(i||"").action(function(){var c=process.env[cS.PROCESS_ENV_TEMPLATE_NAME];if(c){var v=new lS.CommandManager(c,n,d,process.env.temp_params);v.init()}}),o}te.createUniversalCommand=Iu;function mS(n,r,i){return xr(this,void 0,void 0,function(){var o;return Or(this,function(a){return o=[],[2,o]})})}te.getCommandDetail=mS;function Tu(n){return xr(this,void 0,void 0,function(){var r,i,o;return Or(this,function(a){switch(a.label){case 0:return r=new Ou.Parse(n),i=r.getOriginalParsedObj(),[4,r.getRealVariables(i)];case 1:return o=a.sent(),[2,o]}})})}te.getParsedTemplateObj=Tu;function Pu(n){return dS(n)}te.getCustomerCommandInfo=Pu;function vS(n,r){var i=n.length,o=new Array(r-i).fill(" ");return""+n+o.join("")+" : "}function Gp(n){return xr(this,void 0,void 0,function(){var r,i,o,a,u,d=this;return Or(this,function(m){switch(m.label){case 0:return r=[],[4,Tu(n)];case 1:return i=m.sent(),o=Pu(i),a=o.map(function(_){return xr(d,void 0,void 0,function(){var c;return Or(this,function(v){return c=gS(i,_),[2,{projectName:_,projectDocDetail:c}]})})}),[4,Promise.all(a)];case 2:return u=m.sent(),u.forEach(function(_){var c=_.projectName,v=_.projectDocDetail,C=new Hp.Command(c),R=(0,Up.emoji)("\u{1F449}")+" This is a customer command please use [s "+c+" -h] obtain the documentation";C.description(R);var P=process.argv.slice(2),Z=P[0],oe=P[1];Z===c&&oe&&oe.indexOf("-")!==0&&C.addCommand(Iu(oe,c)),C.option("-h, --help","Print usage document"),C.action(function(){return xr(d,void 0,void 0,function(){var be,Y,lt,ve,pe,xe,We,We,rn;return Or(this,function(It){switch(It.label){case 0:return be=v.component,[4,hS(be)];case 1:return Y=It.sent(),Y?Y.__doc&&Y.__doc().length>1685?(lt=Y.__doc(c),_s.default.info(`
54
+ `+lt),[3,6]):[3,2]:[3,7];case 2:return It.trys.push([2,5,,6]),ve=jp.default.join(Y.__path,"publish.yml"),[4,Ru.existsSync(ve)];case 3:return It.sent()||(ve=jp.default.join(Y.__path,"publish.yaml")),[4,pS.load(Ru.readFileSync(ve,"utf8"))];case 4:if(pe=It.sent(),console.log(`
55
+ `+pe.Name+"@"+pe.Version+": "+pe.Description+`
56
+ `),xe=0,pe.Commands){for(We in pe.Commands)We.length>xe&&(xe=We.length);for(We in pe.Commands)console.log(" "+vS(We,xe)+" "+pe.Commands[We]);console.log(`
57
+ `+(pe.HomePage?(0,Up.emoji)("\u{1F9ED}")+" More information: "+pe.HomePage+`
58
+ `:""))}return[3,6];case 5:return rn=It.sent(),_s.default.error("Help information could not be found"),[3,6];case 6:return[3,8];case 7:_s.default.error("Help information could not be found"),It.label=8;case 8:return[2]}})})}),r.push(C)}),[2,r]}})})}te.createCustomerCommand=Gp;function Wp(n){n.on("command:*",function(r){var i=n.commands.map(function(o){return o.name()});i.includes(r[0])||(_s.default.error(" error: unknown command "+r[0]),n.help())})}te.registerCommandChecker=Wp;function Bp(n,r){return xr(this,void 0,void 0,function(){var i;return Or(this,function(o){switch(o.label){case 0:return r?[4,Gp(r)]:[3,2];case 1:i=o.sent(),i.forEach(function(a){n.addCommand(a)}),o.label=2;case 2:return[2]}})})}te.registerCustomerCommand=Bp;function kp(n,r){return xr(this,void 0,void 0,function(){var i,o;return Or(this,function(a){switch(a.label){case 0:return r?[4,Tu(r)]:[3,2];case 1:i=a.sent(),o=Pu(i),process.argv[2]&&!o.includes(process.argv[2])&&!["-h","--help"].includes(process.argv[2])&&n.addCommand(Iu(process.argv[2])),a.label=2;case 2:return[2]}})})}te.registerUniversalCommand=kp;function _S(n){process.argv.includes("--verbose")&&(process.env.VERBOSE=n.verbose)}te.registerVerbose=_S;function Vp(n){var r=fS.default.getHistoryFile();Ru.appendFileSync(r,n.join(",")+aS.default.EOL)}te.recordCommandHistory=Vp;te.default={registerCommandChecker:Wp,recordCommandHistory:Vp,registerCustomerCommand:Bp,registerUniversalCommand:kp}});var Xp=I(Lu=>{"use strict";Object.defineProperty(Lu,"__esModule",{value:!0});Lu.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 Yp=I(Du=>{"use strict";Object.defineProperty(Du,"__esModule",{value:!0});Du.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 Zp=I(Kn=>{"use strict";var Kp=Kn&&Kn.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(Kn,"__esModule",{value:!0});var yS=rr(),ES=Kp(Xp()),wS=Kp(Yp()),Nu={en:wS.default,zh:ES.default},bS=function(n){var r=(0,yS.getLang)(),i=Nu[r]?Nu[r][n]:Nu.en[n];return i||n};Kn.default=bS});var kn=I(de=>{"use strict";var Wt=de&&de.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(de,"__esModule",{value:!0});de.getYamlPath=de.i18n=de.logger=de.registerAction=de.urlParser=de.storage=de.configSet=de.common=void 0;var Jp=Wt(require("path")),CS=Wt(Te()),Qp=CS.default.fse,SS=rr();Object.defineProperty(de,"common",{enumerable:!0,get:function(){return Wt(SS).default}});var xS=as();Object.defineProperty(de,"configSet",{enumerable:!0,get:function(){return Wt(xS).default}});var OS=os();Object.defineProperty(de,"storage",{enumerable:!0,get:function(){return Wt(OS).default}});var AS=sp();Object.defineProperty(de,"urlParser",{enumerable:!0,get:function(){return Wt(AS).default}});var RS=zp();Object.defineProperty(de,"registerAction",{enumerable:!0,get:function(){return Wt(RS).default}});var IS=xu();Object.defineProperty(de,"logger",{enumerable:!0,get:function(){return Wt(IS).default}});var TS=Zp();Object.defineProperty(de,"i18n",{enumerable:!0,get:function(){return Wt(TS).default}});var PS=function(n,r){var i=Jp.default.join(n,r+".yaml"),o=Jp.default.join(n,r+".yml"),a=Qp.existsSync(i)?i:Qp.existsSync(o)?o:void 0;return a};de.getYamlPath=PS});"use strict";var LS=exports&&exports.__awaiter||function(n,r,i,o){function a(u){return u instanceof i?u:new i(function(d){d(u)})}return new(i||(i=Promise))(function(u,d){function m(v){try{c(o.next(v))}catch(C){d(C)}}function _(v){try{c(o.throw(v))}catch(C){d(C)}}function c(v){v.done?u(v.value):a(v.value).then(m,_)}c((o=o.apply(n,r||[])).next())})},DS=exports&&exports.__generator||function(n,r){var i={label:0,sent:function(){if(u[0]&1)throw u[1];return u[1]},trys:[],ops:[]},o,a,u,d;return d={next:m(0),throw:m(1),return:m(2)},typeof Symbol=="function"&&(d[Symbol.iterator]=function(){return this}),d;function m(c){return function(v){return _([c,v])}}function _(c){if(o)throw new TypeError("Generator is already executing.");for(;i;)try{if(o=1,a&&(u=c[0]&2?a.return:c[0]?a.throw||((u=a.return)&&u.call(a),0):a.next)&&!(u=u.call(a,c[1])).done)return u;switch(a=0,u&&(c=[c[0]&2,u.value]),c[0]){case 0:case 1:u=c;break;case 4:return i.label++,{value:c[1],done:!1};case 5:i.label++,a=c[1],c=[0];continue;case 7:c=i.ops.pop(),i.trys.pop();continue;default:if(u=i.trys,!(u=u.length>0&&u[u.length-1])&&(c[0]===6||c[0]===2)){i=0;continue}if(c[0]===3&&(!u||c[1]>u[0]&&c[1]<u[3])){i.label=c[1];break}if(c[0]===6&&i.label<u[1]){i.label=u[1],u=c;break}if(u&&i.label<u[2]){i.label=u[2],i.ops.push(c);break}u[2]&&i.ops.pop(),i.trys.pop();continue}c=r.call(n,i)}catch(v){c=[6,v],a=0}finally{o=u=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}},ed=exports&&exports.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(exports,"__esModule",{value:!0});exports.registryInquire=void 0;var ys=ed(ko()),td=kn(),NS=Qr(),rd=ed(Te()),nd=rr(),id=rd.default.inquirer,qu=as(),qS=rd.default.colors,$u="custom",$S=[{key:"http://registry.devsapp.cn/simple",name:"serverless registry [http://registry.devsapp.cn/simple]",value:"http://registry.devsapp.cn/simple"},{key:"https://api.github.com/repos",name:"github registry [https://api.github.com/repos]",value:"https://api.github.com/repos"},{key:"http://gitee.registry.devsapp.cn/simple",name:"gitee registry [http://gitee.registry.devsapp.cn/simple] ",value:"http://gitee.registry.devsapp.cn/simple"},{key:$u,name:"custom registry",value:$u}];exports.registryInquire=[{type:"list",name:"registry",message:"Choose a registry?",choices:$S}];ys.default.name("s set registry").usage("[options]").helpOption("-h, --help","Display help for command").addHelpCommand(!1).description(`Set registry information.
59
59
 
60
60
  Example:
61
61
  $ s set registry
62
62
  $ s set registry http://registry.devsapp.cn/simple
63
63
 
64
- `.concat((0,nd.emoji)("\u{1F4D6}")," Document: ").concat(qS.underline("https://github.com/Serverless-Devs/Serverless-Devs/tree/master/docs/zh/command/set.md"))).parse(process.argv);(function(){return LS(void 0,void 0,void 0,function(){var n,r,i;return DS(this,function(o){switch(o.label){case 0:return ys.default.args.length!==0?[3,4]:(td.logger.log(`
65
- `.concat((0,nd.emoji)("\u{1F50E}")," Current registry: ").concat((0,qu.getConfig)("registry","http://registry.devsapp.cn/simple"),`
66
- `)),[4,id.prompt(exports.registryInquire)]);case 1:return n=o.sent(),n.registry!==$u?[3,3]:[4,id.prompt([{type:"input",name:"registry",message:"Please input your customer registry?"}])];case 2:n=o.sent(),o.label=3;case 3:r=n.registry,(0,qu.setConfig)("registry",r),o.label=4;case 4:return ys.default.args.length>0&&(i=ys.default.args[0],i&&((0,qu.setConfig)("registry",i),td.logger.success("Setup succeeded"))),[2]}})})})().catch(function(n){throw new NS.CommandError(n.message)});
64
+ `+(0,nd.emoji)("\u{1F4D6}")+" Document: "+qS.underline("https://github.com/Serverless-Devs/Serverless-Devs/tree/master/docs/zh/command/set.md")).parse(process.argv);(function(){return LS(void 0,void 0,void 0,function(){var n,r,i;return DS(this,function(o){switch(o.label){case 0:return ys.default.args.length!==0?[3,4]:(td.logger.log(`
65
+ `+(0,nd.emoji)("\u{1F50E}")+" Current registry: "+(0,qu.getConfig)("registry","http://registry.devsapp.cn/simple")+`
66
+ `),[4,id.prompt(exports.registryInquire)]);case 1:return n=o.sent(),n.registry!==$u?[3,3]:[4,id.prompt([{type:"input",name:"registry",message:"Please input your customer registry?"}])];case 2:n=o.sent(),o.label=3;case 3:r=n.registry,(0,qu.setConfig)("registry",r),o.label=4;case 4:return ys.default.args.length>0&&(i=ys.default.args[0],i&&((0,qu.setConfig)("registry",i),td.logger.success("Setup succeeded"))),[2]}})})})().catch(function(n){throw new NS.CommandError(n.message)});
67
67
  /**
68
68
  * @license
69
69
  * Lodash <https://lodash.com/>