mgexcli 1.0.9 → 1.0.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/bin/index.js CHANGED
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- "use strict";function r(){var n=["1702066RVFBzV","11680pTfgWW","752028fHTJfb","69018Xzqsms","1GKMUkY","847115pBIJvQ","998212wVHmnQ","7049410ZCzhUa","322RcOjAh","5508FCBQpd"];return(r=function(){return n})()}function n(n,t){return n-=294,r()[n]}require("../index.js"),function(){for(var t=n,s=r();;)try{if(549096===parseInt(t(298))/1*(-parseInt(t(294))/2)+parseInt(t(296))/3+parseInt(t(300))/4+-parseInt(t(299))/5+-parseInt(t(297))/6*(parseInt(t(302))/7)+parseInt(t(295))/8*(parseInt(t(303))/9)+parseInt(t(301))/10)break;s.push(s.shift())}catch(r){s.push(s.shift())}}();
2
+ "use strict";function n(n,r){return n-=275,t()[n]}function t(){var n=["5992QutKic","2369750nInhaZ","7mRpCYj","7758970WPxyTh","20835paQKuv","291AVdFoN","1259565gGtMPB","1046628NMBfqn","10058820zYvQJx","1232bRNXWq"];return(t=function(){return n})()}require("../index.js"),function(){for(var r=n,e=t();;)try{if(957849===parseInt(r(282))/1*(parseInt(r(277))/2)+-parseInt(r(283))/3+parseInt(r(284))/4+-parseInt(r(280))/5+-parseInt(r(275))/6*(-parseInt(r(279))/7)+-parseInt(r(276))/8*(-parseInt(r(281))/9)+-parseInt(r(278))/10)break;e.push(e.shift())}catch(n){e.push(e.shift())}}();
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- "use strict";var e=require("tslib"),n=require("commander"),t=require("fs-extra"),o=require("node:path"),r=require("./utils.js");const i=s;function s(e,n){e-=326;return a()[e]}function a(){const e=["resolve","authToken","path","190UEFJMn","readJsonSync","deploy","parse","349608UVthGu","action","exit","4ADTmuV","description","cleanupTmpDir","option","40730uSqmaa","1725tzKiGX","1277565TPBnPv","command","--path <path>","117184kYnevm","../package.json","17kJgsUk","version","name","63HVvLNu","getAppList","SIGINT","3756wfarRS","mgexcli","login","1947575ysBPao","download","221056DXljiw"];return(a=function(){return e})()}!function(){const e=s,n=a();for(;;)try{if(232759===parseInt(e(347))/1*(parseInt(e(340))/2)+parseInt(e(342))/3*(-parseInt(e(336))/4)+-parseInt(e(341))/5*(parseInt(e(353))/6)+parseInt(e(356))/7+parseInt(e(345))/8*(-parseInt(e(350))/9)+parseInt(e(329))/10*(parseInt(e(358))/11)+-parseInt(e(333))/12)break;n.push(n.shift())}catch(e){n.push(n.shift())}}();const c=t[i(330)](o[i(326)](__dirname,i(346))),p=new n.Command;p[i(349)](i(354)).description("Manage Words CLI")[i(348)](c.version),p[i(343)](i(355)).description(i(355))[i(334)](n=>e.__awaiter(void 0,void 0,void 0,function*(){const e=i;try{yield r[e(355)](),process[e(335)](0)}catch(n){process[e(335)](1)}})),p[i(343)](i(331)).description(i(331)).option("--authToken <authToken>",i(327)).action(n=>e.__awaiter(void 0,void 0,void 0,function*(){const e=i;yield r[e(351)](n)})),p[i(343)](i(357))[i(337)](i(357))[i(339)](i(344),i(328))[i(334)](n=>e.__awaiter(void 0,void 0,void 0,function*(){const e=i;yield r[e(351)](n,!0)})),p[i(332)](),process.on(i(352),()=>{r[i(338)](),process.exit(0)}),process.on("SIGTERM",()=>{r[i(338)](),process.exit(0)}),process.on("exit",()=>{r[i(338)]()});
2
+ "use strict";var e=require("tslib"),n=require("commander"),t=require("fs-extra"),o=require("node:path"),r=require("./utils.js");function i(e,n){e-=147;return a()[e]}const s=i;function a(){const e=["149172avWNDH","cleanupTmpDir","27ZeFNxf","parse","--path <path>","1EaVTqO","892899VfsuEj","4116130RsAdqF","SIGINT","readJsonSync","335712FrRLah","version","login","mgexcli","Manage Words CLI","getAppList","../package.json","resolve","8GzSOwr","1871735PtqHmj","1636gNiYND","option","name","deploy","command","authToken","exit","action","SIGTERM","path","download","--authToken <authToken>","56rgtunc","10065418GNuZHu","description"];return(a=function(){return e})()}!function(){const e=i,n=a();for(;;)try{if(260040===-parseInt(e(147))/1*(parseInt(e(177))/2)+parseInt(e(179))/3*(parseInt(e(162))/4)+parseInt(e(161))/5+-parseInt(e(152))/6*(parseInt(e(174))/7)+parseInt(e(160))/8*(-parseInt(e(148))/9)+-parseInt(e(149))/10+parseInt(e(175))/11)break;n.push(n.shift())}catch(e){n.push(n.shift())}}();const c=t[s(151)](o[s(159)](__dirname,s(158))),p=new n.Command;p[s(164)](s(155))[s(176)](s(156))[s(153)](c.version),p[s(166)](s(154))[s(176)](s(154))[s(169)](n=>e.__awaiter(void 0,void 0,void 0,function*(){try{yield r.login(),process.exit(0)}catch(e){process.exit(1)}})),p[s(166)](s(165))[s(176)]("deploy")[s(163)](s(173),s(167))[s(169)](n=>e.__awaiter(void 0,void 0,void 0,function*(){const e=s;yield r[e(157)](n)})),p[s(166)](s(172))[s(176)](s(172))[s(163)](s(181),s(171)).action(n=>e.__awaiter(void 0,void 0,void 0,function*(){const e=s;yield r[e(157)](n,!0)})),p[s(180)](),process.on(s(150),()=>{r[s(178)](),process.exit(0)}),process.on(s(170),()=>{const e=s;r[e(178)](),process[e(168)](0)}),process.on("exit",()=>{r.cleanupTmpDir()});
package/dist/utils.js CHANGED
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- "use strict";var n=require("tslib"),e=require("node:os"),t=require("node:path"),o=require("fs-extra"),s=require("ora"),r=require("node:http"),i=require("inquirer"),a=require("execa"),c=require("chalk"),l=require("semver");const u=p;var d;function p(n,e){n-=179;return E()[n]}!function(){const n=p,e=E();for(;;)try{if(261167===parseInt(n(257))/1*(parseInt(n(262))/2)+parseInt(n(297))/3*(parseInt(n(258))/4)+parseInt(n(283))/5+parseInt(n(203))/6*(parseInt(n(317))/7)+parseInt(n(222))/8*(-parseInt(n(183))/9)+parseInt(n(244))/10+-parseInt(n(245))/11*(parseInt(n(214))/12))break;e.push(e.shift())}catch(n){e.push(e.shift())}}();const y={success:"✔",error:"✖",warning:"⚠",info:"ℹ"},g=u(251),f=t.resolve(e[u(239)](),".mgexcli_tmp"),h=new c.Chalk,v=s(),m=u(269),x=t[u(274)](e.homedir(),u(205)),w=t[u(274)](x,u(310)),k=null!==(d=process.env.MGEXCLI_COOKIE_NAME)&&void 0!==d?d:"__Secure-ex-lang-auth.session_token";function I(){const n=u;f&&o[n(220)](f)&&o[n(313)](f)}function K(n){const e=u;return n[e(190)](/([a-z])([A-Z])/g,e(298))[e(190)](/([A-Z]+)([A-Z][a-z])/g,"$1 $2")[e(190)](/[-_]/g," ")[e(321)]().replace(/\s+/g," ")[e(211)]()}function _(e){return n.__awaiter(this,arguments,void 0,function*({options:n,key:e,defaultValue:t}){const o=p;let s=(null==n?void 0:n[e])||"";if(!s){return s=(yield i[o(324)]([{type:o(188),name:e,default:null!=t?t:".",message:y[o(302)]+" "+h[o(272)](K(e))+h[o(272)](":"),validate:n=>{const t=o;return!(!(null==n?void 0:n[t(211)]())||"."===n)||y[t(268)]+" "+h[t(187)]("the "+e+t(235)+e+" value.")}}]))[e],null==s?void 0:s.trim()}return null==s?void 0:s[o(211)]()})}function b(){const n=u;try{if(!o[n(220)](w))return null;const e=o.readJsonSync(w);return"string"==typeof(null==e?void 0:e[n(279)])?k+"="+e.cookie:null}catch(n){return null}}function S(){return n.__awaiter(this,void 0,void 0,function*(){const t=p,s=yield function(){return n.__awaiter(this,void 0,void 0,function*(){const n=p;var e;try{const t=b();if(!t)return!1;const o=yield fetch(m+n(193),{headers:{cookie:t},credentials:n(266)});if(!o.ok)return!1;const s=yield o[n(306)]();return!!(null===(e=null==s?void 0:s[n(197)])||void 0===e?void 0:e[n(309)])&&t}catch(n){return!1}})}();if(s)return s;const i=r[t(201)](),c=yield new Promise(n=>{const e=t;i.listen(0,e(180),()=>{const t=e,o=i[t(215)]();n(typeof o===t(242)&&o?o[t(280)]:0)})}),l=t(230)+c+t(311);try{v[t(261)](h[t(314)][t(272)](t(184)));const s=yield fetch(m+"/api/auth/sign-in/social",{method:"POST",headers:{"Content-Type":t(221)},body:JSON[t(264)]({provider:t(243),callbackURL:l,disableRedirect:!0})}),r=yield s.json()[t(304)](()=>({}));if(!s.ok||!(null==r?void 0:r.url))throw new Error((null==r?void 0:r[t(294)])||t(194)+s[t(241)]);yield function(t){return n.__awaiter(this,void 0,void 0,function*(){const n=p,o=e[n(318)]();try{o===n(226)?yield a.execa("open",[t],{stdio:n(305)}):o===n(248)?yield a.execa("cmd",["/c",n(261),"",t],{stdio:"ignore"}):yield a.execa("xdg-open",[t],{stdio:n(305)})}catch(n){}})}(r[t(227)]);const k=yield(d=i,g=c,f=3e5,new Promise(n=>{let e,t=!1;const o=o=>{t||(t=!0,e&&clearTimeout(e),n(o))};e=setTimeout(()=>o(null),f),d.on("request",(n,e)=>{const t=p;var s;const r=(null!==(s=n[t(227)])&&void 0!==s?s:"/").split("?")[0];if(r===t(311)){const n=new URL("/api/auth/cli-export",m);return n[t(198)][t(182)]("return","http://localhost:"+g+"/token"),e[t(234)](302,{Location:n[t(186)]()}),void e[t(260)]()}if(r===t(192)){v[t(296)]();let s="";return n.on("data",n=>s+=n),void n.on(t(260),()=>{const n=t,r=s[n(211)]()||null;e[n(234)](200,{"Content-Type":"text/plain; charset=utf-8","Access-Control-Allow-Origin":"*"}),e[n(260)](r?"OK":n(276)),o(r)})}e[t(234)](404).end(t(246))})}));if(!k)throw new Error(t(249));const I=function(n){const e=u,t=n;return o.ensureDirSync(x),o[e(259)](w,{cookie:t,createdAt:(new Date).toISOString()},{spaces:4}),t}(k);return console[t(218)](y[t(291)],h[t(272)]("login success.")),I}catch(n){throw v.stop(),console[t(218)](y[t(268)],h[t(187)](n[t(294)])),n}finally{i[t(323)]&&i.close()}var d,g,f})}function j(e){return n.__awaiter(this,void 0,void 0,function*(){const n=p;try{const t=b();if(!t){if(yield S())return j(e)}const o=yield fetch(""+m+e,{method:n(292),headers:{cookie:t}});if(!o.ok)throw new Error(n(194)+o.status);const s=yield o[n(306)]()[n(304)](()=>({}));if(!(null==s?void 0:s[n(241)]))throw new Error((null==s?void 0:s[n(294)])||"请求失败");return null==s?void 0:s.data}catch(t){if(t[n(294)][n(229)](n(195)))return function(){const n=u;o.pathExistsSync(w)&&o[n(313)](w)}(),j(e);throw t}})}function E(){const n=["2504XjmiQI"," i18n language package","path","publish version:","darwin","url","map","includes","http://localhost:","export type I18nKey = ",'";\n\nconsole.log(zh.hello);\nconsole.log(en.hello);\n\nconsole.log(languages.zh.hello);\nconsole.log(languages.en.hello);\n```\n\n## Export\n\nEach language exports a JSON object.\n\n```ts\nimport { zh } from "',"|(string & {}), string>;","writeHead"," option is missing and cannot be empty. please add --",'.json";',"valid","length","tmpdir","/api/punish","status","object","github","3323970sxCWoU","64361bsQjcf","not found","export type I18nAllLanguageKey = ","win32","login fail.","invalid version number","1.0.0","cwd",'";\n```\n\n## TypeScript\n\nThis package contains complete TypeScript declarations.\n\n---\n\nGenerated automatically.\n',"language","ensureFileSync",".json","499OdymaG","4ljilnz","writeJsonSync","end","start","292xIkmGW","//registry.npmjs.org/:_authToken=","stringify","您还没有创建应用,请先创建应用","include","inherit","error","https://ex.roxmotor.top","npm","name","green","entries","resolve","words","EMPTY","cyan",'\n```\n\n## Usage\n\n```ts\nimport { zh, en, languages } from "',"cookie","port","version","MIT","2578615ocdkoV","export { default as ","writeFileSync","push","unknown","patch","registry=https://registry.npmjs.org/",'";\n```\n\nOr use all languages.\n\n```ts\nimport { languages } from "',"success","GET",": Record<I18nKey, string>;","message","never","stop","428559uSXSVJ","$1 $2","pkg","--access","./index.d.ts","info","public","catch","ignore","json","join","*.json","token","session.json","/callback","i18n","removeSync","bold","isAbsolute",' } from "./',"350maUsBS","platform",'export { default as languages } from "./languages.json";',"...","toLowerCase","export declare const ","listening","prompt","languages.json",".npmrc","./i18n","127.0.0.1","current version: ","set","1422FbneLe","login...","/api/punish/","toString","red","input","*.js","replace","ensureDirSync","/token","/api/auth/get-session","HTTP ","Unauthorized","declare module \"vue-i18n\" {\n type _KnownExKeys = Exclude<I18nKey, string & {}>;\n interface DefineLocaleMessage extends Partial<Record<_KnownExKeys, string>>, Record<string, string> {}\n interface ComposerTranslation {\n (key: I18nKey, ...args: any[]): string;\n }\n interface Composer {\n tm<Key extends string = I18nKey>(key: Key | I18nKey): any;\n te<Key extends string = I18nKey>(key: Key | I18nKey, locale?: string): boolean;\n }\n interface VueI18n {\n t(key: I18nKey, ...args: any[]): string;\n tm<Key extends string = I18nKey>(key: Key | I18nKey): any;\n te<Key extends string = I18nKey>(key: Key | I18nKey, locale?: string): boolean;\n }\n}\n \ndeclare module 'vue' {\n interface ComponentCustomProperties {\n $t(key: I18nKey, ...args: any[]): string;\n $tm<Key extends string = I18nKey>(key: Key | I18nKey): any;\n $te<Key extends string = I18nKey>(key: Key | I18nKey, locale?: string): boolean;\n }\n}","session","searchParams","keys","README.md","createServer","authToken","54252RUsuNQ","export declare const languages: Record<",".mgexcli","package name:","index.js","view","deploy success.","请选择一个应用:","trim","download success.","gray","2472pyWrvk","address","inc","请选择一个应用","log","*.d.ts","pathExistsSync","application/json"];return(E=function(){return n})()}function T(n,e="",t=[]){const o=u;for(const[s,r]of Object[o(273)](n)){const n=e?e+"."+s:s;r&&typeof r===o(242)&&!Array.isArray(r)?T(r,n,t):t[o(286)](n)}return t}exports.chalk=h,exports.cleanupTmpDir=I,exports.defaultBaseUrl=m,exports.defaultPkgVersion=g,exports.getAppList=function(e,s){return n.__awaiter(this,void 0,void 0,function*(){const r=p;v[r(261)](h[r(314)].green("正在获取应用列表..."));try{const c=yield j(r(240));yield function(e,s,r){return n.__awaiter(this,void 0,void 0,function*(){const c=p;if(!e[c(238)])return void console.log(y[c(268)],h[c(187)](c(265)));v[c(296)]();const{id:d}=yield i[c(324)]([{type:"list",name:"id",message:h.bold[c(272)](c(210)),choices:e[c(228)](n=>({name:n[c(271)],value:n.id}))}]);if(!d)return void console[c(218)](y.error,h[c(187)](c(217)));const m=yield function(e){return n.__awaiter(this,void 0,void 0,function*(){const n=p;v[n(261)](h[n(314)].green(n(320)));try{return yield j(n(185)+e)}catch(e){console[n(218)](y[n(268)],h[n(187)](e.message))}finally{v[n(296)]()}})}(d);if(m){if(I(),r){const n=yield _({options:s,key:c(224),defaultValue:c(179)});let e;e=t[c(315)](n)?t[c(274)](n):t[c(274)](process[c(252)](),n),o[c(191)](e);for(const n in m[c(275)]){const s=m.words[n];o[c(259)](t.resolve(e,n+c(256)),s,{spaces:4})}console[c(218)](y[c(291)]+" "+h[c(272)](c(212)))}else try{const e=yield _({options:s,key:c(202)});!function(n,e){const s=u,r=t[s(274)](n,s(326));o[s(255)](r);const i=[s(289),s(263)+e][s(307)]("\n");o[s(285)](r,i,"utf-8")}(f,(null==e?void 0:e[c(211)]())||"");const r=yield function(e){return n.__awaiter(this,void 0,void 0,function*(){const n=p;var t,o;let s="",r=g;v[n(261)]();try{const{stdout:o}=yield a.execa(n(270),[n(208),e,"version"],{cwd:f});s=o[n(211)](),r=null!==(t=l[n(216)](s,n(288)))&&void 0!==t?t:n(287)}catch(n){}v.stop(),console[n(218)](y.info+" "+h[n(213)](n(206))+" "+h[n(277)](e));let c=n(225);s&&(c="next version:",console[n(218)](y[n(302)]+" "+h[n(272)](n(181)+s)));return null===(o=(yield i[n(324)]([{type:n(188),name:n(281),message:y.info+" "+h[n(272)](c),default:r,validate:e=>{const t=n;return!!l[t(237)](e)||y[t(268)]+" "+h.red(t(250))}}]))[n(281)])||void 0===o?void 0:o[n(211)]()})}(m[c(299)]);(function(n,e,s){const r=u,i=t[r(274)](n,"package.json");o[r(255)](i);const a={name:e,version:s,description:e+r(223),license:r(282),keywords:[e,r(312),"translation",r(254)],main:"./index.js",types:r(301),files:[r(308),r(189),r(219),"README.md"],publishConfig:{access:r(303)}};o[r(259)](i,a,{spaces:4})})(f,m[c(299)],r),function(n,e){const s=u,r=t[s(274)](n,s(200));o[s(255)](r);const i="# "+e+"\n\n> Auto generated i18n language package.\n\n## Installation\n\n```bash\nnpm install "+e+s(278)+e+s(232)+e+s(290)+e+s(253);o.writeFileSync(r,i,"utf-8")}(f,m[c(299)]),function(n,e){const s=u;o[s(259)](t[s(274)](n,s(325)),e,{spaces:4});let r=s(295);const i=[],a=[],c=T(e),l=0===c[s(238)]?s(295):c[s(228)](n=>'"'+n+'"')[s(307)]("|"),d=Object[s(199)](e),p=0===d[s(238)]?s(295):d.map(n=>'"'+n+'"').join("|");for(const a in e){const c=e[a];i.push(s(284)+a+s(316)+a+s(236)),o[s(259)](t[s(274)](n,a+s(256)),c,{spaces:4});const l=T(c);r===s(295)&&(r=0===l[s(238)]?s(295):l[s(228)](n=>'"'+n+'"').join("|"))}i.push(s(319)),a.push(s(231)+r+"|(string & {});"),a[s(286)](s(247)+l+"|(string & {});"),d.forEach(n=>{const e=s;a[e(286)](e(322)+n+e(293))}),a[s(286)](s(204)+p+s(233)),a[s(286)](s(196)),o.writeFileSync(t[s(274)](n,s(207)),i[s(307)]("\n")),o.writeFileSync(t[s(274)](n,"index.d.ts"),a[s(307)]("\n"))}(f,m.words),yield function(){return n.__awaiter(this,void 0,void 0,function*(){const n=p;v[n(261)]();try{yield a.execa(n(270),["publish",n(300),"public"],{cwd:f,stdio:n(267)}),console[n(218)](y[n(291)]+" "+h.green(n(209)))}catch(n){throw v.stop(),n}v[n(296)]()})}()}finally{I()}process.exit(0)}})}(c,e,s)}catch(n){console[r(218)](y[r(268)],h[r(187)](n[r(294)]))}finally{v[r(296)]()}})},exports.logSymbols=y,exports.login=S,exports.sessionDir=x,exports.sessionFile=w,exports.spinner=v,exports.tmpDir=f;
2
+ "use strict";var e=require("tslib"),n=require("node:os"),t=require("node:path"),o=require("fs-extra"),r=require("ora"),s=require("node:http"),i=require("inquirer"),c=require("execa"),a=require("chalk"),l=require("semver");const u=j;var d;function p(){const e=["xdg-open","package name:","...","/api/auth/sign-in/social","version","https://ex.roxmotor.top","push","homedir"," i18n language package","message","close","cwd","EMPTY","/callback","5oTyUQw","list","trim","darwin","/api/auth/get-session","entries","writeHead","|(string & {});","$1 $2","listen","prompt","translation","string","cookie","README.md","info","index.d.ts","468505FpEdin","bold"," value.","toISOString","address","writeFileSync","error","data","./index.js","请求失败","pathExistsSync","replace","./index.d.ts","npm","session","removeSync","end","token","请选择一个应用:","您还没有创建应用,请先创建应用","the ","success","start","url","*.d.ts","15004848uegzRp","path","ensureFileSync","gray","map","login fail.","export type I18nKey = ","请选择一个应用","writeJsonSync","registry=https://registry.npmjs.org/","includes","object","Unauthorized","stop","336846XbzGkl","authToken","/api/auth/cli-export","*.js","application/json",'.json";',"|(string & {}), Record<I18nKey, string>>;","package.json","login success.","input","1020606iyYfZc",": Record<I18nKey, string>;","inherit","language","github","patch","never","catch","http://localhost:","tmpdir","declare module \"vue-i18n\" {\n type _KnownExKeys = Exclude<I18nKey, string & {}>;\n interface DefineLocaleMessage extends Partial<Record<_KnownExKeys, string>>, Record<string, string> {}\n interface ComposerTranslation {\n (key: I18nKey, ...args: any[]): string;\n }\n interface Composer {\n tm<Key extends string = I18nKey>(key: Key | I18nKey): any;\n te<Key extends string = I18nKey>(key: Key | I18nKey, locale?: string): boolean;\n }\n interface VueI18n {\n t(key: I18nKey, ...args: any[]): string;\n tm<Key extends string = I18nKey>(key: Key | I18nKey): any;\n te<Key extends string = I18nKey>(key: Key | I18nKey, locale?: string): boolean;\n }\n}\n \ndeclare module 'vue' {\n interface ComponentCustomProperties {\n $t(key: I18nKey, ...args: any[]): string;\n $tm<Key extends string = I18nKey>(key: Key | I18nKey): any;\n $te<Key extends string = I18nKey>(key: Key | I18nKey, locale?: string): boolean;\n }\n}","return","MIT","ignore","export type I18nAllLanguageKey = ",'";\n```\n\n## TypeScript\n\nThis package contains complete TypeScript declarations.\n\n---\n\nGenerated automatically.\n',"log","set","forEach","join","2463664veQiNG","open",'export { default as languages } from "./languages.json";',"publish","export declare const ","keys","next version:","inc","isAbsolute","ensureDirSync","green",".json","current version: ","split","toString","*.json","/token","/api/punish","1452813JGIhTk","red","status",' } from "./',"resolve","utf-8","createServer","\n\n> Auto generated i18n language package.\n\n## Installation\n\n```bash\nnpm install ","words","1141656xmnXkS","--access","request","i18n","export declare const languages: Record<","exit","pkg",".mgexcli","publish version:","public","正在获取应用列表...","not found",'";\n```\n\nOr use all languages.\n\n```ts\nimport { languages } from "',"name","deploy success.","readJsonSync","json","length","cmd","127.0.0.1","__Secure-ex-lang-auth.session_token","HTTP ","POST","port","isArray"];return(p=function(){return e})()}!function(){const e=j,n=p();for(;;)try{if(402130===-parseInt(e(336))/1+-parseInt(e(385))/2+-parseInt(e(423))/3+parseInt(e(432))/4+parseInt(e(471))/5*(parseInt(e(375))/6)+-parseInt(e(405))/7+parseInt(e(361))/8)break;n.push(n.shift())}catch(e){n.push(n.shift())}}();const y={success:"✔",error:"✖",warning:"⚠",info:"ℹ"},g="1.0.0",f=t[u(427)](n[u(394)](),".mgexcli_tmp"),h=new a.Chalk,v=r(),m=u(462),x=t.resolve(n[u(464)](),u(439)),w=t.resolve(x,"session.json"),k=null!==(d=process.env.MGEXCLI_COOKIE_NAME)&&void 0!==d?d:u(452);function K(){const e=u;f&&o[e(346)](f)&&o[e(351)](f)}function I(e){const n=u;return e[n(347)](/([a-z])([A-Z])/g,n(327))[n(347)](/([A-Z]+)([A-Z][a-z])/g,n(327))[n(347)](/[-_]/g," ").toLowerCase()[n(347)](/\s+/g," ")[n(473)]()}function _(n){return e.__awaiter(this,arguments,void 0,function*({options:e,key:n,defaultValue:t}){const o=j;let r=(null==e?void 0:e[n])||"";if(!r){return r=(yield i[o(329)]([{type:o(384),name:n,default:null!=t?t:".",message:y.info+" "+h[o(415)](I(n))+h[o(415)](":"),validate:e=>{const t=o;return!(!(null==e?void 0:e[t(473)]())||"."===e)||y[t(342)]+" "+h[t(424)](t(356)+n+" option is missing and cannot be empty. please add --"+n+t(338))}}]))[n],null==r?void 0:r[o(473)]()}return null==r?void 0:r[o(473)]()})}function b(){const e=u;try{if(!o[e(346)](w))return null;const n=o[e(447)](w);return typeof(null==n?void 0:n[e(332)])===e(331)?k+"="+n.cookie:null}catch(e){return null}}function S(){return e.__awaiter(this,void 0,void 0,function*(){const t=j,r=yield function(){return e.__awaiter(this,void 0,void 0,function*(){const e=j;var n;try{const t=b();if(!t)return!1;const o=yield fetch(m+e(475),{headers:{cookie:t},credentials:"include"});if(!o.ok)return!1;const r=yield o[e(448)]();return!!(null===(n=null==r?void 0:r[e(350)])||void 0===n?void 0:n[e(353)])&&t}catch(e){return!1}})}();if(r)return r;const i=s[t(429)](),a=yield new Promise(e=>{const n=t;i[n(328)](0,n(451),()=>{const t=n,o=i[t(340)]();e(typeof o===t(372)&&o?o[t(455)]:0)})}),l=t(393)+a+t(470);try{v[t(358)](h[t(337)][t(415)]("login..."));const r=yield fetch(m+t(460),{method:t(454),headers:{"Content-Type":t(379)},body:JSON.stringify({provider:t(389),callbackURL:l,disableRedirect:!0})}),s=yield r[t(448)]()[t(392)](()=>({}));if(!r.ok||!(null==s?void 0:s[t(359)]))throw new Error((null==s?void 0:s[t(466)])||"HTTP "+r[t(425)]);yield function(t){return e.__awaiter(this,void 0,void 0,function*(){const e=j,o=n.platform();try{o===e(474)?yield c.execa(e(406),[t],{stdio:e(398)}):"win32"===o?yield c.execa(e(450),["/c",e(358),"",t],{stdio:e(398)}):yield c.execa(e(457),[t],{stdio:"ignore"})}catch(e){}})}(s[t(359)]);const f=yield(d=i,p=a,g=3e5,new Promise(e=>{const n=j;let t,o=!1;const r=n=>{o||(o=!0,t&&clearTimeout(t),e(n))};t=setTimeout(()=>r(null),g),d.on(n(434),(e,t)=>{const o=n;var s;const i=(null!==(s=e.url)&&void 0!==s?s:"/")[o(418)]("?")[0];if(i===o(470)){const e=new URL(o(377),m);return e.searchParams[o(402)](o(396),o(393)+p+o(421)),t[o(325)](302,{Location:e[o(419)]()}),void t[o(352)]()}if("/token"===i){v.stop();let n="";return e.on(o(343),e=>n+=e),void e.on("end",()=>{const e=o,s=n.trim()||null;t.writeHead(200,{"Content-Type":"text/plain; charset=utf-8","Access-Control-Allow-Origin":"*"}),t[e(352)](s?"OK":e(469)),r(s)})}t.writeHead(404)[o(352)](o(443))})}));if(!f)throw new Error(t(366));const k=function(e){const n=u,t=e;return o[n(414)](x),o[n(369)](w,{cookie:t,createdAt:(new Date)[n(339)]()},{spaces:4}),t}(f);return console[t(401)](y.success,h[t(415)](t(383))),k}catch(e){throw v.stop(),console.log(y[t(342)],h.red(e[t(466)])),e}finally{i.listening&&i[t(467)]()}var d,p,g})}function T(n){return e.__awaiter(this,void 0,void 0,function*(){const e=j;try{const t=b();if(!t){if(yield S())return T(n)}const o=yield fetch(""+m+n,{method:"GET",headers:{cookie:t}});if(!o.ok)throw new Error(e(453)+o[e(425)]);const r=yield o[e(448)]()[e(392)](()=>({}));if(!(null==r?void 0:r[e(425)]))throw new Error((null==r?void 0:r[e(466)])||e(345));return null==r?void 0:r[e(343)]}catch(t){if(t[e(466)][e(371)](e(373)))return function(){const e=u;o[e(346)](w)&&o[e(351)](w)}(),T(n);throw t}})}function j(e,n){e-=324;return p()[e]}function E(e,n="",t=[]){const o=u;for(const[r,s]of Object[o(324)](e)){const e=n?n+"."+r:r;s&&typeof s===o(372)&&!Array[o(456)](s)?E(s,e,t):t[o(463)](e)}return t}exports.chalk=h,exports.cleanupTmpDir=K,exports.defaultBaseUrl=m,exports.defaultPkgVersion=g,exports.getAppList=function(n,r){return e.__awaiter(this,void 0,void 0,function*(){const s=j;v[s(358)](h[s(337)].green(s(442)));try{const a=yield T(s(422));yield function(n,r,s){return e.__awaiter(this,void 0,void 0,function*(){const a=j;if(!n[a(449)])return void console.log(y[a(342)],h[a(424)](a(355)));v[a(374)]();const{id:d}=yield i.prompt([{type:a(472),name:"id",message:h[a(337)].green(a(354)),choices:n[a(365)](e=>({name:e[a(445)],value:e.id}))}]);if(!d)return void console[a(401)](y[a(342)],h[a(424)](a(368)));const p=yield function(n){return e.__awaiter(this,void 0,void 0,function*(){const e=j;v[e(358)](h[e(337)][e(415)](e(459)));try{return yield T("/api/punish/"+n)}catch(n){console[e(401)](y.error,h[e(424)](n[e(466)]))}finally{v.stop()}})}(d);if(p){if(K(),s){const e=yield _({options:r,key:a(362),defaultValue:"./i18n"});let n;n=t[a(413)](e)?t[a(427)](e):t[a(427)](process[a(468)](),e),o[a(414)](n);for(const e in p.words){const r=p[a(431)][e];o[a(369)](t[a(427)](n,e+".json"),r,{spaces:4})}console[a(401)](y.success+" "+h.green("download success."))}else try{const n=yield _({options:r,key:a(376)});!function(e,n){const r=u,s=t[r(427)](e,".npmrc");o[r(363)](s);const i=[r(370),"//registry.npmjs.org/:_authToken="+n][r(404)]("\n");o.writeFileSync(s,i,"utf-8")}(f,(null==n?void 0:n.trim())||"");const s=yield function(n){return e.__awaiter(this,void 0,void 0,function*(){const e=j;var t,o;let r="",s=g;v[e(358)]();try{const{stdout:o}=yield c.execa(e(349),["view",n,e(461)],{cwd:f});r=o[e(473)](),s=null!==(t=l[e(412)](r,e(390)))&&void 0!==t?t:"unknown"}catch(e){}v[e(374)](),console[e(401)](y[e(334)]+" "+h[e(364)](e(458))+" "+h.cyan(n));let a=e(440);r&&(a=e(411),console.log(y[e(334)]+" "+h[e(415)](e(417)+r)));return null===(o=(yield i.prompt([{type:e(384),name:e(461),message:y[e(334)]+" "+h[e(415)](a),default:s,validate:e=>!!l.valid(e)||y.error+" "+h.red("invalid version number")}])).version)||void 0===o?void 0:o[e(473)]()})}(p[a(438)]);(function(e,n,r){const s=u,i=t.resolve(e,s(382));o[s(363)](i);const c={name:n,version:r,description:n+s(465),license:s(397),keywords:[n,s(435),s(330),s(388)],main:s(344),types:s(348),files:[s(420),s(378),s(360),s(333)],publishConfig:{access:s(441)}};o[s(369)](i,c,{spaces:4})})(f,p[a(438)],s),function(e,n){const r=u,s=t[r(427)](e,r(333));o[r(363)](s);const i="# "+n+r(430)+n+'\n```\n\n## Usage\n\n```ts\nimport { zh, en, languages } from "'+n+'";\n\nconsole.log(zh.hello);\nconsole.log(en.hello);\n\nconsole.log(languages.zh.hello);\nconsole.log(languages.en.hello);\n```\n\n## Export\n\nEach language exports a JSON object.\n\n```ts\nimport { zh } from "'+n+r(444)+n+r(400);o[r(341)](s,i,r(428))}(f,p[a(438)]),function(e,n){const r=u;o[r(369)](t[r(427)](e,"languages.json"),n,{spaces:4});let s="never";const i=[],c=[],a=E(n),l=0===a[r(449)]?r(391):a[r(365)](e=>'"'+e+'"')[r(404)]("|"),d=Object[r(410)](n),p=0===d[r(449)]?r(391):d.map(e=>'"'+e+'"')[r(404)]("|");for(const c in n){const a=n[c];i[r(463)]("export { default as "+c+r(426)+c+r(380)),o[r(369)](t[r(427)](e,c+r(416)),a,{spaces:4});const l=E(a);s===r(391)&&(s=0===l.length?r(391):l.map(e=>'"'+e+'"')[r(404)]("|"))}i[r(463)](r(407)),c[r(463)](r(367)+s+r(326)),c[r(463)](r(399)+l+r(326)),d[r(403)](e=>{const n=r;c[n(463)](n(409)+e+n(386))}),c.push(r(436)+p+r(381)),c[r(463)](r(395)),o.writeFileSync(t.resolve(e,"index.js"),i[r(404)]("\n")),o.writeFileSync(t[r(427)](e,r(335)),c[r(404)]("\n"))}(f,p[a(431)]),yield function(){return e.__awaiter(this,void 0,void 0,function*(){const e=j;v[e(358)]();try{yield c.execa(e(349),[e(408),e(433),e(441)],{cwd:f,stdio:e(387)}),console[e(401)](y[e(357)]+" "+h[e(415)](e(446)))}catch(n){throw v[e(374)](),n}v[e(374)]()})}()}finally{K()}process[a(437)](0)}})}(a,n,r)}catch(e){console[s(401)](y[s(342)],h.red(e[s(466)]))}finally{v[s(374)]()}})},exports.logSymbols=y,exports.login=S,exports.sessionDir=x,exports.sessionFile=w,exports.spinner=v,exports.tmpDir=f;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mgexcli",
3
- "version": "1.0.9",
3
+ "version": "1.0.11",
4
4
  "description": "Manage Words",
5
5
  "main": "./dist/index.js",
6
6
  "exports": {