@lovrabet/cli 1.1.5-beta.0 → 1.1.7

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 (46) hide show
  1. package/lib/add-page/input-page-router.js +1 -1
  2. package/lib/add-page/main.js +1 -1
  3. package/lib/add-page/select-page-template.js +1 -1
  4. package/lib/api/api-pull-ui.js +1 -1
  5. package/lib/api/format-dataset.js +1 -1
  6. package/lib/api/generate-api-file.js +1 -1
  7. package/lib/api/main.js +1 -1
  8. package/lib/api/pull-silent.js +1 -1
  9. package/lib/api/pull.js +1 -1
  10. package/lib/auth/auth-server-ui.js +1 -1
  11. package/lib/auth/auth-server.js +1 -1
  12. package/lib/auth/constant.js +1 -1
  13. package/lib/auth/get-cookie.js +1 -1
  14. package/lib/auth/is-session-valid.js +1 -1
  15. package/lib/auth/logout.js +1 -1
  16. package/lib/cli.js +1 -1
  17. package/lib/cmd/build-watch.js +1 -1
  18. package/lib/cmd/build.js +1 -1
  19. package/lib/cmd/logs.js +1 -1
  20. package/lib/cmd/preview.js +1 -1
  21. package/lib/cmd/start.js +1 -1
  22. package/lib/config/config-help.js +1 -1
  23. package/lib/config/main.js +1 -1
  24. package/lib/constant/domain.js +1 -1
  25. package/lib/constant/env.js +1 -1
  26. package/lib/create-app/enhanced-guided-create.js +1 -1
  27. package/lib/create-app/format-elapsed.js +1 -1
  28. package/lib/create-app/main.js +1 -1
  29. package/lib/create-app/task-finished.js +1 -1
  30. package/lib/create-app/task-loading.js +1 -1
  31. package/lib/create-app/task-running.js +1 -1
  32. package/lib/create-app/task-time.js +1 -1
  33. package/lib/create-app/use-copy-project-template.js +1 -1
  34. package/lib/create-app/use-format-code.js +1 -1
  35. package/lib/create-app/use-install-dependencies.js +1 -1
  36. package/lib/help.js +1 -1
  37. package/lib/utils/config.js +1 -1
  38. package/lib/utils/copy-directory.js +1 -1
  39. package/lib/utils/http-client.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/projects/sub-app-react-demo/package-lock.json +4 -4
  45. package/templates/projects/sub-app-react-demo/package.json +1 -1
  46. package/templates/projects/sub-app-react-demo/src/router/index.tsx +4 -4
@@ -1 +1 @@
1
- (function(_0x34c340,_0x292309){const _0x2b6720=a0_0x1428,_0x360ea0=_0x34c340();while(!![]){try{const _0x3399f3=parseInt(_0x2b6720(0x14f))/0x1*(-parseInt(_0x2b6720(0x147))/0x2)+parseInt(_0x2b6720(0x140))/0x3+parseInt(_0x2b6720(0x153))/0x4+-parseInt(_0x2b6720(0x150))/0x5*(parseInt(_0x2b6720(0x13f))/0x6)+parseInt(_0x2b6720(0x155))/0x7*(parseInt(_0x2b6720(0x146))/0x8)+-parseInt(_0x2b6720(0x13b))/0x9+-parseInt(_0x2b6720(0x152))/0xa;if(_0x3399f3===_0x292309)break;else _0x360ea0['push'](_0x360ea0['shift']());}catch(_0x1279c6){_0x360ea0['push'](_0x360ea0['shift']());}}}(a0_0x5b74,0x8a7fd));import{jsx as a0_0x279700,jsxs as a0_0x31fed5}from'react/jsx-runtime';import{useState}from'react';import{Text,Box,useInput}from'ink';import a0_0x4220ef from'node:fs';function a0_0x1428(_0x1dd9c3,_0x55f71f){const _0x5b7480=a0_0x5b74();return a0_0x1428=function(_0x142800,_0x45d001){_0x142800=_0x142800-0x139;let _0x4185e4=_0x5b7480[_0x142800];return _0x4185e4;},a0_0x1428(_0x1dd9c3,_0x55f71f);}function a0_0x5b74(){const _0x3e1def=['366224eFBvEK','926RHjAwB','路径不能包含连续的\x20/','页面路径\x20','existsSync','\x20Step2:\x20','endsWith','页面路径不合法','includes','683FIwvBw','15nrKPmZ','backspace','1371890gPnFbG','1645876qpcuEW','路径中的每个段只能以字母或数字开头,且只包含字母、数字、-\x20和\x20_','42jVZbbP','return','test','\x20已存在,请使用其他路径','775755WYlOEk','length','gray','split','839346nPwpkj','2521326gbwCoy','页面路径长度不能超过\x20100\x20个字符','页面路由地址:\x20','delete','trim','\x20直接回车确认,或输入自定义路由地址'];a0_0x5b74=function(){return _0x3e1def;};return a0_0x5b74();}export function InputProjectCode(_0xeba6b2){const _0x2f0f6a=a0_0x1428,{onSubmit:_0x46e227,pagePath:_0x46eaa4}=_0xeba6b2,[_0x4a1a9e,_0x29b815]=useState(''),[_0x56517c,_0x17ac3d]=useState(''),_0x50e489='my-page';function _0x181f4d(_0x3cd56a){const _0x33ac46=a0_0x1428;if(_0x3cd56a[_0x33ac46(0x13c)]>0x64)return{'valid':![],'message':_0x33ac46(0x141)};if(_0x3cd56a['startsWith']('/')||_0x3cd56a[_0x33ac46(0x14c)]('/'))return{'valid':![],'message':'路径不能以\x20/\x20开头或结尾'};if(_0x3cd56a[_0x33ac46(0x14e)]('//'))return{'valid':![],'message':_0x33ac46(0x148)};const _0x79f5ac=_0x3cd56a[_0x33ac46(0x13e)]('/');for(const _0x443060 of _0x79f5ac){if(!_0x443060)continue;const _0xcb1ed7=/^[A-Za-z0-9][A-Za-z0-9_-]*$/;if(!_0xcb1ed7[_0x33ac46(0x139)](_0x443060))return{'valid':![],'message':_0x33ac46(0x154)};}return{'valid':!![]};}return useInput((_0x237262,_0x45b5a6)=>{const _0x94ccf8=a0_0x1428;if(_0x45b5a6[_0x94ccf8(0x156)]){const _0x18c4bf=_0x4a1a9e[_0x94ccf8(0x144)]()||_0x50e489;if(_0x56517c)return;const _0x32a9e7=_0x46eaa4+'/'+_0x18c4bf;if(a0_0x4220ef[_0x94ccf8(0x14a)](_0x32a9e7)){_0x17ac3d(_0x94ccf8(0x149)+_0x18c4bf+_0x94ccf8(0x13a));return;}_0x46e227(_0x18c4bf),_0x29b815(''),_0x17ac3d('');}else _0x45b5a6[_0x94ccf8(0x151)]||_0x45b5a6[_0x94ccf8(0x143)]?_0x29b815(_0x4e5c1b=>{const _0x25faa=_0x94ccf8,_0x474611=_0x4e5c1b['slice'](0x0,-0x1),{valid:_0x888733,message:_0x3f2a83}=_0x181f4d(_0x474611);return _0x17ac3d(_0x888733?'':_0x3f2a83||_0x25faa(0x14d)),_0x474611;}):_0x29b815(_0x32d508=>{const _0x441982=_0x94ccf8,_0xbb7e2b=_0x32d508+_0x237262,{valid:_0x594cbb,message:_0x22e52a}=_0x181f4d(_0xbb7e2b);return _0x17ac3d(_0x594cbb?'':_0x22e52a||_0x441982(0x14d)),_0xbb7e2b;});}),a0_0x31fed5(Box,{'flexDirection':'column','children':[a0_0x31fed5(Box,{'children':[a0_0x279700(Text,{'color':_0x2f0f6a(0x13d),'children':_0x2f0f6a(0x14b)}),a0_0x279700(Text,{'children':_0x2f0f6a(0x142)}),_0x4a1a9e?a0_0x279700(Text,{'color':'green','children':_0x4a1a9e}):a0_0x279700(Text,{'color':'gray','children':_0x50e489}),_0x56517c&&a0_0x31fed5(Text,{'color':'red','children':['\x20←\x20',_0x56517c]})]}),!_0x56517c&&!_0x4a1a9e&&a0_0x279700(Box,{'children':a0_0x279700(Text,{'color':'gray','children':_0x2f0f6a(0x145)})})]});}
1
+ function a0_0x5b4f(_0x59a3bc,_0x5630b0){const _0x389584=a0_0x3895();return a0_0x5b4f=function(_0x5b4fa8,_0x34b1aa){_0x5b4fa8=_0x5b4fa8-0x196;let _0x1f57fc=_0x389584[_0x5b4fa8];return _0x1f57fc;},a0_0x5b4f(_0x59a3bc,_0x5630b0);}(function(_0x2ef32b,_0x59feaa){const _0x2e66bd=a0_0x5b4f,_0x154d48=_0x2ef32b();while(!![]){try{const _0x13a684=parseInt(_0x2e66bd(0x1b4))/0x1*(-parseInt(_0x2e66bd(0x1aa))/0x2)+-parseInt(_0x2e66bd(0x1a9))/0x3+parseInt(_0x2e66bd(0x1b3))/0x4*(parseInt(_0x2e66bd(0x1a0))/0x5)+parseInt(_0x2e66bd(0x19b))/0x6*(parseInt(_0x2e66bd(0x1a6))/0x7)+-parseInt(_0x2e66bd(0x197))/0x8+-parseInt(_0x2e66bd(0x1b6))/0x9*(-parseInt(_0x2e66bd(0x199))/0xa)+parseInt(_0x2e66bd(0x19d))/0xb*(parseInt(_0x2e66bd(0x1af))/0xc);if(_0x13a684===_0x59feaa)break;else _0x154d48['push'](_0x154d48['shift']());}catch(_0x3d1ef4){_0x154d48['push'](_0x154d48['shift']());}}}(a0_0x3895,0xda540));import{jsx as a0_0xc39c85,jsxs as a0_0xa8d649}from'react/jsx-runtime';import{useState}from'react';import{Text,Box,useInput}from'ink';import a0_0xf4b223 from'node:fs';function a0_0x3895(){const _0x4a92d4=['3506cyHRYB','endsWith','slice','startsWith','column','2057520jykCSJ','页面路由地址:\x20','backspace','\x20直接回车确认,或输入自定义路由地址','40tywmtN','593owOSjC','return','6419862DtkzrL','路径不能包含连续的\x20/','gray','5009248GsQxlZ','\x20←\x20','20ZWVLJn','\x20Step2:\x20','782658fznaVU','test','121IiJoOx','\x20已存在,请使用其他路径','includes','37775xVuoIY','路径中的每个段只能以字母或数字开头,且只包含字母、数字、-\x20和\x20_','delete','页面路径长度不能超过\x20100\x20个字符','red','my-page','28azXCmH','页面路径\x20','existsSync','4050183eNBTmx'];a0_0x3895=function(){return _0x4a92d4;};return a0_0x3895();}export function InputProjectCode(_0x28d9d7){const _0x33e5dc=a0_0x5b4f,{onSubmit:_0x3e1b57,pagePath:_0x3421ba}=_0x28d9d7,[_0x1ea7f5,_0x4d3f31]=useState(''),[_0x7747c4,_0x145ed7]=useState(''),_0x4564c3=_0x33e5dc(0x1a5);function _0x9de74a(_0x1371f0){const _0x22f92f=_0x33e5dc;if(_0x1371f0['length']>0x64)return{'valid':![],'message':_0x22f92f(0x1a3)};if(_0x1371f0[_0x22f92f(0x1ad)]('/')||_0x1371f0[_0x22f92f(0x1ab)]('/'))return{'valid':![],'message':'路径不能以\x20/\x20开头或结尾'};if(_0x1371f0[_0x22f92f(0x19f)]('//'))return{'valid':![],'message':_0x22f92f(0x1b7)};const _0x586999=_0x1371f0['split']('/');for(const _0x356fa6 of _0x586999){if(!_0x356fa6)continue;const _0xeea8d7=/^[A-Za-z0-9][A-Za-z0-9_-]*$/;if(!_0xeea8d7[_0x22f92f(0x19c)](_0x356fa6))return{'valid':![],'message':_0x22f92f(0x1a1)};}return{'valid':!![]};}return useInput((_0x58dce1,_0x36ca1d)=>{const _0xc156a2=_0x33e5dc;if(_0x36ca1d[_0xc156a2(0x1b5)]){const _0x551934=_0x1ea7f5['trim']()||_0x4564c3;if(_0x7747c4)return;const _0x1b44c2=_0x3421ba+'/'+_0x551934;if(a0_0xf4b223[_0xc156a2(0x1a8)](_0x1b44c2)){_0x145ed7(_0xc156a2(0x1a7)+_0x551934+_0xc156a2(0x19e));return;}_0x3e1b57(_0x551934),_0x4d3f31(''),_0x145ed7('');}else _0x36ca1d[_0xc156a2(0x1b1)]||_0x36ca1d[_0xc156a2(0x1a2)]?_0x4d3f31(_0x443728=>{const _0x18fc77=_0xc156a2,_0x4671ce=_0x443728[_0x18fc77(0x1ac)](0x0,-0x1),{valid:_0x1b65d3,message:_0x4dc77c}=_0x9de74a(_0x4671ce);return _0x145ed7(_0x1b65d3?'':_0x4dc77c||'页面路径不合法'),_0x4671ce;}):_0x4d3f31(_0x31525f=>{const _0x4e2977=_0x31525f+_0x58dce1,{valid:_0x33fe14,message:_0x534871}=_0x9de74a(_0x4e2977);return _0x145ed7(_0x33fe14?'':_0x534871||'页面路径不合法'),_0x4e2977;});}),a0_0xa8d649(Box,{'flexDirection':_0x33e5dc(0x1ae),'children':[a0_0xa8d649(Box,{'children':[a0_0xc39c85(Text,{'color':_0x33e5dc(0x196),'children':_0x33e5dc(0x19a)}),a0_0xc39c85(Text,{'children':_0x33e5dc(0x1b0)}),_0x1ea7f5?a0_0xc39c85(Text,{'color':'green','children':_0x1ea7f5}):a0_0xc39c85(Text,{'color':_0x33e5dc(0x196),'children':_0x4564c3}),_0x7747c4&&a0_0xa8d649(Text,{'color':_0x33e5dc(0x1a4),'children':[_0x33e5dc(0x198),_0x7747c4]})]}),!_0x7747c4&&!_0x1ea7f5&&a0_0xc39c85(Box,{'children':a0_0xc39c85(Text,{'color':_0x33e5dc(0x196),'children':_0x33e5dc(0x1b2)})})]});}
@@ -1 +1 @@
1
- const a1_0x35e7b6=a1_0x65d5;(function(_0x2b5743,_0x51c198){const _0x148379=a1_0x65d5,_0x53f8e6=_0x2b5743();while(!![]){try{const _0x11a40e=-parseInt(_0x148379(0x1cf))/0x1*(-parseInt(_0x148379(0x1eb))/0x2)+-parseInt(_0x148379(0x1db))/0x3*(parseInt(_0x148379(0x1e0))/0x4)+-parseInt(_0x148379(0x1df))/0x5*(-parseInt(_0x148379(0x1d3))/0x6)+-parseInt(_0x148379(0x1e6))/0x7+-parseInt(_0x148379(0x1d9))/0x8+-parseInt(_0x148379(0x1e5))/0x9+parseInt(_0x148379(0x1d4))/0xa;if(_0x11a40e===_0x51c198)break;else _0x53f8e6['push'](_0x53f8e6['shift']());}catch(_0x12646e){_0x53f8e6['push'](_0x53f8e6['shift']());}}}(a1_0x3265,0x7bf9f));function a1_0x65d5(_0x4411b9,_0x46449c){const _0x326572=a1_0x3265();return a1_0x65d5=function(_0x65d549,_0x5153dd){_0x65d549=_0x65d549-0x1c5;let _0x3593aa=_0x326572[_0x65d549];return _0x3593aa;},a1_0x65d5(_0x4411b9,_0x46449c);}import{jsx as a1_0x37830a,jsxs as a1_0x54158e,Fragment as a1_0x2d336a}from'react/jsx-runtime';import{fileURLToPath}from'node:url';import a1_0x18519a from'node:path';import{useEffect,useState}from'react';import{Box,Text,useApp}from'ink';import{SelectPageTemplate}from'./select-page-template.js';function a1_0x3265(){const _0x362ca9=['页面添加成功:\x20','gray','src','698480OOURXL','setLogPath','5847bDsihu','../../templates/pages','\x20Step1:\x20','resolve','5455XPYwUM','344dMcTNX','\x20Step2:\x20','column','info','finally','847062joXIGt','3513608VYtaut','\x20*\x20页面创建成功!','add-page','then','\x20*\x20页面文件已创建,可直接通过路由访问','704654XTjtdU','join','error','catch','\x20*\x20页面路径:\x20','已输入的页面路由\x20','success','cwd','url','开始添加页面:\x20','green','1zWrBUp','now','pages','processTemplate','4836YMtKAJ','1271200CaWWEy','已选择页面模板\x20'];a1_0x3265=function(){return _0x362ca9;};return a1_0x3265();}import{InputProjectCode}from'./input-page-router.js';import{logger}from'../utils/logger.js';import{TemplateReplacer}from'../utils/template-replacer.js';const __dirname=a1_0x18519a['dirname'](fileURLToPath(import.meta[a1_0x35e7b6(0x1cc)])),pageTemplateDir=a1_0x18519a['resolve'](__dirname,a1_0x35e7b6(0x1dc)),projectDir=process[a1_0x35e7b6(0x1cb)]();export const AddPage=()=>{const _0x1186c5=a1_0x35e7b6,{exit:_0x5866f6}=useApp(),[_0x778d4c,_0x3a19e2]=useState(''),[_0x5eae31,_0x1e22da]=useState(''),[_0x4b8bbd,_0x51778b]=useState(![]),[_0x56ae71,_0x3e4f74]=useState(![]),_0x339edc=a1_0x18519a[_0x1186c5(0x1c5)](projectDir,_0x1186c5(0x1d8),_0x1186c5(0x1d1)),_0x5cf962=a1_0x18519a[_0x1186c5(0x1c5)](_0x339edc,_0x5eae31),_0x81218e=a1_0x18519a['join']('src',_0x1186c5(0x1d1),_0x5eae31);useEffect(()=>{const _0x15073f=_0x1186c5,_0x45e73a=a1_0x18519a[_0x15073f(0x1de)](pageTemplateDir,_0x778d4c);if(_0x778d4c&&_0x5eae31){_0x51778b(!![]),logger[_0x15073f(0x1da)](process['cwd']());const _0x35104a=Date[_0x15073f(0x1d0)]();logger[_0x15073f(0x1e3)]('add-page',_0x15073f(0x1cd)+_0x5eae31,{'template':_0x778d4c,'targetPath':_0x81218e}),TemplateReplacer[_0x15073f(0x1d2)](_0x45e73a,a1_0x18519a['join'](_0x339edc,_0x5eae31),_0x5eae31,_0x778d4c)[_0x15073f(0x1e9)](()=>{const _0x58b29e=_0x15073f,_0x4904d5=Date[_0x58b29e(0x1d0)]()-_0x35104a;logger[_0x58b29e(0x1ca)](_0x58b29e(0x1e8),_0x58b29e(0x1d6)+_0x5eae31,_0x4904d5,{'template':_0x778d4c,'targetPath':_0x81218e,'routePath':_0x5eae31}),_0x3e4f74(!![]);})[_0x15073f(0x1c7)](_0x2650fe=>{const _0x149d9b=_0x15073f,_0x3dce50=Date[_0x149d9b(0x1d0)]()-_0x35104a;logger[_0x149d9b(0x1c6)]('add-page','页面添加失败:\x20'+_0x5eae31,{'template':_0x778d4c,'targetPath':_0x81218e,'error':_0x2650fe instanceof Error?_0x2650fe['message']:String(_0x2650fe),'duration':_0x3dce50});})[_0x15073f(0x1e4)](()=>{_0x51778b(![]);});}},[_0x778d4c,_0x5eae31]),useEffect(()=>{_0x56ae71&&setTimeout(()=>{_0x5866f6();});},[_0x56ae71]);if(_0x778d4c)return a1_0x54158e(Box,{'flexDirection':_0x1186c5(0x1e2),'paddingY':0x1,'children':[a1_0x54158e(Box,{'children':[a1_0x37830a(Text,{'color':'gray','children':_0x1186c5(0x1dd)}),a1_0x37830a(Text,{'children':_0x1186c5(0x1d5)}),a1_0x37830a(Text,{'color':_0x1186c5(0x1ce),'children':_0x778d4c})]}),_0x5eae31?a1_0x54158e(Box,{'children':[a1_0x37830a(Text,{'color':_0x1186c5(0x1d7),'children':_0x1186c5(0x1e1)}),a1_0x37830a(Text,{'children':_0x1186c5(0x1c9)}),a1_0x37830a(Text,{'color':_0x1186c5(0x1ce),'children':_0x5eae31})]}):a1_0x37830a(InputProjectCode,{'pagePath':_0x5cf962,'onSubmit':_0x1e22da}),_0x5eae31&&_0x4b8bbd?a1_0x54158e(Box,{'marginTop':0x1,'children':[a1_0x37830a(Box,{'width':'4'}),a1_0x37830a(Text,{'children':'正在创建页面,请稍候…'})]}):null,_0x56ae71?a1_0x54158e(a1_0x2d336a,{'children':[a1_0x37830a(Box,{'marginTop':0x1,'children':a1_0x37830a(Text,{'color':_0x1186c5(0x1d7),'children':_0x1186c5(0x1e7)})}),a1_0x54158e(Box,{'children':[a1_0x37830a(Text,{'color':_0x1186c5(0x1d7),'children':_0x1186c5(0x1c8)}),a1_0x37830a(Text,{'color':_0x1186c5(0x1ce),'children':_0x81218e})]}),a1_0x54158e(Box,{'children':[a1_0x37830a(Text,{'color':_0x1186c5(0x1d7),'children':'\x20*\x20路由地址:\x20'}),a1_0x54158e(Text,{'color':_0x1186c5(0x1ce),'children':['/',_0x5eae31]})]}),a1_0x37830a(Box,{'marginTop':0x1,'children':a1_0x37830a(Text,{'color':'cyan','children':_0x1186c5(0x1ea)})})]}):null]});return a1_0x37830a(SelectPageTemplate,{'onSelect':_0x3a19e2});};
1
+ const a1_0x40d0ae=a1_0x4253;(function(_0x39dbac,_0x601f20){const _0x431cfc=a1_0x4253,_0x1effb2=_0x39dbac();while(!![]){try{const _0x5e304f=-parseInt(_0x431cfc(0x192))/0x1+parseInt(_0x431cfc(0x1b4))/0x2+-parseInt(_0x431cfc(0x1ab))/0x3*(-parseInt(_0x431cfc(0x18d))/0x4)+parseInt(_0x431cfc(0x1b1))/0x5*(parseInt(_0x431cfc(0x1ad))/0x6)+-parseInt(_0x431cfc(0x1a6))/0x7*(-parseInt(_0x431cfc(0x19a))/0x8)+parseInt(_0x431cfc(0x1aa))/0x9*(parseInt(_0x431cfc(0x197))/0xa)+parseInt(_0x431cfc(0x19e))/0xb*(-parseInt(_0x431cfc(0x19f))/0xc);if(_0x5e304f===_0x601f20)break;else _0x1effb2['push'](_0x1effb2['shift']());}catch(_0x523677){_0x1effb2['push'](_0x1effb2['shift']());}}}(a1_0x2de5,0xa31f9));function a1_0x2de5(){const _0x2cdf94=['catch','2365TgKHkB','108312jgeTkH','\x20*\x20页面文件已创建,可直接通过路由访问','join','\x20*\x20页面路径:\x20','\x20Step2:\x20','\x20*\x20路由地址:\x20','column','16079StKVUW','setLogPath','finally','green','9phLdCZ','12whhZRX','then','6DHyyXQ','开始添加页面:\x20','src','message','4703335AmQPCW','add-page','resolve','2330658ZtBdsm','273548PImXye','url','页面添加失败:\x20','processTemplate','已输入的页面路由\x20','664497cAhhOx','now','success','页面添加成功:\x20','gray','5927890KJVBfU','已选择页面模板\x20','cwd','1048mNahtW','../../templates/pages','cyan'];a1_0x2de5=function(){return _0x2cdf94;};return a1_0x2de5();}import{jsx as a1_0x13c719,jsxs as a1_0xca579b,Fragment as a1_0x2f3c67}from'react/jsx-runtime';import{fileURLToPath}from'node:url';import a1_0x3df011 from'node:path';import{useEffect,useState}from'react';function a1_0x4253(_0x3badc8,_0x5f4771){const _0x2de5a2=a1_0x2de5();return a1_0x4253=function(_0x4253b8,_0x2fd677){_0x4253b8=_0x4253b8-0x18d;let _0x44116e=_0x2de5a2[_0x4253b8];return _0x44116e;},a1_0x4253(_0x3badc8,_0x5f4771);}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_0x3df011['dirname'](fileURLToPath(import.meta[a1_0x40d0ae(0x18e)])),pageTemplateDir=a1_0x3df011['resolve'](__dirname,a1_0x40d0ae(0x19b)),projectDir=process[a1_0x40d0ae(0x199)]();export const AddPage=()=>{const _0x2cef51=a1_0x40d0ae,{exit:_0xebd0e7}=useApp(),[_0x130905,_0x3da1bf]=useState(''),[_0x33b37f,_0x12c083]=useState(''),[_0x26c93c,_0x87565c]=useState(![]),[_0x53090f,_0x55268a]=useState(![]),_0x449925=a1_0x3df011[_0x2cef51(0x1a1)](projectDir,'src','pages'),_0x265a36=a1_0x3df011['join'](_0x449925,_0x33b37f),_0x2ec926=a1_0x3df011[_0x2cef51(0x1a1)](_0x2cef51(0x1af),'pages',_0x33b37f);useEffect(()=>{const _0x597b14=_0x2cef51,_0x5d564d=a1_0x3df011[_0x597b14(0x1b3)](pageTemplateDir,_0x130905);if(_0x130905&&_0x33b37f){_0x87565c(!![]),logger[_0x597b14(0x1a7)](process[_0x597b14(0x199)]());const _0x15eb66=Date['now']();logger['info'](_0x597b14(0x1b2),_0x597b14(0x1ae)+_0x33b37f,{'template':_0x130905,'targetPath':_0x2ec926}),TemplateReplacer[_0x597b14(0x190)](_0x5d564d,a1_0x3df011[_0x597b14(0x1a1)](_0x449925,_0x33b37f),_0x33b37f,_0x130905)[_0x597b14(0x1ac)](()=>{const _0xf3f713=_0x597b14,_0x3e8cf5=Date[_0xf3f713(0x193)]()-_0x15eb66;logger[_0xf3f713(0x194)](_0xf3f713(0x1b2),_0xf3f713(0x195)+_0x33b37f,_0x3e8cf5,{'template':_0x130905,'targetPath':_0x2ec926,'routePath':_0x33b37f}),_0x55268a(!![]);})[_0x597b14(0x19d)](_0x2cddda=>{const _0x1e5180=_0x597b14,_0x2dee29=Date[_0x1e5180(0x193)]()-_0x15eb66;logger['error'](_0x1e5180(0x1b2),_0x1e5180(0x18f)+_0x33b37f,{'template':_0x130905,'targetPath':_0x2ec926,'error':_0x2cddda instanceof Error?_0x2cddda[_0x1e5180(0x1b0)]:String(_0x2cddda),'duration':_0x2dee29});})[_0x597b14(0x1a8)](()=>{_0x87565c(![]);});}},[_0x130905,_0x33b37f]),useEffect(()=>{_0x53090f&&setTimeout(()=>{_0xebd0e7();});},[_0x53090f]);if(_0x130905)return a1_0xca579b(Box,{'flexDirection':_0x2cef51(0x1a5),'paddingY':0x1,'children':[a1_0xca579b(Box,{'children':[a1_0x13c719(Text,{'color':_0x2cef51(0x196),'children':'\x20Step1:\x20'}),a1_0x13c719(Text,{'children':_0x2cef51(0x198)}),a1_0x13c719(Text,{'color':_0x2cef51(0x1a9),'children':_0x130905})]}),_0x33b37f?a1_0xca579b(Box,{'children':[a1_0x13c719(Text,{'color':_0x2cef51(0x196),'children':_0x2cef51(0x1a3)}),a1_0x13c719(Text,{'children':_0x2cef51(0x191)}),a1_0x13c719(Text,{'color':_0x2cef51(0x1a9),'children':_0x33b37f})]}):a1_0x13c719(InputProjectCode,{'pagePath':_0x265a36,'onSubmit':_0x12c083}),_0x33b37f&&_0x26c93c?a1_0xca579b(Box,{'marginTop':0x1,'children':[a1_0x13c719(Box,{'width':'4'}),a1_0x13c719(Text,{'children':'正在创建页面,请稍候…'})]}):null,_0x53090f?a1_0xca579b(a1_0x2f3c67,{'children':[a1_0x13c719(Box,{'marginTop':0x1,'children':a1_0x13c719(Text,{'color':_0x2cef51(0x196),'children':'\x20*\x20页面创建成功!'})}),a1_0xca579b(Box,{'children':[a1_0x13c719(Text,{'color':_0x2cef51(0x196),'children':_0x2cef51(0x1a2)}),a1_0x13c719(Text,{'color':'green','children':_0x2ec926})]}),a1_0xca579b(Box,{'children':[a1_0x13c719(Text,{'color':_0x2cef51(0x196),'children':_0x2cef51(0x1a4)}),a1_0xca579b(Text,{'color':_0x2cef51(0x1a9),'children':['/',_0x33b37f]})]}),a1_0x13c719(Box,{'marginTop':0x1,'children':a1_0x13c719(Text,{'color':_0x2cef51(0x19c),'children':_0x2cef51(0x1a0)})})]}):null]});return a1_0x13c719(SelectPageTemplate,{'onSelect':_0x3da1bf});};
@@ -1 +1 @@
1
- function a2_0x3801(_0x26c333,_0xcf832){const _0x13a39e=a2_0x13a3();return a2_0x3801=function(_0x380139,_0x41515c){_0x380139=_0x380139-0xf5;let _0x54aac7=_0x13a39e[_0x380139];return _0x54aac7;},a2_0x3801(_0x26c333,_0xcf832);}function a2_0x13a3(){const _0x50d5de=['templates/pages','12asPwIa','map','2313588ucjMCL','isDirectory','4686381SMZibX','downArrow','105vhkCAM','upArrow','name','gray','filter','正在加载页面模板...','localeCompare','\x20Step1:\x20','187536XdUDZB','join','url','error','green','dirname','return','sort','2139330XvDEYb','column','99CILtGe','label','321756hutFwi','\x20\x20\x20\x20\x20\x20\x20\x20','length','19827RIzaxv','2504580JRrEpD','\x20\x20\x20\x20\x20\x20>\x20','请选择您要创建的页面模板','onSelect','blank'];a2_0x13a3=function(){return _0x50d5de;};return a2_0x13a3();}(function(_0xe635af,_0x4993e2){const _0x2c2155=a2_0x3801,_0x1e356e=_0xe635af();while(!![]){try{const _0x3b05e6=parseInt(_0x2c2155(0x10a))/0x1*(parseInt(_0x2c2155(0x111))/0x2)+-parseInt(_0x2c2155(0x103))/0x3+-parseInt(_0x2c2155(0x113))/0x4+parseInt(_0x2c2155(0x117))/0x5*(parseInt(_0x2c2155(0x107))/0x6)+parseInt(_0x2c2155(0x115))/0x7+parseInt(_0x2c2155(0xfb))/0x8*(parseInt(_0x2c2155(0x105))/0x9)+-parseInt(_0x2c2155(0x10b))/0xa;if(_0x3b05e6===_0x4993e2)break;else _0x1e356e['push'](_0x1e356e['shift']());}catch(_0x4d0932){_0x1e356e['push'](_0x1e356e['shift']());}}}(a2_0x13a3,0x99ed8));import{jsx as a2_0x5ad9,jsxs as a2_0xf19837}from'react/jsx-runtime';import{useState,useEffect}from'react';import{Text,Box,useInput}from'ink';import{readdir}from'node:fs/promises';import a2_0x1e3e4f from'node:path';import{fileURLToPath}from'node:url';async function getTemplateList(){const _0x303da0=a2_0x3801;try{const _0x59a545=fileURLToPath(import.meta[_0x303da0(0xfd)]),_0x1e81e8=a2_0x1e3e4f['resolve'](a2_0x1e3e4f[_0x303da0(0x100)](_0x59a545),'../..'),_0x2aa54e=a2_0x1e3e4f[_0x303da0(0xfc)](_0x1e81e8,_0x303da0(0x110)),_0x17baac=await readdir(_0x2aa54e,{'withFileTypes':!![]}),_0x255e6a=_0x17baac[_0x303da0(0xf7)](_0x14c9e3=>_0x14c9e3[_0x303da0(0x114)]())['map'](_0x3bea37=>({'label':_0x3bea37[_0x303da0(0xf5)]}))[_0x303da0(0x102)]((_0x20aa2b,_0x586f51)=>_0x20aa2b[_0x303da0(0x106)][_0x303da0(0xf9)](_0x586f51['label']));return _0x255e6a;}catch(_0x3216f4){return console[_0x303da0(0xfe)]('获取模板列表失败:',_0x3216f4),[{'label':_0x303da0(0x10f)},{'label':'sdk-fetch'}];}}export function SelectPageTemplate(_0x40381c){const _0x29b7a1=a2_0x3801,[_0x3ceed6,_0x5d83d0]=useState(0x0),[_0x2b5e77,_0x2e7e60]=useState([]),[_0x3bb5c8,_0x653b7d]=useState(!![]);useEffect(()=>{async function _0x5338f6(){const _0x226b05=await getTemplateList();_0x2e7e60(_0x226b05),_0x653b7d(![]);}_0x5338f6();},[]),useInput((_0x2461dd,_0x16875d)=>{const _0x50489a=a2_0x3801;if(_0x3bb5c8)return;if(_0x16875d[_0x50489a(0x101)]){const _0x287c70=_0x2b5e77[_0x3ceed6];_0x287c70&&_0x40381c[_0x50489a(0x10e)](_0x287c70[_0x50489a(0x106)]);}_0x16875d[_0x50489a(0x118)]&&_0x5d83d0(_0xabd01b=>_0xabd01b===0x0?_0x2b5e77['length']-0x1:_0xabd01b-0x1),_0x16875d[_0x50489a(0x116)]&&_0x5d83d0(_0x565cff=>_0x565cff===_0x2b5e77[_0x50489a(0x109)]-0x1?0x0:_0x565cff+0x1);});if(_0x3bb5c8)return a2_0x5ad9(Box,{'flexDirection':'column','paddingY':0x1,'children':a2_0xf19837(Box,{'children':[a2_0x5ad9(Text,{'color':_0x29b7a1(0xf6),'children':_0x29b7a1(0xfa)}),a2_0x5ad9(Text,{'children':_0x29b7a1(0xf8)})]})});return a2_0xf19837(Box,{'flexDirection':_0x29b7a1(0x104),'paddingY':0x1,'children':[a2_0xf19837(Box,{'children':[a2_0x5ad9(Text,{'color':_0x29b7a1(0xf6),'children':'\x20Step1:\x20'}),a2_0x5ad9(Text,{'children':_0x29b7a1(0x10d)})]}),_0x2b5e77[_0x29b7a1(0x112)]((_0x113ef0,_0x6e55b8)=>{const _0x4c2c10=_0x29b7a1,_0x3491f8=_0x6e55b8===_0x3ceed6,_0x2d03b3=_0x3491f8?_0x4c2c10(0x10c)+_0x113ef0[_0x4c2c10(0x106)]:_0x4c2c10(0x108)+_0x113ef0[_0x4c2c10(0x106)];return a2_0x5ad9(Box,{'children':a2_0x5ad9(Text,{'color':_0x3491f8?_0x4c2c10(0xff):undefined,'children':_0x2d03b3})},_0x2d03b3);})]});}
1
+ (function(_0x46c0d7,_0x3d6517){const _0xbdb7e8=a2_0x5a89,_0x2dd957=_0x46c0d7();while(!![]){try{const _0x3b4e5d=-parseInt(_0xbdb7e8(0x169))/0x1*(parseInt(_0xbdb7e8(0x17b))/0x2)+parseInt(_0xbdb7e8(0x157))/0x3+-parseInt(_0xbdb7e8(0x15a))/0x4*(-parseInt(_0xbdb7e8(0x17c))/0x5)+parseInt(_0xbdb7e8(0x15e))/0x6*(parseInt(_0xbdb7e8(0x176))/0x7)+-parseInt(_0xbdb7e8(0x160))/0x8*(parseInt(_0xbdb7e8(0x170))/0x9)+-parseInt(_0xbdb7e8(0x162))/0xa+-parseInt(_0xbdb7e8(0x15d))/0xb*(parseInt(_0xbdb7e8(0x175))/0xc);if(_0x3b4e5d===_0x3d6517)break;else _0x2dd957['push'](_0x2dd957['shift']());}catch(_0x1b10d5){_0x2dd957['push'](_0x2dd957['shift']());}}}(a2_0x5c55,0x36b21));function a2_0x5c55(){const _0x24cba9=['onSelect','264zntQBX','35qFoUUR','error','sdk-fetch','dirname','resolve','56HERywX','5kUeBNw','gray','872991wRRLlj','isDirectory','sort','1015796TdAcHs','\x20\x20\x20\x20\x20\x20>\x20','map','26653jZuQxU','377304pVlCmg','请选择您要创建的页面模板','181736TRqPQq','\x20\x20\x20\x20\x20\x20\x20\x20','3172320SEIPiV','upArrow','green','column','获取模板列表失败:','../..','url','7023JcyUZm','\x20Step1:\x20','join','localeCompare','templates/pages','label','downArrow','27QGFyeW','blank','filter','length'];a2_0x5c55=function(){return _0x24cba9;};return a2_0x5c55();}import{jsx as a2_0x541009,jsxs as a2_0x1c86e7}from'react/jsx-runtime';import{useState,useEffect}from'react';function a2_0x5a89(_0x727287,_0x4cc103){const _0x5c5513=a2_0x5c55();return a2_0x5a89=function(_0x5a8948,_0xbb787b){_0x5a8948=_0x5a8948-0x157;let _0x989a59=_0x5c5513[_0x5a8948];return _0x989a59;},a2_0x5a89(_0x727287,_0x4cc103);}import{Text,Box,useInput}from'ink';import{readdir}from'node:fs/promises';import a2_0x54b893 from'node:path';import{fileURLToPath}from'node:url';async function getTemplateList(){const _0x33348d=a2_0x5a89;try{const _0x56f642=fileURLToPath(import.meta[_0x33348d(0x168)]),_0x33a249=a2_0x54b893[_0x33348d(0x17a)](a2_0x54b893[_0x33348d(0x179)](_0x56f642),_0x33348d(0x167)),_0x10ac72=a2_0x54b893[_0x33348d(0x16b)](_0x33a249,_0x33348d(0x16d)),_0x36d857=await readdir(_0x10ac72,{'withFileTypes':!![]}),_0x1628f1=_0x36d857[_0x33348d(0x172)](_0x46a029=>_0x46a029[_0x33348d(0x158)]())[_0x33348d(0x15c)](_0x4a7013=>({'label':_0x4a7013['name']}))[_0x33348d(0x159)]((_0xd4e6f,_0x9acff6)=>_0xd4e6f[_0x33348d(0x16e)][_0x33348d(0x16c)](_0x9acff6[_0x33348d(0x16e)]));return _0x1628f1;}catch(_0x401d1f){return console[_0x33348d(0x177)](_0x33348d(0x166),_0x401d1f),[{'label':_0x33348d(0x171)},{'label':_0x33348d(0x178)}];}}export function SelectPageTemplate(_0x4b78bf){const _0x465dd8=a2_0x5a89,[_0x31dbf8,_0x4e1f40]=useState(0x0),[_0x14b43f,_0x442bfb]=useState([]),[_0x258690,_0x53a02d]=useState(!![]);useEffect(()=>{async function _0x373c18(){const _0x2fc343=await getTemplateList();_0x442bfb(_0x2fc343),_0x53a02d(![]);}_0x373c18();},[]),useInput((_0x4cbceb,_0x463df7)=>{const _0x4fe965=a2_0x5a89;if(_0x258690)return;if(_0x463df7['return']){const _0xd11c23=_0x14b43f[_0x31dbf8];_0xd11c23&&_0x4b78bf[_0x4fe965(0x174)](_0xd11c23[_0x4fe965(0x16e)]);}_0x463df7[_0x4fe965(0x163)]&&_0x4e1f40(_0xd3cc19=>_0xd3cc19===0x0?_0x14b43f['length']-0x1:_0xd3cc19-0x1),_0x463df7[_0x4fe965(0x16f)]&&_0x4e1f40(_0x12327b=>_0x12327b===_0x14b43f[_0x4fe965(0x173)]-0x1?0x0:_0x12327b+0x1);});if(_0x258690)return a2_0x541009(Box,{'flexDirection':_0x465dd8(0x165),'paddingY':0x1,'children':a2_0x1c86e7(Box,{'children':[a2_0x541009(Text,{'color':_0x465dd8(0x17d),'children':_0x465dd8(0x16a)}),a2_0x541009(Text,{'children':'正在加载页面模板...'})]})});return a2_0x1c86e7(Box,{'flexDirection':_0x465dd8(0x165),'paddingY':0x1,'children':[a2_0x1c86e7(Box,{'children':[a2_0x541009(Text,{'color':_0x465dd8(0x17d),'children':'\x20Step1:\x20'}),a2_0x541009(Text,{'children':_0x465dd8(0x15f)})]}),_0x14b43f['map']((_0x555d3c,_0x54c7ee)=>{const _0x1f72a3=_0x465dd8,_0x4f6d68=_0x54c7ee===_0x31dbf8,_0x25e97e=_0x4f6d68?_0x1f72a3(0x15b)+_0x555d3c[_0x1f72a3(0x16e)]:_0x1f72a3(0x161)+_0x555d3c[_0x1f72a3(0x16e)];return a2_0x541009(Box,{'children':a2_0x541009(Text,{'color':_0x4f6d68?_0x1f72a3(0x164):undefined,'children':_0x25e97e})},_0x25e97e);})]});}
@@ -1 +1 @@
1
- (function(_0x350ac5,_0x237566){const _0x4691b2=a3_0x2f0b,_0x45fd37=_0x350ac5();while(!![]){try{const _0x17e1c3=-parseInt(_0x4691b2(0x1f6))/0x1*(parseInt(_0x4691b2(0x1cc))/0x2)+-parseInt(_0x4691b2(0x1f9))/0x3+-parseInt(_0x4691b2(0x1bf))/0x4+parseInt(_0x4691b2(0x1f8))/0x5*(-parseInt(_0x4691b2(0x1f1))/0x6)+parseInt(_0x4691b2(0x1c9))/0x7+-parseInt(_0x4691b2(0x1c6))/0x8+parseInt(_0x4691b2(0x1d7))/0x9;if(_0x17e1c3===_0x237566)break;else _0x45fd37['push'](_0x45fd37['shift']());}catch(_0xb43d41){_0x45fd37['push'](_0x45fd37['shift']());}}}(a3_0x51e7,0xab824));import{jsx as a3_0x31e22e,jsxs as a3_0x422079}from'react/jsx-runtime';import{useEffect,useState}from'react';import{Box,Text,useApp}from'ink';function a3_0x2f0b(_0x460deb,_0x50d218){const _0x51e78e=a3_0x51e7();return a3_0x2f0b=function(_0x2f0bd2,_0xdff366){_0x2f0bd2=_0x2f0bd2-0x1bd;let _0x16069a=_0x51e78e[_0x2f0bd2];return _0x16069a;},a3_0x2f0b(_0x460deb,_0x50d218);}function a3_0x51e7(){const _0x4d47cc=['status','\x20-\x20客户端实例文件','text','string','url','green','red','\x20-\x20模型配置文件','\x20from\x20\x27@/api/','\x20和\x20','426RYBIaJ','{\x20lovrabetClient\x20}','dim','获取数据集失败,HTTP状态码:\x20','登录鉴权失败,登录已过期,请使用\x20lovrabet\x20auth\x20重新登录','210191SRZyTz','yellow','24695bWCVNv','1952439wHdAqF','api','-client','95152aHwACn','src/api/','cwd','\x20重新登录后再试','-api','column','setLogPath','9002936PGUnzO','💡\x20请使用\x20','*\x20将生成文件:\x20','5844090RllkFL','message','使用指定的应用AppCode:\x20','2eKHVPu','success','includes','import\x20','使用配置的应用AppCode:\x20',',且无法读取错误响应内容','online','api-pull','√\x20API\x20文件生成成功!','未提供应用AppCode,且配置中也没有默认值','slice','20056122EmwqyO','error','split','gray','lovrabet\x20auth','拉取\x20API\x20配置失败:\x20','.ts','*\x20已生成文件:','/smartapi/dataset/getList?appCode=','data','white','replace','env','client','cyan','join'];a3_0x51e7=function(){return _0x4d47cc;};return a3_0x51e7();}import{readConfig}from'../utils/config.js';import{getCookie}from'../auth/get-cookie.js';import{getApiDomain}from'../constant/domain.js';import{initEnv}from'../constant/env.js';import{generateApiFile}from'./generate-api-file.js';import{logger}from'../utils/logger.js';export const ApiPullUI=({appCode:_0x5823d0,env:_0x49e95f})=>{const _0x3b2af0=a3_0x2f0b,{exit:_0x5995ac}=useApp(),[_0x5874e2,_0x18f5c9]=useState(![]),[_0x772471,_0x20a891]=useState(![]),[_0x2a0a78,_0x24ebc1]=useState(null),[_0x3ac67a,_0x2d5121]=useState(null),_0x4d3158=readConfig(),_0x3a830d=_0x5823d0||_0x4d3158?.['app'],_0x342576=typeof _0x4d3158?.['env']===_0x3b2af0(0x1ea)?_0x4d3158[_0x3b2af0(0x1e3)]:undefined,_0x3d8307=_0x49e95f||_0x342576||_0x3b2af0(0x1d2);initEnv(_0x3d8307);const _0x3cc2e9=_0x5823d0&&_0x5823d0[_0x3b2af0(0x1ce)]('-')?_0x5823d0[_0x3b2af0(0x1d9)]('-')[_0x3b2af0(0x1d6)](0x1)[_0x3b2af0(0x1e6)]('-'):'',_0x5d9c82=_0x5823d0?_0x3b2af0(0x1cb)+_0x3a830d:_0x3b2af0(0x1d0)+_0x3a830d,_0x2d3cce=_0x3cc2e9?_0x3cc2e9+_0x3b2af0(0x1c3):_0x3b2af0(0x1bd),_0x4ea6d4=_0x3cc2e9?_0x3cc2e9+_0x3b2af0(0x1be):_0x3b2af0(0x1e4);useEffect(()=>{_0x18f5c9(!![]),_0x4b5dfc();},[]),useEffect(()=>{(_0x772471||_0x2a0a78)&&_0x5995ac();},[_0x772471,_0x2a0a78,_0x5995ac]);async function _0x4b5dfc(){const _0x156160=_0x3b2af0;if(!_0x3a830d){_0x24ebc1(_0x156160(0x1d5));return;}try{logger[_0x156160(0x1c5)](process[_0x156160(0x1c1)]());const _0x53bfc6=await fetch(getApiDomain()+_0x156160(0x1df)+_0x3a830d+'&pageSize=999&currentPage=1',{'headers':{'Cookie':getCookie()}});if(_0x53bfc6['ok']){const _0xa263b0=await _0x53bfc6['json']();if(_0xa263b0[_0x156160(0x1cd)]){const _0x5f5605=!_0x5823d0;await generateApiFile(_0xa263b0[_0x156160(0x1e0)]['tableData'],_0x3cc2e9,_0x3a830d,_0x5f5605,_0x3d8307),_0x2d5121({'api':'src/api/'+_0x2d3cce+_0x156160(0x1dd),'client':'src/api/'+_0x4ea6d4+_0x156160(0x1dd)}),_0x20a891(!![]);}}else{if(_0x53bfc6['status']===0x191){const _0x3dd946=_0x156160(0x1f5);logger['error']('api-pull',_0x3dd946,{'status':_0x53bfc6['status'],'appCode':_0x3a830d,'url':_0x53bfc6['url']}),_0x24ebc1(_0x3dd946);}else{const _0x1ec721=_0x156160(0x1f4)+_0x53bfc6[_0x156160(0x1e7)];try{const _0x681b47=await _0x53bfc6[_0x156160(0x1e9)]();_0x681b47?logger[_0x156160(0x1d8)](_0x156160(0x1d3),_0x1ec721,{'status':_0x53bfc6[_0x156160(0x1e7)],'appCode':_0x3a830d,'url':_0x53bfc6[_0x156160(0x1eb)],'errorBody':_0x681b47}):logger['error'](_0x156160(0x1d3),_0x1ec721,{'status':_0x53bfc6[_0x156160(0x1e7)],'appCode':_0x3a830d,'url':_0x53bfc6[_0x156160(0x1eb)]});}catch(_0x12dcb0){logger[_0x156160(0x1d8)]('api-pull',_0x1ec721+_0x156160(0x1d1),{'status':_0x53bfc6['status'],'appCode':_0x3a830d,'url':_0x53bfc6['url'],'readError':_0x12dcb0 instanceof Error?_0x12dcb0[_0x156160(0x1ca)]:String(_0x12dcb0)});}_0x24ebc1(_0x1ec721);}}}catch(_0x18bf38){const _0x58dd6a=_0x18bf38 instanceof Error?_0x18bf38['message']:String(_0x18bf38);_0x24ebc1(_0x156160(0x1dc)+_0x58dd6a);}finally{_0x18f5c9(![]);}}return a3_0x422079(Box,{'flexDirection':_0x3b2af0(0x1c4),'children':[a3_0x422079(Box,{'children':[a3_0x31e22e(Text,{'color':_0x3b2af0(0x1da),'children':'*\x20'}),a3_0x31e22e(Text,{'color':_0x5823d0?_0x3b2af0(0x1e1):'dim','children':_0x5d9c82})]}),a3_0x422079(Box,{'children':[a3_0x31e22e(Text,{'color':_0x3b2af0(0x1da),'children':_0x3b2af0(0x1c8)}),a3_0x422079(Text,{'color':_0x3b2af0(0x1e5),'children':[_0x2d3cce,_0x3b2af0(0x1dd)]}),a3_0x31e22e(Text,{'color':_0x3b2af0(0x1f3),'children':_0x3b2af0(0x1f0)}),a3_0x422079(Text,{'color':_0x3b2af0(0x1e5),'children':[_0x4ea6d4,'.ts']})]}),_0x5874e2&&a3_0x31e22e(Box,{'children':a3_0x422079(Text,{'children':['🚀\x20正在从服务器拉取\x20API\x20配置...\x20(环境:\x20',_0x3d8307,')']})}),_0x772471&&_0x3ac67a&&a3_0x422079(Box,{'flexDirection':_0x3b2af0(0x1c4),'children':[a3_0x31e22e(Box,{'children':a3_0x31e22e(Text,{'color':_0x3b2af0(0x1ec),'children':_0x3b2af0(0x1d4)})}),a3_0x31e22e(Box,{'marginTop':0x1,'children':a3_0x31e22e(Text,{'color':'gray','children':_0x3b2af0(0x1de)})}),a3_0x422079(Box,{'marginLeft':0x2,'children':[a3_0x422079(Text,{'color':_0x3b2af0(0x1e5),'children':['•\x20',_0x3ac67a['api']]}),a3_0x31e22e(Text,{'color':'dim','children':_0x3b2af0(0x1ee)})]}),a3_0x422079(Box,{'marginLeft':0x2,'children':[a3_0x422079(Text,{'color':_0x3b2af0(0x1e5),'children':['•\x20',_0x3ac67a[_0x3b2af0(0x1e4)]]}),a3_0x31e22e(Text,{'color':_0x3b2af0(0x1f3),'children':_0x3b2af0(0x1e8)})]}),a3_0x31e22e(Box,{'marginTop':0x1,'children':a3_0x31e22e(Text,{'color':_0x3b2af0(0x1da),'children':'*\x20导入方式:'})}),a3_0x31e22e(Box,{'marginLeft':0x2,'children':a3_0x422079(Text,{'color':'yellow','children':[_0x3b2af0(0x1cf),_0x3b2af0(0x1f2),_0x3b2af0(0x1ef),_0x3ac67a[_0x3b2af0(0x1e4)][_0x3b2af0(0x1e2)](_0x3b2af0(0x1c0),'')[_0x3b2af0(0x1e2)](_0x3b2af0(0x1dd),''),'\x27']})})]}),_0x2a0a78&&a3_0x422079(Box,{'flexDirection':_0x3b2af0(0x1c4),'children':[a3_0x31e22e(Box,{'children':a3_0x422079(Text,{'color':_0x3b2af0(0x1ed),'children':['❌\x20',_0x2a0a78]})}),_0x2a0a78[_0x3b2af0(0x1ce)]('登录')&&a3_0x422079(Box,{'marginTop':0x1,'children':[a3_0x31e22e(Text,{'color':_0x3b2af0(0x1f7),'children':_0x3b2af0(0x1c7)}),a3_0x31e22e(Text,{'color':'cyan','children':_0x3b2af0(0x1db)}),a3_0x31e22e(Text,{'color':_0x3b2af0(0x1f7),'children':_0x3b2af0(0x1c2)})]})]})]});};
1
+ (function(_0xc3d26a,_0x538884){const _0x4daae5=a3_0x5a60,_0x51dbda=_0xc3d26a();while(!![]){try{const _0x3f26f8=parseInt(_0x4daae5(0x122))/0x1*(-parseInt(_0x4daae5(0x129))/0x2)+parseInt(_0x4daae5(0x108))/0x3+parseInt(_0x4daae5(0x120))/0x4+parseInt(_0x4daae5(0x111))/0x5+-parseInt(_0x4daae5(0x12b))/0x6+-parseInt(_0x4daae5(0x10f))/0x7+-parseInt(_0x4daae5(0x123))/0x8*(-parseInt(_0x4daae5(0x135))/0x9);if(_0x3f26f8===_0x538884)break;else _0x51dbda['push'](_0x51dbda['shift']());}catch(_0x304877){_0x51dbda['push'](_0x51dbda['shift']());}}}(a3_0x21a5,0x55778));import{jsx as a3_0x323b6c,jsxs as a3_0x3743db}from'react/jsx-runtime';import{useEffect,useState}from'react';function a3_0x21a5(){const _0x48bc94=['🚀\x20正在从服务器拉取\x20API\x20配置...\x20(环境:\x20','status','\x20from\x20\x27@/','使用配置的应用AppCode:\x20','app','148OzJbXp','./src/api/','1222368dmJqWB','lovrabet\x20auth','success','message','-client','import\x20','\x20-\x20模型配置文件','green','tableData','url','9sFmzaN','json','env','replace','登录鉴权失败,登录已过期,请使用\x20lovrabet\x20auth\x20重新登录','error','cwd','online','💡\x20请使用\x20','获取数据集失败,HTTP状态码:\x20','text','data','white','*\x20已生成文件:','1179102TvHwzN','yellow','dim','*\x20将生成文件:\x20','/smartapi/dataset/getList?appCode=','\x20和\x20','includes','3306632lwOrJy','split','3000985lsyfGj','join','未提供应用AppCode,且配置中也没有默认值','cyan','api-pull','api','column','slice','gray','使用指定的应用AppCode:\x20','string',',且无法读取错误响应内容','endsWith','拉取\x20API\x20配置失败:\x20','.ts','272100WQevpy','client','5627IsRObn','3050544AvhvKg'];a3_0x21a5=function(){return _0x48bc94;};return a3_0x21a5();}function a3_0x5a60(_0x4c8777,_0x30f12f){const _0x21a5cb=a3_0x21a5();return a3_0x5a60=function(_0x5a6088,_0x3d63e3){_0x5a6088=_0x5a6088-0xfd;let _0x2963d6=_0x21a5cb[_0x5a6088];return _0x2963d6;},a3_0x5a60(_0x4c8777,_0x30f12f);}import{Box,Text,useApp}from'ink';import{readConfig}from'../utils/config.js';import{getCookie}from'../auth/get-cookie.js';import{getApiDomain}from'../constant/domain.js';import{initEnv}from'../constant/env.js';import{generateApiFile}from'./generate-api-file.js';import{logger}from'../utils/logger.js';export const ApiPullUI=({appCode:_0x3402b1,env:_0x3a20be,output:_0x2f062a})=>{const _0x1a7345=a3_0x5a60,{exit:_0x59d912}=useApp(),[_0x3f02d6,_0x3cd5c2]=useState(![]),[_0x4478dc,_0x32e447]=useState(![]),[_0x39f641,_0x3f2915]=useState(null),[_0x17d4c4,_0x22d88d]=useState(null),_0xe7f14b=readConfig(),_0x24b7a8=_0x3402b1||_0xe7f14b?.[_0x1a7345(0x128)],_0x1eeff3=typeof _0xe7f14b?.['env']===_0x1a7345(0x11b)?_0xe7f14b[_0x1a7345(0x137)]:undefined,_0x208e26=_0x3a20be||_0x1eeff3||_0x1a7345(0x101);initEnv(_0x208e26);const _0x2801af=_0x2f062a||_0x1a7345(0x12a),_0x2e07a3=_0x3402b1&&_0x3402b1[_0x1a7345(0x10e)]('-')?_0x3402b1[_0x1a7345(0x110)]('-')[_0x1a7345(0x118)](0x1)[_0x1a7345(0x112)]('-'):'',_0x4b50c6=_0x3402b1?_0x1a7345(0x11a)+_0x24b7a8:_0x1a7345(0x127)+_0x24b7a8,_0x429dec=_0x2e07a3?_0x2e07a3+'-api':'api',_0x5936b2=_0x2e07a3?_0x2e07a3+_0x1a7345(0x12f):_0x1a7345(0x121);useEffect(()=>{_0x3cd5c2(!![]),_0x24286b();},[]),useEffect(()=>{(_0x4478dc||_0x39f641)&&_0x59d912();},[_0x4478dc,_0x39f641,_0x59d912]);async function _0x24286b(){const _0x1976ca=_0x1a7345;if(!_0x24b7a8){_0x3f2915(_0x1976ca(0x113));return;}try{logger['setLogPath'](process[_0x1976ca(0x100)]());const _0x365c65=await fetch(getApiDomain()+_0x1976ca(0x10c)+_0x24b7a8+'&pageSize=999&currentPage=1',{'headers':{'Cookie':getCookie()}});if(_0x365c65['ok']){const _0x927180=await _0x365c65[_0x1976ca(0x136)]();if(_0x927180[_0x1976ca(0x12d)]){const _0x5c5979=!_0x3402b1;await generateApiFile(_0x927180[_0x1976ca(0x105)][_0x1976ca(0x133)],_0x2e07a3,_0x24b7a8,_0x5c5979,_0x208e26,_0x2801af);const _0x4e2603=_0x2801af[_0x1976ca(0x11d)]('/')?_0x2801af:_0x2801af+'/';_0x22d88d({'api':''+_0x4e2603+_0x429dec+_0x1976ca(0x11f),'client':''+_0x4e2603+_0x5936b2+_0x1976ca(0x11f)}),_0x32e447(!![]);}}else{if(_0x365c65[_0x1976ca(0x125)]===0x191){const _0x41d677=_0x1976ca(0xfe);logger[_0x1976ca(0xff)](_0x1976ca(0x115),_0x41d677,{'status':_0x365c65[_0x1976ca(0x125)],'appCode':_0x24b7a8,'url':_0x365c65[_0x1976ca(0x134)]}),_0x3f2915(_0x41d677);}else{const _0x710f1=_0x1976ca(0x103)+_0x365c65[_0x1976ca(0x125)];try{const _0x129233=await _0x365c65[_0x1976ca(0x104)]();_0x129233?logger[_0x1976ca(0xff)](_0x1976ca(0x115),_0x710f1,{'status':_0x365c65[_0x1976ca(0x125)],'appCode':_0x24b7a8,'url':_0x365c65[_0x1976ca(0x134)],'errorBody':_0x129233}):logger[_0x1976ca(0xff)]('api-pull',_0x710f1,{'status':_0x365c65[_0x1976ca(0x125)],'appCode':_0x24b7a8,'url':_0x365c65[_0x1976ca(0x134)]});}catch(_0x57a806){logger[_0x1976ca(0xff)](_0x1976ca(0x115),_0x710f1+_0x1976ca(0x11c),{'status':_0x365c65['status'],'appCode':_0x24b7a8,'url':_0x365c65[_0x1976ca(0x134)],'readError':_0x57a806 instanceof Error?_0x57a806[_0x1976ca(0x12e)]:String(_0x57a806)});}_0x3f2915(_0x710f1);}}}catch(_0x3c1930){const _0x392511=_0x3c1930 instanceof Error?_0x3c1930[_0x1976ca(0x12e)]:String(_0x3c1930);_0x3f2915(_0x1976ca(0x11e)+_0x392511);}finally{_0x3cd5c2(![]);}}return a3_0x3743db(Box,{'flexDirection':'column','children':[a3_0x3743db(Box,{'children':[a3_0x323b6c(Text,{'color':_0x1a7345(0x119),'children':'*\x20'}),a3_0x323b6c(Text,{'color':_0x3402b1?_0x1a7345(0x106):'dim','children':_0x4b50c6})]}),a3_0x3743db(Box,{'children':[a3_0x323b6c(Text,{'color':_0x1a7345(0x119),'children':_0x1a7345(0x10b)}),a3_0x3743db(Text,{'color':_0x1a7345(0x114),'children':[_0x429dec,_0x1a7345(0x11f)]}),a3_0x323b6c(Text,{'color':'dim','children':_0x1a7345(0x10d)}),a3_0x3743db(Text,{'color':_0x1a7345(0x114),'children':[_0x5936b2,_0x1a7345(0x11f)]})]}),_0x3f02d6&&a3_0x323b6c(Box,{'children':a3_0x3743db(Text,{'children':[_0x1a7345(0x124),_0x208e26,')']})}),_0x4478dc&&_0x17d4c4&&a3_0x3743db(Box,{'flexDirection':_0x1a7345(0x117),'children':[a3_0x323b6c(Box,{'children':a3_0x323b6c(Text,{'color':_0x1a7345(0x132),'children':'√\x20API\x20文件生成成功!'})}),a3_0x323b6c(Box,{'marginTop':0x1,'children':a3_0x323b6c(Text,{'color':'gray','children':_0x1a7345(0x107)})}),a3_0x3743db(Box,{'marginLeft':0x2,'children':[a3_0x3743db(Text,{'color':_0x1a7345(0x114),'children':['•\x20',_0x17d4c4[_0x1a7345(0x116)]]}),a3_0x323b6c(Text,{'color':_0x1a7345(0x10a),'children':_0x1a7345(0x131)})]}),a3_0x3743db(Box,{'marginLeft':0x2,'children':[a3_0x3743db(Text,{'color':'cyan','children':['•\x20',_0x17d4c4[_0x1a7345(0x121)]]}),a3_0x323b6c(Text,{'color':_0x1a7345(0x10a),'children':'\x20-\x20客户端实例文件'})]}),a3_0x323b6c(Box,{'marginTop':0x1,'children':a3_0x323b6c(Text,{'color':_0x1a7345(0x119),'children':'*\x20导入方式:'})}),a3_0x323b6c(Box,{'marginLeft':0x2,'children':a3_0x3743db(Text,{'color':_0x1a7345(0x109),'children':[_0x1a7345(0x130),'{\x20lovrabetClient\x20}',_0x1a7345(0x126),_0x17d4c4['client'][_0x1a7345(0xfd)](/^\.\//,'')['replace'](/^src\//,'')[_0x1a7345(0xfd)]('.ts',''),'\x27']})})]}),_0x39f641&&a3_0x3743db(Box,{'flexDirection':_0x1a7345(0x117),'children':[a3_0x323b6c(Box,{'children':a3_0x3743db(Text,{'color':'red','children':['❌\x20',_0x39f641]})}),_0x39f641['includes']('登录')&&a3_0x3743db(Box,{'marginTop':0x1,'children':[a3_0x323b6c(Text,{'color':_0x1a7345(0x109),'children':_0x1a7345(0x102)}),a3_0x323b6c(Text,{'color':_0x1a7345(0x114),'children':_0x1a7345(0x12c)}),a3_0x323b6c(Text,{'color':_0x1a7345(0x109),'children':'\x20重新登录后再试'})]})]})]});};
@@ -1 +1 @@
1
- function a4_0xb7e3(_0x5c51fd,_0x46e002){const _0x4b355c=a4_0x4b35();return a4_0xb7e3=function(_0xb7e3a4,_0x4e7032){_0xb7e3a4=_0xb7e3a4-0x166;let _0x6850f2=_0x4b355c[_0xb7e3a4];return _0x6850f2;},a4_0xb7e3(_0x5c51fd,_0x46e002);}(function(_0xf637b1,_0x3cc269){const _0x1a3809=a4_0xb7e3,_0x284dd6=_0xf637b1();while(!![]){try{const _0x422835=-parseInt(_0x1a3809(0x16e))/0x1*(parseInt(_0x1a3809(0x179))/0x2)+parseInt(_0x1a3809(0x178))/0x3+parseInt(_0x1a3809(0x168))/0x4+-parseInt(_0x1a3809(0x177))/0x5+parseInt(_0x1a3809(0x16b))/0x6*(parseInt(_0x1a3809(0x172))/0x7)+parseInt(_0x1a3809(0x169))/0x8*(-parseInt(_0x1a3809(0x17d))/0x9)+parseInt(_0x1a3809(0x167))/0xa;if(_0x422835===_0x3cc269)break;else _0x284dd6['push'](_0x284dd6['shift']());}catch(_0x4a3b40){_0x284dd6['push'](_0x284dd6['shift']());}}}(a4_0x4b35,0xd1e10));export function formatDataset(_0x18798b){const _0x188b59=a4_0xb7e3,_0x228992=_0x18798b[_0x188b59(0x17a)](_0x2a2221=>_0x2a2221[_0x188b59(0x171)]),_0x11fa56=_0x18798b[_0x188b59(0x17a)](_0x3b611d=>!_0x3b611d[_0x188b59(0x171)]),_0x3cc480=new Map();_0x228992[_0x188b59(0x16f)](_0x5459c3=>{const _0x434ad3=_0x188b59,_0x47d5e4=_0x5459c3[_0x434ad3(0x171)][_0x434ad3(0x176)],_0x3d4a70=_0x3cc480[_0x434ad3(0x16d)](_0x47d5e4);(!_0x3d4a70||_0x5459c3['id']>_0x3d4a70['id'])&&_0x3cc480[_0x434ad3(0x173)](_0x47d5e4,_0x5459c3);});const _0x3d35c6=Array[_0x188b59(0x170)](_0x3cc480['values']())[_0x188b59(0x16a)](_0xc352a8=>{const _0x13598f=_0x188b59,_0x132e50=snakeToCamel(_0xc352a8[_0x13598f(0x171)][_0x13598f(0x176)]);return{'id':_0xc352a8['id'],'name':_0xc352a8[_0x13598f(0x17e)],'code':_0xc352a8[_0x13598f(0x16c)],'tableName':_0xc352a8[_0x13598f(0x171)][_0x13598f(0x176)],'apiFucName':_0x132e50?_0x132e50+_0x13598f(0x174):_0x13598f(0x17b)+_0xc352a8['code']+_0x13598f(0x174),'pkField':_0xc352a8[_0x13598f(0x171)][_0x13598f(0x175)],'allFields':_0xc352a8[_0x13598f(0x171)][_0x13598f(0x182)][_0x13598f(0x180)](',')};}),_0x24a6cf=_0x11fa56[_0x188b59(0x16a)](_0x163697=>{const _0x4928a7=_0x188b59,_0x390a9f=_0x4928a7(0x17f)+_0x163697[_0x4928a7(0x16c)],_0x4d0df2=snakeToCamel(_0x390a9f);return{'id':_0x163697['id'],'name':_0x163697[_0x4928a7(0x17e)],'code':_0x163697[_0x4928a7(0x16c)],'tableName':_0x390a9f,'apiFucName':_0x4d0df2?_0x4d0df2+_0x4928a7(0x174):'dataset'+_0x163697[_0x4928a7(0x16c)]+_0x4928a7(0x174),'pkField':undefined,'allFields':[]};});return[..._0x3d35c6,..._0x24a6cf];}function a4_0x4b35(){const _0x17d19b=['Api','pkField','tableName','1810990wxYEqg','3983961XAexXA','526kvMcZC','filter','dataset','trim','1161hcbfJw','name','dataset_','split','replace','allFields','toUpperCase','8329370ZFNhZk','5464304zIXHYz','83288HBndjn','map','919482FOhhya','code','get','5989CmPrMQ','forEach','from','dbtableConfig','28HYQpQF','set'];a4_0x4b35=function(){return _0x17d19b;};return a4_0x4b35();}function snakeToCamel(_0x2f3994){const _0x297a77=a4_0xb7e3;if(!_0x2f3994)return _0x2f3994;const _0x2cc446=_0x2f3994[_0x297a77(0x17c)]();return _0x2cc446[_0x297a77(0x181)](/_([a-zA-Z0-9])/g,(_0x4ff6c2,_0x2d4c3f)=>_0x2d4c3f[_0x297a77(0x166)]());}
1
+ function a4_0x2dba(_0x3e00c6,_0x449fc4){const _0x3589e0=a4_0x3589();return a4_0x2dba=function(_0x2dba6f,_0x4a50cd){_0x2dba6f=_0x2dba6f-0x9b;let _0x177b08=_0x3589e0[_0x2dba6f];return _0x177b08;},a4_0x2dba(_0x3e00c6,_0x449fc4);}function a4_0x3589(){const _0x2da101=['dbtableConfig','2032430qRVVCN','dataset','code','set','allFields','get','156MvtIGd','toUpperCase','map','trim','filter','forEach','88320FxhijU','2jmmXmA','118966YLfcPc','split','name','values','750332ieFxmN','tableName','dataset_','Api','946845JPLkVT','1179626gZIinx','16UNEdkI','replace','755HtbFCa'];a4_0x3589=function(){return _0x2da101;};return a4_0x3589();}(function(_0x4b1ca2,_0x28fb6e){const _0x518609=a4_0x2dba,_0x2471a2=_0x4b1ca2();while(!![]){try{const _0x241486=parseInt(_0x518609(0xad))/0x1*(parseInt(_0x518609(0xae))/0x2)+-parseInt(_0x518609(0xac))/0x3+parseInt(_0x518609(0xb2))/0x4+parseInt(_0x518609(0x9e))/0x5*(parseInt(_0x518609(0xa6))/0x6)+-parseInt(_0x518609(0x9b))/0x7+parseInt(_0x518609(0x9c))/0x8*(-parseInt(_0x518609(0xb6))/0x9)+parseInt(_0x518609(0xa0))/0xa;if(_0x241486===_0x28fb6e)break;else _0x2471a2['push'](_0x2471a2['shift']());}catch(_0x40b674){_0x2471a2['push'](_0x2471a2['shift']());}}}(a4_0x3589,0x19b86));export function formatDataset(_0x4ebf31){const _0x39b06e=a4_0x2dba,_0x68dae7=_0x4ebf31[_0x39b06e(0xaa)](_0x56c72=>_0x56c72[_0x39b06e(0x9f)]),_0x45fdd5=_0x4ebf31[_0x39b06e(0xaa)](_0x8dbed5=>!_0x8dbed5['dbtableConfig']),_0x14d256=new Map();_0x68dae7[_0x39b06e(0xab)](_0x5dec25=>{const _0x390fee=_0x39b06e,_0x35ccb0=_0x5dec25['dbtableConfig'][_0x390fee(0xb3)],_0x6f258c=_0x14d256[_0x390fee(0xa5)](_0x35ccb0);(!_0x6f258c||_0x5dec25['id']>_0x6f258c['id'])&&_0x14d256[_0x390fee(0xa3)](_0x35ccb0,_0x5dec25);});const _0x108c3f=Array['from'](_0x14d256[_0x39b06e(0xb1)]())[_0x39b06e(0xa8)](_0xe307f8=>{const _0x4f0372=_0x39b06e,_0x27e1d6=snakeToCamel(_0xe307f8[_0x4f0372(0x9f)][_0x4f0372(0xb3)]);return{'id':_0xe307f8['id'],'name':_0xe307f8['name'],'code':_0xe307f8[_0x4f0372(0xa2)],'tableName':_0xe307f8[_0x4f0372(0x9f)][_0x4f0372(0xb3)],'apiFucName':_0x27e1d6?_0x27e1d6+_0x4f0372(0xb5):'dataset'+_0xe307f8['code']+_0x4f0372(0xb5),'pkField':_0xe307f8[_0x4f0372(0x9f)]['pkField'],'allFields':_0xe307f8[_0x4f0372(0x9f)][_0x4f0372(0xa4)][_0x4f0372(0xaf)](',')};}),_0x22e53e=_0x45fdd5[_0x39b06e(0xa8)](_0x445340=>{const _0x3bf04e=_0x39b06e,_0x13240b=_0x3bf04e(0xb4)+_0x445340[_0x3bf04e(0xa2)],_0x4e686b=snakeToCamel(_0x13240b);return{'id':_0x445340['id'],'name':_0x445340[_0x3bf04e(0xb0)],'code':_0x445340[_0x3bf04e(0xa2)],'tableName':_0x13240b,'apiFucName':_0x4e686b?_0x4e686b+_0x3bf04e(0xb5):_0x3bf04e(0xa1)+_0x445340[_0x3bf04e(0xa2)]+_0x3bf04e(0xb5),'pkField':undefined,'allFields':[]};});return[..._0x108c3f,..._0x22e53e];}function snakeToCamel(_0x55fbec){const _0x2ed199=a4_0x2dba;if(!_0x55fbec)return _0x55fbec;const _0x6640ef=_0x55fbec[_0x2ed199(0xa9)]();return _0x6640ef[_0x2ed199(0x9d)](/_([a-zA-Z0-9])/g,(_0x487e36,_0xf179c9)=>_0xf179c9[_0x2ed199(0xa7)]());}
@@ -1 +1 @@
1
- (function(_0x3eca15,_0x16e923){const _0x1c7da6=a5_0x5ae5,_0x2ffdc5=_0x3eca15();while(!![]){try{const _0x38daf5=parseInt(_0x1c7da6(0x80))/0x1+-parseInt(_0x1c7da6(0x8d))/0x2+parseInt(_0x1c7da6(0x78))/0x3+parseInt(_0x1c7da6(0x8f))/0x4*(-parseInt(_0x1c7da6(0x92))/0x5)+-parseInt(_0x1c7da6(0x74))/0x6*(-parseInt(_0x1c7da6(0x76))/0x7)+parseInt(_0x1c7da6(0x9c))/0x8*(-parseInt(_0x1c7da6(0x8a))/0x9)+-parseInt(_0x1c7da6(0x77))/0xa*(-parseInt(_0x1c7da6(0x90))/0xb);if(_0x38daf5===_0x16e923)break;else _0x2ffdc5['push'](_0x2ffdc5['shift']());}catch(_0x762296){_0x2ffdc5['push'](_0x2ffdc5['shift']());}}}(a5_0x1632,0xbdf02));function a5_0x5ae5(_0x515a2f,_0x175a9b){const _0x16323d=a5_0x1632();return a5_0x5ae5=function(_0x5ae5b7,_0x5a6bc7){_0x5ae5b7=_0x5ae5b7-0x72;let _0x21dc88=_0x16323d[_0x5ae5b7];return _0x21dc88;},a5_0x5ae5(_0x515a2f,_0x175a9b);}import a5_0x2aa706 from'prettier';import{mkdirSync,writeFileSync,readFileSync}from'node:fs';import a5_0x4531e7 from'node:path';function a5_0x1632(){const _0x425777=['\x20-\x20模型配置文件\x20(','CONFIG_NAMES.DEFAULT','1772469QOQtms','src/api','replace','1032858zjvTAL',',\x20env:\x20\x22','1525980lSwout','1023qnzgBb','templates/generate-api','15RfeOBc','success','\x22\x20}','typescript','*\x20API配置\x20apiConfigName\x20:\x20','../..','init-api','utf8','*\x20可以开始使用:\x20import\x20{\x20lovrabetClient\x20}\x20from\x20\x27@/api/','\x20\x20\x20•\x20','40PnawzO','string','请先通过\x20`lovrabet\x20config\x20set\x20app\x20<value>`\x20配置应用\x20Code','url','code','\x20-\x20客户端实例文件','join','length','src/api/','slice','replaceApiContent','{\x20apiConfigName:\x20','30RcQhHP','\x20个模型)','385042vIfCMs','198160MmYvaX','544635UPZiLH','API\x20文件生成成功!','forEach','format','keys','-api','log','client','1124142FoeWQr','toUpperCase','env','api','resolve','dirname','online','charAt'];a5_0x1632=function(){return _0x425777;};return a5_0x1632();}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(_0x4b30a9,_0xd0b2e='',_0x1418a6,_0x5a7283=![],_0x5b8ec4){const _0x15ed42=a5_0x5ae5,_0x5148de=readConfig(),_0x1800b3=_0x1418a6||_0x5148de?.['app'];if(typeof _0x1800b3!==_0x15ed42(0x9d)||!_0x1800b3)throw new Error(_0x15ed42(0x9e));const _0x5711ee=_0x5a7283?_0x15ed42(0x89):'\x22'+_0x1800b3+'\x22',_0x15188e=typeof _0x5148de[_0x15ed42(0x82)]===_0x15ed42(0x9d)?_0x5148de[_0x15ed42(0x82)]:undefined,_0x4ae98b=_0x5b8ec4||_0x15188e||_0x15ed42(0x86),_0xf2dc94=_0x4ae98b!==_0x15ed42(0x86);let _0x22df15;if(_0x5a7283)_0xf2dc94?_0x22df15=_0x15ed42(0x73)+_0x5711ee+_0x15ed42(0x8e)+_0x4ae98b+_0x15ed42(0x94):_0x22df15='';else{const _0x845af5=_0xf2dc94?',\x20env:\x20\x22'+_0x4ae98b+'\x22':'';_0x22df15='{\x20apiConfigName:\x20\x22'+_0x1800b3+'\x22'+_0x845af5+'\x20}';}const _0x9fc5e5=_0xd0b2e?_0xd0b2e+_0x15ed42(0x7d):_0x15ed42(0x83),_0x3659a5=_0xd0b2e?_0xd0b2e+'-client':_0x15ed42(0x7f),_0x58dfce=formatDataset(_0x4b30a9),_0xab9157={};_0x58dfce[_0x15ed42(0x7a)](_0x2e41f0=>{const _0x434923=_0x15ed42,_0x466f8c=_0x2e41f0['apiFucName'][_0x434923(0x8c)](/Api$/,''),_0x44d9fa=_0x466f8c[_0x434923(0x87)](0x0)[_0x434923(0x81)]()+_0x466f8c[_0x434923(0xa5)](0x1);_0xab9157[_0x44d9fa]={'tableName':_0x2e41f0['tableName'],'datasetCode':_0x2e41f0[_0x434923(0xa0)]};});const _0x4299a7=fileURLToPath(import.meta[_0x15ed42(0x9f)]),_0x54070d=a5_0x4531e7[_0x15ed42(0x84)](a5_0x4531e7[_0x15ed42(0x85)](_0x4299a7),_0x15ed42(0x97)),_0x4909f3=a5_0x4531e7[_0x15ed42(0xa2)](_0x54070d,_0x15ed42(0x91)),_0x2ccded=a5_0x4531e7[_0x15ed42(0xa2)](_0x4909f3,'api.ts.tpl'),_0x335ea0=a5_0x4531e7[_0x15ed42(0xa2)](_0x4909f3,'client.ts.tpl');mkdirSync(_0x15ed42(0x8b),{'recursive':!![]});const _0x4fb502=readFileSync(_0x2ccded,_0x15ed42(0x99)),_0x5f0878=TemplateReplacer[_0x15ed42(0x72)](_0x4fb502,_0x1800b3,_0xab9157,Object[_0x15ed42(0x7c)](_0xab9157)[0x0],_0x9fc5e5,_0x5711ee),_0x5b90d4=await a5_0x2aa706[_0x15ed42(0x7b)](_0x5f0878,{'parser':_0x15ed42(0x95)}),_0x195cbf=_0x15ed42(0xa4)+_0x9fc5e5+'.ts';writeFileSync(_0x195cbf,_0x5b90d4,{'encoding':_0x15ed42(0x99)});const _0x114304=readFileSync(_0x335ea0,_0x15ed42(0x99)),_0x2ae62a=TemplateReplacer['replaceApiContent'](_0x114304,_0x1800b3,_0xab9157,Object['keys'](_0xab9157)[0x0],_0x9fc5e5,_0x5711ee,_0x22df15),_0x1e6250=await a5_0x2aa706[_0x15ed42(0x7b)](_0x2ae62a,{'parser':_0x15ed42(0x95)}),_0x4b3004=_0x15ed42(0xa4)+_0x3659a5+'.ts';writeFileSync(_0x4b3004,_0x1e6250,{'encoding':_0x15ed42(0x99)}),logger[_0x15ed42(0x93)](_0x15ed42(0x98),_0x15ed42(0x79)),console[_0x15ed42(0x7e)]('*\x20已生成文件:'),console[_0x15ed42(0x7e)](_0x15ed42(0x9b)+_0x195cbf+_0x15ed42(0x88)+Object[_0x15ed42(0x7c)](_0xab9157)[_0x15ed42(0xa3)]+_0x15ed42(0x75)),console[_0x15ed42(0x7e)](_0x15ed42(0x9b)+_0x4b3004+_0x15ed42(0xa1)),console[_0x15ed42(0x7e)](_0x15ed42(0x96)+_0x5711ee),console[_0x15ed42(0x7e)](_0x15ed42(0x9a)+_0x3659a5+'\x27');}
1
+ const a5_0x497cd3=a5_0x3bac;(function(_0x1df8c6,_0x1428f0){const _0x4aad75=a5_0x3bac,_0x9302f6=_0x1df8c6();while(!![]){try{const _0x2d40b9=-parseInt(_0x4aad75(0x119))/0x1*(-parseInt(_0x4aad75(0x122))/0x2)+parseInt(_0x4aad75(0x107))/0x3*(-parseInt(_0x4aad75(0x106))/0x4)+-parseInt(_0x4aad75(0x12c))/0x5+parseInt(_0x4aad75(0x102))/0x6*(parseInt(_0x4aad75(0x11f))/0x7)+-parseInt(_0x4aad75(0x115))/0x8*(parseInt(_0x4aad75(0x10a))/0x9)+-parseInt(_0x4aad75(0x125))/0xa*(-parseInt(_0x4aad75(0x120))/0xb)+parseInt(_0x4aad75(0x128))/0xc*(-parseInt(_0x4aad75(0x127))/0xd);if(_0x2d40b9===_0x1428f0)break;else _0x9302f6['push'](_0x9302f6['shift']());}catch(_0x1435ab){_0x9302f6['push'](_0x9302f6['shift']());}}}(a5_0x1f11,0xcd942));import a5_0x174ee0 from'prettier';import{mkdirSync,writeFileSync,readFileSync}from'node:fs';import a5_0x17faf3 from'node:path';import{fileURLToPath}from'node:url';import{readConfig}from'../utils/config.js';function a5_0x3bac(_0x2f0a79,_0x2d1ced){const _0x1f1109=a5_0x1f11();return a5_0x3bac=function(_0x3bac2d,_0x15b063){_0x3bac2d=_0x3bac2d-0xff;let _0x4aad8a=_0x1f1109[_0x3bac2d];return _0x4aad8a;},a5_0x3bac(_0x2f0a79,_0x2d1ced);}import{formatDataset}from'./format-dataset.js';import{TemplateReplacer}from'../utils/template-replacer.js';function a5_0x1f11(){const _0x2430e6=['url','\x20个模型)','client','4446070LerLVx','API\x20文件生成成功!','resolve','format','api','请先通过\x20`lovrabet\x20config\x20set\x20app\x20<value>`\x20配置应用\x20Code','dirname','apiFucName','9549984HTxqMx','online','./src/api/','\x22\x20}','244Awfjbr','27051ABLIzx','.ts','length','9PsRzce','CONFIG_NAMES.DEFAULT','-client','replace','code','slice','utf8','string','keys','{\x20apiConfigName:\x20','templates/generate-api','7720408pyjdma','tableName','api.ts.tpl','*\x20可以开始使用:\x20import\x20{\x20lovrabetClient\x20}\x20from\x20\x27@/','1uIogaw','typescript','../..','endsWith','app','join','7iqitgh','10038523DlKptA','\x20\x20\x20•\x20','1840502InElPp','env','log','10oIjsFE',',\x20env:\x20\x22','105274UwRwlJ','264fBMxkx'];a5_0x1f11=function(){return _0x2430e6;};return a5_0x1f11();}import{logger}from'../utils/logger.js';export async function generateApiFile(_0x432935,_0x241e99='',_0x1cecbe,_0x542e9e=![],_0x3ab604,_0x4a6586=a5_0x497cd3(0x104)){const _0x5b482d=a5_0x497cd3,_0x5ea918=readConfig(),_0x19676b=_0x1cecbe||_0x5ea918?.[_0x5b482d(0x11d)];if(typeof _0x19676b!==_0x5b482d(0x111)||!_0x19676b)throw new Error(_0x5b482d(0xff));const _0x53e6c6=_0x542e9e?_0x5b482d(0x10b):'\x22'+_0x19676b+'\x22',_0x2cc0c4=typeof _0x5ea918[_0x5b482d(0x123)]===_0x5b482d(0x111)?_0x5ea918['env']:undefined,_0x36d66d=_0x3ab604||_0x2cc0c4||'online',_0xcdacf0=_0x36d66d!==_0x5b482d(0x103);let _0x146b4b;if(_0x542e9e)_0xcdacf0?_0x146b4b=_0x5b482d(0x113)+_0x53e6c6+_0x5b482d(0x126)+_0x36d66d+_0x5b482d(0x105):_0x146b4b='';else{const _0x69b8d3=_0xcdacf0?_0x5b482d(0x126)+_0x36d66d+'\x22':'';_0x146b4b='{\x20apiConfigName:\x20\x22'+_0x19676b+'\x22'+_0x69b8d3+'\x20}';}const _0x5b4782=_0x241e99?_0x241e99+'-api':_0x5b482d(0x130),_0x3611c2=_0x241e99?_0x241e99+_0x5b482d(0x10c):_0x5b482d(0x12b),_0x2c2231=formatDataset(_0x432935),_0x1dcc50={};_0x2c2231['forEach'](_0x9e01c1=>{const _0x4df0f9=_0x5b482d,_0x1adc21=_0x9e01c1[_0x4df0f9(0x101)][_0x4df0f9(0x10d)](/Api$/,''),_0x14eb6c=_0x1adc21['charAt'](0x0)['toUpperCase']()+_0x1adc21[_0x4df0f9(0x10f)](0x1);_0x1dcc50[_0x14eb6c]={'tableName':_0x9e01c1[_0x4df0f9(0x116)],'datasetCode':_0x9e01c1[_0x4df0f9(0x10e)]};});const _0x4ff11c=fileURLToPath(import.meta[_0x5b482d(0x129)]),_0x50afeb=a5_0x17faf3[_0x5b482d(0x12e)](a5_0x17faf3[_0x5b482d(0x100)](_0x4ff11c),_0x5b482d(0x11b)),_0x53e496=a5_0x17faf3[_0x5b482d(0x11e)](_0x50afeb,_0x5b482d(0x114)),_0x330a79=a5_0x17faf3['join'](_0x53e496,_0x5b482d(0x117)),_0x47bdec=a5_0x17faf3[_0x5b482d(0x11e)](_0x53e496,'client.ts.tpl'),_0x5a3feb=_0x4a6586[_0x5b482d(0x11c)]('/')?_0x4a6586[_0x5b482d(0x10f)](0x0,-0x1):_0x4a6586;mkdirSync(_0x5a3feb,{'recursive':!![]});const _0x877e1e=readFileSync(_0x330a79,'utf8'),_0x1ffd50=TemplateReplacer['replaceApiContent'](_0x877e1e,_0x19676b,_0x1dcc50,Object[_0x5b482d(0x112)](_0x1dcc50)[0x0],_0x5b4782,_0x53e6c6),_0x1c7055=await a5_0x174ee0[_0x5b482d(0x12f)](_0x1ffd50,{'parser':_0x5b482d(0x11a)}),_0x29e2f8=_0x5a3feb+'/'+_0x5b4782+_0x5b482d(0x108);writeFileSync(_0x29e2f8,_0x1c7055,{'encoding':_0x5b482d(0x110)});const _0x44f452=readFileSync(_0x47bdec,'utf8'),_0x4ef9c4=TemplateReplacer['replaceApiContent'](_0x44f452,_0x19676b,_0x1dcc50,Object[_0x5b482d(0x112)](_0x1dcc50)[0x0],_0x5b4782,_0x53e6c6,_0x146b4b),_0x98547b=await a5_0x174ee0['format'](_0x4ef9c4,{'parser':_0x5b482d(0x11a)}),_0x453dc5=_0x5a3feb+'/'+_0x3611c2+_0x5b482d(0x108);writeFileSync(_0x453dc5,_0x98547b,{'encoding':_0x5b482d(0x110)}),logger['success']('init-api',_0x5b482d(0x12d)),console['log']('*\x20已生成文件:'),console[_0x5b482d(0x124)](_0x5b482d(0x121)+_0x29e2f8+'\x20-\x20模型配置文件\x20('+Object[_0x5b482d(0x112)](_0x1dcc50)[_0x5b482d(0x109)]+_0x5b482d(0x12a)),console[_0x5b482d(0x124)]('\x20\x20\x20•\x20'+_0x453dc5+'\x20-\x20客户端实例文件'),console[_0x5b482d(0x124)]('*\x20API配置\x20apiConfigName\x20:\x20'+_0x53e6c6);const _0x341fc7=_0x5a3feb[_0x5b482d(0x10d)](/^\.\//,'')[_0x5b482d(0x10d)](/\/$/,'');console['log'](_0x5b482d(0x118)+_0x341fc7+'/'+_0x3611c2+'\x27');}
package/lib/api/main.js CHANGED
@@ -1 +1 @@
1
- function a6_0x3fb3(_0x20836a,_0x256a30){const _0x2c88d0=a6_0x2c88();return a6_0x3fb3=function(_0x3fb3ce,_0x3a067e){_0x3fb3ce=_0x3fb3ce-0x129;let _0x3332bd=_0x2c88d0[_0x3fb3ce];return _0x3332bd;},a6_0x3fb3(_0x20836a,_0x256a30);}(function(_0x593d56,_0x35b39a){const _0x327323=a6_0x3fb3,_0x50d672=_0x593d56();while(!![]){try{const _0x4487b5=-parseInt(_0x327323(0x12c))/0x1+parseInt(_0x327323(0x12f))/0x2+-parseInt(_0x327323(0x131))/0x3+parseInt(_0x327323(0x129))/0x4+parseInt(_0x327323(0x12d))/0x5*(-parseInt(_0x327323(0x133))/0x6)+-parseInt(_0x327323(0x130))/0x7+parseInt(_0x327323(0x132))/0x8;if(_0x4487b5===_0x35b39a)break;else _0x50d672['push'](_0x50d672['shift']());}catch(_0x4d0fa8){_0x50d672['push'](_0x50d672['shift']());}}}(a6_0x2c88,0x8852e));import{jsx as a6_0x123f5e}from'react/jsx-runtime';import{render}from'ink';import{ApiPullUI}from'./api-pull-ui.js';export async function apiCli(_0x4ffde9){const _0x521b86=a6_0x3fb3,_0x4825cd=_0x4ffde9[_0x521b86(0x12b)][0x1];if(_0x4825cd===_0x521b86(0x139)){const _0x5bd854=_0x4ffde9['input'][0x2],_0x296a22=typeof _0x4ffde9[_0x521b86(0x137)]['env']===_0x521b86(0x138)?_0x4ffde9[_0x521b86(0x137)]['env']:undefined;render(a6_0x123f5e(ApiPullUI,{'appCode':_0x5bd854,'env':_0x296a22}));}else console[_0x521b86(0x12e)](_0x521b86(0x135)+_0x4825cd),console[_0x521b86(0x12a)](_0x521b86(0x13a)),console['log'](_0x521b86(0x134)),console[_0x521b86(0x12a)](_0x521b86(0x136)),process['exit'](0x1);}function a6_0x2c88(){const _0x8700e0=['string','pull','Available\x20commands:','1732424lRnwZF','log','input','1112641lrHpXX','145tzRWRo','error','706942TKWKzE','2308096eVRfzB','448884Yczidu','18234888tciyxb','189426YfPjnE','\x20\x20lovrabet\x20api\x20pull\x20[app-code]\x20\x20\x20\x20//\x20拉取并生成\x20API\x20配置文件','Unknown\x20api\x20command:\x20','\x20\x20\x20\x20app-code:\x20可选的应用AppCode,不指定则使用配置的默认值','flags'];a6_0x2c88=function(){return _0x8700e0;};return a6_0x2c88();}
1
+ (function(_0x8998b6,_0x44aa6c){const _0x201587=a6_0x3ae3,_0x4fcb9d=_0x8998b6();while(!![]){try{const _0x36607d=parseInt(_0x201587(0x14f))/0x1+parseInt(_0x201587(0x14a))/0x2*(parseInt(_0x201587(0x14e))/0x3)+parseInt(_0x201587(0x152))/0x4+-parseInt(_0x201587(0x153))/0x5+parseInt(_0x201587(0x154))/0x6+parseInt(_0x201587(0x14b))/0x7+parseInt(_0x201587(0x159))/0x8*(-parseInt(_0x201587(0x151))/0x9);if(_0x36607d===_0x44aa6c)break;else _0x4fcb9d['push'](_0x4fcb9d['shift']());}catch(_0x3d4382){_0x4fcb9d['push'](_0x4fcb9d['shift']());}}}(a6_0x353f,0xb295a));import{jsx as a6_0xc600d5}from'react/jsx-runtime';function a6_0x3ae3(_0x14faf0,_0x5bf349){const _0x353f46=a6_0x353f();return a6_0x3ae3=function(_0x3ae34d,_0x1d28bb){_0x3ae34d=_0x3ae34d-0x145;let _0x1a338b=_0x353f46[_0x3ae34d];return _0x1a338b;},a6_0x3ae3(_0x14faf0,_0x5bf349);}import{render}from'ink';import{ApiPullUI}from'./api-pull-ui.js';function a6_0x353f(){const _0x5a8db4=['3pTVeoT','1036458oNezsn','\x20\x20lovrabet\x20api\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20拉取并生成\x20API\x20配置文件','2452941kPKxjz','5466408tVyhzB','3004185nGeFnx','109506rpIYuP','string','\x20\x20lovrabet\x20api\x20pull\x20--env\x20<env>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定环境(如:\x20daily,\x20online)','\x0alovrabet\x20api\x20-\x20API\x20相关操作\x0a\x0a用法:\x0a\x20\x20$\x20lovrabet\x20api\x20pull\x20[options]\x0a\x0a选项:\x0a\x20\x20--appcode\x20<code>\x20\x20\x20\x20指定应用代码\x0a\x20\x20--output\x20<dir>\x20\x20\x20\x20\x20\x20指定输出目录(默认:./src/api/)\x0a\x20\x20--env\x20<env>\x20\x20\x20\x20\x20\x20\x20\x20\x20指定环境(如:daily、online)\x0a\x20\x20--help\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20显示此帮助信息\x0a\x0a示例:\x0a\x20\x20$\x20lovrabet\x20api\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20拉取并生成\x20API\x20配置文件\x0a\x20\x20$\x20lovrabet\x20api\x20pull\x20--appcode\x20myapp\x20\x20\x20\x20\x20\x20\x20//\x20使用指定的\x20appcode\x0a\x20\x20$\x20lovrabet\x20api\x20pull\x20--output\x20./api\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定输出目录\x0a\x20\x20$\x20lovrabet\x20api\x20pull\x20--env\x20daily\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定环境拉取\x20API\x0a\x20\x20$\x20lovrabet\x20api\x20pull\x20--appcode\x20myapp\x20--env\x20daily\x20--output\x20./api\x0a','env','56kvmReI','flags','output','error','input','\x20\x20lovrabet\x20api\x20pull\x20--output\x20<dir>\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定输出目录(默认:\x20./src/api/)','❌\x20错误:不再支持位置参数方式','请使用\x20--appcode\x20参数,例如:','appcode','pull','log','exit','1143764nLbBlc','1728783NGvlyH','\x20\x20lovrabet\x20api\x20pull\x20--appcode\x20<code>\x20\x20\x20\x20\x20\x20//\x20使用指定的\x20appcode','help'];a6_0x353f=function(){return _0x5a8db4;};return a6_0x353f();}export async function apiCli(_0x2b71ad){const _0x9d8cda=a6_0x3ae3,_0x554b5f=_0x2b71ad[_0x9d8cda(0x15d)][0x1];if(_0x2b71ad['flags'][_0x9d8cda(0x14d)]){console[_0x9d8cda(0x148)](_0x9d8cda(0x157));return;}if(_0x554b5f===_0x9d8cda(0x147)){_0x2b71ad['input'][0x2]&&(console[_0x9d8cda(0x15c)](_0x9d8cda(0x15f)),console[_0x9d8cda(0x148)](_0x9d8cda(0x145)),console[_0x9d8cda(0x148)]('\x20\x20lovrabet\x20api\x20pull\x20--appcode\x20'+_0x2b71ad[_0x9d8cda(0x15d)][0x2]),process[_0x9d8cda(0x149)](0x1));const _0xf3d9c2=_0x2b71ad[_0x9d8cda(0x15a)][_0x9d8cda(0x146)],_0x11847d=typeof _0x2b71ad[_0x9d8cda(0x15a)]['env']===_0x9d8cda(0x155)?_0x2b71ad['flags'][_0x9d8cda(0x158)]:undefined,_0x33d538=_0x2b71ad['flags'][_0x9d8cda(0x15b)];render(a6_0xc600d5(ApiPullUI,{'appCode':_0xf3d9c2,'env':_0x11847d,'output':_0x33d538}));}else console[_0x9d8cda(0x15c)]('Unknown\x20api\x20command:\x20'+_0x554b5f),console['log']('Available\x20commands:'),console[_0x9d8cda(0x148)](_0x9d8cda(0x150)),console[_0x9d8cda(0x148)](_0x9d8cda(0x14c)),console[_0x9d8cda(0x148)](_0x9d8cda(0x15e)),console[_0x9d8cda(0x148)](_0x9d8cda(0x156)),process['exit'](0x1);}
@@ -1 +1 @@
1
- (function(_0x65751e,_0x4cd957){const _0x578320=a7_0x4c42,_0x43bd0f=_0x65751e();while(!![]){try{const _0x5c9abf=-parseInt(_0x578320(0x1c8))/0x1+-parseInt(_0x578320(0x1e7))/0x2+-parseInt(_0x578320(0x1cb))/0x3*(-parseInt(_0x578320(0x1e0))/0x4)+parseInt(_0x578320(0x1d9))/0x5*(parseInt(_0x578320(0x1ce))/0x6)+parseInt(_0x578320(0x1ee))/0x7+-parseInt(_0x578320(0x1e5))/0x8+parseInt(_0x578320(0x1d0))/0x9;if(_0x5c9abf===_0x4cd957)break;else _0x43bd0f['push'](_0x43bd0f['shift']());}catch(_0x55908c){_0x43bd0f['push'](_0x43bd0f['shift']());}}}(a7_0x4b9c,0x6b715));function a7_0x4c42(_0x510385,_0x40fb4c){const _0x4b9cd0=a7_0x4b9c();return a7_0x4c42=function(_0x4c4214,_0x1d0600){_0x4c4214=_0x4c4214-0x1c2;let _0x1cf641=_0x4b9cd0[_0x4c4214];return _0x1cf641;},a7_0x4c42(_0x510385,_0x40fb4c);}import{readConfig}from'../utils/config.js';import{getCookie}from'../auth/get-cookie.js';import{getApiDomain}from'../constant/domain.js';import{initEnv}from'../constant/env.js';import{generateApiFile}from'./generate-api-file.js';import{logger}from'../utils/logger.js';import{httpRequest}from'../utils/http-client.js';function a7_0x4b9c(){const _0x302631=['data','2345220AlzTmn','message','\x20\x20\x20•\x20','*\x20正在从服务器拉取\x20API\x20配置...\x20(环境:\x20','client','获取数据集失败,原因:登录鉴权失败,登录已过期','×\x20文件前缀格式不正确。只能包含字母、数字、连字符和下划线,且必须以字母开头。',',且无法读取错误响应内容','√\x20API\x20配置文件生成完成','401825NMpXVa','create-api-pull','length','*\x20开始生成\x20API\x20配置文件:','获取数据集失败,HTTP状态码:\x20','trim','status','12yimbef','API\x20配置拉取异常:\x20','*\x20正在处理\x20','/smartapi/dataset/getList?appCode=','.ts\x20-\x20客户端实例文件','1188720gbGmSj','×\x20服务器返回错误:','742598xlCPVY','api','test','×\x20错误详情:','未知错误','url','string','3362541qHGYyk','success','\x20个数据集...','error','.ts\x20-\x20模型配置文件','cwd','env','API\x20配置拉取成功:\x20','tableData','chdir','log','734219irhAjS','online','-api','712155cXaSbk','text','API\x20配置拉取失败:\x20','18ftZeDB'];a7_0x4b9c=function(){return _0x302631;};return a7_0x4b9c();}export async function pullApiSilent(_0x4a20a4,_0x370a16,_0x511c38,_0x4d14e9){const _0x1641aa=a7_0x4c42;let _0x4ba66e;try{const _0x275cb0=_0x370a16?.[_0x1641aa(0x1de)]()||'';if(_0x275cb0){const _0x52793b=/^[a-zA-Z][a-zA-Z0-9_-]*$/;if(!_0x52793b[_0x1641aa(0x1e9)](_0x275cb0))return console[_0x1641aa(0x1f1)](_0x1641aa(0x1d6)),![];}_0x511c38&&(_0x4ba66e=process[_0x1641aa(0x1c2)](),process[_0x1641aa(0x1c6)](_0x511c38));const _0x29353b=readConfig(),_0x9b369c=typeof _0x29353b[_0x1641aa(0x1c3)]===_0x1641aa(0x1ed)?_0x29353b[_0x1641aa(0x1c3)]:undefined,_0x248e0f=_0x4d14e9||_0x9b369c||_0x1641aa(0x1c9);initEnv(_0x248e0f),console[_0x1641aa(0x1c7)](_0x1641aa(0x1d3)+_0x248e0f+')');const _0x35a65d=getApiDomain()+_0x1641aa(0x1e3)+_0x4a20a4+'&pageSize=999&currentPage=1',_0x756a89=await httpRequest(_0x35a65d,{'headers':{'Cookie':getCookie()},'timeout':0xea60,'retries':0x2});if(_0x756a89['ok']){const _0xfd03d8=_0x756a89[_0x1641aa(0x1cf)];if(_0xfd03d8[_0x1641aa(0x1ef)]){const _0x5a6a4e=_0x275cb0?_0x275cb0+_0x1641aa(0x1ca):_0x1641aa(0x1e8),_0x1eb44a=_0x275cb0?_0x275cb0+'-client':_0x1641aa(0x1d4);return console[_0x1641aa(0x1c7)](_0x1641aa(0x1dc)),console['log'](_0x1641aa(0x1d2)+_0x5a6a4e+_0x1641aa(0x1f2)),console[_0x1641aa(0x1c7)](_0x1641aa(0x1d2)+_0x1eb44a+_0x1641aa(0x1e4)),console[_0x1641aa(0x1c7)](_0x1641aa(0x1e2)+_0xfd03d8[_0x1641aa(0x1cf)][_0x1641aa(0x1c5)][_0x1641aa(0x1db)]+_0x1641aa(0x1f0)),await generateApiFile(_0xfd03d8[_0x1641aa(0x1cf)][_0x1641aa(0x1c5)],_0x275cb0,_0x4a20a4,!![],_0x248e0f),console[_0x1641aa(0x1c7)](_0x1641aa(0x1d8)),_0x511c38&&logger['info'](_0x1641aa(0x1da),_0x1641aa(0x1c4)+_0x4a20a4,{'projectPath':_0x511c38,'appCode':_0x4a20a4,'datasetCount':_0xfd03d8[_0x1641aa(0x1cf)][_0x1641aa(0x1c5)][_0x1641aa(0x1db)],'filePrefix':_0x275cb0}),!![];}else return console[_0x1641aa(0x1f1)](_0x1641aa(0x1e6),_0xfd03d8[_0x1641aa(0x1d1)]||_0x1641aa(0x1eb)),_0x511c38&&logger[_0x1641aa(0x1f1)](_0x1641aa(0x1da),_0x1641aa(0x1cd)+(_0xfd03d8['message']||_0x1641aa(0x1eb)),{'projectPath':_0x511c38,'appCode':_0x4a20a4}),![];}else{if(_0x756a89[_0x1641aa(0x1df)]===0x191){const _0x13b3bb=_0x1641aa(0x1d5);console[_0x1641aa(0x1f1)]('×\x20'+_0x13b3bb),_0x511c38&&logger[_0x1641aa(0x1f1)](_0x1641aa(0x1da),_0x13b3bb,{'status':_0x756a89[_0x1641aa(0x1df)],'appCode':_0x4a20a4,'url':_0x756a89['url'],'projectPath':_0x511c38});}else{const _0x3732a7=_0x1641aa(0x1dd)+_0x756a89['status'];console[_0x1641aa(0x1f1)]('×\x20'+_0x3732a7);try{const _0x1fcae6=await _0x756a89[_0x1641aa(0x1cc)]();_0x1fcae6&&console[_0x1641aa(0x1f1)](_0x1641aa(0x1ea),_0x1fcae6),_0x511c38&&logger['error']('create-api-pull',_0x3732a7,{'status':_0x756a89['status'],'appCode':_0x4a20a4,'url':_0x756a89[_0x1641aa(0x1ec)],'errorBody':_0x1fcae6,'projectPath':_0x511c38});}catch(_0x3cf564){console['error']('×\x20无法读取错误响应内容'),_0x511c38&&logger[_0x1641aa(0x1f1)]('create-api-pull',_0x3732a7+_0x1641aa(0x1d7),{'status':_0x756a89[_0x1641aa(0x1df)],'appCode':_0x4a20a4,'url':_0x756a89[_0x1641aa(0x1ec)],'readError':_0x3cf564 instanceof Error?_0x3cf564[_0x1641aa(0x1d1)]:String(_0x3cf564),'projectPath':_0x511c38});}}return![];}}catch(_0x41863f){const _0x1774be=_0x41863f instanceof Error?_0x41863f[_0x1641aa(0x1d1)]:String(_0x41863f);return console[_0x1641aa(0x1f1)]('×\x20API\x20配置拉取异常:',_0x1774be),_0x511c38&&logger[_0x1641aa(0x1f1)](_0x1641aa(0x1da),_0x1641aa(0x1e1)+_0x1774be,{'appCode':_0x4a20a4,'projectPath':_0x511c38}),![];}finally{_0x4ba66e&&process[_0x1641aa(0x1c6)](_0x4ba66e);}}
1
+ (function(_0x1437ca,_0x2482ff){const _0x25a84f=a7_0x2a24,_0x159dee=_0x1437ca();while(!![]){try{const _0x2ef2c4=parseInt(_0x25a84f(0xb5))/0x1+parseInt(_0x25a84f(0x9e))/0x2+parseInt(_0x25a84f(0xa2))/0x3*(-parseInt(_0x25a84f(0xaf))/0x4)+-parseInt(_0x25a84f(0xa3))/0x5*(-parseInt(_0x25a84f(0x97))/0x6)+parseInt(_0x25a84f(0xb4))/0x7*(parseInt(_0x25a84f(0x99))/0x8)+parseInt(_0x25a84f(0x95))/0x9+-parseInt(_0x25a84f(0xbe))/0xa;if(_0x2ef2c4===_0x2482ff)break;else _0x159dee['push'](_0x159dee['shift']());}catch(_0x133fe3){_0x159dee['push'](_0x159dee['shift']());}}}(a7_0x1953,0xcf2d6));function a7_0x2a24(_0x39d6b6,_0x5be0a4){const _0x195389=a7_0x1953();return a7_0x2a24=function(_0x2a2443,_0x330a39){_0x2a2443=_0x2a2443-0x93;let _0x2518ad=_0x195389[_0x2a2443];return _0x2518ad;},a7_0x2a24(_0x39d6b6,_0x5be0a4);}import{readConfig}from'../utils/config.js';function a7_0x1953(){const _0x224f3e=['data','3vFhctm','20cvkAtX','-client','error','env','×\x20服务器返回错误:','API\x20配置拉取成功:\x20','API\x20配置拉取异常:\x20','length','cwd','.ts\x20-\x20模型配置文件','\x20个数据集...','API\x20配置拉取失败:\x20','1793116CaQokS','未知错误','online','&pageSize=999&currentPage=1','message','273FkAVBn','1454535acKRea','-api',',且无法读取错误响应内容','获取数据集失败,原因:登录鉴权失败,登录已过期','log','test','×\x20API\x20配置拉取异常:','*\x20正在处理\x20','\x20\x20\x20•\x20','42656010odezAi','.ts\x20-\x20客户端实例文件','status','√\x20API\x20配置文件生成完成','/smartapi/dataset/getList?appCode=','string','api','success','1599912FPJzPt','text','1596966oLazqQ','url','326504TizhIT','获取数据集失败,HTTP状态码:\x20','tableData','client','×\x20错误详情:','2547648fcbxXk','create-api-pull','chdir'];a7_0x1953=function(){return _0x224f3e;};return a7_0x1953();}import{getCookie}from'../auth/get-cookie.js';import{getApiDomain}from'../constant/domain.js';import{initEnv}from'../constant/env.js';import{generateApiFile}from'./generate-api-file.js';import{logger}from'../utils/logger.js';import{httpRequest}from'../utils/http-client.js';export async function pullApiSilent(_0x2bf723,_0x28a047,_0xd0d7e7,_0x3d4572){const _0x528db2=a7_0x2a24;let _0x47e646;try{const _0x5b23d3=_0x28a047?.['trim']()||'';if(_0x5b23d3){const _0x4553eb=/^[a-zA-Z][a-zA-Z0-9_-]*$/;if(!_0x4553eb[_0x528db2(0xba)](_0x5b23d3))return console[_0x528db2(0xa5)]('×\x20文件前缀格式不正确。只能包含字母、数字、连字符和下划线,且必须以字母开头。'),![];}_0xd0d7e7&&(_0x47e646=process[_0x528db2(0xab)](),process[_0x528db2(0xa0)](_0xd0d7e7));const _0x34f6f4=readConfig(),_0x15b6fd=typeof _0x34f6f4[_0x528db2(0xa6)]===_0x528db2(0xc3)?_0x34f6f4[_0x528db2(0xa6)]:undefined,_0x40610c=_0x3d4572||_0x15b6fd||_0x528db2(0xb1);initEnv(_0x40610c),console[_0x528db2(0xb9)]('*\x20正在从服务器拉取\x20API\x20配置...\x20(环境:\x20'+_0x40610c+')');const _0x33fdfb=getApiDomain()+_0x528db2(0xc2)+_0x2bf723+_0x528db2(0xb2),_0x4ec561=await httpRequest(_0x33fdfb,{'headers':{'Cookie':getCookie()},'timeout':0xea60,'retries':0x2});if(_0x4ec561['ok']){const _0x3b523c=_0x4ec561['data'];if(_0x3b523c[_0x528db2(0x94)]){const _0x2d61e2=_0x5b23d3?_0x5b23d3+_0x528db2(0xb6):_0x528db2(0x93),_0x3137d7=_0x5b23d3?_0x5b23d3+_0x528db2(0xa4):_0x528db2(0x9c);return console['log']('*\x20开始生成\x20API\x20配置文件:'),console['log'](_0x528db2(0xbd)+_0x2d61e2+_0x528db2(0xac)),console[_0x528db2(0xb9)](_0x528db2(0xbd)+_0x3137d7+_0x528db2(0xbf)),console[_0x528db2(0xb9)](_0x528db2(0xbc)+_0x3b523c[_0x528db2(0xa1)][_0x528db2(0x9b)]['length']+_0x528db2(0xad)),await generateApiFile(_0x3b523c[_0x528db2(0xa1)][_0x528db2(0x9b)],_0x5b23d3,_0x2bf723,!![],_0x40610c),console['log'](_0x528db2(0xc1)),_0xd0d7e7&&logger['info'](_0x528db2(0x9f),_0x528db2(0xa8)+_0x2bf723,{'projectPath':_0xd0d7e7,'appCode':_0x2bf723,'datasetCount':_0x3b523c[_0x528db2(0xa1)]['tableData'][_0x528db2(0xaa)],'filePrefix':_0x5b23d3}),!![];}else return console[_0x528db2(0xa5)](_0x528db2(0xa7),_0x3b523c['message']||'未知错误'),_0xd0d7e7&&logger['error'](_0x528db2(0x9f),_0x528db2(0xae)+(_0x3b523c[_0x528db2(0xb3)]||_0x528db2(0xb0)),{'projectPath':_0xd0d7e7,'appCode':_0x2bf723}),![];}else{if(_0x4ec561[_0x528db2(0xc0)]===0x191){const _0x2ef8d0=_0x528db2(0xb8);console['error']('×\x20'+_0x2ef8d0),_0xd0d7e7&&logger['error'](_0x528db2(0x9f),_0x2ef8d0,{'status':_0x4ec561[_0x528db2(0xc0)],'appCode':_0x2bf723,'url':_0x4ec561[_0x528db2(0x98)],'projectPath':_0xd0d7e7});}else{const _0x1299df=_0x528db2(0x9a)+_0x4ec561[_0x528db2(0xc0)];console['error']('×\x20'+_0x1299df);try{const _0x19a540=await _0x4ec561[_0x528db2(0x96)]();_0x19a540&&console['error'](_0x528db2(0x9d),_0x19a540),_0xd0d7e7&&logger[_0x528db2(0xa5)](_0x528db2(0x9f),_0x1299df,{'status':_0x4ec561['status'],'appCode':_0x2bf723,'url':_0x4ec561[_0x528db2(0x98)],'errorBody':_0x19a540,'projectPath':_0xd0d7e7});}catch(_0x29bfa4){console[_0x528db2(0xa5)]('×\x20无法读取错误响应内容'),_0xd0d7e7&&logger['error'](_0x528db2(0x9f),_0x1299df+_0x528db2(0xb7),{'status':_0x4ec561[_0x528db2(0xc0)],'appCode':_0x2bf723,'url':_0x4ec561[_0x528db2(0x98)],'readError':_0x29bfa4 instanceof Error?_0x29bfa4[_0x528db2(0xb3)]:String(_0x29bfa4),'projectPath':_0xd0d7e7});}}return![];}}catch(_0xc3ef25){const _0x51b212=_0xc3ef25 instanceof Error?_0xc3ef25[_0x528db2(0xb3)]:String(_0xc3ef25);return console[_0x528db2(0xa5)](_0x528db2(0xbb),_0x51b212),_0xd0d7e7&&logger['error'](_0x528db2(0x9f),_0x528db2(0xa9)+_0x51b212,{'appCode':_0x2bf723,'projectPath':_0xd0d7e7}),![];}finally{_0x47e646&&process[_0x528db2(0xa0)](_0x47e646);}}
package/lib/api/pull.js CHANGED
@@ -1 +1 @@
1
- (function(_0x448f5f,_0x13e3e5){const _0x14057d=a8_0x422d,_0x4b97fb=_0x448f5f();while(!![]){try{const _0x491269=parseInt(_0x14057d(0x1ed))/0x1+parseInt(_0x14057d(0x20a))/0x2+-parseInt(_0x14057d(0x208))/0x3+-parseInt(_0x14057d(0x1ea))/0x4*(parseInt(_0x14057d(0x1f0))/0x5)+-parseInt(_0x14057d(0x1fd))/0x6+parseInt(_0x14057d(0x1e9))/0x7*(-parseInt(_0x14057d(0x1fc))/0x8)+parseInt(_0x14057d(0x207))/0x9;if(_0x491269===_0x13e3e5)break;else _0x4b97fb['push'](_0x4b97fb['shift']());}catch(_0xa51bc3){_0x4b97fb['push'](_0x4b97fb['shift']());}}}(a8_0x55fc,0xe5a5a));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';function a8_0x55fc(){const _0x18d921=['-api','.ts\x20-\x20模型配置文件','2816072QqtPww','6106860ZgRhkJ','online','-client','exit','url','*\x20使用指定的应用AppCode:\x20','status','api','client','error','34906158hXVmta','3426510zqhIhR','*\x20正在处理\x20','2387074bJLZRH','×\x20文件前缀格式不正确。只能包含字母、数字、连字符和下划线,且必须以字母开头。','env','text','\x22\x20无效','stdin','&pageSize=999&currentPage=1','question','log','\x1b[0m','获取数据集失败,原因:登录鉴权失败,登录已过期,请使用\x20lovrabet\x20auth\x20重新登录后再尝试','\x0a*\x20正在从服务器拉取\x20API\x20配置...\x20(环境:\x20','×\x20错误详情:','!\x20请输入文件前缀\x20\x1b[90m[留空表示无前缀]\x1b[0m:\x20','\x20\x20\x202.\x20配置默认值:\x20lovrabet\x20config\x20set\x20app\x20<app-code>','获取数据集失败,HTTP状态码:\x20','/smartapi/dataset/getList?appCode=','trim','test','\x20\x20\x201.\x20直接指定:\x20lovrabet\x20api\x20pull\x20<app-code>','21vuzSlx','5926808NviRgU','close','.ts\x20-\x20客户端实例文件','566344imxNZj','json','string','5zijBUf','\x20个数据集...','tableData','app','\x1b[90m*\x20使用配置的应用AppCode:\x20',',且无法读取错误响应内容','api-pull','data','message','stdout'];a8_0x55fc=function(){return _0x18d921;};return a8_0x55fc();}function a8_0x422d(_0x5070e8,_0x555520){const _0x55fcaa=a8_0x55fc();return a8_0x422d=function(_0x422dd6,_0x129f6c){_0x422dd6=_0x422dd6-0x1e1;let _0x46c846=_0x55fcaa[_0x422dd6];return _0x46c846;},a8_0x422d(_0x5070e8,_0x555520);}import{initEnv}from'../constant/env.js';import{generateApiFile}from'./generate-api-file.js';import{logger}from'../utils/logger.js';export async function initApi(_0x382b3a,_0x2a4c59){const _0x3fc8a2=a8_0x422d,_0xfe878b=readConfig(),_0x4f4239=_0x382b3a||_0xfe878b?.[_0x3fc8a2(0x1f3)],_0x457097=typeof _0xfe878b[_0x3fc8a2(0x20c)]===_0x3fc8a2(0x1ef)?_0xfe878b[_0x3fc8a2(0x20c)]:undefined,_0x2cbb9d=_0x2a4c59||_0x457097||_0x3fc8a2(0x1fe);initEnv(_0x2cbb9d);(typeof _0x4f4239!=='string'||!_0x4f4239)&&(_0x382b3a?console[_0x3fc8a2(0x206)]('×\x20提供的应用AppCode\x20\x22'+_0x382b3a+_0x3fc8a2(0x20e)):(console[_0x3fc8a2(0x206)]('×\x20未提供应用AppCode,且配置中也没有默认值'),console[_0x3fc8a2(0x212)]('!\x20请使用以下方式之一:'),console[_0x3fc8a2(0x212)](_0x3fc8a2(0x1e8)),console['log'](_0x3fc8a2(0x1e3))),process[_0x3fc8a2(0x200)](0x1));_0x382b3a?console[_0x3fc8a2(0x212)](_0x3fc8a2(0x202)+_0x4f4239):console['log'](_0x3fc8a2(0x1f4)+_0x4f4239+_0x3fc8a2(0x213));const _0x14bacb=createInterface({'input':process[_0x3fc8a2(0x20f)],'output':process[_0x3fc8a2(0x1f9)]});let _0x3f78f5;try{const _0x4ef43c=await _0x14bacb[_0x3fc8a2(0x211)](_0x3fc8a2(0x1e2));_0x3f78f5=_0x4ef43c[_0x3fc8a2(0x1e6)]();if(_0x3f78f5){const _0xc3f07b=/^[a-zA-Z][a-zA-Z0-9_-]*$/;!_0xc3f07b[_0x3fc8a2(0x1e7)](_0x3f78f5)&&(console[_0x3fc8a2(0x206)](_0x3fc8a2(0x20b)),process['exit'](0x1));}}finally{_0x14bacb[_0x3fc8a2(0x1eb)]();}console[_0x3fc8a2(0x212)](_0x3fc8a2(0x215)+_0x2cbb9d+')');const _0x3ea242=await fetch(getApiDomain()+_0x3fc8a2(0x1e5)+_0x4f4239+_0x3fc8a2(0x210),{'headers':{'Cookie':getCookie()}});if(_0x3ea242['ok']){const _0x53dbe3=await _0x3ea242[_0x3fc8a2(0x1ee)]();if(_0x53dbe3['success']){const _0x1ddcff=_0x3f78f5?_0x3f78f5+_0x3fc8a2(0x1fa):_0x3fc8a2(0x204),_0x2854a7=_0x3f78f5?_0x3f78f5+_0x3fc8a2(0x1ff):_0x3fc8a2(0x205);console[_0x3fc8a2(0x212)]('*\x20开始生成\x20API\x20配置文件:'),console['log']('\x20\x20\x20•\x20'+_0x1ddcff+_0x3fc8a2(0x1fb)),console['log']('\x20\x20\x20•\x20'+_0x2854a7+_0x3fc8a2(0x1ec)),console[_0x3fc8a2(0x212)](_0x3fc8a2(0x209)+_0x53dbe3[_0x3fc8a2(0x1f7)]['tableData']['length']+_0x3fc8a2(0x1f1));const _0x23844c=!_0x382b3a;await generateApiFile(_0x53dbe3[_0x3fc8a2(0x1f7)][_0x3fc8a2(0x1f2)],_0x3f78f5,_0x4f4239,_0x23844c,_0x2cbb9d);}}else{if(_0x3ea242[_0x3fc8a2(0x203)]===0x191){const _0x1d9a26=_0x3fc8a2(0x214);console[_0x3fc8a2(0x206)]('×\x20'+_0x1d9a26),logger[_0x3fc8a2(0x206)](_0x3fc8a2(0x1f6),_0x1d9a26,{'status':_0x3ea242[_0x3fc8a2(0x203)],'appCode':_0x4f4239,'url':_0x3ea242[_0x3fc8a2(0x201)]});}else{const _0xd20871=_0x3fc8a2(0x1e4)+_0x3ea242['status'];console['error']('×\x20'+_0xd20871);try{const _0x185cb3=await _0x3ea242[_0x3fc8a2(0x20d)]();_0x185cb3?(console['error'](_0x3fc8a2(0x1e1),_0x185cb3),logger[_0x3fc8a2(0x206)](_0x3fc8a2(0x1f6),_0xd20871,{'status':_0x3ea242[_0x3fc8a2(0x203)],'appCode':_0x4f4239,'url':_0x3ea242[_0x3fc8a2(0x201)],'errorBody':_0x185cb3})):logger[_0x3fc8a2(0x206)]('api-pull',_0xd20871,{'status':_0x3ea242[_0x3fc8a2(0x203)],'appCode':_0x4f4239,'url':_0x3ea242[_0x3fc8a2(0x201)]});}catch(_0x10530b){console[_0x3fc8a2(0x206)]('×\x20无法读取错误响应内容'),logger[_0x3fc8a2(0x206)](_0x3fc8a2(0x1f6),_0xd20871+_0x3fc8a2(0x1f5),{'status':_0x3ea242[_0x3fc8a2(0x203)],'appCode':_0x4f4239,'url':_0x3ea242[_0x3fc8a2(0x201)],'readError':_0x10530b instanceof Error?_0x10530b[_0x3fc8a2(0x1f8)]:String(_0x10530b)});}}process[_0x3fc8a2(0x200)](0x1);}}
1
+ function a8_0x4b67(){const _0x1d0a2c=['data','\x0a*\x20正在从服务器拉取\x20API\x20配置...\x20(环境:\x20','api','api-pull','*\x20使用指定的应用AppCode:\x20','*\x20开始生成\x20API\x20配置文件:','8586530DOTCJN','×\x20提供的应用AppCode\x20\x22','12BgGkHE','error','stdout','status','!\x20请使用以下方式之一:','\x20个数据集...','/smartapi/dataset/getList?appCode=','env','668622NzIZOT','742736NZFDfo','×\x20未提供应用AppCode,且配置中也没有默认值','test','.ts\x20-\x20模型配置文件','5201238TeHvhv','-client','9ILAwva','url','trim','&pageSize=999&currentPage=1','×\x20错误详情:','tableData','\x20\x20\x202.\x20配置默认值:\x20lovrabet\x20config\x20set\x20app\x20<app-code>','log','stdin','app',',且无法读取错误响应内容','\x1b[90m*\x20使用配置的应用AppCode:\x20','exit','获取数据集失败,原因:登录鉴权失败,登录已过期,请使用\x20lovrabet\x20auth\x20重新登录后再尝试','3adQVpO','8515472nZZrwE','\x1b[0m','7868072GmiSsu','question','×\x20文件前缀格式不正确。只能包含字母、数字、连字符和下划线,且必须以字母开头。','\x22\x20无效','online','\x20\x20\x20•\x20','string','*\x20正在处理\x20','text','167795KQcnjV','\x20\x20\x201.\x20直接指定:\x20lovrabet\x20api\x20pull\x20<app-code>','json'];a8_0x4b67=function(){return _0x1d0a2c;};return a8_0x4b67();}(function(_0x1dcc70,_0x3860e7){const _0x3a4712=a8_0x5192,_0x4dd676=_0x1dcc70();while(!![]){try{const _0x1740e3=-parseInt(_0x3a4712(0x11e))/0x1*(-parseInt(_0x3a4712(0x10a))/0x2)+-parseInt(_0x3a4712(0x109))/0x3+parseInt(_0x3a4712(0x135))/0x4*(parseInt(_0x3a4712(0x12a))/0x5)+-parseInt(_0x3a4712(0x10e))/0x6+-parseInt(_0x3a4712(0x11f))/0x7+-parseInt(_0x3a4712(0x121))/0x8*(-parseInt(_0x3a4712(0x110))/0x9)+parseInt(_0x3a4712(0x133))/0xa;if(_0x1740e3===_0x3860e7)break;else _0x4dd676['push'](_0x4dd676['shift']());}catch(_0x3d3dd8){_0x4dd676['push'](_0x4dd676['shift']());}}}(a8_0x4b67,0xb746c));import{createInterface}from'node:readline/promises';import{readConfig}from'../utils/config.js';import{getCookie}from'../auth/get-cookie.js';function a8_0x5192(_0x2dafdb,_0x4cb25a){const _0x4b6720=a8_0x4b67();return a8_0x5192=function(_0x519213,_0x37a41b){_0x519213=_0x519213-0x105;let _0x292d3c=_0x4b6720[_0x519213];return _0x292d3c;},a8_0x5192(_0x2dafdb,_0x4cb25a);}import{getApiDomain}from'../constant/domain.js';import{initEnv}from'../constant/env.js';import{generateApiFile}from'./generate-api-file.js';import{logger}from'../utils/logger.js';export async function initApi(_0x11edcb,_0x44cd88){const _0x32d156=a8_0x5192,_0x5c5d3e=readConfig(),_0x37a5e5=_0x11edcb||_0x5c5d3e?.[_0x32d156(0x119)],_0x1892d1=typeof _0x5c5d3e['env']===_0x32d156(0x127)?_0x5c5d3e[_0x32d156(0x108)]:undefined,_0x318396=_0x44cd88||_0x1892d1||_0x32d156(0x125);initEnv(_0x318396);(typeof _0x37a5e5!==_0x32d156(0x127)||!_0x37a5e5)&&(_0x11edcb?console[_0x32d156(0x136)](_0x32d156(0x134)+_0x11edcb+_0x32d156(0x124)):(console['error'](_0x32d156(0x10b)),console[_0x32d156(0x117)](_0x32d156(0x105)),console['log'](_0x32d156(0x12b)),console[_0x32d156(0x117)](_0x32d156(0x116))),process[_0x32d156(0x11c)](0x1));_0x11edcb?console['log'](_0x32d156(0x131)+_0x37a5e5):console[_0x32d156(0x117)](_0x32d156(0x11b)+_0x37a5e5+_0x32d156(0x120));const _0x537b98=createInterface({'input':process[_0x32d156(0x118)],'output':process[_0x32d156(0x137)]});let _0x15f9b5;try{const _0x564a81=await _0x537b98[_0x32d156(0x122)]('!\x20请输入文件前缀\x20\x1b[90m[留空表示无前缀]\x1b[0m:\x20');_0x15f9b5=_0x564a81[_0x32d156(0x112)]();if(_0x15f9b5){const _0x65036f=/^[a-zA-Z][a-zA-Z0-9_-]*$/;!_0x65036f[_0x32d156(0x10c)](_0x15f9b5)&&(console[_0x32d156(0x136)](_0x32d156(0x123)),process[_0x32d156(0x11c)](0x1));}}finally{_0x537b98['close']();}console['log'](_0x32d156(0x12e)+_0x318396+')');const _0x1e6f88=await fetch(getApiDomain()+_0x32d156(0x107)+_0x37a5e5+_0x32d156(0x113),{'headers':{'Cookie':getCookie()}});if(_0x1e6f88['ok']){const _0x37e731=await _0x1e6f88[_0x32d156(0x12c)]();if(_0x37e731['success']){const _0x7279f3=_0x15f9b5?_0x15f9b5+'-api':_0x32d156(0x12f),_0x2b177c=_0x15f9b5?_0x15f9b5+_0x32d156(0x10f):'client';console[_0x32d156(0x117)](_0x32d156(0x132)),console[_0x32d156(0x117)](_0x32d156(0x126)+_0x7279f3+_0x32d156(0x10d)),console[_0x32d156(0x117)](_0x32d156(0x126)+_0x2b177c+'.ts\x20-\x20客户端实例文件'),console[_0x32d156(0x117)](_0x32d156(0x128)+_0x37e731[_0x32d156(0x12d)][_0x32d156(0x115)]['length']+_0x32d156(0x106));const _0x55fd6c=!_0x11edcb;await generateApiFile(_0x37e731[_0x32d156(0x12d)][_0x32d156(0x115)],_0x15f9b5,_0x37a5e5,_0x55fd6c,_0x318396);}}else{if(_0x1e6f88[_0x32d156(0x138)]===0x191){const _0x4f1cfc=_0x32d156(0x11d);console[_0x32d156(0x136)]('×\x20'+_0x4f1cfc),logger[_0x32d156(0x136)](_0x32d156(0x130),_0x4f1cfc,{'status':_0x1e6f88[_0x32d156(0x138)],'appCode':_0x37a5e5,'url':_0x1e6f88[_0x32d156(0x111)]});}else{const _0x30d139='获取数据集失败,HTTP状态码:\x20'+_0x1e6f88[_0x32d156(0x138)];console['error']('×\x20'+_0x30d139);try{const _0x54e6ab=await _0x1e6f88[_0x32d156(0x129)]();_0x54e6ab?(console[_0x32d156(0x136)](_0x32d156(0x114),_0x54e6ab),logger[_0x32d156(0x136)](_0x32d156(0x130),_0x30d139,{'status':_0x1e6f88['status'],'appCode':_0x37a5e5,'url':_0x1e6f88['url'],'errorBody':_0x54e6ab})):logger['error']('api-pull',_0x30d139,{'status':_0x1e6f88[_0x32d156(0x138)],'appCode':_0x37a5e5,'url':_0x1e6f88[_0x32d156(0x111)]});}catch(_0x406f75){console['error']('×\x20无法读取错误响应内容'),logger[_0x32d156(0x136)](_0x32d156(0x130),_0x30d139+_0x32d156(0x11a),{'status':_0x1e6f88[_0x32d156(0x138)],'appCode':_0x37a5e5,'url':_0x1e6f88[_0x32d156(0x111)],'readError':_0x406f75 instanceof Error?_0x406f75['message']:String(_0x406f75)});}}process[_0x32d156(0x11c)](0x1);}}
@@ -1 +1 @@
1
- function a10_0x1ce4(_0xa442f8,_0x29d9ff){const _0x292d68=a10_0x292d();return a10_0x1ce4=function(_0x1ce4a6,_0x12f3df){_0x1ce4a6=_0x1ce4a6-0xe9;let _0x59bdda=_0x292d68[_0x1ce4a6];return _0x59bdda;},a10_0x1ce4(_0xa442f8,_0x29d9ff);}(function(_0x5826aa,_0x3b43ef){const _0x52493d=a10_0x1ce4,_0x1f54ec=_0x5826aa();while(!![]){try{const _0x316bba=parseInt(_0x52493d(0xf8))/0x1+parseInt(_0x52493d(0xf1))/0x2+-parseInt(_0x52493d(0xfb))/0x3*(-parseInt(_0x52493d(0xfa))/0x4)+parseInt(_0x52493d(0xf7))/0x5*(-parseInt(_0x52493d(0xf0))/0x6)+parseInt(_0x52493d(0xee))/0x7*(-parseInt(_0x52493d(0xf6))/0x8)+parseInt(_0x52493d(0xfe))/0x9+parseInt(_0x52493d(0xec))/0xa*(-parseInt(_0x52493d(0xf9))/0xb);if(_0x316bba===_0x3b43ef)break;else _0x1f54ec['push'](_0x1f54ec['shift']());}catch(_0x227371){_0x1f54ec['push'](_0x1f54ec['shift']());}}}(a10_0x292d,0x337da));import{jsx as a10_0x1b137f,jsxs as a10_0x3cf023}from'react/jsx-runtime';import{Text,Box,useInput,useApp}from'ink';import{useEffect,useState}from'react';function a10_0x292d(){const _0x1e05ea=['正在登录...\x20','8uKEUJH','130zqDbEY','111755SIjMIF','77PHhdoC','89108mOyCOv','3vFwExP','*\x20按回车开始登录。','finally','1700919nMymaB','return','*\x20登录成功!','then','gray','dots','按\x20“q”\x20退出。','280370WQStQL','log','439852ozGkHC','√\x20当前为有效会话,无需重新登录。','33834gPejPS','587184UzoGLi','column','green','请前往浏览器完成登录。'];a10_0x292d=function(){return _0x1e05ea;};return a10_0x292d();}import{getIsSessionValid}from'./is-session-valid.js';import{authServer}from'./auth-server.js';import a10_0x236afc from'ink-spinner';export function AuthServer(){const _0xd6f12a=a10_0x1ce4,{exit:_0x251c0b}=useApp(),[_0x58e38b,_0x3a253d]=useState(![]),[_0x29cf96,_0x471cc4]=useState(!![]),[_0x3933d0,_0x38a312]=useState(![]),[_0x13799a,_0x14d036]=useState(![]);useEffect(()=>{const _0x4c27a0=a10_0x1ce4;getIsSessionValid()[_0x4c27a0(0x101)](_0x3a253d)[_0x4c27a0(0xfd)](()=>_0x471cc4(![]));},[]),useEffect(()=>{const _0x46a924=a10_0x1ce4;!_0x29cf96&&_0x58e38b&&(console[_0x46a924(0xed)](_0x46a924(0xef)),_0x251c0b());},[_0x29cf96,_0x58e38b,_0x251c0b]),useEffect(()=>{const _0x36f466=a10_0x1ce4;_0x13799a&&(console[_0x36f466(0xed)](_0x36f466(0x100)),_0x251c0b());},[_0x13799a,_0x251c0b]),useInput((_0x2bef91,_0x2d7111)=>{const _0x4dbc02=a10_0x1ce4;_0x2d7111[_0x4dbc02(0xff)]&&(_0x38a312(!![]),authServer({'silent':!![]})['then'](_0x23a171=>{_0x14d036(_0x23a171);})),_0x2bef91==='q'&&_0x251c0b();});if(_0x29cf96)return null;if(_0x58e38b||_0x13799a)return null;return a10_0x1b137f(Box,{'flexDirection':_0xd6f12a(0xf2),'marginTop':0x1,'marginBottom':0x1,'children':_0x3933d0?a10_0x3cf023(Box,{'children':[a10_0x1b137f(Box,{'width':'1'}),a10_0x3cf023(Text,{'color':_0xd6f12a(0xf3),'children':[a10_0x1b137f(a10_0x236afc,{'type':_0xd6f12a(0xea)}),'\x20\x20']}),a10_0x1b137f(Text,{'children':_0xd6f12a(0xf5)}),a10_0x1b137f(Text,{'color':_0xd6f12a(0xe9),'children':_0xd6f12a(0xf4)})]}):a10_0x3cf023(Box,{'children':[a10_0x1b137f(Box,{'width':'1'}),a10_0x1b137f(Text,{'children':_0xd6f12a(0xfc)}),a10_0x1b137f(Text,{'color':_0xd6f12a(0xe9),'children':_0xd6f12a(0xeb)})]})});}
1
+ (function(_0x5b87fe,_0x490d99){const _0x718fca=a10_0x515a,_0x14176c=_0x5b87fe();while(!![]){try{const _0x109d3a=parseInt(_0x718fca(0xd1))/0x1+parseInt(_0x718fca(0xc5))/0x2+-parseInt(_0x718fca(0xd3))/0x3*(parseInt(_0x718fca(0xc4))/0x4)+parseInt(_0x718fca(0xd5))/0x5*(parseInt(_0x718fca(0xce))/0x6)+parseInt(_0x718fca(0xcc))/0x7*(parseInt(_0x718fca(0xc1))/0x8)+-parseInt(_0x718fca(0xc2))/0x9+-parseInt(_0x718fca(0xc7))/0xa;if(_0x109d3a===_0x490d99)break;else _0x14176c['push'](_0x14176c['shift']());}catch(_0x24010f){_0x14176c['push'](_0x14176c['shift']());}}}(a10_0xaeaf,0x54884));import{jsx as a10_0x48d0b7,jsxs as a10_0x26756e}from'react/jsx-runtime';import{Text,Box,useInput,useApp}from'ink';import{useEffect,useState}from'react';import{getIsSessionValid}from'./is-session-valid.js';import{authServer}from'./auth-server.js';import a10_0x34e7e5 from'ink-spinner';function a10_0x515a(_0xf2749e,_0x54241f){const _0xaeaf1e=a10_0xaeaf();return a10_0x515a=function(_0x515ac9,_0x513ca8){_0x515ac9=_0x515ac9-0xc1;let _0xdeca23=_0xaeaf1e[_0x515ac9];return _0xdeca23;},a10_0x515a(_0xf2749e,_0x54241f);}export function AuthServer(){const _0x8b19a1=a10_0x515a,{exit:_0x25d757}=useApp(),[_0x94c985,_0xa14d82]=useState(![]),[_0x210102,_0x54a4c9]=useState(!![]),[_0x3414eb,_0x274c77]=useState(![]),[_0x263c42,_0x1787c6]=useState(![]);useEffect(()=>{getIsSessionValid()['then'](_0xa14d82)['finally'](()=>_0x54a4c9(![]));},[]),useEffect(()=>{!_0x210102&&_0x94c985&&(console['log']('√\x20当前为有效会话,无需重新登录。'),_0x25d757());},[_0x210102,_0x94c985,_0x25d757]),useEffect(()=>{const _0x100937=a10_0x515a;_0x263c42&&(console[_0x100937(0xcb)](_0x100937(0xc3)),_0x25d757());},[_0x263c42,_0x25d757]),useInput((_0x3cbfaa,_0x306248)=>{const _0x4b402b=a10_0x515a;_0x306248[_0x4b402b(0xcd)]&&(_0x274c77(!![]),authServer({'silent':!![]})[_0x4b402b(0xd2)](_0x187bff=>{_0x1787c6(_0x187bff);})),_0x3cbfaa==='q'&&_0x25d757();});if(_0x210102)return null;if(_0x94c985||_0x263c42)return null;return a10_0x48d0b7(Box,{'flexDirection':_0x8b19a1(0xc8),'marginTop':0x1,'marginBottom':0x1,'children':_0x3414eb?a10_0x26756e(Box,{'children':[a10_0x48d0b7(Box,{'width':'1'}),a10_0x26756e(Text,{'color':_0x8b19a1(0xcf),'children':[a10_0x48d0b7(a10_0x34e7e5,{'type':_0x8b19a1(0xc6)}),'\x20\x20']}),a10_0x48d0b7(Text,{'children':'正在登录...\x20'}),a10_0x48d0b7(Text,{'color':_0x8b19a1(0xd4),'children':_0x8b19a1(0xd0)})]}):a10_0x26756e(Box,{'children':[a10_0x48d0b7(Box,{'width':'1'}),a10_0x48d0b7(Text,{'children':_0x8b19a1(0xca)}),a10_0x48d0b7(Text,{'color':'gray','children':_0x8b19a1(0xc9)})]})});}function a10_0xaeaf(){const _0x2cf4d9=['column','按\x20“q”\x20退出。','*\x20按回车开始登录。','log','63VXrSEJ','return','1430418rSctWB','green','请前往浏览器完成登录。','538723SwkInw','then','512217DjIdoZ','gray','5zOMuKe','23192tsAxSG','3570894vzjwZU','*\x20登录成功!','4dtDZdJ','1197340kaHWXh','dots','4881380VMqeeT'];a10_0xaeaf=function(){return _0x2cf4d9;};return a10_0xaeaf();}
@@ -1 +1 @@
1
- const a11_0x29411e=a11_0x5c97;(function(_0x469de1,_0x5b5fbd){const _0x2639ef=a11_0x5c97,_0x215ee2=_0x469de1();while(!![]){try{const _0xb2d5ba=parseInt(_0x2639ef(0xee))/0x1+parseInt(_0x2639ef(0xfc))/0x2+-parseInt(_0x2639ef(0xf0))/0x3+parseInt(_0x2639ef(0xec))/0x4+parseInt(_0x2639ef(0x109))/0x5*(parseInt(_0x2639ef(0xfd))/0x6)+-parseInt(_0x2639ef(0xef))/0x7*(parseInt(_0x2639ef(0x102))/0x8)+parseInt(_0x2639ef(0xeb))/0x9*(-parseInt(_0x2639ef(0xf2))/0xa);if(_0xb2d5ba===_0x5b5fbd)break;else _0x215ee2['push'](_0x215ee2['shift']());}catch(_0x2dada2){_0x215ee2['push'](_0x215ee2['shift']());}}}(a11_0x442f,0xef5df));import{writeFileSync}from'node:fs';import a11_0x5efce5 from'node:https';function a11_0x442f(){const _0x3efee1=['listen','💡\x20如果浏览器没有自动打开,请手动复制上面的登录地址到浏览器中打开','error','Auth\x20server\x20error:','writeHead','📍\x20登录地址:','start\x20\x22\x22\x20\x22','⚠️\x20\x20无法自动打开浏览器','object','text/html;\x20charset=utf-8','utf-8','then','https://dev.lovrabet.com:','9ferLia','2845220yFMCvb','close','1726060MKUbSM','38892uJEAkl','2670453QFyEcr','end','5169290EZIGuG','main','127.0.0.1','open\x20\x22','cookie','🌐\x20正在尝试自动打开浏览器...','log','✅\x20浏览器已自动打开,请在浏览器中完成登录','win32','address','45122KQCyiA','846eGBlJH','<!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>','🔗\x20请手动复制登录地址到浏览器:','session','platform','1256oMIKKU','json','https://g.yuntooai.com/cert/lovrabet-dev.json','xdg-open\x20\x22','isAuth','🔐\x20正在启动登录服务...','createServer','28365tyCecI','headers'];a11_0x442f=function(){return _0x3efee1;};return a11_0x442f();}function a11_0x5c97(_0x2d5f71,_0x53da90){const _0x442f63=a11_0x442f();return a11_0x5c97=function(_0x5c9778,_0x902e66){_0x5c9778=_0x5c9778-0xdd;let _0x189d02=_0x442f63[_0x5c9778];return _0x189d02;},a11_0x5c97(_0x2d5f71,_0x53da90);}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(_0x48b6e5){const _0x382385=a11_0x5c97,_0x28085c=_0x48b6e5?.['silent']||![];if(await getIsSessionValid())return!![];const _0x2415a2=await(await fetch(_0x382385(0x104)))[_0x382385(0x103)]();return new Promise(async(_0x268bba,_0x42c543)=>{const _0x20643a=_0x382385;let _0x58b051=0x0;const _0x578e55=a11_0x5efce5[_0x20643a(0x108)](_0x2415a2,async(_0x4ffcca,_0xd37104)=>{const _0x472b6b=_0x20643a,_0x2f5f5a=getUserDomain(),_0x33999f=_0x4ffcca[_0x472b6b(0xdd)][_0x472b6b(0xf6)]||'',_0x34cf46=await fetch(_0x2f5f5a+'/api/auth/get-session',{'headers':{'cookie':_0x33999f}})[_0x472b6b(0xe9)](_0x342442=>_0x342442[_0x472b6b(0x103)]()),_0x8cc238=_0x34cf46&&_0x34cf46[_0x472b6b(0x100)]&&_0x34cf46['user'];if(_0x8cc238){writeFileSync(cookieFile,_0x33999f,_0x472b6b(0xe8)),_0x268bba(!![]);const _0x5ecf31=_0x472b6b(0xfe);_0xd37104[_0x472b6b(0xe2)](0xc8,{'Content-Type':_0x472b6b(0xe7)}),_0xd37104[_0x472b6b(0xf1)](_0x5ecf31),_0x578e55[_0x472b6b(0xed)]();}else{const _0x5e657d=''+encodeURIComponent(_0x472b6b(0xea)+_0x58b051);_0xd37104[_0x472b6b(0xe2)](0x12e,{'location':_0x2f5f5a+'/sign-in?redirect='+_0x5e657d}),_0xd37104['end']();return;}});_0x578e55[_0x20643a(0xde)](0x0,_0x20643a(0xf4),()=>{const _0x28f1b2=_0x20643a,_0x4ca670=_0x578e55[_0x28f1b2(0xfb)]();_0x58b051=typeof _0x4ca670===_0x28f1b2(0xe6)&&_0x4ca670?_0x4ca670['port']:Number(_0x4ca670);const _0x494a3d=_0x28f1b2(0xea)+_0x58b051;!_0x28085c&&(console[_0x28f1b2(0xf8)](_0x28f1b2(0x107)),console['log'](_0x28f1b2(0xe3),_0x494a3d),console[_0x28f1b2(0xf8)](_0x28f1b2(0xf7)),console[_0x28f1b2(0xf8)](''),console[_0x28f1b2(0xf8)](_0x28f1b2(0xdf)),console[_0x28f1b2(0xf8)]('')),openInBrowser(_0x494a3d)['then'](_0x1a8eb8=>{const _0x3e87c2=_0x28f1b2;!_0x28085c&&(_0x1a8eb8?console[_0x3e87c2(0xf8)](_0x3e87c2(0xf9)):(console[_0x3e87c2(0xf8)](_0x3e87c2(0xe5)),console[_0x3e87c2(0xf8)](_0x3e87c2(0xff),_0x494a3d)),console['log'](''));})['catch'](()=>{const _0x3b3841=_0x28f1b2;!_0x28085c&&(console[_0x3b3841(0xf8)]('⚠️\x20\x20无法自动打开浏览器'),console[_0x3b3841(0xf8)](_0x3b3841(0xff),_0x494a3d),console['log'](''));});}),_0x578e55['on'](_0x20643a(0xe0),_0x2d5a39=>{const _0x5c7c7f=_0x20643a;!_0x28085c&&console['error'](_0x5c7c7f(0xe1),_0x2d5a39),_0x42c543(_0x2d5a39);});});}function openInBrowser(_0x3c5ed1){return new Promise(_0x45bc4f=>{const _0x3ed408=a11_0x5c97,_0x26875d=process[_0x3ed408(0x101)];let _0x3c919b;if(_0x26875d===_0x3ed408(0xfa))_0x3c919b=_0x3ed408(0xe4)+_0x3c5ed1+'\x22';else _0x26875d==='darwin'?_0x3c919b=_0x3ed408(0xf5)+_0x3c5ed1+'\x22':_0x3c919b=_0x3ed408(0x105)+_0x3c5ed1+'\x22';exec(_0x3c919b,_0x10d56e=>{_0x10d56e?_0x45bc4f(![]):_0x45bc4f(!![]);});});}if(import.meta[a11_0x29411e(0xf3)]){const isAuth=await authServer();console[a11_0x29411e(0xf8)](a11_0x29411e(0x106),isAuth);}
1
+ const a11_0xd67ccb=a11_0x5a38;function a11_0x5a38(_0x3c1f30,_0x387207){const _0x55800a=a11_0x5580();return a11_0x5a38=function(_0x5a38c8,_0xb96fd){_0x5a38c8=_0x5a38c8-0xdd;let _0x255947=_0x55800a[_0x5a38c8];return _0x255947;},a11_0x5a38(_0x3c1f30,_0x387207);}(function(_0x557fca,_0x48952f){const _0x543f68=a11_0x5a38,_0x13e710=_0x557fca();while(!![]){try{const _0x1243b0=parseInt(_0x543f68(0xea))/0x1+-parseInt(_0x543f68(0x105))/0x2+parseInt(_0x543f68(0x101))/0x3+parseInt(_0x543f68(0xf0))/0x4*(parseInt(_0x543f68(0xe5))/0x5)+-parseInt(_0x543f68(0xe6))/0x6+-parseInt(_0x543f68(0xe9))/0x7+parseInt(_0x543f68(0x102))/0x8;if(_0x1243b0===_0x48952f)break;else _0x13e710['push'](_0x13e710['shift']());}catch(_0x13b76f){_0x13e710['push'](_0x13e710['shift']());}}}(a11_0x5580,0x950cf));import{writeFileSync}from'node:fs';import a11_0x5ad76b 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(_0x23a348){const _0x2404f1=a11_0x5a38,_0x2c2c47=_0x23a348?.[_0x2404f1(0xfd)]||![];if(await getIsSessionValid())return!![];const _0x55c370=await(await fetch(_0x2404f1(0xfa)))['json']();return new Promise(async(_0x8a7139,_0x23812d)=>{const _0x475818=_0x2404f1;let _0x14614e=0x0;const _0x53c290=a11_0x5ad76b['createServer'](_0x55c370,async(_0x3a3e62,_0x1c8f7f)=>{const _0x46c199=a11_0x5a38,_0x1c9f0e=getUserDomain(),_0x51c081=_0x3a3e62[_0x46c199(0xf1)][_0x46c199(0xf4)]||'',_0x3c9317=await fetch(_0x1c9f0e+'/api/auth/get-session',{'headers':{'cookie':_0x51c081}})[_0x46c199(0xf6)](_0x1c2ebc=>_0x1c2ebc[_0x46c199(0x100)]()),_0x5eeb42=_0x3c9317&&_0x3c9317[_0x46c199(0xe7)]&&_0x3c9317['user'];if(_0x5eeb42){writeFileSync(cookieFile,_0x51c081,'utf-8'),_0x8a7139(!![]);const _0x37106b=_0x46c199(0xf7);_0x1c8f7f[_0x46c199(0xfc)](0xc8,{'Content-Type':_0x46c199(0x104)}),_0x1c8f7f[_0x46c199(0xff)](_0x37106b),_0x53c290[_0x46c199(0xe4)]();}else{const _0x10e334=''+encodeURIComponent('https://dev.lovrabet.com:'+_0x14614e);_0x1c8f7f[_0x46c199(0xfc)](0x12e,{'location':_0x1c9f0e+_0x46c199(0xe3)+_0x10e334}),_0x1c8f7f[_0x46c199(0xff)]();return;}});_0x53c290['listen'](0x0,_0x475818(0xeb),()=>{const _0xa32bb7=_0x475818,_0x5f2f32=_0x53c290[_0xa32bb7(0xf3)]();_0x14614e=typeof _0x5f2f32===_0xa32bb7(0xef)&&_0x5f2f32?_0x5f2f32[_0xa32bb7(0xe0)]:Number(_0x5f2f32);const _0x3c243e='https://dev.lovrabet.com:'+_0x14614e;!_0x2c2c47&&(console[_0xa32bb7(0x103)](_0xa32bb7(0xec)),console['log'](_0xa32bb7(0xf8),_0x3c243e),console[_0xa32bb7(0x103)](_0xa32bb7(0xf9)),console[_0xa32bb7(0x103)](''),console[_0xa32bb7(0x103)]('💡\x20如果浏览器没有自动打开,请手动复制上面的登录地址到浏览器中打开'),console[_0xa32bb7(0x103)]('')),openInBrowser(_0x3c243e)['then'](_0x431e87=>{const _0x2b82b5=_0xa32bb7;!_0x2c2c47&&(_0x431e87?console[_0x2b82b5(0x103)](_0x2b82b5(0xdf)):(console['log'](_0x2b82b5(0xf5)),console[_0x2b82b5(0x103)](_0x2b82b5(0xdd),_0x3c243e)),console['log'](''));})[_0xa32bb7(0xe8)](()=>{const _0x54e458=_0xa32bb7;!_0x2c2c47&&(console[_0x54e458(0x103)](_0x54e458(0xf5)),console['log']('🔗\x20请手动复制登录地址到浏览器:',_0x3c243e),console[_0x54e458(0x103)](''));});}),_0x53c290['on']('error',_0x2e34b9=>{const _0x39ffe7=_0x475818;!_0x2c2c47&&console[_0x39ffe7(0xee)](_0x39ffe7(0xed),_0x2e34b9),_0x23812d(_0x2e34b9);});});}function openInBrowser(_0x18a29c){return new Promise(_0x1a8ae1=>{const _0x2e0207=a11_0x5a38,_0x4f1eb3=process[_0x2e0207(0xf2)];let _0x84e3a9;if(_0x4f1eb3===_0x2e0207(0xfb))_0x84e3a9='start\x20\x22\x22\x20\x22'+_0x18a29c+'\x22';else _0x4f1eb3===_0x2e0207(0xe1)?_0x84e3a9=_0x2e0207(0xe2)+_0x18a29c+'\x22':_0x84e3a9=_0x2e0207(0xde)+_0x18a29c+'\x22';exec(_0x84e3a9,_0x5ceb75=>{_0x5ceb75?_0x1a8ae1(![]):_0x1a8ae1(!![]);});});}function a11_0x5580(){const _0x3377a7=['close','5tsJUjn','3807144DobdSb','session','catch','6417243UfWNDm','1098934uEetEc','127.0.0.1','🔐\x20正在启动登录服务...','Auth\x20server\x20error:','error','object','3135032XkBeaZ','headers','platform','address','cookie','⚠️\x20\x20无法自动打开浏览器','then','<!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>','📍\x20登录地址:','🌐\x20正在尝试自动打开浏览器...','https://g.yuntooai.com/cert/lovrabet-dev.json','win32','writeHead','silent','main','end','json','1036704tiPCoK','8073784rqMGnw','log','text/html;\x20charset=utf-8','2151398kaGJDL','🔗\x20请手动复制登录地址到浏览器:','xdg-open\x20\x22','✅\x20浏览器已自动打开,请在浏览器中完成登录','port','darwin','open\x20\x22','/sign-in?redirect='];a11_0x5580=function(){return _0x3377a7;};return a11_0x5580();}if(import.meta[a11_0xd67ccb(0xfe)]){const isAuth=await authServer();console['log']('isAuth',isAuth);}
@@ -1 +1 @@
1
- const a12_0x393166=a12_0x57c5;(function(_0xa66526,_0x2b39ee){const _0x2ede49=a12_0x57c5,_0x557fb3=_0xa66526();while(!![]){try{const _0x1a7d6f=-parseInt(_0x2ede49(0x1a3))/0x1*(-parseInt(_0x2ede49(0x1a2))/0x2)+-parseInt(_0x2ede49(0x19e))/0x3+parseInt(_0x2ede49(0x1a0))/0x4*(-parseInt(_0x2ede49(0x19d))/0x5)+-parseInt(_0x2ede49(0x1aa))/0x6*(-parseInt(_0x2ede49(0x1a6))/0x7)+-parseInt(_0x2ede49(0x1ab))/0x8*(-parseInt(_0x2ede49(0x1a4))/0x9)+-parseInt(_0x2ede49(0x1a1))/0xa*(parseInt(_0x2ede49(0x1a8))/0xb)+parseInt(_0x2ede49(0x19f))/0xc*(parseInt(_0x2ede49(0x1a9))/0xd);if(_0x1a7d6f===_0x2b39ee)break;else _0x557fb3['push'](_0x557fb3['shift']());}catch(_0x2fcc89){_0x557fb3['push'](_0x557fb3['shift']());}}}(a12_0x23b8,0x89fcf));function a12_0x57c5(_0x30646b,_0x3f04de){const _0x23b8b8=a12_0x23b8();return a12_0x57c5=function(_0x57c5eb,_0x58f1fa){_0x57c5eb=_0x57c5eb-0x19d;let _0x2b89cb=_0x23b8b8[_0x57c5eb];return _0x2b89cb;},a12_0x57c5(_0x30646b,_0x3f04de);}function a12_0x23b8(){const _0x4a51fb=['1266360emlJCg','4331652fOaFmh','548620kxWSgF','30vcRbUl','6ecptHH','243484mTtezy','1140993cyUTeq','/cookie','161Barvei','/.lovrabet','1861607KwIjXd','13BqpcZw','116118cGuamu','32ZScXpZ','20CVpGFN'];a12_0x23b8=function(){return _0x4a51fb;};return a12_0x23b8();}import{mkdirSync}from'node:fs';import{homedir}from'node:os';export const configDir=homedir()+a12_0x393166(0x1a7);export const cookieFile=configDir+a12_0x393166(0x1a5);mkdirSync(configDir,{'recursive':!![]});
1
+ const a12_0xa299d=a12_0x5167;function a12_0x5167(_0x9d2cac,_0x1c4397){const _0x146668=a12_0x1466();return a12_0x5167=function(_0x5167a5,_0x59e224){_0x5167a5=_0x5167a5-0x112;let _0x4fa2a8=_0x146668[_0x5167a5];return _0x4fa2a8;},a12_0x5167(_0x9d2cac,_0x1c4397);}(function(_0x41e52e,_0x205a0c){const _0x3ef18e=a12_0x5167,_0x2ecd0b=_0x41e52e();while(!![]){try{const _0xf4aa9=-parseInt(_0x3ef18e(0x113))/0x1*(parseInt(_0x3ef18e(0x112))/0x2)+-parseInt(_0x3ef18e(0x11a))/0x3+-parseInt(_0x3ef18e(0x116))/0x4*(parseInt(_0x3ef18e(0x11b))/0x5)+-parseInt(_0x3ef18e(0x11e))/0x6*(-parseInt(_0x3ef18e(0x114))/0x7)+-parseInt(_0x3ef18e(0x117))/0x8+-parseInt(_0x3ef18e(0x119))/0x9+parseInt(_0x3ef18e(0x11d))/0xa*(parseInt(_0x3ef18e(0x118))/0xb);if(_0xf4aa9===_0x205a0c)break;else _0x2ecd0b['push'](_0x2ecd0b['shift']());}catch(_0x2e05ac){_0x2ecd0b['push'](_0x2ecd0b['shift']());}}}(a12_0x1466,0x81560));import{mkdirSync}from'node:fs';import{homedir}from'node:os';function a12_0x1466(){const _0xb86f6d=['67243PuuWSs','2196864OGzguk','341187ZUQUrw','224050LdrymA','/.lovrabet','4020dLZOXo','22818igxYDl','2ZoVZVh','988732fVZmvA','637dVccAb','/cookie','64uiJPir','1681776MxuTop'];a12_0x1466=function(){return _0xb86f6d;};return a12_0x1466();}export const configDir=homedir()+a12_0xa299d(0x11c);export const cookieFile=configDir+a12_0xa299d(0x115);mkdirSync(configDir,{'recursive':!![]});
@@ -1 +1 @@
1
- function a13_0x1047(_0x3c173b,_0x558c32){var _0x7014ae=a13_0x7014();return a13_0x1047=function(_0x104754,_0x48a7c5){_0x104754=_0x104754-0x110;var _0x5ec713=_0x7014ae[_0x104754];return _0x5ec713;},a13_0x1047(_0x3c173b,_0x558c32);}(function(_0x361901,_0x2943c6){var _0x2ff8c2=a13_0x1047,_0x54b376=_0x361901();while(!![]){try{var _0x2b90e6=-parseInt(_0x2ff8c2(0x112))/0x1*(parseInt(_0x2ff8c2(0x117))/0x2)+parseInt(_0x2ff8c2(0x119))/0x3+-parseInt(_0x2ff8c2(0x118))/0x4*(parseInt(_0x2ff8c2(0x116))/0x5)+parseInt(_0x2ff8c2(0x111))/0x6*(parseInt(_0x2ff8c2(0x114))/0x7)+-parseInt(_0x2ff8c2(0x110))/0x8+-parseInt(_0x2ff8c2(0x115))/0x9+parseInt(_0x2ff8c2(0x113))/0xa;if(_0x2b90e6===_0x2943c6)break;else _0x54b376['push'](_0x54b376['shift']());}catch(_0x530717){_0x54b376['push'](_0x54b376['shift']());}}}(a13_0x7014,0xce935));import{readFileSync}from'node:fs';function a13_0x7014(){var _0x157540=['139890BOatSd','16147yTrelP','17454800rETUdy','147vWGhYL','7010595CAYtWq','168215fOmHIR','146GEOctZ','4jIJKWT','4955280KJDcTn','8395144XgJDuw'];a13_0x7014=function(){return _0x157540;};return a13_0x7014();}import{cookieFile}from'./constant.js';export function getCookie(){try{return readFileSync(cookieFile,'utf-8');}catch{}return'';}
1
+ (function(_0x39c31c,_0x346241){var _0x2c6daa=a13_0xe0ca,_0x48eb24=_0x39c31c();while(!![]){try{var _0x4e465c=-parseInt(_0x2c6daa(0xec))/0x1+parseInt(_0x2c6daa(0xea))/0x2+-parseInt(_0x2c6daa(0xe9))/0x3+parseInt(_0x2c6daa(0xef))/0x4*(-parseInt(_0x2c6daa(0xf0))/0x5)+parseInt(_0x2c6daa(0xf1))/0x6+parseInt(_0x2c6daa(0xe8))/0x7+parseInt(_0x2c6daa(0xeb))/0x8*(parseInt(_0x2c6daa(0xee))/0x9);if(_0x4e465c===_0x346241)break;else _0x48eb24['push'](_0x48eb24['shift']());}catch(_0x11b5d5){_0x48eb24['push'](_0x48eb24['shift']());}}}(a13_0x52e3,0x326c8));import{readFileSync}from'node:fs';import{cookieFile}from'./constant.js';function a13_0x52e3(){var _0x2f172d=['20WEILHp','1878630pdYujn','492422eAsMcF','235857CEswDc','226636zYbQuS','23776BmqyTt','229162Euyufd','utf-8','198ZCXgwF','47836WdCBjS'];a13_0x52e3=function(){return _0x2f172d;};return a13_0x52e3();}function a13_0xe0ca(_0x5c6875,_0x48b46b){var _0x52e314=a13_0x52e3();return a13_0xe0ca=function(_0xe0ca59,_0x50a8b6){_0xe0ca59=_0xe0ca59-0xe8;var _0x3ee262=_0x52e314[_0xe0ca59];return _0x3ee262;},a13_0xe0ca(_0x5c6875,_0x48b46b);}export function getCookie(){var _0x4fced4=a13_0xe0ca;try{return readFileSync(cookieFile,_0x4fced4(0xed));}catch{}return'';}
@@ -1 +1 @@
1
- (function(_0x141a3c,_0xafab85){const _0x1174c2=a14_0x2289,_0x58c5f5=_0x141a3c();while(!![]){try{const _0x173c4b=parseInt(_0x1174c2(0x1b9))/0x1+parseInt(_0x1174c2(0x1b6))/0x2*(parseInt(_0x1174c2(0x1b3))/0x3)+-parseInt(_0x1174c2(0x1ba))/0x4*(-parseInt(_0x1174c2(0x1b4))/0x5)+-parseInt(_0x1174c2(0x1b7))/0x6*(parseInt(_0x1174c2(0x1bf))/0x7)+parseInt(_0x1174c2(0x1be))/0x8*(-parseInt(_0x1174c2(0x1b5))/0x9)+-parseInt(_0x1174c2(0x1bb))/0xa+parseInt(_0x1174c2(0x1b2))/0xb;if(_0x173c4b===_0xafab85)break;else _0x58c5f5['push'](_0x58c5f5['shift']());}catch(_0x446a7c){_0x58c5f5['push'](_0x58c5f5['shift']());}}}(a14_0x4c91,0x1e311));function a14_0x2289(_0x25b93a,_0x465eed){const _0x4c9140=a14_0x4c91();return a14_0x2289=function(_0x2289a4,_0x97d5d1){_0x2289a4=_0x2289a4-0x1b1;let _0x31d221=_0x4c9140[_0x2289a4];return _0x31d221;},a14_0x2289(_0x25b93a,_0x465eed);}import{existsSync,readFileSync}from'node:fs';function a14_0x4c91(){const _0x1fe28d=['user','86473gNRGlh','4Qnueaw','309340JnrQpx','json','session','16OiTauQ','203pVsFoB','/api/auth/get-session','then','utf-8','2791910nnMvKD','68088Obzvcn','609005viPmhc','908613mLgAVy','2iUgHYV','26538cnojZF'];a14_0x4c91=function(){return _0x1fe28d;};return a14_0x4c91();}import{getUserDomain}from'../constant/domain.js';import{cookieFile}from'./constant.js';export async function getIsSessionValid(){const _0x528d75=a14_0x2289;try{if(!existsSync(cookieFile))return![];const _0x50fab1=readFileSync(cookieFile,_0x528d75(0x1b1)),_0x3c013a=await fetch(getUserDomain()+_0x528d75(0x1c0),{'headers':{'cookie':_0x50fab1}})[_0x528d75(0x1c1)](_0x7271dd=>_0x7271dd[_0x528d75(0x1bc)]());return _0x3c013a&&_0x3c013a[_0x528d75(0x1bd)]&&_0x3c013a[_0x528d75(0x1b8)];}catch{}return![];}
1
+ (function(_0x49023b,_0x4477b8){const _0x47724c=a14_0x18d5,_0x1858be=_0x49023b();while(!![]){try{const _0x422f79=parseInt(_0x47724c(0x1d8))/0x1+parseInt(_0x47724c(0x1df))/0x2*(-parseInt(_0x47724c(0x1da))/0x3)+-parseInt(_0x47724c(0x1de))/0x4+parseInt(_0x47724c(0x1db))/0x5*(parseInt(_0x47724c(0x1d4))/0x6)+-parseInt(_0x47724c(0x1d1))/0x7*(parseInt(_0x47724c(0x1d6))/0x8)+parseInt(_0x47724c(0x1dd))/0x9*(parseInt(_0x47724c(0x1d2))/0xa)+-parseInt(_0x47724c(0x1e0))/0xb*(-parseInt(_0x47724c(0x1d5))/0xc);if(_0x422f79===_0x4477b8)break;else _0x1858be['push'](_0x1858be['shift']());}catch(_0x2ad436){_0x1858be['push'](_0x1858be['shift']());}}}(a14_0x5b8a,0x3ba29));import{existsSync,readFileSync}from'node:fs';import{getUserDomain}from'../constant/domain.js';import{cookieFile}from'./constant.js';function a14_0x18d5(_0x292e99,_0xda29ef){const _0x5b8acf=a14_0x5b8a();return a14_0x18d5=function(_0x18d5ac,_0x46e699){_0x18d5ac=_0x18d5ac-0x1cf;let _0x9253d8=_0x5b8acf[_0x18d5ac];return _0x9253d8;},a14_0x18d5(_0x292e99,_0xda29ef);}function a14_0x5b8a(){const _0x1c6b37=['803xBMoSK','session','user','7HmvurW','280Tzglyw','/api/auth/get-session','1687674gkZknC','60216NzRfcH','2260336hHcgcO','utf-8','104671xhqSHI','then','171966UXWEGd','5CKhWJb','json','89901QLQAvT','1562020ielPyy','4cWTcrR'];a14_0x5b8a=function(){return _0x1c6b37;};return a14_0x5b8a();}export async function getIsSessionValid(){const _0x5e1a81=a14_0x18d5;try{if(!existsSync(cookieFile))return![];const _0x45d25b=readFileSync(cookieFile,_0x5e1a81(0x1d7)),_0x2a32b1=await fetch(getUserDomain()+_0x5e1a81(0x1d3),{'headers':{'cookie':_0x45d25b}})[_0x5e1a81(0x1d9)](_0x260bdb=>_0x260bdb[_0x5e1a81(0x1dc)]());return _0x2a32b1&&_0x2a32b1[_0x5e1a81(0x1cf)]&&_0x2a32b1[_0x5e1a81(0x1d0)];}catch{}return![];}
@@ -1 +1 @@
1
- function a15_0x26a6(){var _0x1eaa18=['1375320WiqEop','1771848sckjtW','2498756xRVAKP','!\x20当前未登录','9172510GsbHHN','45DNLseJ','9RqRAhf','log','6230KEgdia','78330uqCcFF','9882APBEYA','6604765cCfqEL'];a15_0x26a6=function(){return _0x1eaa18;};return a15_0x26a6();}function a15_0x2211(_0x21896c,_0x1398f6){var _0x26a658=a15_0x26a6();return a15_0x2211=function(_0x22113e,_0x1e98d2){_0x22113e=_0x22113e-0x10b;var _0xb19922=_0x26a658[_0x22113e];return _0xb19922;},a15_0x2211(_0x21896c,_0x1398f6);}(function(_0x4f0172,_0x1d9901){var _0x4c5cc2=a15_0x2211,_0x217845=_0x4f0172();while(!![]){try{var _0x162649=parseInt(_0x4c5cc2(0x114))/0x1+parseInt(_0x4c5cc2(0x111))/0x2*(parseInt(_0x4c5cc2(0x10d))/0x3)+parseInt(_0x4c5cc2(0x116))/0x4+-parseInt(_0x4c5cc2(0x113))/0x5+parseInt(_0x4c5cc2(0x112))/0x6*(-parseInt(_0x4c5cc2(0x110))/0x7)+parseInt(_0x4c5cc2(0x115))/0x8+-parseInt(_0x4c5cc2(0x10e))/0x9*(-parseInt(_0x4c5cc2(0x10c))/0xa);if(_0x162649===_0x1d9901)break;else _0x217845['push'](_0x217845['shift']());}catch(_0x90e72c){_0x217845['push'](_0x217845['shift']());}}}(a15_0x26a6,0xe55a9));import{unlinkSync,existsSync}from'node:fs';import{cookieFile}from'./constant.js';export function logout(){var _0x5dc0de=a15_0x2211;existsSync(cookieFile)?(unlinkSync(cookieFile),console['log']('✓\x20已退出登录')):console[_0x5dc0de(0x10f)](_0x5dc0de(0x10b));}
1
+ (function(_0x28c428,_0x422946){var _0x1006fa=a15_0xa705,_0x3d2617=_0x28c428();while(!![]){try{var _0x184901=parseInt(_0x1006fa(0xf1))/0x1*(parseInt(_0x1006fa(0xf3))/0x2)+-parseInt(_0x1006fa(0xf6))/0x3*(parseInt(_0x1006fa(0xef))/0x4)+parseInt(_0x1006fa(0xf5))/0x5+parseInt(_0x1006fa(0xf7))/0x6+parseInt(_0x1006fa(0xed))/0x7+parseInt(_0x1006fa(0xf9))/0x8*(parseInt(_0x1006fa(0xfa))/0x9)+-parseInt(_0x1006fa(0xee))/0xa*(parseInt(_0x1006fa(0xf4))/0xb);if(_0x184901===_0x422946)break;else _0x3d2617['push'](_0x3d2617['shift']());}catch(_0x4513bf){_0x3d2617['push'](_0x3d2617['shift']());}}}(a15_0x53b7,0xb1735));import{unlinkSync,existsSync}from'node:fs';function a15_0xa705(_0x3cbb15,_0x2117a5){var _0x53b75b=a15_0x53b7();return a15_0xa705=function(_0xa7053b,_0x38bbf0){_0xa7053b=_0xa7053b-0xed;var _0x4215e8=_0x53b75b[_0xa7053b];return _0x4215e8;},a15_0xa705(_0x3cbb15,_0x2117a5);}import{cookieFile}from'./constant.js';function a15_0x53b7(){var _0x162966=['✓\x20已退出登录','43934HUtZsS','209MVvfZz','6613765wwzbmh','18EXJIKc','467022Vabmaw','log','1989080GAyakG','18biTsyn','4643079QIZdDW','1112170wEZGCy','443852AxkggQ','!\x20当前未登录','43kQYDKE'];a15_0x53b7=function(){return _0x162966;};return a15_0x53b7();}export function logout(){var _0x67f66d=a15_0xa705;existsSync(cookieFile)?(unlinkSync(cookieFile),console[_0x67f66d(0xf8)](_0x67f66d(0xf2))):console['log'](_0x67f66d(0xf0));}
package/lib/cli.js CHANGED
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- const a16_0x3303d9=a16_0x4ff4;(function(_0x519e81,_0x2f3281){const _0x276b67=a16_0x4ff4,_0x20a4a=_0x519e81();while(!![]){try{const _0x2126d6=parseInt(_0x276b67(0x15e))/0x1+parseInt(_0x276b67(0x15b))/0x2+-parseInt(_0x276b67(0x174))/0x3+parseInt(_0x276b67(0x163))/0x4*(parseInt(_0x276b67(0x165))/0x5)+parseInt(_0x276b67(0x173))/0x6*(parseInt(_0x276b67(0x169))/0x7)+-parseInt(_0x276b67(0x16e))/0x8+-parseInt(_0x276b67(0x167))/0x9*(parseInt(_0x276b67(0x15f))/0xa);if(_0x2126d6===_0x2f3281)break;else _0x20a4a['push'](_0x20a4a['shift']());}catch(_0x2ede87){_0x20a4a['push'](_0x20a4a['shift']());}}}(a16_0x2c11,0xb1e57));import{jsx as a16_0x4afd79}from'react/jsx-runtime';import a16_0x2d53f6 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';import{logger}from'./utils/logger.js';function a16_0x4ff4(_0x4e1714,_0x598af5){const _0x2c11e2=a16_0x2c11();return a16_0x4ff4=function(_0x4ff411,_0xc7751f){_0x4ff411=_0x4ff411-0x158;let _0x1242f2=_0x2c11e2[_0x4ff411];return _0x1242f2;},a16_0x4ff4(_0x4e1714,_0x598af5);}import{showLogs,clearLogs}from'./cmd/logs.js';const cli=a16_0x2d53f6(a16_0x3303d9(0x161),{'importMeta':import.meta,'flags':{'name':{'type':a16_0x3303d9(0x175)},'clear':{'type':a16_0x3303d9(0x164)},'env':{'type':a16_0x3303d9(0x175)},'watch':{'type':'boolean'},'help':{'type':'boolean'}}});await run();async function run(){const _0x39df27=a16_0x3303d9,_0x580d79=cli[_0x39df27(0x16a)][0x0];switch(_0x580d79){case _0x39df27(0x171):{const _0x3c6ce5=cli[_0x39df27(0x16a)][0x1]?.[_0x39df27(0x158)](),_0xfeb6e1=cli[_0x39df27(0x162)][_0x39df27(0x16c)];render(a16_0x4afd79(CreateApp,{'projectCode':_0x3c6ce5,'env':_0xfeb6e1}));break;}case'add':{cli[_0x39df27(0x16a)][0x1]===_0x39df27(0x16d)&&(logger[_0x39df27(0x15c)](process['cwd']()),render(a16_0x4afd79(AddPage,{})));break;}case _0x39df27(0x170):{try{logger[_0x39df27(0x15c)](process[_0x39df27(0x16b)]()),await runStart();}catch(_0x4e68f4){console[_0x39df27(0x166)](_0x4e68f4),process[_0x39df27(0x176)](0x1);}break;}case'build':{try{logger[_0x39df27(0x15c)](process[_0x39df27(0x16b)]()),await runBuild();}catch(_0x268cc2){console[_0x39df27(0x166)](_0x268cc2),process[_0x39df27(0x176)](0x1);}break;}case _0x39df27(0x160):{const _0x24533c=cli['flags'][_0x39df27(0x159)];logger[_0x39df27(0x15c)](process[_0x39df27(0x16b)]());if(_0x24533c)try{await Promise['all']([runBuildWatch(),runPreview()]);}catch(_0x407526){console['error'](_0x407526),process[_0x39df27(0x176)](0x1);}else try{await runPreview();}catch(_0x5a72b0){console[_0x39df27(0x166)](_0x5a72b0),process['exit'](0x1);}break;}case _0x39df27(0x15d):{render(a16_0x4afd79(Config,{'cli':cli}));break;}case _0x39df27(0x168):{await apiCli(cli);break;}case _0x39df27(0x172):{render(a16_0x4afd79(AuthServer,{}));break;}case _0x39df27(0x16f):{logout();break;}case'logs':{cli[_0x39df27(0x162)][_0x39df27(0x15a)]?clearLogs():showLogs();break;}default:render(a16_0x4afd79(Help,{}));break;}}function a16_0x2c11(){const _0x21a2d5=['5HVFKeA','error','18HVSJzS','api','7dckMEj','input','cwd','env','page','3497000hqQDGp','logout','start','create','auth','1850514pZcKbT','937077JutTQz','string','exit','trim','watch','clear','2023546GizJMV','setLogPath','config','1021737brsCfH','7613980eGLEbS','preview','\x0a\x09Usage\x0a\x09\x20\x20$\x20lovrabet\x0a\x0a\x09Examples\x0a\x09\x20\x20$\x20lovrabet\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20登录认证\x0a\x09\x20\x20$\x20lovrabet\x20logout\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20退出登录\x0a\x09\x20\x20$\x20lovrabet\x20create\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20创建一个项目\x0a\x09\x20\x20$\x20lovrabet\x20create\x20--env\x20daily\x20\x20\x20\x20\x20\x20\x20\x20//\x20创建项目并指定环境\x0a\x09\x20\x20$\x20lovrabet\x20add\x20page\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20添加一个页面\x0a\x09\x20\x20$\x20lovrabet\x20start\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20启动项目\x0a\x09\x20\x20$\x20lovrabet\x20build\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20构建项目\x0a\x09\x20\x20$\x20lovrabet\x20preview\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20预览项目\x0a\x09\x20\x20$\x20lovrabet\x20preview\x20--watch\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20监听文件变化并自动构建预览\x0a\x09\x20\x20$\x20lovrabet\x20config\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20项目配置\x0a\x09\x20\x20$\x20lovrabet\x20api\x20pull\x20[app-code]\x20\x20\x20\x20\x20\x20\x20//\x20拉取并生成\x20API\x20配置文件\x0a\x09\x20\x20$\x20lovrabet\x20api\x20pull\x20--env\x20daily\x20\x20\x20\x20\x20\x20//\x20指定环境拉取\x20API\x0a\x09\x20\x20$\x20lovrabet\x20logs\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20查看日志\x0a\x09\x20\x20$\x20lovrabet\x20logs\x20--clear\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20清空日志\x0a','flags','2636056RVUBVP','boolean'];a16_0x2c11=function(){return _0x21a2d5;};return a16_0x2c11();}
2
+ const a16_0x42fca=a16_0x4fef;(function(_0x5c5d93,_0x5c859d){const _0x38fec8=a16_0x4fef,_0x33afcb=_0x5c5d93();while(!![]){try{const _0x2d06a7=parseInt(_0x38fec8(0xb1))/0x1*(parseInt(_0x38fec8(0xac))/0x2)+-parseInt(_0x38fec8(0xb7))/0x3*(-parseInt(_0x38fec8(0x9d))/0x4)+-parseInt(_0x38fec8(0xa7))/0x5*(-parseInt(_0x38fec8(0x9e))/0x6)+parseInt(_0x38fec8(0xb8))/0x7+-parseInt(_0x38fec8(0xa3))/0x8*(parseInt(_0x38fec8(0xb9))/0x9)+-parseInt(_0x38fec8(0xa0))/0xa*(parseInt(_0x38fec8(0x9c))/0xb)+-parseInt(_0x38fec8(0xa2))/0xc*(-parseInt(_0x38fec8(0xa6))/0xd);if(_0x2d06a7===_0x5c859d)break;else _0x33afcb['push'](_0x33afcb['shift']());}catch(_0x2b9a20){_0x33afcb['push'](_0x33afcb['shift']());}}}(a16_0x93cc,0x8c80e));import{jsx as a16_0xe25169}from'react/jsx-runtime';import a16_0x5ca777 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';import{logger}from'./utils/logger.js';function a16_0x93cc(){const _0x22a22b=['10hpzOZh','watch','2698332fvVuYe','56ZrltBL','cwd','add','52lxkCxx','5cxwoGC','exit','boolean','logs','start','1612AGQOXu','input','string','logout','api','263FVHqHr','env','error','\x0a\x09Usage\x0a\x09\x20\x20$\x20lovrabet\x0a\x0a\x09Examples\x0a\x09\x20\x20$\x20lovrabet\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20登录认证\x0a\x09\x20\x20$\x20lovrabet\x20logout\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20退出登录\x0a\x09\x20\x20$\x20lovrabet\x20create\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20创建一个项目\x0a\x09\x20\x20$\x20lovrabet\x20create\x20--env\x20daily\x20\x20\x20\x20\x20\x20\x20\x20//\x20创建项目并指定环境\x0a\x09\x20\x20$\x20lovrabet\x20add\x20page\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20添加一个页面\x0a\x09\x20\x20$\x20lovrabet\x20start\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20启动项目\x0a\x09\x20\x20$\x20lovrabet\x20build\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20构建项目\x0a\x09\x20\x20$\x20lovrabet\x20preview\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20预览项目\x0a\x09\x20\x20$\x20lovrabet\x20preview\x20--watch\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20监听文件变化并自动构建预览\x0a\x09\x20\x20$\x20lovrabet\x20config\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20项目配置\x0a\x09\x20\x20$\x20lovrabet\x20api\x20pull\x20--[options]\x20\x20\x20\x20\x20\x20//\x20拉取并生成\x20API\x20配置文件(详见\x20lovrabet\x20api\x20--help)\x0a\x09\x20\x20$\x20lovrabet\x20logs\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20查看日志\x0a\x09\x20\x20$\x20lovrabet\x20logs\x20--clear\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20清空日志\x0a','preview','flags','167445wDGHaT','5179216zDRgWZ','1295181AymqfY','setLogPath','build','page','6700881XmXqHP','12gcwXCK','1039686VILySx','trim'];a16_0x93cc=function(){return _0x22a22b;};return a16_0x93cc();}function a16_0x4fef(_0x4d0b45,_0x214036){const _0x93ccb9=a16_0x93cc();return a16_0x4fef=function(_0x4fefce,_0x163e38){_0x4fefce=_0x4fefce-0x99;let _0x49c45a=_0x93ccb9[_0x4fefce];return _0x49c45a;},a16_0x4fef(_0x4d0b45,_0x214036);}import{showLogs,clearLogs}from'./cmd/logs.js';const cli=a16_0x5ca777(a16_0x42fca(0xb4),{'importMeta':import.meta,'flags':{'name':{'type':a16_0x42fca(0xae)},'clear':{'type':a16_0x42fca(0xa9)},'env':{'type':a16_0x42fca(0xae)},'watch':{'type':'boolean'},'help':{'type':a16_0x42fca(0xa9)},'appcode':{'type':a16_0x42fca(0xae)},'output':{'type':'string'}}});await run();async function run(){const _0x3bf2e3=a16_0x42fca,_0x264153=cli[_0x3bf2e3(0xad)][0x0];switch(_0x264153){case'create':{const _0x4751f6=cli['input'][0x1]?.[_0x3bf2e3(0x9f)](),_0x2d68a4=cli[_0x3bf2e3(0xb6)][_0x3bf2e3(0xb2)];render(a16_0xe25169(CreateApp,{'projectCode':_0x4751f6,'env':_0x2d68a4}));break;}case _0x3bf2e3(0xa5):{cli[_0x3bf2e3(0xad)][0x1]===_0x3bf2e3(0x9b)&&(logger[_0x3bf2e3(0x99)](process[_0x3bf2e3(0xa4)]()),render(a16_0xe25169(AddPage,{})));break;}case _0x3bf2e3(0xab):{try{logger['setLogPath'](process[_0x3bf2e3(0xa4)]()),await runStart();}catch(_0x29d967){console['error'](_0x29d967),process[_0x3bf2e3(0xa8)](0x1);}break;}case _0x3bf2e3(0x9a):{try{logger[_0x3bf2e3(0x99)](process[_0x3bf2e3(0xa4)]()),await runBuild();}catch(_0x32ee78){console[_0x3bf2e3(0xb3)](_0x32ee78),process[_0x3bf2e3(0xa8)](0x1);}break;}case _0x3bf2e3(0xb5):{const _0x49225a=cli[_0x3bf2e3(0xb6)][_0x3bf2e3(0xa1)];logger[_0x3bf2e3(0x99)](process[_0x3bf2e3(0xa4)]());if(_0x49225a)try{await Promise['all']([runBuildWatch(),runPreview()]);}catch(_0x409bd2){console[_0x3bf2e3(0xb3)](_0x409bd2),process[_0x3bf2e3(0xa8)](0x1);}else try{await runPreview();}catch(_0x444332){console['error'](_0x444332),process[_0x3bf2e3(0xa8)](0x1);}break;}case'config':{render(a16_0xe25169(Config,{'cli':cli}));break;}case _0x3bf2e3(0xb0):{await apiCli(cli);break;}case'auth':{render(a16_0xe25169(AuthServer,{}));break;}case _0x3bf2e3(0xaf):{logout();break;}case _0x3bf2e3(0xaa):{cli['flags']['clear']?clearLogs():showLogs();break;}default:render(a16_0xe25169(Help,{}));break;}}