@lovrabet/cli 1.1.2 → 1.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. package/README.md +2 -2
  2. package/lib/add-page/input-page-router.js +1 -1
  3. package/lib/add-page/main.js +1 -1
  4. package/lib/add-page/select-page-template.js +1 -1
  5. package/lib/api/api-pull-ui.js +1 -1
  6. package/lib/api/format-dataset.js +1 -1
  7. package/lib/api/generate-api-file.js +1 -1
  8. package/lib/api/main.js +1 -1
  9. package/lib/api/pull-silent.js +1 -1
  10. package/lib/api/pull.js +1 -1
  11. package/lib/auth/auth-server-ui.js +1 -1
  12. package/lib/auth/auth-server.js +1 -1
  13. package/lib/auth/constant.js +1 -1
  14. package/lib/auth/get-cookie.js +1 -1
  15. package/lib/auth/is-session-valid.js +1 -1
  16. package/lib/auth/logout.js +1 -1
  17. package/lib/cli.js +1 -1
  18. package/lib/cmd/build-watch.js +1 -1
  19. package/lib/cmd/build.js +1 -1
  20. package/lib/cmd/logs.js +1 -1
  21. package/lib/cmd/preview.js +1 -1
  22. package/lib/cmd/start.js +1 -1
  23. package/lib/config/config-help.js +1 -1
  24. package/lib/config/main.js +1 -1
  25. package/lib/constant/domain.js +1 -1
  26. package/lib/constant/env.js +1 -1
  27. package/lib/create-app/enhanced-guided-create.js +1 -1
  28. package/lib/create-app/format-elapsed.js +1 -1
  29. package/lib/create-app/main.js +1 -1
  30. package/lib/create-app/task-finished.js +1 -1
  31. package/lib/create-app/task-loading.js +1 -1
  32. package/lib/create-app/task-running.js +1 -1
  33. package/lib/create-app/task-time.js +1 -1
  34. package/lib/create-app/use-copy-project-template.js +1 -1
  35. package/lib/create-app/use-format-code.js +1 -1
  36. package/lib/create-app/use-install-dependencies.js +1 -1
  37. package/lib/help.js +1 -1
  38. package/lib/utils/config.js +1 -1
  39. package/lib/utils/copy-directory.js +1 -1
  40. package/lib/utils/logger.js +1 -1
  41. package/lib/utils/router-updater.js +1 -1
  42. package/lib/utils/template-replacer.js +1 -1
  43. package/package.json +1 -1
  44. package/templates/pages/sdk-fetch/index.tsx.tpl +14 -5
  45. package/templates/projects/sub-app-react-demo/package.json +1 -1
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Lovrabet CLI
2
2
 
3
- 一个强大的前端开发脚手架工具,专为 Lovrabet 数据平台应用开发而设计。提供项目创建、页面生成、API 集成、开发调试等全套开发工具链。
3
+ 一个强大的前端开发脚手架工具,专为 [Lovrabet](https://www.lovrabet.com) 开放平台应用开发而设计。提供项目创建、页面生成、API 集成、开发调试等全套开发工具链。
4
4
 
5
5
  ## ✨ 特性
6
6
 
@@ -250,7 +250,7 @@ cd component-library
250
250
  lovrabet build
251
251
  ```
252
252
 
253
- ## 🆘 故障排除
253
+ ## 🆘 故障排查
254
254
 
255
255
  ### 常见问题
256
256
 
@@ -1 +1 @@
1
- (function(_0x56d18f,_0x36917f){const _0x287e4b=a0_0x3359,_0x238a4e=_0x56d18f();while(!![]){try{const _0x4aa739=parseInt(_0x287e4b(0x16a))/0x1*(parseInt(_0x287e4b(0x159))/0x2)+-parseInt(_0x287e4b(0x16e))/0x3+-parseInt(_0x287e4b(0x166))/0x4*(-parseInt(_0x287e4b(0x16b))/0x5)+parseInt(_0x287e4b(0x167))/0x6+-parseInt(_0x287e4b(0x16f))/0x7+-parseInt(_0x287e4b(0x15c))/0x8+parseInt(_0x287e4b(0x172))/0x9;if(_0x4aa739===_0x36917f)break;else _0x238a4e['push'](_0x238a4e['shift']());}catch(_0x449cf1){_0x238a4e['push'](_0x238a4e['shift']());}}}(a0_0x25ab,0x810a8));function a0_0x3359(_0x5a5eb8,_0xee0ea0){const _0x25abc1=a0_0x25ab();return a0_0x3359=function(_0x335990,_0x173a3a){_0x335990=_0x335990-0x159;let _0x56c78a=_0x25abc1[_0x335990];return _0x56c78a;},a0_0x3359(_0x5a5eb8,_0xee0ea0);}import{jsx as a0_0x33b031,jsxs as a0_0x59d093}from'react/jsx-runtime';import{useState}from'react';function a0_0x25ab(){const _0x37a14c=['startsWith','4562136suGrIV','split','路径不能以\x20/\x20开头或结尾','trim','test','\x20直接回车确认,或输入自定义路由地址','\x20已存在,请使用其他路径','length','my-page','existsSync','407384NyzMSv','4729548RNqsms','green','gray','53962DjbKYc','5JTLLUL','delete','\x20Step2:\x20','2330790OzAOhC','5473580banseg','endsWith','路径中的每个段只能以字母或数字开头,且只包含字母、数字、-\x20和\x20_','14451291lNyTrt','\x20←\x20','页面路径不合法','includes','6begXby','red'];a0_0x25ab=function(){return _0x37a14c;};return a0_0x25ab();}import{Text,Box,useInput}from'ink';import a0_0x57dd1f from'node:fs';export function InputProjectCode(_0x390ee6){const _0x7786e9=a0_0x3359,{onSubmit:_0x797a67,pagePath:_0x8db58c}=_0x390ee6,[_0x45d697,_0x1cc0f0]=useState(''),[_0x175db1,_0x313900]=useState(''),_0xf69051=_0x7786e9(0x164);function _0x2096b5(_0x1df182){const _0x554a00=_0x7786e9;if(_0x1df182[_0x554a00(0x163)]>0x64)return{'valid':![],'message':'页面路径长度不能超过\x20100\x20个字符'};if(_0x1df182[_0x554a00(0x15b)]('/')||_0x1df182[_0x554a00(0x170)]('/'))return{'valid':![],'message':_0x554a00(0x15e)};if(_0x1df182[_0x554a00(0x175)]('//'))return{'valid':![],'message':'路径不能包含连续的\x20/'};const _0xfdde9b=_0x1df182[_0x554a00(0x15d)]('/');for(const _0x5a2236 of _0xfdde9b){if(!_0x5a2236)continue;const _0x3b62ca=/^[A-Za-z0-9][A-Za-z0-9_-]*$/;if(!_0x3b62ca[_0x554a00(0x160)](_0x5a2236))return{'valid':![],'message':_0x554a00(0x171)};}return{'valid':!![]};}return useInput((_0x5df5d3,_0x1ffe83)=>{const _0x4188e6=_0x7786e9;if(_0x1ffe83['return']){const _0x1e5535=_0x45d697[_0x4188e6(0x15f)]()||_0xf69051;if(_0x175db1)return;const _0x509080=_0x8db58c+'/'+_0x1e5535;if(a0_0x57dd1f[_0x4188e6(0x165)](_0x509080)){_0x313900('页面路径\x20'+_0x1e5535+_0x4188e6(0x162));return;}_0x797a67(_0x1e5535),_0x1cc0f0(''),_0x313900('');}else _0x1ffe83['backspace']||_0x1ffe83[_0x4188e6(0x16c)]?_0x1cc0f0(_0x5f1276=>{const _0x578b37=_0x4188e6,_0xc0c9ec=_0x5f1276['slice'](0x0,-0x1),{valid:_0x2b0ea7,message:_0x5c3ce0}=_0x2096b5(_0xc0c9ec);return _0x313900(_0x2b0ea7?'':_0x5c3ce0||_0x578b37(0x174)),_0xc0c9ec;}):_0x1cc0f0(_0x35b418=>{const _0xc50aad=_0x4188e6,_0x2ada3c=_0x35b418+_0x5df5d3,{valid:_0x450a2e,message:_0x4aaa9a}=_0x2096b5(_0x2ada3c);return _0x313900(_0x450a2e?'':_0x4aaa9a||_0xc50aad(0x174)),_0x2ada3c;});}),a0_0x59d093(Box,{'flexDirection':'column','children':[a0_0x59d093(Box,{'children':[a0_0x33b031(Text,{'color':_0x7786e9(0x169),'children':_0x7786e9(0x16d)}),a0_0x33b031(Text,{'children':'页面路由地址:\x20'}),_0x45d697?a0_0x33b031(Text,{'color':_0x7786e9(0x168),'children':_0x45d697}):a0_0x33b031(Text,{'color':'gray','children':_0xf69051}),_0x175db1&&a0_0x59d093(Text,{'color':_0x7786e9(0x15a),'children':[_0x7786e9(0x173),_0x175db1]})]}),!_0x175db1&&!_0x45d697&&a0_0x33b031(Box,{'children':a0_0x33b031(Text,{'color':_0x7786e9(0x169),'children':_0x7786e9(0x161)})})]});}
1
+ (function(_0x2e461f,_0x62dfbd){const _0x132572=a0_0x1b32,_0x76f3c8=_0x2e461f();while(!![]){try{const _0x3e8db0=parseInt(_0x132572(0x1fd))/0x1+parseInt(_0x132572(0x1ea))/0x2+parseInt(_0x132572(0x1eb))/0x3+-parseInt(_0x132572(0x1ec))/0x4+-parseInt(_0x132572(0x1e9))/0x5*(parseInt(_0x132572(0x1f6))/0x6)+parseInt(_0x132572(0x1fe))/0x7+-parseInt(_0x132572(0x1f7))/0x8;if(_0x3e8db0===_0x62dfbd)break;else _0x76f3c8['push'](_0x76f3c8['shift']());}catch(_0x784424){_0x76f3c8['push'](_0x76f3c8['shift']());}}}(a0_0x45a9,0xba6f3));import{jsx as a0_0x255896,jsxs as a0_0x177f52}from'react/jsx-runtime';function a0_0x45a9(){const _0x5f3b30=['页面路径\x20','delete','\x20Step2:\x20','my-page','页面路径不合法','existsSync','17838cfTQeL','11962600QYKvoy','test','页面路径长度不能超过\x20100\x20个字符','gray','split','length','484524lhNAtB','7505575qKoGGJ','return','green','trim','includes','路径不能包含连续的\x20/','startsWith','2435XyOQZj','2061576ovPJFH','4366623JVBsOR','1345068HTnwpM','column','路径中的每个段只能以字母或数字开头,且只包含字母、数字、-\x20和\x20_','red'];a0_0x45a9=function(){return _0x5f3b30;};return a0_0x45a9();}function a0_0x1b32(_0x240bf7,_0x23c528){const _0x45a9c7=a0_0x45a9();return a0_0x1b32=function(_0x1b3270,_0x35d55e){_0x1b3270=_0x1b3270-0x1e5;let _0x25d5a6=_0x45a9c7[_0x1b3270];return _0x25d5a6;},a0_0x1b32(_0x240bf7,_0x23c528);}import{useState}from'react';import{Text,Box,useInput}from'ink';import a0_0x350198 from'node:fs';export function InputProjectCode(_0x54ae11){const _0x18927e=a0_0x1b32,{onSubmit:_0x5a69d0,pagePath:_0x360cd5}=_0x54ae11,[_0x6cc17e,_0x40689b]=useState(''),[_0x360f7d,_0x436ba3]=useState(''),_0x30dc01=_0x18927e(0x1f3);function _0x23ed8f(_0x52371e){const _0x36c547=_0x18927e;if(_0x52371e[_0x36c547(0x1fc)]>0x64)return{'valid':![],'message':_0x36c547(0x1f9)};if(_0x52371e[_0x36c547(0x1e8)]('/')||_0x52371e['endsWith']('/'))return{'valid':![],'message':'路径不能以\x20/\x20开头或结尾'};if(_0x52371e[_0x36c547(0x1e6)]('//'))return{'valid':![],'message':_0x36c547(0x1e7)};const _0x5d25da=_0x52371e[_0x36c547(0x1fb)]('/');for(const _0x1547dc of _0x5d25da){if(!_0x1547dc)continue;const _0x3679ff=/^[A-Za-z0-9][A-Za-z0-9_-]*$/;if(!_0x3679ff[_0x36c547(0x1f8)](_0x1547dc))return{'valid':![],'message':_0x36c547(0x1ee)};}return{'valid':!![]};}return useInput((_0x4c59c2,_0x213f8d)=>{const _0x549c6d=_0x18927e;if(_0x213f8d[_0x549c6d(0x1ff)]){const _0x52d1e3=_0x6cc17e[_0x549c6d(0x1e5)]()||_0x30dc01;if(_0x360f7d)return;const _0x3336c1=_0x360cd5+'/'+_0x52d1e3;if(a0_0x350198[_0x549c6d(0x1f5)](_0x3336c1)){_0x436ba3(_0x549c6d(0x1f0)+_0x52d1e3+'\x20已存在,请使用其他路径');return;}_0x5a69d0(_0x52d1e3),_0x40689b(''),_0x436ba3('');}else _0x213f8d['backspace']||_0x213f8d[_0x549c6d(0x1f1)]?_0x40689b(_0x8b571c=>{const _0x36ea0f=_0x549c6d,_0x15255d=_0x8b571c['slice'](0x0,-0x1),{valid:_0xcc278c,message:_0x23be3f}=_0x23ed8f(_0x15255d);return _0x436ba3(_0xcc278c?'':_0x23be3f||_0x36ea0f(0x1f4)),_0x15255d;}):_0x40689b(_0x1d2697=>{const _0xab34c6=_0x549c6d,_0x55c03c=_0x1d2697+_0x4c59c2,{valid:_0x572b6c,message:_0x45b8b3}=_0x23ed8f(_0x55c03c);return _0x436ba3(_0x572b6c?'':_0x45b8b3||_0xab34c6(0x1f4)),_0x55c03c;});}),a0_0x177f52(Box,{'flexDirection':_0x18927e(0x1ed),'children':[a0_0x177f52(Box,{'children':[a0_0x255896(Text,{'color':_0x18927e(0x1fa),'children':_0x18927e(0x1f2)}),a0_0x255896(Text,{'children':'页面路由地址:\x20'}),_0x6cc17e?a0_0x255896(Text,{'color':_0x18927e(0x200),'children':_0x6cc17e}):a0_0x255896(Text,{'color':_0x18927e(0x1fa),'children':_0x30dc01}),_0x360f7d&&a0_0x177f52(Text,{'color':_0x18927e(0x1ef),'children':['\x20←\x20',_0x360f7d]})]}),!_0x360f7d&&!_0x6cc17e&&a0_0x255896(Box,{'children':a0_0x255896(Text,{'color':'gray','children':'\x20直接回车确认,或输入自定义路由地址'})})]});}
@@ -1 +1 @@
1
- const a1_0x3b126c=a1_0x25c4;(function(_0x1b1455,_0x3543e2){const _0x23bf24=a1_0x25c4,_0x36ad3b=_0x1b1455();while(!![]){try{const _0x2380f0=-parseInt(_0x23bf24(0xae))/0x1+parseInt(_0x23bf24(0xb2))/0x2*(parseInt(_0x23bf24(0xaf))/0x3)+-parseInt(_0x23bf24(0xb8))/0x4+parseInt(_0x23bf24(0xcc))/0x5+parseInt(_0x23bf24(0xcb))/0x6+-parseInt(_0x23bf24(0xc2))/0x7*(parseInt(_0x23bf24(0xb0))/0x8)+parseInt(_0x23bf24(0xaa))/0x9;if(_0x2380f0===_0x3543e2)break;else _0x36ad3b['push'](_0x36ad3b['shift']());}catch(_0x4f3847){_0x36ad3b['push'](_0x36ad3b['shift']());}}}(a1_0x2477,0xf253a));import{jsx as a1_0x120f66,jsxs as a1_0x45e025,Fragment as a1_0x30cb8a}from'react/jsx-runtime';import{fileURLToPath}from'node:url';import a1_0x2e5c32 from'node:path';import{useEffect,useState}from'react';function a1_0x2477(){const _0x18154a=['1110013MXAixk','4971hIHUSi','8136784feYZpm','success','686YGKUYE','cwd','message','setLogPath','column','pages','5196712wltDHi','\x20Step1:\x20','now','then','dirname','join','\x20*\x20路由地址:\x20','\x20*\x20页面创建成功!','\x20Step2:\x20','src','7eYmMvH','error','processTemplate','gray','catch','cyan','页面添加失败:\x20','add-page','已选择页面模板\x20','894342IhLcqv','7346045uLoxlo','开始添加页面:\x20','resolve','\x20*\x20页面文件已创建,可直接通过路由访问','info','正在创建页面,请稍候…','20090178rnUhME','green','../../templates/pages','url'];a1_0x2477=function(){return _0x18154a;};return a1_0x2477();}import{Box,Text,useApp}from'ink';import{SelectPageTemplate}from'./select-page-template.js';import{InputProjectCode}from'./input-page-router.js';function a1_0x25c4(_0x4af222,_0x177186){const _0x24770c=a1_0x2477();return a1_0x25c4=function(_0x25c47e,_0x12b0b0){_0x25c47e=_0x25c47e-0xaa;let _0xf963c6=_0x24770c[_0x25c47e];return _0xf963c6;},a1_0x25c4(_0x4af222,_0x177186);}import{logger}from'../utils/logger.js';import{TemplateReplacer}from'../utils/template-replacer.js';const __dirname=a1_0x2e5c32[a1_0x3b126c(0xbc)](fileURLToPath(import.meta[a1_0x3b126c(0xad)])),pageTemplateDir=a1_0x2e5c32[a1_0x3b126c(0xce)](__dirname,a1_0x3b126c(0xac)),projectDir=process['cwd']();export const AddPage=()=>{const _0x36e214=a1_0x3b126c,{exit:_0x4efd94}=useApp(),[_0x3df3f5,_0x2faf6f]=useState(''),[_0x3d3c39,_0x301d01]=useState(''),[_0x38a08e,_0x36b863]=useState(![]),[_0xe4f263,_0x3bc2b0]=useState(![]),_0x5f363a=a1_0x2e5c32[_0x36e214(0xbd)](projectDir,_0x36e214(0xc1),_0x36e214(0xb7)),_0x556f9c=a1_0x2e5c32[_0x36e214(0xbd)](_0x5f363a,_0x3d3c39),_0x43be0d=a1_0x2e5c32[_0x36e214(0xbd)](_0x36e214(0xc1),_0x36e214(0xb7),_0x3d3c39);useEffect(()=>{const _0x461597=_0x36e214,_0x101bb8=a1_0x2e5c32[_0x461597(0xce)](pageTemplateDir,_0x3df3f5);if(_0x3df3f5&&_0x3d3c39){_0x36b863(!![]),logger[_0x461597(0xb5)](process[_0x461597(0xb3)]());const _0xf2270c=Date['now']();logger[_0x461597(0xd0)](_0x461597(0xc9),_0x461597(0xcd)+_0x3d3c39,{'template':_0x3df3f5,'targetPath':_0x43be0d}),TemplateReplacer[_0x461597(0xc4)](_0x101bb8,a1_0x2e5c32['join'](_0x5f363a,_0x3d3c39),_0x3d3c39,_0x3df3f5)[_0x461597(0xbb)](()=>{const _0x4134a7=_0x461597,_0x308caa=Date[_0x4134a7(0xba)]()-_0xf2270c;logger[_0x4134a7(0xb1)](_0x4134a7(0xc9),'页面添加成功:\x20'+_0x3d3c39,_0x308caa,{'template':_0x3df3f5,'targetPath':_0x43be0d,'routePath':_0x3d3c39}),_0x3bc2b0(!![]);})[_0x461597(0xc6)](_0x3a022a=>{const _0x2fe285=_0x461597,_0x511a26=Date[_0x2fe285(0xba)]()-_0xf2270c;logger[_0x2fe285(0xc3)]('add-page',_0x2fe285(0xc8)+_0x3d3c39,{'template':_0x3df3f5,'targetPath':_0x43be0d,'error':_0x3a022a instanceof Error?_0x3a022a[_0x2fe285(0xb4)]:String(_0x3a022a),'duration':_0x511a26});})['finally'](()=>{_0x36b863(![]);});}},[_0x3df3f5,_0x3d3c39]),useEffect(()=>{_0xe4f263&&setTimeout(()=>{_0x4efd94();});},[_0xe4f263]);if(_0x3df3f5)return a1_0x45e025(Box,{'flexDirection':_0x36e214(0xb6),'paddingY':0x1,'children':[a1_0x45e025(Box,{'children':[a1_0x120f66(Text,{'color':_0x36e214(0xc5),'children':_0x36e214(0xb9)}),a1_0x120f66(Text,{'children':_0x36e214(0xca)}),a1_0x120f66(Text,{'color':_0x36e214(0xab),'children':_0x3df3f5})]}),_0x3d3c39?a1_0x45e025(Box,{'children':[a1_0x120f66(Text,{'color':'gray','children':_0x36e214(0xc0)}),a1_0x120f66(Text,{'children':'已输入的页面路由\x20'}),a1_0x120f66(Text,{'color':'green','children':_0x3d3c39})]}):a1_0x120f66(InputProjectCode,{'pagePath':_0x556f9c,'onSubmit':_0x301d01}),_0x3d3c39&&_0x38a08e?a1_0x45e025(Box,{'marginTop':0x1,'children':[a1_0x120f66(Box,{'width':'4'}),a1_0x120f66(Text,{'children':_0x36e214(0xd1)})]}):null,_0xe4f263?a1_0x45e025(a1_0x30cb8a,{'children':[a1_0x120f66(Box,{'marginTop':0x1,'children':a1_0x120f66(Text,{'color':_0x36e214(0xc5),'children':_0x36e214(0xbf)})}),a1_0x45e025(Box,{'children':[a1_0x120f66(Text,{'color':_0x36e214(0xc5),'children':'\x20*\x20页面路径:\x20'}),a1_0x120f66(Text,{'color':_0x36e214(0xab),'children':_0x43be0d})]}),a1_0x45e025(Box,{'children':[a1_0x120f66(Text,{'color':'gray','children':_0x36e214(0xbe)}),a1_0x45e025(Text,{'color':_0x36e214(0xab),'children':['/',_0x3d3c39]})]}),a1_0x120f66(Box,{'marginTop':0x1,'children':a1_0x120f66(Text,{'color':_0x36e214(0xc7),'children':_0x36e214(0xcf)})})]}):null]});return a1_0x120f66(SelectPageTemplate,{'onSelect':_0x2faf6f});};
1
+ function a1_0x229f(){const _0x27fbb6=['\x20*\x20页面路径:\x20','正在创建页面,请稍候…','24pTmfnO','144xPYoeI','125ThCKrs','已输入的页面路由\x20','join','green','页面添加失败:\x20','页面添加成功:\x20','add-page','cwd','131305HtZUFr','29490108AFuhBz','src','now','info','resolve','../../templates/pages','\x20*\x20页面创建成功!','then','7515541mOEYMf','message','10kYLQvT','48537KIntAo','13dgdXnd','49tAXMvl','setLogPath','gray','dirname','\x20Step2:\x20','540312ddJYRx','1148934SPeout','21652PtldiM','pages','\x20Step1:\x20'];a1_0x229f=function(){return _0x27fbb6;};return a1_0x229f();}const a1_0x3bd643=a1_0x4603;(function(_0x49e910,_0x4e2a6b){const _0x4ac08e=a1_0x4603,_0x409c2f=_0x49e910();while(!![]){try{const _0x1539c2=-parseInt(_0x4ac08e(0xf1))/0x1*(-parseInt(_0x4ac08e(0x10b))/0x2)+-parseInt(_0x4ac08e(0x104))/0x3+-parseInt(_0x4ac08e(0x106))/0x4*(parseInt(_0x4ac08e(0x10d))/0x5)+-parseInt(_0x4ac08e(0x105))/0x6*(-parseInt(_0x4ac08e(0xff))/0x7)+parseInt(_0x4ac08e(0x10c))/0x8*(parseInt(_0x4ac08e(0xfd))/0x9)+-parseInt(_0x4ac08e(0xfc))/0xa*(-parseInt(_0x4ac08e(0xfa))/0xb)+-parseInt(_0x4ac08e(0xf2))/0xc*(parseInt(_0x4ac08e(0xfe))/0xd);if(_0x1539c2===_0x4e2a6b)break;else _0x409c2f['push'](_0x409c2f['shift']());}catch(_0xbcd175){_0x409c2f['push'](_0x409c2f['shift']());}}}(a1_0x229f,0xe173a));import{jsx as a1_0x545af1,jsxs as a1_0x25eecd,Fragment as a1_0x1413db}from'react/jsx-runtime';import{fileURLToPath}from'node:url';import a1_0x3ad482 from'node:path';import{useEffect,useState}from'react';function a1_0x4603(_0xee0d76,_0x4c5387){const _0x229fc3=a1_0x229f();return a1_0x4603=function(_0x460326,_0x572149){_0x460326=_0x460326-0xeb;let _0x21f2bf=_0x229fc3[_0x460326];return _0x21f2bf;},a1_0x4603(_0xee0d76,_0x4c5387);}import{Box,Text,useApp}from'ink';import{SelectPageTemplate}from'./select-page-template.js';import{InputProjectCode}from'./input-page-router.js';import{logger}from'../utils/logger.js';import{TemplateReplacer}from'../utils/template-replacer.js';const __dirname=a1_0x3ad482[a1_0x3bd643(0x102)](fileURLToPath(import.meta['url'])),pageTemplateDir=a1_0x3ad482[a1_0x3bd643(0xf6)](__dirname,a1_0x3bd643(0xf7)),projectDir=process[a1_0x3bd643(0xf0)]();export const AddPage=()=>{const _0x83fc25=a1_0x3bd643,{exit:_0x902d0c}=useApp(),[_0x3c8fcb,_0xb5fae3]=useState(''),[_0x88daa1,_0x315a2c]=useState(''),[_0x38cbde,_0x5d4136]=useState(![]),[_0x435aa4,_0x257141]=useState(![]),_0x141d9b=a1_0x3ad482[_0x83fc25(0xeb)](projectDir,'src',_0x83fc25(0x107)),_0x1c5147=a1_0x3ad482[_0x83fc25(0xeb)](_0x141d9b,_0x88daa1),_0x374035=a1_0x3ad482[_0x83fc25(0xeb)](_0x83fc25(0xf3),_0x83fc25(0x107),_0x88daa1);useEffect(()=>{const _0x578381=_0x83fc25,_0x3ec014=a1_0x3ad482['resolve'](pageTemplateDir,_0x3c8fcb);if(_0x3c8fcb&&_0x88daa1){_0x5d4136(!![]),logger[_0x578381(0x100)](process[_0x578381(0xf0)]());const _0xb5cba1=Date[_0x578381(0xf4)]();logger[_0x578381(0xf5)](_0x578381(0xef),'开始添加页面:\x20'+_0x88daa1,{'template':_0x3c8fcb,'targetPath':_0x374035}),TemplateReplacer['processTemplate'](_0x3ec014,a1_0x3ad482[_0x578381(0xeb)](_0x141d9b,_0x88daa1),_0x88daa1,_0x3c8fcb)[_0x578381(0xf9)](()=>{const _0x525fed=_0x578381,_0x373aea=Date[_0x525fed(0xf4)]()-_0xb5cba1;logger['success'](_0x525fed(0xef),_0x525fed(0xee)+_0x88daa1,_0x373aea,{'template':_0x3c8fcb,'targetPath':_0x374035,'routePath':_0x88daa1}),_0x257141(!![]);})['catch'](_0x3c9cea=>{const _0x5c694d=_0x578381,_0x5f24bd=Date['now']()-_0xb5cba1;logger['error'](_0x5c694d(0xef),_0x5c694d(0xed)+_0x88daa1,{'template':_0x3c8fcb,'targetPath':_0x374035,'error':_0x3c9cea instanceof Error?_0x3c9cea[_0x5c694d(0xfb)]:String(_0x3c9cea),'duration':_0x5f24bd});})['finally'](()=>{_0x5d4136(![]);});}},[_0x3c8fcb,_0x88daa1]),useEffect(()=>{_0x435aa4&&setTimeout(()=>{_0x902d0c();});},[_0x435aa4]);if(_0x3c8fcb)return a1_0x25eecd(Box,{'flexDirection':'column','paddingY':0x1,'children':[a1_0x25eecd(Box,{'children':[a1_0x545af1(Text,{'color':'gray','children':_0x83fc25(0x108)}),a1_0x545af1(Text,{'children':'已选择页面模板\x20'}),a1_0x545af1(Text,{'color':_0x83fc25(0xec),'children':_0x3c8fcb})]}),_0x88daa1?a1_0x25eecd(Box,{'children':[a1_0x545af1(Text,{'color':_0x83fc25(0x101),'children':_0x83fc25(0x103)}),a1_0x545af1(Text,{'children':_0x83fc25(0x10e)}),a1_0x545af1(Text,{'color':_0x83fc25(0xec),'children':_0x88daa1})]}):a1_0x545af1(InputProjectCode,{'pagePath':_0x1c5147,'onSubmit':_0x315a2c}),_0x88daa1&&_0x38cbde?a1_0x25eecd(Box,{'marginTop':0x1,'children':[a1_0x545af1(Box,{'width':'4'}),a1_0x545af1(Text,{'children':_0x83fc25(0x10a)})]}):null,_0x435aa4?a1_0x25eecd(a1_0x1413db,{'children':[a1_0x545af1(Box,{'marginTop':0x1,'children':a1_0x545af1(Text,{'color':_0x83fc25(0x101),'children':_0x83fc25(0xf8)})}),a1_0x25eecd(Box,{'children':[a1_0x545af1(Text,{'color':_0x83fc25(0x101),'children':_0x83fc25(0x109)}),a1_0x545af1(Text,{'color':_0x83fc25(0xec),'children':_0x374035})]}),a1_0x25eecd(Box,{'children':[a1_0x545af1(Text,{'color':_0x83fc25(0x101),'children':'\x20*\x20路由地址:\x20'}),a1_0x25eecd(Text,{'color':_0x83fc25(0xec),'children':['/',_0x88daa1]})]}),a1_0x545af1(Box,{'marginTop':0x1,'children':a1_0x545af1(Text,{'color':'cyan','children':'\x20*\x20页面文件已创建,可直接通过路由访问'})})]}):null]});return a1_0x545af1(SelectPageTemplate,{'onSelect':_0xb5fae3});};
@@ -1 +1 @@
1
- function a2_0x4c74(_0x23d20b,_0x27917a){const _0x14b239=a2_0x14b2();return a2_0x4c74=function(_0x4c74dc,_0x51f9eb){_0x4c74dc=_0x4c74dc-0x91;let _0x1a379c=_0x14b239[_0x4c74dc];return _0x1a379c;},a2_0x4c74(_0x23d20b,_0x27917a);}(function(_0x29b899,_0x179bbb){const _0x461542=a2_0x4c74,_0x2d0139=_0x29b899();while(!![]){try{const _0x4275a3=parseInt(_0x461542(0x94))/0x1*(-parseInt(_0x461542(0xa1))/0x2)+-parseInt(_0x461542(0x91))/0x3*(parseInt(_0x461542(0xae))/0x4)+parseInt(_0x461542(0x9f))/0x5*(-parseInt(_0x461542(0xab))/0x6)+-parseInt(_0x461542(0x98))/0x7+-parseInt(_0x461542(0xac))/0x8+parseInt(_0x461542(0xa2))/0x9*(parseInt(_0x461542(0x95))/0xa)+parseInt(_0x461542(0x9a))/0xb;if(_0x4275a3===_0x179bbb)break;else _0x2d0139['push'](_0x2d0139['shift']());}catch(_0x111dc6){_0x2d0139['push'](_0x2d0139['shift']());}}}(a2_0x14b2,0x70120));import{jsx as a2_0x4c3f1a,jsxs as a2_0x1fccb0}from'react/jsx-runtime';import{useState,useEffect}from'react';import{Text,Box,useInput}from'ink';import{readdir}from'node:fs/promises';import a2_0xbd6f9c from'node:path';function a2_0x14b2(){const _0x409b2f=['402XiMfGH','label','return','28703aKghPK','25140EHynMS','length','gray','4116168tAHLoB','name','23993684ehLgSa','\x20Step1:\x20','请选择您要创建的页面模板','blank','localeCompare','5ekKpYk','column','58fhfUiR','1134YHIAYg','\x20\x20\x20\x20\x20\x20>\x20','获取模板列表失败:','isDirectory','dirname','onSelect','url','正在加载页面模板...','map','1340796wggkqm','2664392GTEJEj','green','1852LtxyXn'];a2_0x14b2=function(){return _0x409b2f;};return a2_0x14b2();}import{fileURLToPath}from'node:url';async function getTemplateList(){const _0x2fdc59=a2_0x4c74;try{const _0x1b49de=fileURLToPath(import.meta[_0x2fdc59(0xa8)]),_0x333a2a=a2_0xbd6f9c['resolve'](a2_0xbd6f9c[_0x2fdc59(0xa6)](_0x1b49de),'../..'),_0xcf8082=a2_0xbd6f9c['join'](_0x333a2a,'templates/pages'),_0x5a14e7=await readdir(_0xcf8082,{'withFileTypes':!![]}),_0x1b0bbd=_0x5a14e7['filter'](_0x3d10c5=>_0x3d10c5[_0x2fdc59(0xa5)]())[_0x2fdc59(0xaa)](_0x20ce99=>({'label':_0x20ce99[_0x2fdc59(0x99)]}))['sort']((_0x46695a,_0x5acc63)=>_0x46695a[_0x2fdc59(0x92)][_0x2fdc59(0x9e)](_0x5acc63[_0x2fdc59(0x92)]));return _0x1b0bbd;}catch(_0x838049){return console['error'](_0x2fdc59(0xa4),_0x838049),[{'label':_0x2fdc59(0x9d)},{'label':'sdk-fetch'}];}}export function SelectPageTemplate(_0x197a6c){const _0x4df371=a2_0x4c74,[_0x58ca59,_0x32f8d1]=useState(0x0),[_0x333965,_0x314e97]=useState([]),[_0x52bdbd,_0x331612]=useState(!![]);useEffect(()=>{async function _0x1c915d(){const _0x68f719=await getTemplateList();_0x314e97(_0x68f719),_0x331612(![]);}_0x1c915d();},[]),useInput((_0x931bce,_0x56cffc)=>{const _0x44cdd3=a2_0x4c74;if(_0x52bdbd)return;if(_0x56cffc[_0x44cdd3(0x93)]){const _0x33460e=_0x333965[_0x58ca59];_0x33460e&&_0x197a6c[_0x44cdd3(0xa7)](_0x33460e[_0x44cdd3(0x92)]);}_0x56cffc['upArrow']&&_0x32f8d1(_0x18f882=>_0x18f882===0x0?_0x333965['length']-0x1:_0x18f882-0x1),_0x56cffc['downArrow']&&_0x32f8d1(_0x47ec8a=>_0x47ec8a===_0x333965[_0x44cdd3(0x96)]-0x1?0x0:_0x47ec8a+0x1);});if(_0x52bdbd)return a2_0x4c3f1a(Box,{'flexDirection':_0x4df371(0xa0),'paddingY':0x1,'children':a2_0x1fccb0(Box,{'children':[a2_0x4c3f1a(Text,{'color':_0x4df371(0x97),'children':'\x20Step1:\x20'}),a2_0x4c3f1a(Text,{'children':_0x4df371(0xa9)})]})});return a2_0x1fccb0(Box,{'flexDirection':_0x4df371(0xa0),'paddingY':0x1,'children':[a2_0x1fccb0(Box,{'children':[a2_0x4c3f1a(Text,{'color':_0x4df371(0x97),'children':_0x4df371(0x9b)}),a2_0x4c3f1a(Text,{'children':_0x4df371(0x9c)})]}),_0x333965[_0x4df371(0xaa)]((_0x24fec3,_0x2a73cd)=>{const _0x44e685=_0x4df371,_0x49e0a3=_0x2a73cd===_0x58ca59,_0x3d6fcf=_0x49e0a3?_0x44e685(0xa3)+_0x24fec3[_0x44e685(0x92)]:'\x20\x20\x20\x20\x20\x20\x20\x20'+_0x24fec3[_0x44e685(0x92)];return a2_0x4c3f1a(Box,{'children':a2_0x4c3f1a(Text,{'color':_0x49e0a3?_0x44e685(0xad):undefined,'children':_0x3d6fcf})},_0x3d6fcf);})]});}
1
+ (function(_0x349bd6,_0x183824){const _0x248ff9=a2_0x1e4d,_0x4e5aab=_0x349bd6();while(!![]){try{const _0x129e38=parseInt(_0x248ff9(0x103))/0x1+-parseInt(_0x248ff9(0x104))/0x2+-parseInt(_0x248ff9(0x112))/0x3*(-parseInt(_0x248ff9(0x10e))/0x4)+-parseInt(_0x248ff9(0x100))/0x5+parseInt(_0x248ff9(0xfe))/0x6+parseInt(_0x248ff9(0x107))/0x7+-parseInt(_0x248ff9(0xfd))/0x8;if(_0x129e38===_0x183824)break;else _0x4e5aab['push'](_0x4e5aab['shift']());}catch(_0x5f5247){_0x4e5aab['push'](_0x4e5aab['shift']());}}}(a2_0x506e,0xcb394));import{jsx as a2_0x41c266,jsxs as a2_0x48d44d}from'react/jsx-runtime';import{useState,useEffect}from'react';function a2_0x506e(){const _0x540a73=['dirname','localeCompare','filter','green','gray','18962280SaoMpp','1927848wKRIgZ','../..','4205470AYJijc','upArrow','map','1303213vyRRtj','950686Mlhdrs','onSelect','请选择您要创建的页面模板','10663492BPiLJr','url','column','sort','templates/pages','\x20\x20\x20\x20\x20\x20>\x20','\x20Step1:\x20','32076NosUnf','isDirectory','label','name','513SELMor'];a2_0x506e=function(){return _0x540a73;};return a2_0x506e();}function a2_0x1e4d(_0x51cfa3,_0x58e821){const _0x506e50=a2_0x506e();return a2_0x1e4d=function(_0x1e4d92,_0x1ed53e){_0x1e4d92=_0x1e4d92-0xfc;let _0x3e3ad0=_0x506e50[_0x1e4d92];return _0x3e3ad0;},a2_0x1e4d(_0x51cfa3,_0x58e821);}import{Text,Box,useInput}from'ink';import{readdir}from'node:fs/promises';import a2_0x1c489b from'node:path';import{fileURLToPath}from'node:url';async function getTemplateList(){const _0x135c90=a2_0x1e4d;try{const _0x2b6b50=fileURLToPath(import.meta[_0x135c90(0x108)]),_0x218da9=a2_0x1c489b['resolve'](a2_0x1c489b[_0x135c90(0x113)](_0x2b6b50),_0x135c90(0xff)),_0x5cbd3b=a2_0x1c489b['join'](_0x218da9,_0x135c90(0x10b)),_0x1efd5e=await readdir(_0x5cbd3b,{'withFileTypes':!![]}),_0xe17355=_0x1efd5e[_0x135c90(0x115)](_0x7751e7=>_0x7751e7[_0x135c90(0x10f)]())[_0x135c90(0x102)](_0x1aad8e=>({'label':_0x1aad8e[_0x135c90(0x111)]}))[_0x135c90(0x10a)]((_0x2e2650,_0x537d9b)=>_0x2e2650[_0x135c90(0x110)][_0x135c90(0x114)](_0x537d9b[_0x135c90(0x110)]));return _0xe17355;}catch(_0x3a3611){return console['error']('获取模板列表失败:',_0x3a3611),[{'label':'blank'},{'label':'sdk-fetch'}];}}export function SelectPageTemplate(_0x1193cd){const _0x295d7f=a2_0x1e4d,[_0x4008fe,_0x17373c]=useState(0x0),[_0x2dd00b,_0x37767f]=useState([]),[_0x5f3f8a,_0x579051]=useState(!![]);useEffect(()=>{async function _0x504e6d(){const _0xf5c1bf=await getTemplateList();_0x37767f(_0xf5c1bf),_0x579051(![]);}_0x504e6d();},[]),useInput((_0x1dbb73,_0xea06f9)=>{const _0x3361ba=a2_0x1e4d;if(_0x5f3f8a)return;if(_0xea06f9['return']){const _0x48faf7=_0x2dd00b[_0x4008fe];_0x48faf7&&_0x1193cd[_0x3361ba(0x105)](_0x48faf7[_0x3361ba(0x110)]);}_0xea06f9[_0x3361ba(0x101)]&&_0x17373c(_0x1880a6=>_0x1880a6===0x0?_0x2dd00b['length']-0x1:_0x1880a6-0x1),_0xea06f9['downArrow']&&_0x17373c(_0x1bc9fd=>_0x1bc9fd===_0x2dd00b['length']-0x1?0x0:_0x1bc9fd+0x1);});if(_0x5f3f8a)return a2_0x41c266(Box,{'flexDirection':_0x295d7f(0x109),'paddingY':0x1,'children':a2_0x48d44d(Box,{'children':[a2_0x41c266(Text,{'color':_0x295d7f(0xfc),'children':'\x20Step1:\x20'}),a2_0x41c266(Text,{'children':'正在加载页面模板...'})]})});return a2_0x48d44d(Box,{'flexDirection':_0x295d7f(0x109),'paddingY':0x1,'children':[a2_0x48d44d(Box,{'children':[a2_0x41c266(Text,{'color':_0x295d7f(0xfc),'children':_0x295d7f(0x10d)}),a2_0x41c266(Text,{'children':_0x295d7f(0x106)})]}),_0x2dd00b[_0x295d7f(0x102)]((_0x4b1578,_0x4a9c60)=>{const _0x36d438=_0x295d7f,_0x48a0a8=_0x4a9c60===_0x4008fe,_0x3eefc1=_0x48a0a8?_0x36d438(0x10c)+_0x4b1578[_0x36d438(0x110)]:'\x20\x20\x20\x20\x20\x20\x20\x20'+_0x4b1578[_0x36d438(0x110)];return a2_0x41c266(Box,{'children':a2_0x41c266(Text,{'color':_0x48a0a8?_0x36d438(0x116):undefined,'children':_0x3eefc1})},_0x3eefc1);})]});}
@@ -1 +1 @@
1
- (function(_0x4801f7,_0x277726){const _0x162b77=a3_0x5332,_0x3cfaec=_0x4801f7();while(!![]){try{const _0x39c819=parseInt(_0x162b77(0x1f7))/0x1*(-parseInt(_0x162b77(0x1e5))/0x2)+-parseInt(_0x162b77(0x1d3))/0x3+-parseInt(_0x162b77(0x1d7))/0x4*(-parseInt(_0x162b77(0x1f5))/0x5)+-parseInt(_0x162b77(0x1f9))/0x6+parseInt(_0x162b77(0x1e0))/0x7*(-parseInt(_0x162b77(0x1e1))/0x8)+-parseInt(_0x162b77(0x1f0))/0x9*(parseInt(_0x162b77(0x1c1))/0xa)+parseInt(_0x162b77(0x1e9))/0xb*(parseInt(_0x162b77(0x1d0))/0xc);if(_0x39c819===_0x277726)break;else _0x3cfaec['push'](_0x3cfaec['shift']());}catch(_0x5d80f5){_0x3cfaec['push'](_0x3cfaec['shift']());}}}(a3_0x394d,0xdaa5b));import{jsx as a3_0x46b730,jsxs as a3_0x1ecaca}from'react/jsx-runtime';function a3_0x394d(){const _0x5b1307=['status','5822766NETjkS','6326730MtLkcU','未提供应用AppCode,且配置中也没有默认值','{\x20lovrabetClient\x20}','使用配置的应用AppCode:\x20','client','-client','json','join','success','yellow','import\x20','data','url','message','includes','3254568sbitjp','获取数据集失败,HTTP状态码:\x20','tableData','4103541FTOVqI','split','cyan','gray','4PVbJGp','💡\x20请使用\x20','登录鉴权失败,登录已过期,请使用\x20lovrabet\x20auth\x20重新登录','\x20重新登录后再试','\x20-\x20客户端实例文件','white','replace','拉取\x20API\x20配置失败:\x20','*\x20导入方式:','42077iYoZUR','664lZbBya','.ts','src/api/','\x20-\x20模型配置文件','2276HrfZEk','slice','-api','/smartapi/dataset/getList?appCode=','121mLdCLP','api-pull','setLogPath','column','green','\x20和\x20','app','9OOAgPH','red','cwd','error','dim','7377175agkqRc','√\x20API\x20文件生成成功!','82LkNRev'];a3_0x394d=function(){return _0x5b1307;};return a3_0x394d();}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{generateApiFile}from'./generate-api-file.js';function a3_0x5332(_0x3c4c34,_0x1c03c7){const _0x394d51=a3_0x394d();return a3_0x5332=function(_0x533292,_0xbf221d){_0x533292=_0x533292-0x1c1;let _0x13986d=_0x394d51[_0x533292];return _0x13986d;},a3_0x5332(_0x3c4c34,_0x1c03c7);}import{logger}from'../utils/logger.js';export const ApiPullUI=({appCode:_0x17b78a})=>{const _0x3310ac=a3_0x5332,{exit:_0x1cad31}=useApp(),[_0x4eceed,_0x509d4b]=useState(![]),[_0x48e487,_0x58bacb]=useState(![]),[_0x56c7f5,_0x5e8f31]=useState(null),[_0x530ea2,_0x3fe961]=useState(null),_0x17c31c=readConfig(),_0xb4903c=_0x17b78a||_0x17c31c?.[_0x3310ac(0x1ef)],_0x33b3b5=_0x17b78a&&_0x17b78a['includes']('-')?_0x17b78a[_0x3310ac(0x1d4)]('-')[_0x3310ac(0x1e6)](0x1)[_0x3310ac(0x1c8)]('-'):'',_0x4c6de3=_0x17b78a?'使用指定的应用AppCode:\x20'+_0xb4903c:_0x3310ac(0x1c4)+_0xb4903c,_0x384868=_0x33b3b5?_0x33b3b5+_0x3310ac(0x1e7):'api',_0x533179=_0x33b3b5?_0x33b3b5+_0x3310ac(0x1c6):_0x3310ac(0x1c5);useEffect(()=>{_0x509d4b(!![]),_0x2fdae5();},[]),useEffect(()=>{(_0x48e487||_0x56c7f5)&&_0x1cad31();},[_0x48e487,_0x56c7f5,_0x1cad31]);async function _0x2fdae5(){const _0x2688fc=_0x3310ac;if(!_0xb4903c){_0x5e8f31(_0x2688fc(0x1c2));return;}try{logger[_0x2688fc(0x1eb)](process[_0x2688fc(0x1f2)]());const _0x53fb25=await fetch(getApiDomain()+_0x2688fc(0x1e8)+_0xb4903c+'&pageSize=999&currentPage=1',{'headers':{'Cookie':getCookie()}});if(_0x53fb25['ok']){const _0x3dae44=await _0x53fb25[_0x2688fc(0x1c7)]();if(_0x3dae44[_0x2688fc(0x1c9)]){const _0x2ae3ca=!_0x17b78a;await generateApiFile(_0x3dae44[_0x2688fc(0x1cc)][_0x2688fc(0x1d2)],_0x33b3b5,_0xb4903c,_0x2ae3ca),_0x3fe961({'api':'src/api/'+_0x384868+_0x2688fc(0x1e2),'client':_0x2688fc(0x1e3)+_0x533179+_0x2688fc(0x1e2)}),_0x58bacb(!![]);}}else{if(_0x53fb25[_0x2688fc(0x1f8)]===0x191){const _0x1ab6ff=_0x2688fc(0x1d9);logger[_0x2688fc(0x1f3)]('api-pull',_0x1ab6ff,{'status':_0x53fb25[_0x2688fc(0x1f8)],'appCode':_0xb4903c,'url':_0x53fb25['url']}),_0x5e8f31(_0x1ab6ff);}else{const _0x4f8b18=_0x2688fc(0x1d1)+_0x53fb25[_0x2688fc(0x1f8)];try{const _0x308ee1=await _0x53fb25['text']();_0x308ee1?logger['error'](_0x2688fc(0x1ea),_0x4f8b18,{'status':_0x53fb25['status'],'appCode':_0xb4903c,'url':_0x53fb25[_0x2688fc(0x1cd)],'errorBody':_0x308ee1}):logger[_0x2688fc(0x1f3)]('api-pull',_0x4f8b18,{'status':_0x53fb25[_0x2688fc(0x1f8)],'appCode':_0xb4903c,'url':_0x53fb25[_0x2688fc(0x1cd)]});}catch(_0x45e564){logger[_0x2688fc(0x1f3)]('api-pull',_0x4f8b18+',且无法读取错误响应内容',{'status':_0x53fb25[_0x2688fc(0x1f8)],'appCode':_0xb4903c,'url':_0x53fb25[_0x2688fc(0x1cd)],'readError':_0x45e564 instanceof Error?_0x45e564[_0x2688fc(0x1ce)]:String(_0x45e564)});}_0x5e8f31(_0x4f8b18);}}}catch(_0x1bdca8){const _0x5e72b7=_0x1bdca8 instanceof Error?_0x1bdca8[_0x2688fc(0x1ce)]:String(_0x1bdca8);_0x5e8f31(_0x2688fc(0x1de)+_0x5e72b7);}finally{_0x509d4b(![]);}}return a3_0x1ecaca(Box,{'flexDirection':_0x3310ac(0x1ec),'children':[a3_0x1ecaca(Box,{'children':[a3_0x46b730(Text,{'color':_0x3310ac(0x1d6),'children':'*\x20'}),a3_0x46b730(Text,{'color':_0x17b78a?_0x3310ac(0x1dc):_0x3310ac(0x1f4),'children':_0x4c6de3})]}),a3_0x1ecaca(Box,{'children':[a3_0x46b730(Text,{'color':_0x3310ac(0x1d6),'children':'*\x20将生成文件:\x20'}),a3_0x1ecaca(Text,{'color':_0x3310ac(0x1d5),'children':[_0x384868,_0x3310ac(0x1e2)]}),a3_0x46b730(Text,{'color':_0x3310ac(0x1f4),'children':_0x3310ac(0x1ee)}),a3_0x1ecaca(Text,{'color':_0x3310ac(0x1d5),'children':[_0x533179,_0x3310ac(0x1e2)]})]}),_0x4eceed&&a3_0x46b730(Box,{'children':a3_0x46b730(Text,{'children':'🚀\x20正在从服务器拉取\x20API\x20配置...'})}),_0x48e487&&_0x530ea2&&a3_0x1ecaca(Box,{'flexDirection':_0x3310ac(0x1ec),'children':[a3_0x46b730(Box,{'children':a3_0x46b730(Text,{'color':_0x3310ac(0x1ed),'children':_0x3310ac(0x1f6)})}),a3_0x46b730(Box,{'marginTop':0x1,'children':a3_0x46b730(Text,{'color':_0x3310ac(0x1d6),'children':'*\x20已生成文件:'})}),a3_0x1ecaca(Box,{'marginLeft':0x2,'children':[a3_0x1ecaca(Text,{'color':_0x3310ac(0x1d5),'children':['•\x20',_0x530ea2['api']]}),a3_0x46b730(Text,{'color':'dim','children':_0x3310ac(0x1e4)})]}),a3_0x1ecaca(Box,{'marginLeft':0x2,'children':[a3_0x1ecaca(Text,{'color':_0x3310ac(0x1d5),'children':['•\x20',_0x530ea2['client']]}),a3_0x46b730(Text,{'color':_0x3310ac(0x1f4),'children':_0x3310ac(0x1db)})]}),a3_0x46b730(Box,{'marginTop':0x1,'children':a3_0x46b730(Text,{'color':_0x3310ac(0x1d6),'children':_0x3310ac(0x1df)})}),a3_0x46b730(Box,{'marginLeft':0x2,'children':a3_0x1ecaca(Text,{'color':_0x3310ac(0x1ca),'children':[_0x3310ac(0x1cb),_0x3310ac(0x1c3),'\x20from\x20\x27@/api/',_0x530ea2[_0x3310ac(0x1c5)][_0x3310ac(0x1dd)](_0x3310ac(0x1e3),'')[_0x3310ac(0x1dd)]('.ts',''),'\x27']})})]}),_0x56c7f5&&a3_0x1ecaca(Box,{'flexDirection':_0x3310ac(0x1ec),'children':[a3_0x46b730(Box,{'children':a3_0x1ecaca(Text,{'color':_0x3310ac(0x1f1),'children':['❌\x20',_0x56c7f5]})}),_0x56c7f5[_0x3310ac(0x1cf)]('登录')&&a3_0x1ecaca(Box,{'marginTop':0x1,'children':[a3_0x46b730(Text,{'color':'yellow','children':_0x3310ac(0x1d8)}),a3_0x46b730(Text,{'color':_0x3310ac(0x1d5),'children':'lovrabet\x20auth'}),a3_0x46b730(Text,{'color':'yellow','children':_0x3310ac(0x1da)})]})]})]});};
1
+ (function(_0x3e51d9,_0x292591){const _0x26da7f=a3_0x57fd,_0x4cf0cd=_0x3e51d9();while(!![]){try{const _0x507b0e=parseInt(_0x26da7f(0x1a6))/0x1+-parseInt(_0x26da7f(0x194))/0x2+parseInt(_0x26da7f(0x193))/0x3*(-parseInt(_0x26da7f(0x18c))/0x4)+parseInt(_0x26da7f(0x1b4))/0x5*(parseInt(_0x26da7f(0x1a4))/0x6)+-parseInt(_0x26da7f(0x1be))/0x7+-parseInt(_0x26da7f(0x1bb))/0x8*(parseInt(_0x26da7f(0x1a3))/0x9)+parseInt(_0x26da7f(0x1a0))/0xa;if(_0x507b0e===_0x292591)break;else _0x4cf0cd['push'](_0x4cf0cd['shift']());}catch(_0x188f9a){_0x4cf0cd['push'](_0x4cf0cd['shift']());}}}(a3_0x3b05,0x7d988));import{jsx as a3_0x21fe80,jsxs as a3_0x40f07a}from'react/jsx-runtime';function a3_0x57fd(_0x449937,_0x22c2cd){const _0x3b0516=a3_0x3b05();return a3_0x57fd=function(_0x57fd46,_0x453da2){_0x57fd46=_0x57fd46-0x189;let _0x4e0197=_0x3b0516[_0x57fd46];return _0x4e0197;},a3_0x57fd(_0x449937,_0x22c2cd);}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{generateApiFile}from'./generate-api-file.js';import{logger}from'../utils/logger.js';export const ApiPullUI=({appCode:_0x4f4930})=>{const _0x4b66cf=a3_0x57fd,{exit:_0x1cbd26}=useApp(),[_0x1d4152,_0x33a6d0]=useState(![]),[_0x4452e7,_0x16cd99]=useState(![]),[_0x1abec5,_0x106752]=useState(null),[_0x36a0ee,_0x367ea2]=useState(null),_0x438f84=readConfig(),_0xe5972e=_0x4f4930||_0x438f84?.[_0x4b66cf(0x199)],_0x243f3b=_0x4f4930&&_0x4f4930[_0x4b66cf(0x195)]('-')?_0x4f4930[_0x4b66cf(0x192)]('-')[_0x4b66cf(0x1bd)](0x1)[_0x4b66cf(0x1b2)]('-'):'',_0x566b27=_0x4f4930?_0x4b66cf(0x1a2)+_0xe5972e:_0x4b66cf(0x1af)+_0xe5972e,_0x1c508e=_0x243f3b?_0x243f3b+_0x4b66cf(0x18f):_0x4b66cf(0x198),_0xfe1eca=_0x243f3b?_0x243f3b+'-client':_0x4b66cf(0x191);useEffect(()=>{_0x33a6d0(!![]),_0x13d013();},[]),useEffect(()=>{(_0x4452e7||_0x1abec5)&&_0x1cbd26();},[_0x4452e7,_0x1abec5,_0x1cbd26]);async function _0x13d013(){const _0x47c81b=_0x4b66cf;if(!_0xe5972e){_0x106752('未提供应用AppCode,且配置中也没有默认值');return;}try{logger[_0x47c81b(0x190)](process['cwd']());const _0xdf4b93=await fetch(getApiDomain()+'/smartapi/dataset/getList?appCode='+_0xe5972e+_0x47c81b(0x19a),{'headers':{'Cookie':getCookie()}});if(_0xdf4b93['ok']){const _0x5d8576=await _0xdf4b93[_0x47c81b(0x1ae)]();if(_0x5d8576[_0x47c81b(0x1a5)]){const _0x137a3c=!_0x4f4930;await generateApiFile(_0x5d8576[_0x47c81b(0x1b6)][_0x47c81b(0x1b1)],_0x243f3b,_0xe5972e,_0x137a3c),_0x367ea2({'api':'src/api/'+_0x1c508e+_0x47c81b(0x18a),'client':_0x47c81b(0x1b9)+_0xfe1eca+_0x47c81b(0x18a)}),_0x16cd99(!![]);}}else{if(_0xdf4b93[_0x47c81b(0x18d)]===0x191){const _0x1022d0=_0x47c81b(0x1ba);logger[_0x47c81b(0x1b5)](_0x47c81b(0x1ad),_0x1022d0,{'status':_0xdf4b93['status'],'appCode':_0xe5972e,'url':_0xdf4b93[_0x47c81b(0x1b3)]}),_0x106752(_0x1022d0);}else{const _0x4ea052=_0x47c81b(0x1c1)+_0xdf4b93['status'];try{const _0x203c2d=await _0xdf4b93[_0x47c81b(0x1a9)]();_0x203c2d?logger[_0x47c81b(0x1b5)]('api-pull',_0x4ea052,{'status':_0xdf4b93[_0x47c81b(0x18d)],'appCode':_0xe5972e,'url':_0xdf4b93[_0x47c81b(0x1b3)],'errorBody':_0x203c2d}):logger[_0x47c81b(0x1b5)](_0x47c81b(0x1ad),_0x4ea052,{'status':_0xdf4b93[_0x47c81b(0x18d)],'appCode':_0xe5972e,'url':_0xdf4b93[_0x47c81b(0x1b3)]});}catch(_0x46f901){logger['error'](_0x47c81b(0x1ad),_0x4ea052+_0x47c81b(0x1a1),{'status':_0xdf4b93[_0x47c81b(0x18d)],'appCode':_0xe5972e,'url':_0xdf4b93[_0x47c81b(0x1b3)],'readError':_0x46f901 instanceof Error?_0x46f901[_0x47c81b(0x19d)]:String(_0x46f901)});}_0x106752(_0x4ea052);}}}catch(_0x5e47e7){const _0x305f20=_0x5e47e7 instanceof Error?_0x5e47e7[_0x47c81b(0x19d)]:String(_0x5e47e7);_0x106752(_0x47c81b(0x1bf)+_0x305f20);}finally{_0x33a6d0(![]);}}return a3_0x40f07a(Box,{'flexDirection':'column','children':[a3_0x40f07a(Box,{'children':[a3_0x21fe80(Text,{'color':_0x4b66cf(0x1aa),'children':'*\x20'}),a3_0x21fe80(Text,{'color':_0x4f4930?'white':_0x4b66cf(0x1b7),'children':_0x566b27})]}),a3_0x40f07a(Box,{'children':[a3_0x21fe80(Text,{'color':_0x4b66cf(0x1aa),'children':_0x4b66cf(0x1b0)}),a3_0x40f07a(Text,{'color':'cyan','children':[_0x1c508e,_0x4b66cf(0x18a)]}),a3_0x21fe80(Text,{'color':'dim','children':_0x4b66cf(0x19c)}),a3_0x40f07a(Text,{'color':_0x4b66cf(0x196),'children':[_0xfe1eca,_0x4b66cf(0x18a)]})]}),_0x1d4152&&a3_0x21fe80(Box,{'children':a3_0x21fe80(Text,{'children':_0x4b66cf(0x1bc)})}),_0x4452e7&&_0x36a0ee&&a3_0x40f07a(Box,{'flexDirection':_0x4b66cf(0x1a7),'children':[a3_0x21fe80(Box,{'children':a3_0x21fe80(Text,{'color':_0x4b66cf(0x19e),'children':'√\x20API\x20文件生成成功!'})}),a3_0x21fe80(Box,{'marginTop':0x1,'children':a3_0x21fe80(Text,{'color':_0x4b66cf(0x1aa),'children':_0x4b66cf(0x189)})}),a3_0x40f07a(Box,{'marginLeft':0x2,'children':[a3_0x40f07a(Text,{'color':'cyan','children':['•\x20',_0x36a0ee[_0x4b66cf(0x198)]]}),a3_0x21fe80(Text,{'color':_0x4b66cf(0x1b7),'children':_0x4b66cf(0x19f)})]}),a3_0x40f07a(Box,{'marginLeft':0x2,'children':[a3_0x40f07a(Text,{'color':_0x4b66cf(0x196),'children':['•\x20',_0x36a0ee[_0x4b66cf(0x191)]]}),a3_0x21fe80(Text,{'color':_0x4b66cf(0x1b7),'children':_0x4b66cf(0x1c2)})]}),a3_0x21fe80(Box,{'marginTop':0x1,'children':a3_0x21fe80(Text,{'color':_0x4b66cf(0x1aa),'children':_0x4b66cf(0x1ac)})}),a3_0x21fe80(Box,{'marginLeft':0x2,'children':a3_0x40f07a(Text,{'color':'yellow','children':[_0x4b66cf(0x18b),_0x4b66cf(0x1b8),_0x4b66cf(0x197),_0x36a0ee[_0x4b66cf(0x191)]['replace'](_0x4b66cf(0x1b9),'')[_0x4b66cf(0x19b)]('.ts',''),'\x27']})})]}),_0x1abec5&&a3_0x40f07a(Box,{'flexDirection':_0x4b66cf(0x1a7),'children':[a3_0x21fe80(Box,{'children':a3_0x40f07a(Text,{'color':_0x4b66cf(0x1a8),'children':['❌\x20',_0x1abec5]})}),_0x1abec5[_0x4b66cf(0x195)]('登录')&&a3_0x40f07a(Box,{'marginTop':0x1,'children':[a3_0x21fe80(Text,{'color':_0x4b66cf(0x18e),'children':_0x4b66cf(0x1ab)}),a3_0x21fe80(Text,{'color':_0x4b66cf(0x196),'children':_0x4b66cf(0x1c0)}),a3_0x21fe80(Text,{'color':_0x4b66cf(0x18e),'children':'\x20重新登录后再试'})]})]})]});};function a3_0x3b05(){const _0x1e92e0=['4376CVoOQZ','🚀\x20正在从服务器拉取\x20API\x20配置...','slice','2679334lYeAKe','拉取\x20API\x20配置失败:\x20','lovrabet\x20auth','获取数据集失败,HTTP状态码:\x20','\x20-\x20客户端实例文件','*\x20已生成文件:','.ts','import\x20','52BUTuYA','status','yellow','-api','setLogPath','client','split','88218NHGhSH','1402048XEldQG','includes','cyan','\x20from\x20\x27@/api/','api','app','&pageSize=999&currentPage=1','replace','\x20和\x20','message','green','\x20-\x20模型配置文件','15923490xjreKK',',且无法读取错误响应内容','使用指定的应用AppCode:\x20','3420ANdHOu','735294ehPRXP','success','350917rurSfB','column','red','text','gray','💡\x20请使用\x20','*\x20导入方式:','api-pull','json','使用配置的应用AppCode:\x20','*\x20将生成文件:\x20','tableData','join','url','10kNiYYf','error','data','dim','{\x20lovrabetClient\x20}','src/api/','登录鉴权失败,登录已过期,请使用\x20lovrabet\x20auth\x20重新登录'];a3_0x3b05=function(){return _0x1e92e0;};return a3_0x3b05();}
@@ -1 +1 @@
1
- (function(_0x274a09,_0x5a2ff1){const _0x3a63ec=a4_0x2c03,_0x2bad73=_0x274a09();while(!![]){try{const _0x40ec34=parseInt(_0x3a63ec(0xeb))/0x1*(-parseInt(_0x3a63ec(0xdd))/0x2)+parseInt(_0x3a63ec(0xd2))/0x3+-parseInt(_0x3a63ec(0xdc))/0x4*(parseInt(_0x3a63ec(0xd9))/0x5)+parseInt(_0x3a63ec(0xdb))/0x6*(parseInt(_0x3a63ec(0xe6))/0x7)+-parseInt(_0x3a63ec(0xd1))/0x8*(-parseInt(_0x3a63ec(0xd6))/0x9)+-parseInt(_0x3a63ec(0xd0))/0xa+parseInt(_0x3a63ec(0xe9))/0xb;if(_0x40ec34===_0x5a2ff1)break;else _0x2bad73['push'](_0x2bad73['shift']());}catch(_0x2ddfae){_0x2bad73['push'](_0x2bad73['shift']());}}}(a4_0x11f2,0xa2f9a));function a4_0x11f2(){const _0x3d54a3=['values','replace','code','21DiYSPE','dataset_','filter','17107013mYmSJe','name','614683rhFNgA','12885710Bnrbzo','8whUYNd','2796588FSWUaq','trim','Api','set','7817436oRZcpP','dbtableConfig','map','4075985YTATgG','dataset','1289394CtChiQ','4POWhAg','4zpHzhV','allFields','tableName','forEach','split','pkField'];a4_0x11f2=function(){return _0x3d54a3;};return a4_0x11f2();}function a4_0x2c03(_0x11593a,_0x15e510){const _0x11f25b=a4_0x11f2();return a4_0x2c03=function(_0x2c0338,_0x4e02c8){_0x2c0338=_0x2c0338-0xd0;let _0x3fd674=_0x11f25b[_0x2c0338];return _0x3fd674;},a4_0x2c03(_0x11593a,_0x15e510);}export function formatDataset(_0x248581){const _0x286b91=a4_0x2c03,_0x37a3e6=_0x248581[_0x286b91(0xe8)](_0x5dc6f6=>_0x5dc6f6[_0x286b91(0xd7)]),_0x1be928=_0x248581[_0x286b91(0xe8)](_0x11a100=>!_0x11a100[_0x286b91(0xd7)]),_0x521efe=new Map();_0x37a3e6[_0x286b91(0xe0)](_0x493bdc=>{const _0x260958=_0x286b91,_0x76b1a7=_0x493bdc[_0x260958(0xd7)][_0x260958(0xdf)],_0x503efc=_0x521efe['get'](_0x76b1a7);(!_0x503efc||_0x493bdc['id']>_0x503efc['id'])&&_0x521efe[_0x260958(0xd5)](_0x76b1a7,_0x493bdc);});const _0x411fa0=Array['from'](_0x521efe[_0x286b91(0xe3)]())['map'](_0x263852=>{const _0x110645=_0x286b91,_0x342618=snakeToCamel(_0x263852['dbtableConfig'][_0x110645(0xdf)]);return{'id':_0x263852['id'],'name':_0x263852[_0x110645(0xea)],'code':_0x263852['code'],'tableName':_0x263852['dbtableConfig'][_0x110645(0xdf)],'apiFucName':_0x342618?_0x342618+'Api':_0x110645(0xda)+_0x263852[_0x110645(0xe5)]+_0x110645(0xd4),'pkField':_0x263852[_0x110645(0xd7)][_0x110645(0xe2)],'allFields':_0x263852[_0x110645(0xd7)][_0x110645(0xde)][_0x110645(0xe1)](',')};}),_0x531545=_0x1be928[_0x286b91(0xd8)](_0x2da737=>{const _0x5dd7b1=_0x286b91,_0x31613e=_0x5dd7b1(0xe7)+_0x2da737[_0x5dd7b1(0xe5)],_0x46b9ff=snakeToCamel(_0x31613e);return{'id':_0x2da737['id'],'name':_0x2da737[_0x5dd7b1(0xea)],'code':_0x2da737[_0x5dd7b1(0xe5)],'tableName':_0x31613e,'apiFucName':_0x46b9ff?_0x46b9ff+_0x5dd7b1(0xd4):_0x5dd7b1(0xda)+_0x2da737[_0x5dd7b1(0xe5)]+_0x5dd7b1(0xd4),'pkField':undefined,'allFields':[]};});return[..._0x411fa0,..._0x531545];}function snakeToCamel(_0x305f5f){const _0x577c1f=a4_0x2c03;if(!_0x305f5f)return _0x305f5f;const _0x253280=_0x305f5f[_0x577c1f(0xd3)]();return _0x253280[_0x577c1f(0xe4)](/_([a-zA-Z0-9])/g,(_0x62258f,_0x47c83b)=>_0x47c83b['toUpperCase']());}
1
+ (function(_0x3db2bc,_0x234080){const _0x55c1b1=a4_0x29bb,_0x5a9dea=_0x3db2bc();while(!![]){try{const _0x51fd75=parseInt(_0x55c1b1(0x1f5))/0x1+-parseInt(_0x55c1b1(0x1f3))/0x2*(parseInt(_0x55c1b1(0x1ed))/0x3)+parseInt(_0x55c1b1(0x1ff))/0x4*(-parseInt(_0x55c1b1(0x1f7))/0x5)+-parseInt(_0x55c1b1(0x1ee))/0x6+-parseInt(_0x55c1b1(0x1fb))/0x7+-parseInt(_0x55c1b1(0x201))/0x8+-parseInt(_0x55c1b1(0x1f0))/0x9*(-parseInt(_0x55c1b1(0x1ea))/0xa);if(_0x51fd75===_0x234080)break;else _0x5a9dea['push'](_0x5a9dea['shift']());}catch(_0x507a5f){_0x5a9dea['push'](_0x5a9dea['shift']());}}}(a4_0xb856,0x746b2));function a4_0x29bb(_0x2c517d,_0x2c188a){const _0xb85620=a4_0xb856();return a4_0x29bb=function(_0x29bb5a,_0x1f689c){_0x29bb5a=_0x29bb5a-0x1ea;let _0x14efe4=_0xb85620[_0x29bb5a];return _0x14efe4;},a4_0x29bb(_0x2c517d,_0x2c188a);}function a4_0xb856(){const _0x5ab3bd=['name','227685hgIecX','split','115UBGwwX','Api','pkField','set','5484815svNDUE','code','dbtableConfig','filter','4204eoHSHa','map','474424IubOPE','dataset','dataset_','values','464980JZOqpc','replace','tableName','129933ZGqvgN','2853684JGURDx','from','459BVeOgb','forEach','trim','36EGhyqe'];a4_0xb856=function(){return _0x5ab3bd;};return a4_0xb856();}export function formatDataset(_0x367cd6){const _0xb26408=a4_0x29bb,_0x47e674=_0x367cd6[_0xb26408(0x1fe)](_0x5b6169=>_0x5b6169['dbtableConfig']),_0x123699=_0x367cd6[_0xb26408(0x1fe)](_0x1713e7=>!_0x1713e7['dbtableConfig']),_0x169f4d=new Map();_0x47e674[_0xb26408(0x1f1)](_0x440c8e=>{const _0x253221=_0xb26408,_0x2fde45=_0x440c8e['dbtableConfig']['tableName'],_0xa599ab=_0x169f4d['get'](_0x2fde45);(!_0xa599ab||_0x440c8e['id']>_0xa599ab['id'])&&_0x169f4d[_0x253221(0x1fa)](_0x2fde45,_0x440c8e);});const _0xf6d0a9=Array[_0xb26408(0x1ef)](_0x169f4d[_0xb26408(0x204)]())['map'](_0x339b27=>{const _0x5e7651=_0xb26408,_0x252c1f=snakeToCamel(_0x339b27['dbtableConfig']['tableName']);return{'id':_0x339b27['id'],'name':_0x339b27[_0x5e7651(0x1f4)],'code':_0x339b27[_0x5e7651(0x1fc)],'tableName':_0x339b27['dbtableConfig'][_0x5e7651(0x1ec)],'apiFucName':_0x252c1f?_0x252c1f+_0x5e7651(0x1f8):_0x5e7651(0x202)+_0x339b27['code']+_0x5e7651(0x1f8),'pkField':_0x339b27[_0x5e7651(0x1fd)][_0x5e7651(0x1f9)],'allFields':_0x339b27[_0x5e7651(0x1fd)]['allFields'][_0x5e7651(0x1f6)](',')};}),_0x2959d1=_0x123699[_0xb26408(0x200)](_0x50be3=>{const _0x1d6dd0=_0xb26408,_0x2a51ca=_0x1d6dd0(0x203)+_0x50be3[_0x1d6dd0(0x1fc)],_0x27ecef=snakeToCamel(_0x2a51ca);return{'id':_0x50be3['id'],'name':_0x50be3[_0x1d6dd0(0x1f4)],'code':_0x50be3[_0x1d6dd0(0x1fc)],'tableName':_0x2a51ca,'apiFucName':_0x27ecef?_0x27ecef+'Api':_0x1d6dd0(0x202)+_0x50be3[_0x1d6dd0(0x1fc)]+'Api','pkField':undefined,'allFields':[]};});return[..._0xf6d0a9,..._0x2959d1];}function snakeToCamel(_0x4acf35){const _0x1b2158=a4_0x29bb;if(!_0x4acf35)return _0x4acf35;const _0x1ae856=_0x4acf35[_0x1b2158(0x1f2)]();return _0x1ae856[_0x1b2158(0x1eb)](/_([a-zA-Z0-9])/g,(_0x32f1ef,_0x381dfc)=>_0x381dfc['toUpperCase']());}
@@ -1 +1 @@
1
- (function(_0x2643b3,_0xaa1196){const _0x2730fc=a5_0x53ff,_0x13e465=_0x2643b3();while(!![]){try{const _0x14e29c=parseInt(_0x2730fc(0x197))/0x1+-parseInt(_0x2730fc(0x19c))/0x2*(parseInt(_0x2730fc(0x1a9))/0x3)+-parseInt(_0x2730fc(0x1aa))/0x4+-parseInt(_0x2730fc(0x185))/0x5+parseInt(_0x2730fc(0x1a5))/0x6+-parseInt(_0x2730fc(0x196))/0x7+parseInt(_0x2730fc(0x1a2))/0x8*(parseInt(_0x2730fc(0x1a6))/0x9);if(_0x14e29c===_0xaa1196)break;else _0x13e465['push'](_0x13e465['shift']());}catch(_0x53b705){_0x13e465['push'](_0x13e465['shift']());}}}(a5_0x5b4a,0xf2219));import a5_0x311b8b from'prettier';import{mkdirSync,writeFileSync,readFileSync}from'node:fs';import a5_0x3a2e0a from'node:path';import{fileURLToPath}from'node:url';function a5_0x53ff(_0xad6412,_0x288315){const _0x5b4a62=a5_0x5b4a();return a5_0x53ff=function(_0x53ff4f,_0x2652a4){_0x53ff4f=_0x53ff4f-0x184;let _0x1fbe57=_0x5b4a62[_0x53ff4f];return _0x1fbe57;},a5_0x53ff(_0xad6412,_0x288315);}import{readConfig}from'../utils/config.js';import{formatDataset}from'./format-dataset.js';import{TemplateReplacer}from'../utils/template-replacer.js';import{logger}from'../utils/logger.js';function a5_0x5b4a(){const _0xb24c28=['dirname','\x20-\x20客户端实例文件','keys','app','src/api/','4376850sPUmXy','*\x20已生成文件:','join','replaceApiContent','*\x20API配置\x20apiConfigName\x20:\x20','init-api','log','.ts','\x20\x20\x20•\x20','\x20个模型)','string','length','format','请先通过\x20`lovrabet\x20config\x20set\x20app\x20<value>`\x20配置应用\x20Code','forEach','typescript','resolve','12498773RCuVRB','1377412HEUPyr','replace','url','-api','utf8','12biOSxo','src/api','-client','api','success','toUpperCase','8nOEoUr','templates/generate-api','charAt','8955486RUDJED','13010283FRnoUr','tableName','api.ts.tpl','212976JgkdOr','947800hZaOzQ'];a5_0x5b4a=function(){return _0xb24c28;};return a5_0x5b4a();}export async function generateApiFile(_0x263702,_0xf422d1='',_0x2a1e6e,_0x4ad875=![]){const _0x48fd3d=a5_0x53ff,_0x1c3b93=readConfig(),_0x5f151c=_0x2a1e6e||_0x1c3b93?.[_0x48fd3d(0x1ae)];if(typeof _0x5f151c!==_0x48fd3d(0x18f)||!_0x5f151c)throw new Error(_0x48fd3d(0x192));const _0x5e471a=_0x4ad875?'CONFIG_NAMES.DEFAULT':'\x22'+_0x5f151c+'\x22',_0x4e4019=_0x4ad875?'':'\x22'+_0x5f151c+'\x22',_0x4181f0=_0xf422d1?_0xf422d1+_0x48fd3d(0x19a):_0x48fd3d(0x19f),_0x3f0854=_0xf422d1?_0xf422d1+_0x48fd3d(0x19e):'client',_0x42dc12=formatDataset(_0x263702),_0x13b55d={};_0x42dc12[_0x48fd3d(0x193)](_0x4de0fd=>{const _0x1c1b75=_0x48fd3d,_0x57e653=_0x4de0fd['apiFucName'][_0x1c1b75(0x198)](/Api$/,''),_0x187f1f=_0x57e653[_0x1c1b75(0x1a4)](0x0)[_0x1c1b75(0x1a1)]()+_0x57e653['slice'](0x1);_0x13b55d[_0x187f1f]={'tableName':_0x4de0fd[_0x1c1b75(0x1a7)],'datasetId':_0x4de0fd['code']};});const _0x373245=fileURLToPath(import.meta[_0x48fd3d(0x199)]),_0xbb2e35=a5_0x3a2e0a[_0x48fd3d(0x195)](a5_0x3a2e0a[_0x48fd3d(0x1ab)](_0x373245),'../..'),_0x2c7299=a5_0x3a2e0a[_0x48fd3d(0x187)](_0xbb2e35,_0x48fd3d(0x1a3)),_0x46db65=a5_0x3a2e0a['join'](_0x2c7299,_0x48fd3d(0x1a8)),_0x1024e=a5_0x3a2e0a[_0x48fd3d(0x187)](_0x2c7299,'client.ts.tpl');mkdirSync(_0x48fd3d(0x19d),{'recursive':!![]});const _0x5963d6=readFileSync(_0x46db65,_0x48fd3d(0x19b)),_0x121ba3=TemplateReplacer[_0x48fd3d(0x188)](_0x5963d6,_0x5f151c,_0x13b55d,Object[_0x48fd3d(0x1ad)](_0x13b55d)[0x0],_0x4181f0,_0x5e471a),_0x5e29ed=await a5_0x311b8b[_0x48fd3d(0x191)](_0x121ba3,{'parser':'typescript'}),_0x33c823='src/api/'+_0x4181f0+_0x48fd3d(0x18c);writeFileSync(_0x33c823,_0x5e29ed,{'encoding':'utf8'});const _0x2e66a7=readFileSync(_0x1024e,_0x48fd3d(0x19b)),_0x3a1a30=TemplateReplacer['replaceApiContent'](_0x2e66a7,_0x5f151c,_0x13b55d,Object[_0x48fd3d(0x1ad)](_0x13b55d)[0x0],_0x4181f0,_0x5e471a,_0x4e4019),_0x1499f0=await a5_0x311b8b[_0x48fd3d(0x191)](_0x3a1a30,{'parser':_0x48fd3d(0x194)}),_0x2b0dca=_0x48fd3d(0x184)+_0x3f0854+_0x48fd3d(0x18c);writeFileSync(_0x2b0dca,_0x1499f0,{'encoding':_0x48fd3d(0x19b)}),logger[_0x48fd3d(0x1a0)](_0x48fd3d(0x18a),'API\x20文件生成成功!'),console[_0x48fd3d(0x18b)](_0x48fd3d(0x186)),console[_0x48fd3d(0x18b)](_0x48fd3d(0x18d)+_0x33c823+'\x20-\x20模型配置文件\x20('+Object[_0x48fd3d(0x1ad)](_0x13b55d)[_0x48fd3d(0x190)]+_0x48fd3d(0x18e)),console[_0x48fd3d(0x18b)](_0x48fd3d(0x18d)+_0x2b0dca+_0x48fd3d(0x1ac)),console[_0x48fd3d(0x18b)](_0x48fd3d(0x189)+_0x5e471a),console[_0x48fd3d(0x18b)]('*\x20可以开始使用:\x20import\x20{\x20lovrabetClient\x20}\x20from\x20\x27@/api/'+_0x3f0854+'\x27');}
1
+ function a5_0x5b4c(){const _0x469896=['apiFucName','1409170GGxwrX','app','5333727DBxyze','slice','toUpperCase','utf8','templates/generate-api','forEach','CONFIG_NAMES.DEFAULT','length','116144uNXihE','replace','log','*\x20可以开始使用:\x20import\x20{\x20lovrabetClient\x20}\x20from\x20\x27@/api/','init-api','6179022aSHzxb','resolve','keys','12XkXiIT','*\x20API配置\x20apiConfigName\x20:\x20','replaceApiContent','1eohByt','\x20\x20\x20•\x20','api.ts.tpl','success','typescript','string','*\x20已生成文件:','src/api','.ts','5457930nTXskn','join','api','-api','code','2466783Hzotfh','format','396220duQcxn','src/api/'];a5_0x5b4c=function(){return _0x469896;};return a5_0x5b4c();}function a5_0x22b1(_0xab5aaa,_0x4b2f21){const _0x5b4c6f=a5_0x5b4c();return a5_0x22b1=function(_0x22b168,_0x54a666){_0x22b168=_0x22b168-0x1d4;let _0x5ec80f=_0x5b4c6f[_0x22b168];return _0x5ec80f;},a5_0x22b1(_0xab5aaa,_0x4b2f21);}(function(_0x551a9e,_0x334417){const _0x16854c=a5_0x22b1,_0x17ac5c=_0x551a9e();while(!![]){try{const _0x93630d=-parseInt(_0x16854c(0x1d9))/0x1*(-parseInt(_0x16854c(0x1ec))/0x2)+-parseInt(_0x16854c(0x1e7))/0x3+-parseInt(_0x16854c(0x1d6))/0x4*(parseInt(_0x16854c(0x1e9))/0x5)+parseInt(_0x16854c(0x1e2))/0x6+parseInt(_0x16854c(0x1ee))/0x7+-parseInt(_0x16854c(0x1f6))/0x8+-parseInt(_0x16854c(0x1fb))/0x9;if(_0x93630d===_0x334417)break;else _0x17ac5c['push'](_0x17ac5c['shift']());}catch(_0x3d2d24){_0x17ac5c['push'](_0x17ac5c['shift']());}}}(a5_0x5b4c,0x962dc));import a5_0x2a9447 from'prettier';import{mkdirSync,writeFileSync,readFileSync}from'node:fs';import a5_0x4cbabb from'node:path';import{fileURLToPath}from'node:url';import{readConfig}from'../utils/config.js';import{formatDataset}from'./format-dataset.js';import{TemplateReplacer}from'../utils/template-replacer.js';import{logger}from'../utils/logger.js';export async function generateApiFile(_0x11813d,_0x253e62='',_0x35bcd2,_0x223ce6=![]){const _0x105c7a=a5_0x22b1,_0x483df6=readConfig(),_0x320ddc=_0x35bcd2||_0x483df6?.[_0x105c7a(0x1ed)];if(typeof _0x320ddc!==_0x105c7a(0x1de)||!_0x320ddc)throw new Error('请先通过\x20`lovrabet\x20config\x20set\x20app\x20<value>`\x20配置应用\x20Code');const _0x31f99f=_0x223ce6?_0x105c7a(0x1f4):'\x22'+_0x320ddc+'\x22',_0xe66ce8=_0x223ce6?'':'\x22'+_0x320ddc+'\x22',_0x27a85f=_0x253e62?_0x253e62+_0x105c7a(0x1e5):_0x105c7a(0x1e4),_0x431b47=_0x253e62?_0x253e62+'-client':'client',_0x3e3009=formatDataset(_0x11813d),_0x584c={};_0x3e3009[_0x105c7a(0x1f3)](_0x3ca7ba=>{const _0x508f39=_0x105c7a,_0x49255f=_0x3ca7ba[_0x508f39(0x1eb)][_0x508f39(0x1f7)](/Api$/,''),_0x356e76=_0x49255f['charAt'](0x0)[_0x508f39(0x1f0)]()+_0x49255f[_0x508f39(0x1ef)](0x1);_0x584c[_0x356e76]={'tableName':_0x3ca7ba['tableName'],'datasetId':_0x3ca7ba[_0x508f39(0x1e6)]};});const _0x1a29f1=fileURLToPath(import.meta['url']),_0x30b12c=a5_0x4cbabb[_0x105c7a(0x1d4)](a5_0x4cbabb['dirname'](_0x1a29f1),'../..'),_0x3e2454=a5_0x4cbabb['join'](_0x30b12c,_0x105c7a(0x1f2)),_0x2c4f48=a5_0x4cbabb[_0x105c7a(0x1e3)](_0x3e2454,_0x105c7a(0x1db)),_0x4a4b96=a5_0x4cbabb[_0x105c7a(0x1e3)](_0x3e2454,'client.ts.tpl');mkdirSync(_0x105c7a(0x1e0),{'recursive':!![]});const _0x37860e=readFileSync(_0x2c4f48,_0x105c7a(0x1f1)),_0x304814=TemplateReplacer[_0x105c7a(0x1d8)](_0x37860e,_0x320ddc,_0x584c,Object[_0x105c7a(0x1d5)](_0x584c)[0x0],_0x27a85f,_0x31f99f),_0x49c3d8=await a5_0x2a9447['format'](_0x304814,{'parser':'typescript'}),_0x5e058a=_0x105c7a(0x1ea)+_0x27a85f+_0x105c7a(0x1e1);writeFileSync(_0x5e058a,_0x49c3d8,{'encoding':'utf8'});const _0x293ab8=readFileSync(_0x4a4b96,_0x105c7a(0x1f1)),_0x4be92b=TemplateReplacer[_0x105c7a(0x1d8)](_0x293ab8,_0x320ddc,_0x584c,Object[_0x105c7a(0x1d5)](_0x584c)[0x0],_0x27a85f,_0x31f99f,_0xe66ce8),_0x180c8d=await a5_0x2a9447[_0x105c7a(0x1e8)](_0x4be92b,{'parser':_0x105c7a(0x1dd)}),_0x3ebd36=_0x105c7a(0x1ea)+_0x431b47+'.ts';writeFileSync(_0x3ebd36,_0x180c8d,{'encoding':_0x105c7a(0x1f1)}),logger[_0x105c7a(0x1dc)](_0x105c7a(0x1fa),'API\x20文件生成成功!'),console[_0x105c7a(0x1f8)](_0x105c7a(0x1df)),console[_0x105c7a(0x1f8)]('\x20\x20\x20•\x20'+_0x5e058a+'\x20-\x20模型配置文件\x20('+Object[_0x105c7a(0x1d5)](_0x584c)[_0x105c7a(0x1f5)]+'\x20个模型)'),console['log'](_0x105c7a(0x1da)+_0x3ebd36+'\x20-\x20客户端实例文件'),console['log'](_0x105c7a(0x1d7)+_0x31f99f),console['log'](_0x105c7a(0x1f9)+_0x431b47+'\x27');}
package/lib/api/main.js CHANGED
@@ -1 +1 @@
1
- (function(_0x279ae0,_0x3e93b5){const _0x2b4128=a6_0x49ba,_0x1f5394=_0x279ae0();while(!![]){try{const _0x74a2da=-parseInt(_0x2b4128(0x1d5))/0x1+-parseInt(_0x2b4128(0x1ce))/0x2+-parseInt(_0x2b4128(0x1c7))/0x3*(-parseInt(_0x2b4128(0x1c8))/0x4)+parseInt(_0x2b4128(0x1c5))/0x5*(-parseInt(_0x2b4128(0x1d0))/0x6)+-parseInt(_0x2b4128(0x1cc))/0x7+parseInt(_0x2b4128(0x1cd))/0x8+-parseInt(_0x2b4128(0x1d1))/0x9*(-parseInt(_0x2b4128(0x1cb))/0xa);if(_0x74a2da===_0x3e93b5)break;else _0x1f5394['push'](_0x1f5394['shift']());}catch(_0x37fcb4){_0x1f5394['push'](_0x1f5394['shift']());}}}(a6_0x1c0b,0xb7b9c));import{jsx as a6_0x1ca228}from'react/jsx-runtime';import{render}from'ink';function a6_0x49ba(_0x59ac6a,_0x351d32){const _0x1c0b33=a6_0x1c0b();return a6_0x49ba=function(_0x49badb,_0x1377ac){_0x49badb=_0x49badb-0x1c5;let _0x125bf5=_0x1c0b33[_0x49badb];return _0x125bf5;},a6_0x49ba(_0x59ac6a,_0x351d32);}import{ApiPullUI}from'./api-pull-ui.js';export async function apiCli(_0xf29757){const _0x2f21ed=a6_0x49ba,_0x2e421f=_0xf29757[_0x2f21ed(0x1d4)][0x1];if(_0x2e421f===_0x2f21ed(0x1d2)){const _0x5ccf98=_0xf29757[_0x2f21ed(0x1d4)][0x2];render(a6_0x1ca228(ApiPullUI,{'appCode':_0x5ccf98}));}else console[_0x2f21ed(0x1c9)](_0x2f21ed(0x1ca)+_0x2e421f),console[_0x2f21ed(0x1d6)](_0x2f21ed(0x1c6)),console[_0x2f21ed(0x1d6)](_0x2f21ed(0x1d3)),console['log']('\x20\x20\x20\x20app-code:\x20可选的应用AppCode,不指定则使用配置的默认值'),process[_0x2f21ed(0x1cf)](0x1);}function a6_0x1c0b(){const _0x39a34a=['\x20\x20lovrabet\x20api\x20pull\x20[app-code]\x20\x20\x20\x20//\x20拉取并生成\x20API\x20配置文件','input','757641SDnURm','log','1085dAlooX','Available\x20commands:','3xukFWJ','1155256ZcXKoV','error','Unknown\x20api\x20command:\x20','16807890tXRJqj','4511255qOKqcO','11232552fUfpIq','221614tMtgis','exit','30642PlEKms','9wwSXGN','pull'];a6_0x1c0b=function(){return _0x39a34a;};return a6_0x1c0b();}
1
+ (function(_0x3bff70,_0x13a622){const _0x414350=a6_0x160b,_0x30192b=_0x3bff70();while(!![]){try{const _0x27c970=-parseInt(_0x414350(0xe5))/0x1+-parseInt(_0x414350(0xec))/0x2+parseInt(_0x414350(0xe3))/0x3*(-parseInt(_0x414350(0xe7))/0x4)+parseInt(_0x414350(0xeb))/0x5+parseInt(_0x414350(0xef))/0x6+-parseInt(_0x414350(0xf2))/0x7*(-parseInt(_0x414350(0xee))/0x8)+-parseInt(_0x414350(0xe8))/0x9*(-parseInt(_0x414350(0xe9))/0xa);if(_0x27c970===_0x13a622)break;else _0x30192b['push'](_0x30192b['shift']());}catch(_0x40cccd){_0x30192b['push'](_0x30192b['shift']());}}}(a6_0xacc1,0x5aa67));import{jsx as a6_0x1be234}from'react/jsx-runtime';import{render}from'ink';import{ApiPullUI}from'./api-pull-ui.js';export async function apiCli(_0x4ed099){const _0x26c33d=a6_0x160b,_0x3c93e9=_0x4ed099[_0x26c33d(0xea)][0x1];if(_0x3c93e9===_0x26c33d(0xe4)){const _0x36e7bb=_0x4ed099[_0x26c33d(0xea)][0x2];render(a6_0x1be234(ApiPullUI,{'appCode':_0x36e7bb}));}else console[_0x26c33d(0xf1)](_0x26c33d(0xf3)+_0x3c93e9),console[_0x26c33d(0xe2)](_0x26c33d(0xe6)),console[_0x26c33d(0xe2)](_0x26c33d(0xf0)),console[_0x26c33d(0xe2)](_0x26c33d(0xed)),process['exit'](0x1);}function a6_0x160b(_0x19bfb9,_0x2d9ea3){const _0xacc1e6=a6_0xacc1();return a6_0x160b=function(_0x160bb8,_0xaaa5e){_0x160bb8=_0x160bb8-0xe2;let _0x550656=_0xacc1e6[_0x160bb8];return _0x550656;},a6_0x160b(_0x19bfb9,_0x2d9ea3);}function a6_0xacc1(){const _0x6c40c5=['593991rxkKBr','30nEZeRs','input','1824085VayFSQ','646124BfhmDH','\x20\x20\x20\x20app-code:\x20可选的应用AppCode,不指定则使用配置的默认值','205168rJbosC','3210444Xckyxt','\x20\x20lovrabet\x20api\x20pull\x20[app-code]\x20\x20\x20\x20//\x20拉取并生成\x20API\x20配置文件','error','126SxMran','Unknown\x20api\x20command:\x20','log','2222742UHpBaS','pull','124237HHsKmx','Available\x20commands:','4yiCgtA'];a6_0xacc1=function(){return _0x6c40c5;};return a6_0xacc1();}
@@ -1 +1 @@
1
- (function(_0x41283d,_0x3f87b5){const _0x5024fb=a7_0x326c,_0x2c8cbc=_0x41283d();while(!![]){try{const _0x1c3ca8=-parseInt(_0x5024fb(0x1ea))/0x1*(-parseInt(_0x5024fb(0x1d3))/0x2)+-parseInt(_0x5024fb(0x1d9))/0x3*(parseInt(_0x5024fb(0x1ee))/0x4)+-parseInt(_0x5024fb(0x1e0))/0x5+-parseInt(_0x5024fb(0x1e9))/0x6+-parseInt(_0x5024fb(0x1e7))/0x7*(parseInt(_0x5024fb(0x1ec))/0x8)+parseInt(_0x5024fb(0x1f3))/0x9+-parseInt(_0x5024fb(0x1cd))/0xa*(-parseInt(_0x5024fb(0x1da))/0xb);if(_0x1c3ca8===_0x3f87b5)break;else _0x2c8cbc['push'](_0x2c8cbc['shift']());}catch(_0x207616){_0x2c8cbc['push'](_0x2c8cbc['shift']());}}}(a7_0x297a,0x442f9));import{getCookie}from'../auth/get-cookie.js';import{getApiDomain}from'../constant/domain.js';import{generateApiFile}from'./generate-api-file.js';function a7_0x326c(_0x379fcd,_0x289638){const _0x297a7c=a7_0x297a();return a7_0x326c=function(_0x326cc5,_0x3d79e7){_0x326cc5=_0x326cc5-0x1cc;let _0x173171=_0x297a7c[_0x326cc5];return _0x173171;},a7_0x326c(_0x379fcd,_0x289638);}function a7_0x297a(){const _0x2bd12f=[',且无法读取错误响应内容','create-api-pull','data','2201202FYBEeP','message','status','-client','trim','×\x20API\x20配置拉取异常:','4089110gDupQI','.ts\x20-\x20客户端实例文件','error','/smartapi/dataset/getList?appCode=','*\x20正在处理\x20','tableData','82978MFyKRy','.ts\x20-\x20模型配置文件','length','×\x20错误详情:','*\x20正在从服务器拉取\x20API\x20配置...','API\x20配置拉取异常:\x20','1273746oFtzRm','22CztgOw','API\x20配置拉取成功:\x20','log','未知错误','cwd','chdir','1898330EQEUfQ','url','api','test','×\x20无法读取错误响应内容','×\x20文件前缀格式不正确。只能包含字母、数字、连字符和下划线,且必须以字母开头。','json','427889EYGXZN','info','633258ZlMxOs','6zCaVSk','\x20\x20\x20•\x20','16uhlpTv','×\x20服务器返回错误:','4ZdgAAH','-api'];a7_0x297a=function(){return _0x2bd12f;};return a7_0x297a();}import{logger}from'../utils/logger.js';export async function pullApiSilent(_0x4da5e5,_0xf31f32,_0x5adf71){const _0x801ebd=a7_0x326c;let _0x1977e6;try{const _0x4d59d2=_0xf31f32?.[_0x801ebd(0x1f7)]()||'';if(_0x4d59d2){const _0x25f1d9=/^[a-zA-Z][a-zA-Z0-9_-]*$/;if(!_0x25f1d9[_0x801ebd(0x1e3)](_0x4d59d2))return console[_0x801ebd(0x1cf)](_0x801ebd(0x1e5)),![];}_0x5adf71&&(_0x1977e6=process[_0x801ebd(0x1de)](),process['chdir'](_0x5adf71));console[_0x801ebd(0x1dc)](_0x801ebd(0x1d7));const _0x1686e1=await fetch(getApiDomain()+_0x801ebd(0x1d0)+_0x4da5e5+'&pageSize=999&currentPage=1',{'headers':{'Cookie':getCookie()}});if(_0x1686e1['ok']){const _0x5960ee=await _0x1686e1[_0x801ebd(0x1e6)]();if(_0x5960ee['success']){const _0x3b7f15=_0x4d59d2?_0x4d59d2+_0x801ebd(0x1ef):_0x801ebd(0x1e2),_0x43b86e=_0x4d59d2?_0x4d59d2+_0x801ebd(0x1f6):'client';return console['log']('*\x20开始生成\x20API\x20配置文件:'),console[_0x801ebd(0x1dc)](_0x801ebd(0x1eb)+_0x3b7f15+_0x801ebd(0x1d4)),console[_0x801ebd(0x1dc)](_0x801ebd(0x1eb)+_0x43b86e+_0x801ebd(0x1ce)),console[_0x801ebd(0x1dc)](_0x801ebd(0x1d1)+_0x5960ee['data'][_0x801ebd(0x1d2)][_0x801ebd(0x1d5)]+'\x20个数据集...'),await generateApiFile(_0x5960ee[_0x801ebd(0x1f2)]['tableData'],_0x4d59d2,_0x4da5e5,!![]),console[_0x801ebd(0x1dc)]('√\x20API\x20配置文件生成完成'),_0x5adf71&&logger[_0x801ebd(0x1e8)](_0x801ebd(0x1f1),_0x801ebd(0x1db)+_0x4da5e5,{'projectPath':_0x5adf71,'appCode':_0x4da5e5,'datasetCount':_0x5960ee[_0x801ebd(0x1f2)][_0x801ebd(0x1d2)][_0x801ebd(0x1d5)],'filePrefix':_0x4d59d2}),!![];}else return console[_0x801ebd(0x1cf)](_0x801ebd(0x1ed),_0x5960ee[_0x801ebd(0x1f4)]||_0x801ebd(0x1dd)),_0x5adf71&&logger[_0x801ebd(0x1cf)]('create-api-pull','API\x20配置拉取失败:\x20'+(_0x5960ee[_0x801ebd(0x1f4)]||_0x801ebd(0x1dd)),{'projectPath':_0x5adf71,'appCode':_0x4da5e5}),![];}else{if(_0x1686e1['status']===0x191){const _0x5527ee='获取数据集失败,原因:登录鉴权失败,登录已过期';console['error']('×\x20'+_0x5527ee),_0x5adf71&&logger[_0x801ebd(0x1cf)](_0x801ebd(0x1f1),_0x5527ee,{'status':_0x1686e1[_0x801ebd(0x1f5)],'appCode':_0x4da5e5,'url':_0x1686e1['url'],'projectPath':_0x5adf71});}else{const _0x2aa08c='获取数据集失败,HTTP状态码:\x20'+_0x1686e1['status'];console[_0x801ebd(0x1cf)]('×\x20'+_0x2aa08c);try{const _0x22fae6=await _0x1686e1['text']();_0x22fae6&&console[_0x801ebd(0x1cf)](_0x801ebd(0x1d6),_0x22fae6),_0x5adf71&&logger[_0x801ebd(0x1cf)](_0x801ebd(0x1f1),_0x2aa08c,{'status':_0x1686e1[_0x801ebd(0x1f5)],'appCode':_0x4da5e5,'url':_0x1686e1['url'],'errorBody':_0x22fae6,'projectPath':_0x5adf71});}catch(_0x5ed5e9){console[_0x801ebd(0x1cf)](_0x801ebd(0x1e4)),_0x5adf71&&logger[_0x801ebd(0x1cf)](_0x801ebd(0x1f1),_0x2aa08c+_0x801ebd(0x1f0),{'status':_0x1686e1[_0x801ebd(0x1f5)],'appCode':_0x4da5e5,'url':_0x1686e1[_0x801ebd(0x1e1)],'readError':_0x5ed5e9 instanceof Error?_0x5ed5e9['message']:String(_0x5ed5e9),'projectPath':_0x5adf71});}}return![];}}catch(_0x374da9){const _0x2af458=_0x374da9 instanceof Error?_0x374da9['message']:String(_0x374da9);return console['error'](_0x801ebd(0x1cc),_0x2af458),_0x5adf71&&logger[_0x801ebd(0x1cf)](_0x801ebd(0x1f1),_0x801ebd(0x1d8)+_0x2af458,{'appCode':_0x4da5e5,'projectPath':_0x5adf71}),![];}finally{_0x1977e6&&process[_0x801ebd(0x1df)](_0x1977e6);}}
1
+ (function(_0x396138,_0x2375a4){const _0x509f3a=a7_0x2070,_0x5dcfdc=_0x396138();while(!![]){try{const _0x1791bf=parseInt(_0x509f3a(0x115))/0x1+-parseInt(_0x509f3a(0x11a))/0x2+parseInt(_0x509f3a(0x126))/0x3*(parseInt(_0x509f3a(0x103))/0x4)+-parseInt(_0x509f3a(0x116))/0x5*(-parseInt(_0x509f3a(0x10c))/0x6)+parseInt(_0x509f3a(0x100))/0x7+-parseInt(_0x509f3a(0x109))/0x8*(parseInt(_0x509f3a(0x114))/0x9)+parseInt(_0x509f3a(0x11c))/0xa;if(_0x1791bf===_0x2375a4)break;else _0x5dcfdc['push'](_0x5dcfdc['shift']());}catch(_0xf74ee4){_0x5dcfdc['push'](_0x5dcfdc['shift']());}}}(a7_0x303d,0x46750));function a7_0x2070(_0x4db295,_0x56a77c){const _0x303da3=a7_0x303d();return a7_0x2070=function(_0x20709c,_0x27f5ce){_0x20709c=_0x20709c-0xfb;let _0x1ed26d=_0x303da3[_0x20709c];return _0x1ed26d;},a7_0x2070(_0x4db295,_0x56a77c);}import{getCookie}from'../auth/get-cookie.js';import{getApiDomain}from'../constant/domain.js';function a7_0x303d(){const _0x23f148=['trim','json','\x20\x20\x20•\x20','API\x20配置拉取失败:\x20','*\x20开始生成\x20API\x20配置文件:','length','url','text','2793fgVXdt','×\x20文件前缀格式不正确。只能包含字母、数字、连字符和下划线,且必须以字母开头。','message','tableData','data','status','create-api-pull','*\x20正在处理\x20','1006320Ezwmwg','×\x20服务器返回错误:','api','536kklYkr','未知错误',',且无法读取错误响应内容','API\x20配置拉取成功:\x20','chdir','API\x20配置拉取异常:\x20','1743272YnxEEv','test','error','501762toPset','√\x20API\x20配置文件生成完成','.ts\x20-\x20客户端实例文件','client','/smartapi/dataset/getList?appCode=','cwd','&pageSize=999&currentPage=1','×\x20无法读取错误响应内容','9FjdxlZ','221275SnIzvO','5tuzyYE','获取数据集失败,HTTP状态码:\x20','*\x20正在从服务器拉取\x20API\x20配置...','log','758872PibpqU','.ts\x20-\x20模型配置文件','3125210QcdodK','\x20个数据集...'];a7_0x303d=function(){return _0x23f148;};return a7_0x303d();}import{generateApiFile}from'./generate-api-file.js';import{logger}from'../utils/logger.js';export async function pullApiSilent(_0x1bf1ce,_0x539e0c,_0x344096){const _0x30b314=a7_0x2070;let _0x5bd6e2;try{const _0x4f0ada=_0x539e0c?.[_0x30b314(0x11e)]()||'';if(_0x4f0ada){const _0x551253=/^[a-zA-Z][a-zA-Z0-9_-]*$/;if(!_0x551253[_0x30b314(0x10a)](_0x4f0ada))return console[_0x30b314(0x10b)](_0x30b314(0x127)),![];}_0x344096&&(_0x5bd6e2=process[_0x30b314(0x111)](),process[_0x30b314(0x107)](_0x344096));console[_0x30b314(0x119)](_0x30b314(0x118));const _0x267345=await fetch(getApiDomain()+_0x30b314(0x110)+_0x1bf1ce+_0x30b314(0x112),{'headers':{'Cookie':getCookie()}});if(_0x267345['ok']){const _0x4e5966=await _0x267345[_0x30b314(0x11f)]();if(_0x4e5966['success']){const _0x3003d6=_0x4f0ada?_0x4f0ada+'-api':_0x30b314(0x102),_0x1f0593=_0x4f0ada?_0x4f0ada+'-client':_0x30b314(0x10f);return console[_0x30b314(0x119)](_0x30b314(0x122)),console[_0x30b314(0x119)](_0x30b314(0x120)+_0x3003d6+_0x30b314(0x11b)),console['log'](_0x30b314(0x120)+_0x1f0593+_0x30b314(0x10e)),console['log'](_0x30b314(0xff)+_0x4e5966[_0x30b314(0xfc)]['tableData'][_0x30b314(0x123)]+_0x30b314(0x11d)),await generateApiFile(_0x4e5966[_0x30b314(0xfc)][_0x30b314(0xfb)],_0x4f0ada,_0x1bf1ce,!![]),console['log'](_0x30b314(0x10d)),_0x344096&&logger['info'](_0x30b314(0xfe),_0x30b314(0x106)+_0x1bf1ce,{'projectPath':_0x344096,'appCode':_0x1bf1ce,'datasetCount':_0x4e5966[_0x30b314(0xfc)][_0x30b314(0xfb)][_0x30b314(0x123)],'filePrefix':_0x4f0ada}),!![];}else return console['error'](_0x30b314(0x101),_0x4e5966[_0x30b314(0x128)]||_0x30b314(0x104)),_0x344096&&logger[_0x30b314(0x10b)](_0x30b314(0xfe),_0x30b314(0x121)+(_0x4e5966[_0x30b314(0x128)]||_0x30b314(0x104)),{'projectPath':_0x344096,'appCode':_0x1bf1ce}),![];}else{if(_0x267345[_0x30b314(0xfd)]===0x191){const _0x5de8a0='获取数据集失败,原因:登录鉴权失败,登录已过期';console[_0x30b314(0x10b)]('×\x20'+_0x5de8a0),_0x344096&&logger[_0x30b314(0x10b)](_0x30b314(0xfe),_0x5de8a0,{'status':_0x267345[_0x30b314(0xfd)],'appCode':_0x1bf1ce,'url':_0x267345[_0x30b314(0x124)],'projectPath':_0x344096});}else{const _0x56c50e=_0x30b314(0x117)+_0x267345[_0x30b314(0xfd)];console[_0x30b314(0x10b)]('×\x20'+_0x56c50e);try{const _0x57fde6=await _0x267345[_0x30b314(0x125)]();_0x57fde6&&console['error']('×\x20错误详情:',_0x57fde6),_0x344096&&logger[_0x30b314(0x10b)](_0x30b314(0xfe),_0x56c50e,{'status':_0x267345[_0x30b314(0xfd)],'appCode':_0x1bf1ce,'url':_0x267345[_0x30b314(0x124)],'errorBody':_0x57fde6,'projectPath':_0x344096});}catch(_0x128cfe){console[_0x30b314(0x10b)](_0x30b314(0x113)),_0x344096&&logger[_0x30b314(0x10b)](_0x30b314(0xfe),_0x56c50e+_0x30b314(0x105),{'status':_0x267345['status'],'appCode':_0x1bf1ce,'url':_0x267345[_0x30b314(0x124)],'readError':_0x128cfe instanceof Error?_0x128cfe[_0x30b314(0x128)]:String(_0x128cfe),'projectPath':_0x344096});}}return![];}}catch(_0x4b9d1d){const _0x254757=_0x4b9d1d instanceof Error?_0x4b9d1d['message']:String(_0x4b9d1d);return console[_0x30b314(0x10b)]('×\x20API\x20配置拉取异常:',_0x254757),_0x344096&&logger[_0x30b314(0x10b)](_0x30b314(0xfe),_0x30b314(0x108)+_0x254757,{'appCode':_0x1bf1ce,'projectPath':_0x344096}),![];}finally{_0x5bd6e2&&process[_0x30b314(0x107)](_0x5bd6e2);}}
package/lib/api/pull.js CHANGED
@@ -1 +1 @@
1
- (function(_0xd624a9,_0x357c09){const _0x2145e6=a8_0x394b,_0x2f1fba=_0xd624a9();while(!![]){try{const _0x520ca3=-parseInt(_0x2145e6(0x1ed))/0x1+-parseInt(_0x2145e6(0x1e8))/0x2+-parseInt(_0x2145e6(0x203))/0x3*(-parseInt(_0x2145e6(0x1f5))/0x4)+-parseInt(_0x2145e6(0x1fb))/0x5*(parseInt(_0x2145e6(0x1ea))/0x6)+parseInt(_0x2145e6(0x1db))/0x7+-parseInt(_0x2145e6(0x1f3))/0x8*(parseInt(_0x2145e6(0x1fe))/0x9)+-parseInt(_0x2145e6(0x1d1))/0xa*(-parseInt(_0x2145e6(0x1d4))/0xb);if(_0x520ca3===_0x357c09)break;else _0x2f1fba['push'](_0x2f1fba['shift']());}catch(_0x2c12bf){_0x2f1fba['push'](_0x2f1fba['shift']());}}}(a8_0x4432,0x98514));import{createInterface}from'node:readline/promises';import{readConfig}from'../utils/config.js';import{getCookie}from'../auth/get-cookie.js';function a8_0x394b(_0xb1acca,_0x2e7513){const _0x4432b1=a8_0x4432();return a8_0x394b=function(_0x394bc2,_0x2aaa43){_0x394bc2=_0x394bc2-0x1d1;let _0x2ce8e0=_0x4432b1[_0x394bc2];return _0x2ce8e0;},a8_0x394b(_0xb1acca,_0x2e7513);}function a8_0x4432(){const _0x1d46ce=['24CGECSb','×\x20提供的应用AppCode\x20\x22','23824pqaVbi','\x1b[0m','tableData','-client','×\x20错误详情:','\x22\x20无效','20WiJQbO','data','length','804663aDdwod','question','&pageSize=999&currentPage=1','!\x20请使用以下方式之一:','log','249CsovEp','url','trim','*\x20正在处理\x20','31550SxJnsx','*\x20开始生成\x20API\x20配置文件:','stdout','5401iARdOH','\x20\x20\x202.\x20配置默认值:\x20lovrabet\x20config\x20set\x20app\x20<app-code>','api-pull','string','/smartapi/dataset/getList?appCode=','!\x20请输入文件前缀\x20\x1b[90m[留空表示无前缀]\x1b[0m:\x20','stdin','3926923cVTUjA','exit','error','.ts\x20-\x20模型配置文件','app','status','\x0a*\x20正在从服务器拉取\x20API\x20配置...','\x1b[90m*\x20使用配置的应用AppCode:\x20','×\x20未提供应用AppCode,且配置中也没有默认值','-api','text','\x20\x20\x20•\x20',',且无法读取错误响应内容','1359230BLgFYN','api','93144pCiBpC','*\x20使用指定的应用AppCode:\x20','test','970618WmVHnE','获取数据集失败,HTTP状态码:\x20','.ts\x20-\x20客户端实例文件','message','success','json'];a8_0x4432=function(){return _0x1d46ce;};return a8_0x4432();}import{getApiDomain}from'../constant/domain.js';import{generateApiFile}from'./generate-api-file.js';import{logger}from'../utils/logger.js';export async function initApi(_0x23e0d0){const _0x363ecc=a8_0x394b,_0x1b63f1=readConfig(),_0x53b2ed=_0x23e0d0||_0x1b63f1?.[_0x363ecc(0x1df)];(typeof _0x53b2ed!==_0x363ecc(0x1d7)||!_0x53b2ed)&&(_0x23e0d0?console[_0x363ecc(0x1dd)](_0x363ecc(0x1f4)+_0x23e0d0+_0x363ecc(0x1fa)):(console['error'](_0x363ecc(0x1e3)),console[_0x363ecc(0x202)](_0x363ecc(0x201)),console[_0x363ecc(0x202)]('\x20\x20\x201.\x20直接指定:\x20lovrabet\x20api\x20pull\x20<app-code>'),console[_0x363ecc(0x202)](_0x363ecc(0x1d5))),process[_0x363ecc(0x1dc)](0x1));_0x23e0d0?console[_0x363ecc(0x202)](_0x363ecc(0x1eb)+_0x53b2ed):console['log'](_0x363ecc(0x1e2)+_0x53b2ed+_0x363ecc(0x1f6));const _0x57b0ef=createInterface({'input':process[_0x363ecc(0x1da)],'output':process[_0x363ecc(0x1d3)]});let _0x3875a2;try{const _0x226310=await _0x57b0ef[_0x363ecc(0x1ff)](_0x363ecc(0x1d9));_0x3875a2=_0x226310[_0x363ecc(0x205)]();if(_0x3875a2){const _0x4cc031=/^[a-zA-Z][a-zA-Z0-9_-]*$/;!_0x4cc031[_0x363ecc(0x1ec)](_0x3875a2)&&(console[_0x363ecc(0x1dd)]('×\x20文件前缀格式不正确。只能包含字母、数字、连字符和下划线,且必须以字母开头。'),process[_0x363ecc(0x1dc)](0x1));}}finally{_0x57b0ef['close']();}console[_0x363ecc(0x202)](_0x363ecc(0x1e1));const _0x2ba019=await fetch(getApiDomain()+_0x363ecc(0x1d8)+_0x53b2ed+_0x363ecc(0x200),{'headers':{'Cookie':getCookie()}});if(_0x2ba019['ok']){const _0x341aa5=await _0x2ba019[_0x363ecc(0x1f2)]();if(_0x341aa5[_0x363ecc(0x1f1)]){const _0x5bfe05=_0x3875a2?_0x3875a2+_0x363ecc(0x1e4):_0x363ecc(0x1e9),_0x2cdaf5=_0x3875a2?_0x3875a2+_0x363ecc(0x1f8):'client';console[_0x363ecc(0x202)](_0x363ecc(0x1d2)),console[_0x363ecc(0x202)](_0x363ecc(0x1e6)+_0x5bfe05+_0x363ecc(0x1de)),console[_0x363ecc(0x202)](_0x363ecc(0x1e6)+_0x2cdaf5+_0x363ecc(0x1ef)),console[_0x363ecc(0x202)](_0x363ecc(0x206)+_0x341aa5[_0x363ecc(0x1fc)]['tableData'][_0x363ecc(0x1fd)]+'\x20个数据集...');const _0x4104f2=!_0x23e0d0;await generateApiFile(_0x341aa5['data'][_0x363ecc(0x1f7)],_0x3875a2,_0x53b2ed,_0x4104f2);}}else{if(_0x2ba019[_0x363ecc(0x1e0)]===0x191){const _0x1df2bc='获取数据集失败,原因:登录鉴权失败,登录已过期,请使用\x20lovrabet\x20auth\x20重新登录后再尝试';console[_0x363ecc(0x1dd)]('×\x20'+_0x1df2bc),logger[_0x363ecc(0x1dd)](_0x363ecc(0x1d6),_0x1df2bc,{'status':_0x2ba019[_0x363ecc(0x1e0)],'appCode':_0x53b2ed,'url':_0x2ba019[_0x363ecc(0x204)]});}else{const _0x1e95e0=_0x363ecc(0x1ee)+_0x2ba019[_0x363ecc(0x1e0)];console[_0x363ecc(0x1dd)]('×\x20'+_0x1e95e0);try{const _0x3b9cac=await _0x2ba019[_0x363ecc(0x1e5)]();_0x3b9cac?(console[_0x363ecc(0x1dd)](_0x363ecc(0x1f9),_0x3b9cac),logger['error'](_0x363ecc(0x1d6),_0x1e95e0,{'status':_0x2ba019[_0x363ecc(0x1e0)],'appCode':_0x53b2ed,'url':_0x2ba019[_0x363ecc(0x204)],'errorBody':_0x3b9cac})):logger[_0x363ecc(0x1dd)](_0x363ecc(0x1d6),_0x1e95e0,{'status':_0x2ba019[_0x363ecc(0x1e0)],'appCode':_0x53b2ed,'url':_0x2ba019[_0x363ecc(0x204)]});}catch(_0x54ad03){console[_0x363ecc(0x1dd)]('×\x20无法读取错误响应内容'),logger[_0x363ecc(0x1dd)](_0x363ecc(0x1d6),_0x1e95e0+_0x363ecc(0x1e7),{'status':_0x2ba019[_0x363ecc(0x1e0)],'appCode':_0x53b2ed,'url':_0x2ba019[_0x363ecc(0x204)],'readError':_0x54ad03 instanceof Error?_0x54ad03[_0x363ecc(0x1f0)]:String(_0x54ad03)});}}process[_0x363ecc(0x1dc)](0x1);}}
1
+ (function(_0x580fa6,_0x2f4b88){const _0x132427=a8_0x169e,_0x5c853f=_0x580fa6();while(!![]){try{const _0x5f0990=parseInt(_0x132427(0x9b))/0x1*(-parseInt(_0x132427(0xaa))/0x2)+-parseInt(_0x132427(0x8e))/0x3*(-parseInt(_0x132427(0x94))/0x4)+-parseInt(_0x132427(0xa9))/0x5+parseInt(_0x132427(0x92))/0x6*(parseInt(_0x132427(0xb8))/0x7)+parseInt(_0x132427(0xb2))/0x8+-parseInt(_0x132427(0x98))/0x9+-parseInt(_0x132427(0xb5))/0xa*(-parseInt(_0x132427(0x9f))/0xb);if(_0x5f0990===_0x2f4b88)break;else _0x5c853f['push'](_0x5c853f['shift']());}catch(_0x3796c7){_0x5c853f['push'](_0x5c853f['shift']());}}}(a8_0x3a30,0x8218c));function a8_0x169e(_0x1a4984,_0x481b77){const _0x3a307c=a8_0x3a30();return a8_0x169e=function(_0x169e6f,_0x1aab6c){_0x169e6f=_0x169e6f-0x8d;let _0x3eb3dd=_0x3a307c[_0x169e6f];return _0x3eb3dd;},a8_0x169e(_0x1a4984,_0x481b77);}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{generateApiFile}from'./generate-api-file.js';import{logger}from'../utils/logger.js';function a8_0x3a30(){const _0x47afc5=['510AhidsQ','获取数据集失败,HTTP状态码:\x20','\x20\x20\x20•\x20','2653yHnwHb','×\x20无法读取错误响应内容','\x20\x20\x202.\x20配置默认值:\x20lovrabet\x20config\x20set\x20app\x20<app-code>','url','app','24dbdUMk','message','api-pull','×\x20错误详情:','6756ZtpnZM','client','103236qTCdNH','-client','json','!\x20请输入文件前缀\x20\x1b[90m[留空表示无前缀]\x1b[0m:\x20','4033206LodwMq','tableData','!\x20请使用以下方式之一:','1qxqPMV','status','\x20个数据集...','\x20\x20\x201.\x20直接指定:\x20lovrabet\x20api\x20pull\x20<app-code>','366993jCBEpr','.ts\x20-\x20客户端实例文件','×\x20未提供应用AppCode,且配置中也没有默认值','\x0a*\x20正在从服务器拉取\x20API\x20配置...','-api','stdout','.ts\x20-\x20模型配置文件','/smartapi/dataset/getList?appCode=','length','exit','4206450LuMUsB','1181576HLtNHc','×\x20文件前缀格式不正确。只能包含字母、数字、连字符和下划线,且必须以字母开头。','success','error','*\x20开始生成\x20API\x20配置文件:','*\x20正在处理\x20','data','log','626792RJWSht','test','string'];a8_0x3a30=function(){return _0x47afc5;};return a8_0x3a30();}export async function initApi(_0x537efd){const _0x2b2b55=a8_0x169e,_0x34aa1f=readConfig(),_0x23cd8f=_0x537efd||_0x34aa1f?.[_0x2b2b55(0x8d)];(typeof _0x23cd8f!==_0x2b2b55(0xb4)||!_0x23cd8f)&&(_0x537efd?console['error']('×\x20提供的应用AppCode\x20\x22'+_0x537efd+'\x22\x20无效'):(console['error'](_0x2b2b55(0xa1)),console[_0x2b2b55(0xb1)](_0x2b2b55(0x9a)),console[_0x2b2b55(0xb1)](_0x2b2b55(0x9e)),console['log'](_0x2b2b55(0xba))),process['exit'](0x1));_0x537efd?console['log']('*\x20使用指定的应用AppCode:\x20'+_0x23cd8f):console[_0x2b2b55(0xb1)]('\x1b[90m*\x20使用配置的应用AppCode:\x20'+_0x23cd8f+'\x1b[0m');const _0x4a6001=createInterface({'input':process['stdin'],'output':process[_0x2b2b55(0xa4)]});let _0xaaa955;try{const _0x1e251a=await _0x4a6001['question'](_0x2b2b55(0x97));_0xaaa955=_0x1e251a['trim']();if(_0xaaa955){const _0x356a11=/^[a-zA-Z][a-zA-Z0-9_-]*$/;!_0x356a11[_0x2b2b55(0xb3)](_0xaaa955)&&(console[_0x2b2b55(0xad)](_0x2b2b55(0xab)),process[_0x2b2b55(0xa8)](0x1));}}finally{_0x4a6001['close']();}console[_0x2b2b55(0xb1)](_0x2b2b55(0xa2));const _0x58a0d2=await fetch(getApiDomain()+_0x2b2b55(0xa6)+_0x23cd8f+'&pageSize=999&currentPage=1',{'headers':{'Cookie':getCookie()}});if(_0x58a0d2['ok']){const _0x34ef16=await _0x58a0d2[_0x2b2b55(0x96)]();if(_0x34ef16[_0x2b2b55(0xac)]){const _0x3d0283=_0xaaa955?_0xaaa955+_0x2b2b55(0xa3):'api',_0x5c532a=_0xaaa955?_0xaaa955+_0x2b2b55(0x95):_0x2b2b55(0x93);console[_0x2b2b55(0xb1)](_0x2b2b55(0xae)),console[_0x2b2b55(0xb1)](_0x2b2b55(0xb7)+_0x3d0283+_0x2b2b55(0xa5)),console[_0x2b2b55(0xb1)](_0x2b2b55(0xb7)+_0x5c532a+_0x2b2b55(0xa0)),console[_0x2b2b55(0xb1)](_0x2b2b55(0xaf)+_0x34ef16['data'][_0x2b2b55(0x99)][_0x2b2b55(0xa7)]+_0x2b2b55(0x9d));const _0x2720a2=!_0x537efd;await generateApiFile(_0x34ef16[_0x2b2b55(0xb0)][_0x2b2b55(0x99)],_0xaaa955,_0x23cd8f,_0x2720a2);}}else{if(_0x58a0d2['status']===0x191){const _0x16578a='获取数据集失败,原因:登录鉴权失败,登录已过期,请使用\x20lovrabet\x20auth\x20重新登录后再尝试';console['error']('×\x20'+_0x16578a),logger[_0x2b2b55(0xad)]('api-pull',_0x16578a,{'status':_0x58a0d2[_0x2b2b55(0x9c)],'appCode':_0x23cd8f,'url':_0x58a0d2['url']});}else{const _0x48efe2=_0x2b2b55(0xb6)+_0x58a0d2[_0x2b2b55(0x9c)];console[_0x2b2b55(0xad)]('×\x20'+_0x48efe2);try{const _0x562de0=await _0x58a0d2['text']();_0x562de0?(console[_0x2b2b55(0xad)](_0x2b2b55(0x91),_0x562de0),logger['error'](_0x2b2b55(0x90),_0x48efe2,{'status':_0x58a0d2[_0x2b2b55(0x9c)],'appCode':_0x23cd8f,'url':_0x58a0d2[_0x2b2b55(0xbb)],'errorBody':_0x562de0})):logger['error'](_0x2b2b55(0x90),_0x48efe2,{'status':_0x58a0d2['status'],'appCode':_0x23cd8f,'url':_0x58a0d2[_0x2b2b55(0xbb)]});}catch(_0x3f1aa1){console[_0x2b2b55(0xad)](_0x2b2b55(0xb9)),logger['error']('api-pull',_0x48efe2+',且无法读取错误响应内容',{'status':_0x58a0d2['status'],'appCode':_0x23cd8f,'url':_0x58a0d2['url'],'readError':_0x3f1aa1 instanceof Error?_0x3f1aa1[_0x2b2b55(0x8f)]:String(_0x3f1aa1)});}}process['exit'](0x1);}}
@@ -1 +1 @@
1
- (function(_0x20d3ed,_0x1eab7a){const _0x4031b7=a10_0x4bd3,_0x4fbd76=_0x20d3ed();while(!![]){try{const _0x509aa9=-parseInt(_0x4031b7(0x130))/0x1*(parseInt(_0x4031b7(0x137))/0x2)+parseInt(_0x4031b7(0x12d))/0x3*(-parseInt(_0x4031b7(0x13b))/0x4)+parseInt(_0x4031b7(0x12a))/0x5+parseInt(_0x4031b7(0x138))/0x6+parseInt(_0x4031b7(0x13e))/0x7+-parseInt(_0x4031b7(0x13f))/0x8+-parseInt(_0x4031b7(0x135))/0x9*(-parseInt(_0x4031b7(0x12f))/0xa);if(_0x509aa9===_0x1eab7a)break;else _0x4fbd76['push'](_0x4fbd76['shift']());}catch(_0x6fa383){_0x4fbd76['push'](_0x4fbd76['shift']());}}}(a10_0x4ae6,0x1da6d));import{jsx as a10_0x2fab24,jsxs as a10_0x94f8f4}from'react/jsx-runtime';function a10_0x4bd3(_0x31197a,_0x373763){const _0x4ae609=a10_0x4ae6();return a10_0x4bd3=function(_0x4bd3da,_0x1cedcf){_0x4bd3da=_0x4bd3da-0x12a;let _0xdb36d6=_0x4ae609[_0x4bd3da];return _0xdb36d6;},a10_0x4bd3(_0x31197a,_0x373763);}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';import a10_0x50e6d2 from'ink-spinner';export function AuthServer(){const _0x529d1c=a10_0x4bd3,{exit:_0x4166e0}=useApp(),[_0x44c80b,_0x24f97b]=useState(![]),[_0xf86d71,_0x55685f]=useState(!![]),[_0x1eff51,_0x350f7a]=useState(![]),[_0x536861,_0x29da3c]=useState(![]);useEffect(()=>{const _0x9c268f=a10_0x4bd3;getIsSessionValid()[_0x9c268f(0x12c)](_0x24f97b)[_0x9c268f(0x131)](()=>_0x55685f(![]));},[]),useEffect(()=>{const _0x3e0d78=a10_0x4bd3;!_0xf86d71&&_0x44c80b&&(console[_0x3e0d78(0x134)](_0x3e0d78(0x133)),_0x4166e0());},[_0xf86d71,_0x44c80b,_0x4166e0]),useEffect(()=>{const _0x132da2=a10_0x4bd3;_0x536861&&(console[_0x132da2(0x134)](_0x132da2(0x132)),_0x4166e0());},[_0x536861,_0x4166e0]),useInput((_0x14ff8b,_0x468b5f)=>{_0x468b5f['return']&&(_0x350f7a(!![]),authServer({'silent':!![]})['then'](_0x508ca6=>{_0x29da3c(_0x508ca6);})),_0x14ff8b==='q'&&_0x4166e0();});if(_0xf86d71)return null;if(_0x44c80b||_0x536861)return null;return a10_0x2fab24(Box,{'flexDirection':_0x529d1c(0x12b),'marginTop':0x1,'marginBottom':0x1,'children':_0x1eff51?a10_0x94f8f4(Box,{'children':[a10_0x2fab24(Box,{'width':'1'}),a10_0x94f8f4(Text,{'color':_0x529d1c(0x13a),'children':[a10_0x2fab24(a10_0x50e6d2,{'type':_0x529d1c(0x139)}),'\x20\x20']}),a10_0x2fab24(Text,{'children':_0x529d1c(0x12e)}),a10_0x2fab24(Text,{'color':_0x529d1c(0x136),'children':_0x529d1c(0x13d)})]}):a10_0x94f8f4(Box,{'children':[a10_0x2fab24(Box,{'width':'1'}),a10_0x2fab24(Text,{'children':_0x529d1c(0x13c)}),a10_0x2fab24(Text,{'color':_0x529d1c(0x136),'children':'按\x20“q”\x20退出。'})]})});}function a10_0x4ae6(){const _0x2a05bd=['68mqAyqN','*\x20按回车开始登录。','请前往浏览器完成登录。','1414098RFEcoS','586128qeCFJm','306635OoFBQC','column','then','7188OyiUMU','正在登录...\x20','949990gXnkIN','17pILdEa','finally','*\x20登录成功!','√\x20当前为有效会话,无需重新登录。','log','9czmrWJ','gray','22354LimgpM','402720iCjTwm','dots','green'];a10_0x4ae6=function(){return _0x2a05bd;};return a10_0x4ae6();}
1
+ (function(_0x9f89e9,_0x3784d5){const _0x3c477a=a10_0x7104,_0x36e2e1=_0x9f89e9();while(!![]){try{const _0x4d4d33=-parseInt(_0x3c477a(0x198))/0x1*(parseInt(_0x3c477a(0x194))/0x2)+parseInt(_0x3c477a(0x18e))/0x3+-parseInt(_0x3c477a(0x19d))/0x4+parseInt(_0x3c477a(0x195))/0x5+-parseInt(_0x3c477a(0x192))/0x6*(-parseInt(_0x3c477a(0x18f))/0x7)+parseInt(_0x3c477a(0x191))/0x8+parseInt(_0x3c477a(0x19c))/0x9*(-parseInt(_0x3c477a(0x196))/0xa);if(_0x4d4d33===_0x3784d5)break;else _0x36e2e1['push'](_0x36e2e1['shift']());}catch(_0x12378f){_0x36e2e1['push'](_0x36e2e1['shift']());}}}(a10_0x39aa,0x438aa));function a10_0x39aa(){const _0xd6cab0=['green','finally','2682kWrHGd','2163128cXssly','*\x20登录成功!','gray','223200koUiQC','6482exvkLX','请前往浏览器完成登录。','4002304DYsZdX','2862oMUHXJ','then','835886CEKqOo','1759465fHPWqu','4460EhVNuJ','log','1YfcpiL','dots'];a10_0x39aa=function(){return _0xd6cab0;};return a10_0x39aa();}import{jsx as a10_0x39772d,jsxs as a10_0x4cef98}from'react/jsx-runtime';import{Text,Box,useInput,useApp}from'ink';function a10_0x7104(_0x29e924,_0x6bd33){const _0x39aa6d=a10_0x39aa();return a10_0x7104=function(_0x710452,_0x417189){_0x710452=_0x710452-0x18e;let _0x29b359=_0x39aa6d[_0x710452];return _0x29b359;},a10_0x7104(_0x29e924,_0x6bd33);}import{useEffect,useState}from'react';import{getIsSessionValid}from'./is-session-valid.js';import{authServer}from'./auth-server.js';import a10_0x5a8dcc from'ink-spinner';export function AuthServer(){const _0xcef4cc=a10_0x7104,{exit:_0xad4925}=useApp(),[_0x563ac2,_0x145d76]=useState(![]),[_0x4d89df,_0x19441c]=useState(!![]),[_0x49adcd,_0x4298db]=useState(![]),[_0x56bb21,_0x5b1def]=useState(![]);useEffect(()=>{const _0x359ac6=a10_0x7104;getIsSessionValid()[_0x359ac6(0x193)](_0x145d76)[_0x359ac6(0x19b)](()=>_0x19441c(![]));},[]),useEffect(()=>{const _0x38c1c2=a10_0x7104;!_0x4d89df&&_0x563ac2&&(console[_0x38c1c2(0x197)]('√\x20当前为有效会话,无需重新登录。'),_0xad4925());},[_0x4d89df,_0x563ac2,_0xad4925]),useEffect(()=>{const _0x21a9b5=a10_0x7104;_0x56bb21&&(console[_0x21a9b5(0x197)](_0x21a9b5(0x19e)),_0xad4925());},[_0x56bb21,_0xad4925]),useInput((_0x50187f,_0x4b26f6)=>{const _0x255f91=a10_0x7104;_0x4b26f6['return']&&(_0x4298db(!![]),authServer({'silent':!![]})[_0x255f91(0x193)](_0x5f16ba=>{_0x5b1def(_0x5f16ba);})),_0x50187f==='q'&&_0xad4925();});if(_0x4d89df)return null;if(_0x563ac2||_0x56bb21)return null;return a10_0x39772d(Box,{'flexDirection':'column','marginTop':0x1,'marginBottom':0x1,'children':_0x49adcd?a10_0x4cef98(Box,{'children':[a10_0x39772d(Box,{'width':'1'}),a10_0x4cef98(Text,{'color':_0xcef4cc(0x19a),'children':[a10_0x39772d(a10_0x5a8dcc,{'type':_0xcef4cc(0x199)}),'\x20\x20']}),a10_0x39772d(Text,{'children':'正在登录...\x20'}),a10_0x39772d(Text,{'color':_0xcef4cc(0x19f),'children':_0xcef4cc(0x190)})]}):a10_0x4cef98(Box,{'children':[a10_0x39772d(Box,{'width':'1'}),a10_0x39772d(Text,{'children':'*\x20按回车开始登录。'}),a10_0x39772d(Text,{'color':'gray','children':'按\x20“q”\x20退出。'})]})});}
@@ -1 +1 @@
1
- const a11_0x406a0a=a11_0x4aa3;function a11_0x5104(){const _0x46edfe=['end','writeHead','1313644zyNtxh','darwin','error','text/html;\x20charset=utf-8','createServer','cookie','port','utf-8','start\x20\x22\x22\x20\x22','3018riYfON','object','log','9OAUvPa','https://dev.lovrabet.com:','then','1618186zimDLp','🔗\x20请手动复制登录地址到浏览器:','json','open\x20\x22','https://g.yuntooai.com/cert/lovrabet-dev.json','3045DqvPCW','759940unAMKH','/sign-in?redirect=','📍\x20登录地址:','4615752fWHQSX','3XtdVMO','main','catch','252270qBjyIq','⚠️\x20\x20无法自动打开浏览器','💡\x20如果浏览器没有自动打开,请手动复制上面的登录地址到浏览器中打开','127.0.0.1','close','🌐\x20正在尝试自动打开浏览器...','silent','638184JPGHHB','✅\x20浏览器已自动打开,请在浏览器中完成登录','Auth\x20server\x20error:','user'];a11_0x5104=function(){return _0x46edfe;};return a11_0x5104();}(function(_0x2b1027,_0x275258){const _0x2d34ed=a11_0x4aa3,_0x5bf690=_0x2b1027();while(!![]){try{const _0x5e0ca7=parseInt(_0x2d34ed(0x191))/0x1+-parseInt(_0x2d34ed(0x17d))/0x2+-parseInt(_0x2d34ed(0x187))/0x3*(parseInt(_0x2d34ed(0x197))/0x4)+parseInt(_0x2d34ed(0x18a))/0x5+-parseInt(_0x2d34ed(0x177))/0x6*(-parseInt(_0x2d34ed(0x182))/0x7)+-parseInt(_0x2d34ed(0x186))/0x8*(-parseInt(_0x2d34ed(0x17a))/0x9)+parseInt(_0x2d34ed(0x183))/0xa;if(_0x5e0ca7===_0x275258)break;else _0x5bf690['push'](_0x5bf690['shift']());}catch(_0x50c8c1){_0x5bf690['push'](_0x5bf690['shift']());}}}(a11_0x5104,0x673f6));import{writeFileSync}from'node:fs';import a11_0x14949c from'node:https';function a11_0x4aa3(_0x4699c8,_0x15752d){const _0x510446=a11_0x5104();return a11_0x4aa3=function(_0x4aa3ab,_0xc4c15){_0x4aa3ab=_0x4aa3ab-0x173;let _0x2884aa=_0x510446[_0x4aa3ab];return _0x2884aa;},a11_0x4aa3(_0x4699c8,_0x15752d);}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(_0x21701e){const _0x232d5e=a11_0x4aa3,_0x52a694=_0x21701e?.[_0x232d5e(0x190)]||![];if(await getIsSessionValid())return!![];const _0x53cb98=await(await fetch(_0x232d5e(0x181)))[_0x232d5e(0x17f)]();return new Promise(async(_0x273dfb,_0x1f0381)=>{const _0x26b44b=_0x232d5e;let _0x5bc069=0x0;const _0x35d5be=a11_0x14949c[_0x26b44b(0x19b)](_0x53cb98,async(_0x5d0ac4,_0x333696)=>{const _0x2e0055=_0x26b44b,_0xdf0879=getUserDomain(),_0x5a6d46=_0x5d0ac4['headers'][_0x2e0055(0x173)]||'',_0x1ac7da=await fetch(_0xdf0879+'/api/auth/get-session',{'headers':{'cookie':_0x5a6d46}})[_0x2e0055(0x17c)](_0x5a4e13=>_0x5a4e13[_0x2e0055(0x17f)]()),_0x478afa=_0x1ac7da&&_0x1ac7da['session']&&_0x1ac7da[_0x2e0055(0x194)];if(_0x478afa){writeFileSync(cookieFile,_0x5a6d46,_0x2e0055(0x175)),_0x273dfb(!![]);const _0x3903a8='<!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>';_0x333696[_0x2e0055(0x196)](0xc8,{'Content-Type':_0x2e0055(0x19a)}),_0x333696[_0x2e0055(0x195)](_0x3903a8),_0x35d5be[_0x2e0055(0x18e)]();}else{const _0x19e8ed=''+encodeURIComponent(_0x2e0055(0x17b)+_0x5bc069);_0x333696[_0x2e0055(0x196)](0x12e,{'location':_0xdf0879+_0x2e0055(0x184)+_0x19e8ed}),_0x333696[_0x2e0055(0x195)]();return;}});_0x35d5be['listen'](0x0,_0x26b44b(0x18d),()=>{const _0x129157=_0x26b44b,_0x6d05ee=_0x35d5be['address']();_0x5bc069=typeof _0x6d05ee===_0x129157(0x178)&&_0x6d05ee?_0x6d05ee[_0x129157(0x174)]:Number(_0x6d05ee);const _0x3f5a9a='https://dev.lovrabet.com:'+_0x5bc069;!_0x52a694&&(console[_0x129157(0x179)]('🔐\x20正在启动登录服务...'),console[_0x129157(0x179)](_0x129157(0x185),_0x3f5a9a),console[_0x129157(0x179)](_0x129157(0x18f)),console[_0x129157(0x179)](''),console['log'](_0x129157(0x18c)),console[_0x129157(0x179)]('')),openInBrowser(_0x3f5a9a)[_0x129157(0x17c)](_0x341d70=>{const _0xd8fd42=_0x129157;!_0x52a694&&(_0x341d70?console[_0xd8fd42(0x179)](_0xd8fd42(0x192)):(console[_0xd8fd42(0x179)](_0xd8fd42(0x18b)),console[_0xd8fd42(0x179)]('🔗\x20请手动复制登录地址到浏览器:',_0x3f5a9a)),console['log'](''));})[_0x129157(0x189)](()=>{const _0x265c0f=_0x129157;!_0x52a694&&(console[_0x265c0f(0x179)](_0x265c0f(0x18b)),console[_0x265c0f(0x179)](_0x265c0f(0x17e),_0x3f5a9a),console[_0x265c0f(0x179)](''));});}),_0x35d5be['on'](_0x26b44b(0x199),_0x58b78d=>{const _0x2c0f3d=_0x26b44b;!_0x52a694&&console[_0x2c0f3d(0x199)](_0x2c0f3d(0x193),_0x58b78d),_0x1f0381(_0x58b78d);});});}function openInBrowser(_0x1b674b){return new Promise(_0x816f66=>{const _0x5b68e0=a11_0x4aa3,_0x172fdf=process['platform'];let _0x2005d7;if(_0x172fdf==='win32')_0x2005d7=_0x5b68e0(0x176)+_0x1b674b+'\x22';else _0x172fdf===_0x5b68e0(0x198)?_0x2005d7=_0x5b68e0(0x180)+_0x1b674b+'\x22':_0x2005d7='xdg-open\x20\x22'+_0x1b674b+'\x22';exec(_0x2005d7,_0x355e04=>{_0x355e04?_0x816f66(![]):_0x816f66(!![]);});});}if(import.meta[a11_0x406a0a(0x188)]){const isAuth=await authServer();console[a11_0x406a0a(0x179)]('isAuth',isAuth);}
1
+ const a11_0xb9d948=a11_0x1ede;function a11_0x1ede(_0x582336,_0x106ea1){const _0x3d5f52=a11_0x3d5f();return a11_0x1ede=function(_0x1ede3b,_0x475123){_0x1ede3b=_0x1ede3b-0x1e0;let _0x25b6a7=_0x3d5f52[_0x1ede3b];return _0x25b6a7;},a11_0x1ede(_0x582336,_0x106ea1);}(function(_0x38c527,_0x4808a2){const _0xa40cdd=a11_0x1ede,_0x238f53=_0x38c527();while(!![]){try{const _0x3fb5bf=-parseInt(_0xa40cdd(0x1ff))/0x1+-parseInt(_0xa40cdd(0x1ec))/0x2*(parseInt(_0xa40cdd(0x1e5))/0x3)+parseInt(_0xa40cdd(0x1f4))/0x4+-parseInt(_0xa40cdd(0x209))/0x5+-parseInt(_0xa40cdd(0x1e8))/0x6*(parseInt(_0xa40cdd(0x1ee))/0x7)+parseInt(_0xa40cdd(0x1f1))/0x8*(-parseInt(_0xa40cdd(0x1e0))/0x9)+-parseInt(_0xa40cdd(0x1ea))/0xa*(-parseInt(_0xa40cdd(0x1e4))/0xb);if(_0x3fb5bf===_0x4808a2)break;else _0x238f53['push'](_0x238f53['shift']());}catch(_0x273223){_0x238f53['push'](_0x238f53['shift']());}}}(a11_0x3d5f,0x83e4a));import{writeFileSync}from'node:fs';function a11_0x3d5f(){const _0x331004=['start\x20\x22\x22\x20\x22','writeHead','14754CibcYD','cookie','10GqSgfa','isAuth','239374TTiPzA','xdg-open\x20\x22','2261xBzOeA','💡\x20如果浏览器没有自动打开,请手动复制上面的登录地址到浏览器中打开','https://dev.lovrabet.com:','82552vdobad','json','createServer','563936YeqZIa','win32','✅\x20浏览器已自动打开,请在浏览器中完成登录','object','catch','port','error','darwin','Auth\x20server\x20error:','silent','log','912616IxvLvx','text/html;\x20charset=utf-8','close','/api/auth/get-session','🔗\x20请手动复制登录地址到浏览器:','⚠️\x20\x20无法自动打开浏览器','utf-8','📍\x20登录地址:','platform','then','2192390TKvOFA','558PZvBWv','session','open\x20\x22','end','36344726EvQBpE','3yiXMcS'];a11_0x3d5f=function(){return _0x331004;};return a11_0x3d5f();}import a11_0x16e55e from'node:https';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(_0x2d4e6d){const _0x4c2ac0=a11_0x1ede,_0x53e230=_0x2d4e6d?.[_0x4c2ac0(0x1fd)]||![];if(await getIsSessionValid())return!![];const _0x3b4472=await(await fetch('https://g.yuntooai.com/cert/lovrabet-dev.json'))['json']();return new Promise(async(_0x3ee2f9,_0x4716d1)=>{const _0x179d16=_0x4c2ac0;let _0x2862ba=0x0;const _0x35cc08=a11_0x16e55e[_0x179d16(0x1f3)](_0x3b4472,async(_0x46b28c,_0x51da02)=>{const _0x2262dc=_0x179d16,_0x5a3725=getUserDomain(),_0x159838=_0x46b28c['headers'][_0x2262dc(0x1e9)]||'',_0x2558e7=await fetch(_0x5a3725+_0x2262dc(0x202),{'headers':{'cookie':_0x159838}})[_0x2262dc(0x208)](_0x54736c=>_0x54736c[_0x2262dc(0x1f2)]()),_0x452271=_0x2558e7&&_0x2558e7[_0x2262dc(0x1e1)]&&_0x2558e7['user'];if(_0x452271){writeFileSync(cookieFile,_0x159838,_0x2262dc(0x205)),_0x3ee2f9(!![]);const _0xf9cdb0='<!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>';_0x51da02[_0x2262dc(0x1e7)](0xc8,{'Content-Type':_0x2262dc(0x200)}),_0x51da02['end'](_0xf9cdb0),_0x35cc08[_0x2262dc(0x201)]();}else{const _0x12feb7=''+encodeURIComponent(_0x2262dc(0x1f0)+_0x2862ba);_0x51da02[_0x2262dc(0x1e7)](0x12e,{'location':_0x5a3725+'/sign-in?redirect='+_0x12feb7}),_0x51da02[_0x2262dc(0x1e3)]();return;}});_0x35cc08['listen'](0x0,'127.0.0.1',()=>{const _0x13a916=_0x179d16,_0x3f47ef=_0x35cc08['address']();_0x2862ba=typeof _0x3f47ef===_0x13a916(0x1f7)&&_0x3f47ef?_0x3f47ef[_0x13a916(0x1f9)]:Number(_0x3f47ef);const _0x22c081=_0x13a916(0x1f0)+_0x2862ba;!_0x53e230&&(console[_0x13a916(0x1fe)]('🔐\x20正在启动登录服务...'),console[_0x13a916(0x1fe)](_0x13a916(0x206),_0x22c081),console[_0x13a916(0x1fe)]('🌐\x20正在尝试自动打开浏览器...'),console[_0x13a916(0x1fe)](''),console[_0x13a916(0x1fe)](_0x13a916(0x1ef)),console[_0x13a916(0x1fe)]('')),openInBrowser(_0x22c081)['then'](_0x4364ac=>{const _0x5f4d3e=_0x13a916;!_0x53e230&&(_0x4364ac?console[_0x5f4d3e(0x1fe)](_0x5f4d3e(0x1f6)):(console[_0x5f4d3e(0x1fe)]('⚠️\x20\x20无法自动打开浏览器'),console[_0x5f4d3e(0x1fe)](_0x5f4d3e(0x203),_0x22c081)),console[_0x5f4d3e(0x1fe)](''));})[_0x13a916(0x1f8)](()=>{const _0x217787=_0x13a916;!_0x53e230&&(console[_0x217787(0x1fe)](_0x217787(0x204)),console[_0x217787(0x1fe)](_0x217787(0x203),_0x22c081),console[_0x217787(0x1fe)](''));});}),_0x35cc08['on'](_0x179d16(0x1fa),_0x24e5ce=>{const _0x407d94=_0x179d16;!_0x53e230&&console[_0x407d94(0x1fa)](_0x407d94(0x1fc),_0x24e5ce),_0x4716d1(_0x24e5ce);});});}function openInBrowser(_0x56286a){return new Promise(_0xe604f9=>{const _0x33f478=a11_0x1ede,_0xd9dcef=process[_0x33f478(0x207)];let _0x195952;if(_0xd9dcef===_0x33f478(0x1f5))_0x195952=_0x33f478(0x1e6)+_0x56286a+'\x22';else _0xd9dcef===_0x33f478(0x1fb)?_0x195952=_0x33f478(0x1e2)+_0x56286a+'\x22':_0x195952=_0x33f478(0x1ed)+_0x56286a+'\x22';exec(_0x195952,_0x24f89e=>{_0x24f89e?_0xe604f9(![]):_0xe604f9(!![]);});});}if(import.meta['main']){const isAuth=await authServer();console[a11_0xb9d948(0x1fe)](a11_0xb9d948(0x1eb),isAuth);}
@@ -1 +1 @@
1
- const a12_0x45b3bd=a12_0x418d;(function(_0x41460a,_0x8dcff1){const _0x47d603=a12_0x418d,_0x116567=_0x41460a();while(!![]){try{const _0x3e63fb=-parseInt(_0x47d603(0x8e))/0x1+parseInt(_0x47d603(0x8f))/0x2+-parseInt(_0x47d603(0x8c))/0x3*(-parseInt(_0x47d603(0x8b))/0x4)+-parseInt(_0x47d603(0x90))/0x5*(-parseInt(_0x47d603(0x91))/0x6)+parseInt(_0x47d603(0x95))/0x7+-parseInt(_0x47d603(0x92))/0x8+parseInt(_0x47d603(0x94))/0x9;if(_0x3e63fb===_0x8dcff1)break;else _0x116567['push'](_0x116567['shift']());}catch(_0x33cb13){_0x116567['push'](_0x116567['shift']());}}}(a12_0x28aa,0x925bb));import{mkdirSync}from'node:fs';import{homedir}from'node:os';function a12_0x28aa(){const _0x16c689=['220WnhgQm','27255MieUeo','/cookie','864199ErSYsP','667794QFVvzy','1155ohDBpT','9702UkMGwg','3664128fUsMlU','/.lovrabet','1740771sKUhZd','3648260DgqbTv'];a12_0x28aa=function(){return _0x16c689;};return a12_0x28aa();}export const configDir=homedir()+a12_0x45b3bd(0x93);export const cookieFile=configDir+a12_0x45b3bd(0x8d);function a12_0x418d(_0x507517,_0x442f42){const _0x28aafb=a12_0x28aa();return a12_0x418d=function(_0x418db8,_0x24bc1f){_0x418db8=_0x418db8-0x8b;let _0x3c4e86=_0x28aafb[_0x418db8];return _0x3c4e86;},a12_0x418d(_0x507517,_0x442f42);}mkdirSync(configDir,{'recursive':!![]});
1
+ function a12_0x1ae8(_0x25ea01,_0x1c16de){const _0x52349a=a12_0x5234();return a12_0x1ae8=function(_0x1ae8b4,_0x1ca69f){_0x1ae8b4=_0x1ae8b4-0x108;let _0x38497c=_0x52349a[_0x1ae8b4];return _0x38497c;},a12_0x1ae8(_0x25ea01,_0x1c16de);}const a12_0x5e47c2=a12_0x1ae8;(function(_0x687ceb,_0x521e39){const _0x5d290e=a12_0x1ae8,_0x228605=_0x687ceb();while(!![]){try{const _0x178651=parseInt(_0x5d290e(0x10b))/0x1+-parseInt(_0x5d290e(0x112))/0x2+parseInt(_0x5d290e(0x10c))/0x3*(parseInt(_0x5d290e(0x10a))/0x4)+parseInt(_0x5d290e(0x113))/0x5+-parseInt(_0x5d290e(0x10d))/0x6+-parseInt(_0x5d290e(0x108))/0x7*(-parseInt(_0x5d290e(0x109))/0x8)+parseInt(_0x5d290e(0x110))/0x9*(-parseInt(_0x5d290e(0x111))/0xa);if(_0x178651===_0x521e39)break;else _0x228605['push'](_0x228605['shift']());}catch(_0x553c97){_0x228605['push'](_0x228605['shift']());}}}(a12_0x5234,0xea550));function a12_0x5234(){const _0x1aebdc=['8bFsMII','148Exbnml','415298PppCYV','104313tFEQtA','7856358ZyVZDp','/.lovrabet','/cookie','2232kYDNPB','69820ucQqrM','337970RgjFwj','7266725tuIWvW','7101976PHbixu'];a12_0x5234=function(){return _0x1aebdc;};return a12_0x5234();}import{mkdirSync}from'node:fs';import{homedir}from'node:os';export const configDir=homedir()+a12_0x5e47c2(0x10e);export const cookieFile=configDir+a12_0x5e47c2(0x10f);mkdirSync(configDir,{'recursive':!![]});
@@ -1 +1 @@
1
- function a13_0x720a(){var _0x2d5242=['735pNyHIc','1108260QpsPGO','32885PPKORT','5985cLhALV','6138rQEVYV','670sDtPSE','73182lxhaQd','40803llbXQi','234Kojhte','2222hQJHZB','1216UqcbXx','utf-8'];a13_0x720a=function(){return _0x2d5242;};return a13_0x720a();}function a13_0x2464(_0x2d0009,_0x3e9ef1){var _0x720a04=a13_0x720a();return a13_0x2464=function(_0x2464f9,_0x4cc7ec){_0x2464f9=_0x2464f9-0x155;var _0x1220b0=_0x720a04[_0x2464f9];return _0x1220b0;},a13_0x2464(_0x2d0009,_0x3e9ef1);}(function(_0xbc96c8,_0x9aa02e){var _0x5e3e6e=a13_0x2464,_0x39a552=_0xbc96c8();while(!![]){try{var _0x2ec8d1=parseInt(_0x5e3e6e(0x15d))/0x1+-parseInt(_0x5e3e6e(0x160))/0x2*(-parseInt(_0x5e3e6e(0x157))/0x3)+parseInt(_0x5e3e6e(0x158))/0x4+-parseInt(_0x5e3e6e(0x159))/0x5*(parseInt(_0x5e3e6e(0x15f))/0x6)+-parseInt(_0x5e3e6e(0x15e))/0x7+parseInt(_0x5e3e6e(0x155))/0x8*(-parseInt(_0x5e3e6e(0x15a))/0x9)+-parseInt(_0x5e3e6e(0x15c))/0xa*(parseInt(_0x5e3e6e(0x15b))/0xb);if(_0x2ec8d1===_0x9aa02e)break;else _0x39a552['push'](_0x39a552['shift']());}catch(_0x14e142){_0x39a552['push'](_0x39a552['shift']());}}}(a13_0x720a,0x361cc));import{readFileSync}from'node:fs';import{cookieFile}from'./constant.js';export function getCookie(){var _0x2c60b2=a13_0x2464;try{return readFileSync(cookieFile,_0x2c60b2(0x156));}catch{}return'';}
1
+ (function(_0x3a0597,_0x22ee3d){var _0x1e8a5e=a13_0x1154,_0x2999d4=_0x3a0597();while(!![]){try{var _0x337931=parseInt(_0x1e8a5e(0x168))/0x1*(parseInt(_0x1e8a5e(0x163))/0x2)+parseInt(_0x1e8a5e(0x16b))/0x3*(parseInt(_0x1e8a5e(0x162))/0x4)+-parseInt(_0x1e8a5e(0x167))/0x5+-parseInt(_0x1e8a5e(0x166))/0x6+-parseInt(_0x1e8a5e(0x165))/0x7*(parseInt(_0x1e8a5e(0x16c))/0x8)+-parseInt(_0x1e8a5e(0x169))/0x9+-parseInt(_0x1e8a5e(0x164))/0xa*(-parseInt(_0x1e8a5e(0x16a))/0xb);if(_0x337931===_0x22ee3d)break;else _0x2999d4['push'](_0x2999d4['shift']());}catch(_0x23c9dc){_0x2999d4['push'](_0x2999d4['shift']());}}}(a13_0x14ee,0x96f4b));function a13_0x1154(_0x3ab22a,_0x4a0b97){var _0x14ee21=a13_0x14ee();return a13_0x1154=function(_0x1154fa,_0x290353){_0x1154fa=_0x1154fa-0x161;var _0x4c09a9=_0x14ee21[_0x1154fa];return _0x4c09a9;},a13_0x1154(_0x3ab22a,_0x4a0b97);}function a13_0x14ee(){var _0x5e39dd=['1189785NDtEKp','6212736RbvTwV','utf-8','4OjPmwb','57406trhXuy','393460HXYZnv','7eXqkxh','5889852NakwGM','569895IYfDwf','43fPpKzz','53172XxYUsw','242YBEnMt'];a13_0x14ee=function(){return _0x5e39dd;};return a13_0x14ee();}import{readFileSync}from'node:fs';import{cookieFile}from'./constant.js';export function getCookie(){var _0x2b43b4=a13_0x1154;try{return readFileSync(cookieFile,_0x2b43b4(0x161));}catch{}return'';}
@@ -1 +1 @@
1
- (function(_0x3ce95f,_0x1366e2){const _0x325c1e=a14_0xfdb9,_0x1d48ed=_0x3ce95f();while(!![]){try{const _0x1f32c2=parseInt(_0x325c1e(0xdc))/0x1+parseInt(_0x325c1e(0xdf))/0x2*(-parseInt(_0x325c1e(0xd5))/0x3)+-parseInt(_0x325c1e(0xd8))/0x4*(-parseInt(_0x325c1e(0xd6))/0x5)+parseInt(_0x325c1e(0xd1))/0x6+parseInt(_0x325c1e(0xdd))/0x7*(-parseInt(_0x325c1e(0xdb))/0x8)+-parseInt(_0x325c1e(0xd0))/0x9*(parseInt(_0x325c1e(0xe0))/0xa)+parseInt(_0x325c1e(0xde))/0xb*(parseInt(_0x325c1e(0xd2))/0xc);if(_0x1f32c2===_0x1366e2)break;else _0x1d48ed['push'](_0x1d48ed['shift']());}catch(_0x292665){_0x1d48ed['push'](_0x1d48ed['shift']());}}}(a14_0x54c9,0x8b8e4));function a14_0xfdb9(_0x586534,_0x1ea7da){const _0x54c913=a14_0x54c9();return a14_0xfdb9=function(_0xfdb90c,_0x2d09d2){_0xfdb90c=_0xfdb90c-0xd0;let _0x28d23a=_0x54c913[_0xfdb90c];return _0x28d23a;},a14_0xfdb9(_0x586534,_0x1ea7da);}function a14_0x54c9(){const _0x35af0a=['10Hzzihh','129825gTtBrG','3692328bPQoMs','120odeFml','session','json','3asuBfi','10lxlwaD','/api/auth/get-session','580132PGULBL','then','user','433880QIRJMs','79389ZHesbS','63nWPOiX','1207019wtZmjy','2015946xgSxXt'];a14_0x54c9=function(){return _0x35af0a;};return a14_0x54c9();}import{existsSync,readFileSync}from'node:fs';import{getUserDomain}from'../constant/domain.js';import{cookieFile}from'./constant.js';export async function getIsSessionValid(){const _0x5b37c3=a14_0xfdb9;try{if(!existsSync(cookieFile))return![];const _0x478d1e=readFileSync(cookieFile,'utf-8'),_0x2b068b=await fetch(getUserDomain()+_0x5b37c3(0xd7),{'headers':{'cookie':_0x478d1e}})[_0x5b37c3(0xd9)](_0x9c5bfb=>_0x9c5bfb[_0x5b37c3(0xd4)]());return _0x2b068b&&_0x2b068b[_0x5b37c3(0xd3)]&&_0x2b068b[_0x5b37c3(0xda)];}catch{}return![];}
1
+ function a14_0x4809(_0x188bde,_0x1e0607){const _0x19019e=a14_0x1901();return a14_0x4809=function(_0x480954,_0xf24997){_0x480954=_0x480954-0x1c9;let _0x2a522e=_0x19019e[_0x480954];return _0x2a522e;},a14_0x4809(_0x188bde,_0x1e0607);}(function(_0x9908ed,_0x5074c0){const _0x4450c8=a14_0x4809,_0x1eed40=_0x9908ed();while(!![]){try{const _0x96e04b=-parseInt(_0x4450c8(0x1ca))/0x1+-parseInt(_0x4450c8(0x1d2))/0x2+-parseInt(_0x4450c8(0x1d7))/0x3+parseInt(_0x4450c8(0x1cd))/0x4*(parseInt(_0x4450c8(0x1d0))/0x5)+parseInt(_0x4450c8(0x1c9))/0x6*(-parseInt(_0x4450c8(0x1d1))/0x7)+-parseInt(_0x4450c8(0x1ce))/0x8+parseInt(_0x4450c8(0x1d3))/0x9*(parseInt(_0x4450c8(0x1d5))/0xa);if(_0x96e04b===_0x5074c0)break;else _0x1eed40['push'](_0x1eed40['shift']());}catch(_0x206f88){_0x1eed40['push'](_0x1eed40['shift']());}}}(a14_0x1901,0x9f965));function a14_0x1901(){const _0x16bd1b=['json','3959360pkgPyW','user','2752374vIzxdA','6dHWulE','317785MVTHFo','/api/auth/get-session','session','586308rbaEMQ','6678984xzNOjJ','then','5ZMTWSH','1276919QNAqZp','2399470uIJrJp','90EGAXAW'];a14_0x1901=function(){return _0x16bd1b;};return a14_0x1901();}import{existsSync,readFileSync}from'node:fs';import{getUserDomain}from'../constant/domain.js';import{cookieFile}from'./constant.js';export async function getIsSessionValid(){const _0x220f2c=a14_0x4809;try{if(!existsSync(cookieFile))return![];const _0x2af84a=readFileSync(cookieFile,'utf-8'),_0x1e7872=await fetch(getUserDomain()+_0x220f2c(0x1cb),{'headers':{'cookie':_0x2af84a}})[_0x220f2c(0x1cf)](_0x4484fa=>_0x4484fa[_0x220f2c(0x1d4)]());return _0x1e7872&&_0x1e7872[_0x220f2c(0x1cc)]&&_0x1e7872[_0x220f2c(0x1d6)];}catch{}return![];}
@@ -1 +1 @@
1
- function a15_0x394b(_0x3c912e,_0x1ed9be){var _0x20e6e2=a15_0x20e6();return a15_0x394b=function(_0x394b0b,_0x31978a){_0x394b0b=_0x394b0b-0x184;var _0xc9147d=_0x20e6e2[_0x394b0b];return _0xc9147d;},a15_0x394b(_0x3c912e,_0x1ed9be);}(function(_0x146f49,_0x21ad3a){var _0xa63299=a15_0x394b,_0x20c05b=_0x146f49();while(!![]){try{var _0x3502de=-parseInt(_0xa63299(0x189))/0x1*(parseInt(_0xa63299(0x190))/0x2)+parseInt(_0xa63299(0x18c))/0x3*(parseInt(_0xa63299(0x184))/0x4)+parseInt(_0xa63299(0x192))/0x5+parseInt(_0xa63299(0x185))/0x6*(parseInt(_0xa63299(0x18f))/0x7)+parseInt(_0xa63299(0x191))/0x8+-parseInt(_0xa63299(0x18d))/0x9*(parseInt(_0xa63299(0x18e))/0xa)+parseInt(_0xa63299(0x188))/0xb*(-parseInt(_0xa63299(0x18a))/0xc);if(_0x3502de===_0x21ad3a)break;else _0x20c05b['push'](_0x20c05b['shift']());}catch(_0x668ae5){_0x20c05b['push'](_0x20c05b['shift']());}}}(a15_0x20e6,0x6eac6));import{unlinkSync,existsSync}from'node:fs';import{cookieFile}from'./constant.js';function a15_0x20e6(){var _0x57abe5=['8187612GPYXFp','log','41529ZoUxCW','18zMvWtU','1297550rGpEAH','1099xPEIqn','312478HwtKFU','4634952amtOqt','1145535bsVqBc','192jFNZBw','20910kjoAyX','✓\x20已退出登录','!\x20当前未登录','11nOtYOM','4mMakqf'];a15_0x20e6=function(){return _0x57abe5;};return a15_0x20e6();}export function logout(){var _0x472b82=a15_0x394b;existsSync(cookieFile)?(unlinkSync(cookieFile),console['log'](_0x472b82(0x186))):console[_0x472b82(0x18b)](_0x472b82(0x187));}
1
+ function a15_0x5ef0(_0x241fc6,_0x2ac870){var _0x717f4f=a15_0x717f();return a15_0x5ef0=function(_0x5ef0da,_0x409fc6){_0x5ef0da=_0x5ef0da-0x1c4;var _0x18871e=_0x717f4f[_0x5ef0da];return _0x18871e;},a15_0x5ef0(_0x241fc6,_0x2ac870);}(function(_0x38d521,_0x4bd381){var _0x2beba0=a15_0x5ef0,_0xa2e881=_0x38d521();while(!![]){try{var _0x3f50a6=-parseInt(_0x2beba0(0x1c7))/0x1*(parseInt(_0x2beba0(0x1c5))/0x2)+parseInt(_0x2beba0(0x1c8))/0x3*(parseInt(_0x2beba0(0x1c4))/0x4)+parseInt(_0x2beba0(0x1c6))/0x5+-parseInt(_0x2beba0(0x1ca))/0x6*(-parseInt(_0x2beba0(0x1d1))/0x7)+parseInt(_0x2beba0(0x1ce))/0x8*(parseInt(_0x2beba0(0x1cc))/0x9)+parseInt(_0x2beba0(0x1cb))/0xa*(parseInt(_0x2beba0(0x1c9))/0xb)+-parseInt(_0x2beba0(0x1d0))/0xc;if(_0x3f50a6===_0x4bd381)break;else _0xa2e881['push'](_0xa2e881['shift']());}catch(_0x368787){_0xa2e881['push'](_0xa2e881['shift']());}}}(a15_0x717f,0xdc16e));import{unlinkSync,existsSync}from'node:fs';function a15_0x717f(){var _0x4c6a95=['log','572480mUfLyB','✓\x20已退出登录','64413912lpyKnQ','1054109TAGgAw','24VrVdUS','2810208iEhFSL','6291740uriMxC','1pmWEnf','732315oINKdP','781oVsRnY','66nlNvNF','212110mrQjan','225fdinOY'];a15_0x717f=function(){return _0x4c6a95;};return a15_0x717f();}import{cookieFile}from'./constant.js';export function logout(){var _0x5cadf8=a15_0x5ef0;existsSync(cookieFile)?(unlinkSync(cookieFile),console[_0x5cadf8(0x1cd)](_0x5cadf8(0x1cf))):console[_0x5cadf8(0x1cd)]('!\x20当前未登录');}
package/lib/cli.js CHANGED
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- const a16_0x198d79=a16_0xee6c;(function(_0x4e8fe6,_0x1546d1){const _0x4def12=a16_0xee6c,_0x44310c=_0x4e8fe6();while(!![]){try{const _0x44965f=parseInt(_0x4def12(0xa2))/0x1+-parseInt(_0x4def12(0x98))/0x2+parseInt(_0x4def12(0x91))/0x3+parseInt(_0x4def12(0xa6))/0x4+parseInt(_0x4def12(0xa1))/0x5*(parseInt(_0x4def12(0x9e))/0x6)+-parseInt(_0x4def12(0xa0))/0x7*(parseInt(_0x4def12(0x8f))/0x8)+parseInt(_0x4def12(0x94))/0x9;if(_0x44965f===_0x1546d1)break;else _0x44310c['push'](_0x44310c['shift']());}catch(_0xe37870){_0x44310c['push'](_0x44310c['shift']());}}}(a16_0x1046,0x40deb));import{jsx as a16_0x3a866d}from'react/jsx-runtime';function a16_0xee6c(_0xc23851,_0x39dc64){const _0x10468d=a16_0x1046();return a16_0xee6c=function(_0xee6c0f,_0x46639a){_0xee6c0f=_0xee6c0f-0x8f;let _0x44b6c3=_0x10468d[_0xee6c0f];return _0x44b6c3;},a16_0xee6c(_0xc23851,_0x39dc64);}import a16_0x4e84e4 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_0x1046(){const _0x251579=['add','watch','api','186ZjGoRc','preview','2129043fYoQRP','2705HjjEQM','64292FXRnsJ','config','input','trim','154764sFavIT','exit','\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登录认证\x0a\x09\x20\x20$\x20lovrabet\x20logout\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创建一个项目\x0a\x09\x20\x20$\x20lovrabet\x20add\x20page\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启动项目\x0a\x09\x20\x20$\x20lovrabet\x20build\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预览项目\x0a\x09\x20\x20$\x20lovrabet\x20preview\x20--watch\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项目配置\x0a\x09\x20\x20$\x20lovrabet\x20api\x20pull\x20[app-code]\x20\x20//\x20拉取并生成\x20API\x20配置文件\x0a\x09\x20\x20$\x20lovrabet\x20logs\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清空日志\x0a','setLogPath','error','8NPZToG','clear','1001664rbZHqS','page','logs','3859578zkcMgT','boolean','flags','cwd','625256aGZErp','auth','start'];a16_0x1046=function(){return _0x251579;};return a16_0x1046();}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_0x4e84e4(a16_0x198d79(0xa8),{'importMeta':import.meta,'flags':{'name':{'type':'string'},'clear':{'type':a16_0x198d79(0x95)}}});await run();async function run(){const _0x3ad47b=a16_0x198d79,_0xf725e7=cli[_0x3ad47b(0xa4)][0x0];switch(_0xf725e7){case'create':{const _0xc3cb64=cli[_0x3ad47b(0xa4)][0x1]?.[_0x3ad47b(0xa5)]();render(a16_0x3a866d(CreateApp,{'projectCode':_0xc3cb64}));break;}case _0x3ad47b(0x9b):{cli['input'][0x1]===_0x3ad47b(0x92)&&(logger[_0x3ad47b(0xa9)](process[_0x3ad47b(0x97)]()),render(a16_0x3a866d(AddPage,{})));break;}case _0x3ad47b(0x9a):{try{logger[_0x3ad47b(0xa9)](process['cwd']()),await runStart();}catch(_0x5f4c5c){console['error'](_0x5f4c5c),process[_0x3ad47b(0xa7)](0x1);}break;}case'build':{try{logger[_0x3ad47b(0xa9)](process[_0x3ad47b(0x97)]()),await runBuild();}catch(_0x1fbcb8){console['error'](_0x1fbcb8),process[_0x3ad47b(0xa7)](0x1);}break;}case _0x3ad47b(0x9f):{const _0x4f5a60=cli[_0x3ad47b(0x96)][_0x3ad47b(0x9c)];logger['setLogPath'](process[_0x3ad47b(0x97)]());if(_0x4f5a60)try{await Promise['all']([runBuildWatch(),runPreview()]);}catch(_0x4784c8){console[_0x3ad47b(0xaa)](_0x4784c8),process[_0x3ad47b(0xa7)](0x1);}else try{await runPreview();}catch(_0x4b18b3){console['error'](_0x4b18b3),process[_0x3ad47b(0xa7)](0x1);}break;}case _0x3ad47b(0xa3):{render(a16_0x3a866d(Config,{'cli':cli}));break;}case _0x3ad47b(0x9d):{await apiCli(cli);break;}case _0x3ad47b(0x99):{render(a16_0x3a866d(AuthServer,{}));break;}case'logout':{logout();break;}case _0x3ad47b(0x93):{cli['flags'][_0x3ad47b(0x90)]?clearLogs():showLogs();break;}default:render(a16_0x3a866d(Help,{}));break;}}
2
+ const a16_0x3dcfda=a16_0x4034;(function(_0x50edf0,_0x104f94){const _0x1054a=a16_0x4034,_0x33f48b=_0x50edf0();while(!![]){try{const _0x3d4cc2=parseInt(_0x1054a(0x1e1))/0x1*(-parseInt(_0x1054a(0x1e0))/0x2)+parseInt(_0x1054a(0x1e8))/0x3*(parseInt(_0x1054a(0x1f5))/0x4)+parseInt(_0x1054a(0x1e5))/0x5+parseInt(_0x1054a(0x1de))/0x6+parseInt(_0x1054a(0x1dc))/0x7*(parseInt(_0x1054a(0x1e4))/0x8)+parseInt(_0x1054a(0x1f4))/0x9*(-parseInt(_0x1054a(0x1ed))/0xa)+parseInt(_0x1054a(0x1ea))/0xb*(-parseInt(_0x1054a(0x1ee))/0xc);if(_0x3d4cc2===_0x104f94)break;else _0x33f48b['push'](_0x33f48b['shift']());}catch(_0x33132a){_0x33f48b['push'](_0x33f48b['shift']());}}}(a16_0x1903,0x27aea));function a16_0x1903(){const _0x275162=['2790900JmdQVY','2920yRuhFL','clear','page','setLogPath','logout','input','cwd','202993cnnNpE','auth','801588MOhBEK','start','764ZHFvpF','523TpXfOH','boolean','trim','88WzaZeD','1294270ZLXyaV','preview','watch','183PIiwDA','exit','11VwUvAR','string','flags','10UXBQbh','1002564jlZJqv','\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登录认证\x0a\x09\x20\x20$\x20lovrabet\x20logout\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创建一个项目\x0a\x09\x20\x20$\x20lovrabet\x20add\x20page\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启动项目\x0a\x09\x20\x20$\x20lovrabet\x20build\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预览项目\x0a\x09\x20\x20$\x20lovrabet\x20preview\x20--watch\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项目配置\x0a\x09\x20\x20$\x20lovrabet\x20api\x20pull\x20[app-code]\x20\x20//\x20拉取并生成\x20API\x20配置文件\x0a\x09\x20\x20$\x20lovrabet\x20logs\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清空日志\x0a','add','logs','all','error'];a16_0x1903=function(){return _0x275162;};return a16_0x1903();}import{jsx as a16_0x1d08fb}from'react/jsx-runtime';import a16_0x16a814 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';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';function a16_0x4034(_0x1dcd58,_0x27addf){const _0x19035f=a16_0x1903();return a16_0x4034=function(_0x40345b,_0x57d36d){_0x40345b=_0x40345b-0x1da;let _0x3286c2=_0x19035f[_0x40345b];return _0x3286c2;},a16_0x4034(_0x1dcd58,_0x27addf);}import{logger}from'./utils/logger.js';import{showLogs,clearLogs}from'./cmd/logs.js';const cli=a16_0x16a814(a16_0x3dcfda(0x1ef),{'importMeta':import.meta,'flags':{'name':{'type':a16_0x3dcfda(0x1eb)},'clear':{'type':a16_0x3dcfda(0x1e2)}}});await run();async function run(){const _0x5b9966=a16_0x3dcfda,_0x306798=cli[_0x5b9966(0x1da)][0x0];switch(_0x306798){case'create':{const _0x51073d=cli['input'][0x1]?.[_0x5b9966(0x1e3)]();render(a16_0x1d08fb(CreateApp,{'projectCode':_0x51073d}));break;}case _0x5b9966(0x1f0):{cli[_0x5b9966(0x1da)][0x1]===_0x5b9966(0x1f7)&&(logger[_0x5b9966(0x1f8)](process['cwd']()),render(a16_0x1d08fb(AddPage,{})));break;}case _0x5b9966(0x1df):{try{logger['setLogPath'](process['cwd']()),await runStart();}catch(_0x3bcea0){console[_0x5b9966(0x1f3)](_0x3bcea0),process[_0x5b9966(0x1e9)](0x1);}break;}case'build':{try{logger['setLogPath'](process[_0x5b9966(0x1db)]()),await runBuild();}catch(_0x5536d8){console[_0x5b9966(0x1f3)](_0x5536d8),process[_0x5b9966(0x1e9)](0x1);}break;}case _0x5b9966(0x1e6):{const _0x169021=cli['flags'][_0x5b9966(0x1e7)];logger['setLogPath'](process[_0x5b9966(0x1db)]());if(_0x169021)try{await Promise[_0x5b9966(0x1f2)]([runBuildWatch(),runPreview()]);}catch(_0x4fb9d3){console[_0x5b9966(0x1f3)](_0x4fb9d3),process[_0x5b9966(0x1e9)](0x1);}else try{await runPreview();}catch(_0xf40b5c){console[_0x5b9966(0x1f3)](_0xf40b5c),process['exit'](0x1);}break;}case'config':{render(a16_0x1d08fb(Config,{'cli':cli}));break;}case'api':{await apiCli(cli);break;}case _0x5b9966(0x1dd):{render(a16_0x1d08fb(AuthServer,{}));break;}case _0x5b9966(0x1f9):{logout();break;}case _0x5b9966(0x1f1):{cli[_0x5b9966(0x1ec)][_0x5b9966(0x1f6)]?clearLogs():showLogs();break;}default:render(a16_0x1d08fb(Help,{}));break;}}
@@ -1 +1 @@
1
- function a17_0x38e6(_0x582189,_0x14fe78){const _0xb039cd=a17_0xb039();return a17_0x38e6=function(_0x38e649,_0x804f28){_0x38e649=_0x38e649-0x19f;let _0x53a30b=_0xb039cd[_0x38e649];return _0x53a30b;},a17_0x38e6(_0x582189,_0x14fe78);}function a17_0xb039(){const _0x444ed=['node_modules','55932oMNPAD','4284672AQXcpd','build','vite','7037577pbrGRN','npm\x20run\x20build\x20exited\x20with\x20code\x20','env','796198nFgWog','error','2777580AYnnfi','3151938hQGCUl','2156712QSkkGL','close','--watch','8OyZTYh','1spPVFN'];a17_0xb039=function(){return _0x444ed;};return a17_0xb039();}(function(_0x5766c6,_0xaad145){const _0x515ee8=a17_0x38e6,_0x1259ca=_0x5766c6();while(!![]){try{const _0x2285d4=parseInt(_0x515ee8(0x1a8))/0x1*(parseInt(_0x515ee8(0x1a0))/0x2)+-parseInt(_0x515ee8(0x1a3))/0x3+parseInt(_0x515ee8(0x1a4))/0x4+parseInt(_0x515ee8(0x1a2))/0x5+-parseInt(_0x515ee8(0x1aa))/0x6+-parseInt(_0x515ee8(0x1ab))/0x7+parseInt(_0x515ee8(0x1a7))/0x8*(parseInt(_0x515ee8(0x1ae))/0x9);if(_0x2285d4===_0xaad145)break;else _0x1259ca['push'](_0x1259ca['shift']());}catch(_0x2d2f9f){_0x1259ca['push'](_0x1259ca['shift']());}}}(a17_0xb039,0x9323a));import{spawn}from'node:child_process';import{delimiter,join}from'node:path';export function runBuildWatch(){return new Promise((_0x4da108,_0x13ed51)=>{const _0x4f9795=a17_0x38e6,_0x245f96=spawn(_0x4f9795(0x1ad),[_0x4f9795(0x1ac),_0x4f9795(0x1a6)],{'stdio':'inherit','shell':!![],'env':{...process[_0x4f9795(0x19f)],'PATH':''+join(process['cwd'](),_0x4f9795(0x1a9),'.bin')+delimiter+process[_0x4f9795(0x19f)]['PATH']}});_0x245f96['on'](_0x4f9795(0x1a5),_0x1205ce=>{const _0x489677=_0x4f9795;if(_0x1205ce===0x0||_0x1205ce===null)_0x4da108();else _0x13ed51(new Error(_0x489677(0x1af)+_0x1205ce));}),_0x245f96['on'](_0x4f9795(0x1a1),_0x13ed51);});}
1
+ (function(_0x106e8c,_0x214046){const _0x2557ef=a17_0x40fc,_0x547527=_0x106e8c();while(!![]){try{const _0x219789=parseInt(_0x2557ef(0x133))/0x1*(-parseInt(_0x2557ef(0x13b))/0x2)+-parseInt(_0x2557ef(0x13c))/0x3+-parseInt(_0x2557ef(0x139))/0x4+parseInt(_0x2557ef(0x13a))/0x5*(parseInt(_0x2557ef(0x131))/0x6)+parseInt(_0x2557ef(0x12c))/0x7+parseInt(_0x2557ef(0x134))/0x8+parseInt(_0x2557ef(0x132))/0x9;if(_0x219789===_0x214046)break;else _0x547527['push'](_0x547527['shift']());}catch(_0x589efe){_0x547527['push'](_0x547527['shift']());}}}(a17_0x2a01,0x71c1b));import{spawn}from'node:child_process';function a17_0x40fc(_0x393bce,_0x1dd1db){const _0x2a0181=a17_0x2a01();return a17_0x40fc=function(_0x40fc69,_0x4677d8){_0x40fc69=_0x40fc69-0x12a;let _0x4b7bf1=_0x2a0181[_0x40fc69];return _0x4b7bf1;},a17_0x40fc(_0x393bce,_0x1dd1db);}import{delimiter,join}from'node:path';function a17_0x2a01(){const _0x581368=['error','build','cwd','766224XYnmZl','5320017ShMKaZ','4651vRmwKL','378024RVkyVH','vite','env','inherit','npm\x20run\x20build\x20exited\x20with\x20code\x20','3182692psaotg','35AdSfUi','116fqDVve','2141760idZgWQ','node_modules','.bin','--watch','4991028htNqXi','PATH'];a17_0x2a01=function(){return _0x581368;};return a17_0x2a01();}export function runBuildWatch(){return new Promise((_0x1ad034,_0x2399e2)=>{const _0x3483bb=a17_0x40fc,_0x47ed61=spawn(_0x3483bb(0x135),[_0x3483bb(0x12f),_0x3483bb(0x12b)],{'stdio':_0x3483bb(0x137),'shell':!![],'env':{...process['env'],'PATH':''+join(process[_0x3483bb(0x130)](),_0x3483bb(0x13d),_0x3483bb(0x12a))+delimiter+process[_0x3483bb(0x136)][_0x3483bb(0x12d)]}});_0x47ed61['on']('close',_0x854a0e=>{const _0x427d04=_0x3483bb;if(_0x854a0e===0x0||_0x854a0e===null)_0x1ad034();else _0x2399e2(new Error(_0x427d04(0x138)+_0x854a0e));}),_0x47ed61['on'](_0x3483bb(0x12e),_0x2399e2);});}