@lovrabet/cli 1.1.0 → 1.1.1

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 (42) 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/logger.js +1 -1
  40. package/lib/utils/router-updater.js +1 -1
  41. package/lib/utils/template-replacer.js +1 -1
  42. package/package.json +1 -1
@@ -1 +1 @@
1
- (function(_0x1e5230,_0x562407){const _0x32411a=a0_0x467e,_0x22ae19=_0x1e5230();while(!![]){try{const _0xb12019=parseInt(_0x32411a(0x7a))/0x1*(parseInt(_0x32411a(0x75))/0x2)+-parseInt(_0x32411a(0x74))/0x3*(parseInt(_0x32411a(0x73))/0x4)+-parseInt(_0x32411a(0x72))/0x5+-parseInt(_0x32411a(0x7f))/0x6+-parseInt(_0x32411a(0x7d))/0x7*(-parseInt(_0x32411a(0x7c))/0x8)+parseInt(_0x32411a(0x8a))/0x9*(parseInt(_0x32411a(0x84))/0xa)+-parseInt(_0x32411a(0x76))/0xb;if(_0xb12019===_0x562407)break;else _0x22ae19['push'](_0x22ae19['shift']());}catch(_0x47f191){_0x22ae19['push'](_0x22ae19['shift']());}}}(a0_0x22f0,0x3f34b));function a0_0x22f0(){const _0x5f5b84=['页面路径不合法','gray','startsWith','371830MVymqO','24YoucZQ','167307UleieO','743092xvsNSt','1210033JHIrVu','\x20直接回车确认,或输入自定义路由地址','red','column','1yzyzxr','split','2824952ofUTNd','7oihqLD','green','2712312zuslWf','路径不能包含连续的\x20/','路径中的每个段只能以字母或数字开头,且只包含字母、数字、-\x20和\x20_','delete','页面路径长度不能超过\x20100\x20个字符','5052610JWwAnv','页面路由地址:\x20','\x20已存在,请使用其他路径','includes','my-page','existsSync','9vPLmRZ','路径不能以\x20/\x20开头或结尾'];a0_0x22f0=function(){return _0x5f5b84;};return a0_0x22f0();}function a0_0x467e(_0xa377dd,_0x4040f8){const _0x22f042=a0_0x22f0();return a0_0x467e=function(_0x467e07,_0x5c1d99){_0x467e07=_0x467e07-0x72;let _0x3f0f00=_0x22f042[_0x467e07];return _0x3f0f00;},a0_0x467e(_0xa377dd,_0x4040f8);}import{jsx as a0_0x5f1b17,jsxs as a0_0xb51a28}from'react/jsx-runtime';import{useState}from'react';import{Text,Box,useInput}from'ink';import a0_0xd35c4b from'node:fs';export function InputProjectCode(_0x179559){const _0x3421cb=a0_0x467e,{onSubmit:_0x35f247,pagePath:_0x452cda}=_0x179559,[_0x332c93,_0x125bb4]=useState(''),[_0x1389db,_0x454b2a]=useState(''),_0x178711=_0x3421cb(0x88);function _0x25faf5(_0x272b34){const _0x5d1222=_0x3421cb;if(_0x272b34['length']>0x64)return{'valid':![],'message':_0x5d1222(0x83)};if(_0x272b34[_0x5d1222(0x8e)]('/')||_0x272b34['endsWith']('/'))return{'valid':![],'message':_0x5d1222(0x8b)};if(_0x272b34[_0x5d1222(0x87)]('//'))return{'valid':![],'message':_0x5d1222(0x80)};const _0x528081=_0x272b34[_0x5d1222(0x7b)]('/');for(const _0x402bbf of _0x528081){if(!_0x402bbf)continue;const _0xb8db0c=/^[A-Za-z0-9][A-Za-z0-9_-]*$/;if(!_0xb8db0c['test'](_0x402bbf))return{'valid':![],'message':_0x5d1222(0x81)};}return{'valid':!![]};}return useInput((_0x1e06c0,_0xcf9287)=>{const _0x3d3563=_0x3421cb;if(_0xcf9287['return']){const _0x5db97d=_0x332c93['trim']()||_0x178711;if(_0x1389db)return;const _0x4ad7f9=_0x452cda+'/'+_0x5db97d;if(a0_0xd35c4b[_0x3d3563(0x89)](_0x4ad7f9)){_0x454b2a('页面路径\x20'+_0x5db97d+_0x3d3563(0x86));return;}_0x35f247(_0x5db97d),_0x125bb4(''),_0x454b2a('');}else _0xcf9287['backspace']||_0xcf9287[_0x3d3563(0x82)]?_0x125bb4(_0xee6eeb=>{const _0x11b0c2=_0xee6eeb['slice'](0x0,-0x1),{valid:_0x3dd5e2,message:_0xad4f05}=_0x25faf5(_0x11b0c2);return _0x454b2a(_0x3dd5e2?'':_0xad4f05||'页面路径不合法'),_0x11b0c2;}):_0x125bb4(_0x36927f=>{const _0x275c1b=_0x3d3563,_0x19866c=_0x36927f+_0x1e06c0,{valid:_0x26d626,message:_0x49b3c0}=_0x25faf5(_0x19866c);return _0x454b2a(_0x26d626?'':_0x49b3c0||_0x275c1b(0x8c)),_0x19866c;});}),a0_0xb51a28(Box,{'flexDirection':_0x3421cb(0x79),'children':[a0_0xb51a28(Box,{'children':[a0_0x5f1b17(Text,{'color':'gray','children':'\x20Step2:\x20'}),a0_0x5f1b17(Text,{'children':_0x3421cb(0x85)}),_0x332c93?a0_0x5f1b17(Text,{'color':_0x3421cb(0x7e),'children':_0x332c93}):a0_0x5f1b17(Text,{'color':'gray','children':_0x178711}),_0x1389db&&a0_0xb51a28(Text,{'color':_0x3421cb(0x78),'children':['\x20←\x20',_0x1389db]})]}),!_0x1389db&&!_0x332c93&&a0_0x5f1b17(Box,{'children':a0_0x5f1b17(Text,{'color':_0x3421cb(0x8d),'children':_0x3421cb(0x77)})})]});}
1
+ (function(_0x8f5dc0,_0x54d381){const _0x21beb1=a0_0x2b3c,_0x1c1f94=_0x8f5dc0();while(!![]){try{const _0x113493=parseInt(_0x21beb1(0x13f))/0x1+parseInt(_0x21beb1(0x147))/0x2+-parseInt(_0x21beb1(0x144))/0x3*(-parseInt(_0x21beb1(0x148))/0x4)+-parseInt(_0x21beb1(0x153))/0x5+parseInt(_0x21beb1(0x137))/0x6*(-parseInt(_0x21beb1(0x156))/0x7)+-parseInt(_0x21beb1(0x136))/0x8*(parseInt(_0x21beb1(0x14a))/0x9)+parseInt(_0x21beb1(0x150))/0xa*(parseInt(_0x21beb1(0x13d))/0xb);if(_0x113493===_0x54d381)break;else _0x1c1f94['push'](_0x1c1f94['shift']());}catch(_0x675cd){_0x1c1f94['push'](_0x1c1f94['shift']());}}}(a0_0x296b,0x21ce6));function a0_0x296b(){const _0x2e941f=['my-page','endsWith','364705OMYFhP','green','251735nbbNgy','split','startsWith','页面路径不合法','\x20已存在,请使用其他路径','354738XRlgll','路径不能包含连续的\x20/','red','153054ndGVvw','8edaNOZ','delete','324099ILbzaC','includes','test','existsSync','backspace','路径中的每个段只能以字母或数字开头,且只包含字母、数字、-\x20和\x20_','50uffSzJ','\x20←\x20','\x20直接回车确认,或输入自定义路由地址','704770IzWwMg','gray','页面路由地址:\x20','948675jsHUXK','40sLqpvO','12ayZNft','\x20Step2:\x20','length','路径不能以\x20/\x20开头或结尾'];a0_0x296b=function(){return _0x2e941f;};return a0_0x296b();}import{jsx as a0_0x4190e3,jsxs as a0_0x32133c}from'react/jsx-runtime';function a0_0x2b3c(_0x3bc293,_0x5f50a2){const _0x296b0a=a0_0x296b();return a0_0x2b3c=function(_0x2b3cfd,_0x8b15d5){_0x2b3cfd=_0x2b3cfd-0x136;let _0x2c244b=_0x296b0a[_0x2b3cfd];return _0x2c244b;},a0_0x2b3c(_0x3bc293,_0x5f50a2);}import{useState}from'react';import{Text,Box,useInput}from'ink';import a0_0x230913 from'node:fs';export function InputProjectCode(_0x1fc0ab){const _0x1e23c6=a0_0x2b3c,{onSubmit:_0x1f0677,pagePath:_0x2a6fc6}=_0x1fc0ab,[_0x578dd6,_0x1e3ef9]=useState(''),[_0x10b1dd,_0x58e4d5]=useState(''),_0x36925c=_0x1e23c6(0x13b);function _0x1ed2cb(_0x444520){const _0x50a7ba=_0x1e23c6;if(_0x444520[_0x50a7ba(0x139)]>0x64)return{'valid':![],'message':'页面路径长度不能超过\x20100\x20个字符'};if(_0x444520[_0x50a7ba(0x141)]('/')||_0x444520[_0x50a7ba(0x13c)]('/'))return{'valid':![],'message':_0x50a7ba(0x13a)};if(_0x444520[_0x50a7ba(0x14b)]('//'))return{'valid':![],'message':_0x50a7ba(0x145)};const _0x199742=_0x444520[_0x50a7ba(0x140)]('/');for(const _0x4bb67d of _0x199742){if(!_0x4bb67d)continue;const _0x5dab6=/^[A-Za-z0-9][A-Za-z0-9_-]*$/;if(!_0x5dab6[_0x50a7ba(0x14c)](_0x4bb67d))return{'valid':![],'message':_0x50a7ba(0x14f)};}return{'valid':!![]};}return useInput((_0x50bfcb,_0x3ba158)=>{const _0x136881=_0x1e23c6;if(_0x3ba158['return']){const _0x3e9ea0=_0x578dd6['trim']()||_0x36925c;if(_0x10b1dd)return;const _0x4fa738=_0x2a6fc6+'/'+_0x3e9ea0;if(a0_0x230913[_0x136881(0x14d)](_0x4fa738)){_0x58e4d5('页面路径\x20'+_0x3e9ea0+_0x136881(0x143));return;}_0x1f0677(_0x3e9ea0),_0x1e3ef9(''),_0x58e4d5('');}else _0x3ba158[_0x136881(0x14e)]||_0x3ba158[_0x136881(0x149)]?_0x1e3ef9(_0x61baf3=>{const _0xab16d=_0x136881,_0x2fee01=_0x61baf3['slice'](0x0,-0x1),{valid:_0x44dad4,message:_0x3da8c8}=_0x1ed2cb(_0x2fee01);return _0x58e4d5(_0x44dad4?'':_0x3da8c8||_0xab16d(0x142)),_0x2fee01;}):_0x1e3ef9(_0x5da27d=>{const _0x3fd207=_0x5da27d+_0x50bfcb,{valid:_0x57f2b9,message:_0x446280}=_0x1ed2cb(_0x3fd207);return _0x58e4d5(_0x57f2b9?'':_0x446280||'页面路径不合法'),_0x3fd207;});}),a0_0x32133c(Box,{'flexDirection':'column','children':[a0_0x32133c(Box,{'children':[a0_0x4190e3(Text,{'color':_0x1e23c6(0x154),'children':_0x1e23c6(0x138)}),a0_0x4190e3(Text,{'children':_0x1e23c6(0x155)}),_0x578dd6?a0_0x4190e3(Text,{'color':_0x1e23c6(0x13e),'children':_0x578dd6}):a0_0x4190e3(Text,{'color':_0x1e23c6(0x154),'children':_0x36925c}),_0x10b1dd&&a0_0x32133c(Text,{'color':_0x1e23c6(0x146),'children':[_0x1e23c6(0x151),_0x10b1dd]})]}),!_0x10b1dd&&!_0x578dd6&&a0_0x4190e3(Box,{'children':a0_0x4190e3(Text,{'color':_0x1e23c6(0x154),'children':_0x1e23c6(0x152)})})]});}
@@ -1 +1 @@
1
- function a1_0x2a81(_0x57531e,_0x5a06db){const _0x20ab3c=a1_0x20ab();return a1_0x2a81=function(_0x2a81c9,_0x412d67){_0x2a81c9=_0x2a81c9-0xce;let _0x12ce35=_0x20ab3c[_0x2a81c9];return _0x12ce35;},a1_0x2a81(_0x57531e,_0x5a06db);}const a1_0x200adb=a1_0x2a81;(function(_0x5be83c,_0x47748b){const _0x5941c1=a1_0x2a81,_0x31c686=_0x5be83c();while(!![]){try{const _0x20678a=parseInt(_0x5941c1(0xd9))/0x1*(-parseInt(_0x5941c1(0xe2))/0x2)+parseInt(_0x5941c1(0xe3))/0x3+-parseInt(_0x5941c1(0xf0))/0x4+-parseInt(_0x5941c1(0xec))/0x5+parseInt(_0x5941c1(0xf6))/0x6*(parseInt(_0x5941c1(0xdd))/0x7)+parseInt(_0x5941c1(0xe6))/0x8*(parseInt(_0x5941c1(0xd5))/0x9)+-parseInt(_0x5941c1(0xdc))/0xa*(-parseInt(_0x5941c1(0xf2))/0xb);if(_0x20678a===_0x47748b)break;else _0x31c686['push'](_0x31c686['shift']());}catch(_0x2a4f3a){_0x31c686['push'](_0x31c686['shift']());}}}(a1_0x20ab,0x1fe78));import{jsx as a1_0x511d2d,jsxs as a1_0x4d86a7,Fragment as a1_0x4bc256}from'react/jsx-runtime';import{fileURLToPath}from'node:url';import a1_0x403b54 from'node:path';import{useEffect,useState}from'react';import{Box,Text,useApp}from'ink';import{SelectPageTemplate}from'./select-page-template.js';function a1_0x20ab(){const _0x13c331=['\x20Step1:\x20','页面添加失败:\x20','\x20*\x20页面创建成功!','72CRTqcR','join','dirname','add-page','951KTRRDS','finally','\x20*\x20页面路径:\x20','10TMrCqI','1460641mRgbyz','cwd','processTemplate','\x20Step2:\x20','green','482IynfYt','343248EQrqgH','src','开始添加页面:\x20','89104dcHijn','resolve','gray','setLogPath','url','then','765205mJLeHe','cyan','now','success','296032iJlJtN','info','1922107rJJKkW','message','pages','\x20*\x20路由地址:\x20','6eZaCVB','catch','已选择页面模板\x20','已输入的页面路由\x20','error'];a1_0x20ab=function(){return _0x13c331;};return a1_0x20ab();}import{InputProjectCode}from'./input-page-router.js';import{logger}from'../utils/logger.js';import{TemplateReplacer}from'../utils/template-replacer.js';const __dirname=a1_0x403b54[a1_0x200adb(0xd7)](fileURLToPath(import.meta[a1_0x200adb(0xea)])),pageTemplateDir=a1_0x403b54[a1_0x200adb(0xe7)](__dirname,'../../templates/pages'),projectDir=process[a1_0x200adb(0xde)]();export const AddPage=()=>{const _0x2ccbd8=a1_0x200adb,{exit:_0x12b119}=useApp(),[_0xbb903b,_0x409d4d]=useState(''),[_0x3c9124,_0x539738]=useState(''),[_0xf393e0,_0x1a5fdb]=useState(![]),[_0xa3a0a6,_0x56f87e]=useState(![]),_0x3a020c=a1_0x403b54[_0x2ccbd8(0xd6)](projectDir,_0x2ccbd8(0xe4),_0x2ccbd8(0xf4)),_0x1b3f0c=a1_0x403b54[_0x2ccbd8(0xd6)](_0x3a020c,_0x3c9124),_0x3627dd=a1_0x403b54['join'](_0x2ccbd8(0xe4),_0x2ccbd8(0xf4),_0x3c9124);useEffect(()=>{const _0x35a2ea=_0x2ccbd8,_0x124d6a=a1_0x403b54[_0x35a2ea(0xe7)](pageTemplateDir,_0xbb903b);if(_0xbb903b&&_0x3c9124){_0x1a5fdb(!![]),logger[_0x35a2ea(0xe9)](process[_0x35a2ea(0xde)]());const _0x11d0b4=Date['now']();logger[_0x35a2ea(0xf1)](_0x35a2ea(0xd8),_0x35a2ea(0xe5)+_0x3c9124,{'template':_0xbb903b,'targetPath':_0x3627dd}),TemplateReplacer[_0x35a2ea(0xdf)](_0x124d6a,a1_0x403b54[_0x35a2ea(0xd6)](_0x3a020c,_0x3c9124),_0x3c9124,_0xbb903b)[_0x35a2ea(0xeb)](()=>{const _0x44b4a4=_0x35a2ea,_0x2befd1=Date[_0x44b4a4(0xee)]()-_0x11d0b4;logger[_0x44b4a4(0xef)]('add-page','页面添加成功:\x20'+_0x3c9124,_0x2befd1,{'template':_0xbb903b,'targetPath':_0x3627dd,'routePath':_0x3c9124}),_0x56f87e(!![]);})[_0x35a2ea(0xce)](_0x3740c1=>{const _0x5024fc=_0x35a2ea,_0x1152c3=Date[_0x5024fc(0xee)]()-_0x11d0b4;logger[_0x5024fc(0xd1)](_0x5024fc(0xd8),_0x5024fc(0xd3)+_0x3c9124,{'template':_0xbb903b,'targetPath':_0x3627dd,'error':_0x3740c1 instanceof Error?_0x3740c1[_0x5024fc(0xf3)]:String(_0x3740c1),'duration':_0x1152c3});})[_0x35a2ea(0xda)](()=>{_0x1a5fdb(![]);});}},[_0xbb903b,_0x3c9124]),useEffect(()=>{_0xa3a0a6&&setTimeout(()=>{_0x12b119();});},[_0xa3a0a6]);if(_0xbb903b)return a1_0x4d86a7(Box,{'flexDirection':'column','paddingY':0x1,'children':[a1_0x4d86a7(Box,{'children':[a1_0x511d2d(Text,{'color':_0x2ccbd8(0xe8),'children':_0x2ccbd8(0xd2)}),a1_0x511d2d(Text,{'children':_0x2ccbd8(0xcf)}),a1_0x511d2d(Text,{'color':_0x2ccbd8(0xe1),'children':_0xbb903b})]}),_0x3c9124?a1_0x4d86a7(Box,{'children':[a1_0x511d2d(Text,{'color':_0x2ccbd8(0xe8),'children':_0x2ccbd8(0xe0)}),a1_0x511d2d(Text,{'children':_0x2ccbd8(0xd0)}),a1_0x511d2d(Text,{'color':'green','children':_0x3c9124})]}):a1_0x511d2d(InputProjectCode,{'pagePath':_0x1b3f0c,'onSubmit':_0x539738}),_0x3c9124&&_0xf393e0?a1_0x4d86a7(Box,{'marginTop':0x1,'children':[a1_0x511d2d(Box,{'width':'4'}),a1_0x511d2d(Text,{'children':'正在创建页面,请稍候…'})]}):null,_0xa3a0a6?a1_0x4d86a7(a1_0x4bc256,{'children':[a1_0x511d2d(Box,{'marginTop':0x1,'children':a1_0x511d2d(Text,{'color':_0x2ccbd8(0xe8),'children':_0x2ccbd8(0xd4)})}),a1_0x4d86a7(Box,{'children':[a1_0x511d2d(Text,{'color':_0x2ccbd8(0xe8),'children':_0x2ccbd8(0xdb)}),a1_0x511d2d(Text,{'color':_0x2ccbd8(0xe1),'children':_0x3627dd})]}),a1_0x4d86a7(Box,{'children':[a1_0x511d2d(Text,{'color':_0x2ccbd8(0xe8),'children':_0x2ccbd8(0xf5)}),a1_0x4d86a7(Text,{'color':_0x2ccbd8(0xe1),'children':['/',_0x3c9124]})]}),a1_0x511d2d(Box,{'marginTop':0x1,'children':a1_0x511d2d(Text,{'color':_0x2ccbd8(0xed),'children':'\x20*\x20页面文件已创建,可直接通过路由访问'})})]}):null]});return a1_0x511d2d(SelectPageTemplate,{'onSelect':_0x409d4d});};
1
+ const a1_0x3144e0=a1_0xcce0;function a1_0x1857(){const _0x120770=['pages','catch','join','\x20*\x20路由地址:\x20','then','now','1453527UWnpgg','27996IHHpnF','15zmWvzU','36VfKsuO','finally','1130856VyodKX','src','processTemplate','success','\x20Step1:\x20','url','6138457LhNXzu','add-page','gray','\x20Step2:\x20','\x20*\x20页面文件已创建,可直接通过路由访问','\x20*\x20页面路径:\x20','error','3zFloXi','开始添加页面:\x20','已输入的页面路由\x20','5398790DQTdTa','页面添加成功:\x20','resolve','33gWiJRB','cyan','column','green','204814kIpzIp','setLogPath','正在创建页面,请稍候…','1267rCwTEi','341200ASCUKh','36jsKBmP'];a1_0x1857=function(){return _0x120770;};return a1_0x1857();}(function(_0x504466,_0x3f05be){const _0x3adb68=a1_0xcce0,_0x1f8989=_0x504466();while(!![]){try{const _0x1e3da7=-parseInt(_0x3adb68(0x146))/0x1*(parseInt(_0x3adb68(0x150))/0x2)+-parseInt(_0x3adb68(0x15c))/0x3+-parseInt(_0x3adb68(0x161))/0x4*(-parseInt(_0x3adb68(0x15e))/0x5)+-parseInt(_0x3adb68(0x15d))/0x6*(-parseInt(_0x3adb68(0x153))/0x7)+-parseInt(_0x3adb68(0x154))/0x8*(-parseInt(_0x3adb68(0x155))/0x9)+-parseInt(_0x3adb68(0x149))/0xa*(parseInt(_0x3adb68(0x14c))/0xb)+-parseInt(_0x3adb68(0x15f))/0xc*(-parseInt(_0x3adb68(0x13f))/0xd);if(_0x1e3da7===_0x3f05be)break;else _0x1f8989['push'](_0x1f8989['shift']());}catch(_0x3bb5e3){_0x1f8989['push'](_0x1f8989['shift']());}}}(a1_0x1857,0xd4088));import{jsx as a1_0x3d73f8,jsxs as a1_0x11339f,Fragment as a1_0x448153}from'react/jsx-runtime';import{fileURLToPath}from'node:url';import a1_0x25a9ef from'node:path';import{useEffect,useState}from'react';import{Box,Text,useApp}from'ink';function a1_0xcce0(_0x4abc18,_0x558175){const _0x185770=a1_0x1857();return a1_0xcce0=function(_0xcce09e,_0x5be689){_0xcce09e=_0xcce09e-0x13c;let _0x20429f=_0x185770[_0xcce09e];return _0x20429f;},a1_0xcce0(_0x4abc18,_0x558175);}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_0x25a9ef['dirname'](fileURLToPath(import.meta[a1_0x3144e0(0x13e)])),pageTemplateDir=a1_0x25a9ef[a1_0x3144e0(0x14b)](__dirname,'../../templates/pages'),projectDir=process['cwd']();export const AddPage=()=>{const _0x566a7d=a1_0x3144e0,{exit:_0x350242}=useApp(),[_0x27c846,_0x7828fc]=useState(''),[_0x197895,_0xfc4d39]=useState(''),[_0x4974f6,_0x5ce08c]=useState(![]),[_0x20aaf0,_0x417bdd]=useState(![]),_0x529769=a1_0x25a9ef[_0x566a7d(0x158)](projectDir,_0x566a7d(0x162),_0x566a7d(0x156)),_0x155988=a1_0x25a9ef['join'](_0x529769,_0x197895),_0x8192b4=a1_0x25a9ef['join']('src',_0x566a7d(0x156),_0x197895);useEffect(()=>{const _0x30a24c=_0x566a7d,_0x40425b=a1_0x25a9ef['resolve'](pageTemplateDir,_0x27c846);if(_0x27c846&&_0x197895){_0x5ce08c(!![]),logger[_0x30a24c(0x151)](process['cwd']());const _0x28c9dc=Date[_0x30a24c(0x15b)]();logger['info'](_0x30a24c(0x140),_0x30a24c(0x147)+_0x197895,{'template':_0x27c846,'targetPath':_0x8192b4}),TemplateReplacer[_0x30a24c(0x163)](_0x40425b,a1_0x25a9ef['join'](_0x529769,_0x197895),_0x197895,_0x27c846)[_0x30a24c(0x15a)](()=>{const _0x23a720=_0x30a24c,_0x784493=Date['now']()-_0x28c9dc;logger[_0x23a720(0x13c)](_0x23a720(0x140),_0x23a720(0x14a)+_0x197895,_0x784493,{'template':_0x27c846,'targetPath':_0x8192b4,'routePath':_0x197895}),_0x417bdd(!![]);})[_0x30a24c(0x157)](_0x213ee3=>{const _0x17def8=_0x30a24c,_0x1e7fef=Date['now']()-_0x28c9dc;logger[_0x17def8(0x145)](_0x17def8(0x140),'页面添加失败:\x20'+_0x197895,{'template':_0x27c846,'targetPath':_0x8192b4,'error':_0x213ee3 instanceof Error?_0x213ee3['message']:String(_0x213ee3),'duration':_0x1e7fef});})[_0x30a24c(0x160)](()=>{_0x5ce08c(![]);});}},[_0x27c846,_0x197895]),useEffect(()=>{_0x20aaf0&&setTimeout(()=>{_0x350242();});},[_0x20aaf0]);if(_0x27c846)return a1_0x11339f(Box,{'flexDirection':_0x566a7d(0x14e),'paddingY':0x1,'children':[a1_0x11339f(Box,{'children':[a1_0x3d73f8(Text,{'color':'gray','children':_0x566a7d(0x13d)}),a1_0x3d73f8(Text,{'children':'已选择页面模板\x20'}),a1_0x3d73f8(Text,{'color':_0x566a7d(0x14f),'children':_0x27c846})]}),_0x197895?a1_0x11339f(Box,{'children':[a1_0x3d73f8(Text,{'color':_0x566a7d(0x141),'children':_0x566a7d(0x142)}),a1_0x3d73f8(Text,{'children':_0x566a7d(0x148)}),a1_0x3d73f8(Text,{'color':'green','children':_0x197895})]}):a1_0x3d73f8(InputProjectCode,{'pagePath':_0x155988,'onSubmit':_0xfc4d39}),_0x197895&&_0x4974f6?a1_0x11339f(Box,{'marginTop':0x1,'children':[a1_0x3d73f8(Box,{'width':'4'}),a1_0x3d73f8(Text,{'children':_0x566a7d(0x152)})]}):null,_0x20aaf0?a1_0x11339f(a1_0x448153,{'children':[a1_0x3d73f8(Box,{'marginTop':0x1,'children':a1_0x3d73f8(Text,{'color':_0x566a7d(0x141),'children':'\x20*\x20页面创建成功!'})}),a1_0x11339f(Box,{'children':[a1_0x3d73f8(Text,{'color':'gray','children':_0x566a7d(0x144)}),a1_0x3d73f8(Text,{'color':'green','children':_0x8192b4})]}),a1_0x11339f(Box,{'children':[a1_0x3d73f8(Text,{'color':_0x566a7d(0x141),'children':_0x566a7d(0x159)}),a1_0x11339f(Text,{'color':_0x566a7d(0x14f),'children':['/',_0x197895]})]}),a1_0x3d73f8(Box,{'marginTop':0x1,'children':a1_0x3d73f8(Text,{'color':_0x566a7d(0x14d),'children':_0x566a7d(0x143)})})]}):null]});return a1_0x3d73f8(SelectPageTemplate,{'onSelect':_0x7828fc});};
@@ -1 +1 @@
1
- (function(_0x16fa14,_0x3154ce){const _0x59033a=a2_0x5d7d,_0x293aea=_0x16fa14();while(!![]){try{const _0x58f667=-parseInt(_0x59033a(0x157))/0x1+-parseInt(_0x59033a(0x153))/0x2+-parseInt(_0x59033a(0x148))/0x3+-parseInt(_0x59033a(0x154))/0x4*(-parseInt(_0x59033a(0x152))/0x5)+-parseInt(_0x59033a(0x15d))/0x6*(-parseInt(_0x59033a(0x149))/0x7)+parseInt(_0x59033a(0x162))/0x8+-parseInt(_0x59033a(0x144))/0x9;if(_0x58f667===_0x3154ce)break;else _0x293aea['push'](_0x293aea['shift']());}catch(_0x24a20e){_0x293aea['push'](_0x293aea['shift']());}}}(a2_0x526d,0xcb21b));function a2_0x5d7d(_0x33c30b,_0x9fb3b6){const _0x526d23=a2_0x526d();return a2_0x5d7d=function(_0x5d7df8,_0x577a54){_0x5d7df8=_0x5d7df8-0x143;let _0xbcdc7d=_0x526d23[_0x5d7df8];return _0xbcdc7d;},a2_0x5d7d(_0x33c30b,_0x9fb3b6);}import{jsx as a2_0x21c279,jsxs as a2_0x30c003}from'react/jsx-runtime';import{useState,useEffect}from'react';import{Text,Box,useInput}from'ink';import{readdir}from'node:fs/promises';import a2_0x52488f from'node:path';import{fileURLToPath}from'node:url';async function getTemplateList(){const _0x206c2c=a2_0x5d7d;try{const _0x14f921=fileURLToPath(import.meta[_0x206c2c(0x15b)]),_0x1fb033=a2_0x52488f[_0x206c2c(0x15c)](a2_0x52488f[_0x206c2c(0x15f)](_0x14f921),_0x206c2c(0x14d)),_0x913662=a2_0x52488f[_0x206c2c(0x14a)](_0x1fb033,_0x206c2c(0x15e)),_0x4d0e14=await readdir(_0x913662,{'withFileTypes':!![]}),_0x34cc44=_0x4d0e14['filter'](_0x2a50db=>_0x2a50db[_0x206c2c(0x151)]())[_0x206c2c(0x14c)](_0x59dd0d=>({'label':_0x59dd0d[_0x206c2c(0x145)]}))['sort']((_0x7cb155,_0x49fe9d)=>_0x7cb155['label']['localeCompare'](_0x49fe9d[_0x206c2c(0x155)]));return _0x34cc44;}catch(_0x14b07b){return console[_0x206c2c(0x160)](_0x206c2c(0x158),_0x14b07b),[{'label':_0x206c2c(0x15a)},{'label':_0x206c2c(0x147)}];}}export function SelectPageTemplate(_0x461fea){const _0x43dc75=a2_0x5d7d,[_0x4e53b9,_0x3bd1db]=useState(0x0),[_0xe0c482,_0x36a3d0]=useState([]),[_0x3b0a06,_0x2c4bb8]=useState(!![]);useEffect(()=>{async function _0x80fcc2(){const _0x232a7b=await getTemplateList();_0x36a3d0(_0x232a7b),_0x2c4bb8(![]);}_0x80fcc2();},[]),useInput((_0x39e591,_0x19771c)=>{const _0x4c559d=a2_0x5d7d;if(_0x3b0a06)return;if(_0x19771c[_0x4c559d(0x150)]){const _0x2671c8=_0xe0c482[_0x4e53b9];_0x2671c8&&_0x461fea[_0x4c559d(0x143)](_0x2671c8[_0x4c559d(0x155)]);}_0x19771c[_0x4c559d(0x161)]&&_0x3bd1db(_0x5bee51=>_0x5bee51===0x0?_0xe0c482['length']-0x1:_0x5bee51-0x1),_0x19771c[_0x4c559d(0x156)]&&_0x3bd1db(_0x17a9cb=>_0x17a9cb===_0xe0c482['length']-0x1?0x0:_0x17a9cb+0x1);});if(_0x3b0a06)return a2_0x21c279(Box,{'flexDirection':_0x43dc75(0x14f),'paddingY':0x1,'children':a2_0x30c003(Box,{'children':[a2_0x21c279(Text,{'color':'gray','children':'\x20Step1:\x20'}),a2_0x21c279(Text,{'children':_0x43dc75(0x14b)})]})});return a2_0x30c003(Box,{'flexDirection':_0x43dc75(0x14f),'paddingY':0x1,'children':[a2_0x30c003(Box,{'children':[a2_0x21c279(Text,{'color':_0x43dc75(0x159),'children':'\x20Step1:\x20'}),a2_0x21c279(Text,{'children':'请选择您要创建的页面模板'})]}),_0xe0c482[_0x43dc75(0x14c)]((_0xf3113f,_0x5f4e9c)=>{const _0x3b1286=_0x43dc75,_0x456b19=_0x5f4e9c===_0x4e53b9,_0x1c7c39=_0x456b19?_0x3b1286(0x146)+_0xf3113f[_0x3b1286(0x155)]:_0x3b1286(0x14e)+_0xf3113f[_0x3b1286(0x155)];return a2_0x21c279(Box,{'children':a2_0x21c279(Text,{'color':_0x456b19?'green':undefined,'children':_0x1c7c39})},_0x1c7c39);})]});}function a2_0x526d(){const _0x75e28=['url','resolve','18QgPOvu','templates/pages','dirname','error','upArrow','9312488JJLEGd','onSelect','3888864XDrOhw','name','\x20\x20\x20\x20\x20\x20>\x20','sdk-fetch','193011ckwOAU','3097283yxCUfS','join','正在加载页面模板...','map','../..','\x20\x20\x20\x20\x20\x20\x20\x20','column','return','isDirectory','144665qMAqYD','943018ukpUXE','92axlydb','label','downArrow','1356958ZdqEaT','获取模板列表失败:','gray','blank'];a2_0x526d=function(){return _0x75e28;};return a2_0x526d();}
1
+ function a2_0x331e(){const _0x4d4e61=['sdk-fetch','\x20\x20\x20\x20\x20\x20>\x20','2431920ELMHQm','1627302RQyxFU','270YhJDUv','label','正在加载页面模板...','length','\x20Step1:\x20','downArrow','isDirectory','328MwGHOH','5660388LTlnua','join','column','map','upArrow','gray','green','请选择您要创建的页面模板','3927558sfaDKI','name','url','861SRmPRw','获取模板列表失败:','error','sort','5XWBqCG','templates/pages','13872663CcJJwz','9045oAIhCf'];a2_0x331e=function(){return _0x4d4e61;};return a2_0x331e();}(function(_0x3d0a80,_0x571446){const _0x3c167d=a2_0x30db,_0x128a71=_0x3d0a80();while(!![]){try{const _0x20c4ba=parseInt(_0x3c167d(0x8c))/0x1+parseInt(_0x3c167d(0x8d))/0x2*(-parseInt(_0x3c167d(0xa7))/0x3)+-parseInt(_0x3c167d(0x95))/0x4+-parseInt(_0x3c167d(0xa4))/0x5*(parseInt(_0x3c167d(0x9d))/0x6)+parseInt(_0x3c167d(0xa0))/0x7*(parseInt(_0x3c167d(0x94))/0x8)+parseInt(_0x3c167d(0xa6))/0x9+parseInt(_0x3c167d(0xaa))/0xa;if(_0x20c4ba===_0x571446)break;else _0x128a71['push'](_0x128a71['shift']());}catch(_0xa21978){_0x128a71['push'](_0x128a71['shift']());}}}(a2_0x331e,0xe58c5));import{jsx as a2_0x344ef5,jsxs as a2_0x33fce1}from'react/jsx-runtime';import{useState,useEffect}from'react';import{Text,Box,useInput}from'ink';import{readdir}from'node:fs/promises';import a2_0x56c8c2 from'node:path';import{fileURLToPath}from'node:url';async function getTemplateList(){const _0x2e2e76=a2_0x30db;try{const _0x18731=fileURLToPath(import.meta[_0x2e2e76(0x9f)]),_0x495176=a2_0x56c8c2['resolve'](a2_0x56c8c2['dirname'](_0x18731),'../..'),_0x2acf32=a2_0x56c8c2[_0x2e2e76(0x96)](_0x495176,_0x2e2e76(0xa5)),_0x4c219e=await readdir(_0x2acf32,{'withFileTypes':!![]}),_0x51b788=_0x4c219e['filter'](_0x5c7b1f=>_0x5c7b1f[_0x2e2e76(0x93)]())[_0x2e2e76(0x98)](_0x4290a6=>({'label':_0x4290a6[_0x2e2e76(0x9e)]}))[_0x2e2e76(0xa3)]((_0x5d2924,_0x283e6b)=>_0x5d2924['label']['localeCompare'](_0x283e6b[_0x2e2e76(0x8e)]));return _0x51b788;}catch(_0x3d2bda){return console[_0x2e2e76(0xa2)](_0x2e2e76(0xa1),_0x3d2bda),[{'label':'blank'},{'label':_0x2e2e76(0xa8)}];}}function a2_0x30db(_0x25bb07,_0x3b4bfa){const _0x331e6f=a2_0x331e();return a2_0x30db=function(_0x30db57,_0x4fff4f){_0x30db57=_0x30db57-0x8c;let _0x4aef2c=_0x331e6f[_0x30db57];return _0x4aef2c;},a2_0x30db(_0x25bb07,_0x3b4bfa);}export function SelectPageTemplate(_0x59f090){const _0x42afae=a2_0x30db,[_0x53859d,_0x29bcf5]=useState(0x0),[_0x598342,_0x1083bd]=useState([]),[_0x3d432c,_0x7ea53b]=useState(!![]);useEffect(()=>{async function _0xc50639(){const _0x5c4d3f=await getTemplateList();_0x1083bd(_0x5c4d3f),_0x7ea53b(![]);}_0xc50639();},[]),useInput((_0x115eee,_0x258843)=>{const _0x449294=a2_0x30db;if(_0x3d432c)return;if(_0x258843['return']){const _0x3e101d=_0x598342[_0x53859d];_0x3e101d&&_0x59f090['onSelect'](_0x3e101d[_0x449294(0x8e)]);}_0x258843[_0x449294(0x99)]&&_0x29bcf5(_0x5d2814=>_0x5d2814===0x0?_0x598342[_0x449294(0x90)]-0x1:_0x5d2814-0x1),_0x258843[_0x449294(0x92)]&&_0x29bcf5(_0x3bcb4b=>_0x3bcb4b===_0x598342[_0x449294(0x90)]-0x1?0x0:_0x3bcb4b+0x1);});if(_0x3d432c)return a2_0x344ef5(Box,{'flexDirection':'column','paddingY':0x1,'children':a2_0x33fce1(Box,{'children':[a2_0x344ef5(Text,{'color':_0x42afae(0x9a),'children':_0x42afae(0x91)}),a2_0x344ef5(Text,{'children':_0x42afae(0x8f)})]})});return a2_0x33fce1(Box,{'flexDirection':_0x42afae(0x97),'paddingY':0x1,'children':[a2_0x33fce1(Box,{'children':[a2_0x344ef5(Text,{'color':_0x42afae(0x9a),'children':'\x20Step1:\x20'}),a2_0x344ef5(Text,{'children':_0x42afae(0x9c)})]}),_0x598342[_0x42afae(0x98)]((_0x22db37,_0x3f4cc7)=>{const _0x2572da=_0x42afae,_0x1ba3b3=_0x3f4cc7===_0x53859d,_0x14265c=_0x1ba3b3?_0x2572da(0xa9)+_0x22db37[_0x2572da(0x8e)]:'\x20\x20\x20\x20\x20\x20\x20\x20'+_0x22db37[_0x2572da(0x8e)];return a2_0x344ef5(Box,{'children':a2_0x344ef5(Text,{'color':_0x1ba3b3?_0x2572da(0x9b):undefined,'children':_0x14265c})},_0x14265c);})]});}
@@ -1 +1 @@
1
- (function(_0x4b9e76,_0x5dccd8){const _0x4c0a8f=a3_0x108a,_0x44474e=_0x4b9e76();while(!![]){try{const _0x1e89af=parseInt(_0x4c0a8f(0x178))/0x1+-parseInt(_0x4c0a8f(0x188))/0x2*(parseInt(_0x4c0a8f(0x176))/0x3)+-parseInt(_0x4c0a8f(0x195))/0x4*(parseInt(_0x4c0a8f(0x19a))/0x5)+-parseInt(_0x4c0a8f(0x180))/0x6*(parseInt(_0x4c0a8f(0x18d))/0x7)+-parseInt(_0x4c0a8f(0x182))/0x8*(parseInt(_0x4c0a8f(0x186))/0x9)+parseInt(_0x4c0a8f(0x196))/0xa*(parseInt(_0x4c0a8f(0x1ac))/0xb)+parseInt(_0x4c0a8f(0x192))/0xc*(parseInt(_0x4c0a8f(0x171))/0xd);if(_0x1e89af===_0x5dccd8)break;else _0x44474e['push'](_0x44474e['shift']());}catch(_0x5423d0){_0x44474e['push'](_0x44474e['shift']());}}}(a3_0xd038,0x2a26c));import{jsx as a3_0x11d652,jsxs as a3_0x4b62ba}from'react/jsx-runtime';import{useEffect,useState}from'react';import{Box,Text,useApp}from'ink';import{readConfig}from'../utils/config.js';import{getCookie}from'../auth/get-cookie.js';function a3_0x108a(_0x3cea62,_0x3ff26d){const _0xd0389c=a3_0xd038();return a3_0x108a=function(_0x108a2a,_0x43277d){_0x108a2a=_0x108a2a-0x16d;let _0x5c4a46=_0xd0389c[_0x108a2a];return _0x5c4a46;},a3_0x108a(_0x3cea62,_0x3ff26d);}import{getApiDomain}from'../constant/domain.js';function a3_0xd038(){const _0x3c1447=['\x20-\x20客户端实例文件','1071aqPdXK','import\x20','message','√\x20API\x20文件生成成功!','text','336eNodIl','error','&pageSize=999&currentPage=1','12oGrbbn','10mgmJqh','src/api/','gray','cyan','384760yWCkxo','\x20from\x20\x27@/api/','yellow','dim','.ts','💡\x20请使用\x20','\x20-\x20模型配置文件','api','api-pull','white','app','-api','*\x20将生成文件:\x20','{\x20lovrabetClient\x20}','cwd','使用配置的应用AppCode:\x20','/smartapi/dataset/getList?appCode=','status','345081dOxRlV',',且无法读取错误响应内容','includes','使用指定的应用AppCode:\x20','json','success','413101JpNkda','setLogPath','join','\x20重新登录后再试','replace','1821MpoZIU','green','33023kuMSkd','client','🚀\x20正在从服务器拉取\x20API\x20配置...','slice','登录鉴权失败,登录已过期,请使用\x20lovrabet\x20auth\x20重新登录','拉取\x20API\x20配置失败:\x20','column','red','12606pnVnat','未提供应用AppCode,且配置中也没有默认值','580664APiFcs','获取数据集失败,HTTP状态码:\x20','*\x20导入方式:','data','9qDfpuK','lovrabet\x20auth','516orpBBr','url','tableData','-client'];a3_0xd038=function(){return _0x3c1447;};return a3_0xd038();}import{generateApiFile}from'./generate-api-file.js';import{logger}from'../utils/logger.js';export const ApiPullUI=({appCode:_0x4f53c9})=>{const _0x3afa64=a3_0x108a,{exit:_0x2dfd8c}=useApp(),[_0x4619d0,_0x395460]=useState(![]),[_0x521af4,_0x3be2de]=useState(![]),[_0x106cfe,_0x26be5c]=useState(null),[_0x31c455,_0x3bbbe7]=useState(null),_0x584744=readConfig(),_0x264e14=_0x4f53c9||_0x584744?.[_0x3afa64(0x1a4)],_0x2a6fef=_0x4f53c9&&_0x4f53c9[_0x3afa64(0x16d)]('-')?_0x4f53c9['split']('-')[_0x3afa64(0x17b)](0x1)[_0x3afa64(0x173)]('-'):'',_0x5c5c0f=_0x4f53c9?_0x3afa64(0x16e)+_0x264e14:_0x3afa64(0x1a9)+_0x264e14,_0x1ca6c8=_0x2a6fef?_0x2a6fef+_0x3afa64(0x1a5):_0x3afa64(0x1a1),_0x49963c=_0x2a6fef?_0x2a6fef+_0x3afa64(0x18b):_0x3afa64(0x179);useEffect(()=>{_0x395460(!![]),_0x35f3b2();},[]),useEffect(()=>{(_0x521af4||_0x106cfe)&&_0x2dfd8c();},[_0x521af4,_0x106cfe,_0x2dfd8c]);async function _0x35f3b2(){const _0x1a9750=_0x3afa64;if(!_0x264e14){_0x26be5c(_0x1a9750(0x181));return;}try{logger[_0x1a9750(0x172)](process[_0x1a9750(0x1a8)]());const _0xbde337=await fetch(getApiDomain()+_0x1a9750(0x1aa)+_0x264e14+_0x1a9750(0x194),{'headers':{'Cookie':getCookie()}});if(_0xbde337['ok']){const _0x2e2536=await _0xbde337[_0x1a9750(0x16f)]();if(_0x2e2536[_0x1a9750(0x170)]){const _0x85902c=!_0x4f53c9;await generateApiFile(_0x2e2536[_0x1a9750(0x185)][_0x1a9750(0x18a)],_0x2a6fef,_0x264e14,_0x85902c),_0x3bbbe7({'api':'src/api/'+_0x1ca6c8+_0x1a9750(0x19e),'client':'src/api/'+_0x49963c+'.ts'}),_0x3be2de(!![]);}}else{if(_0xbde337['status']===0x191){const _0x6b8573=_0x1a9750(0x17c);logger[_0x1a9750(0x193)](_0x1a9750(0x1a2),_0x6b8573,{'status':_0xbde337['status'],'appCode':_0x264e14,'url':_0xbde337[_0x1a9750(0x189)]}),_0x26be5c(_0x6b8573);}else{const _0x1fd4c9=_0x1a9750(0x183)+_0xbde337[_0x1a9750(0x1ab)];try{const _0x875417=await _0xbde337[_0x1a9750(0x191)]();_0x875417?logger['error'](_0x1a9750(0x1a2),_0x1fd4c9,{'status':_0xbde337[_0x1a9750(0x1ab)],'appCode':_0x264e14,'url':_0xbde337[_0x1a9750(0x189)],'errorBody':_0x875417}):logger[_0x1a9750(0x193)](_0x1a9750(0x1a2),_0x1fd4c9,{'status':_0xbde337['status'],'appCode':_0x264e14,'url':_0xbde337[_0x1a9750(0x189)]});}catch(_0x5b1e09){logger[_0x1a9750(0x193)](_0x1a9750(0x1a2),_0x1fd4c9+_0x1a9750(0x1ad),{'status':_0xbde337[_0x1a9750(0x1ab)],'appCode':_0x264e14,'url':_0xbde337[_0x1a9750(0x189)],'readError':_0x5b1e09 instanceof Error?_0x5b1e09[_0x1a9750(0x18f)]:String(_0x5b1e09)});}_0x26be5c(_0x1fd4c9);}}}catch(_0x122cd6){const _0x3157a1=_0x122cd6 instanceof Error?_0x122cd6['message']:String(_0x122cd6);_0x26be5c(_0x1a9750(0x17d)+_0x3157a1);}finally{_0x395460(![]);}}return a3_0x4b62ba(Box,{'flexDirection':_0x3afa64(0x17e),'children':[a3_0x4b62ba(Box,{'children':[a3_0x11d652(Text,{'color':'gray','children':'*\x20'}),a3_0x11d652(Text,{'color':_0x4f53c9?_0x3afa64(0x1a3):_0x3afa64(0x19d),'children':_0x5c5c0f})]}),a3_0x4b62ba(Box,{'children':[a3_0x11d652(Text,{'color':_0x3afa64(0x198),'children':_0x3afa64(0x1a6)}),a3_0x4b62ba(Text,{'color':'cyan','children':[_0x1ca6c8,_0x3afa64(0x19e)]}),a3_0x11d652(Text,{'color':_0x3afa64(0x19d),'children':'\x20和\x20'}),a3_0x4b62ba(Text,{'color':_0x3afa64(0x199),'children':[_0x49963c,_0x3afa64(0x19e)]})]}),_0x4619d0&&a3_0x11d652(Box,{'children':a3_0x11d652(Text,{'children':_0x3afa64(0x17a)})}),_0x521af4&&_0x31c455&&a3_0x4b62ba(Box,{'flexDirection':'column','children':[a3_0x11d652(Box,{'children':a3_0x11d652(Text,{'color':_0x3afa64(0x177),'children':_0x3afa64(0x190)})}),a3_0x11d652(Box,{'marginTop':0x1,'children':a3_0x11d652(Text,{'color':_0x3afa64(0x198),'children':'*\x20已生成文件:'})}),a3_0x4b62ba(Box,{'marginLeft':0x2,'children':[a3_0x4b62ba(Text,{'color':_0x3afa64(0x199),'children':['•\x20',_0x31c455['api']]}),a3_0x11d652(Text,{'color':_0x3afa64(0x19d),'children':_0x3afa64(0x1a0)})]}),a3_0x4b62ba(Box,{'marginLeft':0x2,'children':[a3_0x4b62ba(Text,{'color':_0x3afa64(0x199),'children':['•\x20',_0x31c455[_0x3afa64(0x179)]]}),a3_0x11d652(Text,{'color':_0x3afa64(0x19d),'children':_0x3afa64(0x18c)})]}),a3_0x11d652(Box,{'marginTop':0x1,'children':a3_0x11d652(Text,{'color':_0x3afa64(0x198),'children':_0x3afa64(0x184)})}),a3_0x11d652(Box,{'marginLeft':0x2,'children':a3_0x4b62ba(Text,{'color':_0x3afa64(0x19c),'children':[_0x3afa64(0x18e),_0x3afa64(0x1a7),_0x3afa64(0x19b),_0x31c455['client'][_0x3afa64(0x175)](_0x3afa64(0x197),'')[_0x3afa64(0x175)](_0x3afa64(0x19e),''),'\x27']})})]}),_0x106cfe&&a3_0x4b62ba(Box,{'flexDirection':_0x3afa64(0x17e),'children':[a3_0x11d652(Box,{'children':a3_0x4b62ba(Text,{'color':_0x3afa64(0x17f),'children':['❌\x20',_0x106cfe]})}),_0x106cfe[_0x3afa64(0x16d)]('登录')&&a3_0x4b62ba(Box,{'marginTop':0x1,'children':[a3_0x11d652(Text,{'color':_0x3afa64(0x19c),'children':_0x3afa64(0x19f)}),a3_0x11d652(Text,{'color':'cyan','children':_0x3afa64(0x187)}),a3_0x11d652(Text,{'color':_0x3afa64(0x19c),'children':_0x3afa64(0x174)})]})]})]});};
1
+ (function(_0x4dd0e1,_0x5074ea){const _0xc71cf5=a3_0x9bf8,_0x4d5e67=_0x4dd0e1();while(!![]){try{const _0x4b7a7c=parseInt(_0xc71cf5(0x1f8))/0x1+parseInt(_0xc71cf5(0x207))/0x2*(parseInt(_0xc71cf5(0x202))/0x3)+parseInt(_0xc71cf5(0x209))/0x4+-parseInt(_0xc71cf5(0x1e8))/0x5*(-parseInt(_0xc71cf5(0x1f9))/0x6)+parseInt(_0xc71cf5(0x200))/0x7*(-parseInt(_0xc71cf5(0x1ef))/0x8)+-parseInt(_0xc71cf5(0x1dc))/0x9+-parseInt(_0xc71cf5(0x204))/0xa;if(_0x4b7a7c===_0x5074ea)break;else _0x4d5e67['push'](_0x4d5e67['shift']());}catch(_0x3f9325){_0x4d5e67['push'](_0x4d5e67['shift']());}}}(a3_0x2d73,0x584eb));import{jsx as a3_0x9d7a52,jsxs as a3_0x4d2d86}from'react/jsx-runtime';import{useEffect,useState}from'react';import{Box,Text,useApp}from'ink';import{readConfig}from'../utils/config.js';function a3_0x2d73(){const _0xfe92e6=['json','setLogPath','gray','slice','dim','api-pull','*\x20将生成文件:\x20','api','552938FseIez','374100xlsaiF','💡\x20请使用\x20','success','\x20重新登录后再试','src/api/','column','url','200389qkCqSE','&pageSize=999&currentPage=1','1547016FDLmaA','includes','10592720eiZRhM','status','\x20-\x20模型配置文件','2XUXyuv','*\x20导入方式:','1624544ksXBTO','*\x20已生成文件:','tableData','🚀\x20正在从服务器拉取\x20API\x20配置...','red','使用指定的应用AppCode:\x20','cwd','import\x20','-api','app','1348560bSMdMx','client','cyan','white','error','登录鉴权失败,登录已过期,请使用\x20lovrabet\x20auth\x20重新登录','{\x20lovrabetClient\x20}','拉取\x20API\x20配置失败:\x20',',且无法读取错误响应内容','获取数据集失败,HTTP状态码:\x20','yellow','replace','10sHqUTT','green','.ts','-client','split','message','lovrabet\x20auth','8tCLzVF'];a3_0x2d73=function(){return _0xfe92e6;};return a3_0x2d73();}import{getCookie}from'../auth/get-cookie.js';import{getApiDomain}from'../constant/domain.js';function a3_0x9bf8(_0xace1c3,_0x40779b){const _0x2d737c=a3_0x2d73();return a3_0x9bf8=function(_0x9bf8c6,_0x42214d){_0x9bf8c6=_0x9bf8c6-0x1d3;let _0x4d08a9=_0x2d737c[_0x9bf8c6];return _0x4d08a9;},a3_0x9bf8(_0xace1c3,_0x40779b);}import{generateApiFile}from'./generate-api-file.js';import{logger}from'../utils/logger.js';export const ApiPullUI=({appCode:_0x41db6d})=>{const _0x40ef1e=a3_0x9bf8,{exit:_0x5bf4dc}=useApp(),[_0x5217ff,_0x3c1c1f]=useState(![]),[_0x1bdb62,_0x516754]=useState(![]),[_0xd5a609,_0x4ab400]=useState(null),[_0x1831dc,_0x386c18]=useState(null),_0x508637=readConfig(),_0x5a58b8=_0x41db6d||_0x508637?.[_0x40ef1e(0x1db)],_0xcb152f=_0x41db6d&&_0x41db6d[_0x40ef1e(0x203)]('-')?_0x41db6d[_0x40ef1e(0x1ec)]('-')[_0x40ef1e(0x1f3)](0x1)['join']('-'):'',_0x22c600=_0x41db6d?_0x40ef1e(0x1d7)+_0x5a58b8:'使用配置的应用AppCode:\x20'+_0x5a58b8,_0x56d972=_0xcb152f?_0xcb152f+_0x40ef1e(0x1da):_0x40ef1e(0x1f7),_0x1988e4=_0xcb152f?_0xcb152f+_0x40ef1e(0x1eb):_0x40ef1e(0x1dd);useEffect(()=>{_0x3c1c1f(!![]),_0x261d24();},[]),useEffect(()=>{(_0x1bdb62||_0xd5a609)&&_0x5bf4dc();},[_0x1bdb62,_0xd5a609,_0x5bf4dc]);async function _0x261d24(){const _0x23e227=_0x40ef1e;if(!_0x5a58b8){_0x4ab400('未提供应用AppCode,且配置中也没有默认值');return;}try{logger[_0x23e227(0x1f1)](process[_0x23e227(0x1d8)]());const _0x517c3d=await fetch(getApiDomain()+'/smartapi/dataset/getList?appCode='+_0x5a58b8+_0x23e227(0x201),{'headers':{'Cookie':getCookie()}});if(_0x517c3d['ok']){const _0x330fb1=await _0x517c3d[_0x23e227(0x1f0)]();if(_0x330fb1[_0x23e227(0x1fb)]){const _0x51c5d5=!_0x41db6d;await generateApiFile(_0x330fb1['data'][_0x23e227(0x1d4)],_0xcb152f,_0x5a58b8,_0x51c5d5),_0x386c18({'api':_0x23e227(0x1fd)+_0x56d972+'.ts','client':_0x23e227(0x1fd)+_0x1988e4+_0x23e227(0x1ea)}),_0x516754(!![]);}}else{if(_0x517c3d[_0x23e227(0x205)]===0x191){const _0x5eb43c=_0x23e227(0x1e1);logger[_0x23e227(0x1e0)](_0x23e227(0x1f5),_0x5eb43c,{'status':_0x517c3d[_0x23e227(0x205)],'appCode':_0x5a58b8,'url':_0x517c3d[_0x23e227(0x1ff)]}),_0x4ab400(_0x5eb43c);}else{const _0x47e241=_0x23e227(0x1e5)+_0x517c3d['status'];try{const _0x2acc8d=await _0x517c3d['text']();_0x2acc8d?logger['error'](_0x23e227(0x1f5),_0x47e241,{'status':_0x517c3d[_0x23e227(0x205)],'appCode':_0x5a58b8,'url':_0x517c3d[_0x23e227(0x1ff)],'errorBody':_0x2acc8d}):logger[_0x23e227(0x1e0)]('api-pull',_0x47e241,{'status':_0x517c3d[_0x23e227(0x205)],'appCode':_0x5a58b8,'url':_0x517c3d['url']});}catch(_0x1c092c){logger[_0x23e227(0x1e0)](_0x23e227(0x1f5),_0x47e241+_0x23e227(0x1e4),{'status':_0x517c3d[_0x23e227(0x205)],'appCode':_0x5a58b8,'url':_0x517c3d[_0x23e227(0x1ff)],'readError':_0x1c092c instanceof Error?_0x1c092c['message']:String(_0x1c092c)});}_0x4ab400(_0x47e241);}}}catch(_0x3c9abe){const _0x39c76c=_0x3c9abe instanceof Error?_0x3c9abe[_0x23e227(0x1ed)]:String(_0x3c9abe);_0x4ab400(_0x23e227(0x1e3)+_0x39c76c);}finally{_0x3c1c1f(![]);}}return a3_0x4d2d86(Box,{'flexDirection':'column','children':[a3_0x4d2d86(Box,{'children':[a3_0x9d7a52(Text,{'color':_0x40ef1e(0x1f2),'children':'*\x20'}),a3_0x9d7a52(Text,{'color':_0x41db6d?_0x40ef1e(0x1df):_0x40ef1e(0x1f4),'children':_0x22c600})]}),a3_0x4d2d86(Box,{'children':[a3_0x9d7a52(Text,{'color':'gray','children':_0x40ef1e(0x1f6)}),a3_0x4d2d86(Text,{'color':'cyan','children':[_0x56d972,_0x40ef1e(0x1ea)]}),a3_0x9d7a52(Text,{'color':'dim','children':'\x20和\x20'}),a3_0x4d2d86(Text,{'color':_0x40ef1e(0x1de),'children':[_0x1988e4,_0x40ef1e(0x1ea)]})]}),_0x5217ff&&a3_0x9d7a52(Box,{'children':a3_0x9d7a52(Text,{'children':_0x40ef1e(0x1d5)})}),_0x1bdb62&&_0x1831dc&&a3_0x4d2d86(Box,{'flexDirection':'column','children':[a3_0x9d7a52(Box,{'children':a3_0x9d7a52(Text,{'color':_0x40ef1e(0x1e9),'children':'√\x20API\x20文件生成成功!'})}),a3_0x9d7a52(Box,{'marginTop':0x1,'children':a3_0x9d7a52(Text,{'color':_0x40ef1e(0x1f2),'children':_0x40ef1e(0x1d3)})}),a3_0x4d2d86(Box,{'marginLeft':0x2,'children':[a3_0x4d2d86(Text,{'color':_0x40ef1e(0x1de),'children':['•\x20',_0x1831dc['api']]}),a3_0x9d7a52(Text,{'color':_0x40ef1e(0x1f4),'children':_0x40ef1e(0x206)})]}),a3_0x4d2d86(Box,{'marginLeft':0x2,'children':[a3_0x4d2d86(Text,{'color':_0x40ef1e(0x1de),'children':['•\x20',_0x1831dc['client']]}),a3_0x9d7a52(Text,{'color':'dim','children':'\x20-\x20客户端实例文件'})]}),a3_0x9d7a52(Box,{'marginTop':0x1,'children':a3_0x9d7a52(Text,{'color':_0x40ef1e(0x1f2),'children':_0x40ef1e(0x208)})}),a3_0x9d7a52(Box,{'marginLeft':0x2,'children':a3_0x4d2d86(Text,{'color':_0x40ef1e(0x1e6),'children':[_0x40ef1e(0x1d9),_0x40ef1e(0x1e2),'\x20from\x20\x27@/api/',_0x1831dc['client']['replace'](_0x40ef1e(0x1fd),'')[_0x40ef1e(0x1e7)]('.ts',''),'\x27']})})]}),_0xd5a609&&a3_0x4d2d86(Box,{'flexDirection':_0x40ef1e(0x1fe),'children':[a3_0x9d7a52(Box,{'children':a3_0x4d2d86(Text,{'color':_0x40ef1e(0x1d6),'children':['❌\x20',_0xd5a609]})}),_0xd5a609[_0x40ef1e(0x203)]('登录')&&a3_0x4d2d86(Box,{'marginTop':0x1,'children':[a3_0x9d7a52(Text,{'color':'yellow','children':_0x40ef1e(0x1fa)}),a3_0x9d7a52(Text,{'color':_0x40ef1e(0x1de),'children':_0x40ef1e(0x1ee)}),a3_0x9d7a52(Text,{'color':_0x40ef1e(0x1e6),'children':_0x40ef1e(0x1fc)})]})]})]});};
@@ -1 +1 @@
1
- (function(_0x20a520,_0x549d0e){const _0x111624=a4_0x532d,_0x28c4cb=_0x20a520();while(!![]){try{const _0x1001f2=-parseInt(_0x111624(0x98))/0x1+parseInt(_0x111624(0x9d))/0x2*(parseInt(_0x111624(0x9e))/0x3)+-parseInt(_0x111624(0xab))/0x4*(-parseInt(_0x111624(0x97))/0x5)+parseInt(_0x111624(0xac))/0x6+parseInt(_0x111624(0xa9))/0x7*(-parseInt(_0x111624(0x99))/0x8)+-parseInt(_0x111624(0xa8))/0x9*(-parseInt(_0x111624(0x96))/0xa)+-parseInt(_0x111624(0xa7))/0xb*(parseInt(_0x111624(0x95))/0xc);if(_0x1001f2===_0x549d0e)break;else _0x28c4cb['push'](_0x28c4cb['shift']());}catch(_0x1327a5){_0x28c4cb['push'](_0x28c4cb['shift']());}}}(a4_0x27c1,0xc9d54));export function formatDataset(_0x58eb16){const _0x10d746=a4_0x532d,_0x15514c=_0x58eb16['filter'](_0x59e1b0=>_0x59e1b0[_0x10d746(0x9a)]),_0x291337=_0x58eb16['filter'](_0x1a1ac9=>!_0x1a1ac9[_0x10d746(0x9a)]),_0x456f88=new Map();_0x15514c[_0x10d746(0x9b)](_0x4f9687=>{const _0x4ddc07=_0x10d746,_0x124386=_0x4f9687['dbtableConfig'][_0x4ddc07(0xa1)],_0x50a290=_0x456f88[_0x4ddc07(0xad)](_0x124386);(!_0x50a290||_0x4f9687['id']>_0x50a290['id'])&&_0x456f88[_0x4ddc07(0xb0)](_0x124386,_0x4f9687);});const _0x328dbe=Array[_0x10d746(0xaa)](_0x456f88['values']())[_0x10d746(0xa4)](_0x460029=>{const _0x299f1d=_0x10d746,_0x35ee0b=snakeToCamel(_0x460029[_0x299f1d(0x9a)][_0x299f1d(0xa1)]);return{'id':_0x460029['id'],'name':_0x460029[_0x299f1d(0xae)],'code':_0x460029[_0x299f1d(0xa2)],'tableName':_0x460029[_0x299f1d(0x9a)][_0x299f1d(0xa1)],'apiFucName':_0x35ee0b?_0x35ee0b+_0x299f1d(0xa0):'dataset'+_0x460029[_0x299f1d(0xa2)]+'Api','pkField':_0x460029[_0x299f1d(0x9a)][_0x299f1d(0xa6)],'allFields':_0x460029[_0x299f1d(0x9a)][_0x299f1d(0xa3)][_0x299f1d(0xa5)](',')};}),_0x1005a4=_0x291337[_0x10d746(0xa4)](_0x1cccea=>{const _0x3d172e=_0x10d746,_0x3c9aeb=_0x3d172e(0x9c)+_0x1cccea[_0x3d172e(0xa2)],_0x22942b=snakeToCamel(_0x3c9aeb);return{'id':_0x1cccea['id'],'name':_0x1cccea[_0x3d172e(0xae)],'code':_0x1cccea[_0x3d172e(0xa2)],'tableName':_0x3c9aeb,'apiFucName':_0x22942b?_0x22942b+'Api':_0x3d172e(0xaf)+_0x1cccea[_0x3d172e(0xa2)]+'Api','pkField':undefined,'allFields':[]};});return[..._0x328dbe,..._0x1005a4];}function a4_0x532d(_0x4171c4,_0x3a7cd5){const _0x27c1bd=a4_0x27c1();return a4_0x532d=function(_0x532d91,_0x515b06){_0x532d91=_0x532d91-0x95;let _0x1f5ca1=_0x27c1bd[_0x532d91];return _0x1f5ca1;},a4_0x532d(_0x4171c4,_0x3a7cd5);}function a4_0x27c1(){const _0xb76743=['code','allFields','map','split','pkField','3275261fjeXax','3413655QrKgZQ','189AVYRoC','from','56812nPnzRD','9051570lBtIAF','get','name','dataset','set','132YVfQty','40ZusHvQ','230dtiPAH','760192IllHoW','63272NisyIm','dbtableConfig','forEach','dataset_','3046wROpET','2751KMJIig','trim','Api','tableName'];a4_0x27c1=function(){return _0xb76743;};return a4_0x27c1();}function snakeToCamel(_0x5d178e){const _0x5757ec=a4_0x532d;if(!_0x5d178e)return _0x5d178e;const _0x18952f=_0x5d178e[_0x5757ec(0x9f)]();return _0x18952f['replace'](/_([a-zA-Z0-9])/g,(_0x2047f7,_0x36d6ff)=>_0x36d6ff['toUpperCase']());}
1
+ function a4_0x250a(){const _0x49c497=['15592tvmxro','1159217PtcDlC','2124ZOngjL','forEach','8693570CRxIYZ','Api','1316qPukKh','map','code','from','dataset','114969dXOXai','2165388DbrMMT','filter','set','dbtableConfig','96ePPhhp','dataset_','5314770txTaxt','pkField','get','28236bOsRGS','tableName'];a4_0x250a=function(){return _0x49c497;};return a4_0x250a();}function a4_0x1ff3(_0x534ac1,_0x27b8aa){const _0x250a40=a4_0x250a();return a4_0x1ff3=function(_0x1ff303,_0x2c65ee){_0x1ff303=_0x1ff303-0x1b8;let _0x55e0c8=_0x250a40[_0x1ff303];return _0x55e0c8;},a4_0x1ff3(_0x534ac1,_0x27b8aa);}(function(_0x526dcf,_0x4f408d){const _0x1bad73=a4_0x1ff3,_0x371be9=_0x526dcf();while(!![]){try{const _0x1bceac=parseInt(_0x1bad73(0x1b8))/0x1+parseInt(_0x1bad73(0x1c3))/0x2+parseInt(_0x1bad73(0x1c2))/0x3*(-parseInt(_0x1bad73(0x1c7))/0x4)+-parseInt(_0x1bad73(0x1c9))/0x5+-parseInt(_0x1bad73(0x1cc))/0x6*(parseInt(_0x1bad73(0x1bd))/0x7)+-parseInt(_0x1bad73(0x1ce))/0x8*(-parseInt(_0x1bad73(0x1b9))/0x9)+parseInt(_0x1bad73(0x1bb))/0xa;if(_0x1bceac===_0x4f408d)break;else _0x371be9['push'](_0x371be9['shift']());}catch(_0x852cd7){_0x371be9['push'](_0x371be9['shift']());}}}(a4_0x250a,0xabd36));export function formatDataset(_0x220d5a){const _0x2585dd=a4_0x1ff3,_0x42cc9e=_0x220d5a[_0x2585dd(0x1c4)](_0x2f9361=>_0x2f9361['dbtableConfig']),_0x3673a6=_0x220d5a[_0x2585dd(0x1c4)](_0x2907e7=>!_0x2907e7[_0x2585dd(0x1c6)]),_0x45c35d=new Map();_0x42cc9e[_0x2585dd(0x1ba)](_0x914715=>{const _0x4d0399=_0x2585dd,_0x1cac89=_0x914715['dbtableConfig'][_0x4d0399(0x1cd)],_0x3d8b69=_0x45c35d[_0x4d0399(0x1cb)](_0x1cac89);(!_0x3d8b69||_0x914715['id']>_0x3d8b69['id'])&&_0x45c35d[_0x4d0399(0x1c5)](_0x1cac89,_0x914715);});const _0x585c45=Array[_0x2585dd(0x1c0)](_0x45c35d['values']())[_0x2585dd(0x1be)](_0x4da365=>{const _0x48824f=_0x2585dd,_0x3557a6=snakeToCamel(_0x4da365[_0x48824f(0x1c6)][_0x48824f(0x1cd)]);return{'id':_0x4da365['id'],'name':_0x4da365['name'],'code':_0x4da365[_0x48824f(0x1bf)],'tableName':_0x4da365[_0x48824f(0x1c6)]['tableName'],'apiFucName':_0x3557a6?_0x3557a6+_0x48824f(0x1bc):_0x48824f(0x1c1)+_0x4da365[_0x48824f(0x1bf)]+_0x48824f(0x1bc),'pkField':_0x4da365['dbtableConfig'][_0x48824f(0x1ca)],'allFields':_0x4da365['dbtableConfig']['allFields']['split'](',')};}),_0x57f121=_0x3673a6[_0x2585dd(0x1be)](_0x5d42d3=>{const _0x44d022=_0x2585dd,_0x19ff7a=_0x44d022(0x1c8)+_0x5d42d3['code'],_0x1646b7=snakeToCamel(_0x19ff7a);return{'id':_0x5d42d3['id'],'name':_0x5d42d3['name'],'code':_0x5d42d3[_0x44d022(0x1bf)],'tableName':_0x19ff7a,'apiFucName':_0x1646b7?_0x1646b7+_0x44d022(0x1bc):_0x44d022(0x1c1)+_0x5d42d3[_0x44d022(0x1bf)]+_0x44d022(0x1bc),'pkField':undefined,'allFields':[]};});return[..._0x585c45,..._0x57f121];}function snakeToCamel(_0xd0776e){if(!_0xd0776e)return _0xd0776e;const _0x34095d=_0xd0776e['trim']();return _0x34095d['replace'](/_([a-zA-Z0-9])/g,(_0x10a327,_0x159ad3)=>_0x159ad3['toUpperCase']());}
@@ -1 +1 @@
1
- (function(_0x4ba014,_0x270288){const _0x2be778=a5_0xbbad,_0x2480fa=_0x4ba014();while(!![]){try{const _0x261313=-parseInt(_0x2be778(0xb7))/0x1*(-parseInt(_0x2be778(0x92))/0x2)+-parseInt(_0x2be778(0x90))/0x3+parseInt(_0x2be778(0xbc))/0x4*(parseInt(_0x2be778(0x9b))/0x5)+-parseInt(_0x2be778(0xb8))/0x6+-parseInt(_0x2be778(0x97))/0x7+-parseInt(_0x2be778(0xab))/0x8*(parseInt(_0x2be778(0x98))/0x9)+parseInt(_0x2be778(0xb5))/0xa;if(_0x261313===_0x270288)break;else _0x2480fa['push'](_0x2480fa['shift']());}catch(_0x17bb17){_0x2480fa['push'](_0x2480fa['shift']());}}}(a5_0x5e56,0x4dea0));function a5_0xbbad(_0x68d0b8,_0x1c2064){const _0x5e56ef=a5_0x5e56();return a5_0xbbad=function(_0xbbad0b,_0x1a8fd5){_0xbbad0b=_0xbbad0b-0x8f;let _0x3af880=_0x5e56ef[_0xbbad0b];return _0x3af880;},a5_0xbbad(_0x68d0b8,_0x1c2064);}import a5_0x5981b9 from'prettier';import{mkdirSync,writeFileSync,readFileSync}from'node:fs';function a5_0x5e56(){const _0x43cd58=['utf8','src/api/','url','23124Vaduoc','dirname','919113qzySRa','*\x20已生成文件:','1266GpAnLw','*\x20API配置\x20apiConfigName\x20:\x20','CONFIG_NAMES.DEFAULT','请先通过\x20`lovrabet\x20config\x20set\x20app\x20<value>`\x20配置应用\x20Code','success','2141034cACTDT','423PDOcJz','typescript','\x20\x20\x20•\x20','60qeFiMw','length','charAt','\x20-\x20模型配置文件\x20(','tableName','toUpperCase','keys','src/api','replace','log','client','format','replaceApiContent','app','../..','slice','79952xtRMMw','forEach','resolve','templates/generate-api','.ts','\x20个模型)','*\x20可以开始使用:\x20import\x20{\x20lovrabetClient\x20}\x20from\x20\x27@/api/','init-api','join','-client','11961240GgkErk','api','656NGGNGY','1677942hXnbYn'];a5_0x5e56=function(){return _0x43cd58;};return a5_0x5e56();}import a5_0x478809 from'node:path';import{fileURLToPath}from'node:url';import{readConfig}from'../utils/config.js';import{formatDataset}from'./format-dataset.js';import{TemplateReplacer}from'../utils/template-replacer.js';import{logger}from'../utils/logger.js';export async function generateApiFile(_0x467efe,_0x1b8d4a='',_0x48bae1,_0xac6723=![]){const _0x2a5752=a5_0xbbad,_0x483544=readConfig(),_0x59c78e=_0x48bae1||_0x483544?.[_0x2a5752(0xa8)];if(typeof _0x59c78e!=='string'||!_0x59c78e)throw new Error(_0x2a5752(0x95));const _0x5eab6b=_0xac6723?_0x2a5752(0x94):'\x22'+_0x59c78e+'\x22',_0xaa38d6=_0xac6723?'':'\x22'+_0x59c78e+'\x22',_0x1fd12c=_0x1b8d4a?_0x1b8d4a+'-api':_0x2a5752(0xb6),_0x36ffc5=_0x1b8d4a?_0x1b8d4a+_0x2a5752(0xb4):_0x2a5752(0xa5),_0x4f7f76=formatDataset(_0x467efe),_0x40ca65={};_0x4f7f76[_0x2a5752(0xac)](_0x235fac=>{const _0x3d4d2b=_0x2a5752,_0x3a0ebc=_0x235fac['apiFucName'][_0x3d4d2b(0xa3)](/Api$/,''),_0x486b23=_0x3a0ebc[_0x3d4d2b(0x9d)](0x0)[_0x3d4d2b(0xa0)]()+_0x3a0ebc[_0x3d4d2b(0xaa)](0x1);_0x40ca65[_0x486b23]={'tableName':_0x235fac[_0x3d4d2b(0x9f)],'datasetId':_0x235fac['code']};});const _0x9ecfef=fileURLToPath(import.meta[_0x2a5752(0xbb)]),_0x21c3a8=a5_0x478809[_0x2a5752(0xad)](a5_0x478809[_0x2a5752(0x8f)](_0x9ecfef),_0x2a5752(0xa9)),_0x3fa488=a5_0x478809[_0x2a5752(0xb3)](_0x21c3a8,_0x2a5752(0xae)),_0x18fd17=a5_0x478809[_0x2a5752(0xb3)](_0x3fa488,'api.ts.tpl'),_0x33bec3=a5_0x478809['join'](_0x3fa488,'client.ts.tpl');mkdirSync(_0x2a5752(0xa2),{'recursive':!![]});const _0x1e75cb=readFileSync(_0x18fd17,_0x2a5752(0xb9)),_0x9b40eb=TemplateReplacer[_0x2a5752(0xa7)](_0x1e75cb,_0x59c78e,_0x40ca65,Object['keys'](_0x40ca65)[0x0],_0x1fd12c,_0x5eab6b),_0x1cd61c=await a5_0x5981b9[_0x2a5752(0xa6)](_0x9b40eb,{'parser':_0x2a5752(0x99)}),_0x33aad4='src/api/'+_0x1fd12c+_0x2a5752(0xaf);writeFileSync(_0x33aad4,_0x1cd61c,{'encoding':_0x2a5752(0xb9)});const _0x3787a2=readFileSync(_0x33bec3,_0x2a5752(0xb9)),_0x1457cb=TemplateReplacer[_0x2a5752(0xa7)](_0x3787a2,_0x59c78e,_0x40ca65,Object[_0x2a5752(0xa1)](_0x40ca65)[0x0],_0x1fd12c,_0x5eab6b,_0xaa38d6),_0x43bcc5=await a5_0x5981b9['format'](_0x1457cb,{'parser':_0x2a5752(0x99)}),_0x390326=_0x2a5752(0xba)+_0x36ffc5+_0x2a5752(0xaf);writeFileSync(_0x390326,_0x43bcc5,{'encoding':'utf8'}),logger[_0x2a5752(0x96)](_0x2a5752(0xb2),'API\x20文件生成成功!'),console[_0x2a5752(0xa4)](_0x2a5752(0x91)),console[_0x2a5752(0xa4)]('\x20\x20\x20•\x20'+_0x33aad4+_0x2a5752(0x9e)+Object['keys'](_0x40ca65)[_0x2a5752(0x9c)]+_0x2a5752(0xb0)),console[_0x2a5752(0xa4)](_0x2a5752(0x9a)+_0x390326+'\x20-\x20客户端实例文件'),console['log'](_0x2a5752(0x93)+_0x5eab6b),console[_0x2a5752(0xa4)](_0x2a5752(0xb1)+_0x36ffc5+'\x27');}
1
+ function a5_0x36ff(){const _0x3a1a47=['keys','forEach','1120091hPDxZQ','string','resolve','\x20-\x20模型配置文件\x20(','573186SBJWco','\x20-\x20客户端实例文件','code','toUpperCase','384AxSIFd','apiFucName','slice','url','utf8','*\x20可以开始使用:\x20import\x20{\x20lovrabetClient\x20}\x20from\x20\x27@/api/','client','success','typescript','templates/generate-api','40860zftKcC','app','12AWhAZf','13647lBlBCS','api','8MygQhn','join','CONFIG_NAMES.DEFAULT','src/api','format','charAt','src/api/','log','-api','replaceApiContent','\x20\x20\x20•\x20','41976laBNWR','length','请先通过\x20`lovrabet\x20config\x20set\x20app\x20<value>`\x20配置应用\x20Code','replace','56OOljsS','2093826KfaJQI','.ts','dirname','../..','140290KjZYVl','*\x20已生成文件:','init-api','client.ts.tpl','API\x20文件生成成功!','-client','63EcnHIZ'];a5_0x36ff=function(){return _0x3a1a47;};return a5_0x36ff();}(function(_0x37bb58,_0x3496ea){const _0x400b47=a5_0xcbcc,_0x5050d4=_0x37bb58();while(!![]){try{const _0x54d23e=parseInt(_0x400b47(0xd1))/0x1*(-parseInt(_0x400b47(0xae))/0x2)+parseInt(_0x400b47(0xc0))/0x3+-parseInt(_0x400b47(0xd0))/0x4*(parseInt(_0x400b47(0xce))/0x5)+parseInt(_0x400b47(0xaf))/0x6+parseInt(_0x400b47(0xbc))/0x7*(-parseInt(_0x400b47(0xd3))/0x8)+-parseInt(_0x400b47(0xb9))/0x9*(-parseInt(_0x400b47(0xb3))/0xa)+-parseInt(_0x400b47(0xaa))/0xb*(-parseInt(_0x400b47(0xc4))/0xc);if(_0x54d23e===_0x3496ea)break;else _0x5050d4['push'](_0x5050d4['shift']());}catch(_0x566da4){_0x5050d4['push'](_0x5050d4['shift']());}}}(a5_0x36ff,0x2f4a7));import a5_0x59fb24 from'prettier';import{mkdirSync,writeFileSync,readFileSync}from'node:fs';import a5_0x3bd789 from'node:path';import{fileURLToPath}from'node:url';function a5_0xcbcc(_0x4cb465,_0x10b35b){const _0x36ff4e=a5_0x36ff();return a5_0xcbcc=function(_0xcbcc55,_0x1bd060){_0xcbcc55=_0xcbcc55-0xa7;let _0x152ed4=_0x36ff4e[_0xcbcc55];return _0x152ed4;},a5_0xcbcc(_0x4cb465,_0x10b35b);}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(_0x364585,_0x2e92d7='',_0x303524,_0x172be1=![]){const _0x28326f=a5_0xcbcc,_0x3446cb=readConfig(),_0x1b671a=_0x303524||_0x3446cb?.[_0x28326f(0xcf)];if(typeof _0x1b671a!==_0x28326f(0xbd)||!_0x1b671a)throw new Error(_0x28326f(0xac));const _0x587930=_0x172be1?_0x28326f(0xd5):'\x22'+_0x1b671a+'\x22',_0x3d4088=_0x172be1?'':'\x22'+_0x1b671a+'\x22',_0x59a495=_0x2e92d7?_0x2e92d7+_0x28326f(0xa7):_0x28326f(0xd2),_0x176abe=_0x2e92d7?_0x2e92d7+_0x28326f(0xb8):_0x28326f(0xca),_0x4a6c92=formatDataset(_0x364585),_0xbd509c={};_0x4a6c92[_0x28326f(0xbb)](_0x1e5022=>{const _0xbe68ea=_0x28326f,_0x1aa218=_0x1e5022[_0xbe68ea(0xc5)][_0xbe68ea(0xad)](/Api$/,''),_0x3d44b8=_0x1aa218[_0xbe68ea(0xd8)](0x0)[_0xbe68ea(0xc3)]()+_0x1aa218[_0xbe68ea(0xc6)](0x1);_0xbd509c[_0x3d44b8]={'tableName':_0x1e5022['tableName'],'datasetId':_0x1e5022[_0xbe68ea(0xc2)]};});const _0x301217=fileURLToPath(import.meta[_0x28326f(0xc7)]),_0x30b2a8=a5_0x3bd789[_0x28326f(0xbe)](a5_0x3bd789[_0x28326f(0xb1)](_0x301217),_0x28326f(0xb2)),_0x552825=a5_0x3bd789[_0x28326f(0xd4)](_0x30b2a8,_0x28326f(0xcd)),_0x266ea6=a5_0x3bd789[_0x28326f(0xd4)](_0x552825,'api.ts.tpl'),_0x56c658=a5_0x3bd789[_0x28326f(0xd4)](_0x552825,_0x28326f(0xb6));mkdirSync(_0x28326f(0xd6),{'recursive':!![]});const _0x4f4067=readFileSync(_0x266ea6,_0x28326f(0xc8)),_0x49e9a3=TemplateReplacer['replaceApiContent'](_0x4f4067,_0x1b671a,_0xbd509c,Object[_0x28326f(0xba)](_0xbd509c)[0x0],_0x59a495,_0x587930),_0x5549b8=await a5_0x59fb24['format'](_0x49e9a3,{'parser':_0x28326f(0xcc)}),_0x3ae3ad=_0x28326f(0xd9)+_0x59a495+'.ts';writeFileSync(_0x3ae3ad,_0x5549b8,{'encoding':_0x28326f(0xc8)});const _0xb1aa10=readFileSync(_0x56c658,_0x28326f(0xc8)),_0x1171b6=TemplateReplacer[_0x28326f(0xa8)](_0xb1aa10,_0x1b671a,_0xbd509c,Object[_0x28326f(0xba)](_0xbd509c)[0x0],_0x59a495,_0x587930,_0x3d4088),_0x4a45c5=await a5_0x59fb24[_0x28326f(0xd7)](_0x1171b6,{'parser':_0x28326f(0xcc)}),_0x1038f1=_0x28326f(0xd9)+_0x176abe+_0x28326f(0xb0);writeFileSync(_0x1038f1,_0x4a45c5,{'encoding':_0x28326f(0xc8)}),logger[_0x28326f(0xcb)](_0x28326f(0xb5),_0x28326f(0xb7)),console[_0x28326f(0xda)](_0x28326f(0xb4)),console['log'](_0x28326f(0xa9)+_0x3ae3ad+_0x28326f(0xbf)+Object[_0x28326f(0xba)](_0xbd509c)[_0x28326f(0xab)]+'\x20个模型)'),console[_0x28326f(0xda)](_0x28326f(0xa9)+_0x1038f1+_0x28326f(0xc1)),console['log']('*\x20API配置\x20apiConfigName\x20:\x20'+_0x587930),console['log'](_0x28326f(0xc9)+_0x176abe+'\x27');}
package/lib/api/main.js CHANGED
@@ -1 +1 @@
1
- (function(_0x5eb058,_0x175b0e){const _0x2188d4=a6_0x4073,_0x58b11f=_0x5eb058();while(!![]){try{const _0x20e15c=parseInt(_0x2188d4(0x18f))/0x1*(-parseInt(_0x2188d4(0x19a))/0x2)+parseInt(_0x2188d4(0x198))/0x3+-parseInt(_0x2188d4(0x192))/0x4*(-parseInt(_0x2188d4(0x18d))/0x5)+-parseInt(_0x2188d4(0x199))/0x6+parseInt(_0x2188d4(0x18c))/0x7+parseInt(_0x2188d4(0x190))/0x8+-parseInt(_0x2188d4(0x195))/0x9*(parseInt(_0x2188d4(0x18e))/0xa);if(_0x20e15c===_0x175b0e)break;else _0x58b11f['push'](_0x58b11f['shift']());}catch(_0x246a53){_0x58b11f['push'](_0x58b11f['shift']());}}}(a6_0x6f48,0x73ec8));import{jsx as a6_0x33f040}from'react/jsx-runtime';function a6_0x4073(_0x3209f0,_0x1f7230){const _0x6f485c=a6_0x6f48();return a6_0x4073=function(_0x40738c,_0x19a72f){_0x40738c=_0x40738c-0x18b;let _0x463e8f=_0x6f485c[_0x40738c];return _0x463e8f;},a6_0x4073(_0x3209f0,_0x1f7230);}import{render}from'ink';import{ApiPullUI}from'./api-pull-ui.js';function a6_0x6f48(){const _0x5c0d8d=['119576BzALWa','\x20\x20lovrabet\x20api\x20pull\x20[app-code]\x20\x20\x20\x20//\x20拉取并生成\x20API\x20配置文件','6414877JYiGSR','222895BqTaLP','10623480XnWvCQ','7bXuvRo','1819744lPNmjj','input','64oacbmk','pull','\x20\x20\x20\x20app-code:\x20可选的应用AppCode,不指定则使用配置的默认值','9XIGFrN','exit','log','1352622jzDhus','2113974dUHWYs'];a6_0x6f48=function(){return _0x5c0d8d;};return a6_0x6f48();}export async function apiCli(_0x269840){const _0x3730fa=a6_0x4073,_0x387b92=_0x269840[_0x3730fa(0x191)][0x1];if(_0x387b92===_0x3730fa(0x193)){const _0x55e2a2=_0x269840['input'][0x2];render(a6_0x33f040(ApiPullUI,{'appCode':_0x55e2a2}));}else console['error']('Unknown\x20api\x20command:\x20'+_0x387b92),console[_0x3730fa(0x197)]('Available\x20commands:'),console[_0x3730fa(0x197)](_0x3730fa(0x18b)),console[_0x3730fa(0x197)](_0x3730fa(0x194)),process[_0x3730fa(0x196)](0x1);}
1
+ function a6_0xb52a(){const _0x1e0092=['18njkvkg','979088lOgPwZ','2741630OkeSbV','1993971snxNTr','error','log','10FwiVwZ','\x20\x20lovrabet\x20api\x20pull\x20[app-code]\x20\x20\x20\x20//\x20拉取并生成\x20API\x20配置文件','36060497QcRRCR','input','pull','exit','78BHtpiU','111572TWvhaU','30dPAhid','\x20\x20\x20\x20app-code:\x20可选的应用AppCode,不指定则使用配置的默认值','621052qgmNij','9558384NUlJGV'];a6_0xb52a=function(){return _0x1e0092;};return a6_0xb52a();}(function(_0x1fa10f,_0x502908){const _0x547290=a6_0x394a,_0x571991=_0x1fa10f();while(!![]){try{const _0x4eb067=-parseInt(_0x547290(0x10c))/0x1+-parseInt(_0x547290(0x11b))/0x2*(parseInt(_0x547290(0x11a))/0x3)+parseInt(_0x547290(0x10f))/0x4*(parseInt(_0x547290(0x114))/0x5)+parseInt(_0x547290(0x11c))/0x6*(-parseInt(_0x547290(0x111))/0x7)+parseInt(_0x547290(0x10d))/0x8+-parseInt(_0x547290(0x10e))/0x9*(parseInt(_0x547290(0x110))/0xa)+parseInt(_0x547290(0x116))/0xb;if(_0x4eb067===_0x502908)break;else _0x571991['push'](_0x571991['shift']());}catch(_0x442f56){_0x571991['push'](_0x571991['shift']());}}}(a6_0xb52a,0xe03da));import{jsx as a6_0x4d9a97}from'react/jsx-runtime';function a6_0x394a(_0xbd75cb,_0x285058){const _0xb52a75=a6_0xb52a();return a6_0x394a=function(_0x394acd,_0x463a3c){_0x394acd=_0x394acd-0x10b;let _0x4fd36b=_0xb52a75[_0x394acd];return _0x4fd36b;},a6_0x394a(_0xbd75cb,_0x285058);}import{render}from'ink';import{ApiPullUI}from'./api-pull-ui.js';export async function apiCli(_0x425870){const _0x5040da=a6_0x394a,_0x2a8f54=_0x425870[_0x5040da(0x117)][0x1];if(_0x2a8f54===_0x5040da(0x118)){const _0xb82787=_0x425870[_0x5040da(0x117)][0x2];render(a6_0x4d9a97(ApiPullUI,{'appCode':_0xb82787}));}else console[_0x5040da(0x112)]('Unknown\x20api\x20command:\x20'+_0x2a8f54),console[_0x5040da(0x113)]('Available\x20commands:'),console[_0x5040da(0x113)](_0x5040da(0x115)),console[_0x5040da(0x113)](_0x5040da(0x10b)),process[_0x5040da(0x119)](0x1);}
@@ -1 +1 @@
1
- (function(_0x43a5e7,_0x26148a){const _0x56322f=a7_0x2365,_0x638905=_0x43a5e7();while(!![]){try{const _0x38c656=parseInt(_0x56322f(0xf9))/0x1+-parseInt(_0x56322f(0xfb))/0x2*(-parseInt(_0x56322f(0xee))/0x3)+parseInt(_0x56322f(0xed))/0x4+-parseInt(_0x56322f(0xf2))/0x5+parseInt(_0x56322f(0xd6))/0x6*(parseInt(_0x56322f(0xdd))/0x7)+-parseInt(_0x56322f(0xe8))/0x8*(-parseInt(_0x56322f(0xe3))/0x9)+parseInt(_0x56322f(0xdf))/0xa*(-parseInt(_0x56322f(0xe4))/0xb);if(_0x38c656===_0x26148a)break;else _0x638905['push'](_0x638905['shift']());}catch(_0x44c805){_0x638905['push'](_0x638905['shift']());}}}(a7_0xd9ff,0x64f9e));import{getCookie}from'../auth/get-cookie.js';import{getApiDomain}from'../constant/domain.js';import{generateApiFile}from'./generate-api-file.js';function a7_0xd9ff(){const _0x12e2c1=['success','*\x20正在从服务器拉取\x20API\x20配置...','cwd','773010KoyEsv','error','54AgAXzh','*\x20正在处理\x20','×\x20服务器返回错误:','API\x20配置拉取异常:\x20','API\x20配置拉取成功:\x20',',且无法读取错误响应内容','data','8430vZYapp','未知错误','获取数据集失败,HTTP状态码:\x20','*\x20开始生成\x20API\x20配置文件:','client','\x20\x20\x20•\x20','create-api-pull','3262npMwfq','/smartapi/dataset/getList?appCode=','7607780Vtjfet','×\x20文件前缀格式不正确。只能包含字母、数字、连字符和下划线,且必须以字母开头。','message','-client','36HnDjbz','22qdpNpd','status','.ts\x20-\x20模型配置文件','获取数据集失败,原因:登录鉴权失败,登录已过期','552208KELgRj','length','-api','chdir','json','822120GMPptb','6012nQgTqs','log','info','url','141640EybFWH','tableData','×\x20API\x20配置拉取异常:','&pageSize=999&currentPage=1'];a7_0xd9ff=function(){return _0x12e2c1;};return a7_0xd9ff();}import{logger}from'../utils/logger.js';function a7_0x2365(_0x309d2f,_0x5b7158){const _0xd9ff05=a7_0xd9ff();return a7_0x2365=function(_0x236514,_0x427a9f){_0x236514=_0x236514-0xd1;let _0x494db1=_0xd9ff05[_0x236514];return _0x494db1;},a7_0x2365(_0x309d2f,_0x5b7158);}export async function pullApiSilent(_0x3eef91,_0x4d2a0d,_0x4ab7df){const _0x4aa770=a7_0x2365;let _0x3f4d1d;try{const _0x34ced9=_0x4d2a0d?.['trim']()||'';if(_0x34ced9){const _0x143990=/^[a-zA-Z][a-zA-Z0-9_-]*$/;if(!_0x143990['test'](_0x34ced9))return console[_0x4aa770(0xfa)](_0x4aa770(0xe0)),![];}_0x4ab7df&&(_0x3f4d1d=process[_0x4aa770(0xf8)](),process[_0x4aa770(0xeb)](_0x4ab7df));console[_0x4aa770(0xef)](_0x4aa770(0xf7));const _0x5c167b=await fetch(getApiDomain()+_0x4aa770(0xde)+_0x3eef91+_0x4aa770(0xf5),{'headers':{'Cookie':getCookie()}});if(_0x5c167b['ok']){const _0x452e9b=await _0x5c167b[_0x4aa770(0xec)]();if(_0x452e9b[_0x4aa770(0xf6)]){const _0x394860=_0x34ced9?_0x34ced9+_0x4aa770(0xea):'api',_0x335e36=_0x34ced9?_0x34ced9+_0x4aa770(0xe2):_0x4aa770(0xda);return console[_0x4aa770(0xef)](_0x4aa770(0xd9)),console[_0x4aa770(0xef)](_0x4aa770(0xdb)+_0x394860+_0x4aa770(0xe6)),console[_0x4aa770(0xef)](_0x4aa770(0xdb)+_0x335e36+'.ts\x20-\x20客户端实例文件'),console[_0x4aa770(0xef)](_0x4aa770(0xfc)+_0x452e9b[_0x4aa770(0xd5)][_0x4aa770(0xf3)]['length']+'\x20个数据集...'),await generateApiFile(_0x452e9b[_0x4aa770(0xd5)][_0x4aa770(0xf3)],_0x34ced9,_0x3eef91,!![]),console['log']('√\x20API\x20配置文件生成完成'),_0x4ab7df&&logger[_0x4aa770(0xf0)](_0x4aa770(0xdc),_0x4aa770(0xd3)+_0x3eef91,{'projectPath':_0x4ab7df,'appCode':_0x3eef91,'datasetCount':_0x452e9b['data'][_0x4aa770(0xf3)][_0x4aa770(0xe9)],'filePrefix':_0x34ced9}),!![];}else return console['error'](_0x4aa770(0xd1),_0x452e9b['message']||_0x4aa770(0xd7)),_0x4ab7df&&logger[_0x4aa770(0xfa)](_0x4aa770(0xdc),'API\x20配置拉取失败:\x20'+(_0x452e9b['message']||_0x4aa770(0xd7)),{'projectPath':_0x4ab7df,'appCode':_0x3eef91}),![];}else{if(_0x5c167b[_0x4aa770(0xe5)]===0x191){const _0x3bea3e=_0x4aa770(0xe7);console[_0x4aa770(0xfa)]('×\x20'+_0x3bea3e),_0x4ab7df&&logger[_0x4aa770(0xfa)](_0x4aa770(0xdc),_0x3bea3e,{'status':_0x5c167b[_0x4aa770(0xe5)],'appCode':_0x3eef91,'url':_0x5c167b[_0x4aa770(0xf1)],'projectPath':_0x4ab7df});}else{const _0x438424=_0x4aa770(0xd8)+_0x5c167b['status'];console[_0x4aa770(0xfa)]('×\x20'+_0x438424);try{const _0x2413bd=await _0x5c167b['text']();_0x2413bd&&console[_0x4aa770(0xfa)]('×\x20错误详情:',_0x2413bd),_0x4ab7df&&logger[_0x4aa770(0xfa)](_0x4aa770(0xdc),_0x438424,{'status':_0x5c167b[_0x4aa770(0xe5)],'appCode':_0x3eef91,'url':_0x5c167b[_0x4aa770(0xf1)],'errorBody':_0x2413bd,'projectPath':_0x4ab7df});}catch(_0x3929e6){console[_0x4aa770(0xfa)]('×\x20无法读取错误响应内容'),_0x4ab7df&&logger[_0x4aa770(0xfa)](_0x4aa770(0xdc),_0x438424+_0x4aa770(0xd4),{'status':_0x5c167b[_0x4aa770(0xe5)],'appCode':_0x3eef91,'url':_0x5c167b[_0x4aa770(0xf1)],'readError':_0x3929e6 instanceof Error?_0x3929e6['message']:String(_0x3929e6),'projectPath':_0x4ab7df});}}return![];}}catch(_0x2ab089){const _0xd353b0=_0x2ab089 instanceof Error?_0x2ab089[_0x4aa770(0xe1)]:String(_0x2ab089);return console[_0x4aa770(0xfa)](_0x4aa770(0xf4),_0xd353b0),_0x4ab7df&&logger[_0x4aa770(0xfa)](_0x4aa770(0xdc),_0x4aa770(0xd2)+_0xd353b0,{'appCode':_0x3eef91,'projectPath':_0x4ab7df}),![];}finally{_0x3f4d1d&&process['chdir'](_0x3f4d1d);}}
1
+ (function(_0x54d152,_0x8f7494){const _0x1b48af=a7_0xff85,_0x763c98=_0x54d152();while(!![]){try{const _0x3b9f3c=-parseInt(_0x1b48af(0xab))/0x1+-parseInt(_0x1b48af(0xbf))/0x2*(-parseInt(_0x1b48af(0xbc))/0x3)+parseInt(_0x1b48af(0xc0))/0x4*(-parseInt(_0x1b48af(0xb9))/0x5)+parseInt(_0x1b48af(0xc8))/0x6+-parseInt(_0x1b48af(0xcb))/0x7+-parseInt(_0x1b48af(0xc1))/0x8*(parseInt(_0x1b48af(0xb1))/0x9)+parseInt(_0x1b48af(0xc5))/0xa;if(_0x3b9f3c===_0x8f7494)break;else _0x763c98['push'](_0x763c98['shift']());}catch(_0x269df6){_0x763c98['push'](_0x763c98['shift']());}}}(a7_0x1e79,0x8c0ea));function a7_0x1e79(){const _0x30e760=['*\x20正在处理\x20','url','length','27ZqEhzO','√\x20API\x20配置文件生成完成','success','chdir','tableData','×\x20文件前缀格式不正确。只能包含字母、数字、连字符和下划线,且必须以字母开头。','API\x20配置拉取异常:\x20','-api','532705MNPQNA','&pageSize=999&currentPage=1','*\x20正在从服务器拉取\x20API\x20配置...','3087VxOwZV','log','\x20\x20\x20•\x20','162DjfTSX','40vandLl','874392lbtxhM','\x20个数据集...','/smartapi/dataset/getList?appCode=','获取数据集失败,原因:登录鉴权失败,登录已过期','34335630aInTKY','data','获取数据集失败,HTTP状态码:\x20','861558ZbfmJg','message','API\x20配置拉取成功:\x20','6102516PDwGDl','×\x20错误详情:','text','create-api-pull','error','status','×\x20无法读取错误响应内容','trim','×\x20服务器返回错误:','821736ydHqhp','*\x20开始生成\x20API\x20配置文件:','×\x20API\x20配置拉取异常:'];a7_0x1e79=function(){return _0x30e760;};return a7_0x1e79();}import{getCookie}from'../auth/get-cookie.js';function a7_0xff85(_0x408fc3,_0x592111){const _0x1e7995=a7_0x1e79();return a7_0xff85=function(_0xff8560,_0xc0007b){_0xff8560=_0xff8560-0xa9;let _0x466566=_0x1e7995[_0xff8560];return _0x466566;},a7_0xff85(_0x408fc3,_0x592111);}import{getApiDomain}from'../constant/domain.js';import{generateApiFile}from'./generate-api-file.js';import{logger}from'../utils/logger.js';export async function pullApiSilent(_0xf1978,_0x2e10ee,_0x1d50fe){const _0x3c1af8=a7_0xff85;let _0x4b1786;try{const _0xe7f65d=_0x2e10ee?.[_0x3c1af8(0xa9)]()||'';if(_0xe7f65d){const _0x329dab=/^[a-zA-Z][a-zA-Z0-9_-]*$/;if(!_0x329dab['test'](_0xe7f65d))return console[_0x3c1af8(0xcf)](_0x3c1af8(0xb6)),![];}_0x1d50fe&&(_0x4b1786=process['cwd'](),process[_0x3c1af8(0xb4)](_0x1d50fe));console['log'](_0x3c1af8(0xbb));const _0x2097d6=await fetch(getApiDomain()+_0x3c1af8(0xc3)+_0xf1978+_0x3c1af8(0xba),{'headers':{'Cookie':getCookie()}});if(_0x2097d6['ok']){const _0x55e3b1=await _0x2097d6['json']();if(_0x55e3b1[_0x3c1af8(0xb3)]){const _0x4d0dc9=_0xe7f65d?_0xe7f65d+_0x3c1af8(0xb8):'api',_0x4b814e=_0xe7f65d?_0xe7f65d+'-client':'client';return console[_0x3c1af8(0xbd)](_0x3c1af8(0xac)),console[_0x3c1af8(0xbd)](_0x3c1af8(0xbe)+_0x4d0dc9+'.ts\x20-\x20模型配置文件'),console[_0x3c1af8(0xbd)](_0x3c1af8(0xbe)+_0x4b814e+'.ts\x20-\x20客户端实例文件'),console[_0x3c1af8(0xbd)](_0x3c1af8(0xae)+_0x55e3b1['data'][_0x3c1af8(0xb5)][_0x3c1af8(0xb0)]+_0x3c1af8(0xc2)),await generateApiFile(_0x55e3b1[_0x3c1af8(0xc6)]['tableData'],_0xe7f65d,_0xf1978,!![]),console[_0x3c1af8(0xbd)](_0x3c1af8(0xb2)),_0x1d50fe&&logger['info']('create-api-pull',_0x3c1af8(0xca)+_0xf1978,{'projectPath':_0x1d50fe,'appCode':_0xf1978,'datasetCount':_0x55e3b1[_0x3c1af8(0xc6)][_0x3c1af8(0xb5)]['length'],'filePrefix':_0xe7f65d}),!![];}else return console['error'](_0x3c1af8(0xaa),_0x55e3b1[_0x3c1af8(0xc9)]||'未知错误'),_0x1d50fe&&logger[_0x3c1af8(0xcf)](_0x3c1af8(0xce),'API\x20配置拉取失败:\x20'+(_0x55e3b1['message']||'未知错误'),{'projectPath':_0x1d50fe,'appCode':_0xf1978}),![];}else{if(_0x2097d6['status']===0x191){const _0x26e8de=_0x3c1af8(0xc4);console[_0x3c1af8(0xcf)]('×\x20'+_0x26e8de),_0x1d50fe&&logger[_0x3c1af8(0xcf)](_0x3c1af8(0xce),_0x26e8de,{'status':_0x2097d6['status'],'appCode':_0xf1978,'url':_0x2097d6[_0x3c1af8(0xaf)],'projectPath':_0x1d50fe});}else{const _0x2858b5=_0x3c1af8(0xc7)+_0x2097d6[_0x3c1af8(0xd0)];console[_0x3c1af8(0xcf)]('×\x20'+_0x2858b5);try{const _0x2b0f9b=await _0x2097d6[_0x3c1af8(0xcd)]();_0x2b0f9b&&console[_0x3c1af8(0xcf)](_0x3c1af8(0xcc),_0x2b0f9b),_0x1d50fe&&logger['error']('create-api-pull',_0x2858b5,{'status':_0x2097d6[_0x3c1af8(0xd0)],'appCode':_0xf1978,'url':_0x2097d6['url'],'errorBody':_0x2b0f9b,'projectPath':_0x1d50fe});}catch(_0x570100){console['error'](_0x3c1af8(0xd1)),_0x1d50fe&&logger[_0x3c1af8(0xcf)](_0x3c1af8(0xce),_0x2858b5+',且无法读取错误响应内容',{'status':_0x2097d6[_0x3c1af8(0xd0)],'appCode':_0xf1978,'url':_0x2097d6[_0x3c1af8(0xaf)],'readError':_0x570100 instanceof Error?_0x570100[_0x3c1af8(0xc9)]:String(_0x570100),'projectPath':_0x1d50fe});}}return![];}}catch(_0x51e461){const _0x50343c=_0x51e461 instanceof Error?_0x51e461['message']:String(_0x51e461);return console['error'](_0x3c1af8(0xad),_0x50343c),_0x1d50fe&&logger[_0x3c1af8(0xcf)]('create-api-pull',_0x3c1af8(0xb7)+_0x50343c,{'appCode':_0xf1978,'projectPath':_0x1d50fe}),![];}finally{_0x4b1786&&process[_0x3c1af8(0xb4)](_0x4b1786);}}
package/lib/api/pull.js CHANGED
@@ -1 +1 @@
1
- function a8_0x2165(_0x847ec,_0x2c2a31){const _0x2c1af8=a8_0x2c1a();return a8_0x2165=function(_0x216540,_0x5a153f){_0x216540=_0x216540-0xe2;let _0xd77604=_0x2c1af8[_0x216540];return _0xd77604;},a8_0x2165(_0x847ec,_0x2c2a31);}(function(_0x2b18b8,_0x19a24b){const _0x414d09=a8_0x2165,_0x38ccb3=_0x2b18b8();while(!![]){try{const _0x227d45=parseInt(_0x414d09(0xed))/0x1+parseInt(_0x414d09(0xee))/0x2*(-parseInt(_0x414d09(0x10a))/0x3)+-parseInt(_0x414d09(0x110))/0x4+-parseInt(_0x414d09(0x10f))/0x5+-parseInt(_0x414d09(0xe3))/0x6*(-parseInt(_0x414d09(0xe9))/0x7)+parseInt(_0x414d09(0xf3))/0x8*(parseInt(_0x414d09(0xf9))/0x9)+parseInt(_0x414d09(0xe6))/0xa;if(_0x227d45===_0x19a24b)break;else _0x38ccb3['push'](_0x38ccb3['shift']());}catch(_0x59f5e5){_0x38ccb3['push'](_0x38ccb3['shift']());}}}(a8_0x2c1a,0x9e8c9));import{createInterface}from'node:readline/promises';import{readConfig}from'../utils/config.js';import{getCookie}from'../auth/get-cookie.js';import{getApiDomain}from'../constant/domain.js';import{generateApiFile}from'./generate-api-file.js';function a8_0x2c1a(){const _0x5ee8c2=['\x20\x20\x20•\x20','stdout','48TaPKYZ','text','/smartapi/dataset/getList?appCode=','trim','×\x20提供的应用AppCode\x20\x22','2325765Yogcxv','770748mRpxNh','获取数据集失败,原因:登录鉴权失败,登录已过期,请使用\x20lovrabet\x20auth\x20重新登录后再尝试','url','30ZaSRXY','\x20个数据集...','*\x20开始生成\x20API\x20配置文件:','6258380aOfKqL','api','exit','600901nKXnfx','string','stdin','.ts\x20-\x20模型配置文件','335664nvhmFh','94978PeMwLO','\x22\x20无效','\x20\x20\x202.\x20配置默认值:\x20lovrabet\x20config\x20set\x20app\x20<app-code>','message','\x20\x20\x201.\x20直接指定:\x20lovrabet\x20api\x20pull\x20<app-code>','8RsHEOr','&pageSize=999&currentPage=1',',且无法读取错误响应内容','×\x20文件前缀格式不正确。只能包含字母、数字、连字符和下划线,且必须以字母开头。','log','\x1b[0m','6087276OJWXsh','data','app','×\x20无法读取错误响应内容','!\x20请输入文件前缀\x20\x1b[90m[留空表示无前缀]\x1b[0m:\x20','×\x20未提供应用AppCode,且配置中也没有默认值','success','\x1b[90m*\x20使用配置的应用AppCode:\x20','*\x20正在处理\x20','error','question','status','api-pull','tableData','.ts\x20-\x20客户端实例文件'];a8_0x2c1a=function(){return _0x5ee8c2;};return a8_0x2c1a();}import{logger}from'../utils/logger.js';export async function initApi(_0xedebcb){const _0x1e3856=a8_0x2165,_0x2c552a=readConfig(),_0x34d14e=_0xedebcb||_0x2c552a?.[_0x1e3856(0xfb)];(typeof _0x34d14e!==_0x1e3856(0xea)||!_0x34d14e)&&(_0xedebcb?console['error'](_0x1e3856(0x10e)+_0xedebcb+_0x1e3856(0xef)):(console[_0x1e3856(0x102)](_0x1e3856(0xfe)),console[_0x1e3856(0xf7)]('!\x20请使用以下方式之一:'),console['log'](_0x1e3856(0xf2)),console[_0x1e3856(0xf7)](_0x1e3856(0xf0))),process[_0x1e3856(0xe8)](0x1));_0xedebcb?console[_0x1e3856(0xf7)]('*\x20使用指定的应用AppCode:\x20'+_0x34d14e):console[_0x1e3856(0xf7)](_0x1e3856(0x100)+_0x34d14e+_0x1e3856(0xf8));const _0x4620c0=createInterface({'input':process[_0x1e3856(0xeb)],'output':process[_0x1e3856(0x109)]});let _0x287cdd;try{const _0x4e1818=await _0x4620c0[_0x1e3856(0x103)](_0x1e3856(0xfd));_0x287cdd=_0x4e1818[_0x1e3856(0x10d)]();if(_0x287cdd){const _0x5ba4be=/^[a-zA-Z][a-zA-Z0-9_-]*$/;!_0x5ba4be['test'](_0x287cdd)&&(console[_0x1e3856(0x102)](_0x1e3856(0xf6)),process[_0x1e3856(0xe8)](0x1));}}finally{_0x4620c0['close']();}console[_0x1e3856(0xf7)]('\x0a*\x20正在从服务器拉取\x20API\x20配置...');const _0x458c60=await fetch(getApiDomain()+_0x1e3856(0x10c)+_0x34d14e+_0x1e3856(0xf4),{'headers':{'Cookie':getCookie()}});if(_0x458c60['ok']){const _0x1b263d=await _0x458c60['json']();if(_0x1b263d[_0x1e3856(0xff)]){const _0x44d81a=_0x287cdd?_0x287cdd+'-api':_0x1e3856(0xe7),_0x56af27=_0x287cdd?_0x287cdd+'-client':'client';console[_0x1e3856(0xf7)](_0x1e3856(0xe5)),console[_0x1e3856(0xf7)](_0x1e3856(0x108)+_0x44d81a+_0x1e3856(0xec)),console['log'](_0x1e3856(0x108)+_0x56af27+_0x1e3856(0x107)),console[_0x1e3856(0xf7)](_0x1e3856(0x101)+_0x1b263d[_0x1e3856(0xfa)][_0x1e3856(0x106)]['length']+_0x1e3856(0xe4));const _0x3c00c7=!_0xedebcb;await generateApiFile(_0x1b263d[_0x1e3856(0xfa)][_0x1e3856(0x106)],_0x287cdd,_0x34d14e,_0x3c00c7);}}else{if(_0x458c60[_0x1e3856(0x104)]===0x191){const _0x4ab3b2=_0x1e3856(0x111);console[_0x1e3856(0x102)]('×\x20'+_0x4ab3b2),logger[_0x1e3856(0x102)](_0x1e3856(0x105),_0x4ab3b2,{'status':_0x458c60[_0x1e3856(0x104)],'appCode':_0x34d14e,'url':_0x458c60[_0x1e3856(0xe2)]});}else{const _0x39be16='获取数据集失败,HTTP状态码:\x20'+_0x458c60[_0x1e3856(0x104)];console[_0x1e3856(0x102)]('×\x20'+_0x39be16);try{const _0x2edf80=await _0x458c60[_0x1e3856(0x10b)]();_0x2edf80?(console[_0x1e3856(0x102)]('×\x20错误详情:',_0x2edf80),logger[_0x1e3856(0x102)](_0x1e3856(0x105),_0x39be16,{'status':_0x458c60['status'],'appCode':_0x34d14e,'url':_0x458c60[_0x1e3856(0xe2)],'errorBody':_0x2edf80})):logger[_0x1e3856(0x102)]('api-pull',_0x39be16,{'status':_0x458c60[_0x1e3856(0x104)],'appCode':_0x34d14e,'url':_0x458c60[_0x1e3856(0xe2)]});}catch(_0xc56da9){console[_0x1e3856(0x102)](_0x1e3856(0xfc)),logger['error']('api-pull',_0x39be16+_0x1e3856(0xf5),{'status':_0x458c60[_0x1e3856(0x104)],'appCode':_0x34d14e,'url':_0x458c60[_0x1e3856(0xe2)],'readError':_0xc56da9 instanceof Error?_0xc56da9[_0x1e3856(0xf1)]:String(_0xc56da9)});}}process['exit'](0x1);}}
1
+ (function(_0xed3893,_0x3aacbd){const _0x48a3cc=a8_0x3b95,_0x14fc2d=_0xed3893();while(!![]){try{const _0x477e3d=parseInt(_0x48a3cc(0x1cc))/0x1*(parseInt(_0x48a3cc(0x1bb))/0x2)+-parseInt(_0x48a3cc(0x1de))/0x3*(parseInt(_0x48a3cc(0x1b9))/0x4)+-parseInt(_0x48a3cc(0x1df))/0x5*(parseInt(_0x48a3cc(0x1cd))/0x6)+-parseInt(_0x48a3cc(0x1ba))/0x7+parseInt(_0x48a3cc(0x1e8))/0x8+-parseInt(_0x48a3cc(0x1e6))/0x9*(parseInt(_0x48a3cc(0x1cb))/0xa)+parseInt(_0x48a3cc(0x1c6))/0xb;if(_0x477e3d===_0x3aacbd)break;else _0x14fc2d['push'](_0x14fc2d['shift']());}catch(_0x46bb45){_0x14fc2d['push'](_0x14fc2d['shift']());}}}(a8_0x47da,0x9fbd6));function a8_0x3b95(_0x17a2f4,_0x2d4970){const _0x47da96=a8_0x47da();return a8_0x3b95=function(_0x3b95c5,_0x23ddb4){_0x3b95c5=_0x3b95c5-0x1b7;let _0xd66b19=_0x47da96[_0x3b95c5];return _0xd66b19;},a8_0x3b95(_0x17a2f4,_0x2d4970);}import{createInterface}from'node:readline/promises';import{readConfig}from'../utils/config.js';import{getCookie}from'../auth/get-cookie.js';import{getApiDomain}from'../constant/domain.js';import{generateApiFile}from'./generate-api-file.js';import{logger}from'../utils/logger.js';export async function initApi(_0x5f38da){const _0x65214=a8_0x3b95,_0x583fe1=readConfig(),_0x5a4e6=_0x5f38da||_0x583fe1?.['app'];(typeof _0x5a4e6!==_0x65214(0x1d2)||!_0x5a4e6)&&(_0x5f38da?console[_0x65214(0x1d5)](_0x65214(0x1d4)+_0x5f38da+_0x65214(0x1e4)):(console['error'](_0x65214(0x1e0)),console['log']('!\x20请使用以下方式之一:'),console['log'](_0x65214(0x1b8)),console[_0x65214(0x1e5)](_0x65214(0x1da))),process[_0x65214(0x1dd)](0x1));_0x5f38da?console[_0x65214(0x1e5)]('*\x20使用指定的应用AppCode:\x20'+_0x5a4e6):console[_0x65214(0x1e5)](_0x65214(0x1db)+_0x5a4e6+_0x65214(0x1c2));const _0x9d2cae=createInterface({'input':process['stdin'],'output':process[_0x65214(0x1d6)]});let _0x41025c;try{const _0x44a34c=await _0x9d2cae[_0x65214(0x1c4)]('!\x20请输入文件前缀\x20\x1b[90m[留空表示无前缀]\x1b[0m:\x20');_0x41025c=_0x44a34c['trim']();if(_0x41025c){const _0x112df0=/^[a-zA-Z][a-zA-Z0-9_-]*$/;!_0x112df0[_0x65214(0x1dc)](_0x41025c)&&(console[_0x65214(0x1d5)]('×\x20文件前缀格式不正确。只能包含字母、数字、连字符和下划线,且必须以字母开头。'),process[_0x65214(0x1dd)](0x1));}}finally{_0x9d2cae[_0x65214(0x1bf)]();}console[_0x65214(0x1e5)](_0x65214(0x1d7));const _0x5f2b6e=await fetch(getApiDomain()+_0x65214(0x1e2)+_0x5a4e6+_0x65214(0x1e7),{'headers':{'Cookie':getCookie()}});if(_0x5f2b6e['ok']){const _0x486659=await _0x5f2b6e[_0x65214(0x1d8)]();if(_0x486659[_0x65214(0x1bd)]){const _0x546395=_0x41025c?_0x41025c+'-api':_0x65214(0x1b7),_0x120589=_0x41025c?_0x41025c+'-client':_0x65214(0x1c3);console[_0x65214(0x1e5)](_0x65214(0x1e1)),console[_0x65214(0x1e5)]('\x20\x20\x20•\x20'+_0x546395+_0x65214(0x1c5)),console[_0x65214(0x1e5)](_0x65214(0x1c1)+_0x120589+'.ts\x20-\x20客户端实例文件'),console[_0x65214(0x1e5)](_0x65214(0x1cf)+_0x486659['data'][_0x65214(0x1c8)][_0x65214(0x1c0)]+_0x65214(0x1d0));const _0x2a5233=!_0x5f38da;await generateApiFile(_0x486659['data'][_0x65214(0x1c8)],_0x41025c,_0x5a4e6,_0x2a5233);}}else{if(_0x5f2b6e[_0x65214(0x1bc)]===0x191){const _0x240bf0=_0x65214(0x1d1);console[_0x65214(0x1d5)]('×\x20'+_0x240bf0),logger['error']('api-pull',_0x240bf0,{'status':_0x5f2b6e[_0x65214(0x1bc)],'appCode':_0x5a4e6,'url':_0x5f2b6e[_0x65214(0x1d3)]});}else{const _0x47ac0d=_0x65214(0x1e3)+_0x5f2b6e['status'];console['error']('×\x20'+_0x47ac0d);try{const _0x5047ff=await _0x5f2b6e[_0x65214(0x1be)]();_0x5047ff?(console[_0x65214(0x1d5)](_0x65214(0x1c9),_0x5047ff),logger[_0x65214(0x1d5)](_0x65214(0x1ca),_0x47ac0d,{'status':_0x5f2b6e['status'],'appCode':_0x5a4e6,'url':_0x5f2b6e[_0x65214(0x1d3)],'errorBody':_0x5047ff})):logger[_0x65214(0x1d5)]('api-pull',_0x47ac0d,{'status':_0x5f2b6e['status'],'appCode':_0x5a4e6,'url':_0x5f2b6e[_0x65214(0x1d3)]});}catch(_0x11c8de){console[_0x65214(0x1d5)](_0x65214(0x1ce)),logger['error'](_0x65214(0x1ca),_0x47ac0d+_0x65214(0x1c7),{'status':_0x5f2b6e['status'],'appCode':_0x5a4e6,'url':_0x5f2b6e[_0x65214(0x1d3)],'readError':_0x11c8de instanceof Error?_0x11c8de[_0x65214(0x1d9)]:String(_0x11c8de)});}}process[_0x65214(0x1dd)](0x1);}}function a8_0x47da(){const _0x568c88=['9054968HlHRAp','api','\x20\x20\x201.\x20直接指定:\x20lovrabet\x20api\x20pull\x20<app-code>','4BCfYVI','1744246fICkva','38EDrrWG','status','success','text','close','length','\x20\x20\x20•\x20','\x1b[0m','client','question','.ts\x20-\x20模型配置文件','26998532CKeeon',',且无法读取错误响应内容','tableData','×\x20错误详情:','api-pull','10ivqOSv','1957lleuMa','5238654xMBxEN','×\x20无法读取错误响应内容','*\x20正在处理\x20','\x20个数据集...','获取数据集失败,原因:登录鉴权失败,登录已过期,请使用\x20lovrabet\x20auth\x20重新登录后再尝试','string','url','×\x20提供的应用AppCode\x20\x22','error','stdout','\x0a*\x20正在从服务器拉取\x20API\x20配置...','json','message','\x20\x20\x202.\x20配置默认值:\x20lovrabet\x20config\x20set\x20app\x20<app-code>','\x1b[90m*\x20使用配置的应用AppCode:\x20','test','exit','2631501FPkboT','5XimusQ','×\x20未提供应用AppCode,且配置中也没有默认值','*\x20开始生成\x20API\x20配置文件:','/smartapi/dataset/getList?appCode=','获取数据集失败,HTTP状态码:\x20','\x22\x20无效','log','8727462QCnHWc','&pageSize=999&currentPage=1'];a8_0x47da=function(){return _0x568c88;};return a8_0x47da();}
@@ -1 +1 @@
1
- (function(_0x5ab5c0,_0x2c9981){const _0x3707cc=a10_0x53c7,_0xb64b1b=_0x5ab5c0();while(!![]){try{const _0x3702cc=-parseInt(_0x3707cc(0x186))/0x1+-parseInt(_0x3707cc(0x18a))/0x2+-parseInt(_0x3707cc(0x188))/0x3+-parseInt(_0x3707cc(0x18b))/0x4+-parseInt(_0x3707cc(0x18e))/0x5*(parseInt(_0x3707cc(0x187))/0x6)+parseInt(_0x3707cc(0x192))/0x7+parseInt(_0x3707cc(0x185))/0x8*(parseInt(_0x3707cc(0x184))/0x9);if(_0x3702cc===_0x2c9981)break;else _0xb64b1b['push'](_0xb64b1b['shift']());}catch(_0x4a74ed){_0xb64b1b['push'](_0xb64b1b['shift']());}}}(a10_0x49a2,0x3757c));function a10_0x53c7(_0x5b76e6,_0x54224c){const _0x49a269=a10_0x49a2();return a10_0x53c7=function(_0x53c797,_0x517bec){_0x53c797=_0x53c797-0x180;let _0x113c0d=_0x49a269[_0x53c797];return _0x113c0d;},a10_0x53c7(_0x5b76e6,_0x54224c);}import{jsx as a10_0x2aa1ca,jsxs as a10_0x474b0f}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_0x56ebea from'ink-spinner';export function AuthServer(){const _0x3b1c4b=a10_0x53c7,{exit:_0x2910ed}=useApp(),[_0x4b1ce0,_0x2a8f9d]=useState(![]),[_0x2685b5,_0x5c0dc7]=useState(!![]),[_0x5ce72a,_0x9c6301]=useState(![]),[_0x414327,_0x286ea4]=useState(![]);useEffect(()=>{const _0x340cb6=a10_0x53c7;getIsSessionValid()[_0x340cb6(0x191)](_0x2a8f9d)[_0x340cb6(0x18f)](()=>_0x5c0dc7(![]));},[]),useEffect(()=>{const _0x2349c8=a10_0x53c7;!_0x2685b5&&_0x4b1ce0&&(console[_0x2349c8(0x194)](_0x2349c8(0x183)),_0x2910ed());},[_0x2685b5,_0x4b1ce0,_0x2910ed]),useEffect(()=>{const _0x1d2d73=a10_0x53c7;_0x414327&&(console[_0x1d2d73(0x194)](_0x1d2d73(0x18d)),_0x2910ed());},[_0x414327,_0x2910ed]),useInput((_0x308db5,_0xe674d9)=>{const _0x5ea1af=a10_0x53c7;_0xe674d9[_0x5ea1af(0x189)]&&(_0x9c6301(!![]),authServer({'silent':!![]})[_0x5ea1af(0x191)](_0x5d3815=>{_0x286ea4(_0x5d3815);})),_0x308db5==='q'&&_0x2910ed();});if(_0x2685b5)return null;if(_0x4b1ce0||_0x414327)return null;return a10_0x2aa1ca(Box,{'flexDirection':_0x3b1c4b(0x193),'marginTop':0x1,'marginBottom':0x1,'children':_0x5ce72a?a10_0x474b0f(Box,{'children':[a10_0x2aa1ca(Box,{'width':'1'}),a10_0x474b0f(Text,{'color':'green','children':[a10_0x2aa1ca(a10_0x56ebea,{'type':_0x3b1c4b(0x190)}),'\x20\x20']}),a10_0x2aa1ca(Text,{'children':_0x3b1c4b(0x182)}),a10_0x2aa1ca(Text,{'color':'gray','children':_0x3b1c4b(0x18c)})]}):a10_0x474b0f(Box,{'children':[a10_0x2aa1ca(Box,{'width':'1'}),a10_0x2aa1ca(Text,{'children':'*\x20按回车开始登录。'}),a10_0x2aa1ca(Text,{'color':_0x3b1c4b(0x180),'children':_0x3b1c4b(0x181)})]})});}function a10_0x49a2(){const _0x134f54=['then','2362297ATWfTW','column','log','gray','按\x20“q”\x20退出。','正在登录...\x20','√\x20当前为有效会话,无需重新登录。','9SzTizY','7448536AmXewG','149470gpxMvx','2167974bWJAjq','29925uKXCcj','return','400040TsFxnt','1284240ocPoRH','请前往浏览器完成登录。','*\x20登录成功!','5swZPie','finally','dots'];a10_0x49a2=function(){return _0x134f54;};return a10_0x49a2();}
1
+ (function(_0x22dd85,_0x57c2ea){const _0x467b35=a10_0x1aea,_0xd2c78c=_0x22dd85();while(!![]){try{const _0x551163=-parseInt(_0x467b35(0x1d8))/0x1+-parseInt(_0x467b35(0x1cd))/0x2*(parseInt(_0x467b35(0x1d4))/0x3)+-parseInt(_0x467b35(0x1cf))/0x4*(-parseInt(_0x467b35(0x1dc))/0x5)+-parseInt(_0x467b35(0x1d2))/0x6+-parseInt(_0x467b35(0x1cb))/0x7*(-parseInt(_0x467b35(0x1dd))/0x8)+parseInt(_0x467b35(0x1d7))/0x9+parseInt(_0x467b35(0x1d9))/0xa;if(_0x551163===_0x57c2ea)break;else _0xd2c78c['push'](_0xd2c78c['shift']());}catch(_0x1774a9){_0xd2c78c['push'](_0xd2c78c['shift']());}}}(a10_0x18d5,0x71827));import{jsx as a10_0x381caf,jsxs as a10_0x524641}from'react/jsx-runtime';import{Text,Box,useInput,useApp}from'ink';function a10_0x18d5(){const _0x4d3fa7=['2615346gZWXDX','请前往浏览器完成登录。','33618PuyRDT','return','*\x20按回车开始登录。','6454503zCoQRz','708656ORsrvx','7109610aUavoZ','*\x20登录成功!','log','3290XoeNEE','492696xVIgLm','then','按\x20“q”\x20退出。','14wOIOrW','green','104FwPFwJ','dots','3896hsEcsk','finally','gray'];a10_0x18d5=function(){return _0x4d3fa7;};return a10_0x18d5();}import{useEffect,useState}from'react';import{getIsSessionValid}from'./is-session-valid.js';function a10_0x1aea(_0x2b86df,_0x58ed86){const _0x18d54a=a10_0x18d5();return a10_0x1aea=function(_0x1aea65,_0x511aee){_0x1aea65=_0x1aea65-0x1c9;let _0x1225b8=_0x18d54a[_0x1aea65];return _0x1225b8;},a10_0x1aea(_0x2b86df,_0x58ed86);}import{authServer}from'./auth-server.js';import a10_0x40a7b1 from'ink-spinner';export function AuthServer(){const _0x125299=a10_0x1aea,{exit:_0x5c3b5e}=useApp(),[_0x43fbb7,_0x1e93f1]=useState(![]),[_0x2ea19a,_0x59b35d]=useState(!![]),[_0x361c3a,_0x5bcb7d]=useState(![]),[_0x16fb6a,_0x2a1c19]=useState(![]);useEffect(()=>{const _0x9d9347=a10_0x1aea;getIsSessionValid()[_0x9d9347(0x1c9)](_0x1e93f1)[_0x9d9347(0x1d0)](()=>_0x59b35d(![]));},[]),useEffect(()=>{const _0x2c7ed7=a10_0x1aea;!_0x2ea19a&&_0x43fbb7&&(console[_0x2c7ed7(0x1db)]('√\x20当前为有效会话,无需重新登录。'),_0x5c3b5e());},[_0x2ea19a,_0x43fbb7,_0x5c3b5e]),useEffect(()=>{const _0x187640=a10_0x1aea;_0x16fb6a&&(console[_0x187640(0x1db)](_0x187640(0x1da)),_0x5c3b5e());},[_0x16fb6a,_0x5c3b5e]),useInput((_0x54d096,_0x2a5fbb)=>{const _0x2d9661=a10_0x1aea;_0x2a5fbb[_0x2d9661(0x1d5)]&&(_0x5bcb7d(!![]),authServer({'silent':!![]})[_0x2d9661(0x1c9)](_0x2d74a4=>{_0x2a1c19(_0x2d74a4);})),_0x54d096==='q'&&_0x5c3b5e();});if(_0x2ea19a)return null;if(_0x43fbb7||_0x16fb6a)return null;return a10_0x381caf(Box,{'flexDirection':'column','marginTop':0x1,'marginBottom':0x1,'children':_0x361c3a?a10_0x524641(Box,{'children':[a10_0x381caf(Box,{'width':'1'}),a10_0x524641(Text,{'color':_0x125299(0x1cc),'children':[a10_0x381caf(a10_0x40a7b1,{'type':_0x125299(0x1ce)}),'\x20\x20']}),a10_0x381caf(Text,{'children':'正在登录...\x20'}),a10_0x381caf(Text,{'color':_0x125299(0x1d1),'children':_0x125299(0x1d3)})]}):a10_0x524641(Box,{'children':[a10_0x381caf(Box,{'width':'1'}),a10_0x381caf(Text,{'children':_0x125299(0x1d6)}),a10_0x381caf(Text,{'color':_0x125299(0x1d1),'children':_0x125299(0x1ca)})]})});}
@@ -1 +1 @@
1
- const a11_0x17c8a4=a11_0x5e5f;function a11_0xc8d5(){const _0x272b27=['utf-8','catch','13145BDtCfL','isAuth','318023uqSBHg','40163332RWIkmv','session','port','Auth\x20server\x20error:','https://g.yuntooai.com/cert/lovrabet-dev.json','object','💡\x20如果浏览器没有自动打开,请手动复制上面的登录地址到浏览器中打开','⚠️\x20\x20无法自动打开浏览器','✅\x20浏览器已自动打开,请在浏览器中完成登录','createServer','7129071ANMBKD','win32','🔐\x20正在启动登录服务...','2BCMEEw','3962980cEJdWn','1772mMRAdZ','end','then','json','3594eUoycB','writeHead','listen','start\x20\x22\x22\x20\x22','address','📍\x20登录地址:','open\x20\x22','🔗\x20请手动复制登录地址到浏览器:','<!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>','127.0.0.1','7755090JpiOYj','error','/sign-in?redirect=','/api/auth/get-session','text/html;\x20charset=utf-8','user','16vWVsDi','log','xdg-open\x20\x22','10851EZLNdR','platform'];a11_0xc8d5=function(){return _0x272b27;};return a11_0xc8d5();}function a11_0x5e5f(_0x11c552,_0x17e2a9){const _0xc8d5ee=a11_0xc8d5();return a11_0x5e5f=function(_0x5e5f46,_0x4dfd90){_0x5e5f46=_0x5e5f46-0x7a;let _0x4b1b0c=_0xc8d5ee[_0x5e5f46];return _0x4b1b0c;},a11_0x5e5f(_0x11c552,_0x17e2a9);}(function(_0x5d108d,_0x1bd16e){const _0x329c00=a11_0x5e5f,_0x25b8fb=_0x5d108d();while(!![]){try{const _0x5d25ed=parseInt(_0x329c00(0x89))/0x1*(parseInt(_0x329c00(0x97))/0x2)+-parseInt(_0x329c00(0x83))/0x3*(-parseInt(_0x329c00(0x99))/0x4)+-parseInt(_0x329c00(0x87))/0x5*(parseInt(_0x329c00(0x9d))/0x6)+-parseInt(_0x329c00(0x7a))/0x7+-parseInt(_0x329c00(0x80))/0x8*(parseInt(_0x329c00(0x94))/0x9)+-parseInt(_0x329c00(0x98))/0xa+parseInt(_0x329c00(0x8a))/0xb;if(_0x5d25ed===_0x1bd16e)break;else _0x25b8fb['push'](_0x25b8fb['shift']());}catch(_0x3694e3){_0x25b8fb['push'](_0x25b8fb['shift']());}}}(a11_0xc8d5,0xddc65));import{writeFileSync}from'node:fs';import a11_0x251a5c 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(_0x1dcdb9){const _0x5e570e=a11_0x5e5f,_0x5d3a3d=_0x1dcdb9?.['silent']||![];if(await getIsSessionValid())return!![];const _0x43d5b1=await(await fetch(_0x5e570e(0x8e)))[_0x5e570e(0x9c)]();return new Promise(async(_0x11957f,_0x59e629)=>{const _0x5453c3=_0x5e570e;let _0x1c4336=0x0;const _0x3b4098=a11_0x251a5c[_0x5453c3(0x93)](_0x43d5b1,async(_0x276af1,_0x53c79a)=>{const _0x2ab5ec=_0x5453c3,_0x5c0481=getUserDomain(),_0x118384=_0x276af1['headers']['cookie']||'',_0x10d504=await fetch(_0x5c0481+_0x2ab5ec(0x7d),{'headers':{'cookie':_0x118384}})[_0x2ab5ec(0x9b)](_0x2d612c=>_0x2d612c[_0x2ab5ec(0x9c)]()),_0x516639=_0x10d504&&_0x10d504[_0x2ab5ec(0x8b)]&&_0x10d504[_0x2ab5ec(0x7f)];if(_0x516639){writeFileSync(cookieFile,_0x118384,_0x2ab5ec(0x85)),_0x11957f(!![]);const _0x383443=_0x2ab5ec(0xa5);_0x53c79a[_0x2ab5ec(0x9e)](0xc8,{'Content-Type':_0x2ab5ec(0x7e)}),_0x53c79a['end'](_0x383443),_0x3b4098['close']();}else{const _0x364511=''+encodeURIComponent('https://dev.lovrabet.com:'+_0x1c4336);_0x53c79a['writeHead'](0x12e,{'location':_0x5c0481+_0x2ab5ec(0x7c)+_0x364511}),_0x53c79a[_0x2ab5ec(0x9a)]();return;}});_0x3b4098[_0x5453c3(0x9f)](0x0,_0x5453c3(0xa6),()=>{const _0x12d601=_0x5453c3,_0x36632c=_0x3b4098[_0x12d601(0xa1)]();_0x1c4336=typeof _0x36632c===_0x12d601(0x8f)&&_0x36632c?_0x36632c[_0x12d601(0x8c)]:Number(_0x36632c);const _0x42da47='https://dev.lovrabet.com:'+_0x1c4336;!_0x5d3a3d&&(console[_0x12d601(0x81)](_0x12d601(0x96)),console[_0x12d601(0x81)](_0x12d601(0xa2),_0x42da47),console[_0x12d601(0x81)]('🌐\x20正在尝试自动打开浏览器...'),console[_0x12d601(0x81)](''),console[_0x12d601(0x81)](_0x12d601(0x90)),console[_0x12d601(0x81)]('')),openInBrowser(_0x42da47)['then'](_0x3a69a2=>{const _0x4fc4fb=_0x12d601;!_0x5d3a3d&&(_0x3a69a2?console['log'](_0x4fc4fb(0x92)):(console['log'](_0x4fc4fb(0x91)),console[_0x4fc4fb(0x81)](_0x4fc4fb(0xa4),_0x42da47)),console[_0x4fc4fb(0x81)](''));})[_0x12d601(0x86)](()=>{const _0x130385=_0x12d601;!_0x5d3a3d&&(console['log'](_0x130385(0x91)),console[_0x130385(0x81)](_0x130385(0xa4),_0x42da47),console[_0x130385(0x81)](''));});}),_0x3b4098['on'](_0x5453c3(0x7b),_0x305a3b=>{const _0x528ec2=_0x5453c3;!_0x5d3a3d&&console[_0x528ec2(0x7b)](_0x528ec2(0x8d),_0x305a3b),_0x59e629(_0x305a3b);});});}function openInBrowser(_0x37b3a7){return new Promise(_0x255de0=>{const _0x22ebf6=a11_0x5e5f,_0x2e4d84=process[_0x22ebf6(0x84)];let _0x55bf5c;if(_0x2e4d84===_0x22ebf6(0x95))_0x55bf5c=_0x22ebf6(0xa0)+_0x37b3a7+'\x22';else _0x2e4d84==='darwin'?_0x55bf5c=_0x22ebf6(0xa3)+_0x37b3a7+'\x22':_0x55bf5c=_0x22ebf6(0x82)+_0x37b3a7+'\x22';exec(_0x55bf5c,_0x2dd76d=>{_0x2dd76d?_0x255de0(![]):_0x255de0(!![]);});});}if(import.meta['main']){const isAuth=await authServer();console['log'](a11_0x17c8a4(0x88),isAuth);}
1
+ const a11_0x18ef3b=a11_0x57db;(function(_0x2a8deb,_0xbb8459){const _0x403d64=a11_0x57db,_0xf4cf39=_0x2a8deb();while(!![]){try{const _0x3dbbfb=-parseInt(_0x403d64(0x1c3))/0x1+-parseInt(_0x403d64(0x1de))/0x2+parseInt(_0x403d64(0x1ba))/0x3+parseInt(_0x403d64(0x1c5))/0x4*(-parseInt(_0x403d64(0x1ce))/0x5)+-parseInt(_0x403d64(0x1dc))/0x6+parseInt(_0x403d64(0x1db))/0x7+-parseInt(_0x403d64(0x1b7))/0x8*(-parseInt(_0x403d64(0x1c0))/0x9);if(_0x3dbbfb===_0xbb8459)break;else _0xf4cf39['push'](_0xf4cf39['shift']());}catch(_0x3b2491){_0xf4cf39['push'](_0xf4cf39['shift']());}}}(a11_0x49df,0x1f243));import{writeFileSync}from'node:fs';import a11_0x133e29 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';function a11_0x49df(){const _0x5e8274=['platform','📍\x20登录地址:','isAuth','🔐\x20正在启动登录服务...','session','end','log','close','✅\x20浏览器已自动打开,请在浏览器中完成登录','then','cookie','/sign-in?redirect=','1039038bexwBx','1208022GKGEtV','utf-8','64580XggJeo','port','open\x20\x22','main','🌐\x20正在尝试自动打开浏览器...','8oHscIf','text/html;\x20charset=utf-8','start\x20\x22\x22\x20\x22','741534FmDXRe','createServer','win32','listen','error','🔗\x20请手动复制登录地址到浏览器:','1748124yswIYN','xdg-open\x20\x22','⚠️\x20\x20无法自动打开浏览器','33076wgavnn','user','40WAhcdr','writeHead','https://g.yuntooai.com/cert/lovrabet-dev.json','https://dev.lovrabet.com:','catch','object','/api/auth/get-session','silent','json','97795rmlgIf'];a11_0x49df=function(){return _0x5e8274;};return a11_0x49df();}export async function authServer(_0x16ae66){const _0x4d5ef3=a11_0x57db,_0x169e6a=_0x16ae66?.[_0x4d5ef3(0x1cc)]||![];if(await getIsSessionValid())return!![];const _0x48fb6c=await(await fetch(_0x4d5ef3(0x1c7)))['json']();return new Promise(async(_0x3db01e,_0x194690)=>{const _0x8ab0fd=_0x4d5ef3;let _0x7a15c=0x0;const _0xde13d5=a11_0x133e29[_0x8ab0fd(0x1bb)](_0x48fb6c,async(_0x4ca4e3,_0x2ff6b)=>{const _0x17ee71=_0x8ab0fd,_0x1b30c7=getUserDomain(),_0x221098=_0x4ca4e3['headers'][_0x17ee71(0x1d9)]||'',_0x5c5dd9=await fetch(_0x1b30c7+_0x17ee71(0x1cb),{'headers':{'cookie':_0x221098}})[_0x17ee71(0x1d8)](_0x57353d=>_0x57353d[_0x17ee71(0x1cd)]()),_0x140c0b=_0x5c5dd9&&_0x5c5dd9[_0x17ee71(0x1d3)]&&_0x5c5dd9[_0x17ee71(0x1c4)];if(_0x140c0b){writeFileSync(cookieFile,_0x221098,_0x17ee71(0x1dd)),_0x3db01e(!![]);const _0x2ab0a7='<!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>';_0x2ff6b['writeHead'](0xc8,{'Content-Type':_0x17ee71(0x1b8)}),_0x2ff6b[_0x17ee71(0x1d4)](_0x2ab0a7),_0xde13d5[_0x17ee71(0x1d6)]();}else{const _0xef40d2=''+encodeURIComponent(_0x17ee71(0x1c8)+_0x7a15c);_0x2ff6b[_0x17ee71(0x1c6)](0x12e,{'location':_0x1b30c7+_0x17ee71(0x1da)+_0xef40d2}),_0x2ff6b['end']();return;}});_0xde13d5[_0x8ab0fd(0x1bd)](0x0,'127.0.0.1',()=>{const _0x369c5c=_0x8ab0fd,_0x3287bc=_0xde13d5['address']();_0x7a15c=typeof _0x3287bc===_0x369c5c(0x1ca)&&_0x3287bc?_0x3287bc[_0x369c5c(0x1df)]:Number(_0x3287bc);const _0x1b9357=_0x369c5c(0x1c8)+_0x7a15c;!_0x169e6a&&(console['log'](_0x369c5c(0x1d2)),console[_0x369c5c(0x1d5)](_0x369c5c(0x1d0),_0x1b9357),console[_0x369c5c(0x1d5)](_0x369c5c(0x1b6)),console[_0x369c5c(0x1d5)](''),console['log']('💡\x20如果浏览器没有自动打开,请手动复制上面的登录地址到浏览器中打开'),console[_0x369c5c(0x1d5)]('')),openInBrowser(_0x1b9357)[_0x369c5c(0x1d8)](_0x397817=>{const _0x21207e=_0x369c5c;!_0x169e6a&&(_0x397817?console['log'](_0x21207e(0x1d7)):(console[_0x21207e(0x1d5)]('⚠️\x20\x20无法自动打开浏览器'),console['log'](_0x21207e(0x1bf),_0x1b9357)),console[_0x21207e(0x1d5)](''));})[_0x369c5c(0x1c9)](()=>{const _0x4533b9=_0x369c5c;!_0x169e6a&&(console[_0x4533b9(0x1d5)](_0x4533b9(0x1c2)),console[_0x4533b9(0x1d5)](_0x4533b9(0x1bf),_0x1b9357),console[_0x4533b9(0x1d5)](''));});}),_0xde13d5['on']('error',_0x1960ed=>{const _0x42a0ef=_0x8ab0fd;!_0x169e6a&&console[_0x42a0ef(0x1be)]('Auth\x20server\x20error:',_0x1960ed),_0x194690(_0x1960ed);});});}function a11_0x57db(_0x15de38,_0x17eb04){const _0x49df40=a11_0x49df();return a11_0x57db=function(_0x57db37,_0x53a183){_0x57db37=_0x57db37-0x1b6;let _0x58ba58=_0x49df40[_0x57db37];return _0x58ba58;},a11_0x57db(_0x15de38,_0x17eb04);}function openInBrowser(_0x2dc874){return new Promise(_0x57a123=>{const _0x12dceb=a11_0x57db,_0x39b977=process[_0x12dceb(0x1cf)];let _0x42d2cc;if(_0x39b977===_0x12dceb(0x1bc))_0x42d2cc=_0x12dceb(0x1b9)+_0x2dc874+'\x22';else _0x39b977==='darwin'?_0x42d2cc=_0x12dceb(0x1e0)+_0x2dc874+'\x22':_0x42d2cc=_0x12dceb(0x1c1)+_0x2dc874+'\x22';exec(_0x42d2cc,_0x2bf08c=>{_0x2bf08c?_0x57a123(![]):_0x57a123(!![]);});});}if(import.meta[a11_0x18ef3b(0x1e1)]){const isAuth=await authServer();console[a11_0x18ef3b(0x1d5)](a11_0x18ef3b(0x1d1),isAuth);}
@@ -1 +1 @@
1
- const a12_0x38d5a4=a12_0x17d5;function a12_0x2d7b(){const _0xe458c7=['73XraYLY','/.lovrabet','31586772cMCgnM','188CtzmyT','430dMjtxd','7156824oGQXyG','/cookie','21278zmhrus','11aTkdQX','508109pQIJyJ','9oEAFPF','8491420zORKgS','10278orCnpk','75144cqYTrM'];a12_0x2d7b=function(){return _0xe458c7;};return a12_0x2d7b();}(function(_0x20ca57,_0x3d71ed){const _0x5b3fc1=a12_0x17d5,_0x4e880a=_0x20ca57();while(!![]){try{const _0x32ed7e=-parseInt(_0x5b3fc1(0x1c9))/0x1*(parseInt(_0x5b3fc1(0x1c2))/0x2)+parseInt(_0x5b3fc1(0x1c8))/0x3*(-parseInt(_0x5b3fc1(0x1cc))/0x4)+parseInt(_0x5b3fc1(0x1bf))/0x5*(parseInt(_0x5b3fc1(0x1c7))/0x6)+-parseInt(_0x5b3fc1(0x1c4))/0x7+-parseInt(_0x5b3fc1(0x1c0))/0x8*(parseInt(_0x5b3fc1(0x1c5))/0x9)+parseInt(_0x5b3fc1(0x1c6))/0xa*(parseInt(_0x5b3fc1(0x1c3))/0xb)+parseInt(_0x5b3fc1(0x1cb))/0xc;if(_0x32ed7e===_0x3d71ed)break;else _0x4e880a['push'](_0x4e880a['shift']());}catch(_0x42cd57){_0x4e880a['push'](_0x4e880a['shift']());}}}(a12_0x2d7b,0xacc0e));import{mkdirSync}from'node:fs';import{homedir}from'node:os';export const configDir=homedir()+a12_0x38d5a4(0x1ca);export const cookieFile=configDir+a12_0x38d5a4(0x1c1);function a12_0x17d5(_0x57aa8d,_0x4909d1){const _0x2d7b41=a12_0x2d7b();return a12_0x17d5=function(_0x17d56b,_0x17767f){_0x17d56b=_0x17d56b-0x1bf;let _0x8800a8=_0x2d7b41[_0x17d56b];return _0x8800a8;},a12_0x17d5(_0x57aa8d,_0x4909d1);}mkdirSync(configDir,{'recursive':!![]});
1
+ const a12_0x519dc4=a12_0x3233;(function(_0x1a7d9b,_0x235217){const _0x3f17c9=a12_0x3233,_0x20df86=_0x1a7d9b();while(!![]){try{const _0x36599b=-parseInt(_0x3f17c9(0x14c))/0x1*(parseInt(_0x3f17c9(0x14e))/0x2)+parseInt(_0x3f17c9(0x14f))/0x3*(parseInt(_0x3f17c9(0x149))/0x4)+parseInt(_0x3f17c9(0x154))/0x5+parseInt(_0x3f17c9(0x14b))/0x6+parseInt(_0x3f17c9(0x14a))/0x7*(parseInt(_0x3f17c9(0x152))/0x8)+-parseInt(_0x3f17c9(0x151))/0x9*(parseInt(_0x3f17c9(0x153))/0xa)+parseInt(_0x3f17c9(0x150))/0xb;if(_0x36599b===_0x235217)break;else _0x20df86['push'](_0x20df86['shift']());}catch(_0x90b128){_0x20df86['push'](_0x20df86['shift']());}}}(a12_0x34fc,0x2a2f0));import{mkdirSync}from'node:fs';function a12_0x3233(_0x8c9300,_0x54dfc1){const _0x34fc24=a12_0x34fc();return a12_0x3233=function(_0x3233b7,_0x5277d){_0x3233b7=_0x3233b7-0x149;let _0x2f6b68=_0x34fc24[_0x3233b7];return _0x2f6b68;},a12_0x3233(_0x8c9300,_0x54dfc1);}import{homedir}from'node:os';export const configDir=homedir()+a12_0x519dc4(0x14d);export const cookieFile=configDir+'/cookie';function a12_0x34fc(){const _0x5c628c=['364556lFVBru','1657299aaptQT','225366tuLLWP','162650BmhORf','/.lovrabet','2uDRnZB','6sLtGXF','1039841hScmGa','70461mhsxAa','8DuwnTS','360WRfhIu','330755IIxXuk'];a12_0x34fc=function(){return _0x5c628c;};return a12_0x34fc();}mkdirSync(configDir,{'recursive':!![]});
@@ -1 +1 @@
1
- (function(_0x3fe8a7,_0xbf9ba9){var _0x35840b=a13_0x1a9c,_0x48aa34=_0x3fe8a7();while(!![]){try{var _0x200baa=-parseInt(_0x35840b(0x7c))/0x1+parseInt(_0x35840b(0x7a))/0x2+-parseInt(_0x35840b(0x77))/0x3*(parseInt(_0x35840b(0x75))/0x4)+parseInt(_0x35840b(0x79))/0x5*(parseInt(_0x35840b(0x78))/0x6)+parseInt(_0x35840b(0x73))/0x7+parseInt(_0x35840b(0x72))/0x8*(parseInt(_0x35840b(0x74))/0x9)+-parseInt(_0x35840b(0x7b))/0xa;if(_0x200baa===_0xbf9ba9)break;else _0x48aa34['push'](_0x48aa34['shift']());}catch(_0x4f630e){_0x48aa34['push'](_0x48aa34['shift']());}}}(a13_0x1978,0x289b0));import{readFileSync}from'node:fs';import{cookieFile}from'./constant.js';function a13_0x1978(){var _0x59ff5a=['172436PTJmOj','3021810NGLDzz','61903kPyraV','64PVwLDW','1705459avzOJw','69291gAOmie','60NSGSDM','utf-8','23799tQlhiT','288OooVOv','26870czexkI'];a13_0x1978=function(){return _0x59ff5a;};return a13_0x1978();}function a13_0x1a9c(_0x101406,_0x378f8c){var _0x197863=a13_0x1978();return a13_0x1a9c=function(_0x1a9ce8,_0x15ba0e){_0x1a9ce8=_0x1a9ce8-0x72;var _0x5626e7=_0x197863[_0x1a9ce8];return _0x5626e7;},a13_0x1a9c(_0x101406,_0x378f8c);}export function getCookie(){var _0x4cf10a=a13_0x1a9c;try{return readFileSync(cookieFile,_0x4cf10a(0x76));}catch{}return'';}
1
+ (function(_0x63b59d,_0x23563d){var _0x509dba=a13_0x19df,_0x4618b1=_0x63b59d();while(!![]){try{var _0x5ada45=parseInt(_0x509dba(0x91))/0x1*(parseInt(_0x509dba(0x94))/0x2)+-parseInt(_0x509dba(0x97))/0x3+parseInt(_0x509dba(0x93))/0x4+parseInt(_0x509dba(0x96))/0x5+-parseInt(_0x509dba(0x95))/0x6*(parseInt(_0x509dba(0x99))/0x7)+parseInt(_0x509dba(0x98))/0x8+-parseInt(_0x509dba(0x92))/0x9;if(_0x5ada45===_0x23563d)break;else _0x4618b1['push'](_0x4618b1['shift']());}catch(_0x1e3803){_0x4618b1['push'](_0x4618b1['shift']());}}}(a13_0x32aa,0x540d0));function a13_0x19df(_0x5aaa1f,_0x132be0){var _0x32aa0c=a13_0x32aa();return a13_0x19df=function(_0x19df7f,_0x274fc7){_0x19df7f=_0x19df7f-0x90;var _0x3f500f=_0x32aa0c[_0x19df7f];return _0x3f500f;},a13_0x19df(_0x5aaa1f,_0x132be0);}function a13_0x32aa(){var _0x11f286=['1064374vVEtNm','2727054XBoHVZ','1687210DQHizt','1461813VvAWSL','3839208NQgHxQ','7lrqIjC','utf-8','1somGqj','6016815nGktnH','2420228oekDiM'];a13_0x32aa=function(){return _0x11f286;};return a13_0x32aa();}import{readFileSync}from'node:fs';import{cookieFile}from'./constant.js';export function getCookie(){var _0x335478=a13_0x19df;try{return readFileSync(cookieFile,_0x335478(0x90));}catch{}return'';}
@@ -1 +1 @@
1
- (function(_0x3c910a,_0x5d712b){const _0x9d7acc=a14_0x2d0a,_0x31e09a=_0x3c910a();while(!![]){try{const _0x2c2c47=parseInt(_0x9d7acc(0x150))/0x1*(-parseInt(_0x9d7acc(0x151))/0x2)+-parseInt(_0x9d7acc(0x14f))/0x3*(parseInt(_0x9d7acc(0x14e))/0x4)+parseInt(_0x9d7acc(0x14a))/0x5*(parseInt(_0x9d7acc(0x148))/0x6)+parseInt(_0x9d7acc(0x152))/0x7+parseInt(_0x9d7acc(0x147))/0x8+parseInt(_0x9d7acc(0x153))/0x9+parseInt(_0x9d7acc(0x14d))/0xa*(-parseInt(_0x9d7acc(0x14c))/0xb);if(_0x2c2c47===_0x5d712b)break;else _0x31e09a['push'](_0x31e09a['shift']());}catch(_0x25ac2e){_0x31e09a['push'](_0x31e09a['shift']());}}}(a14_0x10e7,0x590ef));import{existsSync,readFileSync}from'node:fs';function a14_0x10e7(){const _0x35a8fa=['3245jpZYsJ','utf-8','506968Pxsypr','290YaeTic','32xRYHhU','18474ydmyPd','867dctZEl','4zIwJWK','4588773bTssPI','3650283rNOAme','user','json','5306400JXnvBF','258qGVUnZ','/api/auth/get-session'];a14_0x10e7=function(){return _0x35a8fa;};return a14_0x10e7();}import{getUserDomain}from'../constant/domain.js';function a14_0x2d0a(_0x40e2ab,_0x19da7a){const _0x10e70f=a14_0x10e7();return a14_0x2d0a=function(_0x2d0a77,_0x113c08){_0x2d0a77=_0x2d0a77-0x147;let _0x57b49a=_0x10e70f[_0x2d0a77];return _0x57b49a;},a14_0x2d0a(_0x40e2ab,_0x19da7a);}import{cookieFile}from'./constant.js';export async function getIsSessionValid(){const _0xe79b3f=a14_0x2d0a;try{if(!existsSync(cookieFile))return![];const _0xfd20dc=readFileSync(cookieFile,_0xe79b3f(0x14b)),_0xdd6d8b=await fetch(getUserDomain()+_0xe79b3f(0x149),{'headers':{'cookie':_0xfd20dc}})['then'](_0x51443f=>_0x51443f[_0xe79b3f(0x155)]());return _0xdd6d8b&&_0xdd6d8b['session']&&_0xdd6d8b[_0xe79b3f(0x154)];}catch{}return![];}
1
+ (function(_0xe9ee19,_0xb79dc0){const _0x44b7c9=a14_0x4b87,_0xf2a583=_0xe9ee19();while(!![]){try{const _0x3a57b2=-parseInt(_0x44b7c9(0x9e))/0x1*(-parseInt(_0x44b7c9(0xa3))/0x2)+-parseInt(_0x44b7c9(0x9c))/0x3+parseInt(_0x44b7c9(0x99))/0x4*(parseInt(_0x44b7c9(0x9f))/0x5)+-parseInt(_0x44b7c9(0xa2))/0x6+parseInt(_0x44b7c9(0xa5))/0x7*(parseInt(_0x44b7c9(0xa6))/0x8)+-parseInt(_0x44b7c9(0xa4))/0x9+parseInt(_0x44b7c9(0x9a))/0xa;if(_0x3a57b2===_0xb79dc0)break;else _0xf2a583['push'](_0xf2a583['shift']());}catch(_0x355ad7){_0xf2a583['push'](_0xf2a583['shift']());}}}(a14_0x98dc,0x36d85));function a14_0x98dc(){const _0x40d065=['utf-8','650451sOWIQm','/api/auth/get-session','140677MTaWDG','149885tZavje','then','json','1238406IalQZW','4cPBRHe','2540466ozLzgo','7cKTHDE','2780312zTZKzc','user','4lmjBPF','2712670EFuxfP'];a14_0x98dc=function(){return _0x40d065;};return a14_0x98dc();}function a14_0x4b87(_0x2da929,_0x23f62e){const _0x98dcd3=a14_0x98dc();return a14_0x4b87=function(_0x4b87c7,_0x1bbae0){_0x4b87c7=_0x4b87c7-0x98;let _0x1c9544=_0x98dcd3[_0x4b87c7];return _0x1c9544;},a14_0x4b87(_0x2da929,_0x23f62e);}import{existsSync,readFileSync}from'node:fs';import{getUserDomain}from'../constant/domain.js';import{cookieFile}from'./constant.js';export async function getIsSessionValid(){const _0x4671a8=a14_0x4b87;try{if(!existsSync(cookieFile))return![];const _0x484821=readFileSync(cookieFile,_0x4671a8(0x9b)),_0x4b265c=await fetch(getUserDomain()+_0x4671a8(0x9d),{'headers':{'cookie':_0x484821}})[_0x4671a8(0xa0)](_0x15341c=>_0x15341c[_0x4671a8(0xa1)]());return _0x4b265c&&_0x4b265c['session']&&_0x4b265c[_0x4671a8(0x98)];}catch{}return![];}
@@ -1 +1 @@
1
- function a15_0x41c7(){var _0x1822a7=['14sdUjpA','1949272IXFqwG','312088QomnSn','3589200HwMVDW','!\x20当前未登录','log','54Exgcfp','35590sTHUjV','8404920SKvkGg','✓\x20已退出登录','348785nNMrNn','370308MTKqzp','35goTPpv'];a15_0x41c7=function(){return _0x1822a7;};return a15_0x41c7();}(function(_0x15cb77,_0x43e7c2){var _0x4d235a=a15_0xf49c,_0x58104f=_0x15cb77();while(!![]){try{var _0x4b00fd=-parseInt(_0x4d235a(0xad))/0x1+-parseInt(_0x4d235a(0xaa))/0x2*(-parseInt(_0x4d235a(0xa9))/0x3)+-parseInt(_0x4d235a(0xa5))/0x4+-parseInt(_0x4d235a(0xa2))/0x5*(-parseInt(_0x4d235a(0xa1))/0x6)+-parseInt(_0x4d235a(0xa3))/0x7*(parseInt(_0x4d235a(0xa4))/0x8)+-parseInt(_0x4d235a(0xa6))/0x9+parseInt(_0x4d235a(0xab))/0xa;if(_0x4b00fd===_0x43e7c2)break;else _0x58104f['push'](_0x58104f['shift']());}catch(_0x12527a){_0x58104f['push'](_0x58104f['shift']());}}}(a15_0x41c7,0x4455f));import{unlinkSync,existsSync}from'node:fs';import{cookieFile}from'./constant.js';function a15_0xf49c(_0x7d6077,_0x440858){var _0x41c7a4=a15_0x41c7();return a15_0xf49c=function(_0xf49c68,_0xd0b5ed){_0xf49c68=_0xf49c68-0xa1;var _0x2d2337=_0x41c7a4[_0xf49c68];return _0x2d2337;},a15_0xf49c(_0x7d6077,_0x440858);}export function logout(){var _0x5d31dc=a15_0xf49c;existsSync(cookieFile)?(unlinkSync(cookieFile),console[_0x5d31dc(0xa8)](_0x5d31dc(0xac))):console[_0x5d31dc(0xa8)](_0x5d31dc(0xa7));}
1
+ (function(_0x247b1f,_0x1a2881){var _0x219399=a15_0x397f,_0x17e2d6=_0x247b1f();while(!![]){try{var _0x2216fe=parseInt(_0x219399(0x164))/0x1+-parseInt(_0x219399(0x163))/0x2+-parseInt(_0x219399(0x160))/0x3*(parseInt(_0x219399(0x166))/0x4)+parseInt(_0x219399(0x162))/0x5*(parseInt(_0x219399(0x167))/0x6)+parseInt(_0x219399(0x169))/0x7+parseInt(_0x219399(0x168))/0x8+-parseInt(_0x219399(0x161))/0x9;if(_0x2216fe===_0x1a2881)break;else _0x17e2d6['push'](_0x17e2d6['shift']());}catch(_0x23f077){_0x17e2d6['push'](_0x17e2d6['shift']());}}}(a15_0x45ef,0x367df));function a15_0x397f(_0x7446ef,_0x404be1){var _0x45efd1=a15_0x45ef();return a15_0x397f=function(_0x397f1e,_0xfd688){_0x397f1e=_0x397f1e-0x15e;var _0x5f39d8=_0x45efd1[_0x397f1e];return _0x5f39d8;},a15_0x397f(_0x7446ef,_0x404be1);}import{unlinkSync,existsSync}from'node:fs';import{cookieFile}from'./constant.js';function a15_0x45ef(){var _0x3fee31=['!\x20当前未登录','log','9QjQjlI','5582493sxSNpL','65ZJYvme','73944erODUq','409228rMFztG','✓\x20已退出登录','159616ANiREM','85038BEYBNM','44448YhRfMT','2807889sqbUyl'];a15_0x45ef=function(){return _0x3fee31;};return a15_0x45ef();}export function logout(){var _0x211103=a15_0x397f;existsSync(cookieFile)?(unlinkSync(cookieFile),console[_0x211103(0x15f)](_0x211103(0x165))):console[_0x211103(0x15f)](_0x211103(0x15e));}
package/lib/cli.js CHANGED
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- const a16_0x260a2e=a16_0x101c;(function(_0x536154,_0x47b41a){const _0x556b95=a16_0x101c,_0x35e6d6=_0x536154();while(!![]){try{const _0x26e5ac=-parseInt(_0x556b95(0xda))/0x1*(-parseInt(_0x556b95(0xde))/0x2)+-parseInt(_0x556b95(0xdd))/0x3+parseInt(_0x556b95(0xd5))/0x4*(parseInt(_0x556b95(0xc4))/0x5)+-parseInt(_0x556b95(0xd2))/0x6*(parseInt(_0x556b95(0xe1))/0x7)+-parseInt(_0x556b95(0xdb))/0x8+parseInt(_0x556b95(0xce))/0x9+-parseInt(_0x556b95(0xcc))/0xa*(-parseInt(_0x556b95(0xd7))/0xb);if(_0x26e5ac===_0x47b41a)break;else _0x35e6d6['push'](_0x35e6d6['shift']());}catch(_0x55e576){_0x35e6d6['push'](_0x35e6d6['shift']());}}}(a16_0x117f,0x2c777));import{jsx as a16_0x4c93de}from'react/jsx-runtime';import a16_0x613f57 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';function a16_0x117f(){const _0x20b53a=['474ElLrqR','string','watch','3256tCONpE','\x0a\x09Usage\x0a\x09\x20\x20$\x20lovrabet\x0a\x0a\x09Examples\x0a\x09\x20\x20$\x20lovrabet\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20登录认证\x0a\x09\x20\x20$\x20lovrabet\x20logout\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20退出登录\x0a\x09\x20\x20$\x20lovrabet\x20create\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20创建一个项目\x0a\x09\x20\x20$\x20lovrabet\x20add\x20page\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20添加一个页面\x0a\x09\x20\x20$\x20lovrabet\x20start\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20启动项目\x0a\x09\x20\x20$\x20lovrabet\x20build\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20构建项目\x0a\x09\x20\x20$\x20lovrabet\x20preview\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20预览项目\x0a\x09\x20\x20$\x20lovrabet\x20preview\x20--watch\x20\x20\x20\x20\x20\x20//\x20监听文件变化并自动构建预览\x0a\x09\x20\x20$\x20lovrabet\x20config\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20项目配置\x0a\x09\x20\x20$\x20lovrabet\x20api\x20pull\x20[app-code]\x20\x20//\x20拉取并生成\x20API\x20配置文件\x0a\x09\x20\x20$\x20lovrabet\x20logs\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20查看日志\x0a\x09\x20\x20$\x20lovrabet\x20logs\x20--clear\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20清空日志\x0a','501083ZliInZ','boolean','input','2GIwhfO','883512ICbUbU','auth','31398LwbamY','275336yEpAdg','error','exit','28854bmhEfd','1090KeWVTR','page','flags','setLogPath','logs','clear','logout','start','10wOFhLj','preview','1173033UodHAw','cwd','all','build'];a16_0x117f=function(){return _0x20b53a;};return a16_0x117f();}function a16_0x101c(_0x6f4864,_0x14b8f4){const _0x117f36=a16_0x117f();return a16_0x101c=function(_0x101c4a,_0x2ca18c){_0x101c4a=_0x101c4a-0xc4;let _0x370093=_0x117f36[_0x101c4a];return _0x370093;},a16_0x101c(_0x6f4864,_0x14b8f4);}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';import{showLogs,clearLogs}from'./cmd/logs.js';const cli=a16_0x613f57(a16_0x260a2e(0xd6),{'importMeta':import.meta,'flags':{'name':{'type':a16_0x260a2e(0xd3)},'clear':{'type':a16_0x260a2e(0xd8)}}});await run();async function run(){const _0x59174f=a16_0x260a2e,_0x22a4c7=cli[_0x59174f(0xd9)][0x0];switch(_0x22a4c7){case'create':{const _0x2bea91=cli['input'][0x1]?.['trim']();render(a16_0x4c93de(CreateApp,{'projectCode':_0x2bea91}));break;}case'add':{cli[_0x59174f(0xd9)][0x1]===_0x59174f(0xc5)&&(logger[_0x59174f(0xc7)](process[_0x59174f(0xcf)]()),render(a16_0x4c93de(AddPage,{})));break;}case _0x59174f(0xcb):{try{logger[_0x59174f(0xc7)](process[_0x59174f(0xcf)]()),await runStart();}catch(_0x96c6da){console['error'](_0x96c6da),process[_0x59174f(0xe0)](0x1);}break;}case _0x59174f(0xd1):{try{logger['setLogPath'](process[_0x59174f(0xcf)]()),await runBuild();}catch(_0x4e8b77){console[_0x59174f(0xdf)](_0x4e8b77),process[_0x59174f(0xe0)](0x1);}break;}case _0x59174f(0xcd):{const _0x49d89b=cli['flags'][_0x59174f(0xd4)];logger[_0x59174f(0xc7)](process[_0x59174f(0xcf)]());if(_0x49d89b)try{await Promise[_0x59174f(0xd0)]([runBuildWatch(),runPreview()]);}catch(_0x29fd69){console[_0x59174f(0xdf)](_0x29fd69),process[_0x59174f(0xe0)](0x1);}else try{await runPreview();}catch(_0x55ea31){console[_0x59174f(0xdf)](_0x55ea31),process['exit'](0x1);}break;}case'config':{render(a16_0x4c93de(Config,{'cli':cli}));break;}case'api':{await apiCli(cli);break;}case _0x59174f(0xdc):{render(a16_0x4c93de(AuthServer,{}));break;}case _0x59174f(0xca):{logout();break;}case _0x59174f(0xc8):{cli[_0x59174f(0xc6)][_0x59174f(0xc9)]?clearLogs():showLogs();break;}default:render(a16_0x4c93de(Help,{}));break;}}
2
+ const a16_0x566b3c=a16_0x26b0;(function(_0x4b6973,_0x5dc9ec){const _0xa4e0c4=a16_0x26b0,_0x4129a1=_0x4b6973();while(!![]){try{const _0x9336e=-parseInt(_0xa4e0c4(0x10d))/0x1*(-parseInt(_0xa4e0c4(0x10e))/0x2)+-parseInt(_0xa4e0c4(0x112))/0x3*(-parseInt(_0xa4e0c4(0xfe))/0x4)+parseInt(_0xa4e0c4(0x117))/0x5+parseInt(_0xa4e0c4(0x114))/0x6*(parseInt(_0xa4e0c4(0x116))/0x7)+parseInt(_0xa4e0c4(0x10c))/0x8+parseInt(_0xa4e0c4(0x105))/0x9*(-parseInt(_0xa4e0c4(0x115))/0xa)+-parseInt(_0xa4e0c4(0xff))/0xb;if(_0x9336e===_0x5dc9ec)break;else _0x4129a1['push'](_0x4129a1['shift']());}catch(_0x17dbea){_0x4129a1['push'](_0x4129a1['shift']());}}}(a16_0x394f,0x79ccd));import{jsx as a16_0x5ae57c}from'react/jsx-runtime';import a16_0x531ecf from'meow';import{render}from'ink';function a16_0x26b0(_0xd89298,_0x99b3fe){const _0x394f7d=a16_0x394f();return a16_0x26b0=function(_0x26b0ce,_0x43df38){_0x26b0ce=_0x26b0ce-0xf8;let _0x29cfe6=_0x394f7d[_0x26b0ce];return _0x29cfe6;},a16_0x26b0(_0xd89298,_0x99b3fe);}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_0x394f(){const _0x39e4c6=['2336490DZIEbX','input','watch','flags','create','build','boolean','string','432836AXwSXd','14598584baHHix','\x0a\x09Usage\x0a\x09\x20\x20$\x20lovrabet\x0a\x0a\x09Examples\x0a\x09\x20\x20$\x20lovrabet\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20登录认证\x0a\x09\x20\x20$\x20lovrabet\x20logout\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20退出登录\x0a\x09\x20\x20$\x20lovrabet\x20create\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20创建一个项目\x0a\x09\x20\x20$\x20lovrabet\x20add\x20page\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20添加一个页面\x0a\x09\x20\x20$\x20lovrabet\x20start\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20启动项目\x0a\x09\x20\x20$\x20lovrabet\x20build\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20构建项目\x0a\x09\x20\x20$\x20lovrabet\x20preview\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20预览项目\x0a\x09\x20\x20$\x20lovrabet\x20preview\x20--watch\x20\x20\x20\x20\x20\x20//\x20监听文件变化并自动构建预览\x0a\x09\x20\x20$\x20lovrabet\x20config\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20项目配置\x0a\x09\x20\x20$\x20lovrabet\x20api\x20pull\x20[app-code]\x20\x20//\x20拉取并生成\x20API\x20配置文件\x0a\x09\x20\x20$\x20lovrabet\x20logs\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20查看日志\x0a\x09\x20\x20$\x20lovrabet\x20logs\x20--clear\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20清空日志\x0a','logs','logout','exit','api','1629ptNHTk','error','trim','config','preview','add','setLogPath','4493840VDlhNB','7ibPIem','133618Ceahyy','start','cwd','page','6oZQoJP','auth','1666962mJgQxv','24460dTWLAD','14JNrprV'];a16_0x394f=function(){return _0x39e4c6;};return a16_0x394f();}import{showLogs,clearLogs}from'./cmd/logs.js';const cli=a16_0x531ecf(a16_0x566b3c(0x100),{'importMeta':import.meta,'flags':{'name':{'type':a16_0x566b3c(0xfd)},'clear':{'type':a16_0x566b3c(0xfc)}}});await run();async function run(){const _0xdddb9c=a16_0x566b3c,_0x40c5c0=cli['input'][0x0];switch(_0x40c5c0){case _0xdddb9c(0xfa):{const _0x54c8bd=cli[_0xdddb9c(0x118)][0x1]?.[_0xdddb9c(0x107)]();render(a16_0x5ae57c(CreateApp,{'projectCode':_0x54c8bd}));break;}case _0xdddb9c(0x10a):{cli['input'][0x1]===_0xdddb9c(0x111)&&(logger[_0xdddb9c(0x10b)](process[_0xdddb9c(0x110)]()),render(a16_0x5ae57c(AddPage,{})));break;}case _0xdddb9c(0x10f):{try{logger['setLogPath'](process[_0xdddb9c(0x110)]()),await runStart();}catch(_0xeb2242){console[_0xdddb9c(0x106)](_0xeb2242),process['exit'](0x1);}break;}case _0xdddb9c(0xfb):{try{logger[_0xdddb9c(0x10b)](process[_0xdddb9c(0x110)]()),await runBuild();}catch(_0x4b5eef){console[_0xdddb9c(0x106)](_0x4b5eef),process[_0xdddb9c(0x103)](0x1);}break;}case _0xdddb9c(0x109):{const _0x1367c4=cli[_0xdddb9c(0xf9)][_0xdddb9c(0xf8)];logger[_0xdddb9c(0x10b)](process[_0xdddb9c(0x110)]());if(_0x1367c4)try{await Promise['all']([runBuildWatch(),runPreview()]);}catch(_0x58eaf4){console[_0xdddb9c(0x106)](_0x58eaf4),process['exit'](0x1);}else try{await runPreview();}catch(_0x477e63){console[_0xdddb9c(0x106)](_0x477e63),process[_0xdddb9c(0x103)](0x1);}break;}case _0xdddb9c(0x108):{render(a16_0x5ae57c(Config,{'cli':cli}));break;}case _0xdddb9c(0x104):{await apiCli(cli);break;}case _0xdddb9c(0x113):{render(a16_0x5ae57c(AuthServer,{}));break;}case _0xdddb9c(0x102):{logout();break;}case _0xdddb9c(0x101):{cli[_0xdddb9c(0xf9)]['clear']?clearLogs():showLogs();break;}default:render(a16_0x5ae57c(Help,{}));break;}}
@@ -1 +1 @@
1
- (function(_0x2c7fea,_0x1209fa){const _0x137f5d=a17_0x1385,_0x3865dc=_0x2c7fea();while(!![]){try{const _0x44fd70=parseInt(_0x137f5d(0xe6))/0x1+parseInt(_0x137f5d(0xe2))/0x2+parseInt(_0x137f5d(0xd9))/0x3*(-parseInt(_0x137f5d(0xd8))/0x4)+-parseInt(_0x137f5d(0xdb))/0x5*(-parseInt(_0x137f5d(0xdf))/0x6)+-parseInt(_0x137f5d(0xe0))/0x7+parseInt(_0x137f5d(0xe7))/0x8+-parseInt(_0x137f5d(0xe8))/0x9*(parseInt(_0x137f5d(0xd7))/0xa);if(_0x44fd70===_0x1209fa)break;else _0x3865dc['push'](_0x3865dc['shift']());}catch(_0x5cfa3c){_0x3865dc['push'](_0x3865dc['shift']());}}}(a17_0xcd73,0x7260f));function a17_0xcd73(){const _0x554a0b=['.bin','env','node_modules','4498510UrwlIL','92RrGgtm','110799bjxefW','PATH','212965PNThwz','cwd','close','inherit','42suqxpg','759073fJywPW','build','1140358FzFTDG','--watch','error','vite','267637CAagNR','5922216STpNBe','9CXvjGA'];a17_0xcd73=function(){return _0x554a0b;};return a17_0xcd73();}function a17_0x1385(_0xd2d2e5,_0x429137){const _0xcd7389=a17_0xcd73();return a17_0x1385=function(_0x1385cf,_0x30e509){_0x1385cf=_0x1385cf-0xd6;let _0x3bd34f=_0xcd7389[_0x1385cf];return _0x3bd34f;},a17_0x1385(_0xd2d2e5,_0x429137);}import{spawn}from'node:child_process';import{delimiter,join}from'node:path';export function runBuildWatch(){return new Promise((_0x4c6f78,_0x30a968)=>{const _0x1c4271=a17_0x1385,_0xcec0fd=spawn(_0x1c4271(0xe5),[_0x1c4271(0xe1),_0x1c4271(0xe3)],{'stdio':_0x1c4271(0xde),'shell':!![],'env':{...process[_0x1c4271(0xea)],'PATH':''+join(process[_0x1c4271(0xdc)](),_0x1c4271(0xd6),_0x1c4271(0xe9))+delimiter+process[_0x1c4271(0xea)][_0x1c4271(0xda)]}});_0xcec0fd['on'](_0x1c4271(0xdd),_0x56d75d=>{if(_0x56d75d===0x0||_0x56d75d===null)_0x4c6f78();else _0x30a968(new Error('npm\x20run\x20build\x20exited\x20with\x20code\x20'+_0x56d75d));}),_0xcec0fd['on'](_0x1c4271(0xe4),_0x30a968);});}
1
+ (function(_0x2991f3,_0xd9b8e2){const _0x344a09=a17_0x1280,_0x2c7034=_0x2991f3();while(!![]){try{const _0x3bbbc4=parseInt(_0x344a09(0x13f))/0x1+parseInt(_0x344a09(0x13e))/0x2*(parseInt(_0x344a09(0x144))/0x3)+parseInt(_0x344a09(0x149))/0x4+-parseInt(_0x344a09(0x14d))/0x5*(parseInt(_0x344a09(0x145))/0x6)+-parseInt(_0x344a09(0x14a))/0x7+parseInt(_0x344a09(0x146))/0x8*(parseInt(_0x344a09(0x142))/0x9)+-parseInt(_0x344a09(0x150))/0xa*(parseInt(_0x344a09(0x14f))/0xb);if(_0x3bbbc4===_0xd9b8e2)break;else _0x2c7034['push'](_0x2c7034['shift']());}catch(_0x31e2fe){_0x2c7034['push'](_0x2c7034['shift']());}}}(a17_0x2171,0x3f62d));import{spawn}from'node:child_process';function a17_0x1280(_0x322b6c,_0x475273){const _0x217130=a17_0x2171();return a17_0x1280=function(_0x1280e0,_0x3675e8){_0x1280e0=_0x1280e0-0x13d;let _0x526de0=_0x217130[_0x1280e0];return _0x526de0;},a17_0x1280(_0x322b6c,_0x475273);}function a17_0x2171(){const _0x3ef310=['2XRaZfd','483626DWfVyv','node_modules','env','18wsoNtv','close','243249DmCYHs','1812rbVVUo','1453048hCwsNr','PATH','inherit','306484voXmgI','1762936quBTWo','build','--watch','3235cTrrLV','vite','15521SzsIwi','2110zCYNkg','.bin'];a17_0x2171=function(){return _0x3ef310;};return a17_0x2171();}import{delimiter,join}from'node:path';export function runBuildWatch(){return new Promise((_0xa0104f,_0x2e17ca)=>{const _0x2ca32e=a17_0x1280,_0x486aba=spawn(_0x2ca32e(0x14e),[_0x2ca32e(0x14b),_0x2ca32e(0x14c)],{'stdio':_0x2ca32e(0x148),'shell':!![],'env':{...process[_0x2ca32e(0x141)],'PATH':''+join(process['cwd'](),_0x2ca32e(0x140),_0x2ca32e(0x13d))+delimiter+process[_0x2ca32e(0x141)][_0x2ca32e(0x147)]}});_0x486aba['on'](_0x2ca32e(0x143),_0x46a67e=>{if(_0x46a67e===0x0||_0x46a67e===null)_0xa0104f();else _0x2e17ca(new Error('npm\x20run\x20build\x20exited\x20with\x20code\x20'+_0x46a67e));}),_0x486aba['on']('error',_0x2e17ca);});}