mgexcli 1.0.2 → 1.0.4

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 t=["204736XwPmRr","2410266hZViST","35203kdBlwl","8KmUNue","302ZOQFsi","2924793KSmDxE","772167ckkyet","1972cXsrlJ","311830aGjPiP"];return(r=function(){return t})()}function t(t,n){return t-=341,r()[t]}require("../index.js"),function(){for(var n=t,e=r();;)try{if(225638===parseInt(n(342))/1*(parseInt(n(348))/2)+-parseInt(n(341))/3+parseInt(n(344))/4+parseInt(n(343))/5+parseInt(n(345))/6+-parseInt(n(346))/7+parseInt(n(347))/8*(-parseInt(n(349))/9))break;e.push(e.shift())}catch(r){e.push(e.shift())}}();
2
+ "use strict";function r(r,t){return r-=304,n()[r]}function n(){var r=["61848KlDedt","1399629QnslVN","4693872EcvvfR","338572xpDIcM","50jnbgGT","72184rGmiBi","4589937SqQViY","96GHXAwb","96392Ertbnl"];return(n=function(){return r})()}require("../index.js"),function(){for(var t=r,e=n();;)try{if(306536===parseInt(t(311))/1+-parseInt(t(306))/2+parseInt(t(304))/3+parseInt(t(312))/4*(parseInt(t(307))/5)+parseInt(t(310))/6*(-parseInt(t(308))/7)+-parseInt(t(305))/8+parseInt(t(309))/9)break;e.push(e.shift())}catch(r){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=a;function s(){const e=["version","88erxwHm","command","getAppList","authToken","18465660CPHzqk","22cqgHeN","option","cleanupTmpDir","SIGTERM","1613930dMoljj","7NylPwW","resolve","--path <path>","SIGINT","name","4911294EwEYpJ","3658840UCabaV","description","action","deploy","Manage Words CLI","exit","122673knOJze","download","parse","557127ITOSvm","29088pyCeJu"];return(s=function(){return e})()}function a(e,n){e-=107;return s()[e]}!function(){const e=a,n=s();for(;;)try{if(577461===-parseInt(e(128))/1+parseInt(e(108))/2*(-parseInt(e(125))/3)+parseInt(e(119))/4+-parseInt(e(112))/5+parseInt(e(118))/6*(-parseInt(e(113))/7)+parseInt(e(131))/8*(-parseInt(e(129))/9)+parseInt(e(107))/10)break;n.push(n.shift())}catch(e){n.push(n.shift())}}();const c=t.readJsonSync(o[i(114)](__dirname,"../package.json")),p=new n.Command;p[i(117)]("mgexcli").description(i(123))[i(130)](c[i(130)]),p[i(132)]("login")[i(120)]("login")[i(121)](n=>e.__awaiter(void 0,void 0,void 0,function*(){const e=i;try{yield r.login(),process.exit(0)}catch(n){process[e(124)](1)}})),p.command(i(122)).description(i(122))[i(109)]("--authToken <authToken>",i(134))[i(121)](n=>e.__awaiter(void 0,void 0,void 0,function*(){const e=i;yield r[e(133)](n)})),p[i(132)](i(126))[i(120)](i(126))[i(109)](i(115),"path")[i(121)](n=>e.__awaiter(void 0,void 0,void 0,function*(){yield r.getAppList(n,!0)})),p[i(127)](),process.on(i(116),()=>{const e=i;r[e(110)](),process[e(124)](0)}),process.on(i(111),()=>{r[i(110)](),process.exit(0)}),process.on("exit",()=>{r[i(110)]()});
2
+ "use strict";var o=require("tslib"),n=require("commander"),e=require("fs-extra"),t=require("node:path"),i=require("./utils.js");const r=a;function s(){const o=["Manage Words CLI","../package.json","deploy","--path <path>","388156gpIcBG","action","373840LoJChc","cleanupTmpDir","9pwoOzw","login","option","3370239INjNqo","3295488GQLRuq","readJsonSync","download","49dSPlBq","mgexcli","resolve","version","authToken","1676700JsOGiw","512670tyQgZR","SIGINT","exit","command","description","name","411259eyZvlS","getAppList"];return(s=function(){return o})()}function a(o,n){o-=334;return s()[o]}!function(){const o=a,n=s();for(;;)try{if(540351===-parseInt(o(344))/1+-parseInt(o(350))/2*(-parseInt(o(354))/3)+parseInt(o(337))/4+parseInt(o(338))/5+parseInt(o(358))/6+-parseInt(o(361))/7*(parseInt(o(352))/8)+-parseInt(o(357))/9)break;n.push(n.shift())}catch(o){n.push(n.shift())}}();const c=e[r(359)](t[r(334)](__dirname,r(347))),p=new n.Command;p[r(343)](r(362))[r(342)](r(346))[r(335)](c.version),p[r(341)](r(355)).description(r(355)).action(n=>o.__awaiter(void 0,void 0,void 0,function*(){const o=r;try{yield i[o(355)](),process[o(340)](0)}catch(n){process[o(340)](1)}})),p[r(341)](r(348)).description(r(348))[r(356)]("--authToken <authToken>",r(336))[r(351)](n=>o.__awaiter(void 0,void 0,void 0,function*(){const o=r;yield i[o(345)](n)})),p.command(r(360))[r(342)](r(360)).option(r(349),"path").action(n=>o.__awaiter(void 0,void 0,void 0,function*(){const o=r;yield i[o(345)](n,!0)})),p.parse(),process.on(r(339),()=>{const o=r;i[o(353)](),process[o(340)](0)}),process.on("SIGTERM",()=>{i[r(353)](),process.exit(0)}),process.on(r(340),()=>{i[r(353)]()});
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"),i=require("ora"),r=require("node:http"),s=require("inquirer"),c=require("execa"),a=require("chalk"),l=require("semver");const u=p;var d;function p(n,e){n-=320;return T()[n]}!function(){const n=p,e=T();for(;;)try{if(405429===parseInt(n(436))/1*(parseInt(n(461))/2)+parseInt(n(445))/3*(-parseInt(n(336))/4)+parseInt(n(360))/5*(parseInt(n(419))/6)+-parseInt(n(447))/7+-parseInt(n(369))/8+parseInt(n(339))/9*(parseInt(n(361))/10)+parseInt(n(373))/11*(parseInt(n(429))/12))break;e.push(e.shift())}catch(n){e.push(e.shift())}}();const f={success:"✔",error:"✖",warning:"⚠",info:"ℹ"},g="1.0.0",y=t.resolve(e[u(415)](),u(421)),h=new a.Chalk,v=i(),m=u(393),w=t[u(330)](e[u(431)](),u(399)),x=t.resolve(w,"session.json"),k=null!==(d=process.env.MGEXCLI_COOKIE_NAME)&&void 0!==d?d:"__Secure-ex-lang-auth.session_token";function _(){const n=u;y&&o[n(411)](y)&&o[n(368)](y)}function b(n){const e=u;return n[e(384)](/([a-z])([A-Z])/g,e(328))[e(384)](/([A-Z]+)([A-Z][a-z])/g,e(328)).replace(/[-_]/g," ")[e(444)]()[e(384)](/\s+/g," ")[e(380)]()}function I(e){return n.__awaiter(this,arguments,void 0,function*({options:n,key:e,defaultValue:t}){const o=p;let i=(null==n?void 0:n[e])||"";if(!i){return i=(yield s[o(335)]([{type:"input",name:e,default:null!=t?t:".",message:f.info+" "+h[o(428)](b(e))+h[o(428)](":"),validate:n=>{const t=o;return!(!(null==n?void 0:n[t(380)]())||"."===n)||f.error+" "+h[t(459)]("the "+e+" option is missing and cannot be empty. please add --"+e+t(332))}}]))[e],null==i?void 0:i.trim()}return null==i?void 0:i[o(380)]()})}function j(){const n=u;try{if(!o[n(411)](x))return null;const e=o[n(366)](x);return typeof(null==e?void 0:e.cookie)===n(348)?k+"="+e[n(452)]:null}catch(n){return null}}function S(){return n.__awaiter(this,void 0,void 0,function*(){const t=p,i=yield function(){return n.__awaiter(this,void 0,void 0,function*(){const n=p;var e;try{const t=j();if(!t)return!1;const o=yield fetch(m+"/api/auth/get-session",{headers:{cookie:t},credentials:"include"});if(!o.ok)return!1;const i=yield o[n(327)]();return!!(null===(e=null==i?void 0:i[n(414)])||void 0===e?void 0:e.token)&&t}catch(n){return!1}})}();if(i)return i;const s=r[t(398)](),a=yield new Promise(n=>{const e=t;s[e(430)](0,e(407),()=>{const t=e,o=s[t(388)]();n(typeof o===t(381)&&o?o[t(375)]:0)})}),l="http://localhost:"+a+t(416);try{v[t(397)](h.bold[t(428)](t(321)));const i=yield fetch(m+"/api/auth/sign-in/social",{method:"POST",headers:{"Content-Type":t(458)},body:JSON[t(450)]({provider:t(468),callbackURL:l,disableRedirect:!0})}),r=yield i[t(327)]()[t(424)](()=>({}));if(!i.ok||!(null==r?void 0:r[t(441)]))throw new Error((null==r?void 0:r[t(379)])||t(341)+i.status);yield function(t){return n.__awaiter(this,void 0,void 0,function*(){const n=p,o=e[n(343)]();try{"darwin"===o?yield c.execa("open",[t],{stdio:n(432)}):o===n(387)?yield c.execa("cmd",["/c",n(397),"",t],{stdio:n(432)}):yield c.execa(n(457),[t],{stdio:n(432)})}catch(n){}})}(r.url);const k=yield(d=s,g=a,y=3e5,new Promise(n=>{const e=p;let t,o=!1;const i=e=>{o||(o=!0,t&&clearTimeout(t),n(e))};t=setTimeout(()=>i(null),y),d.on(e(409),(n,t)=>{const o=e;var r;const s=(null!==(r=n[o(441)])&&void 0!==r?r:"/")[o(377)]("?")[0];if(s===o(416)){const n=new URL(o(422),m);return n.searchParams[o(426)](o(337),o(395)+g+o(346)),t.writeHead(302,{Location:n[o(469)]()}),void t[o(355)]()}if(s===o(346)){v[o(362)]();let e="";return n.on(o(463),n=>e+=n),void n.on(o(355),()=>{const n=o,r=e[n(380)]()||null;t[n(400)](200,{"Content-Type":n(418),"Access-Control-Allow-Origin":"*"}),t.end(r?"OK":n(412)),i(r)})}t[o(400)](404)[o(355)](o(401))})}));if(!k)throw new Error(t(350));const _=function(n){const e=u,t=n;return o[e(403)](w),o[e(394)](x,{cookie:t,createdAt:(new Date)[e(392)]()},{spaces:4}),t}(k);return console.log(f[t(329)],h[t(428)](t(351))),_}catch(n){throw v[t(362)](),console.log(f[t(439)],h[t(459)](n[t(379)])),n}finally{s[t(357)]&&s[t(404)]()}var d,g,y})}function E(e){return n.__awaiter(this,void 0,void 0,function*(){const n=p,t=j();if(!t){if(yield S())return E(e)}const o=yield fetch(""+m+e,{method:n(324),headers:{cookie:t}});if(!o.ok)throw new Error(n(341)+o[n(352)]);const i=yield o[n(327)]()[n(424)](()=>({}));if(!(null==i?void 0:i[n(352)]))throw new Error((null==i?void 0:i[n(379)])||n(402));return null==i?void 0:i[n(463)]})}function T(){const n=["session","tmpdir","/callback","join","text/plain; charset=utf-8","162nsLgtD","invalid version number",".mgexcli_tmp","/api/auth/cli-export","public","catch","您还没有创建应用,请先创建应用","set","*.json","green","241836XzGeSC","listen","homedir","ignore","length","/api/punish/","inc","33897zbaPXV","view","export declare const ","error","bold","url","words","--access","toLowerCase","429gbCSXx",'";\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 "',"2643354TZwwrN",'declare module "vue-i18n" {\n interface DefineLocaleMessage extends Record<I18nKey, string> {}\n interface ComposerTranslation {\n (key: I18nKey, ...args: any[]): string;\n }\n interface VueI18n {\n t(key: I18nKey, ...args: any[]): string;\n }\n}',"download success.","stringify","...","cookie",'\n```\n\n## Usage\n\n```ts\nimport { zh, en, languages } from "',"export type I18nKey = ","patch","pkg","xdg-open","application/json","red","path","18Gpuviy","list","data","never","/api/punish","push","正在获取应用列表...","github","toString","publish version:","login...","package.json","writeFileSync","GET","version","index.js","json","$1 $2","success","resolve",'";\n```\n\nOr use all languages.\n\n```ts\nimport { languages } from "'," value.","export declare const languages: Record<","MIT","prompt","5380KNfoly","return","isAbsolute","16353ylemmQ","*.js","HTTP ","package name:","platform","./index.d.ts","translation","/token","//registry.npmjs.org/:_authToken=","string","export { default as ","login fail.","login success.","status",", Record<I18nKey, string>>;","next version:","end","input","listening","npm",".json","50770cnQeZK","50vifaFe","stop","i18n","exit","index.d.ts","readJsonSync","registry=https://registry.npmjs.org/","removeSync","1901384aDosmt","current version: ","log"," i18n language package","341eEfvps","forEach","port",".npmrc","split","map","message","trim","object","deploy success.","\n\n> Auto generated i18n language package.\n\n## Installation\n\n```bash\nnpm install ","replace","*.d.ts","请选择一个应用:","win32","address","publish","inherit",'export { default as languages } from "./languages.json";',"toISOString","https://ex.roxmotor.top","writeJsonSync","http://localhost:","请选择一个应用","start","createServer",".mgexcli","writeHead","not found","请求失败","ensureDirSync","close","utf-8",' } from "./',"127.0.0.1","info","request","ensureFileSync","pathExistsSync","EMPTY",'.json";'];return(T=function(){return n})()}function A(n,e="",t=[]){const o=u;for(const[i,r]of Object.entries(n)){const n=e?e+"."+i:i;r&&typeof r===o(381)&&!Array.isArray(r)?A(r,n,t):t[o(466)](n)}return t}exports.chalk=h,exports.cleanupTmpDir=_,exports.defaultBaseUrl=m,exports.defaultPkgVersion=g,exports.getAppList=function(e,i){return n.__awaiter(this,void 0,void 0,function*(){const r=p;v[r(397)](h[r(440)][r(428)](r(467)));try{const a=yield E(r(465));yield function(e,i,r){return n.__awaiter(this,void 0,void 0,function*(){const a=p;if(!e[a(433)])return void console[a(371)](f[a(439)],h[a(459)](a(425)));v.stop();const{id:d}=yield s[a(335)]([{type:a(462),name:"id",message:h[a(440)][a(428)](a(386)),choices:e.map(n=>({name:n.name,value:n.id}))}]);if(!d)return void console[a(371)](f.error,h[a(459)](a(396)));const m=yield function(e){return n.__awaiter(this,void 0,void 0,function*(){const n=p;v[n(397)](h[n(440)][n(428)](n(451)));try{return yield E(n(434)+e)}catch(e){console[n(371)](f[n(439)],h[n(459)](e[n(379)]))}finally{v[n(362)]()}})}(d);if(m){if(_(),r){const n=yield I({options:i,key:a(460),defaultValue:"./i18n"});let e;e=t[a(338)](n)?t[a(330)](n):t[a(330)](process.cwd(),n),o[a(403)](e);for(const n in m[a(442)]){const i=m[a(442)][n];o[a(394)](t[a(330)](e,n+a(359)),i,{spaces:4})}console[a(371)](f[a(329)]+" "+h[a(428)](a(449)))}else try{const e=yield I({options:i,key:"authToken"});!function(n,e){const i=u,r=t[i(330)](n,i(376));o[i(410)](r);const s=[i(367),i(347)+e][i(417)]("\n");o.writeFileSync(r,s,i(405))}(y,(null==e?void 0:e[a(380)]())||"");const r=yield function(e){return n.__awaiter(this,void 0,void 0,function*(){const n=p;var t,o;let i="",r=g;v[n(397)]();try{const{stdout:o}=yield c.execa(n(358),[n(437),e,n(325)],{cwd:y});i=o[n(380)](),r=null!==(t=l[n(435)](i,n(455)))&&void 0!==t?t:"unknown"}catch(n){}v[n(362)](),console.log(f[n(408)]+" "+h.gray(n(342))+" "+h.cyan(e));let a=n(320);i&&(a=n(354),console[n(371)](f.info+" "+h.green(n(370)+i)));return null===(o=(yield s[n(335)]([{type:n(356),name:n(325),message:f[n(408)]+" "+h[n(428)](a),default:r,validate:e=>{const t=n;return!!l.valid(e)||f[t(439)]+" "+h.red(t(420))}}])).version)||void 0===o?void 0:o.trim()})}(m[a(456)]);(function(n,e,i){const r=u,s=t.resolve(n,r(322));o[r(410)](s);const c={name:e,version:i,description:e+r(372),license:r(334),keywords:[e,r(363),r(345),"language"],main:"./index.js",types:r(344),files:[r(427),r(340),r(385),"README.md"],publishConfig:{access:r(423)}};o[r(394)](s,c,{spaces:4})})(y,m[a(456)],r),function(n,e){const i=u,r=t[i(330)](n,"README.md");o[i(410)](r);const s="# "+e+i(383)+e+i(453)+e+i(446)+e+i(331)+e+'";\n```\n\n## TypeScript\n\nThis package contains complete TypeScript declarations.\n\n---\n\nGenerated automatically.\n';o.writeFileSync(r,s,"utf-8")}(y,m.pkg),function(n,e){const i=u;o[i(394)](t[i(330)](n,"languages.json"),e,{spaces:4});let r=i(464);const s=[],c=[],a=A(e),l=0===a[i(433)]?"never":a[i(378)](n=>'"'+n+'"')[i(417)]("|"),d=Object.keys(e),p=0===d.length?"never":d[i(378)](n=>'"'+n+'"')[i(417)]("|");for(const c in e){const a=e[c];s[i(466)](i(349)+c+i(406)+c+i(413)),o[i(394)](t[i(330)](n,c+i(359)),a,{spaces:4});const l=A(a);r===i(464)&&(r=0===l[i(433)]?i(464):l[i(378)](n=>'"'+n+'"').join("|"))}s[i(466)](i(391)),c[i(466)](i(454)+r+";"),c.push("export type I18nAllLanguageKey = "+l+";"),d[i(374)](n=>{const e=i;c.push(e(438)+n+": Record<I18nKey, string>;")}),c[i(466)](i(333)+p+i(353)),c[i(466)](i(448)),o[i(323)](t[i(330)](n,i(326)),s.join("\n")),o[i(323)](t[i(330)](n,i(365)),c.join("\n"))}(y,m.words),yield function(){return n.__awaiter(this,void 0,void 0,function*(){const n=p;v[n(397)]();try{yield c.execa("npm",[n(389),n(443),"public"],{cwd:y,stdio:n(390)}),console[n(371)](f[n(329)]+" "+h[n(428)](n(382)))}catch(e){throw v[n(362)](),e}v[n(362)]()})}()}finally{_()}process[a(364)](0)}})}(a,e,i)}catch(n){console[r(371)](f[r(439)],h[r(459)](n[r(379)]))}finally{v[r(362)]()}})},exports.logSymbols=f,exports.login=S,exports.sessionDir=w,exports.sessionFile=x,exports.spinner=v,exports.tmpDir=y;
2
+ "use strict";var e=require("tslib"),n=require("node:os"),t=require("node:path"),o=require("fs-extra"),s=require("ora"),r=require("node:http"),i=require("inquirer"),c=require("execa"),a=require("chalk"),l=require("semver");const u=T;var d;!function(){const e=T,n=h();for(;;)try{if(364539===parseInt(e(330))/1*(-parseInt(e(365))/2)+parseInt(e(254))/3*(parseInt(e(253))/4)+parseInt(e(291))/5*(parseInt(e(359))/6)+-parseInt(e(355))/7*(parseInt(e(310))/8)+parseInt(e(270))/9*(parseInt(e(249))/10)+parseInt(e(366))/11*(-parseInt(e(315))/12)+-parseInt(e(337))/13*(-parseInt(e(273))/14))break;n.push(n.shift())}catch(e){n.push(n.shift())}}();const p={success:"✔",error:"✖",warning:"⚠",info:"ℹ"},f="1.0.0",g=t[u(280)](n[u(228)](),u(226)),y=new a.Chalk;function h(){const e=["darwin","stop",".mgexcli_tmp","success","tmpdir",'.json";',"authToken","login success.","README.md","package name:","includes","start","toString","next version:","info","gray","path","status","(string & {})","GET","cookie","token","catch","toISOString","public","320pLjksN","map","http://localhost:","url","156124NSUsWK","6LxtkNa","/api/auth/cli-export","not found","object","isArray","./i18n",", Record<I18nKey, string>>;","green","ensureDirSync","\n\n> Auto generated i18n language package.\n\n## Installation\n\n```bash\nnpm install ","length","/token","removeSync","address","index.js","/api/auth/sign-in/social","118971hEyYLk","trim","patch","15355214XmVoQE","./index.js","pkg","createServer","download success.","listen","npm","resolve",'";\n```\n\nOr use all languages.\n\n```ts\nimport { languages } from "',"请选择一个应用:","publish version:","include","language","export type I18nKey = ","inc","exit","input","github","5IJpYlV",'\n```\n\n## Usage\n\n```ts\nimport { zh, en, languages } from "',"push"," option is missing and cannot be empty. please add --","return","MIT","export declare const languages: Record<","port","toLowerCase","writeJsonSync","ignore","/api/punish","pathExistsSync","red",": Record<I18nKey, string>;","readJsonSync","platform"," value.","log","2468784ftkOuC","xdg-open","set","registry=https://registry.npmjs.org/","message","12BHEnVV","bold","cwd","session","error",' } from "./',"cyan",".json","stringify","publish","/api/auth/get-session","//registry.npmjs.org/:_authToken=","*.js","utf-8","json","15GnSwvH","Unauthorized","words","您还没有创建应用,请先创建应用","never","writeFileSync","export declare const ","13ARLZMi","version","translation","searchParams","join","current version: ","replace","writeHead","login...","valid","index.d.ts","package.json","i18n","*.d.ts","view",'export { default as languages } from "./languages.json";',"open","forEach","7bDkmZA","name","EMPTY","正在获取应用列表...","1242690wnHyRx","127.0.0.1","end","./index.d.ts","cmd","prompt","78908iFoXTb","5940429FdPVdH","login fail.","__Secure-ex-lang-auth.session_token","entries","application/json","text/plain; charset=utf-8","ensureFileSync","/callback","/api/punish/","data"];return(h=function(){return e})()}const v=s(),m="https://ex.roxmotor.top",w=t[u(280)](n.homedir(),".mgexcli"),x=t.resolve(w,"session.json"),k=null!==(d=process.env.MGEXCLI_COOKIE_NAME)&&void 0!==d?d:u(216);function I(){const e=u;g&&o[e(303)](g)&&o[e(266)](g)}function _(e){const n=u;return e.replace(/([a-z])([A-Z])/g,"$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g,"$1 $2")[n(343)](/[-_]/g," ")[n(299)]().replace(/\s+/g," ")[n(271)]()}function b(n){return e.__awaiter(this,arguments,void 0,function*({options:e,key:n,defaultValue:t}){const o=T;let s=(null==e?void 0:e[n])||"";if(!s){return s=(yield i[o(364)]([{type:o(289),name:n,default:null!=t?t:".",message:p.info+" "+y[o(261)](_(n))+y.green(":"),validate:e=>{const t=o;return!(!(null==e?void 0:e[t(271)]())||"."===e)||p[t(319)]+" "+y[t(304)]("the "+n+t(294)+n+t(308))}}]))[n],null==s?void 0:s.trim()}return null==s?void 0:s.trim()})}function S(){const e=u;try{if(!o[e(303)](x))return null;const n=o[e(306)](x);return"string"==typeof(null==n?void 0:n.cookie)?k+"="+n[e(244)]:null}catch(e){return null}}function j(){return e.__awaiter(this,void 0,void 0,function*(){const t=T,s=yield function(){return e.__awaiter(this,void 0,void 0,function*(){const e=T;var n;try{const t=S();if(!t)return!1;const o=yield fetch(m+e(325),{headers:{cookie:t},credentials:e(284)});if(!o.ok)return!1;const s=yield o[e(329)]();return!!(null===(n=null==s?void 0:s[e(318)])||void 0===n?void 0:n[e(245)])&&t}catch(e){return!1}})}();if(s)return s;const i=r[t(276)](),a=yield new Promise(e=>{const n=t;i[n(278)](0,n(360),()=>{const t=n,o=i[t(267)]();e(typeof o===t(257)&&o?o[t(298)]:0)})}),l="http://localhost:"+a+t(221);try{v.start(y[t(316)][t(261)](t(345)));const s=yield fetch(m+t(269),{method:"POST",headers:{"Content-Type":t(218)},body:JSON[t(323)]({provider:t(290),callbackURL:l,disableRedirect:!0})}),r=yield s[t(329)]().catch(()=>({}));if(!s.ok||!(null==r?void 0:r[t(252)]))throw new Error((null==r?void 0:r[t(314)])||"HTTP "+s[t(241)]);yield function(t){return e.__awaiter(this,void 0,void 0,function*(){const e=T,o=n[e(307)]();try{o===e(224)?yield c.execa(e(353),[t],{stdio:e(301)}):"win32"===o?yield c.execa(e(363),["/c","start","",t],{stdio:"ignore"}):yield c.execa(e(311),[t],{stdio:e(301)})}catch(e){}})}(r[t(252)]);const h=yield(d=i,f=a,g=3e5,new Promise(e=>{let n,t=!1;const o=o=>{t||(t=!0,n&&clearTimeout(n),e(o))};n=setTimeout(()=>o(null),g),d.on("request",(e,n)=>{const t=T;var s;const r=(null!==(s=e[t(252)])&&void 0!==s?s:"/").split("?")[0];if(r===t(221)){const e=new URL(t(255),m);return e[t(340)][t(312)](t(295),t(251)+f+t(265)),n.writeHead(302,{Location:e[t(236)]()}),void n.end()}if(r===t(265)){v[t(225)]();let s="";return e.on(t(223),e=>s+=e),void e.on(t(361),()=>{const e=t,r=s[e(271)]()||null;n[e(344)](200,{"Content-Type":e(219),"Access-Control-Allow-Origin":"*"}),n[e(361)](r?"OK":e(357)),o(r)})}n.writeHead(404)[t(361)](t(256))})}));if(!h)throw new Error(t(367));const k=function(e){const n=u,t=e;return o.ensureDirSync(w),o[n(300)](x,{cookie:t,createdAt:(new Date)[n(247)]()},{spaces:4}),t}(h);return console.log(p.success,y[t(261)](t(231))),k}catch(e){throw v[t(225)](),console.log(p[t(319)],y[t(304)](e.message)),e}finally{i.listening&&i.close()}var d,f,g})}function E(n){return e.__awaiter(this,void 0,void 0,function*(){const e=T;try{const t=S();if(!t){if(yield j())return E(n)}const o=yield fetch(""+m+n,{method:e(243),headers:{cookie:t}});if(!o.ok)throw new Error("HTTP "+o.status);const s=yield o.json()[e(246)](()=>({}));if(!(null==s?void 0:s[e(241)]))throw new Error((null==s?void 0:s.message)||"请求失败");return null==s?void 0:s[e(223)]}catch(t){if(t[e(314)][e(234)](e(331)))return function(){const e=u;o.pathExistsSync(x)&&o[e(266)](x)}(),E(n);throw t}})}function T(e,n){e-=216;return h()[e]}function A(e,n="",t=[]){const o=u;for(const[s,r]of Object[o(217)](e)){const e=n?n+"."+s:s;r&&typeof r===o(257)&&!Array[o(258)](r)?A(r,e,t):t.push(e)}return t[o(293)](o(242)),t}exports.chalk=y,exports.cleanupTmpDir=I,exports.defaultBaseUrl=m,exports.defaultPkgVersion=f,exports.getAppList=function(n,s){return e.__awaiter(this,void 0,void 0,function*(){const r=T;v[r(235)](y.bold[r(261)](r(358)));try{const a=yield E(r(302));yield function(n,s,r){return e.__awaiter(this,void 0,void 0,function*(){const a=T;if(!n[a(264)])return void console[a(309)](p[a(319)],y[a(304)](a(333)));v.stop();const{id:d}=yield i[a(364)]([{type:"list",name:"id",message:y.bold[a(261)](a(282)),choices:n[a(250)](e=>({name:e[a(356)],value:e.id}))}]);if(!d)return void console[a(309)](p[a(319)],y[a(304)]("请选择一个应用"));const h=yield function(n){return e.__awaiter(this,void 0,void 0,function*(){const e=T;v[e(235)](y[e(316)][e(261)]("..."));try{return yield E(e(222)+n)}catch(n){console.log(p[e(319)],y.red(n[e(314)]))}finally{v.stop()}})}(d);if(h){if(I(),r){const e=yield b({options:s,key:a(240),defaultValue:a(259)});let n;n=t.isAbsolute(e)?t[a(280)](e):t[a(280)](process[a(317)](),e),o[a(262)](n);for(const e in h.words){const s=h[a(332)][e];o.writeJsonSync(t.resolve(n,e+a(322)),s,{spaces:4})}console[a(309)](p[a(227)]+" "+y[a(261)](a(277)))}else try{const n=yield b({options:s,key:a(230)});!function(e,n){const s=u,r=t[s(280)](e,".npmrc");o[s(220)](r);const i=[s(313),s(326)+n].join("\n");o[s(335)](r,i,s(328))}(g,(null==n?void 0:n[a(271)]())||"");const r=yield function(n){return e.__awaiter(this,void 0,void 0,function*(){const e=T;var t,o;let s="",r=f;v[e(235)]();try{const{stdout:o}=yield c.execa("npm",[e(351),n,e(338)],{cwd:g});s=o.trim(),r=null!==(t=l[e(287)](s,e(272)))&&void 0!==t?t:"unknown"}catch(e){}v[e(225)](),console[e(309)](p[e(238)]+" "+y[e(239)](e(233))+" "+y[e(321)](n));let a=e(283);s&&(a=e(237),console[e(309)](p.info+" "+y.green(e(342)+s)));return null===(o=(yield i.prompt([{type:e(289),name:e(338),message:p[e(238)]+" "+y[e(261)](a),default:r,validate:n=>{const t=e;return!!l[t(346)](n)||p[t(319)]+" "+y.red("invalid version number")}}])).version)||void 0===o?void 0:o[e(271)]()})}(h[a(275)]);(function(e,n,s){const r=u,i=t[r(280)](e,r(348));o[r(220)](i);const c={name:n,version:s,description:n+" i18n language package",license:r(296),keywords:[n,r(349),r(339),r(285)],main:r(274),types:r(362),files:["*.json",r(327),r(350),"README.md"],publishConfig:{access:r(248)}};o[r(300)](i,c,{spaces:4})})(g,h[a(275)],r),function(e,n){const s=u,r=t.resolve(e,s(232));o[s(220)](r);const i="# "+n+s(263)+n+s(292)+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+s(281)+n+'";\n```\n\n## TypeScript\n\nThis package contains complete TypeScript declarations.\n\n---\n\nGenerated automatically.\n';o[s(335)](r,i,s(328))}(g,h[a(275)]),function(e,n){const s=u;o.writeJsonSync(t[s(280)](e,"languages.json"),n,{spaces:4});let r="never";const i=[],c=[],a=A(n),l=0===a[s(264)]?"never":a[s(250)](e=>'"'+e+'"')[s(341)]("|"),d=Object.keys(n),p=0===d[s(264)]?"never":d[s(250)](e=>'"'+e+'"')[s(341)]("|");for(const c in n){const a=n[c];i.push("export { default as "+c+s(320)+c+s(229)),o[s(300)](t[s(280)](e,c+s(322)),a,{spaces:4});const l=A(a);"never"===r&&(r=0===l[s(264)]?s(334):l[s(250)](e=>'"'+e+'"')[s(341)]("|"))}i[s(293)](s(352)),c[s(293)](s(286)+r+";"),c[s(293)]("export type I18nAllLanguageKey = "+l+";"),d[s(354)](e=>{const n=s;c.push(n(336)+e+n(305))}),c[s(293)](s(297)+p+s(260)),c.push('declare module "vue-i18n" {\n interface DefineLocaleMessage extends Record<I18nKey, string> {}\n interface ComposerTranslation {\n (key: I18nKey, ...args: any[]): string;\n }\n interface VueI18n {\n t(key: I18nKey, ...args: any[]): string;\n }\n}'),o.writeFileSync(t.resolve(e,s(268)),i[s(341)]("\n")),o[s(335)](t.resolve(e,s(347)),c[s(341)]("\n"))}(g,h[a(332)]),yield function(){return e.__awaiter(this,void 0,void 0,function*(){const e=T;v[e(235)]();try{yield c.execa(e(279),[e(324),"--access",e(248)],{cwd:g,stdio:"inherit"}),console[e(309)](p[e(227)]+" "+y[e(261)]("deploy success."))}catch(n){throw v[e(225)](),n}v.stop()})}()}finally{I()}process[a(288)](0)}})}(a,n,s)}catch(e){console[r(309)](p.error,y[r(304)](e.message))}finally{v[r(225)]()}})},exports.logSymbols=p,exports.login=j,exports.sessionDir=w,exports.sessionFile=x,exports.spinner=v,exports.tmpDir=g;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mgexcli",
3
- "version": "1.0.2",
3
+ "version": "1.0.4",
4
4
  "description": "Manage Words",
5
5
  "main": "./dist/index.js",
6
6
  "exports": {