@lovrabet/cli 1.1.26 → 1.2.1-beta.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (67) 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 -0
  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/cursor.js +1 -1
  51. package/lib/mcp/main.js +1 -1
  52. package/lib/types/index.js +1 -0
  53. package/lib/utils/check-sdk-version.js +1 -0
  54. package/lib/utils/config.js +1 -1
  55. package/lib/utils/copy-directory.js +1 -1
  56. package/lib/utils/http-client.js +1 -1
  57. package/lib/utils/logger.js +1 -1
  58. package/lib/utils/router-updater.js +1 -1
  59. package/lib/utils/sleep.js +1 -1
  60. package/lib/utils/template-replacer.js +1 -1
  61. package/package.json +3 -1
  62. package/templates/generate-api/api.ts.tpl +9 -4
  63. package/templates/rules/lovrabet_rules.mdc.tpl +90 -34
  64. package/lib/app-menu-cdn-version/app-menu-sync-cdn-version-ui.js +0 -1
  65. package/lib/app-menu-cdn-version/cdn-url-compare-table.js +0 -1
  66. package/lib/app-menu-cdn-version/update-menu-cdn-url.js +0 -1
  67. /package/lib/{app-menu-cdn-version → app-menu-update-cdn}/types.js +0 -0
@@ -1 +1 @@
1
- (function(_0x47710a,_0x1bc7a9){const _0x14d355=a0_0x34db,_0x4c978a=_0x47710a();while(!![]){try{const _0x26b7bd=-parseInt(_0x14d355(0x16e))/0x1+-parseInt(_0x14d355(0x173))/0x2*(-parseInt(_0x14d355(0x17d))/0x3)+parseInt(_0x14d355(0x170))/0x4*(parseInt(_0x14d355(0x182))/0x5)+-parseInt(_0x14d355(0x184))/0x6+parseInt(_0x14d355(0x171))/0x7+parseInt(_0x14d355(0x17b))/0x8+parseInt(_0x14d355(0x178))/0x9*(-parseInt(_0x14d355(0x175))/0xa);if(_0x26b7bd===_0x1bc7a9)break;else _0x4c978a['push'](_0x4c978a['shift']());}catch(_0x3d4430){_0x4c978a['push'](_0x4c978a['shift']());}}}(a0_0x2add,0x710f9));import{jsx as a0_0x2ff657,jsxs as a0_0x282b9f}from'react/jsx-runtime';function a0_0x34db(_0x464451,_0x541a66){_0x464451=_0x464451-0x16c;const _0x2add51=a0_0x2add();let _0x34db95=_0x2add51[_0x464451];return _0x34db95;}import{useState}from'react';import{Text,Box,useInput}from'ink';import a0_0x1f4797 from'node:fs';function a0_0x2add(){const _0x342fbd=['308604gfTnmT','red','页面路径\x20','\x20Step2:\x20','endsWith','test','length','728624SfTbiy','includes','56PrAjMO','5310998OkjQYI','gray','310510dsCxtx','slice','9259030kUqJBE','backspace','green','9NvTpil','路径不能包含连续的\x20/','\x20已存在,请使用其他路径','3847384QdfyHw','my-page','15HDKzcS','existsSync','return','delete','页面路径不合法','54695BwLBIx','\x20←\x20'];a0_0x2add=function(){return _0x342fbd;};return a0_0x2add();}export function InputProjectCode(_0x3d9f19){const _0xc83a38=a0_0x34db,{onSubmit:_0x5be54b,pagePath:_0x3511b9}=_0x3d9f19,[_0x99a62b,_0xab4e7f]=useState(''),[_0x1b6e63,_0x3108f4]=useState(''),_0x52f485=_0xc83a38(0x17c);function _0x46e318(_0x4eb7b3){const _0x27f756=_0xc83a38;if(_0x4eb7b3[_0x27f756(0x16d)]>0x64)return{'valid':![],'message':'页面路径长度不能超过\x20100\x20个字符'};if(_0x4eb7b3['startsWith']('/')||_0x4eb7b3[_0x27f756(0x188)]('/'))return{'valid':![],'message':'路径不能以\x20/\x20开头或结尾'};if(_0x4eb7b3[_0x27f756(0x16f)]('//'))return{'valid':![],'message':_0x27f756(0x179)};const _0x5b08f1=_0x4eb7b3['split']('/');for(const _0x4a86a0 of _0x5b08f1){if(!_0x4a86a0)continue;const _0x1a7d55=/^[A-Za-z0-9][A-Za-z0-9_-]*$/;if(!_0x1a7d55[_0x27f756(0x16c)](_0x4a86a0))return{'valid':![],'message':'路径中的每个段只能以字母或数字开头,且只包含字母、数字、-\x20和\x20_'};}return{'valid':!![]};}return useInput((_0x1d20d0,_0x4eeeef)=>{const _0x32d19d=_0xc83a38;if(_0x4eeeef[_0x32d19d(0x17f)]){const _0xc523ad=_0x99a62b['trim']()||_0x52f485;if(_0x1b6e63)return;const _0x7641dc=_0x3511b9+'/'+_0xc523ad;if(a0_0x1f4797[_0x32d19d(0x17e)](_0x7641dc)){_0x3108f4(_0x32d19d(0x186)+_0xc523ad+_0x32d19d(0x17a));return;}_0x5be54b(_0xc523ad),_0xab4e7f(''),_0x3108f4('');}else _0x4eeeef[_0x32d19d(0x176)]||_0x4eeeef[_0x32d19d(0x180)]?_0xab4e7f(_0x38e8af=>{const _0x47218d=_0x32d19d,_0x199a2a=_0x38e8af[_0x47218d(0x174)](0x0,-0x1),{valid:_0x1afb8e,message:_0x2a1ccc}=_0x46e318(_0x199a2a);return _0x3108f4(_0x1afb8e?'':_0x2a1ccc||_0x47218d(0x181)),_0x199a2a;}):_0xab4e7f(_0x43928d=>{const _0x221703=_0x32d19d,_0x4bdf9d=_0x43928d+_0x1d20d0,{valid:_0x1bf0c2,message:_0x18cfcd}=_0x46e318(_0x4bdf9d);return _0x3108f4(_0x1bf0c2?'':_0x18cfcd||_0x221703(0x181)),_0x4bdf9d;});}),a0_0x282b9f(Box,{'flexDirection':'column','children':[a0_0x282b9f(Box,{'children':[a0_0x2ff657(Text,{'color':'gray','children':_0xc83a38(0x187)}),a0_0x2ff657(Text,{'children':'页面路由地址:\x20'}),_0x99a62b?a0_0x2ff657(Text,{'color':_0xc83a38(0x177),'children':_0x99a62b}):a0_0x2ff657(Text,{'color':_0xc83a38(0x172),'children':_0x52f485}),_0x1b6e63&&a0_0x282b9f(Text,{'color':_0xc83a38(0x185),'children':[_0xc83a38(0x183),_0x1b6e63]})]}),!_0x1b6e63&&!_0x99a62b&&a0_0x2ff657(Box,{'children':a0_0x2ff657(Text,{'color':_0xc83a38(0x172),'children':'\x20直接回车确认,或输入自定义路由地址'})})]});}
1
+ (function(_0x5a504d,_0x9df3d0){const _0x2ad200=a0_0x5191,_0x1aa5c1=_0x5a504d();while(!![]){try{const _0x7a9f2b=-parseInt(_0x2ad200(0x200))/0x1+-parseInt(_0x2ad200(0x1f2))/0x2*(parseInt(_0x2ad200(0x209))/0x3)+parseInt(_0x2ad200(0x1f8))/0x4*(parseInt(_0x2ad200(0x202))/0x5)+-parseInt(_0x2ad200(0x205))/0x6+-parseInt(_0x2ad200(0x1ee))/0x7*(parseInt(_0x2ad200(0x1fa))/0x8)+parseInt(_0x2ad200(0x201))/0x9*(parseInt(_0x2ad200(0x20a))/0xa)+parseInt(_0x2ad200(0x210))/0xb;if(_0x7a9f2b===_0x9df3d0)break;else _0x1aa5c1['push'](_0x1aa5c1['shift']());}catch(_0x464755){_0x1aa5c1['push'](_0x1aa5c1['shift']());}}}(a0_0x1e56,0x2c9ac));function a0_0x5191(_0x99e9b8,_0x52b239){_0x99e9b8=_0x99e9b8-0x1ed;const _0x1e56fd=a0_0x1e56();let _0x51911c=_0x1e56fd[_0x99e9b8];return _0x51911c;}import{jsx as a0_0x5a7a4a,jsxs as a0_0x9789d1}from'react/jsx-runtime';import{useState}from'react';function a0_0x1e56(){const _0x44ab46=['页面路径长度不能超过\x20100\x20个字符','页面路由地址:\x20','delete','20tLHjaX','trim','24IFuTBX','路径中的每个段只能以字母或数字开头,且只包含字母、数字、-\x20和\x20_','split','startsWith','gray','页面路径不合法','34471ruTZyW','23913YKZejy','130805qsWjPq','green','includes','1396236nKaPwN','endsWith','backspace','existsSync','3smnnSQ','700mFojxa','路径不能以\x20/\x20开头或结尾','\x20已存在,请使用其他路径','test','slice','column','6254468tkTEvH','length','839321cvaXqZ','\x20←\x20','red','return','151594CcXoYa','my-page','页面路径\x20'];a0_0x1e56=function(){return _0x44ab46;};return a0_0x1e56();}import{Text,Box,useInput}from'ink';import a0_0x45e944 from'node:fs';export function InputProjectCode(_0x39f308){const _0x813357=a0_0x5191,{onSubmit:_0x4f59ea,pagePath:_0x71f8e3}=_0x39f308,[_0x146501,_0x504a0b]=useState(''),[_0x1d5aaf,_0x348a80]=useState(''),_0x3112e7=_0x813357(0x1f3);function _0x11c335(_0xaf9998){const _0x3f8c54=_0x813357;if(_0xaf9998[_0x3f8c54(0x1ed)]>0x64)return{'valid':![],'message':_0x3f8c54(0x1f5)};if(_0xaf9998[_0x3f8c54(0x1fd)]('/')||_0xaf9998[_0x3f8c54(0x206)]('/'))return{'valid':![],'message':_0x3f8c54(0x20b)};if(_0xaf9998[_0x3f8c54(0x204)]('//'))return{'valid':![],'message':'路径不能包含连续的\x20/'};const _0x1945bd=_0xaf9998[_0x3f8c54(0x1fc)]('/');for(const _0x450f48 of _0x1945bd){if(!_0x450f48)continue;const _0x298e1d=/^[A-Za-z0-9][A-Za-z0-9_-]*$/;if(!_0x298e1d[_0x3f8c54(0x20d)](_0x450f48))return{'valid':![],'message':_0x3f8c54(0x1fb)};}return{'valid':!![]};}return useInput((_0x3f26da,_0xa0be24)=>{const _0x25aed8=_0x813357;if(_0xa0be24[_0x25aed8(0x1f1)]){const _0x3ac339=_0x146501[_0x25aed8(0x1f9)]()||_0x3112e7;if(_0x1d5aaf)return;const _0x28dbe0=_0x71f8e3+'/'+_0x3ac339;if(a0_0x45e944[_0x25aed8(0x208)](_0x28dbe0)){_0x348a80(_0x25aed8(0x1f4)+_0x3ac339+_0x25aed8(0x20c));return;}_0x4f59ea(_0x3ac339),_0x504a0b(''),_0x348a80('');}else _0xa0be24[_0x25aed8(0x207)]||_0xa0be24[_0x25aed8(0x1f7)]?_0x504a0b(_0x4fc986=>{const _0x514b4a=_0x25aed8,_0x5d476c=_0x4fc986[_0x514b4a(0x20e)](0x0,-0x1),{valid:_0x3b6b4a,message:_0x227ae0}=_0x11c335(_0x5d476c);return _0x348a80(_0x3b6b4a?'':_0x227ae0||_0x514b4a(0x1ff)),_0x5d476c;}):_0x504a0b(_0x215c77=>{const _0x3e1ec7=_0x215c77+_0x3f26da,{valid:_0x265f7c,message:_0x269c18}=_0x11c335(_0x3e1ec7);return _0x348a80(_0x265f7c?'':_0x269c18||'页面路径不合法'),_0x3e1ec7;});}),a0_0x9789d1(Box,{'flexDirection':_0x813357(0x20f),'children':[a0_0x9789d1(Box,{'children':[a0_0x5a7a4a(Text,{'color':_0x813357(0x1fe),'children':'\x20Step2:\x20'}),a0_0x5a7a4a(Text,{'children':_0x813357(0x1f6)}),_0x146501?a0_0x5a7a4a(Text,{'color':_0x813357(0x203),'children':_0x146501}):a0_0x5a7a4a(Text,{'color':'gray','children':_0x3112e7}),_0x1d5aaf&&a0_0x9789d1(Text,{'color':_0x813357(0x1f0),'children':[_0x813357(0x1ef),_0x1d5aaf]})]}),!_0x1d5aaf&&!_0x146501&&a0_0x5a7a4a(Box,{'children':a0_0x5a7a4a(Text,{'color':_0x813357(0x1fe),'children':'\x20直接回车确认,或输入自定义路由地址'})})]});}
@@ -1 +1 @@
1
- const a1_0x5e2203=a1_0xf0e3;(function(_0x569ba5,_0x2e9ff3){const _0x909a72=a1_0xf0e3,_0x9c6f50=_0x569ba5();while(!![]){try{const _0x2f784e=parseInt(_0x909a72(0x19d))/0x1*(parseInt(_0x909a72(0x1a7))/0x2)+parseInt(_0x909a72(0x198))/0x3*(-parseInt(_0x909a72(0x1aa))/0x4)+-parseInt(_0x909a72(0x1ac))/0x5*(-parseInt(_0x909a72(0x199))/0x6)+parseInt(_0x909a72(0x1a4))/0x7+parseInt(_0x909a72(0x1a0))/0x8+-parseInt(_0x909a72(0x197))/0x9*(parseInt(_0x909a72(0x187))/0xa)+parseInt(_0x909a72(0x194))/0xb*(parseInt(_0x909a72(0x1a8))/0xc);if(_0x2f784e===_0x2e9ff3)break;else _0x9c6f50['push'](_0x9c6f50['shift']());}catch(_0x42f62c){_0x9c6f50['push'](_0x9c6f50['shift']());}}}(a1_0xcba8,0x9383e));function a1_0xf0e3(_0x35f23e,_0x3b6558){_0x35f23e=_0x35f23e-0x186;const _0xcba8b2=a1_0xcba8();let _0xf0e3d9=_0xcba8b2[_0x35f23e];return _0xf0e3d9;}function a1_0xcba8(){const _0x13e8af=['10DrCklE','add-page','pages','catch','setLogPath','processTemplate','../../templates/pages','success','dirname','\x20Step2:\x20','column','页面添加失败:\x20','error','11kPzUme','\x20*\x20页面文件已创建,可直接通过路由访问','\x20Step1:\x20','5998518SiyBUi','27UVfjNn','720OxxXib','cwd','\x20*\x20路由地址:\x20','now','1FZwwJm','finally','green','1667864GHSgXw','\x20*\x20页面创建成功!','resolve','正在创建页面,请稍候…','3497130isprHd','then','join','59654TrSgWp','8928972WplHDo','cyan','347012TpiSAl','info','23730WzfMbg','gray','src','message','已输入的页面路由\x20'];a1_0xcba8=function(){return _0x13e8af;};return a1_0xcba8();}import{jsx as a1_0x1a6aa6,jsxs as a1_0x23125a,Fragment as a1_0x8e66f4}from'react/jsx-runtime';import{fileURLToPath}from'node:url';import a1_0x57e349 from'node:path';import{useEffect,useState}from'react';import{Box,Text,useApp}from'ink';import{SelectPageTemplate}from'./select-page-template.js';import{InputProjectCode}from'./input-page-router.js';import{logger}from'../utils/logger.js';import{TemplateReplacer}from'../utils/template-replacer.js';const __dirname=a1_0x57e349[a1_0x5e2203(0x18f)](fileURLToPath(import.meta.url)),pageTemplateDir=a1_0x57e349[a1_0x5e2203(0x1a2)](__dirname,a1_0x5e2203(0x18d)),projectDir=process[a1_0x5e2203(0x19a)]();export const AddPage=()=>{const _0x279af9=a1_0x5e2203,{exit:_0x316c86}=useApp(),[_0x8ca858,_0x41647c]=useState(''),[_0x42104d,_0x5b6651]=useState(''),[_0x2d2d40,_0x7c6331]=useState(![]),[_0xcfb42f,_0x2f86a2]=useState(![]),_0x50f774=a1_0x57e349[_0x279af9(0x1a6)](projectDir,_0x279af9(0x1ae),_0x279af9(0x189)),_0x36e69b=a1_0x57e349[_0x279af9(0x1a6)](_0x50f774,_0x42104d),_0x221d53=a1_0x57e349['join'](_0x279af9(0x1ae),_0x279af9(0x189),_0x42104d);useEffect(()=>{const _0x5ae899=_0x279af9,_0x1e5a70=a1_0x57e349['resolve'](pageTemplateDir,_0x8ca858);if(_0x8ca858&&_0x42104d){_0x7c6331(!![]),logger[_0x5ae899(0x18b)](process[_0x5ae899(0x19a)]());const _0x23bc97=Date[_0x5ae899(0x19c)]();logger[_0x5ae899(0x1ab)](_0x5ae899(0x188),'开始添加页面:\x20'+_0x42104d,{'template':_0x8ca858,'targetPath':_0x221d53}),TemplateReplacer[_0x5ae899(0x18c)](_0x1e5a70,a1_0x57e349[_0x5ae899(0x1a6)](_0x50f774,_0x42104d),_0x42104d,_0x8ca858)[_0x5ae899(0x1a5)](()=>{const _0x3bc3d0=_0x5ae899,_0x1c6ce4=Date[_0x3bc3d0(0x19c)]()-_0x23bc97;logger[_0x3bc3d0(0x18e)](_0x3bc3d0(0x188),'页面添加成功:\x20'+_0x42104d,_0x1c6ce4,{'template':_0x8ca858,'targetPath':_0x221d53,'routePath':_0x42104d}),_0x2f86a2(!![]);})[_0x5ae899(0x18a)](_0x89b76f=>{const _0x4b604a=_0x5ae899,_0x3d0d2c=Date[_0x4b604a(0x19c)]()-_0x23bc97;logger[_0x4b604a(0x193)]('add-page',_0x4b604a(0x192)+_0x42104d,{'template':_0x8ca858,'targetPath':_0x221d53,'error':_0x89b76f instanceof Error?_0x89b76f[_0x4b604a(0x1af)]:String(_0x89b76f),'duration':_0x3d0d2c});})[_0x5ae899(0x19e)](()=>{_0x7c6331(![]);});}},[_0x8ca858,_0x42104d]),useEffect(()=>{_0xcfb42f&&setTimeout(()=>{_0x316c86();});},[_0xcfb42f]);if(_0x8ca858)return a1_0x23125a(Box,{'flexDirection':_0x279af9(0x191),'paddingY':0x1,'children':[a1_0x23125a(Box,{'children':[a1_0x1a6aa6(Text,{'color':_0x279af9(0x1ad),'children':_0x279af9(0x196)}),a1_0x1a6aa6(Text,{'children':'已选择页面模板\x20'}),a1_0x1a6aa6(Text,{'color':_0x279af9(0x19f),'children':_0x8ca858})]}),_0x42104d?a1_0x23125a(Box,{'children':[a1_0x1a6aa6(Text,{'color':'gray','children':_0x279af9(0x190)}),a1_0x1a6aa6(Text,{'children':_0x279af9(0x186)}),a1_0x1a6aa6(Text,{'color':_0x279af9(0x19f),'children':_0x42104d})]}):a1_0x1a6aa6(InputProjectCode,{'pagePath':_0x36e69b,'onSubmit':_0x5b6651}),_0x42104d&&_0x2d2d40?a1_0x23125a(Box,{'marginTop':0x1,'children':[a1_0x1a6aa6(Box,{'width':'4'}),a1_0x1a6aa6(Text,{'children':_0x279af9(0x1a3)})]}):null,_0xcfb42f?a1_0x23125a(a1_0x8e66f4,{'children':[a1_0x1a6aa6(Box,{'marginTop':0x1,'children':a1_0x1a6aa6(Text,{'color':_0x279af9(0x1ad),'children':_0x279af9(0x1a1)})}),a1_0x23125a(Box,{'children':[a1_0x1a6aa6(Text,{'color':_0x279af9(0x1ad),'children':'\x20*\x20页面路径:\x20'}),a1_0x1a6aa6(Text,{'color':_0x279af9(0x19f),'children':_0x221d53})]}),a1_0x23125a(Box,{'children':[a1_0x1a6aa6(Text,{'color':_0x279af9(0x1ad),'children':_0x279af9(0x19b)}),a1_0x23125a(Text,{'color':_0x279af9(0x19f),'children':['/',_0x42104d]})]}),a1_0x1a6aa6(Box,{'marginTop':0x1,'children':a1_0x1a6aa6(Text,{'color':_0x279af9(0x1a9),'children':_0x279af9(0x195)})})]}):null]});return a1_0x1a6aa6(SelectPageTemplate,{'onSelect':_0x41647c});};
1
+ const a1_0x53a574=a1_0x541e;(function(_0x45b1f1,_0x4c1075){const _0x5efb8e=a1_0x541e,_0x66d594=_0x45b1f1();while(!![]){try{const _0x5bdc81=parseInt(_0x5efb8e(0x1e2))/0x1*(parseInt(_0x5efb8e(0x1ea))/0x2)+parseInt(_0x5efb8e(0x1e1))/0x3*(-parseInt(_0x5efb8e(0x1e0))/0x4)+parseInt(_0x5efb8e(0x1d1))/0x5*(-parseInt(_0x5efb8e(0x1d5))/0x6)+parseInt(_0x5efb8e(0x1d7))/0x7*(parseInt(_0x5efb8e(0x1dd))/0x8)+parseInt(_0x5efb8e(0x1cd))/0x9+parseInt(_0x5efb8e(0x1db))/0xa*(-parseInt(_0x5efb8e(0x1e6))/0xb)+parseInt(_0x5efb8e(0x1ec))/0xc*(parseInt(_0x5efb8e(0x1e4))/0xd);if(_0x5bdc81===_0x4c1075)break;else _0x66d594['push'](_0x66d594['shift']());}catch(_0x585352){_0x66d594['push'](_0x66d594['shift']());}}}(a1_0x2487,0xdbd91));import{jsx as a1_0x2a0819,jsxs as a1_0x393ce5,Fragment as a1_0x544564}from'react/jsx-runtime';function a1_0x541e(_0x5b4a59,_0x2b8917){_0x5b4a59=_0x5b4a59-0x1c7;const _0x2487c8=a1_0x2487();let _0x541e3f=_0x2487c8[_0x5b4a59];return _0x541e3f;}import{fileURLToPath}from'node:url';import a1_0x45246c from'node:path';import{useEffect,useState}from'react';import{Box,Text,useApp}from'ink';import{SelectPageTemplate}from'./select-page-template.js';import{InputProjectCode}from'./input-page-router.js';import{logger}from'../utils/logger.js';import{TemplateReplacer}from'../utils/template-replacer.js';function a1_0x2487(){const _0x3a4042=['136YOBKvL','message','pages','4575520fhdzsi','3WbCzha','1LfTPWZ','页面添加成功:\x20','13cVWYCX','\x20Step2:\x20','1294513rAgFee','\x20*\x20路由地址:\x20','dirname','join','1363346YPSrxI','green','10908372DxgjBZ','column','resolve','正在创建页面,请稍候…','页面添加失败:\x20','src','finally','error','10623132qJYGxZ','开始添加页面:\x20','info','cwd','1585SUNbwT','已输入的页面路由\x20','gray','../../templates/pages','21150hhAmiI','已选择页面模板\x20','500101wTCcaJ','success','add-page','then','70UJuDEV','\x20*\x20页面文件已创建,可直接通过路由访问'];a1_0x2487=function(){return _0x3a4042;};return a1_0x2487();}const __dirname=a1_0x45246c[a1_0x53a574(0x1e8)](fileURLToPath(import.meta.url)),pageTemplateDir=a1_0x45246c[a1_0x53a574(0x1c7)](__dirname,a1_0x53a574(0x1d4)),projectDir=process[a1_0x53a574(0x1d0)]();export const AddPage=()=>{const _0x24739a=a1_0x53a574,{exit:_0x35136f}=useApp(),[_0x4b2895,_0x2bad16]=useState(''),[_0xece76a,_0x3828f2]=useState(''),[_0x14b7cc,_0xee17cc]=useState(![]),[_0x41be1f,_0x539663]=useState(![]),_0x23ffe1=a1_0x45246c[_0x24739a(0x1e9)](projectDir,_0x24739a(0x1ca),_0x24739a(0x1df)),_0x110684=a1_0x45246c[_0x24739a(0x1e9)](_0x23ffe1,_0xece76a),_0x3e47cb=a1_0x45246c[_0x24739a(0x1e9)](_0x24739a(0x1ca),_0x24739a(0x1df),_0xece76a);useEffect(()=>{const _0x4a7fd0=_0x24739a,_0x50a586=a1_0x45246c[_0x4a7fd0(0x1c7)](pageTemplateDir,_0x4b2895);if(_0x4b2895&&_0xece76a){_0xee17cc(!![]),logger['setLogPath'](process[_0x4a7fd0(0x1d0)]());const _0x560ebf=Date['now']();logger[_0x4a7fd0(0x1cf)]('add-page',_0x4a7fd0(0x1ce)+_0xece76a,{'template':_0x4b2895,'targetPath':_0x3e47cb}),TemplateReplacer['processTemplate'](_0x50a586,a1_0x45246c[_0x4a7fd0(0x1e9)](_0x23ffe1,_0xece76a),_0xece76a,_0x4b2895)[_0x4a7fd0(0x1da)](()=>{const _0x8ac2e=_0x4a7fd0,_0x4077f8=Date['now']()-_0x560ebf;logger[_0x8ac2e(0x1d8)]('add-page',_0x8ac2e(0x1e3)+_0xece76a,_0x4077f8,{'template':_0x4b2895,'targetPath':_0x3e47cb,'routePath':_0xece76a}),_0x539663(!![]);})['catch'](_0x253056=>{const _0x4b9eb8=_0x4a7fd0,_0x178d18=Date['now']()-_0x560ebf;logger[_0x4b9eb8(0x1cc)](_0x4b9eb8(0x1d9),_0x4b9eb8(0x1c9)+_0xece76a,{'template':_0x4b2895,'targetPath':_0x3e47cb,'error':_0x253056 instanceof Error?_0x253056[_0x4b9eb8(0x1de)]:String(_0x253056),'duration':_0x178d18});})[_0x4a7fd0(0x1cb)](()=>{_0xee17cc(![]);});}},[_0x4b2895,_0xece76a]),useEffect(()=>{_0x41be1f&&setTimeout(()=>{_0x35136f();});},[_0x41be1f]);if(_0x4b2895)return a1_0x393ce5(Box,{'flexDirection':_0x24739a(0x1ed),'paddingY':0x1,'children':[a1_0x393ce5(Box,{'children':[a1_0x2a0819(Text,{'color':_0x24739a(0x1d3),'children':'\x20Step1:\x20'}),a1_0x2a0819(Text,{'children':_0x24739a(0x1d6)}),a1_0x2a0819(Text,{'color':_0x24739a(0x1eb),'children':_0x4b2895})]}),_0xece76a?a1_0x393ce5(Box,{'children':[a1_0x2a0819(Text,{'color':_0x24739a(0x1d3),'children':_0x24739a(0x1e5)}),a1_0x2a0819(Text,{'children':_0x24739a(0x1d2)}),a1_0x2a0819(Text,{'color':_0x24739a(0x1eb),'children':_0xece76a})]}):a1_0x2a0819(InputProjectCode,{'pagePath':_0x110684,'onSubmit':_0x3828f2}),_0xece76a&&_0x14b7cc?a1_0x393ce5(Box,{'marginTop':0x1,'children':[a1_0x2a0819(Box,{'width':'4'}),a1_0x2a0819(Text,{'children':_0x24739a(0x1c8)})]}):null,_0x41be1f?a1_0x393ce5(a1_0x544564,{'children':[a1_0x2a0819(Box,{'marginTop':0x1,'children':a1_0x2a0819(Text,{'color':'gray','children':'\x20*\x20页面创建成功!'})}),a1_0x393ce5(Box,{'children':[a1_0x2a0819(Text,{'color':_0x24739a(0x1d3),'children':'\x20*\x20页面路径:\x20'}),a1_0x2a0819(Text,{'color':_0x24739a(0x1eb),'children':_0x3e47cb})]}),a1_0x393ce5(Box,{'children':[a1_0x2a0819(Text,{'color':_0x24739a(0x1d3),'children':_0x24739a(0x1e7)}),a1_0x393ce5(Text,{'color':_0x24739a(0x1eb),'children':['/',_0xece76a]})]}),a1_0x2a0819(Box,{'marginTop':0x1,'children':a1_0x2a0819(Text,{'color':'cyan','children':_0x24739a(0x1dc)})})]}):null]});return a1_0x2a0819(SelectPageTemplate,{'onSelect':_0x2bad16});};
@@ -1 +1 @@
1
- (function(_0x59027a,_0x595c44){const _0x1bc55b=a2_0x4a3e,_0x325ae9=_0x59027a();while(!![]){try{const _0x465a49=-parseInt(_0x1bc55b(0x183))/0x1*(-parseInt(_0x1bc55b(0x174))/0x2)+parseInt(_0x1bc55b(0x186))/0x3*(-parseInt(_0x1bc55b(0x18c))/0x4)+-parseInt(_0x1bc55b(0x188))/0x5+-parseInt(_0x1bc55b(0x175))/0x6+-parseInt(_0x1bc55b(0x180))/0x7*(parseInt(_0x1bc55b(0x182))/0x8)+parseInt(_0x1bc55b(0x17a))/0x9*(-parseInt(_0x1bc55b(0x18b))/0xa)+parseInt(_0x1bc55b(0x173))/0xb;if(_0x465a49===_0x595c44)break;else _0x325ae9['push'](_0x325ae9['shift']());}catch(_0x1307df){_0x325ae9['push'](_0x325ae9['shift']());}}}(a2_0x2657,0x9b06f));import{jsx as a2_0x3ddcd5,jsxs as a2_0x1cb746}from'react/jsx-runtime';import{useState,useEffect}from'react';function a2_0x2657(){const _0x599e74=['请选择您要创建的页面模板','name','49352358DQLnjR','116quGgCb','5590110kUYoaP','获取模板列表失败:','\x20\x20\x20\x20\x20\x20\x20\x20','column','length','10137429EOfLeR','resolve','green','upArrow','gray','filter','91511UScXmW','label','72yYfLEO','1039QGKOky','return','sort','30PcVOQE','blank','5854330eaznde','localeCompare','join','10WBrRRm','226104mUCAgS','downArrow','error','正在加载页面模板...','map','templates/pages','isDirectory'];a2_0x2657=function(){return _0x599e74;};return a2_0x2657();}import{Text,Box,useInput}from'ink';import{readdir}from'node:fs/promises';import a2_0x5527d1 from'node:path';function a2_0x4a3e(_0x20ca8d,_0x5e9c25){_0x20ca8d=_0x20ca8d-0x172;const _0x265766=a2_0x2657();let _0x4a3ebc=_0x265766[_0x20ca8d];return _0x4a3ebc;}import{fileURLToPath}from'node:url';async function getTemplateList(){const _0x552700=a2_0x4a3e;try{const _0xc04db6=fileURLToPath(import.meta.url),_0xdf300d=a2_0x5527d1[_0x552700(0x17b)](a2_0x5527d1['dirname'](_0xc04db6),'../..'),_0xb97561=a2_0x5527d1[_0x552700(0x18a)](_0xdf300d,_0x552700(0x191)),_0x587c1a=await readdir(_0xb97561,{'withFileTypes':!![]}),_0x384320=_0x587c1a[_0x552700(0x17f)](_0x1e7160=>_0x1e7160[_0x552700(0x192)]())[_0x552700(0x190)](_0x4c9af8=>({'label':_0x4c9af8[_0x552700(0x172)]}))[_0x552700(0x185)]((_0x2149a8,_0x344f82)=>_0x2149a8[_0x552700(0x181)][_0x552700(0x189)](_0x344f82[_0x552700(0x181)]));return _0x384320;}catch(_0x5f354b){return console[_0x552700(0x18e)](_0x552700(0x176),_0x5f354b),[{'label':_0x552700(0x187)},{'label':'sdk-fetch'}];}}export function SelectPageTemplate(_0x5bc4ee){const _0x8e0385=a2_0x4a3e,[_0x1c2d92,_0x269dea]=useState(0x0),[_0x361a78,_0x1a50e0]=useState([]),[_0x44c667,_0x3da45e]=useState(!![]);useEffect(()=>{async function _0x236cdb(){const _0x8cdf64=await getTemplateList();_0x1a50e0(_0x8cdf64),_0x3da45e(![]);}_0x236cdb();},[]),useInput((_0x673655,_0x469a54)=>{const _0x661718=a2_0x4a3e;if(_0x44c667)return;if(_0x469a54[_0x661718(0x184)]){const _0x151f5c=_0x361a78[_0x1c2d92];_0x151f5c&&_0x5bc4ee['onSelect'](_0x151f5c[_0x661718(0x181)]);}_0x469a54[_0x661718(0x17d)]&&_0x269dea(_0x1858ab=>_0x1858ab===0x0?_0x361a78[_0x661718(0x179)]-0x1:_0x1858ab-0x1),_0x469a54[_0x661718(0x18d)]&&_0x269dea(_0xe0d249=>_0xe0d249===_0x361a78[_0x661718(0x179)]-0x1?0x0:_0xe0d249+0x1);});if(_0x44c667)return a2_0x3ddcd5(Box,{'flexDirection':_0x8e0385(0x178),'paddingY':0x1,'children':a2_0x1cb746(Box,{'children':[a2_0x3ddcd5(Text,{'color':'gray','children':'\x20Step1:\x20'}),a2_0x3ddcd5(Text,{'children':_0x8e0385(0x18f)})]})});return a2_0x1cb746(Box,{'flexDirection':'column','paddingY':0x1,'children':[a2_0x1cb746(Box,{'children':[a2_0x3ddcd5(Text,{'color':_0x8e0385(0x17e),'children':'\x20Step1:\x20'}),a2_0x3ddcd5(Text,{'children':_0x8e0385(0x193)})]}),_0x361a78[_0x8e0385(0x190)]((_0x7c0ed,_0x55f543)=>{const _0x10032c=_0x8e0385,_0x119ba8=_0x55f543===_0x1c2d92,_0x46d0e5=_0x119ba8?'\x20\x20\x20\x20\x20\x20>\x20'+_0x7c0ed[_0x10032c(0x181)]:_0x10032c(0x177)+_0x7c0ed[_0x10032c(0x181)];return a2_0x3ddcd5(Box,{'children':a2_0x3ddcd5(Text,{'color':_0x119ba8?_0x10032c(0x17c):undefined,'children':_0x46d0e5})},_0x46d0e5);})]});}
1
+ (function(_0x31675a,_0x352877){const _0x2a16b5=a2_0x3b79,_0x19011b=_0x31675a();while(!![]){try{const _0x152458=parseInt(_0x2a16b5(0x105))/0x1*(parseInt(_0x2a16b5(0xee))/0x2)+parseInt(_0x2a16b5(0xff))/0x3+parseInt(_0x2a16b5(0x102))/0x4*(parseInt(_0x2a16b5(0x10c))/0x5)+-parseInt(_0x2a16b5(0x107))/0x6*(-parseInt(_0x2a16b5(0xfc))/0x7)+parseInt(_0x2a16b5(0xf2))/0x8+-parseInt(_0x2a16b5(0x101))/0x9*(parseInt(_0x2a16b5(0xf5))/0xa)+-parseInt(_0x2a16b5(0x100))/0xb*(parseInt(_0x2a16b5(0xed))/0xc);if(_0x152458===_0x352877)break;else _0x19011b['push'](_0x19011b['shift']());}catch(_0x2058a6){_0x19011b['push'](_0x19011b['shift']());}}}(a2_0x348d,0x7ef5d));import{jsx as a2_0x5616cf,jsxs as a2_0x22a4bb}from'react/jsx-runtime';import{useState,useEffect}from'react';import{Text,Box,useInput}from'ink';import{readdir}from'node:fs/promises';import a2_0x165fbf from'node:path';function a2_0x3b79(_0x360d21,_0x421630){_0x360d21=_0x360d21-0xea;const _0x348d31=a2_0x348d();let _0x3b797b=_0x348d31[_0x360d21];return _0x3b797b;}import{fileURLToPath}from'node:url';function a2_0x348d(){const _0x33b2b5=['green','24MNLwmG','16670XxEiCO','gray','onSelect','downArrow','5861336oNXWdu','isDirectory','map','77870kDWQbJ','\x20\x20\x20\x20\x20\x20>\x20','upArrow','templates/pages','sort','return','length','1612121wxkVLh','filter','join','415353FDmKTI','8406871dTrJCa','783TKWZUJ','44YsMtvj','\x20Step1:\x20','dirname','47vdzZyE','column','12JFIzUn','sdk-fetch','label','name','获取模板列表失败:','455705hQndnq','resolve','正在加载页面模板...'];a2_0x348d=function(){return _0x33b2b5;};return a2_0x348d();}async function getTemplateList(){const _0x3e4f15=a2_0x3b79;try{const _0x45c0bd=fileURLToPath(import.meta.url),_0x9f5f63=a2_0x165fbf[_0x3e4f15(0xea)](a2_0x165fbf[_0x3e4f15(0x104)](_0x45c0bd),'../..'),_0x4de10d=a2_0x165fbf[_0x3e4f15(0xfe)](_0x9f5f63,_0x3e4f15(0xf8)),_0x561d02=await readdir(_0x4de10d,{'withFileTypes':!![]}),_0x5b1620=_0x561d02[_0x3e4f15(0xfd)](_0xf3ac89=>_0xf3ac89[_0x3e4f15(0xf3)]())[_0x3e4f15(0xf4)](_0xf6a643=>({'label':_0xf6a643[_0x3e4f15(0x10a)]}))[_0x3e4f15(0xf9)]((_0x2708a7,_0x3986d1)=>_0x2708a7[_0x3e4f15(0x109)]['localeCompare'](_0x3986d1[_0x3e4f15(0x109)]));return _0x5b1620;}catch(_0x2e6777){return console['error'](_0x3e4f15(0x10b),_0x2e6777),[{'label':'blank'},{'label':_0x3e4f15(0x108)}];}}export function SelectPageTemplate(_0x29e3ff){const _0xd6c537=a2_0x3b79,[_0x2a3122,_0xf4ead9]=useState(0x0),[_0x122695,_0x3e1428]=useState([]),[_0x18028f,_0x1aa875]=useState(!![]);useEffect(()=>{async function _0x3d7c6e(){const _0x55a139=await getTemplateList();_0x3e1428(_0x55a139),_0x1aa875(![]);}_0x3d7c6e();},[]),useInput((_0x3a6875,_0xf8baa0)=>{const _0x96fc50=a2_0x3b79;if(_0x18028f)return;if(_0xf8baa0[_0x96fc50(0xfa)]){const _0x36c7f3=_0x122695[_0x2a3122];_0x36c7f3&&_0x29e3ff[_0x96fc50(0xf0)](_0x36c7f3['label']);}_0xf8baa0[_0x96fc50(0xf7)]&&_0xf4ead9(_0x4ca430=>_0x4ca430===0x0?_0x122695[_0x96fc50(0xfb)]-0x1:_0x4ca430-0x1),_0xf8baa0[_0x96fc50(0xf1)]&&_0xf4ead9(_0x8e191=>_0x8e191===_0x122695['length']-0x1?0x0:_0x8e191+0x1);});if(_0x18028f)return a2_0x5616cf(Box,{'flexDirection':_0xd6c537(0x106),'paddingY':0x1,'children':a2_0x22a4bb(Box,{'children':[a2_0x5616cf(Text,{'color':_0xd6c537(0xef),'children':_0xd6c537(0x103)}),a2_0x5616cf(Text,{'children':_0xd6c537(0xeb)})]})});return a2_0x22a4bb(Box,{'flexDirection':_0xd6c537(0x106),'paddingY':0x1,'children':[a2_0x22a4bb(Box,{'children':[a2_0x5616cf(Text,{'color':_0xd6c537(0xef),'children':'\x20Step1:\x20'}),a2_0x5616cf(Text,{'children':'请选择您要创建的页面模板'})]}),_0x122695[_0xd6c537(0xf4)]((_0x4cf0de,_0x3f56e3)=>{const _0x47de02=_0xd6c537,_0x136663=_0x3f56e3===_0x2a3122,_0x25f756=_0x136663?_0x47de02(0xf6)+_0x4cf0de[_0x47de02(0x109)]:'\x20\x20\x20\x20\x20\x20\x20\x20'+_0x4cf0de[_0x47de02(0x109)];return a2_0x5616cf(Box,{'children':a2_0x5616cf(Text,{'color':_0x136663?_0x47de02(0xec):undefined,'children':_0x25f756})},_0x25f756);})]});}
@@ -1 +1 @@
1
- (function(_0x5cdd9d,_0x1403ae){const _0x3711d8=a3_0x59ed,_0x36c9a5=_0x5cdd9d();while(!![]){try{const _0x4d3012=-parseInt(_0x3711d8(0xe3))/0x1+parseInt(_0x3711d8(0xea))/0x2*(parseInt(_0x3711d8(0xd9))/0x3)+parseInt(_0x3711d8(0xc8))/0x4+-parseInt(_0x3711d8(0xf8))/0x5+-parseInt(_0x3711d8(0xf0))/0x6+-parseInt(_0x3711d8(0xd1))/0x7+parseInt(_0x3711d8(0xf1))/0x8*(parseInt(_0x3711d8(0xca))/0x9);if(_0x4d3012===_0x1403ae)break;else _0x36c9a5['push'](_0x36c9a5['shift']());}catch(_0x3815c9){_0x36c9a5['push'](_0x36c9a5['shift']());}}}(a3_0x42a5,0xda59b));function a3_0x59ed(_0x2bf0d7,_0x245752){_0x2bf0d7=_0x2bf0d7-0xc8;const _0x42a578=a3_0x42a5();let _0x59ed6b=_0x42a578[_0x2bf0d7];return _0x59ed6b;}import{jsx as a3_0x56b2ca,jsxs as a3_0x261236,Fragment as a3_0x987015}from'react/jsx-runtime';function a3_0x42a5(){const _0x17a4a6=['459aioqfq','env','\x20重新登录后再试','filePath','未提供应用AppCode,且配置中也没有默认值','\x1b[33m!\x20以下数据集代码不存在:\x20','\x20个匹配的数据集\x1b[0m','1874712YeKQbO','*\x20共处理\x20','map','includes','未找到任何数据集','gray','red','join','3962163OnIvRh','.md\x20(','cwd','green','√\x20文档生成完成!成功\x20','column','error','white','datasetCode','lovrabet\x20auth','660822komijP','cyan',',\x20失败\x20','api-doc','setLogPath','\x20个数据集中筛选出\x20','dim','2IHxhSj','yellow','success','*\x20生成的文档文件:','文档生成失败:\x20','\x1b[90m*\x20从\x20','6352062QSZvAk','187288TlvZvw','length','🚀\x20','正在生成\x20','\x20(环境:\x20','message','./docs','4207790uqfjpA','正在获取数据集列表...','4834216MRmvQO','filter'];a3_0x42a5=function(){return _0x17a4a6;};return a3_0x42a5();}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';import{logger}from'../utils/logger.js';export const ApiDocUI=({appCode:_0xb4afde,env:_0x418588,output:_0x5cacb0,extraParams:_0x43b58e,datasetCodes:_0x4a1b0c})=>{const _0x4225b7=a3_0x59ed,{exit:_0x45e206}=useApp(),[_0x244386,_0x12c033]=useState(![]),[_0x15863b,_0x570d32]=useState(''),[_0xa67472,_0x4fe6ac]=useState(![]),[_0x2a2a12,_0x4eb10c]=useState(null),[_0x5631cd,_0x430678]=useState(null),[_0x572e5d,_0x2f039d]=useState(0x0),_0x50004a=readConfig(),_0x33db1e=getConfigAppCode(),_0x2c752f=_0xb4afde||_0x33db1e,_0x2add10=typeof _0x50004a?.[_0x4225b7(0xcb)]==='string'?_0x50004a['env']:undefined,_0x3abff5=_0x418588||_0x2add10||'online';initEnv(_0x3abff5);const _0x4dcf62=_0x5cacb0||_0x4225b7(0xf7),_0x3c8a41=_0xb4afde?'使用指定的应用AppCode:\x20'+_0x2c752f:'使用配置的应用AppCode:\x20'+_0x2c752f;useEffect(()=>{_0x12c033(!![]),_0x3d8f17();},[]),useEffect(()=>{(_0xa67472||_0x2a2a12)&&_0x45e206();},[_0xa67472,_0x2a2a12,_0x45e206]);async function _0x3d8f17(){const _0x22c91b=_0x4225b7;if(!_0x2c752f){_0x4eb10c(_0x22c91b(0xce));return;}try{logger[_0x22c91b(0xe7)](process[_0x22c91b(0xdb)]()),_0x570d32(_0x22c91b(0xf9));const {configArray:_0x4c6942}=await fetchModelList(_0x2c752f);_0x2f039d(_0x4c6942[_0x22c91b(0xf2)]);if(_0x4c6942[_0x22c91b(0xf2)]===0x0){_0x4eb10c(_0x22c91b(0xd5));return;}let _0x4c692c=_0x4c6942;if(_0x4a1b0c&&_0x4a1b0c[_0x22c91b(0xf2)]>0x0){_0x4c692c=_0x4c6942[_0x22c91b(0xc9)](_0x54a38d=>_0x4a1b0c[_0x22c91b(0xd4)](_0x54a38d[_0x22c91b(0xe1)]));const _0x542916=_0x4c692c[_0x22c91b(0xd3)](_0x191e82=>_0x191e82[_0x22c91b(0xe1)]),_0x1dfc1d=_0x4a1b0c['filter'](_0x25d880=>!_0x542916['includes'](_0x25d880));_0x1dfc1d['length']>0x0&&console['log'](_0x22c91b(0xcf)+_0x1dfc1d[_0x22c91b(0xd8)](',\x20')+'\x1b[0m');if(_0x4c692c[_0x22c91b(0xf2)]===0x0){_0x4eb10c('指定的数据集代码都不存在:\x20'+_0x4a1b0c[_0x22c91b(0xd8)](',\x20'));return;}console['log'](_0x22c91b(0xef)+_0x4c6942[_0x22c91b(0xf2)]+_0x22c91b(0xe8)+_0x4c692c[_0x22c91b(0xf2)]+_0x22c91b(0xd0));}_0x570d32(_0x22c91b(0xf4)+_0x4c692c['length']+'\x20个数据集的文档...');const _0x4430d1=await generateDatasetDocs(_0x4c692c,_0x2c752f,_0x4dcf62,(_0xabc308,_0x419583,_0x3e5b71)=>{const _0x25d5ea=_0x22c91b;_0x570d32(_0x25d5ea(0xf4)+_0x3e5b71+_0x25d5ea(0xda)+_0xabc308+'/'+_0x419583+')');},_0x43b58e);_0x430678(_0x4430d1),_0x4fe6ac(!![]);const _0xe9e7db=_0x4430d1['filter'](_0xfdc9a5=>_0xfdc9a5[_0x22c91b(0xec)])[_0x22c91b(0xf2)],_0x3a8e21=_0x4430d1[_0x22c91b(0xc9)](_0x515e60=>!_0x515e60[_0x22c91b(0xec)])['length'];logger[_0x22c91b(0xec)](_0x22c91b(0xe6),'文档生成完成',undefined,{'totalCount':_0x4430d1[_0x22c91b(0xf2)],'successCount':_0xe9e7db,'failCount':_0x3a8e21,'outputDir':_0x4dcf62});}catch(_0x4dc21b){const _0x20e2f5=_0x4dc21b instanceof Error?_0x4dc21b[_0x22c91b(0xf6)]:String(_0x4dc21b);logger['error'](_0x22c91b(0xe6),_0x22c91b(0xee)+_0x20e2f5,{'appCode':_0x2c752f,'outputDir':_0x4dcf62}),_0x4eb10c(_0x22c91b(0xee)+_0x20e2f5);}finally{_0x12c033(![]);}}const _0x5015df=_0x5631cd?.['filter'](_0x1bdb47=>_0x1bdb47[_0x4225b7(0xec)])[_0x4225b7(0xf2)]||0x0,_0x2f18db=_0x5631cd?.[_0x4225b7(0xc9)](_0x4d4fc5=>!_0x4d4fc5[_0x4225b7(0xec)])[_0x4225b7(0xf2)]||0x0;return a3_0x261236(Box,{'flexDirection':_0x4225b7(0xde),'children':[(_0x244386||_0xa67472)&&a3_0x261236(Box,{'children':[a3_0x56b2ca(Text,{'color':'gray','children':'*\x20'}),a3_0x56b2ca(Text,{'color':_0xb4afde?_0x4225b7(0xe0):_0x4225b7(0xe9),'children':_0x3c8a41})]}),_0x244386&&a3_0x56b2ca(Box,{'children':a3_0x261236(Text,{'children':[_0x4225b7(0xf3),_0x15863b,_0x4225b7(0xf5),_0x3abff5,')']})}),_0xa67472&&_0x5631cd&&a3_0x261236(Box,{'flexDirection':_0x4225b7(0xde),'children':[a3_0x56b2ca(Box,{'children':a3_0x261236(Text,{'color':_0x4225b7(0xdc),'children':[_0x4225b7(0xdd),_0x5015df,'\x20个',_0x2f18db>0x0&&_0x4225b7(0xe5)+_0x2f18db+'\x20个']})}),a3_0x56b2ca(Box,{'marginTop':0x1,'children':a3_0x261236(Text,{'color':_0x4225b7(0xd6),'children':[_0x4225b7(0xd2),_0x572e5d,'\x20个数据集']})}),a3_0x261236(Box,{'marginTop':0x1,'children':[a3_0x56b2ca(Text,{'color':_0x4225b7(0xd6),'children':'*\x20输出目录:\x20'}),a3_0x56b2ca(Text,{'color':_0x4225b7(0xe4),'children':_0x4dcf62})]}),_0x5015df>0x0&&a3_0x261236(a3_0x987015,{'children':[a3_0x56b2ca(Box,{'marginTop':0x1,'children':a3_0x56b2ca(Text,{'color':'gray','children':_0x4225b7(0xed)})}),_0x5631cd[_0x4225b7(0xc9)](_0x5a406a=>_0x5a406a['success'])[_0x4225b7(0xd3)]((_0x106e8a,_0x36151b)=>a3_0x261236(Box,{'marginLeft':0x2,'children':[a3_0x261236(Text,{'color':_0x4225b7(0xe4),'children':['•\x20',_0x106e8a[_0x4225b7(0xcd)]]}),a3_0x261236(Text,{'color':'dim','children':['\x20-\x20',_0x106e8a['datasetName']]})]},_0x36151b))]}),_0x2f18db>0x0&&a3_0x261236(a3_0x987015,{'children':[a3_0x56b2ca(Box,{'marginTop':0x1,'children':a3_0x56b2ca(Text,{'color':_0x4225b7(0xeb),'children':'⚠️\x20以下数据集生成失败:'})}),_0x5631cd[_0x4225b7(0xc9)](_0x2606c7=>!_0x2606c7[_0x4225b7(0xec)])[_0x4225b7(0xd3)]((_0x3a6a5f,_0x545f05)=>a3_0x261236(Box,{'marginLeft':0x2,'flexDirection':_0x4225b7(0xde),'children':[a3_0x261236(Text,{'color':_0x4225b7(0xd7),'children':['•\x20',_0x3a6a5f['datasetName'],'\x20(',_0x3a6a5f[_0x4225b7(0xe1)],')']}),_0x3a6a5f[_0x4225b7(0xdf)]&&a3_0x56b2ca(Box,{'marginLeft':0x2,'children':a3_0x56b2ca(Text,{'color':'dim','children':_0x3a6a5f[_0x4225b7(0xdf)]})})]},_0x545f05))]})]}),_0x2a2a12&&a3_0x261236(Box,{'flexDirection':_0x4225b7(0xde),'children':[a3_0x56b2ca(Box,{'children':a3_0x261236(Text,{'color':_0x4225b7(0xd7),'children':['❌\x20',_0x2a2a12]})}),_0x2a2a12[_0x4225b7(0xd4)]('登录')&&a3_0x261236(Box,{'marginTop':0x1,'children':[a3_0x56b2ca(Text,{'color':_0x4225b7(0xeb),'children':'💡\x20请使用\x20'}),a3_0x56b2ca(Text,{'color':_0x4225b7(0xe4),'children':_0x4225b7(0xe2)}),a3_0x56b2ca(Text,{'color':'yellow','children':_0x4225b7(0xcc)})]})]})]});};
1
+ (function(_0x6a5074,_0x5ead8e){const _0x241f14=a3_0xd4c4,_0x3edda7=_0x6a5074();while(!![]){try{const _0x109fd1=-parseInt(_0x241f14(0xe1))/0x1+-parseInt(_0x241f14(0xdf))/0x2*(-parseInt(_0x241f14(0xf3))/0x3)+parseInt(_0x241f14(0xda))/0x4+parseInt(_0x241f14(0xd6))/0x5+-parseInt(_0x241f14(0xfe))/0x6*(parseInt(_0x241f14(0x107))/0x7)+parseInt(_0x241f14(0xe8))/0x8+-parseInt(_0x241f14(0xfd))/0x9*(parseInt(_0x241f14(0xf9))/0xa);if(_0x109fd1===_0x5ead8e)break;else _0x3edda7['push'](_0x3edda7['shift']());}catch(_0x3896eb){_0x3edda7['push'](_0x3edda7['shift']());}}}(a3_0x2a33,0x68427));import{jsx as a3_0x7eaaf7,jsxs as a3_0x1f2c95,Fragment as a3_0x1496ea}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 a3_0x2a33(){const _0x178deb=['datasetCode','\x20个数据集中筛选出\x20','column','includes','正在生成\x20','online','filter','\x1b[33m!\x20以下数据集代码不存在:\x20','1666377ZTrjHa','.md\x20(','./docs','\x20个数据集的文档...','red','文档生成失败:\x20','104840NVlaWx','使用配置的应用AppCode:\x20','map','\x20个匹配的数据集\x1b[0m','1395gOTRYb','308316BemZkL','yellow','\x20重新登录后再试','setLogPath','length','white','datasetName','*\x20输出目录:\x20','api-doc','49tJymZt','string','message','dim','env','3696745nCXCOq','lovrabet\x20auth','join','√\x20文档生成完成!成功\x20','2828316AXIrzX','未提供应用AppCode,且配置中也没有默认值','未找到任何数据集','\x20个数据集','*\x20共处理\x20','2VgbqKd','filePath','399911KvYziJ','*\x20生成的文档文件:','cyan','\x20-\x20','error','💡\x20请使用\x20','success','6478344TonYEz','gray','green'];a3_0x2a33=function(){return _0x178deb;};return a3_0x2a33();}import{fetchModelList}from'./fetch-model-list.js';function a3_0xd4c4(_0x46201c,_0x2d2045){_0x46201c=_0x46201c-0xd6;const _0x2a334b=a3_0x2a33();let _0xd4c407=_0x2a334b[_0x46201c];return _0xd4c407;}import{generateDatasetDocs}from'./api-doc.js';import{logger}from'../utils/logger.js';export const ApiDocUI=({appCode:_0x4a2a23,env:_0x3ff33e,output:_0x122556,extraParams:_0x492219,datasetCodes:_0x38f277})=>{const _0x31fc60=a3_0xd4c4,{exit:_0x4ef50c}=useApp(),[_0x7154cb,_0x3ec256]=useState(![]),[_0x55d8b7,_0x5be702]=useState(''),[_0x5b335f,_0x36c951]=useState(![]),[_0x191655,_0x22aa44]=useState(null),[_0x52cfaa,_0x4685d2]=useState(null),[_0x1fa3dc,_0x3e3a14]=useState(0x0),_0x9a0778=readConfig(),_0x26ccdc=getConfigAppCode(),_0x47d4d4=_0x4a2a23||_0x26ccdc,_0x5ca92b=typeof _0x9a0778?.[_0x31fc60(0x10b)]===_0x31fc60(0x108)?_0x9a0778[_0x31fc60(0x10b)]:undefined,_0x240b1b=_0x3ff33e||_0x5ca92b||_0x31fc60(0xf0);initEnv(_0x240b1b);const _0xc1f96e=_0x122556||_0x31fc60(0xf5),_0xcd8391=_0x4a2a23?'使用指定的应用AppCode:\x20'+_0x47d4d4:_0x31fc60(0xfa)+_0x47d4d4;useEffect(()=>{_0x3ec256(!![]),_0x4c0d6d();},[]),useEffect(()=>{(_0x5b335f||_0x191655)&&_0x4ef50c();},[_0x5b335f,_0x191655,_0x4ef50c]);async function _0x4c0d6d(){const _0x410faa=_0x31fc60;if(!_0x47d4d4){_0x22aa44(_0x410faa(0xdb));return;}try{logger[_0x410faa(0x101)](process['cwd']()),_0x5be702('正在获取数据集列表...');const {configArray:_0x4e9e1e}=await fetchModelList(_0x47d4d4);_0x3e3a14(_0x4e9e1e[_0x410faa(0x102)]);if(_0x4e9e1e[_0x410faa(0x102)]===0x0){_0x22aa44(_0x410faa(0xdc));return;}let _0x5a550a=_0x4e9e1e;if(_0x38f277&&_0x38f277[_0x410faa(0x102)]>0x0){_0x5a550a=_0x4e9e1e[_0x410faa(0xf1)](_0x16e405=>_0x38f277[_0x410faa(0xee)](_0x16e405[_0x410faa(0xeb)]));const _0x5c382d=_0x5a550a[_0x410faa(0xfb)](_0x321dea=>_0x321dea['datasetCode']),_0x37d9e2=_0x38f277[_0x410faa(0xf1)](_0x1907f3=>!_0x5c382d[_0x410faa(0xee)](_0x1907f3));_0x37d9e2[_0x410faa(0x102)]>0x0&&console['log'](_0x410faa(0xf2)+_0x37d9e2[_0x410faa(0xd8)](',\x20')+'\x1b[0m');if(_0x5a550a[_0x410faa(0x102)]===0x0){_0x22aa44('指定的数据集代码都不存在:\x20'+_0x38f277['join'](',\x20'));return;}console['log']('\x1b[90m*\x20从\x20'+_0x4e9e1e[_0x410faa(0x102)]+_0x410faa(0xec)+_0x5a550a['length']+_0x410faa(0xfc));}_0x5be702('正在生成\x20'+_0x5a550a[_0x410faa(0x102)]+_0x410faa(0xf6));const _0x416eed=await generateDatasetDocs(_0x5a550a,_0x47d4d4,_0xc1f96e,(_0xdceaaf,_0x57e6d3,_0xdd6b60)=>{const _0x3438f2=_0x410faa;_0x5be702(_0x3438f2(0xef)+_0xdd6b60+_0x3438f2(0xf4)+_0xdceaaf+'/'+_0x57e6d3+')');},_0x492219);_0x4685d2(_0x416eed),_0x36c951(!![]);const _0xdbb0ad=_0x416eed[_0x410faa(0xf1)](_0x27e3a7=>_0x27e3a7['success'])[_0x410faa(0x102)],_0x5608d6=_0x416eed[_0x410faa(0xf1)](_0x45c968=>!_0x45c968['success'])[_0x410faa(0x102)];logger[_0x410faa(0xe7)]('api-doc','文档生成完成',undefined,{'totalCount':_0x416eed[_0x410faa(0x102)],'successCount':_0xdbb0ad,'failCount':_0x5608d6,'outputDir':_0xc1f96e});}catch(_0x4bf9f5){const _0xaca2a8=_0x4bf9f5 instanceof Error?_0x4bf9f5[_0x410faa(0x109)]:String(_0x4bf9f5);logger[_0x410faa(0xe5)](_0x410faa(0x106),_0x410faa(0xf8)+_0xaca2a8,{'appCode':_0x47d4d4,'outputDir':_0xc1f96e}),_0x22aa44('文档生成失败:\x20'+_0xaca2a8);}finally{_0x3ec256(![]);}}const _0x2942d7=_0x52cfaa?.[_0x31fc60(0xf1)](_0x383aa9=>_0x383aa9[_0x31fc60(0xe7)])[_0x31fc60(0x102)]||0x0,_0x25213b=_0x52cfaa?.[_0x31fc60(0xf1)](_0x54c74f=>!_0x54c74f['success'])[_0x31fc60(0x102)]||0x0;return a3_0x1f2c95(Box,{'flexDirection':_0x31fc60(0xed),'children':[(_0x7154cb||_0x5b335f)&&a3_0x1f2c95(Box,{'children':[a3_0x7eaaf7(Text,{'color':_0x31fc60(0xe9),'children':'*\x20'}),a3_0x7eaaf7(Text,{'color':_0x4a2a23?_0x31fc60(0x103):_0x31fc60(0x10a),'children':_0xcd8391})]}),_0x7154cb&&a3_0x7eaaf7(Box,{'children':a3_0x1f2c95(Text,{'children':['🚀\x20',_0x55d8b7,'\x20(环境:\x20',_0x240b1b,')']})}),_0x5b335f&&_0x52cfaa&&a3_0x1f2c95(Box,{'flexDirection':_0x31fc60(0xed),'children':[a3_0x7eaaf7(Box,{'children':a3_0x1f2c95(Text,{'color':_0x31fc60(0xea),'children':[_0x31fc60(0xd9),_0x2942d7,'\x20个',_0x25213b>0x0&&',\x20失败\x20'+_0x25213b+'\x20个']})}),a3_0x7eaaf7(Box,{'marginTop':0x1,'children':a3_0x1f2c95(Text,{'color':_0x31fc60(0xe9),'children':[_0x31fc60(0xde),_0x1fa3dc,_0x31fc60(0xdd)]})}),a3_0x1f2c95(Box,{'marginTop':0x1,'children':[a3_0x7eaaf7(Text,{'color':_0x31fc60(0xe9),'children':_0x31fc60(0x105)}),a3_0x7eaaf7(Text,{'color':_0x31fc60(0xe3),'children':_0xc1f96e})]}),_0x2942d7>0x0&&a3_0x1f2c95(a3_0x1496ea,{'children':[a3_0x7eaaf7(Box,{'marginTop':0x1,'children':a3_0x7eaaf7(Text,{'color':_0x31fc60(0xe9),'children':_0x31fc60(0xe2)})}),_0x52cfaa[_0x31fc60(0xf1)](_0x2dfe96=>_0x2dfe96[_0x31fc60(0xe7)])[_0x31fc60(0xfb)]((_0x688d76,_0x35c8a7)=>a3_0x1f2c95(Box,{'marginLeft':0x2,'children':[a3_0x1f2c95(Text,{'color':_0x31fc60(0xe3),'children':['•\x20',_0x688d76[_0x31fc60(0xe0)]]}),a3_0x1f2c95(Text,{'color':_0x31fc60(0x10a),'children':[_0x31fc60(0xe4),_0x688d76[_0x31fc60(0x104)]]})]},_0x35c8a7))]}),_0x25213b>0x0&&a3_0x1f2c95(a3_0x1496ea,{'children':[a3_0x7eaaf7(Box,{'marginTop':0x1,'children':a3_0x7eaaf7(Text,{'color':_0x31fc60(0xff),'children':'⚠️\x20以下数据集生成失败:'})}),_0x52cfaa['filter'](_0x4acd0a=>!_0x4acd0a[_0x31fc60(0xe7)])[_0x31fc60(0xfb)]((_0x34f87a,_0x38f2b)=>a3_0x1f2c95(Box,{'marginLeft':0x2,'flexDirection':_0x31fc60(0xed),'children':[a3_0x1f2c95(Text,{'color':'red','children':['•\x20',_0x34f87a[_0x31fc60(0x104)],'\x20(',_0x34f87a[_0x31fc60(0xeb)],')']}),_0x34f87a['error']&&a3_0x7eaaf7(Box,{'marginLeft':0x2,'children':a3_0x7eaaf7(Text,{'color':_0x31fc60(0x10a),'children':_0x34f87a[_0x31fc60(0xe5)]})})]},_0x38f2b))]})]}),_0x191655&&a3_0x1f2c95(Box,{'flexDirection':_0x31fc60(0xed),'children':[a3_0x7eaaf7(Box,{'children':a3_0x1f2c95(Text,{'color':_0x31fc60(0xf7),'children':['❌\x20',_0x191655]})}),_0x191655['includes']('登录')&&a3_0x1f2c95(Box,{'marginTop':0x1,'children':[a3_0x7eaaf7(Text,{'color':_0x31fc60(0xff),'children':_0x31fc60(0xe6)}),a3_0x7eaaf7(Text,{'color':'cyan','children':_0x31fc60(0xd7)}),a3_0x7eaaf7(Text,{'color':_0x31fc60(0xff),'children':_0x31fc60(0x100)})]})]})]});};
@@ -1 +1 @@
1
- const a4_0x3bf40d=a4_0x3b6f;(function(_0xdff53f,_0x3f4fc5){const _0x235383=a4_0x3b6f,_0x48f5f1=_0xdff53f();while(!![]){try{const _0x271155=parseInt(_0x235383(0x166))/0x1*(-parseInt(_0x235383(0x14b))/0x2)+parseInt(_0x235383(0x165))/0x3+parseInt(_0x235383(0x14a))/0x4*(-parseInt(_0x235383(0x156))/0x5)+parseInt(_0x235383(0x14c))/0x6*(parseInt(_0x235383(0x143))/0x7)+parseInt(_0x235383(0x155))/0x8+-parseInt(_0x235383(0x147))/0x9+parseInt(_0x235383(0x157))/0xa;if(_0x271155===_0x3f4fc5)break;else _0x48f5f1['push'](_0x48f5f1['shift']());}catch(_0x3a6139){_0x48f5f1['push'](_0x48f5f1['shift']());}}}(a4_0x263c,0xb4e52));function a4_0x263c(){const _0x3a3e26=['POST','✓\x20成功生成:\x20','.md','/api/node-toolbox/api-doc-generator','status','):缺少\x20data.markdown\x20字段','752394jxevLh','4jvWYGn','push','./docs','error','登录鉴权失败,登录已过期,请使用\x20lovrabet\x20auth\x20重新登录','35vXcuKA','api-doc','application/json','datasetCode','10142883dWJxNr','text','生成文档失败:\x20','300XVCWdv','89948YkZEIX','1758126AlWvhU','success','name','.md\x20-\x20','响应数据格式错误\x20(','stringify','log','markdown','join','4823376ZSCXJt','87740LrZHYK','10451040qYPKAy','data','length','生成文档成功:\x20',']\x20正在生成:\x20','),HTTP状态码:\x20','获取文档失败\x20(','\x20个数据集需要生成文档\x0a'];a4_0x263c=function(){return _0x3a3e26;};return a4_0x263c();}import{mkdirSync,writeFileSync}from'node:fs';import a4_0xb74c83 from'node:path';import{getCookie}from'../auth/get-cookie.js';import{getApiDomain}from'../constant/domain.js';import{logger}from'../utils/logger.js';export async function fetchDatasetDoc(_0x478d5a){const _0x59249d=a4_0x3b6f,{appCode:_0x18bf75,datasetCode:_0xd8206d,datasetId:_0x54c22d,extraParams:_0x1aa43d}=_0x478d5a,_0xd63f26=getApiDomain(),_0x22ddf4=_0xd63f26+_0x59249d(0x162),_0xe6c8a6={'appCode':_0x18bf75,'datasetCode':_0xd8206d,'datasetId':_0x54c22d,..._0x1aa43d||{}},_0x46535b=await fetch(_0x22ddf4,{'method':_0x59249d(0x15f),'headers':{'Content-Type':_0x59249d(0x145),'Cookie':getCookie()},'body':JSON[_0x59249d(0x151)](_0xe6c8a6)});if(!_0x46535b['ok']){if(_0x46535b[_0x59249d(0x163)]===0x191)throw new Error(_0x59249d(0x142));let _0x3f9266='';try{_0x3f9266=await _0x46535b[_0x59249d(0x148)]();}catch(_0x54baf9){}throw new Error(_0x59249d(0x15d)+_0xd8206d+_0x59249d(0x15c)+_0x46535b[_0x59249d(0x163)]+(_0x3f9266?'\x0a'+_0x3f9266:''));}const _0x5182cf=await _0x46535b['json']();if(!_0x5182cf[_0x59249d(0x158)]||typeof _0x5182cf[_0x59249d(0x158)][_0x59249d(0x153)]!=='string')throw new Error(_0x59249d(0x150)+_0xd8206d+_0x59249d(0x164));return _0x5182cf['data'][_0x59249d(0x153)];}function delay(_0x188db0){return new Promise(_0x31d534=>setTimeout(_0x31d534,_0x188db0));}function a4_0x3b6f(_0x48e877,_0x72a44a){_0x48e877=_0x48e877-0x141;const _0x263c36=a4_0x263c();let _0x3b6f52=_0x263c36[_0x48e877];return _0x3b6f52;}export async function generateDatasetDocs(_0x2bf5d1,_0x1af48d,_0x3ef3a4=a4_0x3bf40d(0x168),_0x3c4ddb,_0x3106f2){const _0x178fe9=a4_0x3bf40d;mkdirSync(_0x3ef3a4,{'recursive':!![]});const _0x2b275b=[],_0x489e74=_0x2bf5d1[_0x178fe9(0x159)];console[_0x178fe9(0x152)]('\x0a共有\x20'+_0x489e74+_0x178fe9(0x15e));for(let _0x1cf3d1=0x0;_0x1cf3d1<_0x2bf5d1[_0x178fe9(0x159)];_0x1cf3d1++){const _0x23b0d9=_0x2bf5d1[_0x1cf3d1],_0xaeb8ec=_0x1cf3d1+0x1,_0x3d1bd4=_0x23b0d9['tableName'];try{console[_0x178fe9(0x152)]('['+_0xaeb8ec+'/'+_0x489e74+_0x178fe9(0x15b)+_0x3d1bd4+'.md\x20('+_0x23b0d9[_0x178fe9(0x14e)]+')');_0x3c4ddb&&_0x3c4ddb(_0xaeb8ec,_0x489e74,_0x3d1bd4);const _0x362a09=await fetchDatasetDoc({'appCode':_0x1af48d,'datasetCode':_0x23b0d9[_0x178fe9(0x146)],'datasetId':_0x23b0d9['id'],'enableAI':![],'extraParams':_0x3106f2}),_0x25e61b=a4_0xb74c83[_0x178fe9(0x154)](_0x3ef3a4,_0x3d1bd4+_0x178fe9(0x161));writeFileSync(_0x25e61b,_0x362a09,{'encoding':'utf8'}),console[_0x178fe9(0x152)](_0x178fe9(0x160)+_0x3d1bd4+_0x178fe9(0x161)),logger[_0x178fe9(0x14d)](_0x178fe9(0x144),_0x178fe9(0x15a)+_0x3d1bd4,undefined,{'datasetCode':_0x23b0d9['datasetCode'],'datasetName':_0x23b0d9['name'],'filePath':_0x25e61b,'progress':_0xaeb8ec+'/'+_0x489e74}),_0x2b275b[_0x178fe9(0x167)]({'datasetCode':_0x23b0d9[_0x178fe9(0x146)],'datasetName':_0x23b0d9[_0x178fe9(0x14e)],'filePath':_0x25e61b,'success':!![]}),_0xaeb8ec<_0x489e74&&await delay(0x1388);}catch(_0x43d4a7){const _0x4c757a=_0x43d4a7 instanceof Error?_0x43d4a7['message']:String(_0x43d4a7);console[_0x178fe9(0x152)]('✗\x20失败:\x20'+_0x3d1bd4+_0x178fe9(0x14f)+_0x4c757a+'\x0a'),logger[_0x178fe9(0x141)](_0x178fe9(0x144),_0x178fe9(0x149)+_0x23b0d9[_0x178fe9(0x146)],{'datasetCode':_0x23b0d9['datasetCode'],'datasetName':_0x23b0d9[_0x178fe9(0x14e)],'error':_0x4c757a,'progress':_0xaeb8ec+'/'+_0x489e74}),_0x2b275b[_0x178fe9(0x167)]({'datasetCode':_0x23b0d9[_0x178fe9(0x146)],'datasetName':_0x23b0d9[_0x178fe9(0x14e)],'filePath':'','success':![],'error':_0x4c757a}),_0xaeb8ec<_0x489e74&&(console[_0x178fe9(0x152)]('等待\x203\x20秒...\x0a'),await delay(0xbb8));}}return _0x2b275b;}
1
+ (function(_0x1ebae4,_0x29b585){const _0x3abfe7=a4_0x4c06,_0x2f1576=_0x1ebae4();while(!![]){try{const _0x488eb9=-parseInt(_0x3abfe7(0xaa))/0x1+-parseInt(_0x3abfe7(0xa2))/0x2*(parseInt(_0x3abfe7(0xb0))/0x3)+-parseInt(_0x3abfe7(0x9a))/0x4+parseInt(_0x3abfe7(0x8e))/0x5+-parseInt(_0x3abfe7(0xa6))/0x6+-parseInt(_0x3abfe7(0x9b))/0x7+-parseInt(_0x3abfe7(0xb1))/0x8*(-parseInt(_0x3abfe7(0x8a))/0x9);if(_0x488eb9===_0x29b585)break;else _0x2f1576['push'](_0x2f1576['shift']());}catch(_0x2b51f6){_0x2f1576['push'](_0x2f1576['shift']());}}}(a4_0x3138,0x9815b));import{mkdirSync,writeFileSync}from'node:fs';import a4_0x297d4a from'node:path';import{getCookie}from'../auth/get-cookie.js';import{getApiDomain}from'../constant/domain.js';import{logger}from'../utils/logger.js';export async function fetchDatasetDoc(_0x5a9f66){const _0x21cbca=a4_0x4c06,{appCode:_0x537fcd,datasetCode:_0x3d119d,datasetId:_0x400116,extraParams:_0x3bc48c}=_0x5a9f66,_0x1eac7e=getApiDomain(),_0x15f63c=_0x1eac7e+_0x21cbca(0xa9),_0x2bc375={'appCode':_0x537fcd,'datasetCode':_0x3d119d,'datasetId':_0x400116,..._0x3bc48c||{}},_0x2265dc=await fetch(_0x15f63c,{'method':_0x21cbca(0xa1),'headers':{'Content-Type':'application/json','Cookie':getCookie()},'body':JSON['stringify'](_0x2bc375)});if(!_0x2265dc['ok']){if(_0x2265dc[_0x21cbca(0xa3)]===0x191)throw new Error(_0x21cbca(0x97));let _0x3bcd29='';try{_0x3bcd29=await _0x2265dc[_0x21cbca(0x8f)]();}catch(_0x49c51c){}throw new Error(_0x21cbca(0x98)+_0x3d119d+_0x21cbca(0xac)+_0x2265dc[_0x21cbca(0xa3)]+(_0x3bcd29?'\x0a'+_0x3bcd29:''));}const _0x5e5e8c=await _0x2265dc[_0x21cbca(0x9e)]();if(!_0x5e5e8c['data']||typeof _0x5e5e8c[_0x21cbca(0x92)]['markdown']!==_0x21cbca(0xa7))throw new Error(_0x21cbca(0xad)+_0x3d119d+'):缺少\x20data.markdown\x20字段');return _0x5e5e8c[_0x21cbca(0x92)][_0x21cbca(0xa8)];}function a4_0x4c06(_0x8eba67,_0x4ef31c){_0x8eba67=_0x8eba67-0x8a;const _0x31383f=a4_0x3138();let _0x4c06f7=_0x31383f[_0x8eba67];return _0x4c06f7;}function delay(_0x2ee872){return new Promise(_0x3572df=>setTimeout(_0x3572df,_0x2ee872));}export async function generateDatasetDocs(_0x3c7f5c,_0x4bde54,_0x54bd8e='./docs',_0x385901,_0x36d2a1){const _0x59c227=a4_0x4c06;mkdirSync(_0x54bd8e,{'recursive':!![]});const _0x49bde8=[],_0x13daae=_0x3c7f5c[_0x59c227(0x93)];console[_0x59c227(0x9c)](_0x59c227(0xa4)+_0x13daae+_0x59c227(0x8d));for(let _0x57ad60=0x0;_0x57ad60<_0x3c7f5c[_0x59c227(0x93)];_0x57ad60++){const _0x4fdbfd=_0x3c7f5c[_0x57ad60],_0x562337=_0x57ad60+0x1,_0x159e94=_0x4fdbfd[_0x59c227(0xa0)];try{console[_0x59c227(0x9c)]('['+_0x562337+'/'+_0x13daae+_0x59c227(0x91)+_0x159e94+_0x59c227(0x8c)+_0x4fdbfd[_0x59c227(0x9f)]+')');_0x385901&&_0x385901(_0x562337,_0x13daae,_0x159e94);const _0x11a541=await fetchDatasetDoc({'appCode':_0x4bde54,'datasetCode':_0x4fdbfd[_0x59c227(0x99)],'datasetId':_0x4fdbfd['id'],'enableAI':![],'extraParams':_0x36d2a1}),_0x4efb29=a4_0x297d4a[_0x59c227(0x96)](_0x54bd8e,_0x159e94+'.md');writeFileSync(_0x4efb29,_0x11a541,{'encoding':'utf8'}),console['log'](_0x59c227(0x94)+_0x159e94+_0x59c227(0xb2)),logger[_0x59c227(0xae)](_0x59c227(0x95),_0x59c227(0x9d)+_0x159e94,undefined,{'datasetCode':_0x4fdbfd['datasetCode'],'datasetName':_0x4fdbfd[_0x59c227(0x9f)],'filePath':_0x4efb29,'progress':_0x562337+'/'+_0x13daae}),_0x49bde8[_0x59c227(0xa5)]({'datasetCode':_0x4fdbfd['datasetCode'],'datasetName':_0x4fdbfd['name'],'filePath':_0x4efb29,'success':!![]}),_0x562337<_0x13daae&&await delay(0x1388);}catch(_0x3e492e){const _0x4b5d97=_0x3e492e instanceof Error?_0x3e492e[_0x59c227(0xaf)]:String(_0x3e492e);console['log'](_0x59c227(0xab)+_0x159e94+_0x59c227(0x90)+_0x4b5d97+'\x0a'),logger[_0x59c227(0x8b)]('api-doc','生成文档失败:\x20'+_0x4fdbfd[_0x59c227(0x99)],{'datasetCode':_0x4fdbfd['datasetCode'],'datasetName':_0x4fdbfd[_0x59c227(0x9f)],'error':_0x4b5d97,'progress':_0x562337+'/'+_0x13daae}),_0x49bde8[_0x59c227(0xa5)]({'datasetCode':_0x4fdbfd[_0x59c227(0x99)],'datasetName':_0x4fdbfd[_0x59c227(0x9f)],'filePath':'','success':![],'error':_0x4b5d97}),_0x562337<_0x13daae&&(console['log']('等待\x203\x20秒...\x0a'),await delay(0xbb8));}}return _0x49bde8;}function a4_0x3138(){const _0x51fdc4=['message','465PnRNAI','4403984IeCyep','.md','18WvOByg','error','.md\x20(','\x20个数据集需要生成文档\x0a','4556010DMTATc','text','.md\x20-\x20',']\x20正在生成:\x20','data','length','✓\x20成功生成:\x20','api-doc','join','登录鉴权失败,登录已过期,请使用\x20lovrabet\x20auth\x20重新登录','获取文档失败\x20(','datasetCode','382164nlRvyZ','3208716bqvGLD','log','生成文档成功:\x20','json','name','tableName','POST','4612msOMhJ','status','\x0a共有\x20','push','198822GhitLg','string','markdown','/api/node-toolbox/api-doc-generator','444763eRpyhZ','✗\x20失败:\x20','),HTTP状态码:\x20','响应数据格式错误\x20(','success'];a4_0x3138=function(){return _0x51fdc4;};return a4_0x3138();}
@@ -1 +1 @@
1
- (function(_0x59dc02,_0x23ccab){const _0x3342a0=a5_0x5802,_0x3761b4=_0x59dc02();while(!![]){try{const _0x452389=parseInt(_0x3342a0(0x1bc))/0x1*(parseInt(_0x3342a0(0x1cd))/0x2)+parseInt(_0x3342a0(0x1ae))/0x3+-parseInt(_0x3342a0(0x1ac))/0x4*(parseInt(_0x3342a0(0x1bf))/0x5)+parseInt(_0x3342a0(0x1a2))/0x6+-parseInt(_0x3342a0(0x19a))/0x7+parseInt(_0x3342a0(0x1b4))/0x8*(parseInt(_0x3342a0(0x1a6))/0x9)+-parseInt(_0x3342a0(0x19f))/0xa;if(_0x452389===_0x23ccab)break;else _0x3761b4['push'](_0x3761b4['shift']());}catch(_0x40c701){_0x3761b4['push'](_0x3761b4['shift']());}}}(a5_0x4d2e,0x86676));import{jsx as a5_0x4ba1ff,jsxs as a5_0x10b365}from'react/jsx-runtime';import{useEffect,useState}from'react';import{Box,Text,useApp}from'ink';function a5_0x5802(_0x1ca6c2,_0x13c90e){_0x1ca6c2=_0x1ca6c2-0x198;const _0x4d2e62=a5_0x4d2e();let _0x580293=_0x4d2e62[_0x1ca6c2];return _0x580293;}import{readConfig,getConfigAppCode}from'../utils/config.js';import{initEnv}from'../constant/env.js';import{generateApiFile}from'./generate-api-file.js';import{logger}from'../utils/logger.js';function a5_0x4d2e(){const _0x9a9b3d=['./src/api/','36WxTgPM','includes','1350180XPTWMO','{\x20lovrabetClient\x20}','\x20个模型','\x20个,过滤重复','cyan','.ts','776jVaYKk','replace','*\x20已生成文件:','modelCount','endsWith','length','string','dim','280nKfSLC','\x20重新登录后再试','-\x20模型配置文件\x20(','329075sBXJxf','api','√\x20成功拉取\x20','client','使用配置的应用AppCode:\x20','green','yellow','\x20-\x20客户端实例文件','slice','message','未提供应用AppCode,且配置中也没有默认值','online','-client','cwd','1382NzwgfU','duplicateCount','setLogPath','datasetCount','789698PsMaIW','column','gray','white','!\x20原始数据集\x20','7160720JsCUer','api-pull','join','3198540LANChF','red','*\x20导入方式:','error','73773ZaMnFO','\x20个模型)','env','-api','拉取\x20API\x20配置失败:\x20'];a5_0x4d2e=function(){return _0x9a9b3d;};return a5_0x4d2e();}import{fetchModelList}from'./fetch-model-list.js';export const ApiPullUI=({appCode:_0x5ab228,env:_0x554fd0,output:_0x4bfa6f})=>{const _0x4c5d17=a5_0x5802,{exit:_0x152a7f}=useApp(),[_0x441446,_0x3c6188]=useState(![]),[_0x257afe,_0x256c81]=useState(![]),[_0x28bb26,_0x16db9a]=useState(null),[_0x1a8dd1,_0x5c826c]=useState(null),_0x1e0d12=readConfig(),_0x2559e0=getConfigAppCode(),_0xc8e19a=_0x5ab228||_0x2559e0,_0x224dd3=typeof _0x1e0d12?.[_0x4c5d17(0x1a8)]===_0x4c5d17(0x1ba)?_0x1e0d12[_0x4c5d17(0x1a8)]:undefined,_0x4c22e8=_0x554fd0||_0x224dd3||_0x4c5d17(0x1ca);initEnv(_0x4c22e8);const _0x1304a3=_0x4bfa6f||_0x4c5d17(0x1ab),_0xa67c71=_0x5ab228&&_0x5ab228[_0x4c5d17(0x1ad)]('-')?_0x5ab228['split']('-')[_0x4c5d17(0x1c7)](0x1)[_0x4c5d17(0x1a1)]('-'):'',_0xae4b25=_0x5ab228?'使用指定的应用AppCode:\x20'+_0xc8e19a:_0x4c5d17(0x1c3)+_0xc8e19a,_0x59be56=_0xa67c71?_0xa67c71+_0x4c5d17(0x1a9):_0x4c5d17(0x1c0),_0x4c3612=_0xa67c71?_0xa67c71+_0x4c5d17(0x1cb):_0x4c5d17(0x1c2);useEffect(()=>{_0x3c6188(!![]),_0x4318de();},[]),useEffect(()=>{(_0x257afe||_0x28bb26)&&_0x152a7f();},[_0x257afe,_0x28bb26,_0x152a7f]);async function _0x4318de(){const _0x18b84b=_0x4c5d17;if(!_0xc8e19a){_0x16db9a(_0x18b84b(0x1c9));return;}try{logger[_0x18b84b(0x198)](process[_0x18b84b(0x1cc)]());const {configArray:_0x4f7955}=await fetchModelList(_0xc8e19a),_0x5c400e=_0x4f7955[_0x18b84b(0x1b9)],_0x1b25ac=!_0x5ab228,_0x5af0dc=await generateApiFile(_0x4f7955,_0xa67c71,_0xc8e19a,_0x1b25ac,_0x4c22e8,_0x1304a3),_0x2d98e3=_0x1304a3[_0x18b84b(0x1b8)]('/')?_0x1304a3:_0x1304a3+'/';_0x5c826c({'api':''+_0x2d98e3+_0x59be56+_0x18b84b(0x1b3),'client':''+_0x2d98e3+_0x4c3612+_0x18b84b(0x1b3),'modelCount':_0x5af0dc[_0x18b84b(0x1b7)],'datasetCount':_0x5c400e,'originalCount':_0x5c400e,'duplicateCount':0x0}),_0x256c81(!![]);}catch(_0x484780){const _0x5bd9bc=_0x484780 instanceof Error?_0x484780[_0x18b84b(0x1c8)]:String(_0x484780);logger[_0x18b84b(0x1a5)](_0x18b84b(0x1a0),'拉取\x20API\x20配置失败:\x20'+_0x5bd9bc,{'appCode':_0xc8e19a,'error':_0x5bd9bc}),_0x16db9a(_0x18b84b(0x1aa)+_0x5bd9bc);}finally{_0x3c6188(![]);}}return a5_0x10b365(Box,{'flexDirection':_0x4c5d17(0x19b),'children':[(_0x441446||_0x257afe)&&a5_0x10b365(Box,{'children':[a5_0x4ba1ff(Text,{'color':_0x4c5d17(0x19c),'children':'*\x20'}),a5_0x4ba1ff(Text,{'color':_0x5ab228?_0x4c5d17(0x19d):_0x4c5d17(0x1bb),'children':_0xae4b25})]}),_0x441446&&a5_0x4ba1ff(Box,{'children':a5_0x10b365(Text,{'children':['🚀\x20正在从服务器拉取\x20API\x20配置...\x20(环境:\x20',_0x4c22e8,')']})}),_0x257afe&&_0x1a8dd1&&a5_0x10b365(Box,{'flexDirection':_0x4c5d17(0x19b),'children':[a5_0x4ba1ff(Box,{'children':a5_0x10b365(Text,{'color':_0x4c5d17(0x1c4),'children':[_0x4c5d17(0x1c1),_0x1a8dd1[_0x4c5d17(0x199)],'\x20个数据集,生成','\x20',_0x1a8dd1[_0x4c5d17(0x1b7)],_0x4c5d17(0x1b0)]})}),_0x1a8dd1[_0x4c5d17(0x1ce)]>0x0&&a5_0x4ba1ff(Box,{'marginTop':0x1,'children':a5_0x10b365(Text,{'color':'yellow','children':[_0x4c5d17(0x19e),_0x1a8dd1['originalCount'],_0x4c5d17(0x1b1),'\x20',_0x1a8dd1[_0x4c5d17(0x1ce)],'\x20个']})}),a5_0x4ba1ff(Box,{'marginTop':0x1,'children':a5_0x4ba1ff(Text,{'color':_0x4c5d17(0x19c),'children':_0x4c5d17(0x1b6)})}),a5_0x10b365(Box,{'marginLeft':0x2,'children':[a5_0x10b365(Text,{'color':_0x4c5d17(0x1b2),'children':['•\x20',_0x1a8dd1[_0x4c5d17(0x1c0)]]}),a5_0x10b365(Text,{'color':'dim','children':['\x20',_0x4c5d17(0x1be),_0x1a8dd1[_0x4c5d17(0x1b7)],_0x4c5d17(0x1a7)]})]}),a5_0x10b365(Box,{'marginLeft':0x2,'children':[a5_0x10b365(Text,{'color':_0x4c5d17(0x1b2),'children':['•\x20',_0x1a8dd1['client']]}),a5_0x4ba1ff(Text,{'color':_0x4c5d17(0x1bb),'children':_0x4c5d17(0x1c6)})]}),a5_0x4ba1ff(Box,{'marginTop':0x1,'children':a5_0x4ba1ff(Text,{'color':_0x4c5d17(0x19c),'children':_0x4c5d17(0x1a4)})}),a5_0x4ba1ff(Box,{'marginLeft':0x2,'children':a5_0x10b365(Text,{'color':_0x4c5d17(0x1c5),'children':['import\x20',_0x4c5d17(0x1af),'\x20from\x20\x27@/',_0x1a8dd1[_0x4c5d17(0x1c2)][_0x4c5d17(0x1b5)](/^\.\//,'')['replace'](_0x4c5d17(0x1b3),''),'\x27']})})]}),_0x28bb26&&a5_0x10b365(Box,{'flexDirection':'column','children':[a5_0x4ba1ff(Box,{'children':a5_0x10b365(Text,{'color':_0x4c5d17(0x1a3),'children':['❌\x20',_0x28bb26]})}),_0x28bb26[_0x4c5d17(0x1ad)]('登录')&&a5_0x10b365(Box,{'marginTop':0x1,'children':[a5_0x4ba1ff(Text,{'color':_0x4c5d17(0x1c5),'children':'💡\x20请使用\x20'}),a5_0x4ba1ff(Text,{'color':'cyan','children':'lovrabet\x20auth'}),a5_0x4ba1ff(Text,{'color':_0x4c5d17(0x1c5),'children':_0x4c5d17(0x1bd)})]})]})]});};
1
+ (function(_0xebdff1,_0x33ae55){const _0x1c79c1=a5_0x39e7,_0x54f8c5=_0xebdff1();while(!![]){try{const _0x3ab550=parseInt(_0x1c79c1(0x151))/0x1*(parseInt(_0x1c79c1(0x156))/0x2)+-parseInt(_0x1c79c1(0x14e))/0x3*(parseInt(_0x1c79c1(0x14a))/0x4)+-parseInt(_0x1c79c1(0x167))/0x5+-parseInt(_0x1c79c1(0x171))/0x6+-parseInt(_0x1c79c1(0x165))/0x7+parseInt(_0x1c79c1(0x17d))/0x8+-parseInt(_0x1c79c1(0x166))/0x9*(-parseInt(_0x1c79c1(0x14c))/0xa);if(_0x3ab550===_0x33ae55)break;else _0x54f8c5['push'](_0x54f8c5['shift']());}catch(_0x2d6bb9){_0x54f8c5['push'](_0x54f8c5['shift']());}}}(a5_0x1aba,0x420a3));import{jsx as a5_0x2b28c5,jsxs as a5_0x58ae8b}from'react/jsx-runtime';function a5_0x39e7(_0x57a7d6,_0x1c9fca){_0x57a7d6=_0x57a7d6-0x148;const _0x1aba11=a5_0x1aba();let _0x39e7bc=_0x1aba11[_0x57a7d6];return _0x39e7bc;}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';import{logger}from'../utils/logger.js';import{fetchModelList}from'./fetch-model-list.js';function a5_0x1aba(){const _0x341831=['env','830iawNSJ','import\x20','./src/api/','white','🚀\x20正在从服务器拉取\x20API\x20配置...\x20(环境:\x20','676SLBXgP','未提供应用AppCode,且配置中也没有默认值','\x20-\x20客户端实例文件','\x20个,过滤重复','√\x20成功拉取\x20','cwd','green','duplicateCount','💡\x20请使用\x20','{\x20lovrabetClient\x20}','error','dim','datasetCount','api','setLogPath','1501934ClRFee','263943NaZqHU','1508970YnpVME','*\x20导入方式:','split','api-pull','join','includes','\x20个模型)','cyan','online','\x20个模型','635250oWBgeq','.ts','client','column','使用配置的应用AppCode:\x20','replace','使用指定的应用AppCode:\x20','modelCount','*\x20已生成文件:','originalCount','gray','-\x20模型配置文件\x20(','1566440fiXXun','\x20个数据集,生成','拉取\x20API\x20配置失败:\x20','36iLExLU','yellow','180TAXjrR','message','37167rnPiZI','\x20重新登录后再试'];a5_0x1aba=function(){return _0x341831;};return a5_0x1aba();}export const ApiPullUI=({appCode:_0x34d10e,env:_0x54720d,output:_0x3154a3})=>{const _0x2deb6d=a5_0x39e7,{exit:_0x53ec95}=useApp(),[_0x29b24d,_0x35311e]=useState(![]),[_0x4893c1,_0x45a79b]=useState(![]),[_0x43e428,_0x500b8d]=useState(null),[_0x4931f8,_0x2cceba]=useState(null),_0x35fb8e=readConfig(),_0x2116ac=getConfigAppCode(),_0x2c0d4b=_0x34d10e||_0x2116ac,_0x3eb48e=typeof _0x35fb8e?.[_0x2deb6d(0x150)]==='string'?_0x35fb8e[_0x2deb6d(0x150)]:undefined,_0x127afb=_0x54720d||_0x3eb48e||_0x2deb6d(0x16f);initEnv(_0x127afb);const _0x540224=_0x3154a3||_0x2deb6d(0x153),_0x22c55d=_0x34d10e&&_0x34d10e[_0x2deb6d(0x16c)]('-')?_0x34d10e[_0x2deb6d(0x169)]('-')['slice'](0x1)[_0x2deb6d(0x16b)]('-'):'',_0x540df4=_0x34d10e?_0x2deb6d(0x177)+_0x2c0d4b:_0x2deb6d(0x175)+_0x2c0d4b,_0x1cbcef=_0x22c55d?_0x22c55d+'-api':_0x2deb6d(0x163),_0xb4e2c=_0x22c55d?_0x22c55d+'-client':_0x2deb6d(0x173);useEffect(()=>{_0x35311e(!![]),_0x555bb7();},[]),useEffect(()=>{(_0x4893c1||_0x43e428)&&_0x53ec95();},[_0x4893c1,_0x43e428,_0x53ec95]);async function _0x555bb7(){const _0x427651=_0x2deb6d;if(!_0x2c0d4b){_0x500b8d(_0x427651(0x157));return;}try{logger[_0x427651(0x164)](process[_0x427651(0x15b)]());const {configArray:_0x420793}=await fetchModelList(_0x2c0d4b),_0x5036bc=_0x420793['length'],_0x282409=!_0x34d10e,_0x4a16c2=await generateApiFile(_0x420793,_0x22c55d,_0x2c0d4b,_0x282409,_0x127afb,_0x540224),_0x2cd4b9=_0x540224['endsWith']('/')?_0x540224:_0x540224+'/';_0x2cceba({'api':''+_0x2cd4b9+_0x1cbcef+'.ts','client':''+_0x2cd4b9+_0xb4e2c+_0x427651(0x172),'modelCount':_0x4a16c2[_0x427651(0x178)],'datasetCount':_0x5036bc,'originalCount':_0x5036bc,'duplicateCount':0x0}),_0x45a79b(!![]);}catch(_0x4663cf){const _0x1a89be=_0x4663cf instanceof Error?_0x4663cf[_0x427651(0x14d)]:String(_0x4663cf);logger[_0x427651(0x160)](_0x427651(0x16a),_0x427651(0x149)+_0x1a89be,{'appCode':_0x2c0d4b,'error':_0x1a89be}),_0x500b8d('拉取\x20API\x20配置失败:\x20'+_0x1a89be);}finally{_0x35311e(![]);}}return a5_0x58ae8b(Box,{'flexDirection':'column','children':[(_0x29b24d||_0x4893c1)&&a5_0x58ae8b(Box,{'children':[a5_0x2b28c5(Text,{'color':'gray','children':'*\x20'}),a5_0x2b28c5(Text,{'color':_0x34d10e?_0x2deb6d(0x154):'dim','children':_0x540df4})]}),_0x29b24d&&a5_0x2b28c5(Box,{'children':a5_0x58ae8b(Text,{'children':[_0x2deb6d(0x155),_0x127afb,')']})}),_0x4893c1&&_0x4931f8&&a5_0x58ae8b(Box,{'flexDirection':'column','children':[a5_0x2b28c5(Box,{'children':a5_0x58ae8b(Text,{'color':_0x2deb6d(0x15c),'children':[_0x2deb6d(0x15a),_0x4931f8[_0x2deb6d(0x162)],_0x2deb6d(0x148),'\x20',_0x4931f8[_0x2deb6d(0x178)],_0x2deb6d(0x170)]})}),_0x4931f8[_0x2deb6d(0x15d)]>0x0&&a5_0x2b28c5(Box,{'marginTop':0x1,'children':a5_0x58ae8b(Text,{'color':_0x2deb6d(0x14b),'children':['!\x20原始数据集\x20',_0x4931f8[_0x2deb6d(0x17a)],_0x2deb6d(0x159),'\x20',_0x4931f8['duplicateCount'],'\x20个']})}),a5_0x2b28c5(Box,{'marginTop':0x1,'children':a5_0x2b28c5(Text,{'color':_0x2deb6d(0x17b),'children':_0x2deb6d(0x179)})}),a5_0x58ae8b(Box,{'marginLeft':0x2,'children':[a5_0x58ae8b(Text,{'color':'cyan','children':['•\x20',_0x4931f8[_0x2deb6d(0x163)]]}),a5_0x58ae8b(Text,{'color':_0x2deb6d(0x161),'children':['\x20',_0x2deb6d(0x17c),_0x4931f8[_0x2deb6d(0x178)],_0x2deb6d(0x16d)]})]}),a5_0x58ae8b(Box,{'marginLeft':0x2,'children':[a5_0x58ae8b(Text,{'color':_0x2deb6d(0x16e),'children':['•\x20',_0x4931f8[_0x2deb6d(0x173)]]}),a5_0x2b28c5(Text,{'color':_0x2deb6d(0x161),'children':_0x2deb6d(0x158)})]}),a5_0x2b28c5(Box,{'marginTop':0x1,'children':a5_0x2b28c5(Text,{'color':'gray','children':_0x2deb6d(0x168)})}),a5_0x2b28c5(Box,{'marginLeft':0x2,'children':a5_0x58ae8b(Text,{'color':_0x2deb6d(0x14b),'children':[_0x2deb6d(0x152),_0x2deb6d(0x15f),'\x20from\x20\x27@/',_0x4931f8[_0x2deb6d(0x173)][_0x2deb6d(0x176)](/^\.\//,'')[_0x2deb6d(0x176)](_0x2deb6d(0x172),''),'\x27']})})]}),_0x43e428&&a5_0x58ae8b(Box,{'flexDirection':_0x2deb6d(0x174),'children':[a5_0x2b28c5(Box,{'children':a5_0x58ae8b(Text,{'color':'red','children':['❌\x20',_0x43e428]})}),_0x43e428[_0x2deb6d(0x16c)]('登录')&&a5_0x58ae8b(Box,{'marginTop':0x1,'children':[a5_0x2b28c5(Text,{'color':_0x2deb6d(0x14b),'children':_0x2deb6d(0x15e)}),a5_0x2b28c5(Text,{'color':'cyan','children':'lovrabet\x20auth'}),a5_0x2b28c5(Text,{'color':_0x2deb6d(0x14b),'children':_0x2deb6d(0x14f)})]})]})]});};
@@ -1 +1 @@
1
- (function(_0x3d8419,_0x3ed48f){const _0x1c7dd4=a6_0x3d84,_0x2b8b52=_0x3d8419();while(!![]){try{const _0x2d1a86=-parseInt(_0x1c7dd4(0x117))/0x1*(parseInt(_0x1c7dd4(0x112))/0x2)+-parseInt(_0x1c7dd4(0x10d))/0x3+-parseInt(_0x1c7dd4(0x115))/0x4*(-parseInt(_0x1c7dd4(0x119))/0x5)+-parseInt(_0x1c7dd4(0x10a))/0x6*(-parseInt(_0x1c7dd4(0x111))/0x7)+parseInt(_0x1c7dd4(0x109))/0x8+-parseInt(_0x1c7dd4(0x10f))/0x9*(parseInt(_0x1c7dd4(0x114))/0xa)+parseInt(_0x1c7dd4(0x104))/0xb;if(_0x2d1a86===_0x3ed48f)break;else _0x2b8b52['push'](_0x2b8b52['shift']());}catch(_0x20c526){_0x2b8b52['push'](_0x2b8b52['shift']());}}}(a6_0x267d,0x24cc0));import{getCookie}from'../auth/get-cookie.js';import{getApiDomain}from'../constant/domain.js';function a6_0x267d(){const _0x54a583=['477fcxBll','正在从服务器拉取模型列表...\x20(环境:\x20','5mjOmaA','success','获取数据集失败:\x20','1320363FbBUtH','data','configArray','/api/node-toolbox/dataset/model-list?appcode=','message','413032FkQorz','205554cKECeT','&otype=array','json','194958wgJdnp','info','18ZVyzRY','登录鉴权失败,登录已过期,请使用\x20lovrabet\x20auth\x20重新登录','35PzxOlr','628NJqald','fetch-model-list','334810JJRfPp','357956gqkwMU','获取数据集失败,HTTP状态码:\x20'];a6_0x267d=function(){return _0x54a583;};return a6_0x267d();}import{logger}from'../utils/logger.js';import{getEnv}from'../constant/env.js';function a6_0x3d84(_0x4827e5,_0x5d11e8){_0x4827e5=_0x4827e5-0x102;const _0x267d84=a6_0x267d();let _0x3d84ce=_0x267d84[_0x4827e5];return _0x3d84ce;}export async function fetchModelList(_0xe389cb){const _0x50af41=a6_0x3d84,_0x3ae2e4=getEnv(),_0x26cdf0=getApiDomain()+_0x50af41(0x107)+_0xe389cb+_0x50af41(0x10b);logger[_0x50af41(0x10e)](_0x50af41(0x113),_0x50af41(0x118)+_0x3ae2e4+')',{'apiUrl':_0x26cdf0});const _0x457133=await fetch(_0x26cdf0,{'headers':{'Cookie':getCookie()}});if(!_0x457133['ok']){if(_0x457133['status']===0x191)throw new Error(_0x50af41(0x110));throw new Error(_0x50af41(0x116)+_0x457133['status']);}const _0x4d2633=await _0x457133[_0x50af41(0x10c)]();if(!_0x4d2633[_0x50af41(0x102)])throw new Error(_0x50af41(0x103)+(_0x4d2633[_0x50af41(0x108)]||'未知错误'));return{'configArray':_0x4d2633[_0x50af41(0x105)][_0x50af41(0x106)],'count':_0x4d2633[_0x50af41(0x105)]['count']};}
1
+ (function(_0x131793,_0x2a167d){const _0x5e9a53=a6_0x1164,_0xdb3dcd=_0x131793();while(!![]){try{const _0x505031=parseInt(_0x5e9a53(0x196))/0x1*(parseInt(_0x5e9a53(0x18a))/0x2)+parseInt(_0x5e9a53(0x18c))/0x3*(-parseInt(_0x5e9a53(0x188))/0x4)+-parseInt(_0x5e9a53(0x189))/0x5+-parseInt(_0x5e9a53(0x19d))/0x6+parseInt(_0x5e9a53(0x191))/0x7*(parseInt(_0x5e9a53(0x194))/0x8)+parseInt(_0x5e9a53(0x190))/0x9+-parseInt(_0x5e9a53(0x18f))/0xa*(-parseInt(_0x5e9a53(0x195))/0xb);if(_0x505031===_0x2a167d)break;else _0xdb3dcd['push'](_0xdb3dcd['shift']());}catch(_0x293ad7){_0xdb3dcd['push'](_0xdb3dcd['shift']());}}}(a6_0x11d1,0x797c3));import{getCookie}from'../auth/get-cookie.js';import{getApiDomain}from'../constant/domain.js';import{logger}from'../utils/logger.js';function a6_0x1164(_0x178fb0,_0x564490){_0x178fb0=_0x178fb0-0x187;const _0x11d11f=a6_0x11d1();let _0x1164f9=_0x11d11f[_0x178fb0];return _0x1164f9;}import{getEnv}from'../constant/env.js';export async function fetchModelList(_0x30609e){const _0x295e47=a6_0x1164,_0x339f26=getEnv(),_0x36e2e6=getApiDomain()+_0x295e47(0x187)+_0x30609e+_0x295e47(0x198);logger[_0x295e47(0x18b)](_0x295e47(0x199),_0x295e47(0x18d)+_0x339f26+')',{'apiUrl':_0x36e2e6});const _0x3cd83b=await fetch(_0x36e2e6,{'headers':{'Cookie':getCookie()}});if(!_0x3cd83b['ok']){if(_0x3cd83b[_0x295e47(0x192)]===0x191)throw new Error('登录鉴权失败,登录已过期,请使用\x20lovrabet\x20auth\x20重新登录');throw new Error('获取数据集失败,HTTP状态码:\x20'+_0x3cd83b[_0x295e47(0x192)]);}const _0x56410c=await _0x3cd83b['json']();if(!_0x56410c[_0x295e47(0x193)])throw new Error('获取数据集失败:\x20'+(_0x56410c[_0x295e47(0x19a)]||_0x295e47(0x19b)));return{'configArray':_0x56410c[_0x295e47(0x19c)][_0x295e47(0x197)],'count':_0x56410c[_0x295e47(0x19c)][_0x295e47(0x18e)]};}function a6_0x11d1(){const _0x59fd85=['474aNWCmT','正在从服务器拉取模型列表...\x20(环境:\x20','count','130PFpOTX','3590577mgWsib','35ZDCfzP','status','success','1222344hSvZcM','715253aQzRlp','8662WQsBdF','configArray','&otype=array','fetch-model-list','message','未知错误','data','4862238eoBEhW','/api/node-toolbox/dataset/model-list?appcode=','8248CUHJEm','4730685oEteGV','132YJJbWB','info'];a6_0x11d1=function(){return _0x59fd85;};return a6_0x11d1();}
@@ -1 +1 @@
1
- const a7_0x44843a=a7_0x2f65;(function(_0xd7e735,_0x4ed31d){const _0x26adf0=a7_0x2f65,_0x1d65fd=_0xd7e735();while(!![]){try{const _0x3d960e=-parseInt(_0x26adf0(0x96))/0x1*(parseInt(_0x26adf0(0x7e))/0x2)+-parseInt(_0x26adf0(0x97))/0x3*(-parseInt(_0x26adf0(0x84))/0x4)+parseInt(_0x26adf0(0x93))/0x5*(-parseInt(_0x26adf0(0x87))/0x6)+parseInt(_0x26adf0(0x9b))/0x7*(parseInt(_0x26adf0(0x99))/0x8)+-parseInt(_0x26adf0(0x7d))/0x9+-parseInt(_0x26adf0(0x90))/0xa*(-parseInt(_0x26adf0(0x81))/0xb)+-parseInt(_0x26adf0(0x8b))/0xc*(parseInt(_0x26adf0(0x8f))/0xd);if(_0x3d960e===_0x4ed31d)break;else _0x1d65fd['push'](_0x1d65fd['shift']());}catch(_0x2cf7b4){_0x1d65fd['push'](_0x1d65fd['shift']());}}}(a7_0x207e,0x49cc5));import a7_0x440769 from'prettier';import{mkdirSync,writeFileSync,readFileSync}from'node:fs';import a7_0xa25c71 from'node:path';import{fileURLToPath}from'node:url';import{readConfig}from'../utils/config.js';import{TemplateReplacer}from'../utils/template-replacer.js';function a7_0x2f65(_0x4fed67,_0x1c3b63){_0x4fed67=_0x4fed67-0x7a;const _0x207eaa=a7_0x207e();let _0x2f6560=_0x207eaa[_0x4fed67];return _0x2f6560;}import{logger}from'../utils/logger.js';function a7_0x207e(){const _0x34d986=['./src/api/','templates/generate-api','1217565tPSDLw','4TZPKGb',',\x20env:\x20\x22','dirname','68398FNybFZ','slice','name','797912HSohDb','typescript','client.ts.tpl','246kjMcqp','client','../..','{\x20apiConfigName:\x20\x22','16104wXTqbt','请先通过\x20`lovrabet\x20config\x20set\x20app\x20<value>`\x20配置应用\x20Code','CONFIG_NAMES.DEFAULT','.ts','962NCTURW','790hsqNft','join','replaceApiContent','25985bRXpZz','key','API\x20文件生成成功!','98876mtWrsJ','6OFaxmM','keys','8wMcmPQ','api.ts.tpl','402647RZSvlX','{\x20apiConfigName:\x20','success','utf8','online','app','api','format','datasetCode','forEach','length','endsWith','\x22\x20}','init-api','tableName'];a7_0x207e=function(){return _0x34d986;};return a7_0x207e();}export async function generateApiFile(_0x5c4d44,_0x17cd83='',_0x22e4e5,_0x4e8090=![],_0x37b811,_0xcc3bad=a7_0x44843a(0x7b)){const _0xdcea2f=a7_0x44843a,_0xae958e=readConfig(),_0x490d87=_0x22e4e5||_0xae958e?.[_0xdcea2f(0xa0)];if(typeof _0x490d87!=='string'||!_0x490d87)throw new Error(_0xdcea2f(0x8c));const _0x2fc98e=_0x4e8090?_0xdcea2f(0x8d):'\x22'+_0x490d87+'\x22',_0x1179e9=typeof _0xae958e['env']==='string'?_0xae958e['env']:undefined,_0x4497d1=_0x37b811||_0x1179e9||_0xdcea2f(0x9f),_0x4cc2e6=_0x4497d1!=='online';let _0x1f2d27;if(_0x4e8090)_0x4cc2e6?_0x1f2d27=_0xdcea2f(0x9c)+_0x2fc98e+_0xdcea2f(0x7f)+_0x4497d1+_0xdcea2f(0xa7):_0x1f2d27='';else{const _0x5d9194=_0x4cc2e6?_0xdcea2f(0x7f)+_0x4497d1+'\x22':'';_0x1f2d27=_0xdcea2f(0x8a)+_0x490d87+'\x22'+_0x5d9194+'\x20}';}const _0x4216aa=_0x17cd83?_0x17cd83+'-api':_0xdcea2f(0xa1),_0x423ade=_0x17cd83?_0x17cd83+'-client':_0xdcea2f(0x88),_0x2288af={};_0x5c4d44[_0xdcea2f(0xa4)](_0x511113=>{const _0x1a1beb=_0xdcea2f;_0x2288af[_0x511113[_0x1a1beb(0x94)]]={'tableName':_0x511113[_0x1a1beb(0x7a)],'datasetCode':_0x511113[_0x1a1beb(0xa3)],'name':_0x511113[_0x1a1beb(0x83)]||''};});const _0x2e4097=fileURLToPath(import.meta.url),_0x559d79=a7_0xa25c71['resolve'](a7_0xa25c71[_0xdcea2f(0x80)](_0x2e4097),_0xdcea2f(0x89)),_0x5589cd=a7_0xa25c71[_0xdcea2f(0x91)](_0x559d79,_0xdcea2f(0x7c)),_0x4144bf=a7_0xa25c71[_0xdcea2f(0x91)](_0x5589cd,_0xdcea2f(0x9a)),_0x408c42=a7_0xa25c71[_0xdcea2f(0x91)](_0x5589cd,_0xdcea2f(0x86)),_0x322053=_0xcc3bad[_0xdcea2f(0xa6)]('/')?_0xcc3bad[_0xdcea2f(0x82)](0x0,-0x1):_0xcc3bad;mkdirSync(_0x322053,{'recursive':!![]});const _0x243831=readFileSync(_0x4144bf,_0xdcea2f(0x9e)),_0x5c4f6e=TemplateReplacer[_0xdcea2f(0x92)](_0x243831,_0x490d87,_0x2288af,Object['keys'](_0x2288af)[0x0],_0x4216aa,_0x2fc98e),_0x69e4cf=await a7_0x440769[_0xdcea2f(0xa2)](_0x5c4f6e,{'parser':_0xdcea2f(0x85)}),_0x2f6ae1=_0x322053+'/'+_0x4216aa+_0xdcea2f(0x8e);writeFileSync(_0x2f6ae1,_0x69e4cf,{'encoding':'utf8'});const _0x1e95b4=readFileSync(_0x408c42,'utf8'),_0x26a202=TemplateReplacer[_0xdcea2f(0x92)](_0x1e95b4,_0x490d87,_0x2288af,Object['keys'](_0x2288af)[0x0],_0x4216aa,_0x2fc98e,_0x1f2d27),_0x1b24a3=await a7_0x440769[_0xdcea2f(0xa2)](_0x26a202,{'parser':_0xdcea2f(0x85)}),_0x2709e9=_0x322053+'/'+_0x423ade+_0xdcea2f(0x8e);writeFileSync(_0x2709e9,_0x1b24a3,{'encoding':'utf8'});const _0x579d9d=Object[_0xdcea2f(0x98)](_0x2288af)[_0xdcea2f(0xa5)];return logger[_0xdcea2f(0x9d)](_0xdcea2f(0xa8),_0xdcea2f(0x95),undefined,{'apiFile':_0x2f6ae1,'clientFile':_0x2709e9,'modelCount':_0x579d9d,'configName':_0x2fc98e}),{'modelCount':_0x579d9d,'apiFilePath':_0x2f6ae1,'clientFilePath':_0x2709e9,'configName':_0x2fc98e};}
1
+ function a7_0x39de(){const _0x4e3867=['409765dIxooY','350uzRMxL','dirname','replaceApiContent','770FURAOM','success','api.ts.tpl','265ntTYNo','env','format','tableName','32260LkdACU','360PYWYur','-client','slice','133389GTEifz','datasetCode','1146741uXIvzT','app','resolve','client','请先通过\x20`lovrabet\x20config\x20set\x20app\x20<value>`\x20配置应用\x20Code','./src/api/','forEach','api','-api','typescript','alias','init-api','utf8','endsWith','push','templates/generate-api','key','string','2707512nfdkSH','2xSdBKd','join','{\x20apiConfigName:\x20\x22','106956ytHMQg','CONFIG_NAMES.DEFAULT','{\x20apiConfigName:\x20','client.ts.tpl',',\x20env:\x20\x22','API\x20文件生成成功!','online','46186AHobYH'];a7_0x39de=function(){return _0x4e3867;};return a7_0x39de();}const a7_0x58e2a2=a7_0x3f00;(function(_0x436a6a,_0x3aab99){const _0x522dc5=a7_0x3f00,_0x25c847=_0x436a6a();while(!![]){try{const _0x193492=parseInt(_0x522dc5(0x182))/0x1*(parseInt(_0x522dc5(0x177))/0x2)+parseInt(_0x522dc5(0x164))/0x3+parseInt(_0x522dc5(0x15e))/0x4*(-parseInt(_0x522dc5(0x15a))/0x5)+-parseInt(_0x522dc5(0x176))/0x6+parseInt(_0x522dc5(0x181))/0x7*(parseInt(_0x522dc5(0x15f))/0x8)+parseInt(_0x522dc5(0x162))/0x9*(-parseInt(_0x522dc5(0x183))/0xa)+-parseInt(_0x522dc5(0x186))/0xb*(-parseInt(_0x522dc5(0x17a))/0xc);if(_0x193492===_0x3aab99)break;else _0x25c847['push'](_0x25c847['shift']());}catch(_0x2e8950){_0x25c847['push'](_0x25c847['shift']());}}}(a7_0x39de,0x4d008));import a7_0x557e49 from'prettier';import{mkdirSync,writeFileSync,readFileSync}from'node:fs';import a7_0x5283ba from'node:path';import{fileURLToPath}from'node:url';import{readConfig}from'../utils/config.js';function a7_0x3f00(_0x5520cb,_0x387945){_0x5520cb=_0x5520cb-0x15a;const _0x39de68=a7_0x39de();let _0x3f0015=_0x39de68[_0x5520cb];return _0x3f0015;}import{TemplateReplacer}from'../utils/template-replacer.js';import{logger}from'../utils/logger.js';export async function generateApiFile(_0x5a470f,_0x571dd5='',_0x22502a,_0x565df9=![],_0x5d7da1,_0x361aac=a7_0x58e2a2(0x169)){const _0x5b3a31=a7_0x58e2a2,_0x40029d=readConfig(),_0x1e247b=_0x22502a||_0x40029d?.[_0x5b3a31(0x165)];if(typeof _0x1e247b!==_0x5b3a31(0x175)||!_0x1e247b)throw new Error(_0x5b3a31(0x168));const _0x34e0ac=_0x565df9?_0x5b3a31(0x17b):'\x22'+_0x1e247b+'\x22',_0x3570a7=typeof _0x40029d[_0x5b3a31(0x15b)]===_0x5b3a31(0x175)?_0x40029d[_0x5b3a31(0x15b)]:undefined,_0x5a3c45=_0x5d7da1||_0x3570a7||_0x5b3a31(0x180),_0x3db6fe=_0x5a3c45!==_0x5b3a31(0x180);let _0x83d343;if(_0x565df9)_0x3db6fe?_0x83d343=_0x5b3a31(0x17c)+_0x34e0ac+',\x20env:\x20\x22'+_0x5a3c45+'\x22\x20}':_0x83d343='';else{const _0x551296=_0x3db6fe?_0x5b3a31(0x17e)+_0x5a3c45+'\x22':'';_0x83d343=_0x5b3a31(0x179)+_0x1e247b+'\x22'+_0x551296+'\x20}';}const _0x395d6f=_0x571dd5?_0x571dd5+_0x5b3a31(0x16c):_0x5b3a31(0x16b),_0x4d6806=_0x571dd5?_0x571dd5+_0x5b3a31(0x160):_0x5b3a31(0x167),_0x1a8098=[];_0x5a470f[_0x5b3a31(0x16a)](_0x473381=>{const _0x1184de=_0x5b3a31;_0x1a8098[_0x1184de(0x172)]({'datasetCode':_0x473381[_0x1184de(0x163)],'tableName':_0x473381[_0x1184de(0x15d)],'name':_0x473381['name']||'','alias':_0x473381[_0x1184de(0x16e)]||_0x473381[_0x1184de(0x174)]});});const _0x563289=fileURLToPath(import.meta.url),_0x28a846=a7_0x5283ba[_0x5b3a31(0x166)](a7_0x5283ba[_0x5b3a31(0x184)](_0x563289),'../..'),_0x54cdd9=a7_0x5283ba[_0x5b3a31(0x178)](_0x28a846,_0x5b3a31(0x173)),_0x49d79a=a7_0x5283ba[_0x5b3a31(0x178)](_0x54cdd9,_0x5b3a31(0x188)),_0x1a6e9b=a7_0x5283ba[_0x5b3a31(0x178)](_0x54cdd9,_0x5b3a31(0x17d)),_0x18b9b4=_0x361aac[_0x5b3a31(0x171)]('/')?_0x361aac[_0x5b3a31(0x161)](0x0,-0x1):_0x361aac;mkdirSync(_0x18b9b4,{'recursive':!![]});const _0x3f9146=_0x1a8098[0x0]?.[_0x5b3a31(0x16e)],_0x599e26=readFileSync(_0x49d79a,_0x5b3a31(0x170)),_0x34aadf=TemplateReplacer[_0x5b3a31(0x185)](_0x599e26,_0x1e247b,_0x1a8098,_0x3f9146,_0x395d6f,_0x34e0ac),_0x311883=await a7_0x557e49[_0x5b3a31(0x15c)](_0x34aadf,{'parser':_0x5b3a31(0x16d)}),_0x3b67d0=_0x18b9b4+'/'+_0x395d6f+'.ts';writeFileSync(_0x3b67d0,_0x311883,{'encoding':_0x5b3a31(0x170)});const _0x3533c5=readFileSync(_0x1a6e9b,_0x5b3a31(0x170)),_0x373049=TemplateReplacer['replaceApiContent'](_0x3533c5,_0x1e247b,_0x1a8098,_0x3f9146,_0x395d6f,_0x34e0ac,_0x83d343),_0x5387cf=await a7_0x557e49[_0x5b3a31(0x15c)](_0x373049,{'parser':_0x5b3a31(0x16d)}),_0x3941d2=_0x18b9b4+'/'+_0x4d6806+'.ts';writeFileSync(_0x3941d2,_0x5387cf,{'encoding':'utf8'});const _0x2685f0=_0x1a8098['length'];return logger[_0x5b3a31(0x187)](_0x5b3a31(0x16f),_0x5b3a31(0x17f),undefined,{'apiFile':_0x3b67d0,'clientFile':_0x3941d2,'modelCount':_0x2685f0,'configName':_0x34e0ac}),{'modelCount':_0x2685f0,'apiFilePath':_0x3b67d0,'clientFilePath':_0x3941d2,'configName':_0x34e0ac};}
package/lib/api/main.js CHANGED
@@ -1 +1 @@
1
- function a8_0x5e00(_0x122e36,_0x44e0b9){_0x122e36=_0x122e36-0x15f;const _0x1cefbc=a8_0x1cef();let _0x5e0088=_0x1cefbc[_0x122e36];return _0x5e0088;}(function(_0x114236,_0x2b126c){const _0x219ae4=a8_0x5e00,_0x2de7f4=_0x114236();while(!![]){try{const _0x2109ef=parseInt(_0x219ae4(0x15f))/0x1*(parseInt(_0x219ae4(0x161))/0x2)+-parseInt(_0x219ae4(0x18a))/0x3*(parseInt(_0x219ae4(0x184))/0x4)+parseInt(_0x219ae4(0x16d))/0x5+parseInt(_0x219ae4(0x18e))/0x6+parseInt(_0x219ae4(0x170))/0x7+parseInt(_0x219ae4(0x17e))/0x8*(parseInt(_0x219ae4(0x187))/0x9)+-parseInt(_0x219ae4(0x188))/0xa;if(_0x2109ef===_0x2b126c)break;else _0x2de7f4['push'](_0x2de7f4['shift']());}catch(_0x2e5094){_0x2de7f4['push'](_0x2de7f4['shift']());}}}(a8_0x1cef,0xda568));import{jsx as a8_0x5cb55b}from'react/jsx-runtime';import{render}from'ink';function a8_0x1cef(){const _0x5ecf99=['\x20\x20\x201.\x20配置默认值:\x20lovrabet\x20config\x20set\x20appcode\x20<app-code>','\x1b[90m*\x20使用配置的应用AppCode:\x20','Unknown\x20api\x20command:\x20','请使用\x20--appcode\x20参数,例如:','datasetcode','7635960hSORQz','×\x20--datasetcode\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生成\x20API\x20文档','6301169fGFDab','input','\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配置文件','\x20\x20\x202.\x20使用参数:\x20lovrabet\x20api\x20pull\x20--appcode\x20<app-code>','filter','parse','!\x20请使用以下方式之一:','\x20\x20错误:\x20','string','\x20\x20lovrabet\x20api\x20pull\x20--output\x20<dir>\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定输出目录(默认:\x20./src/api/)','\x1b[90m*\x20仅生成指定数据集的文档:\x20','doc','join','log','350248VKCQaL','×\x20--params\x20参数不是有效的\x20JSON\x20格式','isArray','\x20\x20lovrabet\x20api\x20doc\x20--appcode\x20','length','appcode','12WGNxSB','error','\x20\x20lovrabet\x20api\x20doc\x20--appcode\x20<code>\x20\x20\x20\x20\x20\x20\x20//\x20使用指定的\x20appcode','27eoiYWh','40996930Mbvdfd','message','554157kxmNZy','\x20\x20lovrabet\x20api\x20doc\x20--env\x20<env>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定环境(如:\x20daily,\x20online)','\x1b[90m\x20\x20(注:\x20--appcode\x20参数与配置一致,将使用默认配置)\x1b[0m','env','8447196DKCdOS','map','pull','split','\x20\x20\x202.\x20使用参数:\x20lovrabet\x20api\x20doc\x20--appcode\x20<app-code>','6tkQUEv','\x20\x20lovrabet\x20api\x20doc\x20--output\x20<dir>\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定文档输出目录(默认:\x20./docs)','527198HZzxTG','\x1b[0m','exit','flags','❌\x20错误:不再支持位置参数方式','\x20\x20lovrabet\x20api\x20pull\x20--appcode\x20<code>\x20\x20\x20\x20\x20\x20//\x20使用指定的\x20appcode','Available\x20commands:'];a8_0x1cef=function(){return _0x5ecf99;};return a8_0x1cef();}import{ApiPullUI}from'./api-pull-ui.js';import{ApiDocUI}from'./api-doc-ui.js';import{getConfigAppCode}from'../utils/config.js';export async function apiCli(_0x31bf6e){const _0x262d58=a8_0x5e00,_0xcf4255=_0x31bf6e['input'][0x1];if(_0x31bf6e['flags']['help']){console[_0x262d58(0x17d)]('\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');return;}if(_0xcf4255===_0x262d58(0x190)){_0x31bf6e[_0x262d58(0x171)][0x2]&&(console[_0x262d58(0x185)]('❌\x20错误:不再支持位置参数方式'),console[_0x262d58(0x17d)](_0x262d58(0x16b)),console[_0x262d58(0x17d)]('\x20\x20lovrabet\x20api\x20pull\x20--appcode\x20'+_0x31bf6e[_0x262d58(0x171)][0x2]),process['exit'](0x1));const _0x2432a6=getConfigAppCode();let _0x5a493a=_0x31bf6e[_0x262d58(0x164)]['appcode'];const _0x260b5d=typeof _0x31bf6e[_0x262d58(0x164)]['env']===_0x262d58(0x178)?_0x31bf6e[_0x262d58(0x164)][_0x262d58(0x18d)]:undefined,_0xff83ae=_0x31bf6e[_0x262d58(0x164)]['output'];!_0x5a493a&&!_0x2432a6&&(console[_0x262d58(0x185)]('×\x20未配置\x20AppCode'),console[_0x262d58(0x17d)](_0x262d58(0x176)),console[_0x262d58(0x17d)](_0x262d58(0x168)),console[_0x262d58(0x17d)](_0x262d58(0x173)),process[_0x262d58(0x163)](0x1)),_0x5a493a&&_0x2432a6&&_0x5a493a===_0x2432a6&&(console[_0x262d58(0x17d)](_0x262d58(0x169)+_0x5a493a+_0x262d58(0x162)),console[_0x262d58(0x17d)](_0x262d58(0x18c)),_0x5a493a=undefined),render(a8_0x5cb55b(ApiPullUI,{'appCode':_0x5a493a,'env':_0x260b5d,'output':_0xff83ae}));}else{if(_0xcf4255===_0x262d58(0x17b)){_0x31bf6e['input'][0x2]&&(console[_0x262d58(0x185)](_0x262d58(0x165)),console[_0x262d58(0x17d)]('请使用\x20--appcode\x20参数,例如:'),console[_0x262d58(0x17d)](_0x262d58(0x181)+_0x31bf6e['input'][0x2]),process[_0x262d58(0x163)](0x1));const _0xdaf36=getConfigAppCode();let _0x42ce7b=_0x31bf6e[_0x262d58(0x164)][_0x262d58(0x183)];const _0x2b8b4e=typeof _0x31bf6e[_0x262d58(0x164)][_0x262d58(0x18d)]==='string'?_0x31bf6e['flags'][_0x262d58(0x18d)]:undefined,_0x369a9a=_0x31bf6e[_0x262d58(0x164)]['output'],_0x4ddbaa=_0x31bf6e[_0x262d58(0x164)]['params'],_0x280250=_0x31bf6e[_0x262d58(0x164)][_0x262d58(0x16c)];!_0x42ce7b&&!_0xdaf36&&(console['error']('×\x20未配置\x20AppCode'),console[_0x262d58(0x17d)](_0x262d58(0x176)),console[_0x262d58(0x17d)](_0x262d58(0x168)),console[_0x262d58(0x17d)](_0x262d58(0x192)),process[_0x262d58(0x163)](0x1));_0x42ce7b&&_0xdaf36&&_0x42ce7b===_0xdaf36&&(console['log'](_0x262d58(0x169)+_0x42ce7b+_0x262d58(0x162)),_0x42ce7b=undefined);let _0x3ece8d;if(_0x4ddbaa)try{_0x3ece8d=JSON[_0x262d58(0x175)](_0x4ddbaa),(typeof _0x3ece8d!=='object'||_0x3ece8d===null||Array[_0x262d58(0x180)](_0x3ece8d))&&(console[_0x262d58(0x185)]('×\x20--params\x20参数必须是一个有效的\x20JSON\x20对象'),process[_0x262d58(0x163)](0x1));}catch(_0x2693cd){console[_0x262d58(0x185)](_0x262d58(0x17f)),console[_0x262d58(0x185)](_0x262d58(0x177)+(_0x2693cd instanceof Error?_0x2693cd[_0x262d58(0x189)]:String(_0x2693cd))),process['exit'](0x1);}let _0x4a5841;_0x280250&&(_0x4a5841=_0x280250[_0x262d58(0x191)](',')[_0x262d58(0x18f)](_0x2bf7fb=>_0x2bf7fb['trim']())[_0x262d58(0x174)](_0x539405=>_0x539405[_0x262d58(0x182)]>0x0),_0x4a5841['length']===0x0&&(console[_0x262d58(0x185)](_0x262d58(0x16e)),process['exit'](0x1)),console[_0x262d58(0x17d)](_0x262d58(0x17a)+_0x4a5841[_0x262d58(0x17c)](',\x20')+_0x262d58(0x162))),render(a8_0x5cb55b(ApiDocUI,{'appCode':_0x42ce7b,'env':_0x2b8b4e,'output':_0x369a9a,'extraParams':_0x3ece8d,'datasetCodes':_0x4a5841}));}else console[_0x262d58(0x185)](_0x262d58(0x16a)+_0xcf4255),console[_0x262d58(0x17d)](_0x262d58(0x167)),console[_0x262d58(0x17d)](_0x262d58(0x172)),console['log'](_0x262d58(0x166)),console[_0x262d58(0x17d)](_0x262d58(0x179)),console[_0x262d58(0x17d)]('\x20\x20lovrabet\x20api\x20pull\x20--env\x20<env>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定环境(如:\x20daily,\x20online)'),console[_0x262d58(0x17d)](''),console['log'](_0x262d58(0x16f)),console['log'](_0x262d58(0x186)),console['log'](_0x262d58(0x160)),console['log'](_0x262d58(0x18b)),process[_0x262d58(0x163)](0x1);}}
1
+ function a8_0x3ab1(){const _0x357515=['×\x20--datasetcode\x20参数不能为空','\x1b[90m\x20\x20(注:\x20--appcode\x20参数与配置一致,将使用默认配置)\x1b[0m','\x20\x20lovrabet\x20api\x20doc\x20--appcode\x20<code>\x20\x20\x20\x20\x20\x20\x20//\x20使用指定的\x20appcode','\x1b[90m*\x20仅生成指定数据集的文档:\x20','530134VyUIlG','\x1b[0m','isArray','output','\x20\x20lovrabet\x20api\x20pull\x20--env\x20<env>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定环境(如:\x20daily,\x20online)','object','\x20\x20lovrabet\x20api\x20pull\x20--appcode\x20<code>\x20\x20\x20\x20\x20\x20//\x20使用指定的\x20appcode','270tkbNNk','params','Available\x20commands:','2633029hYIVTf','\x20\x20lovrabet\x20api\x20doc\x20--output\x20<dir>\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定文档输出目录(默认:\x20./docs)','input','message','exit','doc','请使用\x20--appcode\x20参数,例如:','pull','13382616VRvtZc','join','\x20\x20错误:\x20','3065384smEgOB','\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','\x20\x20lovrabet\x20api\x20pull\x20--appcode\x20','1405683NquWax','appcode','\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文档','env','\x20\x20\x201.\x20配置默认值:\x20lovrabet\x20config\x20set\x20appcode\x20<app-code>','❌\x20错误:不再支持位置参数方式','split','parse','1315408iWmFOt','\x20\x20\x202.\x20使用参数:\x20lovrabet\x20api\x20doc\x20--appcode\x20<app-code>','length','\x20\x20\x202.\x20使用参数:\x20lovrabet\x20api\x20pull\x20--appcode\x20<app-code>','\x1b[90m*\x20使用配置的应用AppCode:\x20','log','!\x20请使用以下方式之一:','\x20\x20lovrabet\x20api\x20doc\x20--env\x20<env>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定环境(如:\x20daily,\x20online)','19896mCtERJ','string','error','×\x20未配置\x20AppCode','datasetcode','trim','flags'];a8_0x3ab1=function(){return _0x357515;};return a8_0x3ab1();}(function(_0x46cf60,_0x1d0942){const _0x22ef1c=a8_0x345c,_0x526536=_0x46cf60();while(!![]){try{const _0x4b0e36=parseInt(_0x22ef1c(0x213))/0x1+-parseInt(_0x22ef1c(0x200))/0x2+-parseInt(_0x22ef1c(0x1f8))/0x3+-parseInt(_0x22ef1c(0x1f5))/0x4+-parseInt(_0x22ef1c(0x21a))/0x5*(parseInt(_0x22ef1c(0x208))/0x6)+parseInt(_0x22ef1c(0x21d))/0x7+parseInt(_0x22ef1c(0x225))/0x8;if(_0x4b0e36===_0x1d0942)break;else _0x526536['push'](_0x526536['shift']());}catch(_0xe226f2){_0x526536['push'](_0x526536['shift']());}}}(a8_0x3ab1,0x7be29));import{jsx as a8_0x5546fe}from'react/jsx-runtime';import{render}from'ink';import{ApiPullUI}from'./api-pull-ui.js';import{ApiDocUI}from'./api-doc-ui.js';function a8_0x345c(_0x4d6527,_0x1a0673){_0x4d6527=_0x4d6527-0x1f3;const _0x3ab1a9=a8_0x3ab1();let _0x345cc5=_0x3ab1a9[_0x4d6527];return _0x345cc5;}import{getConfigAppCode}from'../utils/config.js';export async function apiCli(_0x3e6409){const _0x57260c=a8_0x345c,_0x4eb2fb=_0x3e6409['input'][0x1];if(_0x3e6409[_0x57260c(0x20e)]['help']){console[_0x57260c(0x205)](_0x57260c(0x1f6));return;}if(_0x4eb2fb===_0x57260c(0x224)){_0x3e6409[_0x57260c(0x21f)][0x2]&&(console[_0x57260c(0x20a)](_0x57260c(0x1fd)),console[_0x57260c(0x205)](_0x57260c(0x223)),console[_0x57260c(0x205)](_0x57260c(0x1f7)+_0x3e6409[_0x57260c(0x21f)][0x2]),process[_0x57260c(0x221)](0x1));const _0x681891=getConfigAppCode();let _0x986bfa=_0x3e6409[_0x57260c(0x20e)][_0x57260c(0x1f9)];const _0x34955b=typeof _0x3e6409[_0x57260c(0x20e)][_0x57260c(0x1fb)]==='string'?_0x3e6409[_0x57260c(0x20e)][_0x57260c(0x1fb)]:undefined,_0x5f6c38=_0x3e6409[_0x57260c(0x20e)][_0x57260c(0x216)];!_0x986bfa&&!_0x681891&&(console['error'](_0x57260c(0x20b)),console[_0x57260c(0x205)]('!\x20请使用以下方式之一:'),console[_0x57260c(0x205)](_0x57260c(0x1fc)),console['log'](_0x57260c(0x203)),process['exit'](0x1)),_0x986bfa&&_0x681891&&_0x986bfa===_0x681891&&(console[_0x57260c(0x205)]('\x1b[90m*\x20使用配置的应用AppCode:\x20'+_0x986bfa+_0x57260c(0x214)),console['log'](_0x57260c(0x210)),_0x986bfa=undefined),render(a8_0x5546fe(ApiPullUI,{'appCode':_0x986bfa,'env':_0x34955b,'output':_0x5f6c38}));}else{if(_0x4eb2fb===_0x57260c(0x222)){_0x3e6409[_0x57260c(0x21f)][0x2]&&(console[_0x57260c(0x20a)]('❌\x20错误:不再支持位置参数方式'),console[_0x57260c(0x205)](_0x57260c(0x223)),console['log']('\x20\x20lovrabet\x20api\x20doc\x20--appcode\x20'+_0x3e6409[_0x57260c(0x21f)][0x2]),process[_0x57260c(0x221)](0x1));const _0x18ece9=getConfigAppCode();let _0x435a54=_0x3e6409[_0x57260c(0x20e)]['appcode'];const _0x525a0d=typeof _0x3e6409[_0x57260c(0x20e)]['env']===_0x57260c(0x209)?_0x3e6409[_0x57260c(0x20e)][_0x57260c(0x1fb)]:undefined,_0x2811cb=_0x3e6409[_0x57260c(0x20e)]['output'],_0x58f40a=_0x3e6409['flags'][_0x57260c(0x21b)],_0x2534ef=_0x3e6409[_0x57260c(0x20e)][_0x57260c(0x20c)];!_0x435a54&&!_0x18ece9&&(console[_0x57260c(0x20a)](_0x57260c(0x20b)),console[_0x57260c(0x205)](_0x57260c(0x206)),console[_0x57260c(0x205)](_0x57260c(0x1fc)),console[_0x57260c(0x205)](_0x57260c(0x201)),process[_0x57260c(0x221)](0x1));_0x435a54&&_0x18ece9&&_0x435a54===_0x18ece9&&(console['log'](_0x57260c(0x204)+_0x435a54+'\x1b[0m'),_0x435a54=undefined);let _0x1265f8;if(_0x58f40a)try{_0x1265f8=JSON[_0x57260c(0x1ff)](_0x58f40a),(typeof _0x1265f8!==_0x57260c(0x218)||_0x1265f8===null||Array[_0x57260c(0x215)](_0x1265f8))&&(console[_0x57260c(0x20a)]('×\x20--params\x20参数必须是一个有效的\x20JSON\x20对象'),process[_0x57260c(0x221)](0x1));}catch(_0x71fb8c){console[_0x57260c(0x20a)]('×\x20--params\x20参数不是有效的\x20JSON\x20格式'),console['error'](_0x57260c(0x1f4)+(_0x71fb8c instanceof Error?_0x71fb8c[_0x57260c(0x220)]:String(_0x71fb8c))),process[_0x57260c(0x221)](0x1);}let _0x3b1c78;_0x2534ef&&(_0x3b1c78=_0x2534ef[_0x57260c(0x1fe)](',')['map'](_0x330138=>_0x330138[_0x57260c(0x20d)]())['filter'](_0x2936c0=>_0x2936c0[_0x57260c(0x202)]>0x0),_0x3b1c78[_0x57260c(0x202)]===0x0&&(console[_0x57260c(0x20a)](_0x57260c(0x20f)),process['exit'](0x1)),console[_0x57260c(0x205)](_0x57260c(0x212)+_0x3b1c78[_0x57260c(0x1f3)](',\x20')+_0x57260c(0x214))),render(a8_0x5546fe(ApiDocUI,{'appCode':_0x435a54,'env':_0x525a0d,'output':_0x2811cb,'extraParams':_0x1265f8,'datasetCodes':_0x3b1c78}));}else console[_0x57260c(0x20a)]('Unknown\x20api\x20command:\x20'+_0x4eb2fb),console['log'](_0x57260c(0x21c)),console['log']('\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配置文件'),console['log'](_0x57260c(0x219)),console[_0x57260c(0x205)]('\x20\x20lovrabet\x20api\x20pull\x20--output\x20<dir>\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定输出目录(默认:\x20./src/api/)'),console['log'](_0x57260c(0x217)),console[_0x57260c(0x205)](''),console[_0x57260c(0x205)](_0x57260c(0x1fa)),console['log'](_0x57260c(0x211)),console[_0x57260c(0x205)](_0x57260c(0x21e)),console[_0x57260c(0x205)](_0x57260c(0x207)),process[_0x57260c(0x221)](0x1);}}
@@ -1 +1 @@
1
- (function(_0x1ffce3,_0xa623b7){const _0xd8324d=a9_0x1203,_0x260e5a=_0x1ffce3();while(!![]){try{const _0x6c787d=-parseInt(_0xd8324d(0xf5))/0x1+parseInt(_0xd8324d(0xf1))/0x2*(parseInt(_0xd8324d(0xe8))/0x3)+-parseInt(_0xd8324d(0xe6))/0x4*(parseInt(_0xd8324d(0xea))/0x5)+-parseInt(_0xd8324d(0xf8))/0x6*(-parseInt(_0xd8324d(0xe4))/0x7)+parseInt(_0xd8324d(0xe3))/0x8*(parseInt(_0xd8324d(0x101))/0x9)+parseInt(_0xd8324d(0xfd))/0xa*(-parseInt(_0xd8324d(0xe5))/0xb)+parseInt(_0xd8324d(0xf0))/0xc;if(_0x6c787d===_0xa623b7)break;else _0x260e5a['push'](_0x260e5a['shift']());}catch(_0x1561c1){_0x260e5a['push'](_0x260e5a['shift']());}}}(a9_0x1322,0x44294));function a9_0x1203(_0x39a252,_0x46f8c0){_0x39a252=_0x39a252-0xe1;const _0x132214=a9_0x1322();let _0x120368=_0x132214[_0x39a252];return _0x120368;}import{readConfig}from'../utils/config.js';import{initEnv}from'../constant/env.js';import{generateApiFile}from'./generate-api-file.js';function a9_0x1322(){const _0x3dee84=['test','√\x20成功拉取\x20','API\x20配置拉取成功:\x20','80lpxnUI','modelCount','\x20个数据集,生成\x20','string','45NSiVCv','message','*\x20正在处理\x20','621480hwwOlc','1685474uOFXNb','472318VNwGpp','12drsesn','\x20个模型','159UnfyUP','length','907505AzyAPT','cwd','log','-api','create-api-pull','.ts\x20-\x20客户端实例文件','5857908KATqZs','15716lwuETj','\x20\x20\x20•\x20','*\x20正在从服务器拉取\x20API\x20配置...\x20(环境:\x20','env','366645lcvJSJ','info','chdir','6EePXgi','error'];a9_0x1322=function(){return _0x3dee84;};return a9_0x1322();}import{logger}from'../utils/logger.js';import{fetchModelList}from'./fetch-model-list.js';export async function pullApiSilent(_0x4b107b,_0x14f645,_0x5e03f0,_0x1e4bc1){const _0x142a35=a9_0x1203;let _0x29ea27;try{const _0x362738=_0x14f645?.['trim']()||'';if(_0x362738){const _0x4f63b6=/^[a-zA-Z][a-zA-Z0-9_-]*$/;if(!_0x4f63b6[_0x142a35(0xfa)](_0x362738))return console[_0x142a35(0xf9)]('×\x20文件前缀格式不正确。只能包含字母、数字、连字符和下划线,且必须以字母开头。'),![];}_0x5e03f0&&(_0x29ea27=process[_0x142a35(0xeb)](),process[_0x142a35(0xf7)](_0x5e03f0));const _0x155c37=readConfig(),_0x1f45f6=typeof _0x155c37['env']===_0x142a35(0x100)?_0x155c37[_0x142a35(0xf4)]:undefined,_0x40ff17=_0x1e4bc1||_0x1f45f6||'online';initEnv(_0x40ff17),console['log'](_0x142a35(0xf3)+_0x40ff17+')');const {configArray:_0x2b5098}=await fetchModelList(_0x4b107b),_0x55fa1c=_0x362738?_0x362738+_0x142a35(0xed):'api',_0x29c3cb=_0x362738?_0x362738+'-client':'client';console['log']('*\x20开始生成\x20API\x20配置文件:'),console['log'](_0x142a35(0xf2)+_0x55fa1c+'.ts\x20-\x20模型配置文件'),console[_0x142a35(0xec)](_0x142a35(0xf2)+_0x29c3cb+_0x142a35(0xef)),console[_0x142a35(0xec)](_0x142a35(0xe2)+_0x2b5098[_0x142a35(0xe9)]+'\x20个数据集...');const _0x540f8e=await generateApiFile(_0x2b5098,_0x362738,_0x4b107b,!![],_0x40ff17);return console[_0x142a35(0xec)](_0x142a35(0xfb)+_0x2b5098[_0x142a35(0xe9)]+_0x142a35(0xff)+_0x540f8e[_0x142a35(0xfe)]+_0x142a35(0xe7)),_0x5e03f0&&logger[_0x142a35(0xf6)](_0x142a35(0xee),_0x142a35(0xfc)+_0x4b107b,{'projectPath':_0x5e03f0,'appCode':_0x4b107b,'datasetCount':_0x2b5098[_0x142a35(0xe9)],'filePrefix':_0x362738}),!![];}catch(_0x3e501d){const _0x155a7e=_0x3e501d instanceof Error?_0x3e501d[_0x142a35(0xe1)]:String(_0x3e501d);return console[_0x142a35(0xf9)]('×\x20API\x20配置拉取异常:',_0x155a7e),_0x5e03f0&&logger[_0x142a35(0xf9)]('create-api-pull','API\x20配置拉取异常:\x20'+_0x155a7e,{'appCode':_0x4b107b,'projectPath':_0x5e03f0}),![];}finally{_0x29ea27&&process[_0x142a35(0xf7)](_0x29ea27);}}
1
+ (function(_0x374443,_0x31c8fd){const _0x581490=a9_0x5788,_0x4b5469=_0x374443();while(!![]){try{const _0x5544a2=-parseInt(_0x581490(0xb4))/0x1+parseInt(_0x581490(0xc0))/0x2*(parseInt(_0x581490(0xa5))/0x3)+-parseInt(_0x581490(0xc8))/0x4+parseInt(_0x581490(0xc2))/0x5*(parseInt(_0x581490(0xaf))/0x6)+-parseInt(_0x581490(0xac))/0x7+parseInt(_0x581490(0xb9))/0x8+parseInt(_0x581490(0xba))/0x9*(parseInt(_0x581490(0xa8))/0xa);if(_0x5544a2===_0x31c8fd)break;else _0x4b5469['push'](_0x4b5469['shift']());}catch(_0x1d3c79){_0x4b5469['push'](_0x4b5469['shift']());}}}(a9_0x45ed,0x45e69));import{readConfig}from'../utils/config.js';function a9_0x5788(_0xe654e7,_0x194366){_0xe654e7=_0xe654e7-0xa5;const _0x45ed6d=a9_0x45ed();let _0x5788af=_0x45ed6d[_0xe654e7];return _0x5788af;}import{initEnv}from'../constant/env.js';import{generateApiFile}from'./generate-api-file.js';function a9_0x45ed(){const _0x526d8f=['\x20个模型','test','5820yKGrlo','\x20\x20\x20•\x20','×\x20文件前缀格式不正确。只能包含字母、数字、连字符和下划线,且必须以字母开头。','error','create-api-pull','218960NzCLRI','trim','client','√\x20成功拉取\x20','*\x20正在从服务器拉取\x20API\x20配置...\x20(环境:\x20','980584fXuYJo','333TImrbD','chdir','×\x20API\x20配置拉取异常:','\x20个数据集,生成\x20','-client','API\x20配置拉取异常:\x20','212YVdFbK','API\x20配置拉取成功:\x20','905lWIdDj','string','*\x20正在处理\x20','online','length','.ts\x20-\x20模型配置文件','1983304CdXPzy','3141gdeFQg','log','\x20个数据集...','193210aYQRpw','api','message','*\x20开始生成\x20API\x20配置文件:','860321iHJRPP'];a9_0x45ed=function(){return _0x526d8f;};return a9_0x45ed();}import{logger}from'../utils/logger.js';import{fetchModelList}from'./fetch-model-list.js';export async function pullApiSilent(_0x1554d5,_0x373019,_0x5b694d,_0x232b5b){const _0xfac3ba=a9_0x5788;let _0x37db68;try{const _0x72c409=_0x373019?.[_0xfac3ba(0xb5)]()||'';if(_0x72c409){const _0x137251=/^[a-zA-Z][a-zA-Z0-9_-]*$/;if(!_0x137251[_0xfac3ba(0xae)](_0x72c409))return console[_0xfac3ba(0xb2)](_0xfac3ba(0xb1)),![];}_0x5b694d&&(_0x37db68=process['cwd'](),process[_0xfac3ba(0xbb)](_0x5b694d));const _0xa71868=readConfig(),_0x5b0e40=typeof _0xa71868['env']===_0xfac3ba(0xc3)?_0xa71868['env']:undefined,_0x365e1a=_0x232b5b||_0x5b0e40||_0xfac3ba(0xc5);initEnv(_0x365e1a),console[_0xfac3ba(0xa6)](_0xfac3ba(0xb8)+_0x365e1a+')');const {configArray:_0x26e128}=await fetchModelList(_0x1554d5),_0x3e884b=_0x72c409?_0x72c409+'-api':_0xfac3ba(0xa9),_0x589435=_0x72c409?_0x72c409+_0xfac3ba(0xbe):_0xfac3ba(0xb6);console[_0xfac3ba(0xa6)](_0xfac3ba(0xab)),console[_0xfac3ba(0xa6)](_0xfac3ba(0xb0)+_0x3e884b+_0xfac3ba(0xc7)),console['log'](_0xfac3ba(0xb0)+_0x589435+'.ts\x20-\x20客户端实例文件'),console[_0xfac3ba(0xa6)](_0xfac3ba(0xc4)+_0x26e128[_0xfac3ba(0xc6)]+_0xfac3ba(0xa7));const _0x23be69=await generateApiFile(_0x26e128,_0x72c409,_0x1554d5,!![],_0x365e1a);return console[_0xfac3ba(0xa6)](_0xfac3ba(0xb7)+_0x26e128['length']+_0xfac3ba(0xbd)+_0x23be69['modelCount']+_0xfac3ba(0xad)),_0x5b694d&&logger['info'](_0xfac3ba(0xb3),_0xfac3ba(0xc1)+_0x1554d5,{'projectPath':_0x5b694d,'appCode':_0x1554d5,'datasetCount':_0x26e128[_0xfac3ba(0xc6)],'filePrefix':_0x72c409}),!![];}catch(_0x2472a0){const _0x1d6f9a=_0x2472a0 instanceof Error?_0x2472a0[_0xfac3ba(0xaa)]:String(_0x2472a0);return console['error'](_0xfac3ba(0xbc),_0x1d6f9a),_0x5b694d&&logger['error']('create-api-pull',_0xfac3ba(0xbf)+_0x1d6f9a,{'appCode':_0x1554d5,'projectPath':_0x5b694d}),![];}finally{_0x37db68&&process['chdir'](_0x37db68);}}
@@ -1 +1 @@
1
- (function(_0x29a90e,_0x5a3877){const _0x4bd69d=a10_0x5771,_0x55da70=_0x29a90e();while(!![]){try{const _0x296622=-parseInt(_0x4bd69d(0x19d))/0x1+-parseInt(_0x4bd69d(0x1a3))/0x2+parseInt(_0x4bd69d(0x1ab))/0x3+-parseInt(_0x4bd69d(0x1b2))/0x4+-parseInt(_0x4bd69d(0x1c8))/0x5*(parseInt(_0x4bd69d(0x1bf))/0x6)+parseInt(_0x4bd69d(0x1d3))/0x7*(-parseInt(_0x4bd69d(0x195))/0x8)+parseInt(_0x4bd69d(0x1ce))/0x9;if(_0x296622===_0x5a3877)break;else _0x55da70['push'](_0x55da70['shift']());}catch(_0x2821cb){_0x55da70['push'](_0x55da70['shift']());}}}(a10_0x403b,0x43914));function a10_0x5771(_0x3d3cd3,_0x2c8ce2){_0x3d3cd3=_0x3d3cd3-0x192;const _0x403bbc=a10_0x403b();let _0x577155=_0x403bbc[_0x3d3cd3];return _0x577155;}import{jsx as a10_0x1f2b80,jsxs as a10_0x102799,Fragment as a10_0x33bb7e}from'react/jsx-runtime';import{Text,Box,useInput,useApp,render}from'ink';import{useEffect,useState}from'react';import a10_0x4bbdd3 from'ink-spinner';import{useGetOnlineMenuList}from'./use-get-online-menu-list.js';import{getLocalPages}from'./get-local-pages.js';function a10_0x403b(){const _0x8315cb=['label','117534ACFbIq','提示:使用\x20','[\x20]','\x20正在获取线上菜单列表...','*\x20请选择要同步的菜单:','JS\x20链接无法访问','394144SSAuQn','\x20←\x20','请输入有效的\x20CSS\x20https\x20链接','downArrow','catch','Lovrabet平台','map','size','1202190yAmrLX','selecting','join','column','JS\x20链接','\x20输入项目的\x20JS\x20资源链接(https://...)','repeat','1919088oEfSPj','input-css','input-js','创建菜单失败','red','slice','max','\x20命令重新登录','backspace','trim','yellow','*\x20同步菜单到\x20Lovrabet\x20平台','√\x20菜单创建完成','4680XJFQtF','local','done','add','菜单名称','online','filter','creating','lovrabet\x20auth','2410cGDCIV','return','*\x20正在创建菜单...','dots','cyan','↑/↓:\x20移动光标\x20空格:\x20切换选中\x20a:\x20全选\x20i/r:\x20反选\x20Enter:\x20确认','10850130oTSWIw','delete','white','message','CSS\x20链接无法访问','322YkenLy','length','value','已选择菜单','includes','27688mmeOtr','请输入有效的\x20JS\x20https\x20链接','\x20输入项目的\x20CSS\x20资源链接(https://...)','green','gray','path','has'];a10_0x403b=function(){return _0x8315cb;};return a10_0x403b();}import{createMenus}from'./create-menu.js';import{isUrlReachable,isValidCssHttpsUrl,isValidJsHttpsUrl}from'./valid-url.js';import.meta.main&&render(a10_0x1f2b80(AppMenuSyncUI,{}));export function AppMenuSyncUI(){const _0x39487c=a10_0x5771,{exit:_0x36a55a}=useApp(),{loading:_0x4e4a45,menuList:_0x3a3b67,error:_0x34b42c}=useGetOnlineMenuList(),_0x3f0619=getLocalPages(),_0x4b960b=_0x3a3b67[_0x39487c(0x1a9)](_0x2f6205=>_0x2f6205[_0x39487c(0x19a)]),_0x42c47d=[_0x39487c(0x1c3),..._0x3f0619[_0x39487c(0x1a9)](_0x3e6531=>_0x3e6531[_0x39487c(0x19c)])],_0x2fa6ab=getStringWidth(getMaxWidth(_0x42c47d,0x4)),_0x480ce1=getStringWidth(getMaxWidth([_0x39487c(0x1c3)])),[_0x569f1a,_0xf127e0]=useState(_0x39487c(0x1ac)),[_0x2afef8,_0x5b9c84]=useState(new Set()),[_0x4b867c,_0x5e1a7d]=useState(0x0),[_0x465bfd,_0x2c2202]=useState(''),[_0x353776,_0x1b4ea0]=useState(''),[_0x3f3e3b,_0x578476]=useState(''),[_0x3391a2,_0x5590cf]=useState(''),[_0x471337,_0x56ab56]=useState([]),_0x324375=_0x3f0619[_0x39487c(0x1a9)](_0x2741d4=>({'label':_0x2741d4[_0x39487c(0x19c)],'path':_0x2741d4[_0x39487c(0x19a)],'local':!![],'online':_0x4b960b[_0x39487c(0x194)](_0x2741d4['path'])})),_0x213110=_0x3f0619[_0x39487c(0x1c5)](_0x452588=>{const _0x4b9086=_0x39487c;return!_0x4b960b[_0x4b9086(0x194)](_0x452588['path']);});useEffect(()=>{const _0x27dcdc=_0x39487c;if(!_0x4e4a45&&_0x3f0619[_0x27dcdc(0x1d4)]>0x0&&_0x2afef8[_0x27dcdc(0x1aa)]===0x0){const _0x9b62a8=new Set(_0x3f0619[_0x27dcdc(0x1a9)]((_0x3f4ed3,_0x1f13bf)=>({'page':_0x3f4ed3,'index':_0x1f13bf}))[_0x27dcdc(0x1c5)](({page:_0x56356e})=>!_0x4b960b[_0x27dcdc(0x194)](_0x56356e[_0x27dcdc(0x19a)]))[_0x27dcdc(0x1a9)](({index:_0x32e9c9})=>_0x32e9c9));_0x5b9c84(_0x9b62a8);}},[_0x4e4a45,_0x3f0619[_0x39487c(0x1d4)],_0x4b960b[_0x39487c(0x1d4)]]),useInput(async(_0x11353b,_0x6c84f0)=>{const _0xb3dd6f=_0x39487c;if(_0x569f1a==='selecting'){if(_0x6c84f0['upArrow']){_0x5e1a7d(_0x107505=>_0x107505>0x0?_0x107505-0x1:_0x3f0619[_0xb3dd6f(0x1d4)]-0x1);return;}if(_0x6c84f0[_0xb3dd6f(0x1a6)]){_0x5e1a7d(_0x5df9c3=>_0x5df9c3<_0x3f0619['length']-0x1?_0x5df9c3+0x1:0x0);return;}if(_0x11353b==='\x20'){_0x5b9c84(_0x44947a=>{const _0x3d062b=_0xb3dd6f,_0x3d335f=new Set(_0x44947a);return _0x3d335f[_0x3d062b(0x19b)](_0x4b867c)?_0x3d335f[_0x3d062b(0x1cf)](_0x4b867c):_0x3d335f[_0x3d062b(0x1c2)](_0x4b867c),_0x3d335f;});return;}if(_0x11353b==='a'||_0x11353b==='A'){const _0x2f9422=new Set(_0x3f0619[_0xb3dd6f(0x1a9)]((_0x598996,_0x377366)=>_0x377366));_0x5b9c84(_0x2f9422);return;}if(_0x11353b==='i'||_0x11353b==='I'||_0x11353b==='r'||_0x11353b==='R'){_0x5b9c84(_0x3d85d2=>{const _0x8a81b3=_0xb3dd6f,_0x12a306=new Set();for(let _0x92a961=0x0;_0x92a961<_0x3f0619['length'];_0x92a961++){!_0x3d85d2[_0x8a81b3(0x19b)](_0x92a961)&&_0x12a306[_0x8a81b3(0x1c2)](_0x92a961);}return _0x12a306;});return;}if(_0x11353b==='q'||_0x11353b==='Q'){_0x36a55a();return;}if(_0x6c84f0[_0xb3dd6f(0x1c9)]){if(_0x2afef8[_0xb3dd6f(0x1aa)]===0x0){_0x5590cf('请至少选择一个菜单');return;}const _0x3c3bbf=_0x3f0619[_0xb3dd6f(0x1c5)]((_0x45e76f,_0x8c1a30)=>_0x2afef8[_0xb3dd6f(0x19b)](_0x8c1a30)),_0x58d765=_0x3c3bbf[_0xb3dd6f(0x1a9)](_0x9b7a32=>_0x9b7a32[_0xb3dd6f(0x19c)])[_0xb3dd6f(0x1ad)](',\x20');_0x56ab56([{'label':_0xb3dd6f(0x193),'value':_0x2afef8[_0xb3dd6f(0x1aa)]+'\x20个'}]),_0x5590cf(''),_0xf127e0('input-js');return;}return;}if(_0x569f1a===_0xb3dd6f(0x1b4)){if(_0x6c84f0['return']){const _0x29d6e3=_0x3f3e3b[_0xb3dd6f(0x1bb)]();if(_0x29d6e3==='')return;if(!isValidJsHttpsUrl(_0x29d6e3)){_0x5590cf(_0xb3dd6f(0x196));return;}if(!await isUrlReachable(_0x29d6e3)){_0x5590cf(_0xb3dd6f(0x1a2));return;}_0x2c2202(_0x29d6e3),_0x56ab56(_0x30dd08=>[..._0x30dd08,{'label':_0xb3dd6f(0x1af),'value':_0x29d6e3}]),_0x578476(''),_0x5590cf(''),_0xf127e0(_0xb3dd6f(0x1b3));return;}if(_0x6c84f0[_0xb3dd6f(0x1ba)]||_0x6c84f0[_0xb3dd6f(0x1cf)]){_0x578476(_0x2b79c6=>_0x2b79c6[_0xb3dd6f(0x1b7)](0x0,-0x1)),_0x5590cf('');return;}_0x578476(_0x1b0af7=>_0x1b0af7+_0x11353b);return;}if(_0x569f1a==='input-css'){if(_0x6c84f0[_0xb3dd6f(0x1c9)]){const _0x44f733=_0x3f3e3b[_0xb3dd6f(0x1bb)]();if(_0x44f733==='')return;if(!isValidCssHttpsUrl(_0x44f733)){_0x5590cf(_0xb3dd6f(0x1a5));return;}if(!await isUrlReachable(_0x44f733)){_0x5590cf(_0xb3dd6f(0x1d2));return;}_0x1b4ea0(_0x44f733),_0x56ab56(_0x3d3e25=>[..._0x3d3e25,{'label':'CSS\x20链接','value':_0x44f733}]),_0x578476(''),_0x5590cf(''),_0xf127e0(_0xb3dd6f(0x1c6));const _0x5cd4b0=_0x3f0619[_0xb3dd6f(0x1c5)]((_0x8288fb,_0x54dd1c)=>_0x2afef8[_0xb3dd6f(0x19b)](_0x54dd1c));createMenus(_0x5cd4b0,[_0x465bfd,_0x44f733])['then'](()=>{const _0x165f03=_0xb3dd6f;_0xf127e0(_0x165f03(0x1c1)),setTimeout(()=>{_0x36a55a();},0x3e8);})[_0xb3dd6f(0x1a7)](_0x19b2b8=>{const _0x533214=_0xb3dd6f;_0x5590cf(_0x19b2b8[_0x533214(0x1d1)]||_0x533214(0x1b5)),_0xf127e0(_0x533214(0x1ac));});return;}if(_0x6c84f0['backspace']||_0x6c84f0[_0xb3dd6f(0x1cf)]){_0x578476(_0x3cda71=>_0x3cda71['slice'](0x0,-0x1)),_0x5590cf('');return;}_0x578476(_0x65994b=>_0x65994b+_0x11353b);return;}});if(_0x4e4a45)return a10_0x102799(Box,{'marginTop':0x1,'marginBottom':0x1,'children':[a10_0x1f2b80(Text,{'children':'\x20\x20'}),a10_0x1f2b80(a10_0x4bbdd3,{'type':_0x39487c(0x1cb)}),a10_0x1f2b80(Text,{'children':_0x39487c(0x1a0)})]});if(_0x34b42c)return a10_0x102799(Box,{'flexDirection':'column','marginTop':0x1,'marginBottom':0x1,'children':[a10_0x102799(Text,{'color':_0x39487c(0x1b6),'children':['✗\x20',_0x34b42c]}),a10_0x102799(Box,{'marginTop':0x1,'children':[a10_0x1f2b80(Text,{'color':_0x39487c(0x199),'children':_0x39487c(0x19e)}),a10_0x1f2b80(Text,{'color':_0x39487c(0x1cc),'children':_0x39487c(0x1c7)}),a10_0x1f2b80(Text,{'color':_0x39487c(0x199),'children':_0x39487c(0x1b9)})]})]});if(_0x3f0619[_0x39487c(0x1d4)]===0x0)return a10_0x1f2b80(Box,{'marginTop':0x1,'marginBottom':0x1,'children':a10_0x1f2b80(Text,{'color':_0x39487c(0x1bc),'children':'!\x20未找到本地页面,请先创建页面'})});return a10_0x102799(Box,{'flexDirection':_0x39487c(0x1ae),'marginTop':0x1,'marginBottom':0x1,'children':[_0x569f1a==='selecting'&&a10_0x102799(a10_0x33bb7e,{'children':[a10_0x102799(Box,{'children':[a10_0x102799(Text,{'bold':!![],'children':['\x20\x20','菜单名称',getRemainingSpaces(_0x2fa6ab,_0x39487c(0x1c3))]}),a10_0x102799(Text,{'bold':!![],'children':['本地',getRemainingSpaces(_0x480ce1,_0x39487c(0x1c3))]}),a10_0x102799(Text,{'bold':!![],'children':[_0x39487c(0x1a8),getRemainingSpaces(_0x480ce1,_0x39487c(0x1c3))]})]}),_0x324375['map'](_0x2b30ed=>a10_0x102799(Box,{'children':[a10_0x102799(Text,{'children':['\x20\x20',_0x2b30ed[_0x39487c(0x19c)],getRemainingSpaces(_0x2fa6ab,_0x2b30ed[_0x39487c(0x19c)])]}),a10_0x102799(Text,{'color':_0x39487c(0x198),'children':[_0x2b30ed[_0x39487c(0x1c0)]?'✓':'✗',getRemainingSpaces(_0x480ce1,'✓')]}),a10_0x102799(Text,{'color':_0x2b30ed['online']?_0x39487c(0x198):_0x39487c(0x1b6),'children':[_0x2b30ed[_0x39487c(0x1c4)]?'✓':'✗',getRemainingSpaces(_0x480ce1,'✓')]})]},_0x2b30ed[_0x39487c(0x19a)]))]}),_0x569f1a===_0x39487c(0x1ac)&&_0x471337[_0x39487c(0x1d4)]===0x0&&a10_0x1f2b80(Box,{'marginTop':0x1,'children':a10_0x1f2b80(Text,{'color':_0x39487c(0x1cc),'children':_0x39487c(0x1bd)})}),_0x471337[_0x39487c(0x1a9)]((_0x1cfda6,_0x4286ff)=>a10_0x102799(Box,{'children':[a10_0x102799(Text,{'color':_0x39487c(0x198),'children':['√\x20',_0x1cfda6[_0x39487c(0x19c)],':\x20']}),a10_0x1f2b80(Text,{'color':'cyan','children':_0x1cfda6[_0x39487c(0x192)]})]},_0x4286ff)),_0x3391a2&&_0x569f1a===_0x39487c(0x1ac)&&a10_0x1f2b80(Box,{'marginTop':0x1,'children':a10_0x102799(Text,{'color':'red','children':['✗\x20',_0x3391a2]})}),_0x569f1a===_0x39487c(0x1ac)&&a10_0x1f2b80(a10_0x33bb7e,{'children':a10_0x102799(Box,{'marginTop':_0x471337['length']>0x0||_0x3391a2?0x1:0x0,'flexDirection':_0x39487c(0x1ae),'children':[a10_0x1f2b80(Text,{'bold':!![],'children':_0x39487c(0x1a1)}),_0x3f0619['map']((_0x349830,_0x341fa2)=>{const _0x2ec9ed=_0x39487c,_0x492aef=_0x4b867c===_0x341fa2,_0x4a145b=_0x2afef8['has'](_0x341fa2),_0x139059=_0x4b960b['includes'](_0x349830[_0x2ec9ed(0x19a)]),_0x45cf7f=_0x139059?'更新':'新建';return a10_0x1f2b80(Box,{'children':a10_0x102799(Text,{'backgroundColor':_0x492aef?'blue':undefined,'color':_0x492aef?_0x2ec9ed(0x1d0):undefined,'children':['\x20\x20',_0x4a145b?'[✓]':_0x2ec9ed(0x19f),'\x20',_0x349830['label']]})},_0x349830[_0x2ec9ed(0x19a)]);}),a10_0x1f2b80(Box,{'marginTop':0x1,'children':a10_0x102799(Text,{'color':'gray','children':['\x20',_0x39487c(0x1cd)]})})]})}),_0x569f1a===_0x39487c(0x1b4)&&a10_0x102799(a10_0x33bb7e,{'children':[a10_0x102799(Box,{'children':[a10_0x1f2b80(Text,{'children':'*\x20JS\x20链接:\x20'}),a10_0x1f2b80(Text,{'color':_0x39487c(0x198),'children':_0x3f3e3b}),_0x3391a2&&a10_0x102799(Text,{'color':_0x39487c(0x1b6),'children':[_0x39487c(0x1a4),_0x3391a2]})]}),!_0x3391a2&&a10_0x1f2b80(Box,{'children':a10_0x1f2b80(Text,{'color':_0x39487c(0x199),'children':_0x39487c(0x1b0)})})]}),_0x569f1a===_0x39487c(0x1b3)&&a10_0x102799(a10_0x33bb7e,{'children':[a10_0x102799(Box,{'children':[a10_0x1f2b80(Text,{'children':'*\x20CSS\x20链接:\x20'}),a10_0x1f2b80(Text,{'color':_0x39487c(0x198),'children':_0x3f3e3b}),_0x3391a2&&a10_0x102799(Text,{'color':_0x39487c(0x1b6),'children':[_0x39487c(0x1a4),_0x3391a2]})]}),!_0x3391a2&&a10_0x1f2b80(Box,{'children':a10_0x1f2b80(Text,{'color':'gray','children':_0x39487c(0x197)})})]}),_0x569f1a==='creating'&&a10_0x1f2b80(Box,{'children':a10_0x1f2b80(Text,{'children':_0x39487c(0x1ca)})}),_0x569f1a===_0x39487c(0x1c1)&&a10_0x1f2b80(Box,{'children':a10_0x1f2b80(Text,{'color':_0x39487c(0x198),'children':_0x39487c(0x1be)})})]});}function getStringWidth(_0x1abd05){let _0x15202c=0x0;for(const _0x81cc96 of _0x1abd05){/[\u4e00-\u9fa5]/['test'](_0x81cc96)?_0x15202c+=0x2:_0x15202c+=0x1;}return _0x15202c;}function getRemainingSpaces(_0xd72b1e,_0x4e9589){const _0x75553d=a10_0x5771,_0x4c0122=getStringWidth(_0x4e9589);return Array(Math[_0x75553d(0x1b8)](0x0,_0xd72b1e-_0x4c0122))['fill']('\x20')[_0x75553d(0x1ad)]('');}function getMaxWidth(_0x538293,_0x799e8f=0x2){const _0x152626=a10_0x5771;let _0x52f2b4='',_0x3b5877=0x0;for(const _0x3001c1 of _0x538293){const _0x133605=getStringWidth(_0x3001c1);_0x133605>_0x3b5877&&(_0x3b5877=_0x133605,_0x52f2b4=_0x3001c1);}return _0x52f2b4+'\x20'[_0x152626(0x1b1)](_0x799e8f);}
1
+ (function(_0x4808cb,_0x1295b7){const _0xacb2aa=a10_0x420c,_0x4ec6d3=_0x4808cb();while(!![]){try{const _0xa9fd4b=-parseInt(_0xacb2aa(0x1c0))/0x1*(-parseInt(_0xacb2aa(0x1a2))/0x2)+-parseInt(_0xacb2aa(0x1d3))/0x3+-parseInt(_0xacb2aa(0x1c2))/0x4+-parseInt(_0xacb2aa(0x1a6))/0x5+-parseInt(_0xacb2aa(0x1b0))/0x6*(parseInt(_0xacb2aa(0x1a5))/0x7)+-parseInt(_0xacb2aa(0x1c6))/0x8+parseInt(_0xacb2aa(0x190))/0x9*(parseInt(_0xacb2aa(0x1c9))/0xa);if(_0xa9fd4b===_0x1295b7)break;else _0x4ec6d3['push'](_0x4ec6d3['shift']());}catch(_0x36e675){_0x4ec6d3['push'](_0x4ec6d3['shift']());}}}(a10_0x2b29,0x32402));import{jsx as a10_0x2f7dcb,jsxs as a10_0x486a7d,Fragment as a10_0x1f2354}from'react/jsx-runtime';import{Text,Box,useInput,useApp,render}from'ink';import{useEffect,useState}from'react';function a10_0x2b29(){const _0x10d549=['done','√\x20菜单创建完成','1053024OUBVkD','gray','请输入有效的\x20CSS\x20https\x20链接','online','has','JS\x20链接','yellow','filter','green','!\x20未找到本地页面,请先创建页面','blue','catch','white','菜单名称','↑/↓:\x20移动光标\x20空格:\x20切换选中\x20a:\x20全选\x20i/r:\x20反选\x20Enter:\x20确认','cyan','101jxuBJT','创建菜单失败','1300120GlRzJI','CSS\x20链接无法访问','\x20输入项目的\x20CSS\x20资源链接(https://...)','column','431136ZmHvVH','local','add','3980370cKLedu','map','input-css','creating','CSS\x20链接','trim','selecting','join','*\x20JS\x20链接:\x20','Lovrabet平台','648819hzMtdq','message','\x20←\x20','27vQKsvF','dots','delete','red','repeat','label','size','*\x20CSS\x20链接:\x20','backspace','length','\x20输入项目的\x20JS\x20资源链接(https://...)','return','slice','[\x20]','includes','lovrabet\x20auth','提示:使用\x20','JS\x20链接无法访问','482zNYTZI','max','path','14KfovAk','332115ioBIut','value','*\x20同步菜单到\x20Lovrabet\x20平台','已选择菜单','input-js','\x20命令重新登录','\x20正在获取线上菜单列表...','*\x20正在创建菜单...'];a10_0x2b29=function(){return _0x10d549;};return a10_0x2b29();}import a10_0x149c12 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_0x2f7dcb(AppMenuSyncUI,{}));export function AppMenuSyncUI(){const _0xd4fb52=a10_0x420c,{exit:_0x392dc2}=useApp(),{loading:_0x255666,menuList:_0x228db3,error:_0x355697}=useGetOnlineMenuList(),_0x3be18a=getLocalPages(),_0x51c903=_0x228db3[_0xd4fb52(0x1ca)](_0x3b8a7c=>_0x3b8a7c[_0xd4fb52(0x1a4)]),_0x33608b=[_0xd4fb52(0x1bd),..._0x3be18a[_0xd4fb52(0x1ca)](_0x3b87bc=>_0x3b87bc[_0xd4fb52(0x195)])],_0x1cc3de=getStringWidth(getMaxWidth(_0x33608b,0x4)),_0x46af6e=getStringWidth(getMaxWidth([_0xd4fb52(0x1bd)])),[_0x478c4f,_0x13746a]=useState(_0xd4fb52(0x1cf)),[_0xd256a2,_0x2c4947]=useState(new Set()),[_0x4732be,_0x4ac5e0]=useState(0x0),[_0xe9e4f5,_0x28bafe]=useState(''),[_0x84eb0b,_0x3a0e2d]=useState(''),[_0x27431e,_0x57595c]=useState(''),[_0x1f2e77,_0x8d6989]=useState(''),[_0x5ae4e9,_0x2a2c37]=useState([]),_0x2053ec=_0x3be18a[_0xd4fb52(0x1ca)](_0x46c0c2=>({'label':_0x46c0c2[_0xd4fb52(0x195)],'path':_0x46c0c2[_0xd4fb52(0x1a4)],'local':!![],'online':_0x51c903[_0xd4fb52(0x19e)](_0x46c0c2[_0xd4fb52(0x1a4)])})),_0x5c1f5b=_0x3be18a[_0xd4fb52(0x1b7)](_0x23b948=>{const _0x41de67=_0xd4fb52;return!_0x51c903[_0x41de67(0x19e)](_0x23b948['path']);});useEffect(()=>{const _0xcf6b0=_0xd4fb52;if(!_0x255666&&_0x3be18a['length']>0x0&&_0xd256a2[_0xcf6b0(0x196)]===0x0){const _0x1fbf28=new Set(_0x3be18a[_0xcf6b0(0x1ca)]((_0x353135,_0x304127)=>({'page':_0x353135,'index':_0x304127}))[_0xcf6b0(0x1b7)](({page:_0x2af77e})=>!_0x51c903['includes'](_0x2af77e[_0xcf6b0(0x1a4)]))[_0xcf6b0(0x1ca)](({index:_0x1b5cd4})=>_0x1b5cd4));_0x2c4947(_0x1fbf28);}},[_0x255666,_0x3be18a[_0xd4fb52(0x199)],_0x51c903['length']]),useInput(async(_0x4f4b00,_0x1033fa)=>{const _0x16290a=_0xd4fb52;if(_0x478c4f==='selecting'){if(_0x1033fa['upArrow']){_0x4ac5e0(_0x201ef0=>_0x201ef0>0x0?_0x201ef0-0x1:_0x3be18a['length']-0x1);return;}if(_0x1033fa['downArrow']){_0x4ac5e0(_0x4774c4=>_0x4774c4<_0x3be18a['length']-0x1?_0x4774c4+0x1:0x0);return;}if(_0x4f4b00==='\x20'){_0x2c4947(_0x3aacff=>{const _0x556c47=a10_0x420c,_0x4f247c=new Set(_0x3aacff);return _0x4f247c['has'](_0x4732be)?_0x4f247c['delete'](_0x4732be):_0x4f247c[_0x556c47(0x1c8)](_0x4732be),_0x4f247c;});return;}if(_0x4f4b00==='a'||_0x4f4b00==='A'){const _0x2d61a8=new Set(_0x3be18a['map']((_0x3afd9a,_0x16f8c0)=>_0x16f8c0));_0x2c4947(_0x2d61a8);return;}if(_0x4f4b00==='i'||_0x4f4b00==='I'||_0x4f4b00==='r'||_0x4f4b00==='R'){_0x2c4947(_0x1a62d7=>{const _0x2df8d0=a10_0x420c,_0xbfe952=new Set();for(let _0x211cf8=0x0;_0x211cf8<_0x3be18a[_0x2df8d0(0x199)];_0x211cf8++){!_0x1a62d7[_0x2df8d0(0x1b4)](_0x211cf8)&&_0xbfe952[_0x2df8d0(0x1c8)](_0x211cf8);}return _0xbfe952;});return;}if(_0x4f4b00==='q'||_0x4f4b00==='Q'){_0x392dc2();return;}if(_0x1033fa[_0x16290a(0x19b)]){if(_0xd256a2[_0x16290a(0x196)]===0x0){_0x8d6989('请至少选择一个菜单');return;}const _0x4b3e24=_0x3be18a[_0x16290a(0x1b7)]((_0x26ceff,_0x55dcca)=>_0xd256a2[_0x16290a(0x1b4)](_0x55dcca)),_0x1e86c1=_0x4b3e24[_0x16290a(0x1ca)](_0x52bc11=>_0x52bc11[_0x16290a(0x195)])[_0x16290a(0x1d0)](',\x20');_0x2a2c37([{'label':_0x16290a(0x1a9),'value':_0xd256a2[_0x16290a(0x196)]+'\x20个'}]),_0x8d6989(''),_0x13746a('input-js');return;}return;}if(_0x478c4f==='input-js'){if(_0x1033fa['return']){const _0x20d007=_0x27431e[_0x16290a(0x1ce)]();if(_0x20d007==='')return;if(!isValidJsHttpsUrl(_0x20d007)){_0x8d6989('请输入有效的\x20JS\x20https\x20链接');return;}if(!await isUrlReachable(_0x20d007)){_0x8d6989(_0x16290a(0x1a1));return;}_0x28bafe(_0x20d007),_0x2a2c37(_0x36194c=>[..._0x36194c,{'label':_0x16290a(0x1b5),'value':_0x20d007}]),_0x57595c(''),_0x8d6989(''),_0x13746a(_0x16290a(0x1cb));return;}if(_0x1033fa['backspace']||_0x1033fa[_0x16290a(0x192)]){_0x57595c(_0x4d14e5=>_0x4d14e5[_0x16290a(0x19c)](0x0,-0x1)),_0x8d6989('');return;}_0x57595c(_0x212069=>_0x212069+_0x4f4b00);return;}if(_0x478c4f==='input-css'){if(_0x1033fa[_0x16290a(0x19b)]){const _0x20a597=_0x27431e[_0x16290a(0x1ce)]();if(_0x20a597==='')return;if(!isValidCssHttpsUrl(_0x20a597)){_0x8d6989(_0x16290a(0x1b2));return;}if(!await isUrlReachable(_0x20a597)){_0x8d6989(_0x16290a(0x1c3));return;}_0x3a0e2d(_0x20a597),_0x2a2c37(_0x1860c7=>[..._0x1860c7,{'label':_0x16290a(0x1cd),'value':_0x20a597}]),_0x57595c(''),_0x8d6989(''),_0x13746a(_0x16290a(0x1cc));const _0x424e48=_0x3be18a[_0x16290a(0x1b7)]((_0x39b952,_0x165857)=>_0xd256a2[_0x16290a(0x1b4)](_0x165857));createMenus(_0x424e48,[_0xe9e4f5,_0x20a597])['then'](()=>{const _0x111791=_0x16290a;_0x13746a(_0x111791(0x1ae)),setTimeout(()=>{_0x392dc2();},0x3e8);})[_0x16290a(0x1bb)](_0x3e369f=>{const _0x423546=_0x16290a;_0x8d6989(_0x3e369f[_0x423546(0x1d4)]||_0x423546(0x1c1)),_0x13746a(_0x423546(0x1cf));});return;}if(_0x1033fa[_0x16290a(0x198)]||_0x1033fa[_0x16290a(0x192)]){_0x57595c(_0x1ea289=>_0x1ea289[_0x16290a(0x19c)](0x0,-0x1)),_0x8d6989('');return;}_0x57595c(_0x492e40=>_0x492e40+_0x4f4b00);return;}});if(_0x255666)return a10_0x486a7d(Box,{'marginTop':0x1,'marginBottom':0x1,'children':[a10_0x2f7dcb(Text,{'children':'\x20\x20'}),a10_0x2f7dcb(a10_0x149c12,{'type':_0xd4fb52(0x191)}),a10_0x2f7dcb(Text,{'children':_0xd4fb52(0x1ac)})]});if(_0x355697)return a10_0x486a7d(Box,{'flexDirection':'column','marginTop':0x1,'marginBottom':0x1,'children':[a10_0x486a7d(Text,{'color':_0xd4fb52(0x193),'children':['✗\x20',_0x355697]}),a10_0x486a7d(Box,{'marginTop':0x1,'children':[a10_0x2f7dcb(Text,{'color':_0xd4fb52(0x1b1),'children':_0xd4fb52(0x1a0)}),a10_0x2f7dcb(Text,{'color':_0xd4fb52(0x1bf),'children':_0xd4fb52(0x19f)}),a10_0x2f7dcb(Text,{'color':_0xd4fb52(0x1b1),'children':_0xd4fb52(0x1ab)})]})]});if(_0x3be18a[_0xd4fb52(0x199)]===0x0)return a10_0x2f7dcb(Box,{'marginTop':0x1,'marginBottom':0x1,'children':a10_0x2f7dcb(Text,{'color':_0xd4fb52(0x1b6),'children':_0xd4fb52(0x1b9)})});return a10_0x486a7d(Box,{'flexDirection':_0xd4fb52(0x1c5),'marginTop':0x1,'marginBottom':0x1,'children':[_0x478c4f===_0xd4fb52(0x1cf)&&a10_0x486a7d(a10_0x1f2354,{'children':[a10_0x486a7d(Box,{'children':[a10_0x486a7d(Text,{'bold':!![],'children':['\x20\x20','菜单名称',getRemainingSpaces(_0x1cc3de,_0xd4fb52(0x1bd))]}),a10_0x486a7d(Text,{'bold':!![],'children':['本地',getRemainingSpaces(_0x46af6e,_0xd4fb52(0x1bd))]}),a10_0x486a7d(Text,{'bold':!![],'children':[_0xd4fb52(0x1d2),getRemainingSpaces(_0x46af6e,_0xd4fb52(0x1bd))]})]}),_0x2053ec[_0xd4fb52(0x1ca)](_0x6cff72=>a10_0x486a7d(Box,{'children':[a10_0x486a7d(Text,{'children':['\x20\x20',_0x6cff72[_0xd4fb52(0x195)],getRemainingSpaces(_0x1cc3de,_0x6cff72[_0xd4fb52(0x195)])]}),a10_0x486a7d(Text,{'color':_0xd4fb52(0x1b8),'children':[_0x6cff72[_0xd4fb52(0x1c7)]?'✓':'✗',getRemainingSpaces(_0x46af6e,'✓')]}),a10_0x486a7d(Text,{'color':_0x6cff72['online']?_0xd4fb52(0x1b8):_0xd4fb52(0x193),'children':[_0x6cff72[_0xd4fb52(0x1b3)]?'✓':'✗',getRemainingSpaces(_0x46af6e,'✓')]})]},_0x6cff72['path']))]}),_0x478c4f===_0xd4fb52(0x1cf)&&_0x5ae4e9['length']===0x0&&a10_0x2f7dcb(Box,{'marginTop':0x1,'children':a10_0x2f7dcb(Text,{'color':_0xd4fb52(0x1bf),'children':_0xd4fb52(0x1a8)})}),_0x5ae4e9[_0xd4fb52(0x1ca)]((_0x2a1516,_0x1f1b66)=>a10_0x486a7d(Box,{'children':[a10_0x486a7d(Text,{'color':'green','children':['√\x20',_0x2a1516[_0xd4fb52(0x195)],':\x20']}),a10_0x2f7dcb(Text,{'color':'cyan','children':_0x2a1516[_0xd4fb52(0x1a7)]})]},_0x1f1b66)),_0x1f2e77&&_0x478c4f===_0xd4fb52(0x1cf)&&a10_0x2f7dcb(Box,{'marginTop':0x1,'children':a10_0x486a7d(Text,{'color':_0xd4fb52(0x193),'children':['✗\x20',_0x1f2e77]})}),_0x478c4f==='selecting'&&a10_0x2f7dcb(a10_0x1f2354,{'children':a10_0x486a7d(Box,{'marginTop':_0x5ae4e9['length']>0x0||_0x1f2e77?0x1:0x0,'flexDirection':_0xd4fb52(0x1c5),'children':[a10_0x2f7dcb(Text,{'bold':!![],'children':'*\x20请选择要同步的菜单:'}),_0x3be18a[_0xd4fb52(0x1ca)]((_0x3bc08f,_0x38a4d5)=>{const _0x1c6381=_0xd4fb52,_0x2c04ad=_0x4732be===_0x38a4d5,_0x5f2aca=_0xd256a2[_0x1c6381(0x1b4)](_0x38a4d5),_0x1e3e20=_0x51c903['includes'](_0x3bc08f[_0x1c6381(0x1a4)]),_0x5c1c02=_0x1e3e20?'更新':'新建';return a10_0x2f7dcb(Box,{'children':a10_0x486a7d(Text,{'backgroundColor':_0x2c04ad?_0x1c6381(0x1ba):undefined,'color':_0x2c04ad?_0x1c6381(0x1bc):undefined,'children':['\x20\x20',_0x5f2aca?'[✓]':_0x1c6381(0x19d),'\x20',_0x3bc08f['label']]})},_0x3bc08f[_0x1c6381(0x1a4)]);}),a10_0x2f7dcb(Box,{'marginTop':0x1,'children':a10_0x486a7d(Text,{'color':_0xd4fb52(0x1b1),'children':['\x20',_0xd4fb52(0x1be)]})})]})}),_0x478c4f===_0xd4fb52(0x1aa)&&a10_0x486a7d(a10_0x1f2354,{'children':[a10_0x486a7d(Box,{'children':[a10_0x2f7dcb(Text,{'children':_0xd4fb52(0x1d1)}),a10_0x2f7dcb(Text,{'color':_0xd4fb52(0x1b8),'children':_0x27431e}),_0x1f2e77&&a10_0x486a7d(Text,{'color':_0xd4fb52(0x193),'children':[_0xd4fb52(0x18f),_0x1f2e77]})]}),!_0x1f2e77&&a10_0x2f7dcb(Box,{'children':a10_0x2f7dcb(Text,{'color':_0xd4fb52(0x1b1),'children':_0xd4fb52(0x19a)})})]}),_0x478c4f===_0xd4fb52(0x1cb)&&a10_0x486a7d(a10_0x1f2354,{'children':[a10_0x486a7d(Box,{'children':[a10_0x2f7dcb(Text,{'children':_0xd4fb52(0x197)}),a10_0x2f7dcb(Text,{'color':'green','children':_0x27431e}),_0x1f2e77&&a10_0x486a7d(Text,{'color':_0xd4fb52(0x193),'children':[_0xd4fb52(0x18f),_0x1f2e77]})]}),!_0x1f2e77&&a10_0x2f7dcb(Box,{'children':a10_0x2f7dcb(Text,{'color':'gray','children':_0xd4fb52(0x1c4)})})]}),_0x478c4f===_0xd4fb52(0x1cc)&&a10_0x2f7dcb(Box,{'children':a10_0x2f7dcb(Text,{'children':_0xd4fb52(0x1ad)})}),_0x478c4f==='done'&&a10_0x2f7dcb(Box,{'children':a10_0x2f7dcb(Text,{'color':'green','children':_0xd4fb52(0x1af)})})]});}function a10_0x420c(_0x11f4f5,_0x4418d7){_0x11f4f5=_0x11f4f5-0x18f;const _0x2b2999=a10_0x2b29();let _0x420ce5=_0x2b2999[_0x11f4f5];return _0x420ce5;}function getStringWidth(_0x31f7d7){let _0x2350d3=0x0;for(const _0x293aea of _0x31f7d7){/[\u4e00-\u9fa5]/['test'](_0x293aea)?_0x2350d3+=0x2:_0x2350d3+=0x1;}return _0x2350d3;}function getRemainingSpaces(_0x2aa1d0,_0x51f0c7){const _0x20ef85=a10_0x420c,_0x2b9b05=getStringWidth(_0x51f0c7);return Array(Math[_0x20ef85(0x1a3)](0x0,_0x2aa1d0-_0x2b9b05))['fill']('\x20')[_0x20ef85(0x1d0)]('');}function getMaxWidth(_0x44beea,_0x44b54a=0x2){const _0x3b8d0c=a10_0x420c;let _0x1819af='',_0x43c300=0x0;for(const _0x4198e8 of _0x44beea){const _0x269ea0=getStringWidth(_0x4198e8);_0x269ea0>_0x43c300&&(_0x43c300=_0x269ea0,_0x1819af=_0x4198e8);}return _0x1819af+'\x20'[_0x3b8d0c(0x194)](_0x44b54a);}