@lovrabet/cli 1.1.4 → 1.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/add-page/input-page-router.js +1 -1
- package/lib/add-page/main.js +1 -1
- package/lib/add-page/select-page-template.js +1 -1
- package/lib/api/api-pull-ui.js +1 -1
- package/lib/api/format-dataset.js +1 -1
- package/lib/api/generate-api-file.js +1 -1
- package/lib/api/main.js +1 -1
- package/lib/api/pull-silent.js +1 -1
- package/lib/api/pull.js +1 -1
- package/lib/auth/auth-server-ui.js +1 -1
- package/lib/auth/auth-server.js +1 -1
- package/lib/auth/constant.js +1 -1
- package/lib/auth/get-cookie.js +1 -1
- package/lib/auth/is-session-valid.js +1 -1
- package/lib/auth/logout.js +1 -1
- package/lib/cli.js +1 -1
- package/lib/cmd/build-watch.js +1 -1
- package/lib/cmd/build.js +1 -1
- package/lib/cmd/logs.js +1 -1
- package/lib/cmd/preview.js +1 -1
- package/lib/cmd/start.js +1 -1
- package/lib/config/config-help.js +1 -1
- package/lib/config/main.js +1 -1
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.js +1 -1
- package/lib/create-app/enhanced-guided-create.js +1 -1
- package/lib/create-app/format-elapsed.js +1 -1
- package/lib/create-app/main.js +1 -1
- package/lib/create-app/task-finished.js +1 -1
- package/lib/create-app/task-loading.js +1 -1
- package/lib/create-app/task-running.js +1 -1
- package/lib/create-app/task-time.js +1 -1
- package/lib/create-app/use-copy-project-template.js +1 -1
- package/lib/create-app/use-format-code.js +1 -1
- package/lib/create-app/use-install-dependencies.js +1 -1
- package/lib/help.js +1 -1
- package/lib/utils/config.js +1 -1
- package/lib/utils/copy-directory.js +1 -1
- package/lib/utils/http-client.js +1 -0
- package/lib/utils/logger.js +1 -1
- package/lib/utils/router-updater.js +1 -1
- package/lib/utils/template-replacer.js +1 -1
- package/package.json +21 -3
- package/templates/generate-api/client.ts.tpl +1 -1
- package/templates/projects/sub-app-react-demo/package-lock.json +4 -4
- package/templates/projects/sub-app-react-demo/package.json +1 -1
- package/templates/projects/sub-app-react-demo/src/pages/sdk-demo/index.tsx +69 -24
- package/templates/projects/sub-app-react-demo/src/router/index.tsx +4 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x52c994,_0x107fce){const _0x2f36a7=a0_0x2567,_0x1fb418=_0x52c994();while(!![]){try{const _0x1f7dfe=parseInt(_0x2f36a7(0xe1))/0x1*(-parseInt(_0x2f36a7(0xd1))/0x2)+-parseInt(_0x2f36a7(0xd7))/0x3*(-parseInt(_0x2f36a7(0xdf))/0x4)+-parseInt(_0x2f36a7(0xda))/0x5*(-parseInt(_0x2f36a7(0xc8))/0x6)+-parseInt(_0x2f36a7(0xc7))/0x7+parseInt(_0x2f36a7(0xca))/0x8+parseInt(_0x2f36a7(0xce))/0x9+parseInt(_0x2f36a7(0xd8))/0xa;if(_0x1f7dfe===_0x107fce)break;else _0x1fb418['push'](_0x1fb418['shift']());}catch(_0x44d4aa){_0x1fb418['push'](_0x1fb418['shift']());}}}(a0_0x491e,0x2fec9));import{jsx as a0_0x42f6fe,jsxs as a0_0x3cc92e}from'react/jsx-runtime';function a0_0x2567(_0x105e07,_0x20b811){const _0x491e2b=a0_0x491e();return a0_0x2567=function(_0x256708,_0x1677e5){_0x256708=_0x256708-0xc5;let _0x43b575=_0x491e2b[_0x256708];return _0x43b575;},a0_0x2567(_0x105e07,_0x20b811);}import{useState}from'react';import{Text,Box,useInput}from'ink';import a0_0x58ceb3 from'node:fs';export function InputProjectCode(_0x25cd4d){const _0x1775f4=a0_0x2567,{onSubmit:_0x6e4a9f,pagePath:_0x165251}=_0x25cd4d,[_0x42578b,_0x3cbeb9]=useState(''),[_0x5ff665,_0x453deb]=useState(''),_0x5a4471=_0x1775f4(0xc9);function _0x38c177(_0xb0e558){const _0x11c6cc=_0x1775f4;if(_0xb0e558[_0x11c6cc(0xc5)]>0x64)return{'valid':![],'message':'页面路径长度不能超过\x20100\x20个字符'};if(_0xb0e558[_0x11c6cc(0xcc)]('/')||_0xb0e558[_0x11c6cc(0xd5)]('/'))return{'valid':![],'message':_0x11c6cc(0xcd)};if(_0xb0e558[_0x11c6cc(0xcb)]('//'))return{'valid':![],'message':_0x11c6cc(0xd0)};const _0x105eac=_0xb0e558['split']('/');for(const _0xf3c095 of _0x105eac){if(!_0xf3c095)continue;const _0x13facc=/^[A-Za-z0-9][A-Za-z0-9_-]*$/;if(!_0x13facc[_0x11c6cc(0xdb)](_0xf3c095))return{'valid':![],'message':_0x11c6cc(0xcf)};}return{'valid':!![]};}return useInput((_0x1e3ecd,_0x20d378)=>{const _0x13dc4d=_0x1775f4;if(_0x20d378[_0x13dc4d(0xd3)]){const _0x19f7f1=_0x42578b[_0x13dc4d(0xdd)]()||_0x5a4471;if(_0x5ff665)return;const _0x29fa93=_0x165251+'/'+_0x19f7f1;if(a0_0x58ceb3[_0x13dc4d(0xc6)](_0x29fa93)){_0x453deb(_0x13dc4d(0xd6)+_0x19f7f1+_0x13dc4d(0xe0));return;}_0x6e4a9f(_0x19f7f1),_0x3cbeb9(''),_0x453deb('');}else _0x20d378['backspace']||_0x20d378[_0x13dc4d(0xd4)]?_0x3cbeb9(_0x5a45a8=>{const _0x5bea32=_0x13dc4d,_0xbaa9b1=_0x5a45a8[_0x5bea32(0xe2)](0x0,-0x1),{valid:_0x2ada3a,message:_0x58f6cf}=_0x38c177(_0xbaa9b1);return _0x453deb(_0x2ada3a?'':_0x58f6cf||_0x5bea32(0xd9)),_0xbaa9b1;}):_0x3cbeb9(_0x1efdff=>{const _0x3fae8d=_0x13dc4d,_0x20b5f9=_0x1efdff+_0x1e3ecd,{valid:_0x20943a,message:_0x245f49}=_0x38c177(_0x20b5f9);return _0x453deb(_0x20943a?'':_0x245f49||_0x3fae8d(0xd9)),_0x20b5f9;});}),a0_0x3cc92e(Box,{'flexDirection':'column','children':[a0_0x3cc92e(Box,{'children':[a0_0x42f6fe(Text,{'color':_0x1775f4(0xdc),'children':'\x20Step2:\x20'}),a0_0x42f6fe(Text,{'children':_0x1775f4(0xd2)}),_0x42578b?a0_0x42f6fe(Text,{'color':'green','children':_0x42578b}):a0_0x42f6fe(Text,{'color':_0x1775f4(0xdc),'children':_0x5a4471}),_0x5ff665&&a0_0x3cc92e(Text,{'color':'red','children':[_0x1775f4(0xde),_0x5ff665]})]}),!_0x5ff665&&!_0x42578b&&a0_0x42f6fe(Box,{'children':a0_0x42f6fe(Text,{'color':_0x1775f4(0xdc),'children':'\x20直接回车确认,或输入自定义路由地址'})})]});}function a0_0x491e(){const _0x26e826=['trim','\x20←\x20','16itRryK','\x20已存在,请使用其他路径','372317eQxtAX','slice','length','existsSync','2587809tBHGBu','1122IlNevS','my-page','2317120AvHVrx','includes','startsWith','路径不能以\x20/\x20开头或结尾','1136601IfeDYz','路径中的每个段只能以字母或数字开头,且只包含字母、数字、-\x20和\x20_','路径不能包含连续的\x20/','2rVXGLu','页面路由地址:\x20','return','delete','endsWith','页面路径\x20','55263aWKQCG','584190UlpBZA','页面路径不合法','10435aASDkC','test','gray'];a0_0x491e=function(){return _0x26e826;};return a0_0x491e();}
|
package/lib/add-page/main.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a1_0x420915=a1_0x4ec5;(function(_0x181056,_0x5d292d){const _0x480478=a1_0x4ec5,_0x1fe931=_0x181056();while(!![]){try{const _0x3380e2=-parseInt(_0x480478(0x183))/0x1+parseInt(_0x480478(0x17c))/0x2+parseInt(_0x480478(0x17e))/0x3+parseInt(_0x480478(0x188))/0x4+-parseInt(_0x480478(0x18c))/0x5*(parseInt(_0x480478(0x182))/0x6)+-parseInt(_0x480478(0x18d))/0x7+parseInt(_0x480478(0x187))/0x8;if(_0x3380e2===_0x5d292d)break;else _0x1fe931['push'](_0x1fe931['shift']());}catch(_0x21769b){_0x1fe931['push'](_0x1fe931['shift']());}}}(a1_0x3063,0xef726));import{jsx as a1_0x426fdf,jsxs as a1_0x3339cc,Fragment as a1_0x8e25ae}from'react/jsx-runtime';function a1_0x4ec5(_0x17b326,_0x214132){const _0x306340=a1_0x3063();return a1_0x4ec5=function(_0x4ec5cf,_0x371900){_0x4ec5cf=_0x4ec5cf-0x16d;let _0x2b1aa3=_0x306340[_0x4ec5cf];return _0x2b1aa3;},a1_0x4ec5(_0x17b326,_0x214132);}import{fileURLToPath}from'node:url';import a1_0x4835f0 from'node:path';import{useEffect,useState}from'react';import{Box,Text,useApp}from'ink';import{SelectPageTemplate}from'./select-page-template.js';function a1_0x3063(){const _0x3f6de2=['now','正在创建页面,请稍候…','../../templates/pages','18150856sGVGwN','5266292aXSwOR','已选择页面模板\x20','finally','src','1722590zfWzRd','13197366JZtGpQ','info','dirname','\x20*\x20页面文件已创建,可直接通过路由访问','gray','setLogPath','已输入的页面路由\x20','\x20*\x20页面路径:\x20','url','add-page','processTemplate','\x20Step2:\x20','cyan','join','\x20Step1:\x20','页面添加失败:\x20','pages','486174qdIrRx','开始添加页面:\x20','1590942qHbLaQ','页面添加成功:\x20','green','column','12dWIJAR','803683SQCudK'];a1_0x3063=function(){return _0x3f6de2;};return a1_0x3063();}import{InputProjectCode}from'./input-page-router.js';import{logger}from'../utils/logger.js';import{TemplateReplacer}from'../utils/template-replacer.js';const __dirname=a1_0x4835f0[a1_0x420915(0x16d)](fileURLToPath(import.meta[a1_0x420915(0x173)])),pageTemplateDir=a1_0x4835f0['resolve'](__dirname,a1_0x420915(0x186)),projectDir=process['cwd']();export const AddPage=()=>{const _0x1da9ec=a1_0x420915,{exit:_0x4aef54}=useApp(),[_0x38d218,_0xef5c3e]=useState(''),[_0x359ad1,_0x13bcb1]=useState(''),[_0x30c92a,_0x3fc62a]=useState(![]),[_0x28272c,_0x5d957c]=useState(![]),_0x5df2d1=a1_0x4835f0[_0x1da9ec(0x178)](projectDir,_0x1da9ec(0x18b),_0x1da9ec(0x17b)),_0x2b1d23=a1_0x4835f0[_0x1da9ec(0x178)](_0x5df2d1,_0x359ad1),_0xdfc9f3=a1_0x4835f0['join']('src',_0x1da9ec(0x17b),_0x359ad1);useEffect(()=>{const _0x5729ea=_0x1da9ec,_0x4bb0e3=a1_0x4835f0['resolve'](pageTemplateDir,_0x38d218);if(_0x38d218&&_0x359ad1){_0x3fc62a(!![]),logger[_0x5729ea(0x170)](process['cwd']());const _0x4c1fc9=Date[_0x5729ea(0x184)]();logger[_0x5729ea(0x18e)]('add-page',_0x5729ea(0x17d)+_0x359ad1,{'template':_0x38d218,'targetPath':_0xdfc9f3}),TemplateReplacer[_0x5729ea(0x175)](_0x4bb0e3,a1_0x4835f0[_0x5729ea(0x178)](_0x5df2d1,_0x359ad1),_0x359ad1,_0x38d218)['then'](()=>{const _0x137c3c=_0x5729ea,_0x2d305f=Date[_0x137c3c(0x184)]()-_0x4c1fc9;logger['success']('add-page',_0x137c3c(0x17f)+_0x359ad1,_0x2d305f,{'template':_0x38d218,'targetPath':_0xdfc9f3,'routePath':_0x359ad1}),_0x5d957c(!![]);})['catch'](_0x565d8d=>{const _0xff61ec=_0x5729ea,_0x5c131e=Date[_0xff61ec(0x184)]()-_0x4c1fc9;logger['error'](_0xff61ec(0x174),_0xff61ec(0x17a)+_0x359ad1,{'template':_0x38d218,'targetPath':_0xdfc9f3,'error':_0x565d8d instanceof Error?_0x565d8d['message']:String(_0x565d8d),'duration':_0x5c131e});})[_0x5729ea(0x18a)](()=>{_0x3fc62a(![]);});}},[_0x38d218,_0x359ad1]),useEffect(()=>{_0x28272c&&setTimeout(()=>{_0x4aef54();});},[_0x28272c]);if(_0x38d218)return a1_0x3339cc(Box,{'flexDirection':_0x1da9ec(0x181),'paddingY':0x1,'children':[a1_0x3339cc(Box,{'children':[a1_0x426fdf(Text,{'color':'gray','children':_0x1da9ec(0x179)}),a1_0x426fdf(Text,{'children':_0x1da9ec(0x189)}),a1_0x426fdf(Text,{'color':_0x1da9ec(0x180),'children':_0x38d218})]}),_0x359ad1?a1_0x3339cc(Box,{'children':[a1_0x426fdf(Text,{'color':'gray','children':_0x1da9ec(0x176)}),a1_0x426fdf(Text,{'children':_0x1da9ec(0x171)}),a1_0x426fdf(Text,{'color':'green','children':_0x359ad1})]}):a1_0x426fdf(InputProjectCode,{'pagePath':_0x2b1d23,'onSubmit':_0x13bcb1}),_0x359ad1&&_0x30c92a?a1_0x3339cc(Box,{'marginTop':0x1,'children':[a1_0x426fdf(Box,{'width':'4'}),a1_0x426fdf(Text,{'children':_0x1da9ec(0x185)})]}):null,_0x28272c?a1_0x3339cc(a1_0x8e25ae,{'children':[a1_0x426fdf(Box,{'marginTop':0x1,'children':a1_0x426fdf(Text,{'color':'gray','children':'\x20*\x20页面创建成功!'})}),a1_0x3339cc(Box,{'children':[a1_0x426fdf(Text,{'color':'gray','children':_0x1da9ec(0x172)}),a1_0x426fdf(Text,{'color':'green','children':_0xdfc9f3})]}),a1_0x3339cc(Box,{'children':[a1_0x426fdf(Text,{'color':_0x1da9ec(0x16f),'children':'\x20*\x20路由地址:\x20'}),a1_0x3339cc(Text,{'color':_0x1da9ec(0x180),'children':['/',_0x359ad1]})]}),a1_0x426fdf(Box,{'marginTop':0x1,'children':a1_0x426fdf(Text,{'color':_0x1da9ec(0x177),'children':_0x1da9ec(0x16e)})})]}):null]});return a1_0x426fdf(SelectPageTemplate,{'onSelect':_0xef5c3e});};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x165ef6,_0xee9407){const _0x533c04=a2_0xb34b,_0x7f5ca6=_0x165ef6();while(!![]){try{const _0x5415a6=-parseInt(_0x533c04(0xa8))/0x1*(parseInt(_0x533c04(0xa1))/0x2)+parseInt(_0x533c04(0x9a))/0x3+parseInt(_0x533c04(0xa5))/0x4+-parseInt(_0x533c04(0x9f))/0x5*(parseInt(_0x533c04(0xa4))/0x6)+parseInt(_0x533c04(0x98))/0x7+-parseInt(_0x533c04(0x99))/0x8+parseInt(_0x533c04(0xaa))/0x9*(parseInt(_0x533c04(0xb1))/0xa);if(_0x5415a6===_0xee9407)break;else _0x7f5ca6['push'](_0x7f5ca6['shift']());}catch(_0x15917b){_0x7f5ca6['push'](_0x7f5ca6['shift']());}}}(a2_0x2367,0x8fca6));import{jsx as a2_0x50d0a4,jsxs as a2_0x320352}from'react/jsx-runtime';function a2_0xb34b(_0x4d1b45,_0x20d945){const _0x23673b=a2_0x2367();return a2_0xb34b=function(_0xb34b0e,_0x1293c6){_0xb34b0e=_0xb34b0e-0x97;let _0x3fc16f=_0x23673b[_0xb34b0e];return _0x3fc16f;},a2_0xb34b(_0x4d1b45,_0x20d945);}import{useState,useEffect}from'react';import{Text,Box,useInput}from'ink';function a2_0x2367(){const _0xf32c92=['error','localeCompare','\x20\x20\x20\x20\x20\x20>\x20','blank','resolve','3184314mypOrr','6530440bGzDCy','2075340vlImwt','sdk-fetch','gray','\x20\x20\x20\x20\x20\x20\x20\x20','label','947225FkmHYm','获取模板列表失败:','2iYcWAu','url','isDirectory','6WLZqij','974516iRLnhJ','downArrow','onSelect','203956Ioizla','templates/pages','3675249IbmDBX','length','green','map','join','filter','dirname','10HJodeC','return','\x20Step1:\x20'];a2_0x2367=function(){return _0xf32c92;};return a2_0x2367();}import{readdir}from'node:fs/promises';import a2_0x37889b from'node:path';import{fileURLToPath}from'node:url';async function getTemplateList(){const _0x5e3050=a2_0xb34b;try{const _0x4bb3e0=fileURLToPath(import.meta[_0x5e3050(0xa2)]),_0x66cc13=a2_0x37889b[_0x5e3050(0x97)](a2_0x37889b[_0x5e3050(0xb0)](_0x4bb3e0),'../..'),_0x3459a2=a2_0x37889b[_0x5e3050(0xae)](_0x66cc13,_0x5e3050(0xa9)),_0x56f648=await readdir(_0x3459a2,{'withFileTypes':!![]}),_0x5de7ee=_0x56f648[_0x5e3050(0xaf)](_0x1a8861=>_0x1a8861[_0x5e3050(0xa3)]())[_0x5e3050(0xad)](_0x4d14c2=>({'label':_0x4d14c2['name']}))['sort']((_0x1181ae,_0x5e78a7)=>_0x1181ae[_0x5e3050(0x9e)][_0x5e3050(0xb5)](_0x5e78a7[_0x5e3050(0x9e)]));return _0x5de7ee;}catch(_0x4d64e2){return console[_0x5e3050(0xb4)](_0x5e3050(0xa0),_0x4d64e2),[{'label':_0x5e3050(0xb7)},{'label':_0x5e3050(0x9b)}];}}export function SelectPageTemplate(_0x607a6b){const _0x13f3a2=a2_0xb34b,[_0x5e736f,_0x4e3d79]=useState(0x0),[_0x20a94a,_0x3d6fdd]=useState([]),[_0x557a84,_0x44bd73]=useState(!![]);useEffect(()=>{async function _0xb00b8b(){const _0x476451=await getTemplateList();_0x3d6fdd(_0x476451),_0x44bd73(![]);}_0xb00b8b();},[]),useInput((_0x3bb38c,_0x1b1f6a)=>{const _0x5d216b=a2_0xb34b;if(_0x557a84)return;if(_0x1b1f6a[_0x5d216b(0xb2)]){const _0x30467a=_0x20a94a[_0x5e736f];_0x30467a&&_0x607a6b[_0x5d216b(0xa7)](_0x30467a[_0x5d216b(0x9e)]);}_0x1b1f6a['upArrow']&&_0x4e3d79(_0xead3b1=>_0xead3b1===0x0?_0x20a94a[_0x5d216b(0xab)]-0x1:_0xead3b1-0x1),_0x1b1f6a[_0x5d216b(0xa6)]&&_0x4e3d79(_0x2b98cd=>_0x2b98cd===_0x20a94a[_0x5d216b(0xab)]-0x1?0x0:_0x2b98cd+0x1);});if(_0x557a84)return a2_0x50d0a4(Box,{'flexDirection':'column','paddingY':0x1,'children':a2_0x320352(Box,{'children':[a2_0x50d0a4(Text,{'color':_0x13f3a2(0x9c),'children':_0x13f3a2(0xb3)}),a2_0x50d0a4(Text,{'children':'正在加载页面模板...'})]})});return a2_0x320352(Box,{'flexDirection':'column','paddingY':0x1,'children':[a2_0x320352(Box,{'children':[a2_0x50d0a4(Text,{'color':_0x13f3a2(0x9c),'children':_0x13f3a2(0xb3)}),a2_0x50d0a4(Text,{'children':'请选择您要创建的页面模板'})]}),_0x20a94a[_0x13f3a2(0xad)]((_0x50f4eb,_0x2d904)=>{const _0xbcce74=_0x13f3a2,_0x3bc0eb=_0x2d904===_0x5e736f,_0x14865c=_0x3bc0eb?_0xbcce74(0xb6)+_0x50f4eb[_0xbcce74(0x9e)]:_0xbcce74(0x9d)+_0x50f4eb[_0xbcce74(0x9e)];return a2_0x50d0a4(Box,{'children':a2_0x50d0a4(Text,{'color':_0x3bc0eb?_0xbcce74(0xac):undefined,'children':_0x14865c})},_0x14865c);})]});}
|
package/lib/api/api-pull-ui.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x2c99d6,_0x1f8d12){const _0x6ec581=a3_0x4cbd,_0x41a2db=_0x2c99d6();while(!![]){try{const _0x82edfa=parseInt(_0x6ec581(0x93))/0x1+parseInt(_0x6ec581(0xbc))/0x2+-parseInt(_0x6ec581(0xa1))/0x3*(parseInt(_0x6ec581(0xaf))/0x4)+-parseInt(_0x6ec581(0xca))/0x5+-parseInt(_0x6ec581(0x9d))/0x6+-parseInt(_0x6ec581(0xa2))/0x7*(parseInt(_0x6ec581(0xaa))/0x8)+parseInt(_0x6ec581(0x94))/0x9*(parseInt(_0x6ec581(0x9c))/0xa);if(_0x82edfa===_0x1f8d12)break;else _0x41a2db['push'](_0x41a2db['shift']());}catch(_0xd03f33){_0x41a2db['push'](_0x41a2db['shift']());}}}(a3_0x28c9,0x92948));import{jsx as a3_0x20400e,jsxs as a3_0x1adda2}from'react/jsx-runtime';import{useEffect,useState}from'react';import{Box,Text,useApp}from'ink';import{readConfig}from'../utils/config.js';import{getCookie}from'../auth/get-cookie.js';import{getApiDomain}from'../constant/domain.js';import{initEnv}from'../constant/env.js';function a3_0x4cbd(_0x28db94,_0x3b5db2){const _0x28c902=a3_0x28c9();return a3_0x4cbd=function(_0x4cbdc6,_0x130d67){_0x4cbdc6=_0x4cbdc6-0x8f;let _0x50921b=_0x28c902[_0x4cbdc6];return _0x50921b;},a3_0x4cbd(_0x28db94,_0x3b5db2);}import{generateApiFile}from'./generate-api-file.js';import{logger}from'../utils/logger.js';export const ApiPullUI=({appCode:_0x387cd1,env:_0x4a489c})=>{const _0x479262=a3_0x4cbd,{exit:_0x4a132e}=useApp(),[_0x25bac6,_0x507c40]=useState(![]),[_0x3b64f7,_0x2bc541]=useState(![]),[_0x268c5c,_0x59f12b]=useState(null),[_0x1e9236,_0x47bdd7]=useState(null),_0xb8d8c7=readConfig(),_0x340cfb=_0x387cd1||_0xb8d8c7?.[_0x479262(0xba)],_0x503589=typeof _0xb8d8c7?.['env']===_0x479262(0xa5)?_0xb8d8c7[_0x479262(0xc9)]:undefined,_0x3e4271=_0x4a489c||_0x503589||_0x479262(0xa9);initEnv(_0x3e4271);const _0x42ecc2=_0x387cd1&&_0x387cd1[_0x479262(0xb4)]('-')?_0x387cd1[_0x479262(0x9a)]('-')[_0x479262(0xa7)](0x1)[_0x479262(0xb8)]('-'):'',_0x7fbf52=_0x387cd1?_0x479262(0x96)+_0x340cfb:'使用配置的应用AppCode:\x20'+_0x340cfb,_0x38c265=_0x42ecc2?_0x42ecc2+_0x479262(0x90):_0x479262(0xbd),_0x138ac6=_0x42ecc2?_0x42ecc2+_0x479262(0xb5):_0x479262(0x99);useEffect(()=>{_0x507c40(!![]),_0x48efd5();},[]),useEffect(()=>{(_0x3b64f7||_0x268c5c)&&_0x4a132e();},[_0x3b64f7,_0x268c5c,_0x4a132e]);async function _0x48efd5(){const _0x4f855e=_0x479262;if(!_0x340cfb){_0x59f12b(_0x4f855e(0xb2));return;}try{logger[_0x4f855e(0xc8)](process[_0x4f855e(0x9b)]());const _0x923426=await fetch(getApiDomain()+_0x4f855e(0xbf)+_0x340cfb+_0x4f855e(0xc1),{'headers':{'Cookie':getCookie()}});if(_0x923426['ok']){const _0x2bcab1=await _0x923426[_0x4f855e(0xa3)]();if(_0x2bcab1[_0x4f855e(0xbb)]){const _0x3004f8=!_0x387cd1;await generateApiFile(_0x2bcab1[_0x4f855e(0xb6)]['tableData'],_0x42ecc2,_0x340cfb,_0x3004f8,_0x3e4271),_0x47bdd7({'api':_0x4f855e(0x9e)+_0x38c265+_0x4f855e(0xb0),'client':_0x4f855e(0x9e)+_0x138ac6+_0x4f855e(0xb0)}),_0x2bc541(!![]);}}else{if(_0x923426['status']===0x191){const _0x16c632=_0x4f855e(0xa6);logger[_0x4f855e(0xa4)](_0x4f855e(0x98),_0x16c632,{'status':_0x923426['status'],'appCode':_0x340cfb,'url':_0x923426[_0x4f855e(0xb3)]}),_0x59f12b(_0x16c632);}else{const _0x4f02c6=_0x4f855e(0x91)+_0x923426[_0x4f855e(0xc6)];try{const _0xb0ff1e=await _0x923426['text']();_0xb0ff1e?logger[_0x4f855e(0xa4)](_0x4f855e(0x98),_0x4f02c6,{'status':_0x923426[_0x4f855e(0xc6)],'appCode':_0x340cfb,'url':_0x923426['url'],'errorBody':_0xb0ff1e}):logger[_0x4f855e(0xa4)]('api-pull',_0x4f02c6,{'status':_0x923426[_0x4f855e(0xc6)],'appCode':_0x340cfb,'url':_0x923426[_0x4f855e(0xb3)]});}catch(_0x2733eb){logger[_0x4f855e(0xa4)](_0x4f855e(0x98),_0x4f02c6+_0x4f855e(0xc5),{'status':_0x923426[_0x4f855e(0xc6)],'appCode':_0x340cfb,'url':_0x923426[_0x4f855e(0xb3)],'readError':_0x2733eb instanceof Error?_0x2733eb['message']:String(_0x2733eb)});}_0x59f12b(_0x4f02c6);}}}catch(_0x399f43){const _0x1b32bf=_0x399f43 instanceof Error?_0x399f43['message']:String(_0x399f43);_0x59f12b(_0x4f855e(0xc2)+_0x1b32bf);}finally{_0x507c40(![]);}}return a3_0x1adda2(Box,{'flexDirection':_0x479262(0x8f),'children':[a3_0x1adda2(Box,{'children':[a3_0x20400e(Text,{'color':_0x479262(0xa0),'children':'*\x20'}),a3_0x20400e(Text,{'color':_0x387cd1?_0x479262(0xbe):_0x479262(0x9f),'children':_0x7fbf52})]}),a3_0x1adda2(Box,{'children':[a3_0x20400e(Text,{'color':_0x479262(0xa0),'children':_0x479262(0x97)}),a3_0x1adda2(Text,{'color':_0x479262(0xac),'children':[_0x38c265,'.ts']}),a3_0x20400e(Text,{'color':_0x479262(0x9f),'children':_0x479262(0xb9)}),a3_0x1adda2(Text,{'color':_0x479262(0xac),'children':[_0x138ac6,_0x479262(0xb0)]})]}),_0x25bac6&&a3_0x20400e(Box,{'children':a3_0x1adda2(Text,{'children':[_0x479262(0xc4),_0x3e4271,')']})}),_0x3b64f7&&_0x1e9236&&a3_0x1adda2(Box,{'flexDirection':_0x479262(0x8f),'children':[a3_0x20400e(Box,{'children':a3_0x20400e(Text,{'color':_0x479262(0xad),'children':'√\x20API\x20文件生成成功!'})}),a3_0x20400e(Box,{'marginTop':0x1,'children':a3_0x20400e(Text,{'color':_0x479262(0xa0),'children':_0x479262(0xa8)})}),a3_0x1adda2(Box,{'marginLeft':0x2,'children':[a3_0x1adda2(Text,{'color':_0x479262(0xac),'children':['•\x20',_0x1e9236[_0x479262(0xbd)]]}),a3_0x20400e(Text,{'color':'dim','children':_0x479262(0xc3)})]}),a3_0x1adda2(Box,{'marginLeft':0x2,'children':[a3_0x1adda2(Text,{'color':'cyan','children':['•\x20',_0x1e9236[_0x479262(0x99)]]}),a3_0x20400e(Text,{'color':_0x479262(0x9f),'children':'\x20-\x20客户端实例文件'})]}),a3_0x20400e(Box,{'marginTop':0x1,'children':a3_0x20400e(Text,{'color':_0x479262(0xa0),'children':_0x479262(0x92)})}),a3_0x20400e(Box,{'marginLeft':0x2,'children':a3_0x1adda2(Text,{'color':_0x479262(0xb7),'children':[_0x479262(0xae),'{\x20lovrabetClient\x20}',_0x479262(0xb1),_0x1e9236[_0x479262(0x99)][_0x479262(0xc7)](_0x479262(0x9e),'')['replace'](_0x479262(0xb0),''),'\x27']})})]}),_0x268c5c&&a3_0x1adda2(Box,{'flexDirection':_0x479262(0x8f),'children':[a3_0x20400e(Box,{'children':a3_0x1adda2(Text,{'color':_0x479262(0x95),'children':['❌\x20',_0x268c5c]})}),_0x268c5c[_0x479262(0xb4)]('登录')&&a3_0x1adda2(Box,{'marginTop':0x1,'children':[a3_0x20400e(Text,{'color':_0x479262(0xb7),'children':_0x479262(0xab)}),a3_0x20400e(Text,{'color':_0x479262(0xac),'children':'lovrabet\x20auth'}),a3_0x20400e(Text,{'color':_0x479262(0xb7),'children':_0x479262(0xc0)})]})]})]});};function a3_0x28c9(){const _0x3180a5=['green','import\x20','3410680LjfBnC','.ts','\x20from\x20\x27@/api/','未提供应用AppCode,且配置中也没有默认值','url','includes','-client','data','yellow','join','\x20和\x20','app','success','557126VLPSqU','api','white','/smartapi/dataset/getList?appCode=','\x20重新登录后再试','&pageSize=999¤tPage=1','拉取\x20API\x20配置失败:\x20','\x20-\x20模型配置文件','🚀\x20正在从服务器拉取\x20API\x20配置...\x20(环境:\x20',',且无法读取错误响应内容','status','replace','setLogPath','env','1348510HSCQmY','column','-api','获取数据集失败,HTTP状态码:\x20','*\x20导入方式:','1098038xzxsRe','108nrKTsc','red','使用指定的应用AppCode:\x20','*\x20将生成文件:\x20','api-pull','client','split','cwd','1361370uCTZJD','7086780yvXwUf','src/api/','dim','gray','3lRZtsJ','49WgKMsX','json','error','string','登录鉴权失败,登录已过期,请使用\x20lovrabet\x20auth\x20重新登录','slice','*\x20已生成文件:','online','121544VlGRUc','💡\x20请使用\x20','cyan'];a3_0x28c9=function(){return _0x3180a5;};return a3_0x28c9();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x3a3c84,_0x2ae912){const _0x1b62ad=a4_0x1f28,_0x26843e=_0x3a3c84();while(!![]){try{const _0x159a1f=-parseInt(_0x1b62ad(0xe7))/0x1*(parseInt(_0x1b62ad(0xdb))/0x2)+-parseInt(_0x1b62ad(0xe1))/0x3*(parseInt(_0x1b62ad(0xe2))/0x4)+parseInt(_0x1b62ad(0xd7))/0x5*(-parseInt(_0x1b62ad(0xea))/0x6)+parseInt(_0x1b62ad(0xe6))/0x7*(-parseInt(_0x1b62ad(0xe8))/0x8)+parseInt(_0x1b62ad(0xe5))/0x9+parseInt(_0x1b62ad(0xd6))/0xa+parseInt(_0x1b62ad(0xdc))/0xb;if(_0x159a1f===_0x2ae912)break;else _0x26843e['push'](_0x26843e['shift']());}catch(_0x1cf66e){_0x26843e['push'](_0x26843e['shift']());}}}(a4_0x5154,0x82df5));export function formatDataset(_0x325ff1){const _0x3b6fc5=a4_0x1f28,_0x3dabf5=_0x325ff1['filter'](_0x99a721=>_0x99a721[_0x3b6fc5(0xe4)]),_0x53f153=_0x325ff1['filter'](_0x5e292b=>!_0x5e292b[_0x3b6fc5(0xe4)]),_0x47582a=new Map();_0x3dabf5[_0x3b6fc5(0xd5)](_0x31f687=>{const _0x495cc3=_0x3b6fc5,_0x98a045=_0x31f687[_0x495cc3(0xe4)][_0x495cc3(0xd3)],_0x11e5c0=_0x47582a[_0x495cc3(0xd8)](_0x98a045);(!_0x11e5c0||_0x31f687['id']>_0x11e5c0['id'])&&_0x47582a['set'](_0x98a045,_0x31f687);});const _0x1a8f3c=Array[_0x3b6fc5(0xd4)](_0x47582a[_0x3b6fc5(0xda)]())['map'](_0x454f22=>{const _0x9f30c1=_0x3b6fc5,_0x39e849=snakeToCamel(_0x454f22['dbtableConfig']['tableName']);return{'id':_0x454f22['id'],'name':_0x454f22['name'],'code':_0x454f22[_0x9f30c1(0xe0)],'tableName':_0x454f22['dbtableConfig'][_0x9f30c1(0xd3)],'apiFucName':_0x39e849?_0x39e849+_0x9f30c1(0xde):_0x9f30c1(0xe9)+_0x454f22[_0x9f30c1(0xe0)]+_0x9f30c1(0xde),'pkField':_0x454f22[_0x9f30c1(0xe4)][_0x9f30c1(0xd9)],'allFields':_0x454f22['dbtableConfig'][_0x9f30c1(0xd2)][_0x9f30c1(0xdd)](',')};}),_0x4abacd=_0x53f153['map'](_0x2b2a8d=>{const _0x159544=_0x3b6fc5,_0x4ef329=_0x159544(0xeb)+_0x2b2a8d['code'],_0x4c9b8b=snakeToCamel(_0x4ef329);return{'id':_0x2b2a8d['id'],'name':_0x2b2a8d[_0x159544(0xe3)],'code':_0x2b2a8d[_0x159544(0xe0)],'tableName':_0x4ef329,'apiFucName':_0x4c9b8b?_0x4c9b8b+_0x159544(0xde):_0x159544(0xe9)+_0x2b2a8d[_0x159544(0xe0)]+_0x159544(0xde),'pkField':undefined,'allFields':[]};});return[..._0x1a8f3c,..._0x4abacd];}function a4_0x1f28(_0x2ade01,_0x16f725){const _0x515428=a4_0x5154();return a4_0x1f28=function(_0x1f28d5,_0x2f6320){_0x1f28d5=_0x1f28d5-0xd2;let _0x16f604=_0x515428[_0x1f28d5];return _0x16f604;},a4_0x1f28(_0x2ade01,_0x16f725);}function a4_0x5154(){const _0x2279eb=['649634grUPQK','18018891OZCJkN','split','Api','toUpperCase','code','6YowsPM','1597924baqiFj','name','dbtableConfig','8551206ACSxxe','35TGQVzZ','2mkiDMm','690416ddXkEc','dataset','12JoWjCW','dataset_','allFields','tableName','from','forEach','4933800cZvFKB','1663590oiDhIe','get','pkField','values'];a4_0x5154=function(){return _0x2279eb;};return a4_0x5154();}function snakeToCamel(_0x5baf7e){const _0x4c2030=a4_0x1f28;if(!_0x5baf7e)return _0x5baf7e;const _0xcc896=_0x5baf7e['trim']();return _0xcc896['replace'](/_([a-zA-Z0-9])/g,(_0x1fef86,_0x175182)=>_0x175182[_0x4c2030(0xdf)]());}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x32c28b,_0x4fcfe9){const _0x517332=a5_0x2bc3,_0x5822e5=_0x32c28b();while(!![]){try{const _0x458c3c=parseInt(_0x517332(0x106))/0x1*(parseInt(_0x517332(0x10a))/0x2)+-parseInt(_0x517332(0xdb))/0x3+parseInt(_0x517332(0x107))/0x4*(-parseInt(_0x517332(0xeb))/0x5)+-parseInt(_0x517332(0xf9))/0x6+-parseInt(_0x517332(0xda))/0x7+parseInt(_0x517332(0xd8))/0x8*(-parseInt(_0x517332(0xef))/0x9)+parseInt(_0x517332(0x101))/0xa*(parseInt(_0x517332(0xfd))/0xb);if(_0x458c3c===_0x4fcfe9)break;else _0x5822e5['push'](_0x5822e5['shift']());}catch(_0x12fac4){_0x5822e5['push'](_0x5822e5['shift']());}}}(a5_0x2249,0x614b8));import a5_0x5285ea from'prettier';import{mkdirSync,writeFileSync,readFileSync}from'node:fs';import a5_0x266496 from'node:path';function a5_0x2bc3(_0x114358,_0x4f931e){const _0x2249e8=a5_0x2249();return a5_0x2bc3=function(_0x2bc3ec,_0x17f257){_0x2bc3ec=_0x2bc3ec-0xd6;let _0xfe168a=_0x2249e8[_0x2bc3ec];return _0xfe168a;},a5_0x2bc3(_0x114358,_0x4f931e);}import{fileURLToPath}from'node:url';import{readConfig}from'../utils/config.js';function a5_0x2249(){const _0x513404=['CONFIG_NAMES.DEFAULT','4216730Evunap','2261289LtrVIu','{\x20apiConfigName:\x20','slice','join','请先通过\x20`lovrabet\x20config\x20set\x20app\x20<value>`\x20配置应用\x20Code','toUpperCase','api.ts.tpl','success','tableName','log','\x20-\x20模型配置文件\x20(','forEach','\x20\x20\x20•\x20','-client','src/api','-api','5yAlgCX','client.ts.tpl','*\x20API配置\x20apiConfigName\x20:\x20','apiFucName','7002lWOIdl','format','client','\x20个模型)','charAt','code',',\x20env:\x20\x22','replaceApiContent','resolve','env','3778806PTqrwd','\x20-\x20客户端实例文件','{\x20apiConfigName:\x20\x22','\x22\x20}','29172517mzNnML','templates/generate-api','init-api','app','10dogHrd','API\x20文件生成成功!','dirname','*\x20已生成文件:','api','793691pPmDAq','1571848CAvanJ','replace','src/api/','2dIKvNW','length','typescript','keys','string','.ts','utf8','6872FXSZPD'];a5_0x2249=function(){return _0x513404;};return a5_0x2249();}import{formatDataset}from'./format-dataset.js';import{TemplateReplacer}from'../utils/template-replacer.js';import{logger}from'../utils/logger.js';export async function generateApiFile(_0x17e197,_0x11afdd='',_0x38c804,_0x30bf95=![],_0x3f36af){const _0x3f6b0a=a5_0x2bc3,_0x56017f=readConfig(),_0x3b9a48=_0x38c804||_0x56017f?.[_0x3f6b0a(0x100)];if(typeof _0x3b9a48!==_0x3f6b0a(0x10e)||!_0x3b9a48)throw new Error(_0x3f6b0a(0xdf));const _0x1f2742=_0x30bf95?_0x3f6b0a(0xd9):'\x22'+_0x3b9a48+'\x22',_0x31ad8f=typeof _0x56017f['env']===_0x3f6b0a(0x10e)?_0x56017f[_0x3f6b0a(0xf8)]:undefined,_0x4bf9a6=_0x3f36af||_0x31ad8f||'online',_0x4bedae=_0x4bf9a6!=='online';let _0x31a55b;if(_0x30bf95)_0x4bedae?_0x31a55b=_0x3f6b0a(0xdc)+_0x1f2742+',\x20env:\x20\x22'+_0x4bf9a6+_0x3f6b0a(0xfc):_0x31a55b='';else{const _0x5ce9bd=_0x4bedae?_0x3f6b0a(0xf5)+_0x4bf9a6+'\x22':'';_0x31a55b=_0x3f6b0a(0xfb)+_0x3b9a48+'\x22'+_0x5ce9bd+'\x20}';}const _0x116b52=_0x11afdd?_0x11afdd+_0x3f6b0a(0xea):_0x3f6b0a(0x105),_0x55036a=_0x11afdd?_0x11afdd+_0x3f6b0a(0xe8):_0x3f6b0a(0xf1),_0x24e19b=formatDataset(_0x17e197),_0xb91acc={};_0x24e19b[_0x3f6b0a(0xe6)](_0x9e98e9=>{const _0x4219bc=_0x3f6b0a,_0x424cc4=_0x9e98e9[_0x4219bc(0xee)][_0x4219bc(0x108)](/Api$/,''),_0x1ca00c=_0x424cc4[_0x4219bc(0xf3)](0x0)[_0x4219bc(0xe0)]()+_0x424cc4[_0x4219bc(0xdd)](0x1);_0xb91acc[_0x1ca00c]={'tableName':_0x9e98e9[_0x4219bc(0xe3)],'datasetCode':_0x9e98e9[_0x4219bc(0xf4)]};});const _0x1c73cd=fileURLToPath(import.meta['url']),_0x20db84=a5_0x266496[_0x3f6b0a(0xf7)](a5_0x266496[_0x3f6b0a(0x103)](_0x1c73cd),'../..'),_0x23db68=a5_0x266496['join'](_0x20db84,_0x3f6b0a(0xfe)),_0x5a47c1=a5_0x266496[_0x3f6b0a(0xde)](_0x23db68,_0x3f6b0a(0xe1)),_0x286f7c=a5_0x266496['join'](_0x23db68,_0x3f6b0a(0xec));mkdirSync(_0x3f6b0a(0xe9),{'recursive':!![]});const _0x1fa1f8=readFileSync(_0x5a47c1,_0x3f6b0a(0xd7)),_0x15f7dc=TemplateReplacer[_0x3f6b0a(0xf6)](_0x1fa1f8,_0x3b9a48,_0xb91acc,Object[_0x3f6b0a(0x10d)](_0xb91acc)[0x0],_0x116b52,_0x1f2742),_0x20dcdc=await a5_0x5285ea[_0x3f6b0a(0xf0)](_0x15f7dc,{'parser':_0x3f6b0a(0x10c)}),_0x3e00a1=_0x3f6b0a(0x109)+_0x116b52+_0x3f6b0a(0xd6);writeFileSync(_0x3e00a1,_0x20dcdc,{'encoding':_0x3f6b0a(0xd7)});const _0x2c39c1=readFileSync(_0x286f7c,_0x3f6b0a(0xd7)),_0x37ea1b=TemplateReplacer[_0x3f6b0a(0xf6)](_0x2c39c1,_0x3b9a48,_0xb91acc,Object[_0x3f6b0a(0x10d)](_0xb91acc)[0x0],_0x116b52,_0x1f2742,_0x31a55b),_0x268dd9=await a5_0x5285ea[_0x3f6b0a(0xf0)](_0x37ea1b,{'parser':_0x3f6b0a(0x10c)}),_0x267a7e=_0x3f6b0a(0x109)+_0x55036a+_0x3f6b0a(0xd6);writeFileSync(_0x267a7e,_0x268dd9,{'encoding':_0x3f6b0a(0xd7)}),logger[_0x3f6b0a(0xe2)](_0x3f6b0a(0xff),_0x3f6b0a(0x102)),console[_0x3f6b0a(0xe4)](_0x3f6b0a(0x104)),console[_0x3f6b0a(0xe4)](_0x3f6b0a(0xe7)+_0x3e00a1+_0x3f6b0a(0xe5)+Object[_0x3f6b0a(0x10d)](_0xb91acc)[_0x3f6b0a(0x10b)]+_0x3f6b0a(0xf2)),console[_0x3f6b0a(0xe4)](_0x3f6b0a(0xe7)+_0x267a7e+_0x3f6b0a(0xfa)),console['log'](_0x3f6b0a(0xed)+_0x1f2742),console[_0x3f6b0a(0xe4)]('*\x20可以开始使用:\x20import\x20{\x20lovrabetClient\x20}\x20from\x20\x27@/api/'+_0x55036a+'\x27');}
|
package/lib/api/main.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x359a86,_0x2eaf3e){const _0x13a7b9=a6_0x34dd,_0x318bd4=_0x359a86();while(!![]){try{const _0x544957=parseInt(_0x13a7b9(0x129))/0x1+-parseInt(_0x13a7b9(0x12d))/0x2*(parseInt(_0x13a7b9(0x139))/0x3)+parseInt(_0x13a7b9(0x128))/0x4*(parseInt(_0x13a7b9(0x135))/0x5)+parseInt(_0x13a7b9(0x12c))/0x6+parseInt(_0x13a7b9(0x137))/0x7+-parseInt(_0x13a7b9(0x12b))/0x8*(-parseInt(_0x13a7b9(0x12f))/0x9)+-parseInt(_0x13a7b9(0x126))/0xa;if(_0x544957===_0x2eaf3e)break;else _0x318bd4['push'](_0x318bd4['shift']());}catch(_0x5ebb33){_0x318bd4['push'](_0x318bd4['shift']());}}}(a6_0x2d7b,0x6d7b8));function a6_0x2d7b(){const _0x36e064=['string','6489QRyHFx','Unknown\x20api\x20command:\x20','\x20\x20\x20\x20app-code:\x20可选的应用AppCode,不指定则使用配置的默认值','input','\x20\x20lovrabet\x20api\x20pull\x20[app-code]\x20\x20\x20\x20//\x20拉取并生成\x20API\x20配置文件','flags','719980rkPVYI','Available\x20commands:','2580445Zqsjur','error','138279CPLGlR','log','11498040tcQUIR','exit','16lzmxmV','795614ymfPIE','pull','1592QacZxg','3541794hdoQPV','38zCejLH'];a6_0x2d7b=function(){return _0x36e064;};return a6_0x2d7b();}function a6_0x34dd(_0x58da92,_0x37c553){const _0x2d7b59=a6_0x2d7b();return a6_0x34dd=function(_0x34dd41,_0x1bc77e){_0x34dd41=_0x34dd41-0x125;let _0x2cf351=_0x2d7b59[_0x34dd41];return _0x2cf351;},a6_0x34dd(_0x58da92,_0x37c553);}import{jsx as a6_0x29c739}from'react/jsx-runtime';import{render}from'ink';import{ApiPullUI}from'./api-pull-ui.js';export async function apiCli(_0x52cbb6){const _0x1e2d62=a6_0x34dd,_0x4b6426=_0x52cbb6[_0x1e2d62(0x132)][0x1];if(_0x4b6426===_0x1e2d62(0x12a)){const _0x4437d7=_0x52cbb6[_0x1e2d62(0x132)][0x2],_0x486b5b=typeof _0x52cbb6[_0x1e2d62(0x134)]['env']===_0x1e2d62(0x12e)?_0x52cbb6[_0x1e2d62(0x134)]['env']:undefined;render(a6_0x29c739(ApiPullUI,{'appCode':_0x4437d7,'env':_0x486b5b}));}else console[_0x1e2d62(0x138)](_0x1e2d62(0x130)+_0x4b6426),console[_0x1e2d62(0x125)](_0x1e2d62(0x136)),console['log'](_0x1e2d62(0x133)),console[_0x1e2d62(0x125)](_0x1e2d62(0x131)),process[_0x1e2d62(0x127)](0x1);}
|
package/lib/api/pull-silent.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x12c8e6,_0x2b1306){const _0x587176=a7_0x2192,_0x3f5995=_0x12c8e6();while(!![]){try{const _0x1a335f=parseInt(_0x587176(0x151))/0x1+parseInt(_0x587176(0x14d))/0x2+-parseInt(_0x587176(0x166))/0x3*(parseInt(_0x587176(0x143))/0x4)+-parseInt(_0x587176(0x15a))/0x5*(-parseInt(_0x587176(0x13e))/0x6)+parseInt(_0x587176(0x150))/0x7+-parseInt(_0x587176(0x148))/0x8+parseInt(_0x587176(0x159))/0x9*(-parseInt(_0x587176(0x144))/0xa);if(_0x1a335f===_0x2b1306)break;else _0x3f5995['push'](_0x3f5995['shift']());}catch(_0x10a7eb){_0x3f5995['push'](_0x3f5995['shift']());}}}(a7_0x1274,0x82a06));import{readConfig}from'../utils/config.js';import{getCookie}from'../auth/get-cookie.js';import{getApiDomain}from'../constant/domain.js';import{initEnv}from'../constant/env.js';import{generateApiFile}from'./generate-api-file.js';import{logger}from'../utils/logger.js';function a7_0x2192(_0x481854,_0x1062a8){const _0x127430=a7_0x1274();return a7_0x2192=function(_0x21925c,_0x45ae04){_0x21925c=_0x21925c-0x139;let _0x334955=_0x127430[_0x21925c];return _0x334955;},a7_0x2192(_0x481854,_0x1062a8);}import{httpRequest}from'../utils/http-client.js';function a7_0x1274(){const _0x5b74db=['1000479TThPuZ','string','create-api-pull','url','.ts\x20-\x20模型配置文件','data','30wdFTXL','info','api','×\x20API\x20配置拉取异常:','text','4YpQoHx','130SUgpmJ','status','success','online','659168gmzADx','.ts\x20-\x20客户端实例文件','env','trim','log','1618972jecHte','message','*\x20正在从服务器拉取\x20API\x20配置...\x20(环境:\x20','4513194IasKVg','905205YhEjzy','tableData','*\x20正在处理\x20','test','error','\x20\x20\x20•\x20','获取数据集失败,HTTP状态码:\x20','API\x20配置拉取异常:\x20','1324539XJdWGe','504725EoricC','-client','length','未知错误','×\x20无法读取错误响应内容','√\x20API\x20配置文件生成完成','\x20个数据集...','×\x20错误详情:','chdir','&pageSize=999¤tPage=1','/smartapi/dataset/getList?appCode=','×\x20文件前缀格式不正确。只能包含字母、数字、连字符和下划线,且必须以字母开头。'];a7_0x1274=function(){return _0x5b74db;};return a7_0x1274();}export async function pullApiSilent(_0x372661,_0x514a58,_0x1f1879,_0x414d22){const _0x2be26b=a7_0x2192;let _0x3f93e7;try{const _0x537f55=_0x514a58?.[_0x2be26b(0x14b)]()||'';if(_0x537f55){const _0x5c6553=/^[a-zA-Z][a-zA-Z0-9_-]*$/;if(!_0x5c6553[_0x2be26b(0x154)](_0x537f55))return console[_0x2be26b(0x155)](_0x2be26b(0x165)),![];}_0x1f1879&&(_0x3f93e7=process['cwd'](),process['chdir'](_0x1f1879));const _0x4aebbc=readConfig(),_0x1ca81d=typeof _0x4aebbc[_0x2be26b(0x14a)]===_0x2be26b(0x139)?_0x4aebbc[_0x2be26b(0x14a)]:undefined,_0x1815c2=_0x414d22||_0x1ca81d||_0x2be26b(0x147);initEnv(_0x1815c2),console[_0x2be26b(0x14c)](_0x2be26b(0x14f)+_0x1815c2+')');const _0x3fd610=getApiDomain()+_0x2be26b(0x164)+_0x372661+_0x2be26b(0x163),_0x1d67e0=await httpRequest(_0x3fd610,{'headers':{'Cookie':getCookie()},'timeout':0xea60,'retries':0x2});if(_0x1d67e0['ok']){const _0x319311=_0x1d67e0['data'];if(_0x319311[_0x2be26b(0x146)]){const _0x388d41=_0x537f55?_0x537f55+'-api':_0x2be26b(0x140),_0x1ab23e=_0x537f55?_0x537f55+_0x2be26b(0x15b):'client';return console[_0x2be26b(0x14c)]('*\x20开始生成\x20API\x20配置文件:'),console['log'](_0x2be26b(0x156)+_0x388d41+_0x2be26b(0x13c)),console['log'](_0x2be26b(0x156)+_0x1ab23e+_0x2be26b(0x149)),console[_0x2be26b(0x14c)](_0x2be26b(0x153)+_0x319311[_0x2be26b(0x13d)][_0x2be26b(0x152)][_0x2be26b(0x15c)]+_0x2be26b(0x160)),await generateApiFile(_0x319311[_0x2be26b(0x13d)][_0x2be26b(0x152)],_0x537f55,_0x372661,!![],_0x1815c2),console[_0x2be26b(0x14c)](_0x2be26b(0x15f)),_0x1f1879&&logger[_0x2be26b(0x13f)](_0x2be26b(0x13a),'API\x20配置拉取成功:\x20'+_0x372661,{'projectPath':_0x1f1879,'appCode':_0x372661,'datasetCount':_0x319311[_0x2be26b(0x13d)][_0x2be26b(0x152)][_0x2be26b(0x15c)],'filePrefix':_0x537f55}),!![];}else return console[_0x2be26b(0x155)]('×\x20服务器返回错误:',_0x319311[_0x2be26b(0x14e)]||_0x2be26b(0x15d)),_0x1f1879&&logger[_0x2be26b(0x155)](_0x2be26b(0x13a),'API\x20配置拉取失败:\x20'+(_0x319311[_0x2be26b(0x14e)]||_0x2be26b(0x15d)),{'projectPath':_0x1f1879,'appCode':_0x372661}),![];}else{if(_0x1d67e0[_0x2be26b(0x145)]===0x191){const _0xb4584='获取数据集失败,原因:登录鉴权失败,登录已过期';console[_0x2be26b(0x155)]('×\x20'+_0xb4584),_0x1f1879&&logger[_0x2be26b(0x155)](_0x2be26b(0x13a),_0xb4584,{'status':_0x1d67e0[_0x2be26b(0x145)],'appCode':_0x372661,'url':_0x1d67e0['url'],'projectPath':_0x1f1879});}else{const _0x5253e2=_0x2be26b(0x157)+_0x1d67e0[_0x2be26b(0x145)];console[_0x2be26b(0x155)]('×\x20'+_0x5253e2);try{const _0x4126fd=await _0x1d67e0[_0x2be26b(0x142)]();_0x4126fd&&console['error'](_0x2be26b(0x161),_0x4126fd),_0x1f1879&&logger[_0x2be26b(0x155)](_0x2be26b(0x13a),_0x5253e2,{'status':_0x1d67e0['status'],'appCode':_0x372661,'url':_0x1d67e0[_0x2be26b(0x13b)],'errorBody':_0x4126fd,'projectPath':_0x1f1879});}catch(_0x1934c2){console[_0x2be26b(0x155)](_0x2be26b(0x15e)),_0x1f1879&&logger['error'](_0x2be26b(0x13a),_0x5253e2+',且无法读取错误响应内容',{'status':_0x1d67e0['status'],'appCode':_0x372661,'url':_0x1d67e0['url'],'readError':_0x1934c2 instanceof Error?_0x1934c2[_0x2be26b(0x14e)]:String(_0x1934c2),'projectPath':_0x1f1879});}}return![];}}catch(_0x229418){const _0x45fbc0=_0x229418 instanceof Error?_0x229418[_0x2be26b(0x14e)]:String(_0x229418);return console[_0x2be26b(0x155)](_0x2be26b(0x141),_0x45fbc0),_0x1f1879&&logger[_0x2be26b(0x155)](_0x2be26b(0x13a),_0x2be26b(0x158)+_0x45fbc0,{'appCode':_0x372661,'projectPath':_0x1f1879}),![];}finally{_0x3f93e7&&process[_0x2be26b(0x162)](_0x3f93e7);}}
|
package/lib/api/pull.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a8_0x4a37(){const _0x29ccad=['client','×\x20无法读取错误响应内容','json','exit','获取数据集失败,原因:登录鉴权失败,登录已过期,请使用\x20lovrabet\x20auth\x20重新登录后再尝试','15469030mmmhGF','.ts\x20-\x20模型配置文件','stdin','data','close','*\x20开始生成\x20API\x20配置文件:','log','trim','1XXQoao','!\x20请使用以下方式之一:','api','api-pull','-api','85iIforn','\x20\x20\x20•\x20','*\x20正在处理\x20','tableData','string','env','1112qYQmyJ',',且无法读取错误响应内容','error','2076738juSFJe','stdout','3254640ypWDqu','\x20\x20\x201.\x20直接指定:\x20lovrabet\x20api\x20pull\x20<app-code>','test','\x22\x20无效','/smartapi/dataset/getList?appCode=','23643LsHdSE','message','app','1292002xyLrIG','url','获取数据集失败,HTTP状态码:\x20','\x20\x20\x202.\x20配置默认值:\x20lovrabet\x20config\x20set\x20app\x20<app-code>','!\x20请输入文件前缀\x20\x1b[90m[留空表示无前缀]\x1b[0m:\x20','×\x20文件前缀格式不正确。只能包含字母、数字、连字符和下划线,且必须以字母开头。','success','length','status','\x20个数据集...','5230225UlZyZu','93364XnDHmg','\x0a*\x20正在从服务器拉取\x20API\x20配置...\x20(环境:\x20','*\x20使用指定的应用AppCode:\x20','×\x20未提供应用AppCode,且配置中也没有默认值','-client','online'];a8_0x4a37=function(){return _0x29ccad;};return a8_0x4a37();}(function(_0x2451e3,_0x2de2cd){const _0x3e351b=a8_0x4b70,_0x22ff26=_0x2451e3();while(!![]){try{const _0x33fd1e=-parseInt(_0x3e351b(0x18e))/0x1*(-parseInt(_0x3e351b(0x170))/0x2)+parseInt(_0x3e351b(0x19e))/0x3+parseInt(_0x3e351b(0x17b))/0x4*(-parseInt(_0x3e351b(0x193))/0x5)+-parseInt(_0x3e351b(0x19c))/0x6+parseInt(_0x3e351b(0x17a))/0x7+-parseInt(_0x3e351b(0x199))/0x8*(-parseInt(_0x3e351b(0x16d))/0x9)+-parseInt(_0x3e351b(0x186))/0xa;if(_0x33fd1e===_0x2de2cd)break;else _0x22ff26['push'](_0x22ff26['shift']());}catch(_0x161e31){_0x22ff26['push'](_0x22ff26['shift']());}}}(a8_0x4a37,0x871aa));function a8_0x4b70(_0x209bc0,_0x15a61c){const _0x4a375e=a8_0x4a37();return a8_0x4b70=function(_0x4b70e5,_0xc55cd3){_0x4b70e5=_0x4b70e5-0x16d;let _0x768847=_0x4a375e[_0x4b70e5];return _0x768847;},a8_0x4b70(_0x209bc0,_0x15a61c);}import{createInterface}from'node:readline/promises';import{readConfig}from'../utils/config.js';import{getCookie}from'../auth/get-cookie.js';import{getApiDomain}from'../constant/domain.js';import{initEnv}from'../constant/env.js';import{generateApiFile}from'./generate-api-file.js';import{logger}from'../utils/logger.js';export async function initApi(_0x337f1c,_0xce614b){const _0x4ca24d=a8_0x4b70,_0x2fbacf=readConfig(),_0xc2b655=_0x337f1c||_0x2fbacf?.[_0x4ca24d(0x16f)],_0x4d0310=typeof _0x2fbacf[_0x4ca24d(0x198)]===_0x4ca24d(0x197)?_0x2fbacf[_0x4ca24d(0x198)]:undefined,_0x49dd75=_0xce614b||_0x4d0310||_0x4ca24d(0x180);initEnv(_0x49dd75);(typeof _0xc2b655!==_0x4ca24d(0x197)||!_0xc2b655)&&(_0x337f1c?console['error']('×\x20提供的应用AppCode\x20\x22'+_0x337f1c+_0x4ca24d(0x1a1)):(console[_0x4ca24d(0x19b)](_0x4ca24d(0x17e)),console[_0x4ca24d(0x18c)](_0x4ca24d(0x18f)),console['log'](_0x4ca24d(0x19f)),console['log'](_0x4ca24d(0x173))),process[_0x4ca24d(0x184)](0x1));_0x337f1c?console[_0x4ca24d(0x18c)](_0x4ca24d(0x17d)+_0xc2b655):console[_0x4ca24d(0x18c)]('\x1b[90m*\x20使用配置的应用AppCode:\x20'+_0xc2b655+'\x1b[0m');const _0x5d1ddb=createInterface({'input':process[_0x4ca24d(0x188)],'output':process[_0x4ca24d(0x19d)]});let _0x30cf37;try{const _0x202064=await _0x5d1ddb['question'](_0x4ca24d(0x174));_0x30cf37=_0x202064[_0x4ca24d(0x18d)]();if(_0x30cf37){const _0x4094c7=/^[a-zA-Z][a-zA-Z0-9_-]*$/;!_0x4094c7[_0x4ca24d(0x1a0)](_0x30cf37)&&(console[_0x4ca24d(0x19b)](_0x4ca24d(0x175)),process[_0x4ca24d(0x184)](0x1));}}finally{_0x5d1ddb[_0x4ca24d(0x18a)]();}console[_0x4ca24d(0x18c)](_0x4ca24d(0x17c)+_0x49dd75+')');const _0x1af311=await fetch(getApiDomain()+_0x4ca24d(0x1a2)+_0xc2b655+'&pageSize=999¤tPage=1',{'headers':{'Cookie':getCookie()}});if(_0x1af311['ok']){const _0x1cf0e8=await _0x1af311[_0x4ca24d(0x183)]();if(_0x1cf0e8[_0x4ca24d(0x176)]){const _0x3ac09c=_0x30cf37?_0x30cf37+_0x4ca24d(0x192):_0x4ca24d(0x190),_0x21d18c=_0x30cf37?_0x30cf37+_0x4ca24d(0x17f):_0x4ca24d(0x181);console[_0x4ca24d(0x18c)](_0x4ca24d(0x18b)),console[_0x4ca24d(0x18c)](_0x4ca24d(0x194)+_0x3ac09c+_0x4ca24d(0x187)),console['log'](_0x4ca24d(0x194)+_0x21d18c+'.ts\x20-\x20客户端实例文件'),console[_0x4ca24d(0x18c)](_0x4ca24d(0x195)+_0x1cf0e8[_0x4ca24d(0x189)]['tableData'][_0x4ca24d(0x177)]+_0x4ca24d(0x179));const _0x31ae9c=!_0x337f1c;await generateApiFile(_0x1cf0e8[_0x4ca24d(0x189)][_0x4ca24d(0x196)],_0x30cf37,_0xc2b655,_0x31ae9c,_0x49dd75);}}else{if(_0x1af311[_0x4ca24d(0x178)]===0x191){const _0x1a812e=_0x4ca24d(0x185);console['error']('×\x20'+_0x1a812e),logger[_0x4ca24d(0x19b)]('api-pull',_0x1a812e,{'status':_0x1af311['status'],'appCode':_0xc2b655,'url':_0x1af311['url']});}else{const _0x38ea7f=_0x4ca24d(0x172)+_0x1af311[_0x4ca24d(0x178)];console[_0x4ca24d(0x19b)]('×\x20'+_0x38ea7f);try{const _0x4d4bb6=await _0x1af311['text']();_0x4d4bb6?(console[_0x4ca24d(0x19b)]('×\x20错误详情:',_0x4d4bb6),logger['error'](_0x4ca24d(0x191),_0x38ea7f,{'status':_0x1af311['status'],'appCode':_0xc2b655,'url':_0x1af311['url'],'errorBody':_0x4d4bb6})):logger[_0x4ca24d(0x19b)]('api-pull',_0x38ea7f,{'status':_0x1af311['status'],'appCode':_0xc2b655,'url':_0x1af311[_0x4ca24d(0x171)]});}catch(_0x2abd2d){console['error'](_0x4ca24d(0x182)),logger['error'](_0x4ca24d(0x191),_0x38ea7f+_0x4ca24d(0x19a),{'status':_0x1af311[_0x4ca24d(0x178)],'appCode':_0xc2b655,'url':_0x1af311[_0x4ca24d(0x171)],'readError':_0x2abd2d instanceof Error?_0x2abd2d[_0x4ca24d(0x16e)]:String(_0x2abd2d)});}}process[_0x4ca24d(0x184)](0x1);}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x336ca7,_0xfa073a){const _0x319cc1=a10_0x599e,_0x57b75d=_0x336ca7();while(!![]){try{const _0x20698c=-parseInt(_0x319cc1(0x1e0))/0x1+parseInt(_0x319cc1(0x1d5))/0x2*(parseInt(_0x319cc1(0x1dd))/0x3)+-parseInt(_0x319cc1(0x1d2))/0x4*(-parseInt(_0x319cc1(0x1d9))/0x5)+-parseInt(_0x319cc1(0x1d3))/0x6*(parseInt(_0x319cc1(0x1e5))/0x7)+parseInt(_0x319cc1(0x1d4))/0x8*(-parseInt(_0x319cc1(0x1e3))/0x9)+-parseInt(_0x319cc1(0x1d6))/0xa*(parseInt(_0x319cc1(0x1e7))/0xb)+parseInt(_0x319cc1(0x1d1))/0xc*(parseInt(_0x319cc1(0x1d8))/0xd);if(_0x20698c===_0xfa073a)break;else _0x57b75d['push'](_0x57b75d['shift']());}catch(_0x2d4b77){_0x57b75d['push'](_0x57b75d['shift']());}}}(a10_0x32a7,0xd6087));import{jsx as a10_0x5d61ea,jsxs as a10_0x1dfed4}from'react/jsx-runtime';import{Text,Box,useInput,useApp}from'ink';import{useEffect,useState}from'react';import{getIsSessionValid}from'./is-session-valid.js';import{authServer}from'./auth-server.js';function a10_0x599e(_0x21d3e3,_0x1cbba2){const _0x32a791=a10_0x32a7();return a10_0x599e=function(_0x599ee4,_0x227561){_0x599ee4=_0x599ee4-0x1d0;let _0x5085d0=_0x32a791[_0x599ee4];return _0x5085d0;},a10_0x599e(_0x21d3e3,_0x1cbba2);}import a10_0x478f75 from'ink-spinner';export function AuthServer(){const _0x24ecd3=a10_0x599e,{exit:_0x100c09}=useApp(),[_0x2a8334,_0x343433]=useState(![]),[_0x5c5d44,_0x3e0b08]=useState(!![]),[_0xca7371,_0x355729]=useState(![]),[_0x5228d1,_0x6ebc02]=useState(![]);useEffect(()=>{const _0x20562c=a10_0x599e;getIsSessionValid()[_0x20562c(0x1e2)](_0x343433)[_0x20562c(0x1df)](()=>_0x3e0b08(![]));},[]),useEffect(()=>{const _0x4633a3=a10_0x599e;!_0x5c5d44&&_0x2a8334&&(console[_0x4633a3(0x1de)](_0x4633a3(0x1e4)),_0x100c09());},[_0x5c5d44,_0x2a8334,_0x100c09]),useEffect(()=>{const _0x233037=a10_0x599e;_0x5228d1&&(console[_0x233037(0x1de)](_0x233037(0x1e6)),_0x100c09());},[_0x5228d1,_0x100c09]),useInput((_0x15d354,_0x4387a9)=>{_0x4387a9['return']&&(_0x355729(!![]),authServer({'silent':!![]})['then'](_0x121dec=>{_0x6ebc02(_0x121dec);})),_0x15d354==='q'&&_0x100c09();});if(_0x5c5d44)return null;if(_0x2a8334||_0x5228d1)return null;return a10_0x5d61ea(Box,{'flexDirection':'column','marginTop':0x1,'marginBottom':0x1,'children':_0xca7371?a10_0x1dfed4(Box,{'children':[a10_0x5d61ea(Box,{'width':'1'}),a10_0x1dfed4(Text,{'color':_0x24ecd3(0x1e1),'children':[a10_0x5d61ea(a10_0x478f75,{'type':_0x24ecd3(0x1db)}),'\x20\x20']}),a10_0x5d61ea(Text,{'children':_0x24ecd3(0x1d0)}),a10_0x5d61ea(Text,{'color':_0x24ecd3(0x1dc),'children':_0x24ecd3(0x1da)})]}):a10_0x1dfed4(Box,{'children':[a10_0x5d61ea(Box,{'width':'1'}),a10_0x5d61ea(Text,{'children':'*\x20按回车开始登录。'}),a10_0x5d61ea(Text,{'color':_0x24ecd3(0x1dc),'children':_0x24ecd3(0x1d7)})]})});}function a10_0x32a7(){const _0x644f2e=['75558ljPqBX','324024DBBdGF','337646COXCSv','71210ysIqcM','按\x20“q”\x20退出。','13SAGCOa','40wFsEjE','请前往浏览器完成登录。','dots','gray','15wHXoNv','log','finally','680559ptgAQn','green','then','333doDzYm','√\x20当前为有效会话,无需重新登录。','707zPaaWw','*\x20登录成功!','143ZcOGZD','正在登录...\x20','26821152PPjYLa','670552HFemkB'];a10_0x32a7=function(){return _0x644f2e;};return a10_0x32a7();}
|
package/lib/auth/auth-server.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a11_0x5acd9b=a11_0x3ab7;(function(_0x4e0c3b,_0x4b4050){const _0xed23dc=a11_0x3ab7,_0x1574b0=_0x4e0c3b();while(!![]){try{const _0x3784f7=-parseInt(_0xed23dc(0xfe))/0x1*(parseInt(_0xed23dc(0xf0))/0x2)+-parseInt(_0xed23dc(0x109))/0x3*(parseInt(_0xed23dc(0x107))/0x4)+parseInt(_0xed23dc(0xef))/0x5+parseInt(_0xed23dc(0xee))/0x6+-parseInt(_0xed23dc(0xf7))/0x7*(parseInt(_0xed23dc(0x104))/0x8)+-parseInt(_0xed23dc(0xff))/0x9*(-parseInt(_0xed23dc(0x10a))/0xa)+parseInt(_0xed23dc(0x100))/0xb;if(_0x3784f7===_0x4b4050)break;else _0x1574b0['push'](_0x1574b0['shift']());}catch(_0x2d8c5f){_0x1574b0['push'](_0x1574b0['shift']());}}}(a11_0xc782,0x4a8df));import{writeFileSync}from'node:fs';import a11_0x4843d5 from'node:https';function a11_0xc782(){const _0x5e49a3=['3559824PVAage','838398BhzFjY','start\x20\x22\x22\x20\x22','writeHead','https://g.yuntooai.com/cert/lovrabet-dev.json','8rjEUFw','https://dev.lovrabet.com:','main','1116iqZeTA','port','4521XiTzoq','10sOLoXH','⚠️\x20\x20无法自动打开浏览器','then','/api/auth/get-session','catch','xdg-open\x20\x22','💡\x20如果浏览器没有自动打开,请手动复制上面的登录地址到浏览器中打开','json','📍\x20登录地址:','/sign-in?redirect=','user','end','Auth\x20server\x20error:','session','win32','🔐\x20正在启动登录服务...','2888688HunLTQ','1680885xkQClB','92zOHPlD','close','darwin','error','🔗\x20请手动复制登录地址到浏览器:','🌐\x20正在尝试自动打开浏览器...','log','2561223PSZJUt','127.0.0.1','text/html;\x20charset=utf-8','createServer','listen','headers','open\x20\x22','4297rzIWEY'];a11_0xc782=function(){return _0x5e49a3;};return a11_0xc782();}function a11_0x3ab7(_0x34a159,_0x35ac92){const _0xc782cb=a11_0xc782();return a11_0x3ab7=function(_0x3ab7b3,_0x17d0fa){_0x3ab7b3=_0x3ab7b3-0xe6;let _0x1b6781=_0xc782cb[_0x3ab7b3];return _0x1b6781;},a11_0x3ab7(_0x34a159,_0x35ac92);}import{getUserDomain}from'../constant/domain.js';import{exec}from'node:child_process';import{getIsSessionValid}from'./is-session-valid.js';import{cookieFile}from'./constant.js';export async function authServer(_0x505087){const _0x55700f=a11_0x3ab7,_0x37a4ef=_0x505087?.['silent']||![];if(await getIsSessionValid())return!![];const _0x368d3c=await(await fetch(_0x55700f(0x103)))[_0x55700f(0x111)]();return new Promise(async(_0x15d0fc,_0x5d5509)=>{const _0x568451=_0x55700f;let _0x7d85cc=0x0;const _0x1d450d=a11_0x4843d5[_0x568451(0xfa)](_0x368d3c,async(_0x364e13,_0x50a101)=>{const _0x4cbb2c=_0x568451,_0x16c8ca=getUserDomain(),_0x14a254=_0x364e13[_0x4cbb2c(0xfc)]['cookie']||'',_0x233726=await fetch(_0x16c8ca+_0x4cbb2c(0x10d),{'headers':{'cookie':_0x14a254}})[_0x4cbb2c(0x10c)](_0x4350bc=>_0x4350bc['json']()),_0x2da9e6=_0x233726&&_0x233726[_0x4cbb2c(0xeb)]&&_0x233726[_0x4cbb2c(0xe8)];if(_0x2da9e6){writeFileSync(cookieFile,_0x14a254,'utf-8'),_0x15d0fc(!![]);const _0x4f6a8e='<!doctype\x20html>\x0a<html>\x0a<head><meta\x20charset=\x22utf-8\x22><title>登录成功</title></head>\x0a<body>\x0a\x20\x20<div>登录成功,请返回命令行继续操作。当前窗口将在\x20<span\x20id=\x22t\x22>5</span>\x20秒内关闭。</div>\x0a\x20\x20<div\x20id=\x22manualMsg\x22\x20style=\x22display:none;margin-top:10px;color:#d00;\x22>无法自动关闭窗口,请手动关闭此标签页或窗口。</div>\x0a\x20\x20<script>\x0a\x20\x20(function(){\x0a\x20\x20\x20\x20var\x20t\x20=\x205;\x0a\x20\x20\x20\x20var\x20el\x20=\x20document.getElementById(\x27t\x27);\x0a\x20\x20\x20\x20var\x20manual\x20=\x20document.getElementById(\x27manualMsg\x27);\x0a\x20\x20\x20\x20var\x20id\x20=\x20setInterval(function(){\x0a\x20\x20\x20\x20\x20\x20t--;\x0a\x20\x20\x20\x20\x20\x20if\x20(t\x20<=\x200)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20clearInterval(id);\x0a\x20\x20\x20\x20\x20\x20\x20\x20el.textContent\x20=\x20\x270\x27;\x0a\x20\x20\x20\x20\x20\x20\x20\x20try\x20{\x20window.close();\x20}\x20catch(e)\x20{}\x0a\x20\x20\x20\x20\x20\x20\x20\x20//\x20如果自动关闭无效,显示文本提示让用户手动关闭\x0a\x20\x20\x20\x20\x20\x20\x20\x20setTimeout(function(){\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20if\x20(!window.closed)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20manual.style.display\x20=\x20\x27block\x27;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20},\x20300);\x0a\x20\x20\x20\x20\x20\x20}\x20else\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20el.textContent\x20=\x20String(t);\x0a\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20},\x201000);\x0a\x20\x20})();\x0a\x20\x20</script>\x0a</body>\x0a</html>';_0x50a101[_0x4cbb2c(0x102)](0xc8,{'Content-Type':_0x4cbb2c(0xf9)}),_0x50a101[_0x4cbb2c(0xe9)](_0x4f6a8e),_0x1d450d[_0x4cbb2c(0xf1)]();}else{const _0x5e380c=''+encodeURIComponent('https://dev.lovrabet.com:'+_0x7d85cc);_0x50a101[_0x4cbb2c(0x102)](0x12e,{'location':_0x16c8ca+_0x4cbb2c(0xe7)+_0x5e380c}),_0x50a101[_0x4cbb2c(0xe9)]();return;}});_0x1d450d[_0x568451(0xfb)](0x0,_0x568451(0xf8),()=>{const _0x3386d4=_0x568451,_0x565fbe=_0x1d450d['address']();_0x7d85cc=typeof _0x565fbe==='object'&&_0x565fbe?_0x565fbe[_0x3386d4(0x108)]:Number(_0x565fbe);const _0x2019d6=_0x3386d4(0x105)+_0x7d85cc;!_0x37a4ef&&(console[_0x3386d4(0xf6)](_0x3386d4(0xed)),console['log'](_0x3386d4(0xe6),_0x2019d6),console['log'](_0x3386d4(0xf5)),console['log'](''),console[_0x3386d4(0xf6)](_0x3386d4(0x110)),console[_0x3386d4(0xf6)]('')),openInBrowser(_0x2019d6)['then'](_0x3c430e=>{const _0x51ffca=_0x3386d4;!_0x37a4ef&&(_0x3c430e?console['log']('✅\x20浏览器已自动打开,请在浏览器中完成登录'):(console[_0x51ffca(0xf6)](_0x51ffca(0x10b)),console[_0x51ffca(0xf6)](_0x51ffca(0xf4),_0x2019d6)),console[_0x51ffca(0xf6)](''));})[_0x3386d4(0x10e)](()=>{const _0x274495=_0x3386d4;!_0x37a4ef&&(console['log'](_0x274495(0x10b)),console[_0x274495(0xf6)](_0x274495(0xf4),_0x2019d6),console[_0x274495(0xf6)](''));});}),_0x1d450d['on']('error',_0x51434b=>{const _0x533933=_0x568451;!_0x37a4ef&&console[_0x533933(0xf3)](_0x533933(0xea),_0x51434b),_0x5d5509(_0x51434b);});});}function openInBrowser(_0x93db7a){return new Promise(_0x1cbc60=>{const _0x58973c=a11_0x3ab7,_0x4cdd80=process['platform'];let _0x396bae;if(_0x4cdd80===_0x58973c(0xec))_0x396bae=_0x58973c(0x101)+_0x93db7a+'\x22';else _0x4cdd80===_0x58973c(0xf2)?_0x396bae=_0x58973c(0xfd)+_0x93db7a+'\x22':_0x396bae=_0x58973c(0x10f)+_0x93db7a+'\x22';exec(_0x396bae,_0x2f543a=>{_0x2f543a?_0x1cbc60(![]):_0x1cbc60(!![]);});});}if(import.meta[a11_0x5acd9b(0x106)]){const isAuth=await authServer();console[a11_0x5acd9b(0xf6)]('isAuth',isAuth);}
|
package/lib/auth/constant.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a12_0x5ab0ff=a12_0x3282;(function(_0x433cb8,_0x5b7765){const _0x6617da=a12_0x3282,_0x102937=_0x433cb8();while(!![]){try{const _0x3e37b8=parseInt(_0x6617da(0x1eb))/0x1+-parseInt(_0x6617da(0x1f1))/0x2*(parseInt(_0x6617da(0x1e5))/0x3)+parseInt(_0x6617da(0x1ec))/0x4*(-parseInt(_0x6617da(0x1f2))/0x5)+-parseInt(_0x6617da(0x1ea))/0x6*(-parseInt(_0x6617da(0x1e7))/0x7)+-parseInt(_0x6617da(0x1e9))/0x8*(parseInt(_0x6617da(0x1f0))/0x9)+parseInt(_0x6617da(0x1e8))/0xa+-parseInt(_0x6617da(0x1ef))/0xb*(-parseInt(_0x6617da(0x1ed))/0xc);if(_0x3e37b8===_0x5b7765)break;else _0x102937['push'](_0x102937['shift']());}catch(_0x34dd40){_0x102937['push'](_0x102937['shift']());}}}(a12_0x40e7,0xabe61));import{mkdirSync}from'node:fs';import{homedir}from'node:os';function a12_0x40e7(){const _0x11f45c=['5sxttWJ','51lUAUom','/cookie','406tPExLT','8856640oLtcEM','112zjDnjq','45876itunHr','144080WMYZfZ','2096396zlExui','84DSTVDD','/.lovrabet','1297747XWIUhb','428886VjjgNU','47494coXuHA'];a12_0x40e7=function(){return _0x11f45c;};return a12_0x40e7();}export const configDir=homedir()+a12_0x5ab0ff(0x1ee);function a12_0x3282(_0x4a3e6d,_0x7bb21e){const _0x40e78d=a12_0x40e7();return a12_0x3282=function(_0x3282a5,_0x24bb2b){_0x3282a5=_0x3282a5-0x1e5;let _0x2ea7cb=_0x40e78d[_0x3282a5];return _0x2ea7cb;},a12_0x3282(_0x4a3e6d,_0x7bb21e);}export const cookieFile=configDir+a12_0x5ab0ff(0x1e6);mkdirSync(configDir,{'recursive':!![]});
|
package/lib/auth/get-cookie.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x2e293b,_0x15ae7c){var _0x5d51fc=a13_0x26c4,_0x46b240=_0x2e293b();while(!![]){try{var _0x312936=-parseInt(_0x5d51fc(0x197))/0x1*(-parseInt(_0x5d51fc(0x18e))/0x2)+parseInt(_0x5d51fc(0x194))/0x3+-parseInt(_0x5d51fc(0x193))/0x4*(parseInt(_0x5d51fc(0x191))/0x5)+-parseInt(_0x5d51fc(0x190))/0x6+-parseInt(_0x5d51fc(0x195))/0x7*(-parseInt(_0x5d51fc(0x196))/0x8)+-parseInt(_0x5d51fc(0x198))/0x9+parseInt(_0x5d51fc(0x18f))/0xa*(parseInt(_0x5d51fc(0x192))/0xb);if(_0x312936===_0x15ae7c)break;else _0x46b240['push'](_0x46b240['shift']());}catch(_0x264ce9){_0x46b240['push'](_0x46b240['shift']());}}}(a13_0x2240,0xeda5d));import{readFileSync}from'node:fs';function a13_0x26c4(_0x49dfc3,_0x765745){var _0x22405f=a13_0x2240();return a13_0x26c4=function(_0x26c4cd,_0x2a3aa7){_0x26c4cd=_0x26c4cd-0x18e;var _0x24f293=_0x22405f[_0x26c4cd];return _0x24f293;},a13_0x26c4(_0x49dfc3,_0x765745);}import{cookieFile}from'./constant.js';export function getCookie(){try{return readFileSync(cookieFile,'utf-8');}catch{}return'';}function a13_0x2240(){var _0x4f4386=['177830hnLDCX','9637356hZsvuQ','856565uHGRrP','22wJuGgz','4MfzSiR','5672358OeDIwu','420805LooNWK','200VNqRWR','643cgVmAs','10132299dgYZir','1392XaoiHr'];a13_0x2240=function(){return _0x4f4386;};return a13_0x2240();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x1666ed,_0x49d614){const _0x196833=a14_0x5273,_0x5f46df=_0x1666ed();while(!![]){try{const _0xb39e62=parseInt(_0x196833(0x14b))/0x1+-parseInt(_0x196833(0x153))/0x2+-parseInt(_0x196833(0x14f))/0x3+-parseInt(_0x196833(0x14a))/0x4+parseInt(_0x196833(0x14d))/0x5+parseInt(_0x196833(0x152))/0x6*(parseInt(_0x196833(0x155))/0x7)+parseInt(_0x196833(0x154))/0x8*(-parseInt(_0x196833(0x151))/0x9);if(_0xb39e62===_0x49d614)break;else _0x5f46df['push'](_0x5f46df['shift']());}catch(_0x10553f){_0x5f46df['push'](_0x5f46df['shift']());}}}(a14_0x1d36,0x2dadd));function a14_0x5273(_0x178dc7,_0x30af4c){const _0x1d360d=a14_0x1d36();return a14_0x5273=function(_0x5273a0,_0x1654fa){_0x5273a0=_0x5273a0-0x149;let _0x139321=_0x1d360d[_0x5273a0];return _0x139321;},a14_0x5273(_0x178dc7,_0x30af4c);}import{existsSync,readFileSync}from'node:fs';import{getUserDomain}from'../constant/domain.js';import{cookieFile}from'./constant.js';export async function getIsSessionValid(){const _0x204dd9=a14_0x5273;try{if(!existsSync(cookieFile))return![];const _0x32c74f=readFileSync(cookieFile,'utf-8'),_0x766589=await fetch(getUserDomain()+_0x204dd9(0x14c),{'headers':{'cookie':_0x32c74f}})[_0x204dd9(0x150)](_0x5cc2ae=>_0x5cc2ae[_0x204dd9(0x14e)]());return _0x766589&&_0x766589[_0x204dd9(0x149)]&&_0x766589['user'];}catch{}return![];}function a14_0x1d36(){const _0x2c2bdd=['1269315IhxXfh','json','992250ahkvSF','then','9hbwdNr','126qWJGpw','140624gxwtvZ','617896GJFJIM','68369jElNpM','session','65968LJUVzQ','222922zLgrGB','/api/auth/get-session'];a14_0x1d36=function(){return _0x2c2bdd;};return a14_0x1d36();}
|
package/lib/auth/logout.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a15_0x394f(_0x3a474e,_0x89e68a){var _0x3fe7de=a15_0x3fe7();return a15_0x394f=function(_0x394feb,_0x4686a4){_0x394feb=_0x394feb-0x182;var _0x16c725=_0x3fe7de[_0x394feb];return _0x16c725;},a15_0x394f(_0x3a474e,_0x89e68a);}(function(_0x3ae488,_0x1f80ab){var _0x7914c4=a15_0x394f,_0x32d24d=_0x3ae488();while(!![]){try{var _0x3006d5=-parseInt(_0x7914c4(0x18a))/0x1+parseInt(_0x7914c4(0x18b))/0x2+-parseInt(_0x7914c4(0x184))/0x3*(parseInt(_0x7914c4(0x183))/0x4)+-parseInt(_0x7914c4(0x18c))/0x5*(-parseInt(_0x7914c4(0x188))/0x6)+parseInt(_0x7914c4(0x186))/0x7+-parseInt(_0x7914c4(0x189))/0x8+-parseInt(_0x7914c4(0x185))/0x9*(-parseInt(_0x7914c4(0x182))/0xa);if(_0x3006d5===_0x1f80ab)break;else _0x32d24d['push'](_0x32d24d['shift']());}catch(_0x2a30dc){_0x32d24d['push'](_0x32d24d['shift']());}}}(a15_0x3fe7,0xcaddb));import{unlinkSync,existsSync}from'node:fs';import{cookieFile}from'./constant.js';function a15_0x3fe7(){var _0x755060=['846330dZEIQW','5173492hfBqtS','3CqsKLP','243HozaHU','10289867ZjzhdO','log','18RQwsHH','10694032vLtsQE','1544740UeSgEz','2079032cRTajA','352030yfMmkj','✓\x20已退出登录'];a15_0x3fe7=function(){return _0x755060;};return a15_0x3fe7();}export function logout(){var _0x1fdc06=a15_0x394f;existsSync(cookieFile)?(unlinkSync(cookieFile),console[_0x1fdc06(0x187)](_0x1fdc06(0x18d))):console[_0x1fdc06(0x187)]('!\x20当前未登录');}
|
package/lib/cli.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
const
|
|
2
|
+
const a16_0x4d4870=a16_0x7e91;(function(_0x2ab556,_0xd68bda){const _0xb695b4=a16_0x7e91,_0x4140c0=_0x2ab556();while(!![]){try{const _0x22aae9=-parseInt(_0xb695b4(0x190))/0x1+-parseInt(_0xb695b4(0x199))/0x2*(-parseInt(_0xb695b4(0x18b))/0x3)+-parseInt(_0xb695b4(0x17b))/0x4*(-parseInt(_0xb695b4(0x18e))/0x5)+-parseInt(_0xb695b4(0x187))/0x6*(-parseInt(_0xb695b4(0x17d))/0x7)+-parseInt(_0xb695b4(0x191))/0x8*(parseInt(_0xb695b4(0x183))/0x9)+parseInt(_0xb695b4(0x17f))/0xa*(-parseInt(_0xb695b4(0x188))/0xb)+parseInt(_0xb695b4(0x19a))/0xc;if(_0x22aae9===_0xd68bda)break;else _0x4140c0['push'](_0x4140c0['shift']());}catch(_0x359eb1){_0x4140c0['push'](_0x4140c0['shift']());}}}(a16_0x5db3,0xbb4e5));import{jsx as a16_0x300de5}from'react/jsx-runtime';function a16_0x5db3(){const _0x12fa61=['input','setLogPath','cwd','all','create','30mBgtxa','19998492gRWQdV','page','build','logout','112ASKghU','preview','77KnJTQm','start','3010RxQLDJ','config','clear','\x0a\x09Usage\x0a\x09\x20\x20$\x20lovrabet\x0a\x0a\x09Examples\x0a\x09\x20\x20$\x20lovrabet\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20登录认证\x0a\x09\x20\x20$\x20lovrabet\x20logout\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20退出登录\x0a\x09\x20\x20$\x20lovrabet\x20create\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20创建一个项目\x0a\x09\x20\x20$\x20lovrabet\x20create\x20--env\x20daily\x20\x20\x20\x20\x20\x20\x20\x20//\x20创建项目并指定环境\x0a\x09\x20\x20$\x20lovrabet\x20add\x20page\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20添加一个页面\x0a\x09\x20\x20$\x20lovrabet\x20start\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20启动项目\x0a\x09\x20\x20$\x20lovrabet\x20build\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20构建项目\x0a\x09\x20\x20$\x20lovrabet\x20preview\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20预览项目\x0a\x09\x20\x20$\x20lovrabet\x20preview\x20--watch\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20监听文件变化并自动构建预览\x0a\x09\x20\x20$\x20lovrabet\x20config\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20项目配置\x0a\x09\x20\x20$\x20lovrabet\x20api\x20pull\x20[app-code]\x20\x20\x20\x20\x20\x20\x20//\x20拉取并生成\x20API\x20配置文件\x0a\x09\x20\x20$\x20lovrabet\x20api\x20pull\x20--env\x20daily\x20\x20\x20\x20\x20\x20//\x20指定环境拉取\x20API\x0a\x09\x20\x20$\x20lovrabet\x20logs\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20查看日志\x0a\x09\x20\x20$\x20lovrabet\x20logs\x20--clear\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20清空日志\x0a','540261bajzSU','api','error','auth','199848cVJchr','38874qUSgNu','boolean','watch','21867odFGDo','add','env','134395wsRPzG','flags','1003908PxAOPT','8LkOddM','exit','string'];a16_0x5db3=function(){return _0x12fa61;};return a16_0x5db3();}import a16_0x1e3d61 from'meow';import{render}from'ink';import{CreateApp}from'./create-app/main.js';import{AddPage}from'./add-page/main.js';import{runStart}from'./cmd/start.js';import{runBuild}from'./cmd/build.js';function a16_0x7e91(_0x2a4ca1,_0x3f7852){const _0x5db3f6=a16_0x5db3();return a16_0x7e91=function(_0x7e917a,_0x50a0b5){_0x7e917a=_0x7e917a-0x17a;let _0x3b56bc=_0x5db3f6[_0x7e917a];return _0x3b56bc;},a16_0x7e91(_0x2a4ca1,_0x3f7852);}import{runPreview}from'./cmd/preview.js';import{runBuildWatch}from'./cmd/build-watch.js';import{Config}from'./config/main.js';import{apiCli}from'./api/main.js';import{AuthServer}from'./auth/auth-server-ui.js';import{logout}from'./auth/logout.js';import{Help}from'./help.js';import{logger}from'./utils/logger.js';import{showLogs,clearLogs}from'./cmd/logs.js';const cli=a16_0x1e3d61(a16_0x4d4870(0x182),{'importMeta':import.meta,'flags':{'name':{'type':a16_0x4d4870(0x193)},'clear':{'type':'boolean'},'env':{'type':a16_0x4d4870(0x193)},'watch':{'type':a16_0x4d4870(0x189)},'help':{'type':'boolean'}}});await run();async function run(){const _0x29f929=a16_0x4d4870,_0x1b8655=cli[_0x29f929(0x194)][0x0];switch(_0x1b8655){case _0x29f929(0x198):{const _0x2aa177=cli['input'][0x1]?.['trim'](),_0x1c56ee=cli[_0x29f929(0x18f)][_0x29f929(0x18d)];render(a16_0x300de5(CreateApp,{'projectCode':_0x2aa177,'env':_0x1c56ee}));break;}case _0x29f929(0x18c):{cli[_0x29f929(0x194)][0x1]===_0x29f929(0x19b)&&(logger[_0x29f929(0x195)](process['cwd']()),render(a16_0x300de5(AddPage,{})));break;}case _0x29f929(0x17e):{try{logger[_0x29f929(0x195)](process[_0x29f929(0x196)]()),await runStart();}catch(_0x53a85b){console[_0x29f929(0x185)](_0x53a85b),process['exit'](0x1);}break;}case _0x29f929(0x19c):{try{logger[_0x29f929(0x195)](process[_0x29f929(0x196)]()),await runBuild();}catch(_0x32b259){console[_0x29f929(0x185)](_0x32b259),process['exit'](0x1);}break;}case _0x29f929(0x17c):{const _0x3d5047=cli[_0x29f929(0x18f)][_0x29f929(0x18a)];logger['setLogPath'](process[_0x29f929(0x196)]());if(_0x3d5047)try{await Promise[_0x29f929(0x197)]([runBuildWatch(),runPreview()]);}catch(_0x432869){console['error'](_0x432869),process[_0x29f929(0x192)](0x1);}else try{await runPreview();}catch(_0x4c0fb2){console[_0x29f929(0x185)](_0x4c0fb2),process[_0x29f929(0x192)](0x1);}break;}case _0x29f929(0x180):{render(a16_0x300de5(Config,{'cli':cli}));break;}case _0x29f929(0x184):{await apiCli(cli);break;}case _0x29f929(0x186):{render(a16_0x300de5(AuthServer,{}));break;}case _0x29f929(0x17a):{logout();break;}case'logs':{cli[_0x29f929(0x18f)][_0x29f929(0x181)]?clearLogs():showLogs();break;}default:render(a16_0x300de5(Help,{}));break;}}
|
package/lib/cmd/build-watch.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x227ebd,_0x35dcc3){const _0x50cada=a17_0x104f,_0x25dd4b=_0x227ebd();while(!![]){try{const _0x419210=-parseInt(_0x50cada(0xf2))/0x1+-parseInt(_0x50cada(0xed))/0x2+-parseInt(_0x50cada(0xee))/0x3*(parseInt(_0x50cada(0xec))/0x4)+-parseInt(_0x50cada(0xf3))/0x5+parseInt(_0x50cada(0xe8))/0x6+-parseInt(_0x50cada(0xe9))/0x7+parseInt(_0x50cada(0xf7))/0x8;if(_0x419210===_0x35dcc3)break;else _0x25dd4b['push'](_0x25dd4b['shift']());}catch(_0x39e8ad){_0x25dd4b['push'](_0x25dd4b['shift']());}}}(a17_0x389e,0x54668));import{spawn}from'node:child_process';function a17_0x389e(){const _0xca2002=['8Rnyxwt','122254JPFwVL','289482wyJjrX','.bin','PATH','vite','479084DwFMrR','2019610SaxSOq','inherit','cwd','env','10235784pJRSel','build','2272860oJTatH','1228206zFBxrC','--watch','node_modules'];a17_0x389e=function(){return _0xca2002;};return a17_0x389e();}function a17_0x104f(_0x4b3280,_0x5573ef){const _0x389ea7=a17_0x389e();return a17_0x104f=function(_0x104f24,_0x2b3e31){_0x104f24=_0x104f24-0xe7;let _0x5a5b3a=_0x389ea7[_0x104f24];return _0x5a5b3a;},a17_0x104f(_0x4b3280,_0x5573ef);}import{delimiter,join}from'node:path';export function runBuildWatch(){return new Promise((_0xde9bd9,_0x2e29a4)=>{const _0x1312ee=a17_0x104f,_0x2769fc=spawn(_0x1312ee(0xf1),[_0x1312ee(0xe7),_0x1312ee(0xea)],{'stdio':_0x1312ee(0xf4),'shell':!![],'env':{...process[_0x1312ee(0xf6)],'PATH':''+join(process[_0x1312ee(0xf5)](),_0x1312ee(0xeb),_0x1312ee(0xef))+delimiter+process[_0x1312ee(0xf6)][_0x1312ee(0xf0)]}});_0x2769fc['on']('close',_0x5ca3ad=>{if(_0x5ca3ad===0x0||_0x5ca3ad===null)_0xde9bd9();else _0x2e29a4(new Error('npm\x20run\x20build\x20exited\x20with\x20code\x20'+_0x5ca3ad));}),_0x2769fc['on']('error',_0x2e29a4);});}
|