@lovrabet/cli 1.2.5-beta.1 → 1.2.5-beta.2

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 (66) 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-doc-ui.js +1 -1
  5. package/lib/api/api-doc.js +1 -1
  6. package/lib/api/api-pull-ui.js +1 -1
  7. package/lib/api/fetch-model-list.js +1 -1
  8. package/lib/api/generate-api-file.js +1 -1
  9. package/lib/api/main.js +1 -1
  10. package/lib/api/pull-silent.js +1 -1
  11. package/lib/app-menu/app-menu-sync-ui.js +1 -1
  12. package/lib/app-menu/create-menu.js +1 -1
  13. package/lib/app-menu/get-local-pages.js +1 -1
  14. package/lib/app-menu/get-online-menu-list.js +1 -1
  15. package/lib/app-menu/use-get-online-menu-list.js +1 -1
  16. package/lib/app-menu/utils.js +1 -1
  17. package/lib/app-menu/valid-url.js +1 -1
  18. package/lib/app-menu-update-cdn/current-content.js +1 -1
  19. package/lib/app-menu-update-cdn/input-cdn-asset.js +1 -1
  20. package/lib/app-menu-update-cdn/main.js +1 -1
  21. package/lib/app-menu-update-cdn/update-menu-cdn-url.js +1 -1
  22. package/lib/auth/auth-server-ui.js +1 -1
  23. package/lib/auth/auth-server.js +1 -1
  24. package/lib/auth/constant.js +1 -1
  25. package/lib/auth/get-cookie.js +1 -1
  26. package/lib/auth/is-session-valid.js +1 -1
  27. package/lib/auth/logout.js +1 -1
  28. package/lib/cli.js +1 -1
  29. package/lib/cmd/build-watch.js +1 -1
  30. package/lib/cmd/build.js +1 -1
  31. package/lib/cmd/logs.js +1 -1
  32. package/lib/cmd/preview.js +1 -1
  33. package/lib/cmd/start.js +1 -1
  34. package/lib/config/config-help.js +1 -1
  35. package/lib/config/main.js +1 -1
  36. package/lib/constant/domain.js +1 -1
  37. package/lib/constant/env.js +1 -1
  38. package/lib/create-app/enhanced-guided-create.js +1 -1
  39. package/lib/create-app/format-elapsed.js +1 -1
  40. package/lib/create-app/main.js +1 -1
  41. package/lib/create-app/task-finished.js +1 -1
  42. package/lib/create-app/task-loading.js +1 -1
  43. package/lib/create-app/task-running.js +1 -1
  44. package/lib/create-app/task-time.js +1 -1
  45. package/lib/create-app/use-copy-project-template.js +1 -1
  46. package/lib/create-app/use-format-code.js +1 -1
  47. package/lib/create-app/use-install-dependencies.js +1 -1
  48. package/lib/help.js +1 -1
  49. package/lib/init/main.js +1 -1
  50. package/lib/mcp/claude.js +1 -1
  51. package/lib/mcp/cursor.js +1 -1
  52. package/lib/mcp/main.js +1 -1
  53. package/lib/skills/main.js +1 -1
  54. package/lib/utils/check-sdk-version.js +1 -1
  55. package/lib/utils/config.js +1 -1
  56. package/lib/utils/copy-directory.js +1 -1
  57. package/lib/utils/http-client.js +1 -1
  58. package/lib/utils/logger.js +1 -1
  59. package/lib/utils/router-updater.js +1 -1
  60. package/lib/utils/sleep.js +1 -1
  61. package/lib/utils/template-replacer.js +1 -1
  62. package/package.json +1 -1
  63. package/templates/skills/.claude/skills/lovrabet/SKILL.md +1 -0
  64. package/templates/skills/.cursor/commands/lovrabet.md +1 -0
  65. package/templates/skills/.shared/guides/07-backend-function/guide.md +679 -0
  66. package/templates/skills/.windsurf/workflows/lovrabet.md +1 -0
@@ -1 +1 @@
1
- (function(_0x31c52c,_0x442cb2){const _0x15f8ef=a0_0x2d5f,_0x568e80=_0x31c52c();while(!![]){try{const _0x1c78ea=-parseInt(_0x15f8ef(0x99))/0x1*(parseInt(_0x15f8ef(0x91))/0x2)+parseInt(_0x15f8ef(0x90))/0x3+-parseInt(_0x15f8ef(0xa4))/0x4+-parseInt(_0x15f8ef(0xa1))/0x5+parseInt(_0x15f8ef(0x8e))/0x6+-parseInt(_0x15f8ef(0x8a))/0x7+-parseInt(_0x15f8ef(0xa7))/0x8*(-parseInt(_0x15f8ef(0x98))/0x9);if(_0x1c78ea===_0x442cb2)break;else _0x568e80['push'](_0x568e80['shift']());}catch(_0x481d04){_0x568e80['push'](_0x568e80['shift']());}}}(a0_0x39c9,0x350ce));function a0_0x2d5f(_0x1bfd4b,_0x57ee8b){_0x1bfd4b=_0x1bfd4b-0x89;const _0x39c9f6=a0_0x39c9();let _0x2d5f2a=_0x39c9f6[_0x1bfd4b];return _0x2d5f2a;}import{jsx as a0_0x43e64f,jsxs as a0_0x1813ed}from'react/jsx-runtime';import{useState}from'react';import{Text,Box,useInput}from'ink';import a0_0x1711aa from'node:fs';export function InputProjectCode(_0x19aba4){const _0xd80925=a0_0x2d5f,{onSubmit:_0x23143f,pagePath:_0x604d00}=_0x19aba4,[_0x9767fc,_0x567b1c]=useState(''),[_0x280996,_0xf78fd]=useState(''),_0x1b9289=_0xd80925(0x9b);function _0x17be88(_0x4ed20f){const _0x4bb894=_0xd80925;if(_0x4ed20f[_0x4bb894(0x8f)]>0x64)return{'valid':![],'message':_0x4bb894(0xa0)};if(_0x4ed20f[_0x4bb894(0x97)]('/')||_0x4ed20f[_0x4bb894(0xa5)]('/'))return{'valid':![],'message':_0x4bb894(0xa2)};if(_0x4ed20f[_0x4bb894(0x8c)]('//'))return{'valid':![],'message':'路径不能包含连续的\x20/'};const _0x150475=_0x4ed20f[_0x4bb894(0x93)]('/');for(const _0x3dc8de of _0x150475){if(!_0x3dc8de)continue;const _0x5360cf=/^[A-Za-z0-9][A-Za-z0-9_-]*$/;if(!_0x5360cf[_0x4bb894(0x8d)](_0x3dc8de))return{'valid':![],'message':_0x4bb894(0x96)};}return{'valid':!![]};}return useInput((_0x28e5e8,_0xd6db44)=>{const _0x2e6e8e=_0xd80925;if(_0xd6db44['return']){const _0x201156=_0x9767fc['trim']()||_0x1b9289;if(_0x280996)return;const _0x371598=_0x604d00+'/'+_0x201156;if(a0_0x1711aa[_0x2e6e8e(0x89)](_0x371598)){_0xf78fd(_0x2e6e8e(0x9f)+_0x201156+'\x20已存在,请使用其他路径');return;}_0x23143f(_0x201156),_0x567b1c(''),_0xf78fd('');}else _0xd6db44['backspace']||_0xd6db44[_0x2e6e8e(0x9e)]?_0x567b1c(_0x3795a5=>{const _0x4e9885=_0x2e6e8e,_0xde7b=_0x3795a5[_0x4e9885(0x9a)](0x0,-0x1),{valid:_0x3a956b,message:_0x5752e6}=_0x17be88(_0xde7b);return _0xf78fd(_0x3a956b?'':_0x5752e6||_0x4e9885(0xa6)),_0xde7b;}):_0x567b1c(_0x44cd94=>{const _0x293d26=_0x44cd94+_0x28e5e8,{valid:_0x29d66f,message:_0x5a617b}=_0x17be88(_0x293d26);return _0xf78fd(_0x29d66f?'':_0x5a617b||'页面路径不合法'),_0x293d26;});}),a0_0x1813ed(Box,{'flexDirection':_0xd80925(0x9c),'children':[a0_0x1813ed(Box,{'children':[a0_0x43e64f(Text,{'color':'gray','children':_0xd80925(0x92)}),a0_0x43e64f(Text,{'children':_0xd80925(0x8b)}),_0x9767fc?a0_0x43e64f(Text,{'color':_0xd80925(0x95),'children':_0x9767fc}):a0_0x43e64f(Text,{'color':_0xd80925(0xa3),'children':_0x1b9289}),_0x280996&&a0_0x1813ed(Text,{'color':_0xd80925(0x94),'children':[_0xd80925(0x9d),_0x280996]})]}),!_0x280996&&!_0x9767fc&&a0_0x43e64f(Box,{'children':a0_0x43e64f(Text,{'color':'gray','children':'\x20直接回车确认,或输入自定义路由地址'})})]});}function a0_0x39c9(){const _0x4070e5=['existsSync','1129065auZnLX','页面路由地址:\x20','includes','test','1034004OvOkwq','length','1001460VlkUci','10MvFaep','\x20Step2:\x20','split','red','green','路径中的每个段只能以字母或数字开头,且只包含字母、数字、-\x20和\x20_','startsWith','531ySBRND','67323rXASfi','slice','my-page','column','\x20←\x20','delete','页面路径\x20','页面路径长度不能超过\x20100\x20个字符','1069240BrnBJx','路径不能以\x20/\x20开头或结尾','gray','631592BaWjNZ','endsWith','页面路径不合法','78752qjFerQ'];a0_0x39c9=function(){return _0x4070e5;};return a0_0x39c9();}
1
+ (function(_0x4c12fd,_0x4a801e){const _0x4e965d=a0_0x4014,_0x3c6c24=_0x4c12fd();while(!![]){try{const _0x71b5c4=parseInt(_0x4e965d(0x165))/0x1+parseInt(_0x4e965d(0x16e))/0x2+parseInt(_0x4e965d(0x173))/0x3*(-parseInt(_0x4e965d(0x17d))/0x4)+-parseInt(_0x4e965d(0x17a))/0x5*(parseInt(_0x4e965d(0x169))/0x6)+-parseInt(_0x4e965d(0x182))/0x7+parseInt(_0x4e965d(0x174))/0x8*(-parseInt(_0x4e965d(0x167))/0x9)+parseInt(_0x4e965d(0x177))/0xa*(parseInt(_0x4e965d(0x16d))/0xb);if(_0x71b5c4===_0x4a801e)break;else _0x3c6c24['push'](_0x3c6c24['shift']());}catch(_0x3d5ef5){_0x3c6c24['push'](_0x3c6c24['shift']());}}}(a0_0x5ab6,0x32380));import{jsx as a0_0x428ee5,jsxs as a0_0x541140}from'react/jsx-runtime';import{useState}from'react';function a0_0x5ab6(){const _0x1fe983=['312xYCGPT','21456uNKKmU','gray','endsWith','90sZjrOt','页面路由地址:\x20','my-page','15GNJhHi','length','split','7688cirkYl','路径中的每个段只能以字母或数字开头,且只包含字母、数字、-\x20和\x20_','column','\x20直接回车确认,或输入自定义路由地址','test','2513525BTptjY','\x20已存在,请使用其他路径','includes','33545tBjgVU','slice','702cAFSDE','return','132420YeZaqy','trim','路径不能包含连续的\x20/','页面路径长度不能超过\x20100\x20个字符','952853KxBNex','453826UHzTaH','路径不能以\x20/\x20开头或结尾','\x20←\x20','delete','existsSync'];a0_0x5ab6=function(){return _0x1fe983;};return a0_0x5ab6();}import{Text,Box,useInput}from'ink';function a0_0x4014(_0x1e0566,_0xb9ac86){_0x1e0566=_0x1e0566-0x165;const _0x5ab6c3=a0_0x5ab6();let _0x40146d=_0x5ab6c3[_0x1e0566];return _0x40146d;}import a0_0x473d9d from'node:fs';export function InputProjectCode(_0x269a7f){const _0x36feb5=a0_0x4014,{onSubmit:_0x4a3cff,pagePath:_0x4e5795}=_0x269a7f,[_0x557ce4,_0x435034]=useState(''),[_0x11e8e0,_0x40d0ce]=useState(''),_0x5ee12e=_0x36feb5(0x179);function _0x5031e0(_0x349d46){const _0x4883c1=_0x36feb5;if(_0x349d46[_0x4883c1(0x17b)]>0x64)return{'valid':![],'message':_0x4883c1(0x16c)};if(_0x349d46['startsWith']('/')||_0x349d46[_0x4883c1(0x176)]('/'))return{'valid':![],'message':_0x4883c1(0x16f)};if(_0x349d46[_0x4883c1(0x184)]('//'))return{'valid':![],'message':_0x4883c1(0x16b)};const _0x36fc23=_0x349d46[_0x4883c1(0x17c)]('/');for(const _0x3f35db of _0x36fc23){if(!_0x3f35db)continue;const _0x2aa444=/^[A-Za-z0-9][A-Za-z0-9_-]*$/;if(!_0x2aa444[_0x4883c1(0x181)](_0x3f35db))return{'valid':![],'message':_0x4883c1(0x17e)};}return{'valid':!![]};}return useInput((_0x739f4a,_0x51d0e3)=>{const _0x43890c=_0x36feb5;if(_0x51d0e3[_0x43890c(0x168)]){const _0x39ee8e=_0x557ce4[_0x43890c(0x16a)]()||_0x5ee12e;if(_0x11e8e0)return;const _0xbc2c23=_0x4e5795+'/'+_0x39ee8e;if(a0_0x473d9d[_0x43890c(0x172)](_0xbc2c23)){_0x40d0ce('页面路径\x20'+_0x39ee8e+_0x43890c(0x183));return;}_0x4a3cff(_0x39ee8e),_0x435034(''),_0x40d0ce('');}else _0x51d0e3['backspace']||_0x51d0e3[_0x43890c(0x171)]?_0x435034(_0x124b2a=>{const _0x57f531=_0x43890c,_0x217502=_0x124b2a[_0x57f531(0x166)](0x0,-0x1),{valid:_0x5b29bd,message:_0x6fb04c}=_0x5031e0(_0x217502);return _0x40d0ce(_0x5b29bd?'':_0x6fb04c||'页面路径不合法'),_0x217502;}):_0x435034(_0x16a4f6=>{const _0x4866cf=_0x16a4f6+_0x739f4a,{valid:_0x33b6cb,message:_0x1cf68f}=_0x5031e0(_0x4866cf);return _0x40d0ce(_0x33b6cb?'':_0x1cf68f||'页面路径不合法'),_0x4866cf;});}),a0_0x541140(Box,{'flexDirection':_0x36feb5(0x17f),'children':[a0_0x541140(Box,{'children':[a0_0x428ee5(Text,{'color':_0x36feb5(0x175),'children':'\x20Step2:\x20'}),a0_0x428ee5(Text,{'children':_0x36feb5(0x178)}),_0x557ce4?a0_0x428ee5(Text,{'color':'green','children':_0x557ce4}):a0_0x428ee5(Text,{'color':'gray','children':_0x5ee12e}),_0x11e8e0&&a0_0x541140(Text,{'color':'red','children':[_0x36feb5(0x170),_0x11e8e0]})]}),!_0x11e8e0&&!_0x557ce4&&a0_0x428ee5(Box,{'children':a0_0x428ee5(Text,{'color':_0x36feb5(0x175),'children':_0x36feb5(0x180)})})]});}
@@ -1 +1 @@
1
- const a1_0x37681e=a1_0x3eab;(function(_0x52b606,_0x164e64){const _0x3be899=a1_0x3eab,_0x2381bc=_0x52b606();while(!![]){try{const _0xa8df6=parseInt(_0x3be899(0x8b))/0x1*(parseInt(_0x3be899(0x9a))/0x2)+parseInt(_0x3be899(0x82))/0x3*(parseInt(_0x3be899(0x8e))/0x4)+-parseInt(_0x3be899(0xa7))/0x5+-parseInt(_0x3be899(0x91))/0x6*(parseInt(_0x3be899(0x8f))/0x7)+parseInt(_0x3be899(0x8a))/0x8*(-parseInt(_0x3be899(0x88))/0x9)+parseInt(_0x3be899(0xa0))/0xa*(-parseInt(_0x3be899(0x98))/0xb)+parseInt(_0x3be899(0x96))/0xc;if(_0xa8df6===_0x164e64)break;else _0x2381bc['push'](_0x2381bc['shift']());}catch(_0x1c677a){_0x2381bc['push'](_0x2381bc['shift']());}}}(a1_0x5b0a,0x45dce));function a1_0x3eab(_0x4e6bc2,_0x40fb70){_0x4e6bc2=_0x4e6bc2-0x7f;const _0x5b0a8e=a1_0x5b0a();let _0x3eab71=_0x5b0a8e[_0x4e6bc2];return _0x3eab71;}import{jsx as a1_0x6fc5a4,jsxs as a1_0x9e3676,Fragment as a1_0x355342}from'react/jsx-runtime';import{fileURLToPath}from'node:url';import a1_0x490b78 from'node:path';import{useEffect,useState}from'react';import{Box,Text,useApp}from'ink';import{SelectPageTemplate}from'./select-page-template.js';function a1_0x5b0a(){const _0x4e6425=['../../templates/pages','resolve','\x20Step2:\x20','10rjRPcv','now','pages','cwd','catch','join','src','123635ztwwzT','dirname','\x20*\x20路由地址:\x20','已选择页面模板\x20','178284xRJaRV','cyan','green','已输入的页面路由\x20','gray','message','2484dGqzeA','finally','1568LFykMS','8kPUdxx','error','\x20*\x20页面文件已创建,可直接通过路由访问','32ZFzzKr','14EnQipk','setLogPath','597078PYxIwb','页面添加失败:\x20','开始添加页面:\x20','\x20Step1:\x20','页面添加成功:\x20','2304660ENeUFP','正在创建页面,请稍候…','5082088AooCnf','\x20*\x20页面创建成功!','89634rkIHmt','processTemplate','add-page'];a1_0x5b0a=function(){return _0x4e6425;};return a1_0x5b0a();}import{InputProjectCode}from'./input-page-router.js';import{logger}from'../utils/logger.js';import{TemplateReplacer}from'../utils/template-replacer.js';const __dirname=a1_0x490b78[a1_0x37681e(0x7f)](fileURLToPath(import.meta.url)),pageTemplateDir=a1_0x490b78[a1_0x37681e(0x9e)](__dirname,a1_0x37681e(0x9d)),projectDir=process[a1_0x37681e(0xa3)]();export const AddPage=()=>{const _0x2b5cf0=a1_0x37681e,{exit:_0x31816d}=useApp(),[_0x10ca6d,_0x370907]=useState(''),[_0x10b8ab,_0x137a61]=useState(''),[_0x18b765,_0x998fb]=useState(![]),[_0x2b30fb,_0x5cb46b]=useState(![]),_0x3d22d6=a1_0x490b78[_0x2b5cf0(0xa5)](projectDir,_0x2b5cf0(0xa6),_0x2b5cf0(0xa2)),_0x55ef22=a1_0x490b78['join'](_0x3d22d6,_0x10b8ab),_0x3d2fd3=a1_0x490b78[_0x2b5cf0(0xa5)](_0x2b5cf0(0xa6),_0x2b5cf0(0xa2),_0x10b8ab);useEffect(()=>{const _0x48cca1=_0x2b5cf0,_0x8c74c=a1_0x490b78[_0x48cca1(0x9e)](pageTemplateDir,_0x10ca6d);if(_0x10ca6d&&_0x10b8ab){_0x998fb(!![]),logger[_0x48cca1(0x90)](process[_0x48cca1(0xa3)]());const _0x64bada=Date[_0x48cca1(0xa1)]();logger['info'](_0x48cca1(0x9c),_0x48cca1(0x93)+_0x10b8ab,{'template':_0x10ca6d,'targetPath':_0x3d2fd3}),TemplateReplacer[_0x48cca1(0x9b)](_0x8c74c,a1_0x490b78[_0x48cca1(0xa5)](_0x3d22d6,_0x10b8ab),_0x10b8ab,_0x10ca6d)['then'](()=>{const _0x36200f=_0x48cca1,_0x113136=Date[_0x36200f(0xa1)]()-_0x64bada;logger['success'](_0x36200f(0x9c),_0x36200f(0x95)+_0x10b8ab,_0x113136,{'template':_0x10ca6d,'targetPath':_0x3d2fd3,'routePath':_0x10b8ab}),_0x5cb46b(!![]);})[_0x48cca1(0xa4)](_0x14499b=>{const _0x51f5ec=_0x48cca1,_0x19ce7e=Date['now']()-_0x64bada;logger[_0x51f5ec(0x8c)](_0x51f5ec(0x9c),_0x51f5ec(0x92)+_0x10b8ab,{'template':_0x10ca6d,'targetPath':_0x3d2fd3,'error':_0x14499b instanceof Error?_0x14499b[_0x51f5ec(0x87)]:String(_0x14499b),'duration':_0x19ce7e});})[_0x48cca1(0x89)](()=>{_0x998fb(![]);});}},[_0x10ca6d,_0x10b8ab]),useEffect(()=>{_0x2b30fb&&setTimeout(()=>{_0x31816d();});},[_0x2b30fb]);if(_0x10ca6d)return a1_0x9e3676(Box,{'flexDirection':'column','paddingY':0x1,'children':[a1_0x9e3676(Box,{'children':[a1_0x6fc5a4(Text,{'color':_0x2b5cf0(0x86),'children':_0x2b5cf0(0x94)}),a1_0x6fc5a4(Text,{'children':_0x2b5cf0(0x81)}),a1_0x6fc5a4(Text,{'color':'green','children':_0x10ca6d})]}),_0x10b8ab?a1_0x9e3676(Box,{'children':[a1_0x6fc5a4(Text,{'color':_0x2b5cf0(0x86),'children':_0x2b5cf0(0x9f)}),a1_0x6fc5a4(Text,{'children':_0x2b5cf0(0x85)}),a1_0x6fc5a4(Text,{'color':_0x2b5cf0(0x84),'children':_0x10b8ab})]}):a1_0x6fc5a4(InputProjectCode,{'pagePath':_0x55ef22,'onSubmit':_0x137a61}),_0x10b8ab&&_0x18b765?a1_0x9e3676(Box,{'marginTop':0x1,'children':[a1_0x6fc5a4(Box,{'width':'4'}),a1_0x6fc5a4(Text,{'children':_0x2b5cf0(0x97)})]}):null,_0x2b30fb?a1_0x9e3676(a1_0x355342,{'children':[a1_0x6fc5a4(Box,{'marginTop':0x1,'children':a1_0x6fc5a4(Text,{'color':_0x2b5cf0(0x86),'children':_0x2b5cf0(0x99)})}),a1_0x9e3676(Box,{'children':[a1_0x6fc5a4(Text,{'color':_0x2b5cf0(0x86),'children':'\x20*\x20页面路径:\x20'}),a1_0x6fc5a4(Text,{'color':'green','children':_0x3d2fd3})]}),a1_0x9e3676(Box,{'children':[a1_0x6fc5a4(Text,{'color':_0x2b5cf0(0x86),'children':_0x2b5cf0(0x80)}),a1_0x9e3676(Text,{'color':_0x2b5cf0(0x84),'children':['/',_0x10b8ab]})]}),a1_0x6fc5a4(Box,{'marginTop':0x1,'children':a1_0x6fc5a4(Text,{'color':_0x2b5cf0(0x83),'children':_0x2b5cf0(0x8d)})})]}):null]});return a1_0x6fc5a4(SelectPageTemplate,{'onSelect':_0x370907});};
1
+ const a1_0x2d6b7c=a1_0x437a;(function(_0xe50381,_0x22fa7e){const _0xa334d=a1_0x437a,_0xa938f0=_0xe50381();while(!![]){try{const _0xe15cc6=-parseInt(_0xa334d(0x8f))/0x1*(-parseInt(_0xa334d(0xae))/0x2)+parseInt(_0xa334d(0xa8))/0x3+-parseInt(_0xa334d(0x9a))/0x4+parseInt(_0xa334d(0x96))/0x5+parseInt(_0xa334d(0xb2))/0x6+-parseInt(_0xa334d(0x90))/0x7+-parseInt(_0xa334d(0xad))/0x8*(parseInt(_0xa334d(0x9d))/0x9);if(_0xe15cc6===_0x22fa7e)break;else _0xa938f0['push'](_0xa938f0['shift']());}catch(_0x317630){_0xa938f0['push'](_0xa938f0['shift']());}}}(a1_0x1286,0x1c329));import{jsx as a1_0x5b1923,jsxs as a1_0x4c41d6,Fragment as a1_0x4d0a0e}from'react/jsx-runtime';import{fileURLToPath}from'node:url';import a1_0x4ef200 from'node:path';import{useEffect,useState}from'react';import{Box,Text,useApp}from'ink';function a1_0x437a(_0x1d7576,_0x3af2f8){_0x1d7576=_0x1d7576-0x8e;const _0x1286e5=a1_0x1286();let _0x437ae5=_0x1286e5[_0x1d7576];return _0x437ae5;}import{SelectPageTemplate}from'./select-page-template.js';import{InputProjectCode}from'./input-page-router.js';import{logger}from'../utils/logger.js';function a1_0x1286(){const _0x241d49=['743172nrstFB','pages','then','1693233oGYUzF','cwd','add-page','processTemplate','finally','已选择页面模板\x20','\x20Step1:\x20','success','dirname','catch','\x20*\x20路由地址:\x20','367479tawOCN','now','message','column','\x20*\x20页面路径:\x20','8FbNSmp','62350jXVJzj','src','gray','已输入的页面路由\x20','297822gJveCw','正在创建页面,请稍候…','5QmUIYD','245735mdBwTx','join','setLogPath','页面添加失败:\x20','\x20Step2:\x20','resolve','982635CuFTmi','\x20*\x20页面文件已创建,可直接通过路由访问','info','../../templates/pages'];a1_0x1286=function(){return _0x241d49;};return a1_0x1286();}import{TemplateReplacer}from'../utils/template-replacer.js';const __dirname=a1_0x4ef200[a1_0x2d6b7c(0xa5)](fileURLToPath(import.meta.url)),pageTemplateDir=a1_0x4ef200[a1_0x2d6b7c(0x95)](__dirname,a1_0x2d6b7c(0x99)),projectDir=process[a1_0x2d6b7c(0x9e)]();export const AddPage=()=>{const _0x4afa5d=a1_0x2d6b7c,{exit:_0x276976}=useApp(),[_0x26b077,_0x33c2de]=useState(''),[_0x3e5102,_0x2fe182]=useState(''),[_0x2b006e,_0x41cb63]=useState(![]),[_0x5cffb9,_0x575ad7]=useState(![]),_0xcc1058=a1_0x4ef200[_0x4afa5d(0x91)](projectDir,_0x4afa5d(0xaf),_0x4afa5d(0x9b)),_0x150466=a1_0x4ef200[_0x4afa5d(0x91)](_0xcc1058,_0x3e5102),_0x237eaf=a1_0x4ef200['join'](_0x4afa5d(0xaf),_0x4afa5d(0x9b),_0x3e5102);useEffect(()=>{const _0x589ffa=_0x4afa5d,_0x28e48d=a1_0x4ef200['resolve'](pageTemplateDir,_0x26b077);if(_0x26b077&&_0x3e5102){_0x41cb63(!![]),logger[_0x589ffa(0x92)](process['cwd']());const _0xdc1b89=Date['now']();logger[_0x589ffa(0x98)]('add-page','开始添加页面:\x20'+_0x3e5102,{'template':_0x26b077,'targetPath':_0x237eaf}),TemplateReplacer[_0x589ffa(0xa0)](_0x28e48d,a1_0x4ef200[_0x589ffa(0x91)](_0xcc1058,_0x3e5102),_0x3e5102,_0x26b077)[_0x589ffa(0x9c)](()=>{const _0x4e4a8c=_0x589ffa,_0x339c49=Date[_0x4e4a8c(0xa9)]()-_0xdc1b89;logger[_0x4e4a8c(0xa4)]('add-page','页面添加成功:\x20'+_0x3e5102,_0x339c49,{'template':_0x26b077,'targetPath':_0x237eaf,'routePath':_0x3e5102}),_0x575ad7(!![]);})[_0x589ffa(0xa6)](_0x4d016d=>{const _0x1e3b64=_0x589ffa,_0x107d47=Date[_0x1e3b64(0xa9)]()-_0xdc1b89;logger['error'](_0x1e3b64(0x9f),_0x1e3b64(0x93)+_0x3e5102,{'template':_0x26b077,'targetPath':_0x237eaf,'error':_0x4d016d instanceof Error?_0x4d016d[_0x1e3b64(0xaa)]:String(_0x4d016d),'duration':_0x107d47});})[_0x589ffa(0xa1)](()=>{_0x41cb63(![]);});}},[_0x26b077,_0x3e5102]),useEffect(()=>{_0x5cffb9&&setTimeout(()=>{_0x276976();});},[_0x5cffb9]);if(_0x26b077)return a1_0x4c41d6(Box,{'flexDirection':_0x4afa5d(0xab),'paddingY':0x1,'children':[a1_0x4c41d6(Box,{'children':[a1_0x5b1923(Text,{'color':_0x4afa5d(0xb0),'children':_0x4afa5d(0xa3)}),a1_0x5b1923(Text,{'children':_0x4afa5d(0xa2)}),a1_0x5b1923(Text,{'color':'green','children':_0x26b077})]}),_0x3e5102?a1_0x4c41d6(Box,{'children':[a1_0x5b1923(Text,{'color':'gray','children':_0x4afa5d(0x94)}),a1_0x5b1923(Text,{'children':_0x4afa5d(0xb1)}),a1_0x5b1923(Text,{'color':'green','children':_0x3e5102})]}):a1_0x5b1923(InputProjectCode,{'pagePath':_0x150466,'onSubmit':_0x2fe182}),_0x3e5102&&_0x2b006e?a1_0x4c41d6(Box,{'marginTop':0x1,'children':[a1_0x5b1923(Box,{'width':'4'}),a1_0x5b1923(Text,{'children':_0x4afa5d(0x8e)})]}):null,_0x5cffb9?a1_0x4c41d6(a1_0x4d0a0e,{'children':[a1_0x5b1923(Box,{'marginTop':0x1,'children':a1_0x5b1923(Text,{'color':_0x4afa5d(0xb0),'children':'\x20*\x20页面创建成功!'})}),a1_0x4c41d6(Box,{'children':[a1_0x5b1923(Text,{'color':_0x4afa5d(0xb0),'children':_0x4afa5d(0xac)}),a1_0x5b1923(Text,{'color':'green','children':_0x237eaf})]}),a1_0x4c41d6(Box,{'children':[a1_0x5b1923(Text,{'color':_0x4afa5d(0xb0),'children':_0x4afa5d(0xa7)}),a1_0x4c41d6(Text,{'color':'green','children':['/',_0x3e5102]})]}),a1_0x5b1923(Box,{'marginTop':0x1,'children':a1_0x5b1923(Text,{'color':'cyan','children':_0x4afa5d(0x97)})})]}):null]});return a1_0x5b1923(SelectPageTemplate,{'onSelect':_0x33c2de});};
@@ -1 +1 @@
1
- function a2_0x59dd(){const _0x3a48ec=['2774456iksrEf','upArrow','column','localeCompare','resolve','map','12cTqugY','正在加载页面模板...','\x20Step1:\x20','isDirectory','dirname','filter','236RoObIS','12frasTS','9BZkHkv','6834560EeNlqT','sort','blank','gray','13428eNdmYY','59628qeaPKH','18012423fHQNCw','name','length','238PqzMrw','error','green','label','获取模板列表失败:','1038280ChlagA','111927OSIhIw','return','downArrow','../..'];a2_0x59dd=function(){return _0x3a48ec;};return a2_0x59dd();}(function(_0x3ae0fe,_0x183f6d){const _0x3b3cd2=a2_0x2082,_0x3d7ee4=_0x3ae0fe();while(!![]){try{const _0x375e91=parseInt(_0x3b3cd2(0xd5))/0x1*(parseInt(_0x3b3cd2(0xf0))/0x2)+-parseInt(_0x3b3cd2(0xe0))/0x3*(-parseInt(_0x3b3cd2(0xea))/0x4)+parseInt(_0x3b3cd2(0xf3))/0x5+parseInt(_0x3b3cd2(0xd6))/0x6*(-parseInt(_0x3b3cd2(0xda))/0x7)+parseInt(_0x3b3cd2(0xe4))/0x8*(-parseInt(_0x3b3cd2(0xf2))/0x9)+parseInt(_0x3b3cd2(0xdf))/0xa+parseInt(_0x3b3cd2(0xd7))/0xb*(-parseInt(_0x3b3cd2(0xf1))/0xc);if(_0x375e91===_0x183f6d)break;else _0x3d7ee4['push'](_0x3d7ee4['shift']());}catch(_0x2998bb){_0x3d7ee4['push'](_0x3d7ee4['shift']());}}}(a2_0x59dd,0xce4b3));import{jsx as a2_0xd8dedf,jsxs as a2_0x50eaff}from'react/jsx-runtime';function a2_0x2082(_0x218799,_0x207107){_0x218799=_0x218799-0xd2;const _0x59dd5c=a2_0x59dd();let _0x208204=_0x59dd5c[_0x218799];return _0x208204;}import{useState,useEffect}from'react';import{Text,Box,useInput}from'ink';import{readdir}from'node:fs/promises';import a2_0x120169 from'node:path';import{fileURLToPath}from'node:url';async function getTemplateList(){const _0x18bca0=a2_0x2082;try{const _0x45d9d6=fileURLToPath(import.meta.url),_0x348240=a2_0x120169[_0x18bca0(0xe8)](a2_0x120169[_0x18bca0(0xee)](_0x45d9d6),_0x18bca0(0xe3)),_0x1e08f6=a2_0x120169['join'](_0x348240,'templates/pages'),_0x43e9be=await readdir(_0x1e08f6,{'withFileTypes':!![]}),_0x564ea6=_0x43e9be[_0x18bca0(0xef)](_0x101293=>_0x101293[_0x18bca0(0xed)]())[_0x18bca0(0xe9)](_0x45eec4=>({'label':_0x45eec4[_0x18bca0(0xd8)]}))[_0x18bca0(0xd2)]((_0x215583,_0x150227)=>_0x215583['label'][_0x18bca0(0xe7)](_0x150227[_0x18bca0(0xdd)]));return _0x564ea6;}catch(_0x4b3130){return console[_0x18bca0(0xdb)](_0x18bca0(0xde),_0x4b3130),[{'label':_0x18bca0(0xd3)},{'label':'sdk-fetch'}];}}export function SelectPageTemplate(_0x194b3e){const _0x2c2274=a2_0x2082,[_0x19c8fe,_0x51f894]=useState(0x0),[_0x5bc2b9,_0x3659bc]=useState([]),[_0x52fa17,_0x56dd6f]=useState(!![]);useEffect(()=>{async function _0x1b19de(){const _0x2211c6=await getTemplateList();_0x3659bc(_0x2211c6),_0x56dd6f(![]);}_0x1b19de();},[]),useInput((_0x2fab33,_0x3ebda5)=>{const _0x3183f0=a2_0x2082;if(_0x52fa17)return;if(_0x3ebda5[_0x3183f0(0xe1)]){const _0xe44361=_0x5bc2b9[_0x19c8fe];_0xe44361&&_0x194b3e['onSelect'](_0xe44361['label']);}_0x3ebda5[_0x3183f0(0xe5)]&&_0x51f894(_0x32de82=>_0x32de82===0x0?_0x5bc2b9[_0x3183f0(0xd9)]-0x1:_0x32de82-0x1),_0x3ebda5[_0x3183f0(0xe2)]&&_0x51f894(_0x2a0a1e=>_0x2a0a1e===_0x5bc2b9[_0x3183f0(0xd9)]-0x1?0x0:_0x2a0a1e+0x1);});if(_0x52fa17)return a2_0xd8dedf(Box,{'flexDirection':_0x2c2274(0xe6),'paddingY':0x1,'children':a2_0x50eaff(Box,{'children':[a2_0xd8dedf(Text,{'color':_0x2c2274(0xd4),'children':_0x2c2274(0xec)}),a2_0xd8dedf(Text,{'children':_0x2c2274(0xeb)})]})});return a2_0x50eaff(Box,{'flexDirection':'column','paddingY':0x1,'children':[a2_0x50eaff(Box,{'children':[a2_0xd8dedf(Text,{'color':'gray','children':_0x2c2274(0xec)}),a2_0xd8dedf(Text,{'children':'请选择您要创建的页面模板'})]}),_0x5bc2b9[_0x2c2274(0xe9)]((_0x559ec1,_0x1697fd)=>{const _0x24cb1a=_0x2c2274,_0x1c7d89=_0x1697fd===_0x19c8fe,_0x467907=_0x1c7d89?'\x20\x20\x20\x20\x20\x20>\x20'+_0x559ec1['label']:'\x20\x20\x20\x20\x20\x20\x20\x20'+_0x559ec1[_0x24cb1a(0xdd)];return a2_0xd8dedf(Box,{'children':a2_0xd8dedf(Text,{'color':_0x1c7d89?_0x24cb1a(0xdc):undefined,'children':_0x467907})},_0x467907);})]});}
1
+ (function(_0x37f134,_0x4c7a9e){const _0x424bf5=a2_0x2b9e,_0x34f14c=_0x37f134();while(!![]){try{const _0x4aafd5=parseInt(_0x424bf5(0xcd))/0x1*(-parseInt(_0x424bf5(0xd3))/0x2)+parseInt(_0x424bf5(0xd6))/0x3*(parseInt(_0x424bf5(0xd9))/0x4)+-parseInt(_0x424bf5(0xd2))/0x5+-parseInt(_0x424bf5(0xe0))/0x6*(-parseInt(_0x424bf5(0xc8))/0x7)+-parseInt(_0x424bf5(0xc5))/0x8+-parseInt(_0x424bf5(0xdf))/0x9*(-parseInt(_0x424bf5(0xde))/0xa)+-parseInt(_0x424bf5(0xc3))/0xb*(-parseInt(_0x424bf5(0xda))/0xc);if(_0x4aafd5===_0x4c7a9e)break;else _0x34f14c['push'](_0x34f14c['shift']());}catch(_0x15c0c8){_0x34f14c['push'](_0x34f14c['shift']());}}}(a2_0x5c0f,0xee71c));import{jsx as a2_0x38a2ea,jsxs as a2_0x39dd40}from'react/jsx-runtime';import{useState,useEffect}from'react';function a2_0x2b9e(_0x1f9a93,_0x3b0aea){_0x1f9a93=_0x1f9a93-0xc1;const _0x5c0f42=a2_0x5c0f();let _0x2b9e96=_0x5c0f42[_0x1f9a93];return _0x2b9e96;}import{Text,Box,useInput}from'ink';function a2_0x5c0f(){const _0x5c0432=['获取模板列表失败:','sdk-fetch','10RoUqBA','14499522hPVyjZ','157362gCcBoH','downArrow','\x20\x20\x20\x20\x20\x20>\x20','36742607zLbfzN','column','15166752KMzbvv','green','onSelect','273dKyJFs','label','../..','gray','length','7fpFeLd','upArrow','filter','map','localeCompare','9184095dQpsUB','552804OqcnZW','resolve','sort','57zkhqKf','return','join','141052hWFdKD','12quPKCp','isDirectory'];a2_0x5c0f=function(){return _0x5c0432;};return a2_0x5c0f();}import{readdir}from'node:fs/promises';import a2_0x304758 from'node:path';import{fileURLToPath}from'node:url';async function getTemplateList(){const _0x36b603=a2_0x2b9e;try{const _0x25ae62=fileURLToPath(import.meta.url),_0x4d99b9=a2_0x304758[_0x36b603(0xd4)](a2_0x304758['dirname'](_0x25ae62),_0x36b603(0xca)),_0x4bb35f=a2_0x304758[_0x36b603(0xd8)](_0x4d99b9,'templates/pages'),_0x3a4bfc=await readdir(_0x4bb35f,{'withFileTypes':!![]}),_0x1eb0f7=_0x3a4bfc[_0x36b603(0xcf)](_0x37191f=>_0x37191f[_0x36b603(0xdb)]())[_0x36b603(0xd0)](_0x1c523e=>({'label':_0x1c523e['name']}))[_0x36b603(0xd5)]((_0x23d39e,_0x26b9ec)=>_0x23d39e[_0x36b603(0xc9)][_0x36b603(0xd1)](_0x26b9ec[_0x36b603(0xc9)]));return _0x1eb0f7;}catch(_0x1c4401){return console['error'](_0x36b603(0xdc),_0x1c4401),[{'label':'blank'},{'label':_0x36b603(0xdd)}];}}export function SelectPageTemplate(_0x4317a9){const _0x5c2af2=a2_0x2b9e,[_0x485be6,_0x470044]=useState(0x0),[_0x5c479e,_0x4d51b5]=useState([]),[_0x514b3e,_0x149cd8]=useState(!![]);useEffect(()=>{async function _0x572df1(){const _0x5822a1=await getTemplateList();_0x4d51b5(_0x5822a1),_0x149cd8(![]);}_0x572df1();},[]),useInput((_0x3cfb38,_0x5dafa2)=>{const _0x4c2d89=a2_0x2b9e;if(_0x514b3e)return;if(_0x5dafa2[_0x4c2d89(0xd7)]){const _0x579078=_0x5c479e[_0x485be6];_0x579078&&_0x4317a9[_0x4c2d89(0xc7)](_0x579078[_0x4c2d89(0xc9)]);}_0x5dafa2[_0x4c2d89(0xce)]&&_0x470044(_0x5cc2ab=>_0x5cc2ab===0x0?_0x5c479e[_0x4c2d89(0xcc)]-0x1:_0x5cc2ab-0x1),_0x5dafa2[_0x4c2d89(0xc1)]&&_0x470044(_0x587ed2=>_0x587ed2===_0x5c479e['length']-0x1?0x0:_0x587ed2+0x1);});if(_0x514b3e)return a2_0x38a2ea(Box,{'flexDirection':'column','paddingY':0x1,'children':a2_0x39dd40(Box,{'children':[a2_0x38a2ea(Text,{'color':'gray','children':'\x20Step1:\x20'}),a2_0x38a2ea(Text,{'children':'正在加载页面模板...'})]})});return a2_0x39dd40(Box,{'flexDirection':_0x5c2af2(0xc4),'paddingY':0x1,'children':[a2_0x39dd40(Box,{'children':[a2_0x38a2ea(Text,{'color':_0x5c2af2(0xcb),'children':'\x20Step1:\x20'}),a2_0x38a2ea(Text,{'children':'请选择您要创建的页面模板'})]}),_0x5c479e[_0x5c2af2(0xd0)]((_0x19e339,_0x530eb9)=>{const _0x4ae436=_0x5c2af2,_0x5d4547=_0x530eb9===_0x485be6,_0x156b5c=_0x5d4547?_0x4ae436(0xc2)+_0x19e339['label']:'\x20\x20\x20\x20\x20\x20\x20\x20'+_0x19e339[_0x4ae436(0xc9)];return a2_0x38a2ea(Box,{'children':a2_0x38a2ea(Text,{'color':_0x5d4547?_0x4ae436(0xc6):undefined,'children':_0x156b5c})},_0x156b5c);})]});}
@@ -1 +1 @@
1
- (function(_0x362ab4,_0x66b0e9){const _0x26a547=a3_0x3380,_0x5d24c7=_0x362ab4();while(!![]){try{const _0x54e893=-parseInt(_0x26a547(0x19a))/0x1*(-parseInt(_0x26a547(0x1a1))/0x2)+-parseInt(_0x26a547(0x1b3))/0x3+parseInt(_0x26a547(0x191))/0x4*(parseInt(_0x26a547(0x194))/0x5)+parseInt(_0x26a547(0x1a7))/0x6+parseInt(_0x26a547(0x1a3))/0x7+parseInt(_0x26a547(0x1ae))/0x8*(parseInt(_0x26a547(0x1ad))/0x9)+-parseInt(_0x26a547(0x1c0))/0xa;if(_0x54e893===_0x66b0e9)break;else _0x5d24c7['push'](_0x5d24c7['shift']());}catch(_0x2ebc48){_0x5d24c7['push'](_0x5d24c7['shift']());}}}(a3_0x3ec5,0x22daf));function a3_0x3ec5(){const _0x19630f=['💡\x20请使用\x20','\x20(环境:\x20','column','\x20重新登录后再试','52coRJJE','\x20-\x20','891786XmRclw','*\x20生成的文档文件:','red','api-doc','653148KLwEBj','log','length','\x1b[0m','指定的数据集代码都不存在:\x20','\x20个匹配的数据集\x1b[0m','9HWdDsn','80048yCkQAr','⚠️\x20以下数据集生成失败:','\x20个数据集中筛选出\x20','map','\x1b[90m*\x20从\x20','342768ZGIlny','gray','message','green','error','\x20个数据集','filter','正在获取数据集列表...','cyan','includes','.md\x20(','white','使用指定的应用AppCode:\x20','4373140fEBakm','yellow','正在生成\x20','join','dim','lovrabet\x20auth','setLogPath','12JAadtc','未找到任何数据集','env','434965tDVEaJ','./docs',',\x20失败\x20','datasetName','filePath','success','7196iUfJJP','使用配置的应用AppCode:\x20','datasetCode'];a3_0x3ec5=function(){return _0x19630f;};return a3_0x3ec5();}import{jsx as a3_0x311a75,jsxs as a3_0x382f83,Fragment as a3_0x5f3d96}from'react/jsx-runtime';import{useEffect,useState}from'react';import{Box,Text,useApp}from'ink';import{readConfig,getConfigAppCode}from'../utils/config.js';import{initEnv}from'../constant/env.js';import{fetchModelList}from'./fetch-model-list.js';import{generateDatasetDocs}from'./api-doc.js';function a3_0x3380(_0x4bd6f6,_0x31f309){_0x4bd6f6=_0x4bd6f6-0x18e;const _0x3ec5ba=a3_0x3ec5();let _0x33806d=_0x3ec5ba[_0x4bd6f6];return _0x33806d;}import{logger}from'../utils/logger.js';export const ApiDocUI=({appCode:_0x426e51,env:_0x1733cd,output:_0x3a3fea,extraParams:_0x5a4bb6,datasetCodes:_0x5f3466})=>{const _0x2564ab=a3_0x3380,{exit:_0x2e423d}=useApp(),[_0x5d6e93,_0x2aef52]=useState(![]),[_0xbce765,_0x8b4b25]=useState(''),[_0x401f49,_0x2b0ca0]=useState(![]),[_0x54d2c4,_0x1f40fa]=useState(null),[_0x553d2f,_0x570e1a]=useState(null),[_0x26211c,_0x457a2c]=useState(0x0),_0x52e065=readConfig(),_0x4ec53a=getConfigAppCode(),_0x179374=_0x426e51||_0x4ec53a,_0x38539f=typeof _0x52e065?.[_0x2564ab(0x193)]==='string'?_0x52e065[_0x2564ab(0x193)]:undefined,_0x15affe=_0x1733cd||_0x38539f||'online';initEnv(_0x15affe);const _0x443c40=_0x3a3fea||_0x2564ab(0x195),_0x5206b5=_0x426e51?_0x2564ab(0x1bf)+_0x179374:_0x2564ab(0x19b)+_0x179374;useEffect(()=>{_0x2aef52(!![]),_0xf75901();},[]),useEffect(()=>{(_0x401f49||_0x54d2c4)&&_0x2e423d();},[_0x401f49,_0x54d2c4,_0x2e423d]);async function _0xf75901(){const _0xe5b147=_0x2564ab;if(!_0x179374){_0x1f40fa('未提供应用AppCode,且配置中也没有默认值');return;}try{logger[_0xe5b147(0x190)](process['cwd']()),_0x8b4b25(_0xe5b147(0x1ba));const {configArray:_0x377d7c}=await fetchModelList(_0x179374);_0x457a2c(_0x377d7c[_0xe5b147(0x1a9)]);if(_0x377d7c[_0xe5b147(0x1a9)]===0x0){_0x1f40fa(_0xe5b147(0x192));return;}let _0x418920=_0x377d7c;if(_0x5f3466&&_0x5f3466[_0xe5b147(0x1a9)]>0x0){_0x418920=_0x377d7c[_0xe5b147(0x1b9)](_0x228e3b=>_0x5f3466[_0xe5b147(0x1bc)](_0x228e3b[_0xe5b147(0x19c)]));const _0x2119fd=_0x418920[_0xe5b147(0x1b1)](_0x3d0c2e=>_0x3d0c2e[_0xe5b147(0x19c)]),_0x265a32=_0x5f3466[_0xe5b147(0x1b9)](_0x2e418f=>!_0x2119fd[_0xe5b147(0x1bc)](_0x2e418f));_0x265a32[_0xe5b147(0x1a9)]>0x0&&console[_0xe5b147(0x1a8)]('\x1b[33m!\x20以下数据集代码不存在:\x20'+_0x265a32[_0xe5b147(0x1c3)](',\x20')+_0xe5b147(0x1aa));if(_0x418920[_0xe5b147(0x1a9)]===0x0){_0x1f40fa(_0xe5b147(0x1ab)+_0x5f3466[_0xe5b147(0x1c3)](',\x20'));return;}console[_0xe5b147(0x1a8)](_0xe5b147(0x1b2)+_0x377d7c[_0xe5b147(0x1a9)]+_0xe5b147(0x1b0)+_0x418920[_0xe5b147(0x1a9)]+_0xe5b147(0x1ac));}_0x8b4b25(_0xe5b147(0x1c2)+_0x418920[_0xe5b147(0x1a9)]+'\x20个数据集的文档...');const _0x499a75=await generateDatasetDocs(_0x418920,_0x179374,_0x443c40,(_0x3721ef,_0x3ca4f4,_0x13b9c4)=>{const _0x252764=_0xe5b147;_0x8b4b25('正在生成\x20'+_0x13b9c4+_0x252764(0x1bd)+_0x3721ef+'/'+_0x3ca4f4+')');},_0x5a4bb6);_0x570e1a(_0x499a75),_0x2b0ca0(!![]);const _0x254f5d=_0x499a75[_0xe5b147(0x1b9)](_0x5d61b7=>_0x5d61b7[_0xe5b147(0x199)])['length'],_0x28661e=_0x499a75[_0xe5b147(0x1b9)](_0x4ad1db=>!_0x4ad1db[_0xe5b147(0x199)])[_0xe5b147(0x1a9)];logger[_0xe5b147(0x199)]('api-doc','文档生成完成',undefined,{'totalCount':_0x499a75['length'],'successCount':_0x254f5d,'failCount':_0x28661e,'outputDir':_0x443c40});}catch(_0x2d4a1b){const _0x10abb1=_0x2d4a1b instanceof Error?_0x2d4a1b[_0xe5b147(0x1b5)]:String(_0x2d4a1b);logger[_0xe5b147(0x1b7)](_0xe5b147(0x1a6),'文档生成失败:\x20'+_0x10abb1,{'appCode':_0x179374,'outputDir':_0x443c40}),_0x1f40fa('文档生成失败:\x20'+_0x10abb1);}finally{_0x2aef52(![]);}}const _0x2bde7a=_0x553d2f?.['filter'](_0x25fa23=>_0x25fa23[_0x2564ab(0x199)])[_0x2564ab(0x1a9)]||0x0,_0x53b3f4=_0x553d2f?.[_0x2564ab(0x1b9)](_0x3415fb=>!_0x3415fb[_0x2564ab(0x199)])['length']||0x0;return a3_0x382f83(Box,{'flexDirection':_0x2564ab(0x19f),'children':[(_0x5d6e93||_0x401f49)&&a3_0x382f83(Box,{'children':[a3_0x311a75(Text,{'color':_0x2564ab(0x1b4),'children':'*\x20'}),a3_0x311a75(Text,{'color':_0x426e51?_0x2564ab(0x1be):'dim','children':_0x5206b5})]}),_0x5d6e93&&a3_0x311a75(Box,{'children':a3_0x382f83(Text,{'children':['🚀\x20',_0xbce765,_0x2564ab(0x19e),_0x15affe,')']})}),_0x401f49&&_0x553d2f&&a3_0x382f83(Box,{'flexDirection':_0x2564ab(0x19f),'children':[a3_0x311a75(Box,{'children':a3_0x382f83(Text,{'color':_0x2564ab(0x1b6),'children':['√\x20文档生成完成!成功\x20',_0x2bde7a,'\x20个',_0x53b3f4>0x0&&_0x2564ab(0x196)+_0x53b3f4+'\x20个']})}),a3_0x311a75(Box,{'marginTop':0x1,'children':a3_0x382f83(Text,{'color':_0x2564ab(0x1b4),'children':['*\x20共处理\x20',_0x26211c,_0x2564ab(0x1b8)]})}),a3_0x382f83(Box,{'marginTop':0x1,'children':[a3_0x311a75(Text,{'color':_0x2564ab(0x1b4),'children':'*\x20输出目录:\x20'}),a3_0x311a75(Text,{'color':_0x2564ab(0x1bb),'children':_0x443c40})]}),_0x2bde7a>0x0&&a3_0x382f83(a3_0x5f3d96,{'children':[a3_0x311a75(Box,{'marginTop':0x1,'children':a3_0x311a75(Text,{'color':_0x2564ab(0x1b4),'children':_0x2564ab(0x1a4)})}),_0x553d2f[_0x2564ab(0x1b9)](_0x345045=>_0x345045[_0x2564ab(0x199)])['map']((_0x25ce33,_0x4a3f3e)=>a3_0x382f83(Box,{'marginLeft':0x2,'children':[a3_0x382f83(Text,{'color':_0x2564ab(0x1bb),'children':['•\x20',_0x25ce33[_0x2564ab(0x198)]]}),a3_0x382f83(Text,{'color':'dim','children':[_0x2564ab(0x1a2),_0x25ce33[_0x2564ab(0x197)]]})]},_0x4a3f3e))]}),_0x53b3f4>0x0&&a3_0x382f83(a3_0x5f3d96,{'children':[a3_0x311a75(Box,{'marginTop':0x1,'children':a3_0x311a75(Text,{'color':_0x2564ab(0x1c1),'children':_0x2564ab(0x1af)})}),_0x553d2f[_0x2564ab(0x1b9)](_0x50b2cc=>!_0x50b2cc[_0x2564ab(0x199)])['map']((_0x4f3245,_0x37014b)=>a3_0x382f83(Box,{'marginLeft':0x2,'flexDirection':_0x2564ab(0x19f),'children':[a3_0x382f83(Text,{'color':_0x2564ab(0x1a5),'children':['•\x20',_0x4f3245[_0x2564ab(0x197)],'\x20(',_0x4f3245[_0x2564ab(0x19c)],')']}),_0x4f3245[_0x2564ab(0x1b7)]&&a3_0x311a75(Box,{'marginLeft':0x2,'children':a3_0x311a75(Text,{'color':_0x2564ab(0x18e),'children':_0x4f3245[_0x2564ab(0x1b7)]})})]},_0x37014b))]})]}),_0x54d2c4&&a3_0x382f83(Box,{'flexDirection':'column','children':[a3_0x311a75(Box,{'children':a3_0x382f83(Text,{'color':_0x2564ab(0x1a5),'children':['❌\x20',_0x54d2c4]})}),_0x54d2c4[_0x2564ab(0x1bc)]('登录')&&a3_0x382f83(Box,{'marginTop':0x1,'children':[a3_0x311a75(Text,{'color':'yellow','children':_0x2564ab(0x19d)}),a3_0x311a75(Text,{'color':'cyan','children':_0x2564ab(0x18f)}),a3_0x311a75(Text,{'color':_0x2564ab(0x1c1),'children':_0x2564ab(0x1a0)})]})]})]});};
1
+ (function(_0x42e70e,_0x2be4c4){const _0x168c7a=a3_0x171a,_0x58d780=_0x42e70e();while(!![]){try{const _0x5a7f77=-parseInt(_0x168c7a(0x196))/0x1+-parseInt(_0x168c7a(0x173))/0x2+parseInt(_0x168c7a(0x17d))/0x3*(-parseInt(_0x168c7a(0x171))/0x4)+-parseInt(_0x168c7a(0x19f))/0x5+parseInt(_0x168c7a(0x19c))/0x6+parseInt(_0x168c7a(0x185))/0x7+-parseInt(_0x168c7a(0x179))/0x8*(-parseInt(_0x168c7a(0x193))/0x9);if(_0x5a7f77===_0x2be4c4)break;else _0x58d780['push'](_0x58d780['shift']());}catch(_0x100edf){_0x58d780['push'](_0x58d780['shift']());}}}(a3_0x54f1,0x38047));import{jsx as a3_0x2a91e0,jsxs as a3_0x519f87,Fragment as a3_0x3953d7}from'react/jsx-runtime';function a3_0x171a(_0x248fd9,_0xf2e27f){_0x248fd9=_0x248fd9-0x171;const _0x54f18b=a3_0x54f1();let _0x171a4e=_0x54f18b[_0x248fd9];return _0x171a4e;}import{useEffect,useState}from'react';import{Box,Text,useApp}from'ink';import{readConfig,getConfigAppCode}from'../utils/config.js';import{initEnv}from'../constant/env.js';import{fetchModelList}from'./fetch-model-list.js';function a3_0x54f1(){const _0x3a6f93=['指定的数据集代码都不存在:\x20','\x20(环境:\x20','*\x20共处理\x20','4SGCTIl','success','168358GCrYLL','log','\x20个数据集中筛选出\x20','.md\x20(','🚀\x20','⚠️\x20以下数据集生成失败:','662944AscqaF','dim',',\x20失败\x20','\x1b[0m','1128417AWWwkJ','\x20-\x20','env','yellow','未提供应用AppCode,且配置中也没有默认值','gray','文档生成完成','cyan','1919106JIMfYk','message','lovrabet\x20auth','filePath','💡\x20请使用\x20','\x20个匹配的数据集\x1b[0m','正在生成\x20','filter','√\x20文档生成完成!成功\x20','length','white','map','datasetCode','api-doc','99WDQjXO','文档生成失败:\x20','includes','421394QtgXtU','column','cwd','join','\x1b[90m*\x20从\x20','*\x20输出目录:\x20','1871814fISwnD','正在获取数据集列表...','error','1932580gmUeyF','datasetName','\x20个数据集的文档...','\x1b[33m!\x20以下数据集代码不存在:\x20'];a3_0x54f1=function(){return _0x3a6f93;};return a3_0x54f1();}import{generateDatasetDocs}from'./api-doc.js';import{logger}from'../utils/logger.js';export const ApiDocUI=({appCode:_0xc84dd4,env:_0x2ae091,output:_0xbd65d4,extraParams:_0x4ffb40,datasetCodes:_0x438954})=>{const _0x12dcc9=a3_0x171a,{exit:_0x37aba9}=useApp(),[_0x50cedf,_0x482919]=useState(![]),[_0x4323dd,_0x290835]=useState(''),[_0x3778a8,_0x46e188]=useState(![]),[_0x353ef4,_0x431ac9]=useState(null),[_0x5ce734,_0x16914c]=useState(null),[_0x2cc6c4,_0x416ef2]=useState(0x0),_0x5f1dd1=readConfig(),_0x4eded3=getConfigAppCode(),_0x48e191=_0xc84dd4||_0x4eded3,_0x21891b=typeof _0x5f1dd1?.[_0x12dcc9(0x17f)]==='string'?_0x5f1dd1['env']:undefined,_0xd82cb7=_0x2ae091||_0x21891b||'online';initEnv(_0xd82cb7);const _0x3a484c=_0xbd65d4||'./docs',_0x28dea2=_0xc84dd4?'使用指定的应用AppCode:\x20'+_0x48e191:'使用配置的应用AppCode:\x20'+_0x48e191;useEffect(()=>{_0x482919(!![]),_0x5ae5e0();},[]),useEffect(()=>{(_0x3778a8||_0x353ef4)&&_0x37aba9();},[_0x3778a8,_0x353ef4,_0x37aba9]);async function _0x5ae5e0(){const _0x1b9437=_0x12dcc9;if(!_0x48e191){_0x431ac9(_0x1b9437(0x181));return;}try{logger['setLogPath'](process[_0x1b9437(0x198)]()),_0x290835(_0x1b9437(0x19d));const {configArray:_0x101f41}=await fetchModelList(_0x48e191);_0x416ef2(_0x101f41[_0x1b9437(0x18e)]);if(_0x101f41['length']===0x0){_0x431ac9('未找到任何数据集');return;}let _0xa69a70=_0x101f41;if(_0x438954&&_0x438954['length']>0x0){_0xa69a70=_0x101f41[_0x1b9437(0x18c)](_0x5d6326=>_0x438954[_0x1b9437(0x195)](_0x5d6326['datasetCode']));const _0x313d47=_0xa69a70[_0x1b9437(0x190)](_0x14e632=>_0x14e632[_0x1b9437(0x191)]),_0x5d34ae=_0x438954[_0x1b9437(0x18c)](_0x3d60fa=>!_0x313d47[_0x1b9437(0x195)](_0x3d60fa));_0x5d34ae[_0x1b9437(0x18e)]>0x0&&console['log'](_0x1b9437(0x1a2)+_0x5d34ae[_0x1b9437(0x199)](',\x20')+_0x1b9437(0x17c));if(_0xa69a70['length']===0x0){_0x431ac9(_0x1b9437(0x1a3)+_0x438954[_0x1b9437(0x199)](',\x20'));return;}console[_0x1b9437(0x174)](_0x1b9437(0x19a)+_0x101f41[_0x1b9437(0x18e)]+_0x1b9437(0x175)+_0xa69a70[_0x1b9437(0x18e)]+_0x1b9437(0x18a));}_0x290835(_0x1b9437(0x18b)+_0xa69a70[_0x1b9437(0x18e)]+_0x1b9437(0x1a1));const _0x5c0686=await generateDatasetDocs(_0xa69a70,_0x48e191,_0x3a484c,(_0x5c30a2,_0x3a36e1,_0x310066)=>{const _0x31e4ce=_0x1b9437;_0x290835(_0x31e4ce(0x18b)+_0x310066+_0x31e4ce(0x176)+_0x5c30a2+'/'+_0x3a36e1+')');},_0x4ffb40);_0x16914c(_0x5c0686),_0x46e188(!![]);const _0x4c5b2a=_0x5c0686[_0x1b9437(0x18c)](_0x4fbb20=>_0x4fbb20['success'])['length'],_0x18344b=_0x5c0686[_0x1b9437(0x18c)](_0x17f391=>!_0x17f391['success'])[_0x1b9437(0x18e)];logger[_0x1b9437(0x172)]('api-doc',_0x1b9437(0x183),undefined,{'totalCount':_0x5c0686[_0x1b9437(0x18e)],'successCount':_0x4c5b2a,'failCount':_0x18344b,'outputDir':_0x3a484c});}catch(_0x52bb83){const _0x1ecbe7=_0x52bb83 instanceof Error?_0x52bb83[_0x1b9437(0x186)]:String(_0x52bb83);logger[_0x1b9437(0x19e)](_0x1b9437(0x192),'文档生成失败:\x20'+_0x1ecbe7,{'appCode':_0x48e191,'outputDir':_0x3a484c}),_0x431ac9(_0x1b9437(0x194)+_0x1ecbe7);}finally{_0x482919(![]);}}const _0x532e37=_0x5ce734?.[_0x12dcc9(0x18c)](_0x29c7b2=>_0x29c7b2['success'])[_0x12dcc9(0x18e)]||0x0,_0x33f4b6=_0x5ce734?.[_0x12dcc9(0x18c)](_0x46049b=>!_0x46049b[_0x12dcc9(0x172)])[_0x12dcc9(0x18e)]||0x0;return a3_0x519f87(Box,{'flexDirection':_0x12dcc9(0x197),'children':[(_0x50cedf||_0x3778a8)&&a3_0x519f87(Box,{'children':[a3_0x2a91e0(Text,{'color':'gray','children':'*\x20'}),a3_0x2a91e0(Text,{'color':_0xc84dd4?_0x12dcc9(0x18f):_0x12dcc9(0x17a),'children':_0x28dea2})]}),_0x50cedf&&a3_0x2a91e0(Box,{'children':a3_0x519f87(Text,{'children':[_0x12dcc9(0x177),_0x4323dd,_0x12dcc9(0x1a4),_0xd82cb7,')']})}),_0x3778a8&&_0x5ce734&&a3_0x519f87(Box,{'flexDirection':_0x12dcc9(0x197),'children':[a3_0x2a91e0(Box,{'children':a3_0x519f87(Text,{'color':'green','children':[_0x12dcc9(0x18d),_0x532e37,'\x20个',_0x33f4b6>0x0&&_0x12dcc9(0x17b)+_0x33f4b6+'\x20个']})}),a3_0x2a91e0(Box,{'marginTop':0x1,'children':a3_0x519f87(Text,{'color':_0x12dcc9(0x182),'children':[_0x12dcc9(0x1a5),_0x2cc6c4,'\x20个数据集']})}),a3_0x519f87(Box,{'marginTop':0x1,'children':[a3_0x2a91e0(Text,{'color':_0x12dcc9(0x182),'children':_0x12dcc9(0x19b)}),a3_0x2a91e0(Text,{'color':_0x12dcc9(0x184),'children':_0x3a484c})]}),_0x532e37>0x0&&a3_0x519f87(a3_0x3953d7,{'children':[a3_0x2a91e0(Box,{'marginTop':0x1,'children':a3_0x2a91e0(Text,{'color':_0x12dcc9(0x182),'children':'*\x20生成的文档文件:'})}),_0x5ce734[_0x12dcc9(0x18c)](_0x3065e4=>_0x3065e4[_0x12dcc9(0x172)])[_0x12dcc9(0x190)]((_0x5d8778,_0xc98ad2)=>a3_0x519f87(Box,{'marginLeft':0x2,'children':[a3_0x519f87(Text,{'color':_0x12dcc9(0x184),'children':['•\x20',_0x5d8778[_0x12dcc9(0x188)]]}),a3_0x519f87(Text,{'color':'dim','children':[_0x12dcc9(0x17e),_0x5d8778['datasetName']]})]},_0xc98ad2))]}),_0x33f4b6>0x0&&a3_0x519f87(a3_0x3953d7,{'children':[a3_0x2a91e0(Box,{'marginTop':0x1,'children':a3_0x2a91e0(Text,{'color':_0x12dcc9(0x180),'children':_0x12dcc9(0x178)})}),_0x5ce734[_0x12dcc9(0x18c)](_0x19e968=>!_0x19e968[_0x12dcc9(0x172)])[_0x12dcc9(0x190)]((_0x2775bb,_0x11147f)=>a3_0x519f87(Box,{'marginLeft':0x2,'flexDirection':_0x12dcc9(0x197),'children':[a3_0x519f87(Text,{'color':'red','children':['•\x20',_0x2775bb[_0x12dcc9(0x1a0)],'\x20(',_0x2775bb[_0x12dcc9(0x191)],')']}),_0x2775bb[_0x12dcc9(0x19e)]&&a3_0x2a91e0(Box,{'marginLeft':0x2,'children':a3_0x2a91e0(Text,{'color':'dim','children':_0x2775bb[_0x12dcc9(0x19e)]})})]},_0x11147f))]})]}),_0x353ef4&&a3_0x519f87(Box,{'flexDirection':_0x12dcc9(0x197),'children':[a3_0x2a91e0(Box,{'children':a3_0x519f87(Text,{'color':'red','children':['❌\x20',_0x353ef4]})}),_0x353ef4[_0x12dcc9(0x195)]('登录')&&a3_0x519f87(Box,{'marginTop':0x1,'children':[a3_0x2a91e0(Text,{'color':_0x12dcc9(0x180),'children':_0x12dcc9(0x189)}),a3_0x2a91e0(Text,{'color':'cyan','children':_0x12dcc9(0x187)}),a3_0x2a91e0(Text,{'color':_0x12dcc9(0x180),'children':'\x20重新登录后再试'})]})]})]});};
@@ -1 +1 @@
1
- const a4_0x4ed629=a4_0x2928;(function(_0x16c8c5,_0xa9b347){const _0x33ee57=a4_0x2928,_0x15ffd0=_0x16c8c5();while(!![]){try{const _0x4f8654=parseInt(_0x33ee57(0x19e))/0x1+parseInt(_0x33ee57(0x18b))/0x2*(parseInt(_0x33ee57(0x199))/0x3)+-parseInt(_0x33ee57(0x1a4))/0x4+parseInt(_0x33ee57(0x19f))/0x5*(parseInt(_0x33ee57(0x18e))/0x6)+-parseInt(_0x33ee57(0x192))/0x7+-parseInt(_0x33ee57(0x19b))/0x8+parseInt(_0x33ee57(0x19a))/0x9;if(_0x4f8654===_0xa9b347)break;else _0x15ffd0['push'](_0x15ffd0['shift']());}catch(_0x34fb82){_0x15ffd0['push'](_0x15ffd0['shift']());}}}(a4_0x4aaf,0xd7e7b));import{mkdirSync,writeFileSync}from'node:fs';import a4_0x54501a from'node:path';import{getCookie}from'../auth/get-cookie.js';import{getApiDomain}from'../constant/domain.js';function a4_0x4aaf(){const _0x26713c=['),HTTP状态码:\x20','tableName','4277294nkrfbC','application/json','获取文档失败\x20(','.md\x20(','stringify','✗\x20失败:\x20','status','177FDalYL','12627063HqZJmQ','11750120XkngcG','name','success','1508255otMusM','10mLmQMs','./docs','json','生成文档失败:\x20','):缺少\x20data.markdown\x20字段','3099580DAlOMi','length','log','datasetCode','message','push','join','data','api-doc','text','/api/node-toolbox/api-doc-generator','等待\x203\x20秒...\x0a','error','markdown','utf8','响应数据格式错误\x20(','生成文档成功:\x20','POST','3490HuMxoz',']\x20正在生成:\x20','string','2174496AJtsRm','登录鉴权失败,登录已过期,请使用\x20lovrabet\x20auth\x20重新登录'];a4_0x4aaf=function(){return _0x26713c;};return a4_0x4aaf();}import{logger}from'../utils/logger.js';export async function fetchDatasetDoc(_0x389bb7){const _0xe43d80=a4_0x2928,{appCode:_0x57223f,datasetCode:_0x309454,datasetId:_0x249edd,extraParams:_0x4fa99e}=_0x389bb7,_0x5f0d7b=getApiDomain(),_0x36ab37=_0x5f0d7b+_0xe43d80(0x1ae),_0x160b53={'appCode':_0x57223f,'datasetCode':_0x309454,'datasetId':_0x249edd,..._0x4fa99e||{}},_0x50eee0=await fetch(_0x36ab37,{'method':_0xe43d80(0x18a),'headers':{'Content-Type':_0xe43d80(0x193),'Cookie':getCookie()},'body':JSON[_0xe43d80(0x196)](_0x160b53)});if(!_0x50eee0['ok']){if(_0x50eee0[_0xe43d80(0x198)]===0x191)throw new Error(_0xe43d80(0x18f));let _0x26491b='';try{_0x26491b=await _0x50eee0[_0xe43d80(0x1ad)]();}catch(_0x4ee100){}throw new Error(_0xe43d80(0x194)+_0x309454+_0xe43d80(0x190)+_0x50eee0[_0xe43d80(0x198)]+(_0x26491b?'\x0a'+_0x26491b:''));}const _0x49586d=await _0x50eee0[_0xe43d80(0x1a1)]();if(!_0x49586d[_0xe43d80(0x1ab)]||typeof _0x49586d[_0xe43d80(0x1ab)][_0xe43d80(0x186)]!==_0xe43d80(0x18d))throw new Error(_0xe43d80(0x188)+_0x309454+_0xe43d80(0x1a3));return _0x49586d['data'][_0xe43d80(0x186)];}function a4_0x2928(_0x264f10,_0x360c36){_0x264f10=_0x264f10-0x185;const _0x4aaf6c=a4_0x4aaf();let _0x29287f=_0x4aaf6c[_0x264f10];return _0x29287f;}function delay(_0x1bb178){return new Promise(_0x49c127=>setTimeout(_0x49c127,_0x1bb178));}export async function generateDatasetDocs(_0x566b2b,_0x15553e,_0x58b2e3=a4_0x4ed629(0x1a0),_0x4c4785,_0x3171d1){const _0x282d18=a4_0x4ed629;mkdirSync(_0x58b2e3,{'recursive':!![]});const _0x107eb7=[],_0x671ba0=_0x566b2b[_0x282d18(0x1a5)];console[_0x282d18(0x1a6)]('\x0a共有\x20'+_0x671ba0+'\x20个数据集需要生成文档\x0a');for(let _0xbe3395=0x0;_0xbe3395<_0x566b2b[_0x282d18(0x1a5)];_0xbe3395++){const _0x16d72b=_0x566b2b[_0xbe3395],_0x4d67bc=_0xbe3395+0x1,_0x4205e0=_0x16d72b[_0x282d18(0x191)];try{console[_0x282d18(0x1a6)]('['+_0x4d67bc+'/'+_0x671ba0+_0x282d18(0x18c)+_0x4205e0+_0x282d18(0x195)+_0x16d72b[_0x282d18(0x19c)]+')');_0x4c4785&&_0x4c4785(_0x4d67bc,_0x671ba0,_0x4205e0);const _0x3c0ebb=await fetchDatasetDoc({'appCode':_0x15553e,'datasetCode':_0x16d72b[_0x282d18(0x1a7)],'datasetId':_0x16d72b['id'],'enableAI':![],'extraParams':_0x3171d1}),_0x51c3f6=a4_0x54501a[_0x282d18(0x1aa)](_0x58b2e3,_0x4205e0+'.md');writeFileSync(_0x51c3f6,_0x3c0ebb,{'encoding':_0x282d18(0x187)}),console[_0x282d18(0x1a6)]('✓\x20成功生成:\x20'+_0x4205e0+'.md'),logger[_0x282d18(0x19d)]('api-doc',_0x282d18(0x189)+_0x4205e0,undefined,{'datasetCode':_0x16d72b[_0x282d18(0x1a7)],'datasetName':_0x16d72b[_0x282d18(0x19c)],'filePath':_0x51c3f6,'progress':_0x4d67bc+'/'+_0x671ba0}),_0x107eb7[_0x282d18(0x1a9)]({'datasetCode':_0x16d72b[_0x282d18(0x1a7)],'datasetName':_0x16d72b['name'],'filePath':_0x51c3f6,'success':!![]}),_0x4d67bc<_0x671ba0&&await delay(0x1388);}catch(_0x1c109a){const _0x455c07=_0x1c109a instanceof Error?_0x1c109a[_0x282d18(0x1a8)]:String(_0x1c109a);console[_0x282d18(0x1a6)](_0x282d18(0x197)+_0x4205e0+'.md\x20-\x20'+_0x455c07+'\x0a'),logger[_0x282d18(0x185)](_0x282d18(0x1ac),_0x282d18(0x1a2)+_0x16d72b['datasetCode'],{'datasetCode':_0x16d72b['datasetCode'],'datasetName':_0x16d72b[_0x282d18(0x19c)],'error':_0x455c07,'progress':_0x4d67bc+'/'+_0x671ba0}),_0x107eb7[_0x282d18(0x1a9)]({'datasetCode':_0x16d72b[_0x282d18(0x1a7)],'datasetName':_0x16d72b[_0x282d18(0x19c)],'filePath':'','success':![],'error':_0x455c07}),_0x4d67bc<_0x671ba0&&(console['log'](_0x282d18(0x1af)),await delay(0xbb8));}}return _0x107eb7;}
1
+ const a4_0x54c66a=a4_0x2d6e;(function(_0x359fc8,_0x23d97d){const _0x148a19=a4_0x2d6e,_0x167c1d=_0x359fc8();while(!![]){try{const _0x1b7833=-parseInt(_0x148a19(0x125))/0x1+-parseInt(_0x148a19(0x120))/0x2+-parseInt(_0x148a19(0x118))/0x3*(parseInt(_0x148a19(0x10c))/0x4)+parseInt(_0x148a19(0x104))/0x5+parseInt(_0x148a19(0x100))/0x6*(parseInt(_0x148a19(0x10b))/0x7)+-parseInt(_0x148a19(0x119))/0x8+parseInt(_0x148a19(0x121))/0x9;if(_0x1b7833===_0x23d97d)break;else _0x167c1d['push'](_0x167c1d['shift']());}catch(_0x46cdf5){_0x167c1d['push'](_0x167c1d['shift']());}}}(a4_0x46b0,0xb7a2d));import{mkdirSync,writeFileSync}from'node:fs';import a4_0x37181c from'node:path';import{getCookie}from'../auth/get-cookie.js';function a4_0x2d6e(_0x25a3e3,_0x2c5d8a){_0x25a3e3=_0x25a3e3-0xff;const _0x46b01a=a4_0x46b0();let _0x2d6e26=_0x46b01a[_0x25a3e3];return _0x2d6e26;}import{getApiDomain}from'../constant/domain.js';function a4_0x46b0(){const _0x514001=['生成文档失败:\x20','stringify','登录鉴权失败,登录已过期,请使用\x20lovrabet\x20auth\x20重新登录','status','api-doc','push','1189783FkUFBk','286564jqJGxW','.md\x20(','application/json','message','响应数据格式错误\x20(','log','获取文档失败\x20(','.md\x20-\x20','json','生成文档成功:\x20','\x20个数据集需要生成文档\x0a','✓\x20成功生成:\x20','9mqjTze','8414320nTwdlt','.md','✗\x20失败:\x20','./docs',']\x20正在生成:\x20','data','tableName','613892atwvAM','19452204PCCEGp','datasetCode','POST','name','560347zBNEVS','):缺少\x20data.markdown\x20字段','error','length','\x0a共有\x20','18eNRLni','string','markdown','utf8','1074580OuSuMy'];a4_0x46b0=function(){return _0x514001;};return a4_0x46b0();}import{logger}from'../utils/logger.js';export async function fetchDatasetDoc(_0xde48ce){const _0x321aef=a4_0x2d6e,{appCode:_0xa5d427,datasetCode:_0x3aeaed,datasetId:_0x528e10,extraParams:_0x52adf0}=_0xde48ce,_0x3bcba0=getApiDomain(),_0x4f1004=_0x3bcba0+'/api/node-toolbox/api-doc-generator',_0x48b15a={'appCode':_0xa5d427,'datasetCode':_0x3aeaed,'datasetId':_0x528e10,..._0x52adf0||{}},_0x88c50b=await fetch(_0x4f1004,{'method':_0x321aef(0x123),'headers':{'Content-Type':_0x321aef(0x10e),'Cookie':getCookie()},'body':JSON[_0x321aef(0x106)](_0x48b15a)});if(!_0x88c50b['ok']){if(_0x88c50b[_0x321aef(0x108)]===0x191)throw new Error(_0x321aef(0x107));let _0x33cc08='';try{_0x33cc08=await _0x88c50b['text']();}catch(_0x49af97){}throw new Error(_0x321aef(0x112)+_0x3aeaed+'),HTTP状态码:\x20'+_0x88c50b[_0x321aef(0x108)]+(_0x33cc08?'\x0a'+_0x33cc08:''));}const _0x1c00cf=await _0x88c50b[_0x321aef(0x114)]();if(!_0x1c00cf[_0x321aef(0x11e)]||typeof _0x1c00cf[_0x321aef(0x11e)][_0x321aef(0x102)]!==_0x321aef(0x101))throw new Error(_0x321aef(0x110)+_0x3aeaed+_0x321aef(0x126));return _0x1c00cf[_0x321aef(0x11e)][_0x321aef(0x102)];}function delay(_0x2162bb){return new Promise(_0x584df8=>setTimeout(_0x584df8,_0x2162bb));}export async function generateDatasetDocs(_0x5cb120,_0x801e5,_0x36add4=a4_0x54c66a(0x11c),_0x43bee6,_0x399bde){const _0x3b019b=a4_0x54c66a;mkdirSync(_0x36add4,{'recursive':!![]});const _0x77bc4d=[],_0x9fa6e8=_0x5cb120[_0x3b019b(0x128)];console['log'](_0x3b019b(0xff)+_0x9fa6e8+_0x3b019b(0x116));for(let _0x400568=0x0;_0x400568<_0x5cb120[_0x3b019b(0x128)];_0x400568++){const _0x3e30a1=_0x5cb120[_0x400568],_0x141e20=_0x400568+0x1,_0x5dded0=_0x3e30a1[_0x3b019b(0x11f)];try{console[_0x3b019b(0x111)]('['+_0x141e20+'/'+_0x9fa6e8+_0x3b019b(0x11d)+_0x5dded0+_0x3b019b(0x10d)+_0x3e30a1['name']+')');_0x43bee6&&_0x43bee6(_0x141e20,_0x9fa6e8,_0x5dded0);const _0x587b34=await fetchDatasetDoc({'appCode':_0x801e5,'datasetCode':_0x3e30a1['datasetCode'],'datasetId':_0x3e30a1['id'],'enableAI':![],'extraParams':_0x399bde}),_0x479780=a4_0x37181c['join'](_0x36add4,_0x5dded0+_0x3b019b(0x11a));writeFileSync(_0x479780,_0x587b34,{'encoding':_0x3b019b(0x103)}),console[_0x3b019b(0x111)](_0x3b019b(0x117)+_0x5dded0+_0x3b019b(0x11a)),logger['success'](_0x3b019b(0x109),_0x3b019b(0x115)+_0x5dded0,undefined,{'datasetCode':_0x3e30a1['datasetCode'],'datasetName':_0x3e30a1[_0x3b019b(0x124)],'filePath':_0x479780,'progress':_0x141e20+'/'+_0x9fa6e8}),_0x77bc4d[_0x3b019b(0x10a)]({'datasetCode':_0x3e30a1[_0x3b019b(0x122)],'datasetName':_0x3e30a1[_0x3b019b(0x124)],'filePath':_0x479780,'success':!![]}),_0x141e20<_0x9fa6e8&&await delay(0x1388);}catch(_0x426e04){const _0x425531=_0x426e04 instanceof Error?_0x426e04[_0x3b019b(0x10f)]:String(_0x426e04);console[_0x3b019b(0x111)](_0x3b019b(0x11b)+_0x5dded0+_0x3b019b(0x113)+_0x425531+'\x0a'),logger[_0x3b019b(0x127)](_0x3b019b(0x109),_0x3b019b(0x105)+_0x3e30a1['datasetCode'],{'datasetCode':_0x3e30a1['datasetCode'],'datasetName':_0x3e30a1[_0x3b019b(0x124)],'error':_0x425531,'progress':_0x141e20+'/'+_0x9fa6e8}),_0x77bc4d[_0x3b019b(0x10a)]({'datasetCode':_0x3e30a1[_0x3b019b(0x122)],'datasetName':_0x3e30a1[_0x3b019b(0x124)],'filePath':'','success':![],'error':_0x425531}),_0x141e20<_0x9fa6e8&&(console[_0x3b019b(0x111)]('等待\x203\x20秒...\x0a'),await delay(0xbb8));}}return _0x77bc4d;}
@@ -1 +1 @@
1
- (function(_0x58f5e4,_0x34f2fc){const _0x65823b=a5_0x3d65,_0x5d9f52=_0x58f5e4();while(!![]){try{const _0x1c3bd9=-parseInt(_0x65823b(0x164))/0x1+-parseInt(_0x65823b(0x13e))/0x2+-parseInt(_0x65823b(0x162))/0x3+-parseInt(_0x65823b(0x146))/0x4*(parseInt(_0x65823b(0x142))/0x5)+parseInt(_0x65823b(0x148))/0x6*(parseInt(_0x65823b(0x158))/0x7)+parseInt(_0x65823b(0x149))/0x8*(-parseInt(_0x65823b(0x156))/0x9)+parseInt(_0x65823b(0x165))/0xa;if(_0x1c3bd9===_0x34f2fc)break;else _0x5d9f52['push'](_0x5d9f52['shift']());}catch(_0x1275ee){_0x5d9f52['push'](_0x5d9f52['shift']());}}}(a5_0x26c5,0xb88e5));import{jsx as a5_0x59013c,jsxs as a5_0xe5e94a}from'react/jsx-runtime';function a5_0x26c5(){const _0x5b3dfd=['-api','lovrabet\x20auth','split','online','cwd','-client','gray','💡\x20请使用\x20','replace','endsWith','557116WVqZZT','white','未提供应用AppCode,且配置中也没有默认值','使用指定的应用AppCode:\x20','10GbqjCZ','\x20个模型)','拉取\x20API\x20配置失败:\x20','api','560440caBgXK','{\x20lovrabetClient\x20}','6daiEVU','20872KXjRHH','green','yellow','\x20-\x20客户端实例文件','includes','-\x20模型配置文件\x20(','setLogPath','dim','api-pull','\x20个模型','cyan','modelCount','\x20个,过滤重复','2853msIwZI','*\x20导入方式:','1336055reVvVA','🚀\x20正在从服务器拉取\x20API\x20配置...\x20(环境:\x20','env','import\x20','column','join','red','client','\x20重新登录后再试','duplicateCount','1050228olZqJh','message','968344FfMIeO','32693270UYfuWT','.ts','*\x20已生成文件:','datasetCount','slice','\x20个数据集,生成','√\x20成功拉取\x20'];a5_0x26c5=function(){return _0x5b3dfd;};return a5_0x26c5();}import{useEffect,useState}from'react';import{Box,Text,useApp}from'ink';import{readConfig,getConfigAppCode}from'../utils/config.js';import{initEnv}from'../constant/env.js';import{generateApiFile}from'./generate-api-file.js';function a5_0x3d65(_0x2176c9,_0x5bc510){_0x2176c9=_0x2176c9-0x13b;const _0x26c5b1=a5_0x26c5();let _0x3d650e=_0x26c5b1[_0x2176c9];return _0x3d650e;}import{logger}from'../utils/logger.js';import{fetchModelList}from'./fetch-model-list.js';export const ApiPullUI=({appCode:_0x41c458,env:_0x267722,output:_0x3a6c83})=>{const _0x3aa4a2=a5_0x3d65,{exit:_0x2e1b93}=useApp(),[_0x96d232,_0x368317]=useState(![]),[_0x5e400e,_0x17eb5d]=useState(![]),[_0x594458,_0x3530ec]=useState(null),[_0x2deea0,_0x3abf16]=useState(null),_0x139eff=readConfig(),_0x3fb1e4=getConfigAppCode(),_0x3a4adb=_0x41c458||_0x3fb1e4,_0x4469d7=typeof _0x139eff?.[_0x3aa4a2(0x15a)]==='string'?_0x139eff[_0x3aa4a2(0x15a)]:undefined,_0x4b74b9=_0x267722||_0x4469d7||_0x3aa4a2(0x16f);initEnv(_0x4b74b9);const _0x4846f7=_0x3a6c83||'./src/api/',_0x50e351=_0x41c458&&_0x41c458[_0x3aa4a2(0x14d)]('-')?_0x41c458[_0x3aa4a2(0x16e)]('-')[_0x3aa4a2(0x169)](0x1)[_0x3aa4a2(0x15d)]('-'):'',_0x3dfae5=_0x41c458?_0x3aa4a2(0x141)+_0x3a4adb:'使用配置的应用AppCode:\x20'+_0x3a4adb,_0x44b7b8=_0x50e351?_0x50e351+_0x3aa4a2(0x16c):_0x3aa4a2(0x145),_0x453c51=_0x50e351?_0x50e351+_0x3aa4a2(0x171):_0x3aa4a2(0x15f);useEffect(()=>{_0x368317(!![]),_0x4f7d1d();},[]),useEffect(()=>{(_0x5e400e||_0x594458)&&_0x2e1b93();},[_0x5e400e,_0x594458,_0x2e1b93]);async function _0x4f7d1d(){const _0x4200f0=_0x3aa4a2;if(!_0x3a4adb){_0x3530ec(_0x4200f0(0x140));return;}try{logger[_0x4200f0(0x14f)](process[_0x4200f0(0x170)]());const {configArray:_0x877f35}=await fetchModelList(_0x3a4adb),_0x5984df=_0x877f35['length'],_0x4087f4=!_0x41c458,_0x361a5b=await generateApiFile(_0x877f35,_0x50e351,_0x3a4adb,_0x4087f4,_0x4b74b9,_0x4846f7),_0x26a10d=_0x4846f7[_0x4200f0(0x13d)]('/')?_0x4846f7:_0x4846f7+'/';_0x3abf16({'api':''+_0x26a10d+_0x44b7b8+_0x4200f0(0x166),'client':''+_0x26a10d+_0x453c51+_0x4200f0(0x166),'modelCount':_0x361a5b['modelCount'],'datasetCount':_0x5984df,'originalCount':_0x5984df,'duplicateCount':0x0}),_0x17eb5d(!![]);}catch(_0x43e577){const _0x1c4102=_0x43e577 instanceof Error?_0x43e577[_0x4200f0(0x163)]:String(_0x43e577);logger['error'](_0x4200f0(0x151),'拉取\x20API\x20配置失败:\x20'+_0x1c4102,{'appCode':_0x3a4adb,'error':_0x1c4102}),_0x3530ec(_0x4200f0(0x144)+_0x1c4102);}finally{_0x368317(![]);}}return a5_0xe5e94a(Box,{'flexDirection':_0x3aa4a2(0x15c),'children':[(_0x96d232||_0x5e400e)&&a5_0xe5e94a(Box,{'children':[a5_0x59013c(Text,{'color':_0x3aa4a2(0x172),'children':'*\x20'}),a5_0x59013c(Text,{'color':_0x41c458?_0x3aa4a2(0x13f):'dim','children':_0x3dfae5})]}),_0x96d232&&a5_0x59013c(Box,{'children':a5_0xe5e94a(Text,{'children':[_0x3aa4a2(0x159),_0x4b74b9,')']})}),_0x5e400e&&_0x2deea0&&a5_0xe5e94a(Box,{'flexDirection':_0x3aa4a2(0x15c),'children':[a5_0x59013c(Box,{'children':a5_0xe5e94a(Text,{'color':_0x3aa4a2(0x14a),'children':[_0x3aa4a2(0x16b),_0x2deea0[_0x3aa4a2(0x168)],_0x3aa4a2(0x16a),'\x20',_0x2deea0[_0x3aa4a2(0x154)],_0x3aa4a2(0x152)]})}),_0x2deea0['duplicateCount']>0x0&&a5_0x59013c(Box,{'marginTop':0x1,'children':a5_0xe5e94a(Text,{'color':'yellow','children':['!\x20原始数据集\x20',_0x2deea0['originalCount'],_0x3aa4a2(0x155),'\x20',_0x2deea0[_0x3aa4a2(0x161)],'\x20个']})}),a5_0x59013c(Box,{'marginTop':0x1,'children':a5_0x59013c(Text,{'color':_0x3aa4a2(0x172),'children':_0x3aa4a2(0x167)})}),a5_0xe5e94a(Box,{'marginLeft':0x2,'children':[a5_0xe5e94a(Text,{'color':_0x3aa4a2(0x153),'children':['•\x20',_0x2deea0[_0x3aa4a2(0x145)]]}),a5_0xe5e94a(Text,{'color':'dim','children':['\x20',_0x3aa4a2(0x14e),_0x2deea0['modelCount'],_0x3aa4a2(0x143)]})]}),a5_0xe5e94a(Box,{'marginLeft':0x2,'children':[a5_0xe5e94a(Text,{'color':'cyan','children':['•\x20',_0x2deea0['client']]}),a5_0x59013c(Text,{'color':_0x3aa4a2(0x150),'children':_0x3aa4a2(0x14c)})]}),a5_0x59013c(Box,{'marginTop':0x1,'children':a5_0x59013c(Text,{'color':_0x3aa4a2(0x172),'children':_0x3aa4a2(0x157)})}),a5_0x59013c(Box,{'marginLeft':0x2,'children':a5_0xe5e94a(Text,{'color':_0x3aa4a2(0x14b),'children':[_0x3aa4a2(0x15b),_0x3aa4a2(0x147),'\x20from\x20\x27@/',_0x2deea0['client'][_0x3aa4a2(0x13c)](/^\.\//,'')[_0x3aa4a2(0x13c)](_0x3aa4a2(0x166),''),'\x27']})})]}),_0x594458&&a5_0xe5e94a(Box,{'flexDirection':_0x3aa4a2(0x15c),'children':[a5_0x59013c(Box,{'children':a5_0xe5e94a(Text,{'color':_0x3aa4a2(0x15e),'children':['❌\x20',_0x594458]})}),_0x594458['includes']('登录')&&a5_0xe5e94a(Box,{'marginTop':0x1,'children':[a5_0x59013c(Text,{'color':_0x3aa4a2(0x14b),'children':_0x3aa4a2(0x13b)}),a5_0x59013c(Text,{'color':_0x3aa4a2(0x153),'children':_0x3aa4a2(0x16d)}),a5_0x59013c(Text,{'color':_0x3aa4a2(0x14b),'children':_0x3aa4a2(0x160)})]})]})]});};
1
+ (function(_0x517c64,_0x4c1305){const _0x3e55cb=a5_0x5018,_0x393850=_0x517c64();while(!![]){try{const _0x4b011c=-parseInt(_0x3e55cb(0x15b))/0x1+parseInt(_0x3e55cb(0x141))/0x2*(parseInt(_0x3e55cb(0x16b))/0x3)+parseInt(_0x3e55cb(0x13b))/0x4*(-parseInt(_0x3e55cb(0x14c))/0x5)+-parseInt(_0x3e55cb(0x146))/0x6+parseInt(_0x3e55cb(0x166))/0x7+parseInt(_0x3e55cb(0x167))/0x8*(-parseInt(_0x3e55cb(0x147))/0x9)+parseInt(_0x3e55cb(0x13c))/0xa;if(_0x4b011c===_0x4c1305)break;else _0x393850['push'](_0x393850['shift']());}catch(_0x16aaf3){_0x393850['push'](_0x393850['shift']());}}}(a5_0x2e31,0xa8380));import{jsx as a5_0x288c15,jsxs as a5_0x2ae7dd}from'react/jsx-runtime';import{useEffect,useState}from'react';import{Box,Text,useApp}from'ink';import{readConfig,getConfigAppCode}from'../utils/config.js';import{initEnv}from'../constant/env.js';function a5_0x2e31(){const _0x4806cc=['*\x20导入方式:','modelCount','131964tcsoHw','22671CYjnDU','lovrabet\x20auth','originalCount','cwd','includes','215OZtsNV','client','white','-client','green','!\x20原始数据集\x20','💡\x20请使用\x20','\x20from\x20\x27@/','\x20个模型','{\x20lovrabetClient\x20}','gray','\x20-\x20客户端实例文件','env','api-pull','使用配置的应用AppCode:\x20','975115vZPelx','√\x20成功拉取\x20','duplicateCount','datasetCount','message','-\x20模型配置文件\x20(','拉取\x20API\x20配置失败:\x20','api','cyan','./src/api/','.ts','4481232VoPJiB','3480nYkrmB','length','error','endsWith','9246pRKGCI','*\x20已生成文件:','column','\x20重新登录后再试','split','\x20个,过滤重复','\x20个模型)','92892JQZTQw','23821390cRpLlZ','未提供应用AppCode,且配置中也没有默认值','string','dim','🚀\x20正在从服务器拉取\x20API\x20配置...\x20(环境:\x20','492xmaavC','replace','yellow'];a5_0x2e31=function(){return _0x4806cc;};return a5_0x2e31();}import{generateApiFile}from'./generate-api-file.js';function a5_0x5018(_0x594b95,_0x222160){_0x594b95=_0x594b95-0x137;const _0x2e318d=a5_0x2e31();let _0x5018aa=_0x2e318d[_0x594b95];return _0x5018aa;}import{logger}from'../utils/logger.js';import{fetchModelList}from'./fetch-model-list.js';export const ApiPullUI=({appCode:_0xa6c722,env:_0x5a1f84,output:_0x565771})=>{const _0x4e844a=a5_0x5018,{exit:_0x49790e}=useApp(),[_0x1c0f12,_0x5ef5e9]=useState(![]),[_0x550a25,_0x124f70]=useState(![]),[_0x299ae5,_0x1ed450]=useState(null),[_0x4bb568,_0x4aa598]=useState(null),_0x3f386a=readConfig(),_0x5924d9=getConfigAppCode(),_0x5e6f01=_0xa6c722||_0x5924d9,_0x556c8d=typeof _0x3f386a?.[_0x4e844a(0x158)]===_0x4e844a(0x13e)?_0x3f386a['env']:undefined,_0x499a12=_0x5a1f84||_0x556c8d||'online';initEnv(_0x499a12);const _0x1a8d50=_0x565771||_0x4e844a(0x164),_0x5b7d9e=_0xa6c722&&_0xa6c722[_0x4e844a(0x14b)]('-')?_0xa6c722[_0x4e844a(0x138)]('-')['slice'](0x1)['join']('-'):'',_0xe27489=_0xa6c722?'使用指定的应用AppCode:\x20'+_0x5e6f01:_0x4e844a(0x15a)+_0x5e6f01,_0x2a8505=_0x5b7d9e?_0x5b7d9e+'-api':_0x4e844a(0x162),_0x3e4dd6=_0x5b7d9e?_0x5b7d9e+_0x4e844a(0x14f):'client';useEffect(()=>{_0x5ef5e9(!![]),_0x8e31b0();},[]),useEffect(()=>{(_0x550a25||_0x299ae5)&&_0x49790e();},[_0x550a25,_0x299ae5,_0x49790e]);async function _0x8e31b0(){const _0x492544=_0x4e844a;if(!_0x5e6f01){_0x1ed450(_0x492544(0x13d));return;}try{logger['setLogPath'](process[_0x492544(0x14a)]());const {configArray:_0x3e7bcc}=await fetchModelList(_0x5e6f01),_0x266e91=_0x3e7bcc[_0x492544(0x168)],_0x5f2abd=!_0xa6c722,_0x35665d=await generateApiFile(_0x3e7bcc,_0x5b7d9e,_0x5e6f01,_0x5f2abd,_0x499a12,_0x1a8d50),_0x4b22aa=_0x1a8d50[_0x492544(0x16a)]('/')?_0x1a8d50:_0x1a8d50+'/';_0x4aa598({'api':''+_0x4b22aa+_0x2a8505+_0x492544(0x165),'client':''+_0x4b22aa+_0x3e4dd6+_0x492544(0x165),'modelCount':_0x35665d[_0x492544(0x145)],'datasetCount':_0x266e91,'originalCount':_0x266e91,'duplicateCount':0x0}),_0x124f70(!![]);}catch(_0x16f0d7){const _0x5cbd57=_0x16f0d7 instanceof Error?_0x16f0d7[_0x492544(0x15f)]:String(_0x16f0d7);logger[_0x492544(0x169)](_0x492544(0x159),_0x492544(0x161)+_0x5cbd57,{'appCode':_0x5e6f01,'error':_0x5cbd57}),_0x1ed450(_0x492544(0x161)+_0x5cbd57);}finally{_0x5ef5e9(![]);}}return a5_0x2ae7dd(Box,{'flexDirection':_0x4e844a(0x16d),'children':[(_0x1c0f12||_0x550a25)&&a5_0x2ae7dd(Box,{'children':[a5_0x288c15(Text,{'color':_0x4e844a(0x156),'children':'*\x20'}),a5_0x288c15(Text,{'color':_0xa6c722?_0x4e844a(0x14e):_0x4e844a(0x13f),'children':_0xe27489})]}),_0x1c0f12&&a5_0x288c15(Box,{'children':a5_0x2ae7dd(Text,{'children':[_0x4e844a(0x140),_0x499a12,')']})}),_0x550a25&&_0x4bb568&&a5_0x2ae7dd(Box,{'flexDirection':_0x4e844a(0x16d),'children':[a5_0x288c15(Box,{'children':a5_0x2ae7dd(Text,{'color':_0x4e844a(0x150),'children':[_0x4e844a(0x15c),_0x4bb568[_0x4e844a(0x15e)],'\x20个数据集,生成','\x20',_0x4bb568[_0x4e844a(0x145)],_0x4e844a(0x154)]})}),_0x4bb568[_0x4e844a(0x15d)]>0x0&&a5_0x288c15(Box,{'marginTop':0x1,'children':a5_0x2ae7dd(Text,{'color':_0x4e844a(0x143),'children':[_0x4e844a(0x151),_0x4bb568[_0x4e844a(0x149)],_0x4e844a(0x139),'\x20',_0x4bb568['duplicateCount'],'\x20个']})}),a5_0x288c15(Box,{'marginTop':0x1,'children':a5_0x288c15(Text,{'color':_0x4e844a(0x156),'children':_0x4e844a(0x16c)})}),a5_0x2ae7dd(Box,{'marginLeft':0x2,'children':[a5_0x2ae7dd(Text,{'color':'cyan','children':['•\x20',_0x4bb568[_0x4e844a(0x162)]]}),a5_0x2ae7dd(Text,{'color':_0x4e844a(0x13f),'children':['\x20',_0x4e844a(0x160),_0x4bb568[_0x4e844a(0x145)],_0x4e844a(0x13a)]})]}),a5_0x2ae7dd(Box,{'marginLeft':0x2,'children':[a5_0x2ae7dd(Text,{'color':_0x4e844a(0x163),'children':['•\x20',_0x4bb568[_0x4e844a(0x14d)]]}),a5_0x288c15(Text,{'color':'dim','children':_0x4e844a(0x157)})]}),a5_0x288c15(Box,{'marginTop':0x1,'children':a5_0x288c15(Text,{'color':'gray','children':_0x4e844a(0x144)})}),a5_0x288c15(Box,{'marginLeft':0x2,'children':a5_0x2ae7dd(Text,{'color':_0x4e844a(0x143),'children':['import\x20',_0x4e844a(0x155),_0x4e844a(0x153),_0x4bb568['client']['replace'](/^\.\//,'')[_0x4e844a(0x142)](_0x4e844a(0x165),''),'\x27']})})]}),_0x299ae5&&a5_0x2ae7dd(Box,{'flexDirection':_0x4e844a(0x16d),'children':[a5_0x288c15(Box,{'children':a5_0x2ae7dd(Text,{'color':'red','children':['❌\x20',_0x299ae5]})}),_0x299ae5[_0x4e844a(0x14b)]('登录')&&a5_0x2ae7dd(Box,{'marginTop':0x1,'children':[a5_0x288c15(Text,{'color':_0x4e844a(0x143),'children':_0x4e844a(0x152)}),a5_0x288c15(Text,{'color':_0x4e844a(0x163),'children':_0x4e844a(0x148)}),a5_0x288c15(Text,{'color':'yellow','children':_0x4e844a(0x137)})]})]})]});};
@@ -1 +1 @@
1
- (function(_0x1056a0,_0x2f5f4e){const _0x4ef780=a6_0x2ec2,_0x1024ee=_0x1056a0();while(!![]){try{const _0x2b4200=-parseInt(_0x4ef780(0x154))/0x1+parseInt(_0x4ef780(0x148))/0x2*(parseInt(_0x4ef780(0x15b))/0x3)+parseInt(_0x4ef780(0x157))/0x4+parseInt(_0x4ef780(0x14a))/0x5+parseInt(_0x4ef780(0x14d))/0x6+parseInt(_0x4ef780(0x151))/0x7*(-parseInt(_0x4ef780(0x159))/0x8)+parseInt(_0x4ef780(0x140))/0x9*(parseInt(_0x4ef780(0x13f))/0xa);if(_0x2b4200===_0x2f5f4e)break;else _0x1024ee['push'](_0x1024ee['shift']());}catch(_0x3c9bcf){_0x1024ee['push'](_0x1024ee['shift']());}}}(a6_0xb495,0x4e71e));import{getCookie}from'../auth/get-cookie.js';import{getApiDomain}from'../constant/domain.js';function a6_0x2ec2(_0x30e03a,_0x7c561f){_0x30e03a=_0x30e03a-0x13f;const _0xb4953e=a6_0xb495();let _0x2ec201=_0xb4953e[_0x30e03a];return _0x2ec201;}function a6_0xb495(){const _0x482ff9=['fetch-model-list','errorMsg','1451412vEeueH','获取数据集失败,HTTP状态码:\x20','code','info','8911dalyjU','count','configArray','313329iLIlwW','includes','登录鉴权失败,登录已过期,请使用\x20lovrabet\x20auth\x20重新登录','444244vVtefk','error','2800NdGnYq','success','3rkSAJw','UNAUTHORIZED','190jRgOpW','248895ShdkDN','status','正在从服务器拉取模型列表...\x20(环境:\x20','/api/node-toolbox/dataset/model-list?appcode=','401','data','Unauthorized','errorMessage','186812oKEzgd','message','541875pHTNxo'];a6_0xb495=function(){return _0x482ff9;};return a6_0xb495();}import{logger}from'../utils/logger.js';import{getEnv}from'../constant/env.js';export async function fetchModelList(_0x49cf2a){const _0x4ba4db=a6_0x2ec2,_0x652287=getEnv(),_0x384dc2=getApiDomain()+_0x4ba4db(0x143)+_0x49cf2a+'&otype=array';logger[_0x4ba4db(0x150)](_0x4ba4db(0x14b),_0x4ba4db(0x142)+_0x652287+')',{'apiUrl':_0x384dc2});const _0x43a007=await fetch(_0x384dc2,{'headers':{'Cookie':getCookie()}});if(!_0x43a007['ok']){if(_0x43a007['status']===0x191)throw new Error('登录鉴权失败,登录已过期,请使用\x20lovrabet\x20auth\x20重新登录');throw new Error(_0x4ba4db(0x14e)+_0x43a007[_0x4ba4db(0x141)]);}const _0x2bb6ac=await _0x43a007['json']();if(!_0x2bb6ac[_0x4ba4db(0x15a)]){const _0x32f00c=_0x2bb6ac[_0x4ba4db(0x14c)]||_0x2bb6ac['message']||_0x2bb6ac[_0x4ba4db(0x145)]?.[_0x4ba4db(0x149)]||_0x2bb6ac[_0x4ba4db(0x147)]||_0x2bb6ac[_0x4ba4db(0x158)]||'未知错误';if(_0x32f00c[_0x4ba4db(0x155)](_0x4ba4db(0x144))||_0x32f00c[_0x4ba4db(0x155)](_0x4ba4db(0x146))||_0x32f00c[_0x4ba4db(0x155)]('登录')||_0x32f00c[_0x4ba4db(0x155)]('认证')||_0x2bb6ac['errorCode']===_0x4ba4db(0x15c)||_0x2bb6ac[_0x4ba4db(0x14f)]===0x191||_0x2bb6ac['code']===_0x4ba4db(0x144))throw new Error(_0x4ba4db(0x156));throw new Error('获取数据集失败:\x20'+_0x32f00c);}return{'configArray':_0x2bb6ac[_0x4ba4db(0x145)][_0x4ba4db(0x153)],'count':_0x2bb6ac[_0x4ba4db(0x145)][_0x4ba4db(0x152)]};}
1
+ (function(_0x3918f8,_0xdc2056){const _0x48d5c4=a6_0x2993,_0x123419=_0x3918f8();while(!![]){try{const _0x5e1518=-parseInt(_0x48d5c4(0x104))/0x1+parseInt(_0x48d5c4(0xe8))/0x2*(-parseInt(_0x48d5c4(0xf9))/0x3)+-parseInt(_0x48d5c4(0xf0))/0x4*(-parseInt(_0x48d5c4(0xf8))/0x5)+-parseInt(_0x48d5c4(0x102))/0x6*(-parseInt(_0x48d5c4(0xee))/0x7)+-parseInt(_0x48d5c4(0xf5))/0x8+parseInt(_0x48d5c4(0xfd))/0x9+parseInt(_0x48d5c4(0xf4))/0xa*(parseInt(_0x48d5c4(0xf1))/0xb);if(_0x5e1518===_0xdc2056)break;else _0x123419['push'](_0x123419['shift']());}catch(_0x576816){_0x123419['push'](_0x123419['shift']());}}}(a6_0x3fb1,0x6a00e));import{getCookie}from'../auth/get-cookie.js';import{getApiDomain}from'../constant/domain.js';function a6_0x3fb1(){const _0x10a4dc=['Unauthorized','401','info','status','98VXdFYA','未知错误','4uBnbsJ','3170629EgZFVO','configArray','errorMessage','30JKtiii','4476544CYQUPc','登录鉴权失败,登录已过期,请使用\x20lovrabet\x20auth\x20重新登录','&otype=array','2692335gDeimm','207oIiuYR','includes','code','success','5007294axfKGG','UNAUTHORIZED','errorMsg','获取数据集失败,HTTP状态码:\x20','count','99240iReQTa','json','737950RcvTZJ','data','正在从服务器拉取模型列表...\x20(环境:\x20','errorCode','13316ufAffr','message'];a6_0x3fb1=function(){return _0x10a4dc;};return a6_0x3fb1();}import{logger}from'../utils/logger.js';function a6_0x2993(_0x165e60,_0x637e95){_0x165e60=_0x165e60-0xe6;const _0x3fb173=a6_0x3fb1();let _0x299382=_0x3fb173[_0x165e60];return _0x299382;}import{getEnv}from'../constant/env.js';export async function fetchModelList(_0x306125){const _0x41f6ee=a6_0x2993,_0x6cbc4c=getEnv(),_0x43421f=getApiDomain()+'/api/node-toolbox/dataset/model-list?appcode='+_0x306125+_0x41f6ee(0xf7);logger[_0x41f6ee(0xec)]('fetch-model-list',_0x41f6ee(0xe6)+_0x6cbc4c+')',{'apiUrl':_0x43421f});const _0x14dae5=await fetch(_0x43421f,{'headers':{'Cookie':getCookie()}});if(!_0x14dae5['ok']){if(_0x14dae5[_0x41f6ee(0xed)]===0x191)throw new Error(_0x41f6ee(0xf6));throw new Error(_0x41f6ee(0x100)+_0x14dae5['status']);}const _0x24e901=await _0x14dae5[_0x41f6ee(0x103)]();if(!_0x24e901[_0x41f6ee(0xfc)]){const _0x4ec9d3=_0x24e901[_0x41f6ee(0xff)]||_0x24e901[_0x41f6ee(0xe9)]||_0x24e901[_0x41f6ee(0x105)]?.[_0x41f6ee(0xe9)]||_0x24e901[_0x41f6ee(0xf3)]||_0x24e901['error']||_0x41f6ee(0xef);if(_0x4ec9d3[_0x41f6ee(0xfa)](_0x41f6ee(0xeb))||_0x4ec9d3[_0x41f6ee(0xfa)](_0x41f6ee(0xea))||_0x4ec9d3[_0x41f6ee(0xfa)]('登录')||_0x4ec9d3[_0x41f6ee(0xfa)]('认证')||_0x24e901[_0x41f6ee(0xe7)]===_0x41f6ee(0xfe)||_0x24e901[_0x41f6ee(0xfb)]===0x191||_0x24e901[_0x41f6ee(0xfb)]===_0x41f6ee(0xeb))throw new Error('登录鉴权失败,登录已过期,请使用\x20lovrabet\x20auth\x20重新登录');throw new Error('获取数据集失败:\x20'+_0x4ec9d3);}return{'configArray':_0x24e901[_0x41f6ee(0x105)][_0x41f6ee(0xf2)],'count':_0x24e901[_0x41f6ee(0x105)][_0x41f6ee(0x101)]};}
@@ -1 +1 @@
1
- const a7_0xf613ee=a7_0x3824;(function(_0xc0b040,_0xa1930a){const _0x9cc191=a7_0x3824,_0x4f8c0d=_0xc0b040();while(!![]){try{const _0x4f8f08=parseInt(_0x9cc191(0x149))/0x1*(-parseInt(_0x9cc191(0x138))/0x2)+-parseInt(_0x9cc191(0x151))/0x3*(parseInt(_0x9cc191(0x133))/0x4)+parseInt(_0x9cc191(0x148))/0x5+-parseInt(_0x9cc191(0x12f))/0x6+-parseInt(_0x9cc191(0x14a))/0x7+parseInt(_0x9cc191(0x141))/0x8+parseInt(_0x9cc191(0x145))/0x9;if(_0x4f8f08===_0xa1930a)break;else _0x4f8c0d['push'](_0x4f8c0d['shift']());}catch(_0x2c3aca){_0x4f8c0d['push'](_0x4f8c0d['shift']());}}}(a7_0x2039,0x24a02));import a7_0x9f1c77 from'prettier';import{mkdirSync,writeFileSync,readFileSync}from'node:fs';import a7_0x4ea615 from'node:path';import{fileURLToPath}from'node:url';import{readConfig}from'../utils/config.js';function a7_0x2039(){const _0x11e3ec=['client.ts.tpl','client','dirname','utf8','\x22\x20}','794856RuYqpK','./src/api/','app','join','6460137iiiCst','init-api','format','310155vSVUYH','58513IDTYyo','741048heLyVp','length','key','alias','forEach','{\x20apiConfigName:\x20','online','27CfUCFf','resolve','-api','typescript','templates/generate-api','name','请先通过\x20`lovrabet\x20config\x20set\x20app\x20<value>`\x20配置应用\x20Code','1436700XJtQIB','.ts','push','tableName','118588fNTpKR','endsWith','success','replaceApiContent','slice','4MSvMlF','string',',\x20env:\x20\x22','env'];a7_0x2039=function(){return _0x11e3ec;};return a7_0x2039();}import{TemplateReplacer}from'../utils/template-replacer.js';function a7_0x3824(_0x505222,_0x291fde){_0x505222=_0x505222-0x12d;const _0x203962=a7_0x2039();let _0x38242f=_0x203962[_0x505222];return _0x38242f;}import{logger}from'../utils/logger.js';export async function generateApiFile(_0x5edc0d,_0x69b61='',_0x2e4b18,_0x104c19=![],_0x58cb78,_0x321f91=a7_0xf613ee(0x142)){const _0x19c277=a7_0xf613ee,_0x431499=readConfig(),_0x167bae=_0x2e4b18||_0x431499?.[_0x19c277(0x143)];if(typeof _0x167bae!==_0x19c277(0x139)||!_0x167bae)throw new Error(_0x19c277(0x12e));const _0x425376=_0x104c19?'CONFIG_NAMES.DEFAULT':'\x22'+_0x167bae+'\x22',_0x28bae3=typeof _0x431499['env']===_0x19c277(0x139)?_0x431499[_0x19c277(0x13b)]:undefined,_0x28ee81=_0x58cb78||_0x28bae3||_0x19c277(0x150),_0x42a703=_0x28ee81!=='online';let _0x308e66;if(_0x104c19)_0x42a703?_0x308e66=_0x19c277(0x14f)+_0x425376+_0x19c277(0x13a)+_0x28ee81+_0x19c277(0x140):_0x308e66='';else{const _0x1211fe=_0x42a703?_0x19c277(0x13a)+_0x28ee81+'\x22':'';_0x308e66='{\x20apiConfigName:\x20\x22'+_0x167bae+'\x22'+_0x1211fe+'\x20}';}const _0x3e636a=_0x69b61?_0x69b61+_0x19c277(0x153):'api',_0x3c03c6=_0x69b61?_0x69b61+'-client':_0x19c277(0x13d),_0x112409=[];_0x5edc0d[_0x19c277(0x14e)](_0x45adb4=>{const _0x5dbec5=_0x19c277;_0x112409[_0x5dbec5(0x131)]({'datasetCode':_0x45adb4['datasetCode'],'tableName':_0x45adb4[_0x5dbec5(0x132)],'name':_0x45adb4[_0x5dbec5(0x12d)]||'','alias':_0x45adb4[_0x5dbec5(0x14d)]||_0x45adb4[_0x5dbec5(0x14c)]});});const _0x440ca1=fileURLToPath(import.meta.url),_0x1c6d73=a7_0x4ea615[_0x19c277(0x152)](a7_0x4ea615[_0x19c277(0x13e)](_0x440ca1),'../..'),_0x4d58b8=a7_0x4ea615[_0x19c277(0x144)](_0x1c6d73,_0x19c277(0x155)),_0x2de126=a7_0x4ea615['join'](_0x4d58b8,'api.ts.tpl'),_0x4021a4=a7_0x4ea615['join'](_0x4d58b8,_0x19c277(0x13c)),_0x5c05b3=_0x321f91[_0x19c277(0x134)]('/')?_0x321f91[_0x19c277(0x137)](0x0,-0x1):_0x321f91;mkdirSync(_0x5c05b3,{'recursive':!![]});const _0x18e920=_0x112409[0x0]?.['alias'],_0x1bed9d=readFileSync(_0x2de126,_0x19c277(0x13f)),_0x495759=TemplateReplacer[_0x19c277(0x136)](_0x1bed9d,_0x167bae,_0x112409,_0x18e920,_0x3e636a,_0x425376),_0x55a6e6=await a7_0x9f1c77[_0x19c277(0x147)](_0x495759,{'parser':_0x19c277(0x154)}),_0x52bb37=_0x5c05b3+'/'+_0x3e636a+_0x19c277(0x130);writeFileSync(_0x52bb37,_0x55a6e6,{'encoding':_0x19c277(0x13f)});const _0x257c1f=readFileSync(_0x4021a4,_0x19c277(0x13f)),_0x5a3e19=TemplateReplacer[_0x19c277(0x136)](_0x257c1f,_0x167bae,_0x112409,_0x18e920,_0x3e636a,_0x425376,_0x308e66),_0x1a8a60=await a7_0x9f1c77[_0x19c277(0x147)](_0x5a3e19,{'parser':_0x19c277(0x154)}),_0x5077b4=_0x5c05b3+'/'+_0x3c03c6+_0x19c277(0x130);writeFileSync(_0x5077b4,_0x1a8a60,{'encoding':'utf8'});const _0x3cddb3=_0x112409[_0x19c277(0x14b)];return logger[_0x19c277(0x135)](_0x19c277(0x146),'API\x20文件生成成功!',undefined,{'apiFile':_0x52bb37,'clientFile':_0x5077b4,'modelCount':_0x3cddb3,'configName':_0x425376}),{'modelCount':_0x3cddb3,'apiFilePath':_0x52bb37,'clientFilePath':_0x5077b4,'configName':_0x425376};}
1
+ function a7_0x4031(){const _0x25341a=['{\x20apiConfigName:\x20\x22','tableName','datasetCode','alias','CONFIG_NAMES.DEFAULT','utf8','4okeEyi','online','2991880NeruZM','8Grhtkf','push','1832506qbYTEj','1319536ubMiUC','10gkdZwm','app','../..','init-api','.ts','env','typescript','client','string','./src/api/','请先通过\x20`lovrabet\x20config\x20set\x20app\x20<value>`\x20配置应用\x20Code','9737791GqJEpC','client.ts.tpl','api','resolve','endsWith','name','15439006bWgnqA','forEach','2900940vfhTbP',',\x20env:\x20\x22','join','api.ts.tpl','key','27sVESrQ','877758DOyThs','length','replaceApiContent'];a7_0x4031=function(){return _0x25341a;};return a7_0x4031();}const a7_0x3a4e9f=a7_0x2f49;(function(_0xf781db,_0x23ca27){const _0x5502fa=a7_0x2f49,_0x47bbb8=_0xf781db();while(!![]){try{const _0x2a9151=parseInt(_0x5502fa(0x1fb))/0x1+-parseInt(_0x5502fa(0x1fc))/0x2+parseInt(_0x5502fa(0x1ed))/0x3*(-parseInt(_0x5502fa(0x1f6))/0x4)+-parseInt(_0x5502fa(0x1fd))/0x5*(-parseInt(_0x5502fa(0x210))/0x6)+-parseInt(_0x5502fa(0x208))/0x7*(parseInt(_0x5502fa(0x1f9))/0x8)+parseInt(_0x5502fa(0x1ec))/0x9*(-parseInt(_0x5502fa(0x1f8))/0xa)+parseInt(_0x5502fa(0x20e))/0xb;if(_0x2a9151===_0x23ca27)break;else _0x47bbb8['push'](_0x47bbb8['shift']());}catch(_0x46644d){_0x47bbb8['push'](_0x47bbb8['shift']());}}}(a7_0x4031,0xeadd1));import a7_0x3e18e4 from'prettier';import{mkdirSync,writeFileSync,readFileSync}from'node:fs';import a7_0x3ac255 from'node:path';import{fileURLToPath}from'node:url';import{readConfig}from'../utils/config.js';import{TemplateReplacer}from'../utils/template-replacer.js';function a7_0x2f49(_0x50283e,_0x540c12){_0x50283e=_0x50283e-0x1eb;const _0x403145=a7_0x4031();let _0x2f49c7=_0x403145[_0x50283e];return _0x2f49c7;}import{logger}from'../utils/logger.js';export async function generateApiFile(_0x300757,_0x325478='',_0x5f54d9,_0x19e8af=![],_0x2e71bc,_0x2ddcae=a7_0x3a4e9f(0x206)){const _0x2cfbad=a7_0x3a4e9f,_0x5d67ef=readConfig(),_0x5b2b31=_0x5f54d9||_0x5d67ef?.[_0x2cfbad(0x1fe)];if(typeof _0x5b2b31!=='string'||!_0x5b2b31)throw new Error(_0x2cfbad(0x207));const _0x23a544=_0x19e8af?_0x2cfbad(0x1f4):'\x22'+_0x5b2b31+'\x22',_0x38f732=typeof _0x5d67ef[_0x2cfbad(0x202)]===_0x2cfbad(0x205)?_0x5d67ef[_0x2cfbad(0x202)]:undefined,_0x22a4d3=_0x2e71bc||_0x38f732||_0x2cfbad(0x1f7),_0x58b452=_0x22a4d3!=='online';let _0x4beca3;if(_0x19e8af)_0x58b452?_0x4beca3='{\x20apiConfigName:\x20'+_0x23a544+_0x2cfbad(0x211)+_0x22a4d3+'\x22\x20}':_0x4beca3='';else{const _0x4124de=_0x58b452?',\x20env:\x20\x22'+_0x22a4d3+'\x22':'';_0x4beca3=_0x2cfbad(0x1f0)+_0x5b2b31+'\x22'+_0x4124de+'\x20}';}const _0xee0c04=_0x325478?_0x325478+'-api':_0x2cfbad(0x20a),_0x58c56e=_0x325478?_0x325478+'-client':_0x2cfbad(0x204),_0x1db52f=[];_0x300757[_0x2cfbad(0x20f)](_0x5ed32c=>{const _0x34a27f=_0x2cfbad;_0x1db52f[_0x34a27f(0x1fa)]({'datasetCode':_0x5ed32c[_0x34a27f(0x1f2)],'tableName':_0x5ed32c[_0x34a27f(0x1f1)],'name':_0x5ed32c[_0x34a27f(0x20d)]||'','alias':_0x5ed32c[_0x34a27f(0x1f3)]||_0x5ed32c[_0x34a27f(0x1eb)]});});const _0x3cfe38=fileURLToPath(import.meta.url),_0x568a47=a7_0x3ac255[_0x2cfbad(0x20b)](a7_0x3ac255['dirname'](_0x3cfe38),_0x2cfbad(0x1ff)),_0x4af3a6=a7_0x3ac255[_0x2cfbad(0x212)](_0x568a47,'templates/generate-api'),_0x25bc7d=a7_0x3ac255[_0x2cfbad(0x212)](_0x4af3a6,_0x2cfbad(0x213)),_0x1cba13=a7_0x3ac255[_0x2cfbad(0x212)](_0x4af3a6,_0x2cfbad(0x209)),_0x3a6276=_0x2ddcae[_0x2cfbad(0x20c)]('/')?_0x2ddcae['slice'](0x0,-0x1):_0x2ddcae;mkdirSync(_0x3a6276,{'recursive':!![]});const _0x4b2c67=_0x1db52f[0x0]?.[_0x2cfbad(0x1f3)],_0x27079a=readFileSync(_0x25bc7d,'utf8'),_0x5170ac=TemplateReplacer[_0x2cfbad(0x1ef)](_0x27079a,_0x5b2b31,_0x1db52f,_0x4b2c67,_0xee0c04,_0x23a544),_0x271ea2=await a7_0x3e18e4['format'](_0x5170ac,{'parser':_0x2cfbad(0x203)}),_0x2ad740=_0x3a6276+'/'+_0xee0c04+_0x2cfbad(0x201);writeFileSync(_0x2ad740,_0x271ea2,{'encoding':_0x2cfbad(0x1f5)});const _0x3e3b9b=readFileSync(_0x1cba13,'utf8'),_0x30ca6a=TemplateReplacer[_0x2cfbad(0x1ef)](_0x3e3b9b,_0x5b2b31,_0x1db52f,_0x4b2c67,_0xee0c04,_0x23a544,_0x4beca3),_0x34a8c0=await a7_0x3e18e4['format'](_0x30ca6a,{'parser':'typescript'}),_0x18cfd1=_0x3a6276+'/'+_0x58c56e+_0x2cfbad(0x201);writeFileSync(_0x18cfd1,_0x34a8c0,{'encoding':_0x2cfbad(0x1f5)});const _0x471648=_0x1db52f[_0x2cfbad(0x1ee)];return logger['success'](_0x2cfbad(0x200),'API\x20文件生成成功!',undefined,{'apiFile':_0x2ad740,'clientFile':_0x18cfd1,'modelCount':_0x471648,'configName':_0x23a544}),{'modelCount':_0x471648,'apiFilePath':_0x2ad740,'clientFilePath':_0x18cfd1,'configName':_0x23a544};}
package/lib/api/main.js CHANGED
@@ -1 +1 @@
1
- function a8_0x5d35(_0x49c680,_0x140c73){_0x49c680=_0x49c680-0x182;const _0x12ff4d=a8_0x12ff();let _0x5d354b=_0x12ff4d[_0x49c680];return _0x5d354b;}(function(_0x3ac2a0,_0x4d6ac1){const _0x4a9bf3=a8_0x5d35,_0x45cf68=_0x3ac2a0();while(!![]){try{const _0x583f93=-parseInt(_0x4a9bf3(0x199))/0x1+-parseInt(_0x4a9bf3(0x1ac))/0x2+-parseInt(_0x4a9bf3(0x19b))/0x3+-parseInt(_0x4a9bf3(0x1ae))/0x4*(parseInt(_0x4a9bf3(0x1a9))/0x5)+parseInt(_0x4a9bf3(0x194))/0x6*(-parseInt(_0x4a9bf3(0x1a8))/0x7)+-parseInt(_0x4a9bf3(0x191))/0x8+parseInt(_0x4a9bf3(0x19c))/0x9*(parseInt(_0x4a9bf3(0x195))/0xa);if(_0x583f93===_0x4d6ac1)break;else _0x45cf68['push'](_0x45cf68['shift']());}catch(_0x3693eb){_0x45cf68['push'](_0x45cf68['shift']());}}}(a8_0x12ff,0x4ab30));import{jsx as a8_0x475a5d}from'react/jsx-runtime';import{render}from'ink';import{ApiPullUI}from'./api-pull-ui.js';import{ApiDocUI}from'./api-doc-ui.js';function a8_0x12ff(){const _0x44432c=['output','!\x20请使用以下方式之一:','map','filter','请使用\x20--appcode\x20参数,例如:','\x20\x20\x201.\x20配置默认值:\x20lovrabet\x20config\x20set\x20appcode\x20<app-code>','\x20\x20\x202.\x20使用参数:\x20lovrabet\x20api\x20doc\x20--appcode\x20<app-code>','object','flags','params','input','\x0alovrabet\x20api\x20-\x20API\x20相关操作\x0a\x0a用法:\x0a\x20\x20$\x20lovrabet\x20api\x20pull\x20[options]\x0a\x20\x20$\x20lovrabet\x20api\x20doc\x20[options]\x0a\x0a选项:\x0a\x20\x20--appcode\x20<code>\x20\x20\x20\x20\x20\x20指定应用代码\x0a\x20\x20--output\x20<dir>\x20\x20\x20\x20\x20\x20\x20\x20指定输出目录(pull:\x20./src/api/,doc:\x20./docs)\x0a\x20\x20--env\x20<env>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20指定环境(如:daily、online)\x0a\x20\x20--datasetcode\x20<codes>\x20指定要生成文档的数据集代码(多个用逗号分隔,仅\x20doc\x20命令)\x0a\x20\x20--help\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20显示此帮助信息\x0a\x0a示例:\x0a\x20\x20$\x20lovrabet\x20api\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20拉取并生成\x20API\x20配置文件\x0a\x20\x20$\x20lovrabet\x20api\x20pull\x20--appcode\x20myapp\x20\x20\x20\x20\x20\x20\x20//\x20使用指定的\x20appcode\x0a\x20\x20$\x20lovrabet\x20api\x20pull\x20--output\x20./api\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定输出目录\x0a\x20\x20$\x20lovrabet\x20api\x20pull\x20--env\x20daily\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定环境拉取\x20API\x0a\x0a\x20\x20$\x20lovrabet\x20api\x20doc\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20生成所有数据集的文档\x0a\x20\x20$\x20lovrabet\x20api\x20doc\x20--appcode\x20myapp\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20使用指定的\x20appcode\x0a\x20\x20$\x20lovrabet\x20api\x20doc\x20--output\x20./docs\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定文档输出目录\x0a\x20\x20$\x20lovrabet\x20api\x20doc\x20--env\x20daily\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定环境生成文档\x0a\x20\x20$\x20lovrabet\x20api\x20doc\x20--datasetcode\x20ds_001\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20只生成指定数据集的文档\x0a\x20\x20$\x20lovrabet\x20api\x20doc\x20--datasetcode\x20ds_001,ds_002\x20\x20\x20\x20\x20\x20//\x20生成多个数据集的文档\x0a','log','isArray','env','2583352FUUXFn','Unknown\x20api\x20command:\x20','string','2043354ABejUh','130SyEnYu','\x20\x20\x202.\x20使用参数:\x20lovrabet\x20api\x20pull\x20--appcode\x20<app-code>','\x1b[90m\x20\x20(注:\x20--appcode\x20参数与配置一致,将使用默认配置)\x1b[0m','split','86581SUpzLR','error','336216IjgPli','1522629mLEbTu','\x20\x20lovrabet\x20api\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20拉取并生成\x20API\x20配置文件','datasetcode','×\x20--params\x20参数不是有效的\x20JSON\x20格式','parse','appcode','\x20\x20lovrabet\x20api\x20doc\x20--appcode\x20','\x1b[0m','doc','trim','×\x20--datasetcode\x20参数不能为空','\x20\x20lovrabet\x20api\x20doc\x20--env\x20<env>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定环境(如:\x20daily,\x20online)','7vHXpTH','5CbAgTl','\x20\x20lovrabet\x20api\x20doc\x20--output\x20<dir>\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定文档输出目录(默认:\x20./docs)','\x20\x20lovrabet\x20api\x20doc\x20--appcode\x20<code>\x20\x20\x20\x20\x20\x20\x20//\x20使用指定的\x20appcode','996580AoLSgQ','help','2131856qinjcB','length','❌\x20错误:不再支持位置参数方式','exit','\x20\x20lovrabet\x20api\x20doc\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20生成\x20API\x20文档','\x1b[90m*\x20使用配置的应用AppCode:\x20','message','join'];a8_0x12ff=function(){return _0x44432c;};return a8_0x12ff();}import{getConfigAppCode}from'../utils/config.js';export async function apiCli(_0x36670c){const _0x18a53c=a8_0x5d35,_0x46d58b=_0x36670c[_0x18a53c(0x18c)][0x1];if(_0x36670c[_0x18a53c(0x18a)][_0x18a53c(0x1ad)]){console[_0x18a53c(0x18e)](_0x18a53c(0x18d));return;}if(_0x46d58b==='pull'){_0x36670c[_0x18a53c(0x18c)][0x2]&&(console['error'](_0x18a53c(0x1b0)),console['log'](_0x18a53c(0x186)),console[_0x18a53c(0x18e)]('\x20\x20lovrabet\x20api\x20pull\x20--appcode\x20'+_0x36670c['input'][0x2]),process[_0x18a53c(0x1b1)](0x1));const _0x277e2b=getConfigAppCode();let _0x4abf91=_0x36670c[_0x18a53c(0x18a)][_0x18a53c(0x1a1)];const _0xc477ba=typeof _0x36670c[_0x18a53c(0x18a)]['env']===_0x18a53c(0x193)?_0x36670c['flags'][_0x18a53c(0x190)]:undefined,_0x120348=_0x36670c['flags']['output'];!_0x4abf91&&!_0x277e2b&&(console['error']('×\x20未配置\x20AppCode'),console['log'](_0x18a53c(0x183)),console[_0x18a53c(0x18e)](_0x18a53c(0x187)),console[_0x18a53c(0x18e)](_0x18a53c(0x196)),process[_0x18a53c(0x1b1)](0x1)),_0x4abf91&&_0x277e2b&&_0x4abf91===_0x277e2b&&(console[_0x18a53c(0x18e)](_0x18a53c(0x1b3)+_0x4abf91+'\x1b[0m'),console[_0x18a53c(0x18e)](_0x18a53c(0x197)),_0x4abf91=undefined),render(a8_0x475a5d(ApiPullUI,{'appCode':_0x4abf91,'env':_0xc477ba,'output':_0x120348}));}else{if(_0x46d58b===_0x18a53c(0x1a4)){_0x36670c[_0x18a53c(0x18c)][0x2]&&(console[_0x18a53c(0x19a)](_0x18a53c(0x1b0)),console['log'](_0x18a53c(0x186)),console['log'](_0x18a53c(0x1a2)+_0x36670c['input'][0x2]),process[_0x18a53c(0x1b1)](0x1));const _0x59f253=getConfigAppCode();let _0x586794=_0x36670c[_0x18a53c(0x18a)]['appcode'];const _0x3634e8=typeof _0x36670c['flags']['env']===_0x18a53c(0x193)?_0x36670c['flags'][_0x18a53c(0x190)]:undefined,_0x313b86=_0x36670c[_0x18a53c(0x18a)][_0x18a53c(0x182)],_0xa8088e=_0x36670c[_0x18a53c(0x18a)][_0x18a53c(0x18b)],_0x1e023a=_0x36670c[_0x18a53c(0x18a)][_0x18a53c(0x19e)];!_0x586794&&!_0x59f253&&(console[_0x18a53c(0x19a)]('×\x20未配置\x20AppCode'),console[_0x18a53c(0x18e)](_0x18a53c(0x183)),console[_0x18a53c(0x18e)](_0x18a53c(0x187)),console[_0x18a53c(0x18e)](_0x18a53c(0x188)),process['exit'](0x1));_0x586794&&_0x59f253&&_0x586794===_0x59f253&&(console[_0x18a53c(0x18e)]('\x1b[90m*\x20使用配置的应用AppCode:\x20'+_0x586794+_0x18a53c(0x1a3)),_0x586794=undefined);let _0x255433;if(_0xa8088e)try{_0x255433=JSON[_0x18a53c(0x1a0)](_0xa8088e),(typeof _0x255433!==_0x18a53c(0x189)||_0x255433===null||Array[_0x18a53c(0x18f)](_0x255433))&&(console[_0x18a53c(0x19a)]('×\x20--params\x20参数必须是一个有效的\x20JSON\x20对象'),process['exit'](0x1));}catch(_0x229f2c){console[_0x18a53c(0x19a)](_0x18a53c(0x19f)),console[_0x18a53c(0x19a)]('\x20\x20错误:\x20'+(_0x229f2c instanceof Error?_0x229f2c[_0x18a53c(0x1b4)]:String(_0x229f2c))),process[_0x18a53c(0x1b1)](0x1);}let _0x531f33;_0x1e023a&&(_0x531f33=_0x1e023a[_0x18a53c(0x198)](',')[_0x18a53c(0x184)](_0x19f95f=>_0x19f95f[_0x18a53c(0x1a5)]())[_0x18a53c(0x185)](_0x58ebb9=>_0x58ebb9[_0x18a53c(0x1af)]>0x0),_0x531f33[_0x18a53c(0x1af)]===0x0&&(console[_0x18a53c(0x19a)](_0x18a53c(0x1a6)),process[_0x18a53c(0x1b1)](0x1)),console['log']('\x1b[90m*\x20仅生成指定数据集的文档:\x20'+_0x531f33[_0x18a53c(0x1b5)](',\x20')+'\x1b[0m')),render(a8_0x475a5d(ApiDocUI,{'appCode':_0x586794,'env':_0x3634e8,'output':_0x313b86,'extraParams':_0x255433,'datasetCodes':_0x531f33}));}else console['error'](_0x18a53c(0x192)+_0x46d58b),console[_0x18a53c(0x18e)]('Available\x20commands:'),console['log'](_0x18a53c(0x19d)),console['log']('\x20\x20lovrabet\x20api\x20pull\x20--appcode\x20<code>\x20\x20\x20\x20\x20\x20//\x20使用指定的\x20appcode'),console['log']('\x20\x20lovrabet\x20api\x20pull\x20--output\x20<dir>\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定输出目录(默认:\x20./src/api/)'),console[_0x18a53c(0x18e)]('\x20\x20lovrabet\x20api\x20pull\x20--env\x20<env>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定环境(如:\x20daily,\x20online)'),console['log'](''),console[_0x18a53c(0x18e)](_0x18a53c(0x1b2)),console[_0x18a53c(0x18e)](_0x18a53c(0x1ab)),console[_0x18a53c(0x18e)](_0x18a53c(0x1aa)),console[_0x18a53c(0x18e)](_0x18a53c(0x1a7)),process['exit'](0x1);}}
1
+ (function(_0x2907ff,_0x1d500e){const _0x4d575f=a8_0xb420,_0x27ae39=_0x2907ff();while(!![]){try{const _0x10c0ec=-parseInt(_0x4d575f(0xbd))/0x1+parseInt(_0x4d575f(0xd9))/0x2*(parseInt(_0x4d575f(0xbf))/0x3)+parseInt(_0x4d575f(0xc1))/0x4+-parseInt(_0x4d575f(0xc2))/0x5*(parseInt(_0x4d575f(0xc0))/0x6)+-parseInt(_0x4d575f(0xdc))/0x7*(parseInt(_0x4d575f(0xec))/0x8)+-parseInt(_0x4d575f(0xea))/0x9*(-parseInt(_0x4d575f(0xd7))/0xa)+-parseInt(_0x4d575f(0xc7))/0xb;if(_0x10c0ec===_0x1d500e)break;else _0x27ae39['push'](_0x27ae39['shift']());}catch(_0x548b54){_0x27ae39['push'](_0x27ae39['shift']());}}}(a8_0x1204,0xc8aaf));import{jsx as a8_0x353256}from'react/jsx-runtime';function a8_0xb420(_0x5a2af0,_0x5f25d0){_0x5a2af0=_0x5a2af0-0xb9;const _0x1204ff=a8_0x1204();let _0xb420e2=_0x1204ff[_0x5a2af0];return _0xb420e2;}import{render}from'ink';import{ApiPullUI}from'./api-pull-ui.js';import{ApiDocUI}from'./api-doc-ui.js';import{getConfigAppCode}from'../utils/config.js';export async function apiCli(_0x45e93a){const _0x435850=a8_0xb420,_0x36a13b=_0x45e93a['input'][0x1];if(_0x45e93a[_0x435850(0xd3)]['help']){console[_0x435850(0xbe)](_0x435850(0xc9));return;}if(_0x36a13b===_0x435850(0xe4)){_0x45e93a[_0x435850(0xc5)][0x2]&&(console[_0x435850(0xdb)](_0x435850(0xcc)),console['log'](_0x435850(0xe8)),console[_0x435850(0xbe)](_0x435850(0xba)+_0x45e93a[_0x435850(0xc5)][0x2]),process['exit'](0x1));const _0x52d033=getConfigAppCode();let _0x5175f0=_0x45e93a['flags']['appcode'];const _0x5d871b=typeof _0x45e93a['flags'][_0x435850(0xd1)]===_0x435850(0xde)?_0x45e93a[_0x435850(0xd3)][_0x435850(0xd1)]:undefined,_0x59605d=_0x45e93a[_0x435850(0xd3)][_0x435850(0xe6)];!_0x5175f0&&!_0x52d033&&(console[_0x435850(0xdb)](_0x435850(0xe0)),console['log']('!\x20请使用以下方式之一:'),console[_0x435850(0xbe)]('\x20\x20\x201.\x20配置默认值:\x20lovrabet\x20config\x20set\x20appcode\x20<app-code>'),console[_0x435850(0xbe)](_0x435850(0xd4)),process[_0x435850(0xe1)](0x1)),_0x5175f0&&_0x52d033&&_0x5175f0===_0x52d033&&(console[_0x435850(0xbe)](_0x435850(0xe5)+_0x5175f0+_0x435850(0xcf)),console['log'](_0x435850(0xb9)),_0x5175f0=undefined),render(a8_0x353256(ApiPullUI,{'appCode':_0x5175f0,'env':_0x5d871b,'output':_0x59605d}));}else{if(_0x36a13b===_0x435850(0xbb)){_0x45e93a[_0x435850(0xc5)][0x2]&&(console[_0x435850(0xdb)]('❌\x20错误:不再支持位置参数方式'),console[_0x435850(0xbe)](_0x435850(0xe8)),console[_0x435850(0xbe)]('\x20\x20lovrabet\x20api\x20doc\x20--appcode\x20'+_0x45e93a['input'][0x2]),process[_0x435850(0xe1)](0x1));const _0x445fc7=getConfigAppCode();let _0x5d5252=_0x45e93a[_0x435850(0xd3)]['appcode'];const _0x4d5703=typeof _0x45e93a['flags'][_0x435850(0xd1)]===_0x435850(0xde)?_0x45e93a[_0x435850(0xd3)][_0x435850(0xd1)]:undefined,_0x1ec4c6=_0x45e93a[_0x435850(0xd3)][_0x435850(0xe6)],_0x368b37=_0x45e93a['flags'][_0x435850(0xcd)],_0x4b2a04=_0x45e93a[_0x435850(0xd3)][_0x435850(0xdd)];!_0x5d5252&&!_0x445fc7&&(console[_0x435850(0xdb)](_0x435850(0xe0)),console['log'](_0x435850(0xd6)),console['log']('\x20\x20\x201.\x20配置默认值:\x20lovrabet\x20config\x20set\x20appcode\x20<app-code>'),console['log'](_0x435850(0xd0)),process[_0x435850(0xe1)](0x1));_0x5d5252&&_0x445fc7&&_0x5d5252===_0x445fc7&&(console[_0x435850(0xbe)](_0x435850(0xe5)+_0x5d5252+'\x1b[0m'),_0x5d5252=undefined);let _0x52610f;if(_0x368b37)try{_0x52610f=JSON[_0x435850(0xc6)](_0x368b37),(typeof _0x52610f!==_0x435850(0xdf)||_0x52610f===null||Array[_0x435850(0xd8)](_0x52610f))&&(console[_0x435850(0xdb)](_0x435850(0xc3)),process[_0x435850(0xe1)](0x1));}catch(_0xa36bb5){console[_0x435850(0xdb)](_0x435850(0xcb)),console[_0x435850(0xdb)](_0x435850(0xeb)+(_0xa36bb5 instanceof Error?_0xa36bb5[_0x435850(0xe3)]:String(_0xa36bb5))),process[_0x435850(0xe1)](0x1);}let _0x39900c;_0x4b2a04&&(_0x39900c=_0x4b2a04[_0x435850(0xd5)](',')['map'](_0x85e9dc=>_0x85e9dc[_0x435850(0xce)]())['filter'](_0x2629f3=>_0x2629f3[_0x435850(0xd2)]>0x0),_0x39900c[_0x435850(0xd2)]===0x0&&(console['error'](_0x435850(0xe7)),process[_0x435850(0xe1)](0x1)),console[_0x435850(0xbe)](_0x435850(0xca)+_0x39900c['join'](',\x20')+_0x435850(0xcf))),render(a8_0x353256(ApiDocUI,{'appCode':_0x5d5252,'env':_0x4d5703,'output':_0x1ec4c6,'extraParams':_0x52610f,'datasetCodes':_0x39900c}));}else console[_0x435850(0xdb)](_0x435850(0xda)+_0x36a13b),console[_0x435850(0xbe)]('Available\x20commands:'),console['log'](_0x435850(0xc8)),console[_0x435850(0xbe)](_0x435850(0xc4)),console[_0x435850(0xbe)]('\x20\x20lovrabet\x20api\x20pull\x20--output\x20<dir>\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定输出目录(默认:\x20./src/api/)'),console[_0x435850(0xbe)](_0x435850(0xe2)),console[_0x435850(0xbe)](''),console[_0x435850(0xbe)](_0x435850(0xbc)),console[_0x435850(0xbe)]('\x20\x20lovrabet\x20api\x20doc\x20--appcode\x20<code>\x20\x20\x20\x20\x20\x20\x20//\x20使用指定的\x20appcode'),console['log']('\x20\x20lovrabet\x20api\x20doc\x20--output\x20<dir>\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定文档输出目录(默认:\x20./docs)'),console[_0x435850(0xbe)](_0x435850(0xe9)),process[_0x435850(0xe1)](0x1);}}function a8_0x1204(){const _0x2e56ec=['\x20\x20lovrabet\x20api\x20doc\x20--env\x20<env>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定环境(如:\x20daily,\x20online)','16911tZoAbb','\x20\x20错误:\x20','5084664SEOoyH','\x1b[90m\x20\x20(注:\x20--appcode\x20参数与配置一致,将使用默认配置)\x1b[0m','\x20\x20lovrabet\x20api\x20pull\x20--appcode\x20','doc','\x20\x20lovrabet\x20api\x20doc\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20生成\x20API\x20文档','116507ftoYUT','log','137787cIUrhw','20550mqdATX','3613472MRsesW','465XfWDlS','×\x20--params\x20参数必须是一个有效的\x20JSON\x20对象','\x20\x20lovrabet\x20api\x20pull\x20--appcode\x20<code>\x20\x20\x20\x20\x20\x20//\x20使用指定的\x20appcode','input','parse','2000262hDrmpo','\x20\x20lovrabet\x20api\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20拉取并生成\x20API\x20配置文件','\x0alovrabet\x20api\x20-\x20API\x20相关操作\x0a\x0a用法:\x0a\x20\x20$\x20lovrabet\x20api\x20pull\x20[options]\x0a\x20\x20$\x20lovrabet\x20api\x20doc\x20[options]\x0a\x0a选项:\x0a\x20\x20--appcode\x20<code>\x20\x20\x20\x20\x20\x20指定应用代码\x0a\x20\x20--output\x20<dir>\x20\x20\x20\x20\x20\x20\x20\x20指定输出目录(pull:\x20./src/api/,doc:\x20./docs)\x0a\x20\x20--env\x20<env>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20指定环境(如:daily、online)\x0a\x20\x20--datasetcode\x20<codes>\x20指定要生成文档的数据集代码(多个用逗号分隔,仅\x20doc\x20命令)\x0a\x20\x20--help\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20显示此帮助信息\x0a\x0a示例:\x0a\x20\x20$\x20lovrabet\x20api\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20拉取并生成\x20API\x20配置文件\x0a\x20\x20$\x20lovrabet\x20api\x20pull\x20--appcode\x20myapp\x20\x20\x20\x20\x20\x20\x20//\x20使用指定的\x20appcode\x0a\x20\x20$\x20lovrabet\x20api\x20pull\x20--output\x20./api\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定输出目录\x0a\x20\x20$\x20lovrabet\x20api\x20pull\x20--env\x20daily\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定环境拉取\x20API\x0a\x0a\x20\x20$\x20lovrabet\x20api\x20doc\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20生成所有数据集的文档\x0a\x20\x20$\x20lovrabet\x20api\x20doc\x20--appcode\x20myapp\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20使用指定的\x20appcode\x0a\x20\x20$\x20lovrabet\x20api\x20doc\x20--output\x20./docs\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定文档输出目录\x0a\x20\x20$\x20lovrabet\x20api\x20doc\x20--env\x20daily\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定环境生成文档\x0a\x20\x20$\x20lovrabet\x20api\x20doc\x20--datasetcode\x20ds_001\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20只生成指定数据集的文档\x0a\x20\x20$\x20lovrabet\x20api\x20doc\x20--datasetcode\x20ds_001,ds_002\x20\x20\x20\x20\x20\x20//\x20生成多个数据集的文档\x0a','\x1b[90m*\x20仅生成指定数据集的文档:\x20','×\x20--params\x20参数不是有效的\x20JSON\x20格式','❌\x20错误:不再支持位置参数方式','params','trim','\x1b[0m','\x20\x20\x202.\x20使用参数:\x20lovrabet\x20api\x20doc\x20--appcode\x20<app-code>','env','length','flags','\x20\x20\x202.\x20使用参数:\x20lovrabet\x20api\x20pull\x20--appcode\x20<app-code>','split','!\x20请使用以下方式之一:','5010YuboEn','isArray','10XkVHCm','Unknown\x20api\x20command:\x20','error','7qdVloS','datasetcode','string','object','×\x20未配置\x20AppCode','exit','\x20\x20lovrabet\x20api\x20pull\x20--env\x20<env>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定环境(如:\x20daily,\x20online)','message','pull','\x1b[90m*\x20使用配置的应用AppCode:\x20','output','×\x20--datasetcode\x20参数不能为空','请使用\x20--appcode\x20参数,例如:'];a8_0x1204=function(){return _0x2e56ec;};return a8_0x1204();}
@@ -1 +1 @@
1
- (function(_0x19ddbe,_0x4e8227){const _0x48ba45=a9_0x5dfb,_0x54c0ae=_0x19ddbe();while(!![]){try{const _0x464869=-parseInt(_0x48ba45(0x1d0))/0x1*(parseInt(_0x48ba45(0x1cb))/0x2)+-parseInt(_0x48ba45(0x1cc))/0x3+parseInt(_0x48ba45(0x1c3))/0x4*(parseInt(_0x48ba45(0x1d5))/0x5)+parseInt(_0x48ba45(0x1d3))/0x6+parseInt(_0x48ba45(0x1db))/0x7+-parseInt(_0x48ba45(0x1c8))/0x8+parseInt(_0x48ba45(0x1c6))/0x9;if(_0x464869===_0x4e8227)break;else _0x54c0ae['push'](_0x54c0ae['shift']());}catch(_0x9eedb0){_0x54c0ae['push'](_0x54c0ae['shift']());}}}(a9_0x338b,0x9e08b));function a9_0x338b(){const _0x6f5f22=['*\x20正在处理\x20','length','7136379rybSej','API\x20配置拉取成功:\x20','9736184mZzMrl','-api','.ts\x20-\x20模型配置文件','2JBndop','1020648gMLlgo','\x20\x20\x20•\x20','env','api','82139VFwVNS','create-api-pull','\x20个数据集,生成\x20','7643142nLjjnh','message','50YPWsnX','-client','trim','API\x20配置拉取异常:\x20','\x20个数据集...','log','98119AumXPn','*\x20开始生成\x20API\x20配置文件:','error','client','test','×\x20API\x20配置拉取异常:','string','√\x20成功拉取\x20','\x20个模型','82352dhnxKL'];a9_0x338b=function(){return _0x6f5f22;};return a9_0x338b();}function a9_0x5dfb(_0x11a9ce,_0x530b39){_0x11a9ce=_0x11a9ce-0x1c0;const _0x338baf=a9_0x338b();let _0x5dfbf1=_0x338baf[_0x11a9ce];return _0x5dfbf1;}import{readConfig}from'../utils/config.js';import{initEnv}from'../constant/env.js';import{generateApiFile}from'./generate-api-file.js';import{logger}from'../utils/logger.js';import{fetchModelList}from'./fetch-model-list.js';export async function pullApiSilent(_0x665b97,_0x4002ee,_0x452fa3,_0x6258bc){const _0x4c7fc6=a9_0x5dfb;let _0xee62c4;try{const _0x885fec=_0x4002ee?.[_0x4c7fc6(0x1d7)]()||'';if(_0x885fec){const _0x5ef045=/^[a-zA-Z][a-zA-Z0-9_-]*$/;if(!_0x5ef045[_0x4c7fc6(0x1df)](_0x885fec))return console[_0x4c7fc6(0x1dd)]('×\x20文件前缀格式不正确。只能包含字母、数字、连字符和下划线,且必须以字母开头。'),![];}_0x452fa3&&(_0xee62c4=process['cwd'](),process['chdir'](_0x452fa3));const _0x69bf6=readConfig(),_0x8ab2a1=typeof _0x69bf6['env']===_0x4c7fc6(0x1c0)?_0x69bf6[_0x4c7fc6(0x1ce)]:undefined,_0x106a8b=_0x6258bc||_0x8ab2a1||'online';initEnv(_0x106a8b),console['log']('*\x20正在从服务器拉取\x20API\x20配置...\x20(环境:\x20'+_0x106a8b+')');const {configArray:_0x5dc474}=await fetchModelList(_0x665b97),_0x3f27f6=_0x885fec?_0x885fec+_0x4c7fc6(0x1c9):_0x4c7fc6(0x1cf),_0x9d75fc=_0x885fec?_0x885fec+_0x4c7fc6(0x1d6):_0x4c7fc6(0x1de);console[_0x4c7fc6(0x1da)](_0x4c7fc6(0x1dc)),console[_0x4c7fc6(0x1da)](_0x4c7fc6(0x1cd)+_0x3f27f6+_0x4c7fc6(0x1ca)),console[_0x4c7fc6(0x1da)](_0x4c7fc6(0x1cd)+_0x9d75fc+'.ts\x20-\x20客户端实例文件'),console[_0x4c7fc6(0x1da)](_0x4c7fc6(0x1c4)+_0x5dc474[_0x4c7fc6(0x1c5)]+_0x4c7fc6(0x1d9));const _0x5e6476=await generateApiFile(_0x5dc474,_0x885fec,_0x665b97,!![],_0x106a8b);return console['log'](_0x4c7fc6(0x1c1)+_0x5dc474[_0x4c7fc6(0x1c5)]+_0x4c7fc6(0x1d2)+_0x5e6476['modelCount']+_0x4c7fc6(0x1c2)),_0x452fa3&&logger['info']('create-api-pull',_0x4c7fc6(0x1c7)+_0x665b97,{'projectPath':_0x452fa3,'appCode':_0x665b97,'datasetCount':_0x5dc474[_0x4c7fc6(0x1c5)],'filePrefix':_0x885fec}),!![];}catch(_0x25ecb6){const _0x30715a=_0x25ecb6 instanceof Error?_0x25ecb6[_0x4c7fc6(0x1d4)]:String(_0x25ecb6);return console[_0x4c7fc6(0x1dd)](_0x4c7fc6(0x1e0),_0x30715a),_0x452fa3&&logger[_0x4c7fc6(0x1dd)](_0x4c7fc6(0x1d1),_0x4c7fc6(0x1d8)+_0x30715a,{'appCode':_0x665b97,'projectPath':_0x452fa3}),![];}finally{_0xee62c4&&process['chdir'](_0xee62c4);}}
1
+ function a9_0x3915(){const _0x301831=['7968590uUHVhg','*\x20正在处理\x20','create-api-pull','√\x20成功拉取\x20','online','-api','91wjNmsf','323976FpowHZ','.ts\x20-\x20模型配置文件','58581IzHoFX','modelCount','146230XUMOvQ','×\x20文件前缀格式不正确。只能包含字母、数字、连字符和下划线,且必须以字母开头。','length','1JjSoqM','810lsOEmD','584724RsAYxY','api','\x20个数据集...','\x20\x20\x20•\x20','.ts\x20-\x20客户端实例文件','error','66jVNHUf','*\x20正在从服务器拉取\x20API\x20配置...\x20(环境:\x20','API\x20配置拉取异常:\x20','104UKUKjJ','\x20个模型','999065vOSnRL','info','chdir','env','trim','74466CMHLEt','test','-client','*\x20开始生成\x20API\x20配置文件:','\x20个数据集,生成\x20','client','36eQKqkq','string','13cDnkuF','log'];a9_0x3915=function(){return _0x301831;};return a9_0x3915();}(function(_0x48c58e,_0x498ab5){const _0x6c9d18=a9_0x300f,_0x4bc099=_0x48c58e();while(!![]){try{const _0x5b3f22=-parseInt(_0x6c9d18(0x1c4))/0x1*(parseInt(_0x6c9d18(0x1c1))/0x2)+parseInt(_0x6c9d18(0x1bf))/0x3*(parseInt(_0x6c9d18(0x1cf))/0x4)+-parseInt(_0x6c9d18(0x1d1))/0x5*(-parseInt(_0x6c9d18(0x1b2))/0x6)+-parseInt(_0x6c9d18(0x1bc))/0x7*(parseInt(_0x6c9d18(0x1bd))/0x8)+parseInt(_0x6c9d18(0x1ac))/0x9*(-parseInt(_0x6c9d18(0x1c5))/0xa)+-parseInt(_0x6c9d18(0x1cc))/0xb*(parseInt(_0x6c9d18(0x1c6))/0xc)+-parseInt(_0x6c9d18(0x1b4))/0xd*(-parseInt(_0x6c9d18(0x1b6))/0xe);if(_0x5b3f22===_0x498ab5)break;else _0x4bc099['push'](_0x4bc099['shift']());}catch(_0x39c579){_0x4bc099['push'](_0x4bc099['shift']());}}}(a9_0x3915,0xae3a1));import{readConfig}from'../utils/config.js';import{initEnv}from'../constant/env.js';import{generateApiFile}from'./generate-api-file.js';import{logger}from'../utils/logger.js';import{fetchModelList}from'./fetch-model-list.js';function a9_0x300f(_0x29feda,_0x399361){_0x29feda=_0x29feda-0x1ac;const _0x3915d6=a9_0x3915();let _0x300fc5=_0x3915d6[_0x29feda];return _0x300fc5;}export async function pullApiSilent(_0x8d1f9b,_0x507f63,_0x1adc32,_0x4a2589){const _0x3509ec=a9_0x300f;let _0x2335de;try{const _0xa2feea=_0x507f63?.[_0x3509ec(0x1d5)]()||'';if(_0xa2feea){const _0x4827ab=/^[a-zA-Z][a-zA-Z0-9_-]*$/;if(!_0x4827ab[_0x3509ec(0x1ad)](_0xa2feea))return console[_0x3509ec(0x1cb)](_0x3509ec(0x1c2)),![];}_0x1adc32&&(_0x2335de=process['cwd'](),process[_0x3509ec(0x1d3)](_0x1adc32));const _0x51bc1d=readConfig(),_0x56f107=typeof _0x51bc1d[_0x3509ec(0x1d4)]===_0x3509ec(0x1b3)?_0x51bc1d[_0x3509ec(0x1d4)]:undefined,_0x55626a=_0x4a2589||_0x56f107||_0x3509ec(0x1ba);initEnv(_0x55626a),console[_0x3509ec(0x1b5)](_0x3509ec(0x1cd)+_0x55626a+')');const {configArray:_0x452581}=await fetchModelList(_0x8d1f9b),_0x2e329d=_0xa2feea?_0xa2feea+_0x3509ec(0x1bb):_0x3509ec(0x1c7),_0x31e1df=_0xa2feea?_0xa2feea+_0x3509ec(0x1ae):_0x3509ec(0x1b1);console[_0x3509ec(0x1b5)](_0x3509ec(0x1af)),console[_0x3509ec(0x1b5)](_0x3509ec(0x1c9)+_0x2e329d+_0x3509ec(0x1be)),console[_0x3509ec(0x1b5)](_0x3509ec(0x1c9)+_0x31e1df+_0x3509ec(0x1ca)),console[_0x3509ec(0x1b5)](_0x3509ec(0x1b7)+_0x452581[_0x3509ec(0x1c3)]+_0x3509ec(0x1c8));const _0xd33048=await generateApiFile(_0x452581,_0xa2feea,_0x8d1f9b,!![],_0x55626a);return console[_0x3509ec(0x1b5)](_0x3509ec(0x1b9)+_0x452581[_0x3509ec(0x1c3)]+_0x3509ec(0x1b0)+_0xd33048[_0x3509ec(0x1c0)]+_0x3509ec(0x1d0)),_0x1adc32&&logger[_0x3509ec(0x1d2)](_0x3509ec(0x1b8),'API\x20配置拉取成功:\x20'+_0x8d1f9b,{'projectPath':_0x1adc32,'appCode':_0x8d1f9b,'datasetCount':_0x452581[_0x3509ec(0x1c3)],'filePrefix':_0xa2feea}),!![];}catch(_0x4696df){const _0x1ade4a=_0x4696df instanceof Error?_0x4696df['message']:String(_0x4696df);return console[_0x3509ec(0x1cb)]('×\x20API\x20配置拉取异常:',_0x1ade4a),_0x1adc32&&logger['error'](_0x3509ec(0x1b8),_0x3509ec(0x1ce)+_0x1ade4a,{'appCode':_0x8d1f9b,'projectPath':_0x1adc32}),![];}finally{_0x2335de&&process[_0x3509ec(0x1d3)](_0x2335de);}}
@@ -1 +1 @@
1
- function a10_0xd31a(){const _0x237e0b=['\x20←\x20','blue','↑/↓:\x20移动光标\x20空格:\x20切换选中\x20a:\x20全选\x20i/r:\x20反选\x20Enter:\x20确认','请至少选择一个菜单','delete','[✓]','[\x20]','创建菜单失败','*\x20请选择要同步的菜单:','done','max','菜单名称','808532YvCaKU','white','value','input-js','1358024KUoNze','includes','map','36SaZXXh','filter','repeat','lovrabet\x20auth','input-css','path','388966RnkvHL','*\x20JS\x20链接:\x20','3PVMEaB','gray','CSS\x20链接无法访问','creating','test','2332115qBvqDT','local','CSS\x20链接','return','green','JS\x20链接','has','11817930sTpHSw','backspace','326426KEtuGw','6HTCUxr','trim','downArrow','size','!\x20未找到本地页面,请先创建页面','slice','247401xMquPq','JS\x20链接无法访问','selecting','*\x20同步菜单到\x20Lovrabet\x20平台','red','fill','cyan','已选择菜单','yellow','online','length','\x20输入项目的\x20JS\x20资源链接(https://...)','add','column','join','*\x20CSS\x20链接:\x20','\x20输入项目的\x20CSS\x20资源链接(https://...)','label','Lovrabet平台'];a10_0xd31a=function(){return _0x237e0b;};return a10_0xd31a();}function a10_0x29c0(_0x4b076b,_0x5cb343){_0x4b076b=_0x4b076b-0x1a6;const _0xd31a65=a10_0xd31a();let _0x29c0c8=_0xd31a65[_0x4b076b];return _0x29c0c8;}(function(_0x1b5996,_0x1cad29){const _0x163773=a10_0x29c0,_0x375aa9=_0x1b5996();while(!![]){try{const _0x465a1a=parseInt(_0x163773(0x1ca))/0x1+parseInt(_0x163773(0x1ba))/0x2+-parseInt(_0x163773(0x1bc))/0x3*(parseInt(_0x163773(0x1ad))/0x4)+parseInt(_0x163773(0x1c1))/0x5*(-parseInt(_0x163773(0x1cb))/0x6)+parseInt(_0x163773(0x1d1))/0x7+parseInt(_0x163773(0x1b1))/0x8*(-parseInt(_0x163773(0x1b4))/0x9)+parseInt(_0x163773(0x1c8))/0xa;if(_0x465a1a===_0x1cad29)break;else _0x375aa9['push'](_0x375aa9['shift']());}catch(_0x397ee5){_0x375aa9['push'](_0x375aa9['shift']());}}}(a10_0xd31a,0x5f54d));import{jsx as a10_0x3028ac,jsxs as a10_0x501adf,Fragment as a10_0x347a28}from'react/jsx-runtime';import{Text,Box,useInput,useApp,render}from'ink';import{useEffect,useState}from'react';import a10_0x1f7fa1 from'ink-spinner';import{useGetOnlineMenuList}from'./use-get-online-menu-list.js';import{getLocalPages}from'./get-local-pages.js';import{createMenus}from'./create-menu.js';import{isUrlReachable,isValidCssHttpsUrl,isValidJsHttpsUrl}from'./valid-url.js';import.meta.main&&render(a10_0x3028ac(AppMenuSyncUI,{}));export function AppMenuSyncUI(){const _0x52d215=a10_0x29c0,{exit:_0x3e2b50}=useApp(),{loading:_0x1374dd,menuList:_0x2ef46b,error:_0x1e1cf5}=useGetOnlineMenuList(),_0x1eed78=getLocalPages(),_0x437e19=_0x2ef46b[_0x52d215(0x1b3)](_0x4c196d=>_0x4c196d['path']),_0xcd7cfd=['菜单名称',..._0x1eed78[_0x52d215(0x1b3)](_0x3b7645=>_0x3b7645[_0x52d215(0x1e2)])],_0x1ce53e=getStringWidth(getMaxWidth(_0xcd7cfd,0x4)),_0x584a4b=getStringWidth(getMaxWidth([_0x52d215(0x1ac)])),[_0x32a5bb,_0x2b41e8]=useState(_0x52d215(0x1d3)),[_0x2d5823,_0x825753]=useState(new Set()),[_0x27943e,_0x5c9295]=useState(0x0),[_0x23db5b,_0x58abc7]=useState(''),[_0x4c6562,_0x1500b7]=useState(''),[_0x3dff4f,_0x32b7ee]=useState(''),[_0x2765a1,_0x6e7cae]=useState(''),[_0x578a81,_0x5de673]=useState([]),_0x68a881=_0x1eed78[_0x52d215(0x1b3)](_0x137d36=>({'label':_0x137d36[_0x52d215(0x1e2)],'path':_0x137d36[_0x52d215(0x1b9)],'local':!![],'online':_0x437e19[_0x52d215(0x1b2)](_0x137d36[_0x52d215(0x1b9)])})),_0x40709d=_0x1eed78['filter'](_0x12ecf5=>{const _0x354a35=_0x52d215;return!_0x437e19[_0x354a35(0x1b2)](_0x12ecf5['path']);});useEffect(()=>{const _0x4806e7=_0x52d215;if(!_0x1374dd&&_0x1eed78[_0x4806e7(0x1db)]>0x0&&_0x2d5823['size']===0x0){const _0x33f5b6=new Set(_0x1eed78[_0x4806e7(0x1b3)]((_0x56e3ea,_0x47f268)=>({'page':_0x56e3ea,'index':_0x47f268}))[_0x4806e7(0x1b5)](({page:_0xf58e6a})=>!_0x437e19['includes'](_0xf58e6a[_0x4806e7(0x1b9)]))[_0x4806e7(0x1b3)](({index:_0x490b05})=>_0x490b05));_0x825753(_0x33f5b6);}},[_0x1374dd,_0x1eed78[_0x52d215(0x1db)],_0x437e19[_0x52d215(0x1db)]]),useInput(async(_0x4f3c0d,_0x4e27dc)=>{const _0x1bef6b=_0x52d215;if(_0x32a5bb===_0x1bef6b(0x1d3)){if(_0x4e27dc['upArrow']){_0x5c9295(_0x29db52=>_0x29db52>0x0?_0x29db52-0x1:_0x1eed78[_0x1bef6b(0x1db)]-0x1);return;}if(_0x4e27dc[_0x1bef6b(0x1cd)]){_0x5c9295(_0x28be65=>_0x28be65<_0x1eed78[_0x1bef6b(0x1db)]-0x1?_0x28be65+0x1:0x0);return;}if(_0x4f3c0d==='\x20'){_0x825753(_0x353b48=>{const _0x45f4e3=_0x1bef6b,_0x32f082=new Set(_0x353b48);return _0x32f082[_0x45f4e3(0x1c7)](_0x27943e)?_0x32f082[_0x45f4e3(0x1e8)](_0x27943e):_0x32f082[_0x45f4e3(0x1dd)](_0x27943e),_0x32f082;});return;}if(_0x4f3c0d==='a'||_0x4f3c0d==='A'){const _0x481901=new Set(_0x1eed78[_0x1bef6b(0x1b3)]((_0x2bef41,_0x18bb64)=>_0x18bb64));_0x825753(_0x481901);return;}if(_0x4f3c0d==='i'||_0x4f3c0d==='I'||_0x4f3c0d==='r'||_0x4f3c0d==='R'){_0x825753(_0xf18ccb=>{const _0x13e659=_0x1bef6b,_0x939b7f=new Set();for(let _0x4722e8=0x0;_0x4722e8<_0x1eed78['length'];_0x4722e8++){!_0xf18ccb[_0x13e659(0x1c7)](_0x4722e8)&&_0x939b7f[_0x13e659(0x1dd)](_0x4722e8);}return _0x939b7f;});return;}if(_0x4f3c0d==='q'||_0x4f3c0d==='Q'){_0x3e2b50();return;}if(_0x4e27dc['return']){if(_0x2d5823[_0x1bef6b(0x1ce)]===0x0){_0x6e7cae(_0x1bef6b(0x1e7));return;}const _0x45cb24=_0x1eed78['filter']((_0x298c0f,_0xa03d1e)=>_0x2d5823[_0x1bef6b(0x1c7)](_0xa03d1e)),_0xfdabc9=_0x45cb24['map'](_0x2186b4=>_0x2186b4[_0x1bef6b(0x1e2)])[_0x1bef6b(0x1df)](',\x20');_0x5de673([{'label':_0x1bef6b(0x1d8),'value':_0x2d5823[_0x1bef6b(0x1ce)]+'\x20个'}]),_0x6e7cae(''),_0x2b41e8(_0x1bef6b(0x1b0));return;}return;}if(_0x32a5bb===_0x1bef6b(0x1b0)){if(_0x4e27dc[_0x1bef6b(0x1c4)]){const _0x38d95a=_0x3dff4f[_0x1bef6b(0x1cc)]();if(_0x38d95a==='')return;if(!isValidJsHttpsUrl(_0x38d95a)){_0x6e7cae('请输入有效的\x20JS\x20https\x20链接');return;}if(!await isUrlReachable(_0x38d95a)){_0x6e7cae(_0x1bef6b(0x1d2));return;}_0x58abc7(_0x38d95a),_0x5de673(_0x4dd869=>[..._0x4dd869,{'label':_0x1bef6b(0x1c6),'value':_0x38d95a}]),_0x32b7ee(''),_0x6e7cae(''),_0x2b41e8(_0x1bef6b(0x1b8));return;}if(_0x4e27dc[_0x1bef6b(0x1c9)]||_0x4e27dc['delete']){_0x32b7ee(_0x5d9fa0=>_0x5d9fa0[_0x1bef6b(0x1d0)](0x0,-0x1)),_0x6e7cae('');return;}_0x32b7ee(_0x1113fa=>_0x1113fa+_0x4f3c0d);return;}if(_0x32a5bb===_0x1bef6b(0x1b8)){if(_0x4e27dc[_0x1bef6b(0x1c4)]){const _0x2971e0=_0x3dff4f['trim']();if(_0x2971e0==='')return;if(!isValidCssHttpsUrl(_0x2971e0)){_0x6e7cae('请输入有效的\x20CSS\x20https\x20链接');return;}if(!await isUrlReachable(_0x2971e0)){_0x6e7cae(_0x1bef6b(0x1be));return;}_0x1500b7(_0x2971e0),_0x5de673(_0x3fbc4c=>[..._0x3fbc4c,{'label':_0x1bef6b(0x1c3),'value':_0x2971e0}]),_0x32b7ee(''),_0x6e7cae(''),_0x2b41e8(_0x1bef6b(0x1bf));const _0x4f3546=_0x1eed78[_0x1bef6b(0x1b5)]((_0x898c29,_0x3c6244)=>_0x2d5823[_0x1bef6b(0x1c7)](_0x3c6244));createMenus(_0x4f3546,[_0x23db5b,_0x2971e0])['then'](()=>{const _0x45f92d=_0x1bef6b;_0x2b41e8(_0x45f92d(0x1aa)),setTimeout(()=>{_0x3e2b50();},0x3e8);})['catch'](_0x52d539=>{const _0xb49071=_0x1bef6b;_0x6e7cae(_0x52d539['message']||_0xb49071(0x1a8)),_0x2b41e8(_0xb49071(0x1d3));});return;}if(_0x4e27dc[_0x1bef6b(0x1c9)]||_0x4e27dc[_0x1bef6b(0x1e8)]){_0x32b7ee(_0x51f3aa=>_0x51f3aa['slice'](0x0,-0x1)),_0x6e7cae('');return;}_0x32b7ee(_0x21f9ae=>_0x21f9ae+_0x4f3c0d);return;}});if(_0x1374dd)return a10_0x501adf(Box,{'marginTop':0x1,'marginBottom':0x1,'children':[a10_0x3028ac(Text,{'children':'\x20\x20'}),a10_0x3028ac(a10_0x1f7fa1,{'type':'dots'}),a10_0x3028ac(Text,{'children':'\x20正在获取线上菜单列表...'})]});if(_0x1e1cf5)return a10_0x501adf(Box,{'flexDirection':_0x52d215(0x1de),'marginTop':0x1,'marginBottom':0x1,'children':[a10_0x501adf(Text,{'color':'red','children':['✗\x20',_0x1e1cf5]}),a10_0x501adf(Box,{'marginTop':0x1,'children':[a10_0x3028ac(Text,{'color':_0x52d215(0x1bd),'children':'提示:使用\x20'}),a10_0x3028ac(Text,{'color':_0x52d215(0x1d7),'children':_0x52d215(0x1b7)}),a10_0x3028ac(Text,{'color':_0x52d215(0x1bd),'children':'\x20命令重新登录'})]})]});if(_0x1eed78['length']===0x0)return a10_0x3028ac(Box,{'marginTop':0x1,'marginBottom':0x1,'children':a10_0x3028ac(Text,{'color':_0x52d215(0x1d9),'children':_0x52d215(0x1cf)})});return a10_0x501adf(Box,{'flexDirection':_0x52d215(0x1de),'marginTop':0x1,'marginBottom':0x1,'children':[_0x32a5bb===_0x52d215(0x1d3)&&a10_0x501adf(a10_0x347a28,{'children':[a10_0x501adf(Box,{'children':[a10_0x501adf(Text,{'bold':!![],'children':['\x20\x20',_0x52d215(0x1ac),getRemainingSpaces(_0x1ce53e,_0x52d215(0x1ac))]}),a10_0x501adf(Text,{'bold':!![],'children':['本地',getRemainingSpaces(_0x584a4b,_0x52d215(0x1ac))]}),a10_0x501adf(Text,{'bold':!![],'children':[_0x52d215(0x1e3),getRemainingSpaces(_0x584a4b,_0x52d215(0x1ac))]})]}),_0x68a881[_0x52d215(0x1b3)](_0x2b2f2b=>a10_0x501adf(Box,{'children':[a10_0x501adf(Text,{'children':['\x20\x20',_0x2b2f2b['label'],getRemainingSpaces(_0x1ce53e,_0x2b2f2b[_0x52d215(0x1e2)])]}),a10_0x501adf(Text,{'color':'green','children':[_0x2b2f2b[_0x52d215(0x1c2)]?'✓':'✗',getRemainingSpaces(_0x584a4b,'✓')]}),a10_0x501adf(Text,{'color':_0x2b2f2b[_0x52d215(0x1da)]?_0x52d215(0x1c5):_0x52d215(0x1d5),'children':[_0x2b2f2b['online']?'✓':'✗',getRemainingSpaces(_0x584a4b,'✓')]})]},_0x2b2f2b['path']))]}),_0x32a5bb===_0x52d215(0x1d3)&&_0x578a81['length']===0x0&&a10_0x3028ac(Box,{'marginTop':0x1,'children':a10_0x3028ac(Text,{'color':_0x52d215(0x1d7),'children':_0x52d215(0x1d4)})}),_0x578a81[_0x52d215(0x1b3)]((_0x36ca0d,_0x246513)=>a10_0x501adf(Box,{'children':[a10_0x501adf(Text,{'color':_0x52d215(0x1c5),'children':['√\x20',_0x36ca0d[_0x52d215(0x1e2)],':\x20']}),a10_0x3028ac(Text,{'color':'cyan','children':_0x36ca0d[_0x52d215(0x1af)]})]},_0x246513)),_0x2765a1&&_0x32a5bb===_0x52d215(0x1d3)&&a10_0x3028ac(Box,{'marginTop':0x1,'children':a10_0x501adf(Text,{'color':_0x52d215(0x1d5),'children':['✗\x20',_0x2765a1]})}),_0x32a5bb===_0x52d215(0x1d3)&&a10_0x3028ac(a10_0x347a28,{'children':a10_0x501adf(Box,{'marginTop':_0x578a81[_0x52d215(0x1db)]>0x0||_0x2765a1?0x1:0x0,'flexDirection':_0x52d215(0x1de),'children':[a10_0x3028ac(Text,{'bold':!![],'children':_0x52d215(0x1a9)}),_0x1eed78['map']((_0x66314c,_0x431af9)=>{const _0x6b5c18=_0x52d215,_0x25acb5=_0x27943e===_0x431af9,_0x4cceac=_0x2d5823[_0x6b5c18(0x1c7)](_0x431af9),_0x44bd2d=_0x437e19['includes'](_0x66314c[_0x6b5c18(0x1b9)]),_0x24f42d=_0x44bd2d?'更新':'新建';return a10_0x3028ac(Box,{'children':a10_0x501adf(Text,{'backgroundColor':_0x25acb5?_0x6b5c18(0x1e5):undefined,'color':_0x25acb5?_0x6b5c18(0x1ae):undefined,'children':['\x20\x20',_0x4cceac?_0x6b5c18(0x1a6):_0x6b5c18(0x1a7),'\x20',_0x66314c['label']]})},_0x66314c['path']);}),a10_0x3028ac(Box,{'marginTop':0x1,'children':a10_0x501adf(Text,{'color':_0x52d215(0x1bd),'children':['\x20',_0x52d215(0x1e6)]})})]})}),_0x32a5bb==='input-js'&&a10_0x501adf(a10_0x347a28,{'children':[a10_0x501adf(Box,{'children':[a10_0x3028ac(Text,{'children':_0x52d215(0x1bb)}),a10_0x3028ac(Text,{'color':'green','children':_0x3dff4f}),_0x2765a1&&a10_0x501adf(Text,{'color':_0x52d215(0x1d5),'children':[_0x52d215(0x1e4),_0x2765a1]})]}),!_0x2765a1&&a10_0x3028ac(Box,{'children':a10_0x3028ac(Text,{'color':_0x52d215(0x1bd),'children':_0x52d215(0x1dc)})})]}),_0x32a5bb===_0x52d215(0x1b8)&&a10_0x501adf(a10_0x347a28,{'children':[a10_0x501adf(Box,{'children':[a10_0x3028ac(Text,{'children':_0x52d215(0x1e0)}),a10_0x3028ac(Text,{'color':'green','children':_0x3dff4f}),_0x2765a1&&a10_0x501adf(Text,{'color':_0x52d215(0x1d5),'children':[_0x52d215(0x1e4),_0x2765a1]})]}),!_0x2765a1&&a10_0x3028ac(Box,{'children':a10_0x3028ac(Text,{'color':_0x52d215(0x1bd),'children':_0x52d215(0x1e1)})})]}),_0x32a5bb===_0x52d215(0x1bf)&&a10_0x3028ac(Box,{'children':a10_0x3028ac(Text,{'children':'*\x20正在创建菜单...'})}),_0x32a5bb===_0x52d215(0x1aa)&&a10_0x3028ac(Box,{'children':a10_0x3028ac(Text,{'color':_0x52d215(0x1c5),'children':'√\x20菜单创建完成'})})]});}function getStringWidth(_0x1c3d77){const _0x77f93a=a10_0x29c0;let _0x2e8a64=0x0;for(const _0x4fc3e1 of _0x1c3d77){/[\u4e00-\u9fa5]/[_0x77f93a(0x1c0)](_0x4fc3e1)?_0x2e8a64+=0x2:_0x2e8a64+=0x1;}return _0x2e8a64;}function getRemainingSpaces(_0x8901cb,_0x4d84ac){const _0x42a534=a10_0x29c0,_0x1029bc=getStringWidth(_0x4d84ac);return Array(Math[_0x42a534(0x1ab)](0x0,_0x8901cb-_0x1029bc))[_0x42a534(0x1d6)]('\x20')[_0x42a534(0x1df)]('');}function getMaxWidth(_0x17359c,_0x2d1cc2=0x2){const _0x5aa19c=a10_0x29c0;let _0x37df91='',_0x4978d3=0x0;for(const _0x347e9f of _0x17359c){const _0xc7ae23=getStringWidth(_0x347e9f);_0xc7ae23>_0x4978d3&&(_0x4978d3=_0xc7ae23,_0x37df91=_0x347e9f);}return _0x37df91+'\x20'[_0x5aa19c(0x1b6)](_0x2d1cc2);}
1
+ (function(_0x39a226,_0x201af5){const _0x25f831=a10_0x3dc7,_0x4cc748=_0x39a226();while(!![]){try{const _0x2116c1=-parseInt(_0x25f831(0xe8))/0x1+-parseInt(_0x25f831(0xf2))/0x2+parseInt(_0x25f831(0xee))/0x3*(-parseInt(_0x25f831(0xc0))/0x4)+-parseInt(_0x25f831(0xbf))/0x5*(parseInt(_0x25f831(0xf6))/0x6)+-parseInt(_0x25f831(0xe1))/0x7*(parseInt(_0x25f831(0xf3))/0x8)+parseInt(_0x25f831(0xef))/0x9+parseInt(_0x25f831(0xd6))/0xa;if(_0x2116c1===_0x201af5)break;else _0x4cc748['push'](_0x4cc748['shift']());}catch(_0xd84836){_0x4cc748['push'](_0x4cc748['shift']());}}}(a10_0x420c,0xa93cd));import{jsx as a10_0x1a39d0,jsxs as a10_0x59cfe5,Fragment as a10_0x3d321e}from'react/jsx-runtime';import{Text,Box,useInput,useApp,render}from'ink';import{useEffect,useState}from'react';import a10_0x4dd96a from'ink-spinner';import{useGetOnlineMenuList}from'./use-get-online-menu-list.js';import{getLocalPages}from'./get-local-pages.js';import{createMenus}from'./create-menu.js';import{isUrlReachable,isValidCssHttpsUrl,isValidJsHttpsUrl}from'./valid-url.js';import.meta.main&&render(a10_0x1a39d0(AppMenuSyncUI,{}));function a10_0x420c(){const _0x5db266=['map','JS\x20链接无法访问','size','\x20命令重新登录','message','delete','菜单名称','has','white','selecting','input-js','backspace','\x20正在获取线上菜单列表...','done','38074940xHDRJj','join','!\x20未找到本地页面,请先创建页面','local','red','length','slice','*\x20请选择要同步的菜单:','return','includes','Lovrabet平台','14TlfziH','green','yellow','↑/↓:\x20移动光标\x20空格:\x20切换选中\x20a:\x20全选\x20i/r:\x20反选\x20Enter:\x20确认','\x20←\x20','label','trim','1053149usurtT','input-css','filter','创建菜单失败','CSS\x20链接','online','6NtiDrE','756207kEdVmc','downArrow','column','2069278ZjCFJW','883888yuZjes','*\x20CSS\x20链接:\x20','*\x20JS\x20链接:\x20','6XAZAIF','*\x20同步菜单到\x20Lovrabet\x20平台','√\x20菜单创建完成','gray','blue','catch','CSS\x20链接无法访问','已选择菜单','[✓]','\x20输入项目的\x20JS\x20资源链接(https://...)','repeat','\x20输入项目的\x20CSS\x20资源链接(https://...)','3349910zifvwQ','439156EThQDk','path','*\x20正在创建菜单...','add','creating','cyan','test','[\x20]'];a10_0x420c=function(){return _0x5db266;};return a10_0x420c();}function a10_0x3dc7(_0x9d4ee7,_0x261a2d){_0x9d4ee7=_0x9d4ee7-0xb6;const _0x420cda=a10_0x420c();let _0x3dc74f=_0x420cda[_0x9d4ee7];return _0x3dc74f;}export function AppMenuSyncUI(){const _0x2bf1cd=a10_0x3dc7,{exit:_0x3bf69e}=useApp(),{loading:_0x525f77,menuList:_0xab662a,error:_0x27055e}=useGetOnlineMenuList(),_0x4e83b0=getLocalPages(),_0x4b9333=_0xab662a['map'](_0x3e9410=>_0x3e9410[_0x2bf1cd(0xc1)]),_0x2234b5=[_0x2bf1cd(0xce),..._0x4e83b0[_0x2bf1cd(0xc8)](_0x1a712a=>_0x1a712a[_0x2bf1cd(0xe6)])],_0x52c8c1=getStringWidth(getMaxWidth(_0x2234b5,0x4)),_0x424eb9=getStringWidth(getMaxWidth([_0x2bf1cd(0xce)])),[_0x43018f,_0x1d448c]=useState(_0x2bf1cd(0xd1)),[_0x1c8fcf,_0x24d318]=useState(new Set()),[_0xb5ad0e,_0x1b6521]=useState(0x0),[_0x2bbfcf,_0x19d983]=useState(''),[_0x53f877,_0xd5fc82]=useState(''),[_0x5adc56,_0x2908de]=useState(''),[_0x31de1e,_0x3891d9]=useState(''),[_0x27ceb6,_0x4bbf17]=useState([]),_0xfe934f=_0x4e83b0['map'](_0x13acde=>({'label':_0x13acde[_0x2bf1cd(0xe6)],'path':_0x13acde[_0x2bf1cd(0xc1)],'local':!![],'online':_0x4b9333['includes'](_0x13acde[_0x2bf1cd(0xc1)])})),_0x4ce02c=_0x4e83b0[_0x2bf1cd(0xea)](_0x21f04c=>{const _0x3e42ab=_0x2bf1cd;return!_0x4b9333[_0x3e42ab(0xdf)](_0x21f04c[_0x3e42ab(0xc1)]);});useEffect(()=>{const _0x4cf472=_0x2bf1cd;if(!_0x525f77&&_0x4e83b0[_0x4cf472(0xdb)]>0x0&&_0x1c8fcf[_0x4cf472(0xca)]===0x0){const _0x3b4d40=new Set(_0x4e83b0['map']((_0x36bfdb,_0x5dfef9)=>({'page':_0x36bfdb,'index':_0x5dfef9}))[_0x4cf472(0xea)](({page:_0x4e3a34})=>!_0x4b9333[_0x4cf472(0xdf)](_0x4e3a34['path']))['map'](({index:_0x56be9b})=>_0x56be9b));_0x24d318(_0x3b4d40);}},[_0x525f77,_0x4e83b0[_0x2bf1cd(0xdb)],_0x4b9333[_0x2bf1cd(0xdb)]]),useInput(async(_0x407c53,_0x22fd31)=>{const _0x1f7f8c=_0x2bf1cd;if(_0x43018f===_0x1f7f8c(0xd1)){if(_0x22fd31['upArrow']){_0x1b6521(_0x49252c=>_0x49252c>0x0?_0x49252c-0x1:_0x4e83b0[_0x1f7f8c(0xdb)]-0x1);return;}if(_0x22fd31[_0x1f7f8c(0xf0)]){_0x1b6521(_0x1d7dbd=>_0x1d7dbd<_0x4e83b0[_0x1f7f8c(0xdb)]-0x1?_0x1d7dbd+0x1:0x0);return;}if(_0x407c53==='\x20'){_0x24d318(_0x247cd0=>{const _0x44a373=_0x1f7f8c,_0x149974=new Set(_0x247cd0);return _0x149974['has'](_0xb5ad0e)?_0x149974[_0x44a373(0xcd)](_0xb5ad0e):_0x149974[_0x44a373(0xc3)](_0xb5ad0e),_0x149974;});return;}if(_0x407c53==='a'||_0x407c53==='A'){const _0xc02363=new Set(_0x4e83b0[_0x1f7f8c(0xc8)]((_0x5d89ed,_0x552e6d)=>_0x552e6d));_0x24d318(_0xc02363);return;}if(_0x407c53==='i'||_0x407c53==='I'||_0x407c53==='r'||_0x407c53==='R'){_0x24d318(_0x3e520d=>{const _0x5ab77f=_0x1f7f8c,_0x10fa1a=new Set();for(let _0x1330ee=0x0;_0x1330ee<_0x4e83b0[_0x5ab77f(0xdb)];_0x1330ee++){!_0x3e520d[_0x5ab77f(0xcf)](_0x1330ee)&&_0x10fa1a[_0x5ab77f(0xc3)](_0x1330ee);}return _0x10fa1a;});return;}if(_0x407c53==='q'||_0x407c53==='Q'){_0x3bf69e();return;}if(_0x22fd31[_0x1f7f8c(0xde)]){if(_0x1c8fcf[_0x1f7f8c(0xca)]===0x0){_0x3891d9('请至少选择一个菜单');return;}const _0x512cf0=_0x4e83b0['filter']((_0x25f75e,_0x2d0221)=>_0x1c8fcf[_0x1f7f8c(0xcf)](_0x2d0221)),_0x441ef8=_0x512cf0[_0x1f7f8c(0xc8)](_0x461c7b=>_0x461c7b['label'])[_0x1f7f8c(0xd7)](',\x20');_0x4bbf17([{'label':_0x1f7f8c(0xba),'value':_0x1c8fcf[_0x1f7f8c(0xca)]+'\x20个'}]),_0x3891d9(''),_0x1d448c(_0x1f7f8c(0xd2));return;}return;}if(_0x43018f==='input-js'){if(_0x22fd31[_0x1f7f8c(0xde)]){const _0x517292=_0x5adc56[_0x1f7f8c(0xe7)]();if(_0x517292==='')return;if(!isValidJsHttpsUrl(_0x517292)){_0x3891d9('请输入有效的\x20JS\x20https\x20链接');return;}if(!await isUrlReachable(_0x517292)){_0x3891d9(_0x1f7f8c(0xc9));return;}_0x19d983(_0x517292),_0x4bbf17(_0x485951=>[..._0x485951,{'label':'JS\x20链接','value':_0x517292}]),_0x2908de(''),_0x3891d9(''),_0x1d448c(_0x1f7f8c(0xe9));return;}if(_0x22fd31[_0x1f7f8c(0xd3)]||_0x22fd31[_0x1f7f8c(0xcd)]){_0x2908de(_0x400180=>_0x400180['slice'](0x0,-0x1)),_0x3891d9('');return;}_0x2908de(_0x4b593c=>_0x4b593c+_0x407c53);return;}if(_0x43018f===_0x1f7f8c(0xe9)){if(_0x22fd31[_0x1f7f8c(0xde)]){const _0x3b6e0f=_0x5adc56['trim']();if(_0x3b6e0f==='')return;if(!isValidCssHttpsUrl(_0x3b6e0f)){_0x3891d9('请输入有效的\x20CSS\x20https\x20链接');return;}if(!await isUrlReachable(_0x3b6e0f)){_0x3891d9(_0x1f7f8c(0xb9));return;}_0xd5fc82(_0x3b6e0f),_0x4bbf17(_0x12db8c=>[..._0x12db8c,{'label':_0x1f7f8c(0xec),'value':_0x3b6e0f}]),_0x2908de(''),_0x3891d9(''),_0x1d448c(_0x1f7f8c(0xc4));const _0x133269=_0x4e83b0[_0x1f7f8c(0xea)]((_0x2cf11d,_0x2033a5)=>_0x1c8fcf[_0x1f7f8c(0xcf)](_0x2033a5));createMenus(_0x133269,[_0x2bbfcf,_0x3b6e0f])['then'](()=>{const _0x454148=_0x1f7f8c;_0x1d448c(_0x454148(0xd5)),setTimeout(()=>{_0x3bf69e();},0x3e8);})[_0x1f7f8c(0xb8)](_0x495d91=>{const _0x32fafe=_0x1f7f8c;_0x3891d9(_0x495d91[_0x32fafe(0xcc)]||_0x32fafe(0xeb)),_0x1d448c(_0x32fafe(0xd1));});return;}if(_0x22fd31['backspace']||_0x22fd31[_0x1f7f8c(0xcd)]){_0x2908de(_0x17510f=>_0x17510f[_0x1f7f8c(0xdc)](0x0,-0x1)),_0x3891d9('');return;}_0x2908de(_0x4b99be=>_0x4b99be+_0x407c53);return;}});if(_0x525f77)return a10_0x59cfe5(Box,{'marginTop':0x1,'marginBottom':0x1,'children':[a10_0x1a39d0(Text,{'children':'\x20\x20'}),a10_0x1a39d0(a10_0x4dd96a,{'type':'dots'}),a10_0x1a39d0(Text,{'children':_0x2bf1cd(0xd4)})]});if(_0x27055e)return a10_0x59cfe5(Box,{'flexDirection':'column','marginTop':0x1,'marginBottom':0x1,'children':[a10_0x59cfe5(Text,{'color':'red','children':['✗\x20',_0x27055e]}),a10_0x59cfe5(Box,{'marginTop':0x1,'children':[a10_0x1a39d0(Text,{'color':_0x2bf1cd(0xb6),'children':'提示:使用\x20'}),a10_0x1a39d0(Text,{'color':_0x2bf1cd(0xc5),'children':'lovrabet\x20auth'}),a10_0x1a39d0(Text,{'color':_0x2bf1cd(0xb6),'children':_0x2bf1cd(0xcb)})]})]});if(_0x4e83b0[_0x2bf1cd(0xdb)]===0x0)return a10_0x1a39d0(Box,{'marginTop':0x1,'marginBottom':0x1,'children':a10_0x1a39d0(Text,{'color':_0x2bf1cd(0xe3),'children':_0x2bf1cd(0xd8)})});return a10_0x59cfe5(Box,{'flexDirection':_0x2bf1cd(0xf1),'marginTop':0x1,'marginBottom':0x1,'children':[_0x43018f===_0x2bf1cd(0xd1)&&a10_0x59cfe5(a10_0x3d321e,{'children':[a10_0x59cfe5(Box,{'children':[a10_0x59cfe5(Text,{'bold':!![],'children':['\x20\x20','菜单名称',getRemainingSpaces(_0x52c8c1,_0x2bf1cd(0xce))]}),a10_0x59cfe5(Text,{'bold':!![],'children':['本地',getRemainingSpaces(_0x424eb9,_0x2bf1cd(0xce))]}),a10_0x59cfe5(Text,{'bold':!![],'children':[_0x2bf1cd(0xe0),getRemainingSpaces(_0x424eb9,_0x2bf1cd(0xce))]})]}),_0xfe934f[_0x2bf1cd(0xc8)](_0x26ba0c=>a10_0x59cfe5(Box,{'children':[a10_0x59cfe5(Text,{'children':['\x20\x20',_0x26ba0c[_0x2bf1cd(0xe6)],getRemainingSpaces(_0x52c8c1,_0x26ba0c[_0x2bf1cd(0xe6)])]}),a10_0x59cfe5(Text,{'color':'green','children':[_0x26ba0c[_0x2bf1cd(0xd9)]?'✓':'✗',getRemainingSpaces(_0x424eb9,'✓')]}),a10_0x59cfe5(Text,{'color':_0x26ba0c[_0x2bf1cd(0xed)]?_0x2bf1cd(0xe2):_0x2bf1cd(0xda),'children':[_0x26ba0c['online']?'✓':'✗',getRemainingSpaces(_0x424eb9,'✓')]})]},_0x26ba0c[_0x2bf1cd(0xc1)]))]}),_0x43018f===_0x2bf1cd(0xd1)&&_0x27ceb6[_0x2bf1cd(0xdb)]===0x0&&a10_0x1a39d0(Box,{'marginTop':0x1,'children':a10_0x1a39d0(Text,{'color':_0x2bf1cd(0xc5),'children':_0x2bf1cd(0xf7)})}),_0x27ceb6[_0x2bf1cd(0xc8)]((_0x3abf96,_0x4584d2)=>a10_0x59cfe5(Box,{'children':[a10_0x59cfe5(Text,{'color':_0x2bf1cd(0xe2),'children':['√\x20',_0x3abf96[_0x2bf1cd(0xe6)],':\x20']}),a10_0x1a39d0(Text,{'color':_0x2bf1cd(0xc5),'children':_0x3abf96['value']})]},_0x4584d2)),_0x31de1e&&_0x43018f===_0x2bf1cd(0xd1)&&a10_0x1a39d0(Box,{'marginTop':0x1,'children':a10_0x59cfe5(Text,{'color':'red','children':['✗\x20',_0x31de1e]})}),_0x43018f===_0x2bf1cd(0xd1)&&a10_0x1a39d0(a10_0x3d321e,{'children':a10_0x59cfe5(Box,{'marginTop':_0x27ceb6[_0x2bf1cd(0xdb)]>0x0||_0x31de1e?0x1:0x0,'flexDirection':_0x2bf1cd(0xf1),'children':[a10_0x1a39d0(Text,{'bold':!![],'children':_0x2bf1cd(0xdd)}),_0x4e83b0[_0x2bf1cd(0xc8)]((_0x2f8d32,_0x1b5f43)=>{const _0x24762d=_0x2bf1cd,_0x58ab2d=_0xb5ad0e===_0x1b5f43,_0x4f43d4=_0x1c8fcf[_0x24762d(0xcf)](_0x1b5f43),_0x19ba96=_0x4b9333[_0x24762d(0xdf)](_0x2f8d32[_0x24762d(0xc1)]),_0x2bcd35=_0x19ba96?'更新':'新建';return a10_0x1a39d0(Box,{'children':a10_0x59cfe5(Text,{'backgroundColor':_0x58ab2d?_0x24762d(0xb7):undefined,'color':_0x58ab2d?_0x24762d(0xd0):undefined,'children':['\x20\x20',_0x4f43d4?_0x24762d(0xbb):_0x24762d(0xc7),'\x20',_0x2f8d32['label']]})},_0x2f8d32['path']);}),a10_0x1a39d0(Box,{'marginTop':0x1,'children':a10_0x59cfe5(Text,{'color':_0x2bf1cd(0xb6),'children':['\x20',_0x2bf1cd(0xe4)]})})]})}),_0x43018f===_0x2bf1cd(0xd2)&&a10_0x59cfe5(a10_0x3d321e,{'children':[a10_0x59cfe5(Box,{'children':[a10_0x1a39d0(Text,{'children':_0x2bf1cd(0xf5)}),a10_0x1a39d0(Text,{'color':_0x2bf1cd(0xe2),'children':_0x5adc56}),_0x31de1e&&a10_0x59cfe5(Text,{'color':'red','children':[_0x2bf1cd(0xe5),_0x31de1e]})]}),!_0x31de1e&&a10_0x1a39d0(Box,{'children':a10_0x1a39d0(Text,{'color':_0x2bf1cd(0xb6),'children':_0x2bf1cd(0xbc)})})]}),_0x43018f===_0x2bf1cd(0xe9)&&a10_0x59cfe5(a10_0x3d321e,{'children':[a10_0x59cfe5(Box,{'children':[a10_0x1a39d0(Text,{'children':_0x2bf1cd(0xf4)}),a10_0x1a39d0(Text,{'color':_0x2bf1cd(0xe2),'children':_0x5adc56}),_0x31de1e&&a10_0x59cfe5(Text,{'color':_0x2bf1cd(0xda),'children':[_0x2bf1cd(0xe5),_0x31de1e]})]}),!_0x31de1e&&a10_0x1a39d0(Box,{'children':a10_0x1a39d0(Text,{'color':'gray','children':_0x2bf1cd(0xbe)})})]}),_0x43018f==='creating'&&a10_0x1a39d0(Box,{'children':a10_0x1a39d0(Text,{'children':_0x2bf1cd(0xc2)})}),_0x43018f==='done'&&a10_0x1a39d0(Box,{'children':a10_0x1a39d0(Text,{'color':'green','children':_0x2bf1cd(0xf8)})})]});}function getStringWidth(_0x5143fb){const _0x4df681=a10_0x3dc7;let _0x1d0775=0x0;for(const _0x40f342 of _0x5143fb){/[\u4e00-\u9fa5]/[_0x4df681(0xc6)](_0x40f342)?_0x1d0775+=0x2:_0x1d0775+=0x1;}return _0x1d0775;}function getRemainingSpaces(_0x11c9a3,_0x10c7a2){const _0x10fd8b=a10_0x3dc7,_0x3e2b42=getStringWidth(_0x10c7a2);return Array(Math['max'](0x0,_0x11c9a3-_0x3e2b42))['fill']('\x20')[_0x10fd8b(0xd7)]('');}function getMaxWidth(_0x15e702,_0x5f0709=0x2){const _0x83a6c=a10_0x3dc7;let _0x593168='',_0x3c601c=0x0;for(const _0x562c7d of _0x15e702){const _0x34deea=getStringWidth(_0x562c7d);_0x34deea>_0x3c601c&&(_0x3c601c=_0x34deea,_0x593168=_0x562c7d);}return _0x593168+'\x20'[_0x83a6c(0xbd)](_0x5f0709);}