@lovrabet/cli 1.1.26-beta.4 → 1.1.26-beta.5

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 (58) 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-cdn-version/app-menu-sync-cdn-version-ui.js +1 -1
  19. package/lib/app-menu-cdn-version/cdn-url-compare-table.js +1 -1
  20. package/lib/app-menu-cdn-version/update-menu-cdn-url.js +1 -1
  21. package/lib/auth/auth-server-ui.js +1 -1
  22. package/lib/auth/auth-server.js +1 -1
  23. package/lib/auth/constant.js +1 -1
  24. package/lib/auth/get-cookie.js +1 -1
  25. package/lib/auth/is-session-valid.js +1 -1
  26. package/lib/auth/logout.js +1 -1
  27. package/lib/cli.js +1 -1
  28. package/lib/cmd/build-watch.js +1 -1
  29. package/lib/cmd/build.js +1 -1
  30. package/lib/cmd/logs.js +1 -1
  31. package/lib/cmd/preview.js +1 -1
  32. package/lib/cmd/start.js +1 -1
  33. package/lib/config/config-help.js +1 -1
  34. package/lib/config/main.js +1 -1
  35. package/lib/constant/domain.js +1 -1
  36. package/lib/constant/env.js +1 -1
  37. package/lib/create-app/enhanced-guided-create.js +1 -1
  38. package/lib/create-app/format-elapsed.js +1 -1
  39. package/lib/create-app/main.js +1 -1
  40. package/lib/create-app/task-finished.js +1 -1
  41. package/lib/create-app/task-loading.js +1 -1
  42. package/lib/create-app/task-running.js +1 -1
  43. package/lib/create-app/task-time.js +1 -1
  44. package/lib/create-app/use-copy-project-template.js +1 -1
  45. package/lib/create-app/use-format-code.js +1 -1
  46. package/lib/create-app/use-install-dependencies.js +1 -1
  47. package/lib/help.js +1 -1
  48. package/lib/init/main.js +1 -1
  49. package/lib/mcp/cursor.js +1 -1
  50. package/lib/mcp/main.js +1 -1
  51. package/lib/utils/config.js +1 -1
  52. package/lib/utils/copy-directory.js +1 -1
  53. package/lib/utils/http-client.js +1 -1
  54. package/lib/utils/logger.js +1 -1
  55. package/lib/utils/router-updater.js +1 -1
  56. package/lib/utils/sleep.js +1 -1
  57. package/lib/utils/template-replacer.js +1 -1
  58. package/package.json +1 -1
@@ -1 +1 @@
1
- (function(_0x4ca21c,_0xf5d083){const _0x313747=a0_0x5bc9,_0x308d70=_0x4ca21c();while(!![]){try{const _0x5753c9=parseInt(_0x313747(0x105))/0x1+parseInt(_0x313747(0x109))/0x2+parseInt(_0x313747(0x10a))/0x3*(-parseInt(_0x313747(0x106))/0x4)+-parseInt(_0x313747(0x10e))/0x5+-parseInt(_0x313747(0x103))/0x6*(parseInt(_0x313747(0xf6))/0x7)+-parseInt(_0x313747(0xff))/0x8*(parseInt(_0x313747(0xf5))/0x9)+parseInt(_0x313747(0xfe))/0xa*(parseInt(_0x313747(0x10d))/0xb);if(_0x5753c9===_0xf5d083)break;else _0x308d70['push'](_0x308d70['shift']());}catch(_0x23523d){_0x308d70['push'](_0x308d70['shift']());}}}(a0_0x5e99,0xc2c4f));import{jsx as a0_0x4895b0,jsxs as a0_0x554e8e}from'react/jsx-runtime';import{useState}from'react';function a0_0x5bc9(_0x229740,_0x546f11){const _0x5e9909=a0_0x5e99();return a0_0x5bc9=function(_0x5bc91a,_0x1ce9bb){_0x5bc91a=_0x5bc91a-0xf1;let _0x4464f5=_0x5e9909[_0x5bc91a];return _0x4464f5;},a0_0x5bc9(_0x229740,_0x546f11);}import{Text,Box,useInput}from'ink';import a0_0x2d2f67 from'node:fs';export function InputProjectCode(_0x3f3fe6){const _0x16b2eb=a0_0x5bc9,{onSubmit:_0x53c065,pagePath:_0x56bda5}=_0x3f3fe6,[_0x39ae9b,_0x52217f]=useState(''),[_0x2f5c8e,_0x5658d4]=useState(''),_0x4f4b84='my-page';function _0x4c6d84(_0x35e9f7){const _0x1d8255=a0_0x5bc9;if(_0x35e9f7[_0x1d8255(0x10c)]>0x64)return{'valid':![],'message':_0x1d8255(0xf7)};if(_0x35e9f7[_0x1d8255(0x10b)]('/')||_0x35e9f7['endsWith']('/'))return{'valid':![],'message':_0x1d8255(0xf4)};if(_0x35e9f7[_0x1d8255(0xf1)]('//'))return{'valid':![],'message':_0x1d8255(0xfa)};const _0x264a36=_0x35e9f7['split']('/');for(const _0x20220a of _0x264a36){if(!_0x20220a)continue;const _0x49cae3=/^[A-Za-z0-9][A-Za-z0-9_-]*$/;if(!_0x49cae3['test'](_0x20220a))return{'valid':![],'message':'路径中的每个段只能以字母或数字开头,且只包含字母、数字、-\x20和\x20_'};}return{'valid':!![]};}return useInput((_0x4a6806,_0x1071fd)=>{const _0x2b3de9=a0_0x5bc9;if(_0x1071fd[_0x2b3de9(0x102)]){const _0x4ffbd3=_0x39ae9b['trim']()||_0x4f4b84;if(_0x2f5c8e)return;const _0x22d94e=_0x56bda5+'/'+_0x4ffbd3;if(a0_0x2d2f67[_0x2b3de9(0x10f)](_0x22d94e)){_0x5658d4(_0x2b3de9(0xf9)+_0x4ffbd3+'\x20已存在,请使用其他路径');return;}_0x53c065(_0x4ffbd3),_0x52217f(''),_0x5658d4('');}else _0x1071fd[_0x2b3de9(0x100)]||_0x1071fd['delete']?_0x52217f(_0x1e9f81=>{const _0x2915c1=_0x2b3de9,_0x47bc93=_0x1e9f81[_0x2915c1(0xfd)](0x0,-0x1),{valid:_0x1b1cd1,message:_0x41c472}=_0x4c6d84(_0x47bc93);return _0x5658d4(_0x1b1cd1?'':_0x41c472||_0x2915c1(0xfc)),_0x47bc93;}):_0x52217f(_0x353a3f=>{const _0x127d4e=_0x2b3de9,_0x3f7d31=_0x353a3f+_0x4a6806,{valid:_0x32ac1d,message:_0x52c50a}=_0x4c6d84(_0x3f7d31);return _0x5658d4(_0x32ac1d?'':_0x52c50a||_0x127d4e(0xfc)),_0x3f7d31;});}),a0_0x554e8e(Box,{'flexDirection':_0x16b2eb(0x107),'children':[a0_0x554e8e(Box,{'children':[a0_0x4895b0(Text,{'color':'gray','children':_0x16b2eb(0x104)}),a0_0x4895b0(Text,{'children':_0x16b2eb(0xfb)}),_0x39ae9b?a0_0x4895b0(Text,{'color':_0x16b2eb(0x101),'children':_0x39ae9b}):a0_0x4895b0(Text,{'color':_0x16b2eb(0x108),'children':_0x4f4b84}),_0x2f5c8e&&a0_0x554e8e(Text,{'color':_0x16b2eb(0xf3),'children':[_0x16b2eb(0xf8),_0x2f5c8e]})]}),!_0x2f5c8e&&!_0x39ae9b&&a0_0x4895b0(Box,{'children':a0_0x4895b0(Text,{'color':_0x16b2eb(0x108),'children':_0x16b2eb(0xf2)})})]});}function a0_0x5e99(){const _0x2fefeb=['页面路由地址:\x20','页面路径不合法','slice','10XwGslr','8MUgPGE','backspace','green','return','129282qBrDtQ','\x20Step2:\x20','1282941zQgftO','6357080CSlmXC','column','gray','1273542xxZjBD','3jFLbEy','startsWith','length','33339515PErBLl','5363180SEXImj','existsSync','includes','\x20直接回车确认,或输入自定义路由地址','red','路径不能以\x20/\x20开头或结尾','10897065VtRnNs','91KmwYdD','页面路径长度不能超过\x20100\x20个字符','\x20←\x20','页面路径\x20','路径不能包含连续的\x20/'];a0_0x5e99=function(){return _0x2fefeb;};return a0_0x5e99();}
1
+ (function(_0x4fd9ac,_0x1cbeb0){const _0x589edd=a0_0x2b91,_0x36cbe4=_0x4fd9ac();while(!![]){try{const _0x1257c3=-parseInt(_0x589edd(0x92))/0x1*(-parseInt(_0x589edd(0x97))/0x2)+parseInt(_0x589edd(0x8b))/0x3*(parseInt(_0x589edd(0x82))/0x4)+parseInt(_0x589edd(0x7e))/0x5+parseInt(_0x589edd(0x95))/0x6*(-parseInt(_0x589edd(0x7b))/0x7)+-parseInt(_0x589edd(0x8f))/0x8*(parseInt(_0x589edd(0x88))/0x9)+-parseInt(_0x589edd(0x80))/0xa*(-parseInt(_0x589edd(0x99))/0xb)+-parseInt(_0x589edd(0x7d))/0xc*(parseInt(_0x589edd(0x89))/0xd);if(_0x1257c3===_0x1cbeb0)break;else _0x36cbe4['push'](_0x36cbe4['shift']());}catch(_0x4f5b90){_0x36cbe4['push'](_0x36cbe4['shift']());}}}(a0_0x1f8d,0x7772b));import{jsx as a0_0x283138,jsxs as a0_0x563b9e}from'react/jsx-runtime';import{useState}from'react';import{Text,Box,useInput}from'ink';function a0_0x2b91(_0x486be2,_0x31667e){const _0x1f8df0=a0_0x1f8d();return a0_0x2b91=function(_0x2b91af,_0x748b6){_0x2b91af=_0x2b91af-0x77;let _0x40035d=_0x1f8df0[_0x2b91af];return _0x40035d;},a0_0x2b91(_0x486be2,_0x31667e);}import a0_0x19f4df from'node:fs';export function InputProjectCode(_0x145be4){const _0x592b17=a0_0x2b91,{onSubmit:_0x2dcfe4,pagePath:_0x589de5}=_0x145be4,[_0x25f92b,_0x48f5b6]=useState(''),[_0x19387b,_0x5cbec2]=useState(''),_0x10ff45='my-page';function _0x3cf583(_0x56977f){const _0x6b60d1=a0_0x2b91;if(_0x56977f[_0x6b60d1(0x8c)]>0x64)return{'valid':![],'message':_0x6b60d1(0x8d)};if(_0x56977f[_0x6b60d1(0x98)]('/')||_0x56977f[_0x6b60d1(0x7c)]('/'))return{'valid':![],'message':'路径不能以\x20/\x20开头或结尾'};if(_0x56977f[_0x6b60d1(0x8e)]('//'))return{'valid':![],'message':_0x6b60d1(0x93)};const _0x54b7e0=_0x56977f[_0x6b60d1(0x84)]('/');for(const _0x1ce0b2 of _0x54b7e0){if(!_0x1ce0b2)continue;const _0x17da34=/^[A-Za-z0-9][A-Za-z0-9_-]*$/;if(!_0x17da34['test'](_0x1ce0b2))return{'valid':![],'message':_0x6b60d1(0x96)};}return{'valid':!![]};}return useInput((_0x13378c,_0x2f9b66)=>{const _0x5af364=a0_0x2b91;if(_0x2f9b66[_0x5af364(0x81)]){const _0x3cb241=_0x25f92b['trim']()||_0x10ff45;if(_0x19387b)return;const _0x5d6315=_0x589de5+'/'+_0x3cb241;if(a0_0x19f4df[_0x5af364(0x7f)](_0x5d6315)){_0x5cbec2(_0x5af364(0x78)+_0x3cb241+_0x5af364(0x83));return;}_0x2dcfe4(_0x3cb241),_0x48f5b6(''),_0x5cbec2('');}else _0x2f9b66[_0x5af364(0x90)]||_0x2f9b66[_0x5af364(0x86)]?_0x48f5b6(_0x1cfa1d=>{const _0x3d5667=_0x1cfa1d['slice'](0x0,-0x1),{valid:_0xce57a5,message:_0x1b8755}=_0x3cf583(_0x3d5667);return _0x5cbec2(_0xce57a5?'':_0x1b8755||'页面路径不合法'),_0x3d5667;}):_0x48f5b6(_0x3f3757=>{const _0x5478dc=_0x5af364,_0x378f63=_0x3f3757+_0x13378c,{valid:_0x2d762f,message:_0x3caf2b}=_0x3cf583(_0x378f63);return _0x5cbec2(_0x2d762f?'':_0x3caf2b||_0x5478dc(0x91)),_0x378f63;});}),a0_0x563b9e(Box,{'flexDirection':_0x592b17(0x79),'children':[a0_0x563b9e(Box,{'children':[a0_0x283138(Text,{'color':'gray','children':_0x592b17(0x77)}),a0_0x283138(Text,{'children':_0x592b17(0x7a)}),_0x25f92b?a0_0x283138(Text,{'color':_0x592b17(0x8a),'children':_0x25f92b}):a0_0x283138(Text,{'color':_0x592b17(0x87),'children':_0x10ff45}),_0x19387b&&a0_0x563b9e(Text,{'color':_0x592b17(0x94),'children':[_0x592b17(0x85),_0x19387b]})]}),!_0x19387b&&!_0x25f92b&&a0_0x283138(Box,{'children':a0_0x283138(Text,{'color':_0x592b17(0x87),'children':'\x20直接回车确认,或输入自定义路由地址'})})]});}function a0_0x1f8d(){const _0x3927a0=['\x20已存在,请使用其他路径','split','\x20←\x20','delete','gray','1346688ZCxHqT','19003647hQWSHO','green','1632WTVbsr','length','页面路径长度不能超过\x20100\x20个字符','includes','8wgTfAL','backspace','页面路径不合法','5266epipMg','路径不能包含连续的\x20/','red','405462WvxXAL','路径中的每个段只能以字母或数字开头,且只包含字母、数字、-\x20和\x20_','148zQBWKp','startsWith','231bzMssn','\x20Step2:\x20','页面路径\x20','column','页面路由地址:\x20','70TdIgtl','endsWith','12tmFyXq','3657690CPUDkR','existsSync','434100ZsDEVl','return','5468nkViTq'];a0_0x1f8d=function(){return _0x3927a0;};return a0_0x1f8d();}
@@ -1 +1 @@
1
- const a1_0x136c09=a1_0x124f;(function(_0x1e6f18,_0xf5289a){const _0x2020fa=a1_0x124f,_0x52bdad=_0x1e6f18();while(!![]){try{const _0x1b6be1=-parseInt(_0x2020fa(0x7d))/0x1+-parseInt(_0x2020fa(0x8b))/0x2+parseInt(_0x2020fa(0x70))/0x3+parseInt(_0x2020fa(0x72))/0x4*(-parseInt(_0x2020fa(0x86))/0x5)+parseInt(_0x2020fa(0x78))/0x6*(-parseInt(_0x2020fa(0x8a))/0x7)+parseInt(_0x2020fa(0x7f))/0x8+parseInt(_0x2020fa(0x74))/0x9*(parseInt(_0x2020fa(0x76))/0xa);if(_0x1b6be1===_0xf5289a)break;else _0x52bdad['push'](_0x52bdad['shift']());}catch(_0x25f6eb){_0x52bdad['push'](_0x52bdad['shift']());}}}(a1_0xde80,0x2a9cb));import{jsx as a1_0x378527,jsxs as a1_0x3688d9,Fragment as a1_0x32d6f8}from'react/jsx-runtime';import{fileURLToPath}from'node:url';import a1_0x356f03 from'node:path';import{useEffect,useState}from'react';function a1_0xde80(){const _0x147b22=['635524ebxviB','页面添加失败:\x20','gray','url','src','join','\x20Step1:\x20','页面添加成功:\x20','已输入的页面路由\x20','开始添加页面:\x20','setLogPath','../../templates/pages','408354oeemBm','已选择页面模板\x20','92BAErgs','catch','592362TPALrK','green','130XVVZxS','now','8682aIiriy','message','pages','cyan','processTemplate','183299GTQAPB','error','1276392HZpXRr','正在创建页面,请稍候…','finally','add-page','\x20*\x20路由地址:\x20','success','cwd','65980eJldIz','resolve','\x20Step2:\x20','\x20*\x20页面路径:\x20','833FQhWoY'];a1_0xde80=function(){return _0x147b22;};return a1_0xde80();}function a1_0x124f(_0x16fa33,_0x44d3e8){const _0xde8007=a1_0xde80();return a1_0x124f=function(_0x124f03,_0x1d3497){_0x124f03=_0x124f03-0x65;let _0x5ba2b7=_0xde8007[_0x124f03];return _0x5ba2b7;},a1_0x124f(_0x16fa33,_0x44d3e8);}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_0x356f03['dirname'](fileURLToPath(import.meta[a1_0x136c09(0x67)])),pageTemplateDir=a1_0x356f03['resolve'](__dirname,a1_0x136c09(0x6f)),projectDir=process[a1_0x136c09(0x85)]();export const AddPage=()=>{const _0x114e88=a1_0x136c09,{exit:_0x46dd81}=useApp(),[_0x8cbb8c,_0x448876]=useState(''),[_0x54c2be,_0x42bdb4]=useState(''),[_0x538fbd,_0x116eb2]=useState(![]),[_0x1e3b6a,_0x1c89e4]=useState(![]),_0x4b09ad=a1_0x356f03['join'](projectDir,'src',_0x114e88(0x7a)),_0x26e13e=a1_0x356f03[_0x114e88(0x69)](_0x4b09ad,_0x54c2be),_0xd8d7c=a1_0x356f03[_0x114e88(0x69)](_0x114e88(0x68),_0x114e88(0x7a),_0x54c2be);useEffect(()=>{const _0x205aab=_0x114e88,_0x21178d=a1_0x356f03[_0x205aab(0x87)](pageTemplateDir,_0x8cbb8c);if(_0x8cbb8c&&_0x54c2be){_0x116eb2(!![]),logger[_0x205aab(0x6e)](process[_0x205aab(0x85)]());const _0x334358=Date[_0x205aab(0x77)]();logger['info']('add-page',_0x205aab(0x6d)+_0x54c2be,{'template':_0x8cbb8c,'targetPath':_0xd8d7c}),TemplateReplacer[_0x205aab(0x7c)](_0x21178d,a1_0x356f03[_0x205aab(0x69)](_0x4b09ad,_0x54c2be),_0x54c2be,_0x8cbb8c)['then'](()=>{const _0x4b3137=_0x205aab,_0x220eb1=Date[_0x4b3137(0x77)]()-_0x334358;logger[_0x4b3137(0x84)](_0x4b3137(0x82),_0x4b3137(0x6b)+_0x54c2be,_0x220eb1,{'template':_0x8cbb8c,'targetPath':_0xd8d7c,'routePath':_0x54c2be}),_0x1c89e4(!![]);})[_0x205aab(0x73)](_0xa7c594=>{const _0x351b6e=_0x205aab,_0x2cd4e6=Date[_0x351b6e(0x77)]()-_0x334358;logger[_0x351b6e(0x7e)](_0x351b6e(0x82),_0x351b6e(0x65)+_0x54c2be,{'template':_0x8cbb8c,'targetPath':_0xd8d7c,'error':_0xa7c594 instanceof Error?_0xa7c594[_0x351b6e(0x79)]:String(_0xa7c594),'duration':_0x2cd4e6});})[_0x205aab(0x81)](()=>{_0x116eb2(![]);});}},[_0x8cbb8c,_0x54c2be]),useEffect(()=>{_0x1e3b6a&&setTimeout(()=>{_0x46dd81();});},[_0x1e3b6a]);if(_0x8cbb8c)return a1_0x3688d9(Box,{'flexDirection':'column','paddingY':0x1,'children':[a1_0x3688d9(Box,{'children':[a1_0x378527(Text,{'color':_0x114e88(0x66),'children':_0x114e88(0x6a)}),a1_0x378527(Text,{'children':_0x114e88(0x71)}),a1_0x378527(Text,{'color':'green','children':_0x8cbb8c})]}),_0x54c2be?a1_0x3688d9(Box,{'children':[a1_0x378527(Text,{'color':_0x114e88(0x66),'children':_0x114e88(0x88)}),a1_0x378527(Text,{'children':_0x114e88(0x6c)}),a1_0x378527(Text,{'color':_0x114e88(0x75),'children':_0x54c2be})]}):a1_0x378527(InputProjectCode,{'pagePath':_0x26e13e,'onSubmit':_0x42bdb4}),_0x54c2be&&_0x538fbd?a1_0x3688d9(Box,{'marginTop':0x1,'children':[a1_0x378527(Box,{'width':'4'}),a1_0x378527(Text,{'children':_0x114e88(0x80)})]}):null,_0x1e3b6a?a1_0x3688d9(a1_0x32d6f8,{'children':[a1_0x378527(Box,{'marginTop':0x1,'children':a1_0x378527(Text,{'color':_0x114e88(0x66),'children':'\x20*\x20页面创建成功!'})}),a1_0x3688d9(Box,{'children':[a1_0x378527(Text,{'color':_0x114e88(0x66),'children':_0x114e88(0x89)}),a1_0x378527(Text,{'color':_0x114e88(0x75),'children':_0xd8d7c})]}),a1_0x3688d9(Box,{'children':[a1_0x378527(Text,{'color':_0x114e88(0x66),'children':_0x114e88(0x83)}),a1_0x3688d9(Text,{'color':_0x114e88(0x75),'children':['/',_0x54c2be]})]}),a1_0x378527(Box,{'marginTop':0x1,'children':a1_0x378527(Text,{'color':_0x114e88(0x7b),'children':'\x20*\x20页面文件已创建,可直接通过路由访问'})})]}):null]});return a1_0x378527(SelectPageTemplate,{'onSelect':_0x448876});};
1
+ const a1_0xb5c1d6=a1_0x1bec;(function(_0x6f46e4,_0x7e8467){const _0x3170a9=a1_0x1bec,_0x4a332f=_0x6f46e4();while(!![]){try{const _0x2fb773=parseInt(_0x3170a9(0xf1))/0x1+parseInt(_0x3170a9(0x100))/0x2+parseInt(_0x3170a9(0xf3))/0x3+parseInt(_0x3170a9(0xf4))/0x4+parseInt(_0x3170a9(0xed))/0x5*(-parseInt(_0x3170a9(0x101))/0x6)+-parseInt(_0x3170a9(0xe6))/0x7+-parseInt(_0x3170a9(0xec))/0x8*(parseInt(_0x3170a9(0xea))/0x9);if(_0x2fb773===_0x7e8467)break;else _0x4a332f['push'](_0x4a332f['shift']());}catch(_0x31c998){_0x4a332f['push'](_0x4a332f['shift']());}}}(a1_0x2e0f,0xa4216));import{jsx as a1_0x156db7,jsxs as a1_0x3b6002,Fragment as a1_0x5b3842}from'react/jsx-runtime';import{fileURLToPath}from'node:url';function a1_0x1bec(_0x109086,_0x1fff4b){const _0x2e0fcd=a1_0x2e0f();return a1_0x1bec=function(_0x1bec57,_0x2bd063){_0x1bec57=_0x1bec57-0xe4;let _0x17a673=_0x2e0fcd[_0x1bec57];return _0x17a673;},a1_0x1bec(_0x109086,_0x1fff4b);}import a1_0x15511d 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_0x2e0f(){const _0x63ad9b=['1155135TaXdre','2903040bRojpF','error','message','\x20*\x20路由地址:\x20','finally','已输入的页面路由\x20','../../templates/pages','dirname','src','success','开始添加页面:\x20','url','1600322dVKPxK','308088AnZTOF','页面添加失败:\x20','then','\x20*\x20页面创建成功!','gray','now','processTemplate','add-page','\x20Step1:\x20','3063991Miyatb','\x20*\x20页面路径:\x20','resolve','正在创建页面,请稍候…','9633915ELMHwy','pages','8rrCSTd','15SeIUvJ','join','green','catch','423504VdPyUy','\x20*\x20页面文件已创建,可直接通过路由访问'];a1_0x2e0f=function(){return _0x63ad9b;};return a1_0x2e0f();}const __dirname=a1_0x15511d[a1_0xb5c1d6(0xfb)](fileURLToPath(import.meta[a1_0xb5c1d6(0xff)])),pageTemplateDir=a1_0x15511d[a1_0xb5c1d6(0xe8)](__dirname,a1_0xb5c1d6(0xfa)),projectDir=process['cwd']();export const AddPage=()=>{const _0x57eb7f=a1_0xb5c1d6,{exit:_0x33de39}=useApp(),[_0x6c8078,_0x1ff721]=useState(''),[_0x20a146,_0x1a0aa6]=useState(''),[_0x270acb,_0x5278ad]=useState(![]),[_0x1619f2,_0x1b560e]=useState(![]),_0xb07362=a1_0x15511d[_0x57eb7f(0xee)](projectDir,'src',_0x57eb7f(0xeb)),_0x20749c=a1_0x15511d[_0x57eb7f(0xee)](_0xb07362,_0x20a146),_0x4114bf=a1_0x15511d[_0x57eb7f(0xee)](_0x57eb7f(0xfc),_0x57eb7f(0xeb),_0x20a146);useEffect(()=>{const _0x249a20=_0x57eb7f,_0x361f4d=a1_0x15511d['resolve'](pageTemplateDir,_0x6c8078);if(_0x6c8078&&_0x20a146){_0x5278ad(!![]),logger['setLogPath'](process['cwd']());const _0x5e5eb9=Date[_0x249a20(0x106)]();logger['info']('add-page',_0x249a20(0xfe)+_0x20a146,{'template':_0x6c8078,'targetPath':_0x4114bf}),TemplateReplacer[_0x249a20(0x107)](_0x361f4d,a1_0x15511d[_0x249a20(0xee)](_0xb07362,_0x20a146),_0x20a146,_0x6c8078)[_0x249a20(0x103)](()=>{const _0x31e616=_0x249a20,_0x2c2dab=Date[_0x31e616(0x106)]()-_0x5e5eb9;logger[_0x31e616(0xfd)](_0x31e616(0xe4),'页面添加成功:\x20'+_0x20a146,_0x2c2dab,{'template':_0x6c8078,'targetPath':_0x4114bf,'routePath':_0x20a146}),_0x1b560e(!![]);})[_0x249a20(0xf0)](_0x2e3b74=>{const _0x6ca201=_0x249a20,_0x2f533a=Date['now']()-_0x5e5eb9;logger[_0x6ca201(0xf5)](_0x6ca201(0xe4),_0x6ca201(0x102)+_0x20a146,{'template':_0x6c8078,'targetPath':_0x4114bf,'error':_0x2e3b74 instanceof Error?_0x2e3b74[_0x6ca201(0xf6)]:String(_0x2e3b74),'duration':_0x2f533a});})[_0x249a20(0xf8)](()=>{_0x5278ad(![]);});}},[_0x6c8078,_0x20a146]),useEffect(()=>{_0x1619f2&&setTimeout(()=>{_0x33de39();});},[_0x1619f2]);if(_0x6c8078)return a1_0x3b6002(Box,{'flexDirection':'column','paddingY':0x1,'children':[a1_0x3b6002(Box,{'children':[a1_0x156db7(Text,{'color':_0x57eb7f(0x105),'children':_0x57eb7f(0xe5)}),a1_0x156db7(Text,{'children':'已选择页面模板\x20'}),a1_0x156db7(Text,{'color':_0x57eb7f(0xef),'children':_0x6c8078})]}),_0x20a146?a1_0x3b6002(Box,{'children':[a1_0x156db7(Text,{'color':_0x57eb7f(0x105),'children':'\x20Step2:\x20'}),a1_0x156db7(Text,{'children':_0x57eb7f(0xf9)}),a1_0x156db7(Text,{'color':_0x57eb7f(0xef),'children':_0x20a146})]}):a1_0x156db7(InputProjectCode,{'pagePath':_0x20749c,'onSubmit':_0x1a0aa6}),_0x20a146&&_0x270acb?a1_0x3b6002(Box,{'marginTop':0x1,'children':[a1_0x156db7(Box,{'width':'4'}),a1_0x156db7(Text,{'children':_0x57eb7f(0xe9)})]}):null,_0x1619f2?a1_0x3b6002(a1_0x5b3842,{'children':[a1_0x156db7(Box,{'marginTop':0x1,'children':a1_0x156db7(Text,{'color':_0x57eb7f(0x105),'children':_0x57eb7f(0x104)})}),a1_0x3b6002(Box,{'children':[a1_0x156db7(Text,{'color':_0x57eb7f(0x105),'children':_0x57eb7f(0xe7)}),a1_0x156db7(Text,{'color':'green','children':_0x4114bf})]}),a1_0x3b6002(Box,{'children':[a1_0x156db7(Text,{'color':_0x57eb7f(0x105),'children':_0x57eb7f(0xf7)}),a1_0x3b6002(Text,{'color':_0x57eb7f(0xef),'children':['/',_0x20a146]})]}),a1_0x156db7(Box,{'marginTop':0x1,'children':a1_0x156db7(Text,{'color':'cyan','children':_0x57eb7f(0xf2)})})]}):null]});return a1_0x156db7(SelectPageTemplate,{'onSelect':_0x1ff721});};
@@ -1 +1 @@
1
- (function(_0x1f2fb6,_0x437d72){const _0x307b80=a2_0x5af8,_0x103bf6=_0x1f2fb6();while(!![]){try{const _0x1ef944=parseInt(_0x307b80(0x1d4))/0x1+-parseInt(_0x307b80(0x1d7))/0x2+-parseInt(_0x307b80(0x1db))/0x3*(-parseInt(_0x307b80(0x1d6))/0x4)+parseInt(_0x307b80(0x1d0))/0x5*(parseInt(_0x307b80(0x1ca))/0x6)+-parseInt(_0x307b80(0x1be))/0x7+parseInt(_0x307b80(0x1c0))/0x8*(parseInt(_0x307b80(0x1c6))/0x9)+parseInt(_0x307b80(0x1c2))/0xa*(-parseInt(_0x307b80(0x1c5))/0xb);if(_0x1ef944===_0x437d72)break;else _0x103bf6['push'](_0x103bf6['shift']());}catch(_0x3c4c4d){_0x103bf6['push'](_0x103bf6['shift']());}}}(a2_0x49e1,0xa75cd));import{jsx as a2_0x189819,jsxs as a2_0x295cb7}from'react/jsx-runtime';function a2_0x5af8(_0x49c943,_0x19fd4f){const _0x49e111=a2_0x49e1();return a2_0x5af8=function(_0x5af884,_0x183f43){_0x5af884=_0x5af884-0x1b8;let _0x1c6f7c=_0x49e111[_0x5af884];return _0x1c6f7c;},a2_0x5af8(_0x49c943,_0x19fd4f);}function a2_0x49e1(){const _0x56c2a4=['resolve','sort','localeCompare','2662125PRWSZQ','join','获取模板列表失败:','url','913330pCzOqg','onSelect','595124erwKrR','1134278hHLKEj','请选择您要创建的页面模板','downArrow','\x20\x20\x20\x20\x20\x20>\x20','3ztpATI','\x20\x20\x20\x20\x20\x20\x20\x20','column','length','green','isDirectory','\x20Step1:\x20','2050524paECiT','return','16dfXijd','正在加载页面模板...','12092260UKqPvN','gray','label','11SwJrwt','5221251AAliWz','error','../..','templates/pages','6nevfYQ','blank','filter'];a2_0x49e1=function(){return _0x56c2a4;};return a2_0x49e1();}import{useState,useEffect}from'react';import{Text,Box,useInput}from'ink';import{readdir}from'node:fs/promises';import a2_0x56c14e from'node:path';import{fileURLToPath}from'node:url';async function getTemplateList(){const _0x12e614=a2_0x5af8;try{const _0x3f6d98=fileURLToPath(import.meta[_0x12e614(0x1d3)]),_0x2a352b=a2_0x56c14e[_0x12e614(0x1cd)](a2_0x56c14e['dirname'](_0x3f6d98),_0x12e614(0x1c8)),_0x3092ff=a2_0x56c14e[_0x12e614(0x1d1)](_0x2a352b,_0x12e614(0x1c9)),_0x2bad97=await readdir(_0x3092ff,{'withFileTypes':!![]}),_0x404056=_0x2bad97[_0x12e614(0x1cc)](_0x3917ad=>_0x3917ad[_0x12e614(0x1bc)]())['map'](_0x27d562=>({'label':_0x27d562['name']}))[_0x12e614(0x1ce)]((_0x1c89ed,_0x21d2cc)=>_0x1c89ed[_0x12e614(0x1c4)][_0x12e614(0x1cf)](_0x21d2cc['label']));return _0x404056;}catch(_0x4ec7c7){return console[_0x12e614(0x1c7)](_0x12e614(0x1d2),_0x4ec7c7),[{'label':_0x12e614(0x1cb)},{'label':'sdk-fetch'}];}}export function SelectPageTemplate(_0x3830d8){const _0x26aace=a2_0x5af8,[_0x525559,_0x4a55a4]=useState(0x0),[_0x2fcfb0,_0x480c1c]=useState([]),[_0x3382fa,_0x36d45b]=useState(!![]);useEffect(()=>{async function _0x2c28ed(){const _0x34ef56=await getTemplateList();_0x480c1c(_0x34ef56),_0x36d45b(![]);}_0x2c28ed();},[]),useInput((_0x4b13d4,_0x53fab8)=>{const _0x35e209=a2_0x5af8;if(_0x3382fa)return;if(_0x53fab8[_0x35e209(0x1bf)]){const _0x599a68=_0x2fcfb0[_0x525559];_0x599a68&&_0x3830d8[_0x35e209(0x1d5)](_0x599a68[_0x35e209(0x1c4)]);}_0x53fab8['upArrow']&&_0x4a55a4(_0x12b5fc=>_0x12b5fc===0x0?_0x2fcfb0[_0x35e209(0x1ba)]-0x1:_0x12b5fc-0x1),_0x53fab8[_0x35e209(0x1d9)]&&_0x4a55a4(_0x4062d7=>_0x4062d7===_0x2fcfb0[_0x35e209(0x1ba)]-0x1?0x0:_0x4062d7+0x1);});if(_0x3382fa)return a2_0x189819(Box,{'flexDirection':'column','paddingY':0x1,'children':a2_0x295cb7(Box,{'children':[a2_0x189819(Text,{'color':'gray','children':_0x26aace(0x1bd)}),a2_0x189819(Text,{'children':_0x26aace(0x1c1)})]})});return a2_0x295cb7(Box,{'flexDirection':_0x26aace(0x1b9),'paddingY':0x1,'children':[a2_0x295cb7(Box,{'children':[a2_0x189819(Text,{'color':_0x26aace(0x1c3),'children':_0x26aace(0x1bd)}),a2_0x189819(Text,{'children':_0x26aace(0x1d8)})]}),_0x2fcfb0['map']((_0x4e94f4,_0x96096)=>{const _0x5851db=_0x26aace,_0x28b41f=_0x96096===_0x525559,_0x2b5046=_0x28b41f?_0x5851db(0x1da)+_0x4e94f4[_0x5851db(0x1c4)]:_0x5851db(0x1b8)+_0x4e94f4[_0x5851db(0x1c4)];return a2_0x189819(Box,{'children':a2_0x189819(Text,{'color':_0x28b41f?_0x5851db(0x1bb):undefined,'children':_0x2b5046})},_0x2b5046);})]});}
1
+ (function(_0x4e689c,_0x55c976){const _0x393f0f=a2_0x28d7,_0x2aca71=_0x4e689c();while(!![]){try{const _0x101aad=-parseInt(_0x393f0f(0x112))/0x1*(parseInt(_0x393f0f(0x11e))/0x2)+-parseInt(_0x393f0f(0x108))/0x3*(-parseInt(_0x393f0f(0x114))/0x4)+parseInt(_0x393f0f(0x107))/0x5+-parseInt(_0x393f0f(0x11b))/0x6+parseInt(_0x393f0f(0x122))/0x7+parseInt(_0x393f0f(0x121))/0x8*(-parseInt(_0x393f0f(0x119))/0x9)+parseInt(_0x393f0f(0x10b))/0xa;if(_0x101aad===_0x55c976)break;else _0x2aca71['push'](_0x2aca71['shift']());}catch(_0x2be525){_0x2aca71['push'](_0x2aca71['shift']());}}}(a2_0x2635,0xedeb9));import{jsx as a2_0x54a08d,jsxs as a2_0x132639}from'react/jsx-runtime';import{useState,useEffect}from'react';import{Text,Box,useInput}from'ink';import{readdir}from'node:fs/promises';function a2_0x2635(){const _0x285b57=['label','1618712PTzwpt','6403530XtPWJP','sort','error','url','onSelect','\x20\x20\x20\x20\x20\x20\x20\x20','8630320yleojd','25293WlMCxU','upArrow','downArrow','1019490vUFxFl','map','localeCompare','gray','\x20\x20\x20\x20\x20\x20>\x20','length','resolve','2666jKxsCO','join','204dMsPyf','\x20Step1:\x20','../..','正在加载页面模板...','return','27UovdRC','column','7803912OdggnW','dirname','name','218YmtvQm','sdk-fetch'];a2_0x2635=function(){return _0x285b57;};return a2_0x2635();}import a2_0x84bd23 from'node:path';import{fileURLToPath}from'node:url';async function getTemplateList(){const _0x394fe0=a2_0x28d7;try{const _0x453c6a=fileURLToPath(import.meta[_0x394fe0(0x104)]),_0xc2f9f5=a2_0x84bd23[_0x394fe0(0x111)](a2_0x84bd23[_0x394fe0(0x11c)](_0x453c6a),_0x394fe0(0x116)),_0x4a691a=a2_0x84bd23[_0x394fe0(0x113)](_0xc2f9f5,'templates/pages'),_0x39f475=await readdir(_0x4a691a,{'withFileTypes':!![]}),_0x5e9642=_0x39f475['filter'](_0x125fed=>_0x125fed['isDirectory']())[_0x394fe0(0x10c)](_0x28f4b1=>({'label':_0x28f4b1[_0x394fe0(0x11d)]}))[_0x394fe0(0x123)]((_0x10bfdd,_0x53c8df)=>_0x10bfdd[_0x394fe0(0x120)][_0x394fe0(0x10d)](_0x53c8df[_0x394fe0(0x120)]));return _0x5e9642;}catch(_0x48d3a7){return console[_0x394fe0(0x124)]('获取模板列表失败:',_0x48d3a7),[{'label':'blank'},{'label':_0x394fe0(0x11f)}];}}function a2_0x28d7(_0x3a8872,_0x5317b0){const _0x263575=a2_0x2635();return a2_0x28d7=function(_0x28d744,_0x3f11b4){_0x28d744=_0x28d744-0x104;let _0x2e2d6d=_0x263575[_0x28d744];return _0x2e2d6d;},a2_0x28d7(_0x3a8872,_0x5317b0);}export function SelectPageTemplate(_0x2d9d06){const _0x374dc2=a2_0x28d7,[_0x2a5f72,_0x497e69]=useState(0x0),[_0xdbf4ca,_0x19ba94]=useState([]),[_0x26742a,_0x45c541]=useState(!![]);useEffect(()=>{async function _0x36c21c(){const _0xc75364=await getTemplateList();_0x19ba94(_0xc75364),_0x45c541(![]);}_0x36c21c();},[]),useInput((_0x44c294,_0x198d31)=>{const _0x5262bc=a2_0x28d7;if(_0x26742a)return;if(_0x198d31[_0x5262bc(0x118)]){const _0x16ac87=_0xdbf4ca[_0x2a5f72];_0x16ac87&&_0x2d9d06[_0x5262bc(0x105)](_0x16ac87[_0x5262bc(0x120)]);}_0x198d31[_0x5262bc(0x109)]&&_0x497e69(_0x16b94b=>_0x16b94b===0x0?_0xdbf4ca[_0x5262bc(0x110)]-0x1:_0x16b94b-0x1),_0x198d31[_0x5262bc(0x10a)]&&_0x497e69(_0x1d65cf=>_0x1d65cf===_0xdbf4ca[_0x5262bc(0x110)]-0x1?0x0:_0x1d65cf+0x1);});if(_0x26742a)return a2_0x54a08d(Box,{'flexDirection':_0x374dc2(0x11a),'paddingY':0x1,'children':a2_0x132639(Box,{'children':[a2_0x54a08d(Text,{'color':_0x374dc2(0x10e),'children':_0x374dc2(0x115)}),a2_0x54a08d(Text,{'children':_0x374dc2(0x117)})]})});return a2_0x132639(Box,{'flexDirection':_0x374dc2(0x11a),'paddingY':0x1,'children':[a2_0x132639(Box,{'children':[a2_0x54a08d(Text,{'color':'gray','children':_0x374dc2(0x115)}),a2_0x54a08d(Text,{'children':'请选择您要创建的页面模板'})]}),_0xdbf4ca[_0x374dc2(0x10c)]((_0x21cfb4,_0x224422)=>{const _0xa6810c=_0x374dc2,_0x41d4d2=_0x224422===_0x2a5f72,_0x50dbed=_0x41d4d2?_0xa6810c(0x10f)+_0x21cfb4['label']:_0xa6810c(0x106)+_0x21cfb4[_0xa6810c(0x120)];return a2_0x54a08d(Box,{'children':a2_0x54a08d(Text,{'color':_0x41d4d2?'green':undefined,'children':_0x50dbed})},_0x50dbed);})]});}
@@ -1 +1 @@
1
- (function(_0x1bef4a,_0x31b9e1){const _0x3bc69c=a3_0x54b0,_0x165e09=_0x1bef4a();while(!![]){try{const _0x313756=parseInt(_0x3bc69c(0x124))/0x1+-parseInt(_0x3bc69c(0x15b))/0x2*(-parseInt(_0x3bc69c(0x120))/0x3)+parseInt(_0x3bc69c(0x158))/0x4+-parseInt(_0x3bc69c(0x150))/0x5+-parseInt(_0x3bc69c(0x131))/0x6*(parseInt(_0x3bc69c(0x149))/0x7)+parseInt(_0x3bc69c(0x13d))/0x8*(parseInt(_0x3bc69c(0x151))/0x9)+parseInt(_0x3bc69c(0x136))/0xa*(-parseInt(_0x3bc69c(0x13a))/0xb);if(_0x313756===_0x31b9e1)break;else _0x165e09['push'](_0x165e09['shift']());}catch(_0x4f9e7f){_0x165e09['push'](_0x165e09['shift']());}}}(a3_0x1075,0x974b4));import{jsx as a3_0x23b80f,jsxs as a3_0xb76d19,Fragment as a3_0x7b863}from'react/jsx-runtime';import{useEffect,useState}from'react';import{Box,Text,useApp}from'ink';import{readConfig,getConfigAppCode}from'../utils/config.js';function a3_0x54b0(_0xf89cba,_0x5daa01){const _0x1075ad=a3_0x1075();return a3_0x54b0=function(_0x54b097,_0x19dc4e){_0x54b097=_0x54b097-0x120;let _0x281a85=_0x1075ad[_0x54b097];return _0x281a85;},a3_0x54b0(_0xf89cba,_0x5daa01);}import{initEnv}from'../constant/env.js';function a3_0x1075(){const _0x4a1e90=['datasetCode','🚀\x20','1183651Msuqti','dim','\x20-\x20','success','文档生成失败:\x20','使用配置的应用AppCode:\x20','💡\x20请使用\x20','3544345GSdOiu','6390EIGBtz','log','gray','length','error','white','online','3274896sNfGuK','\x1b[0m','\x1b[33m!\x20以下数据集代码不存在:\x20','8Qpxxxq','300732AkiaNu','未提供应用AppCode,且配置中也没有默认值','red','setLogPath','1040930QqpNkc','\x20个数据集中筛选出\x20','column','正在生成\x20','string','*\x20生成的文档文件:','指定的数据集代码都不存在:\x20','map','文档生成完成','green','join','\x20个匹配的数据集\x1b[0m','./docs','12bkawsw','yellow',',\x20失败\x20','未找到任何数据集','\x20重新登录后再试','42650KDxOeP','api-doc','\x20个数据集','.md\x20(','2255HnbZAV','lovrabet\x20auth','filePath','3160gsgjuv','filter','includes','√\x20文档生成完成!成功\x20','cyan','\x20个数据集的文档...','\x20(环境:\x20','*\x20输出目录:\x20','env','cwd'];a3_0x1075=function(){return _0x4a1e90;};return a3_0x1075();}import{fetchModelList}from'./fetch-model-list.js';import{generateDatasetDocs}from'./api-doc.js';import{logger}from'../utils/logger.js';export const ApiDocUI=({appCode:_0x52739c,env:_0x37a566,output:_0x1a57e0,extraParams:_0x3e65fc,datasetCodes:_0x3edc3a})=>{const _0x354654=a3_0x54b0,{exit:_0x22e44c}=useApp(),[_0x40204e,_0x12528b]=useState(![]),[_0x543b29,_0x27f5c1]=useState(''),[_0x220a22,_0x16808c]=useState(![]),[_0x4105f6,_0x2cdbac]=useState(null),[_0x445ed2,_0x2f7d1b]=useState(null),[_0x3e003e,_0x4c7c0e]=useState(0x0),_0x249e0b=readConfig(),_0x2485e1=getConfigAppCode(),_0x1108bd=_0x52739c||_0x2485e1,_0x5e6ca6=typeof _0x249e0b?.[_0x354654(0x145)]===_0x354654(0x128)?_0x249e0b[_0x354654(0x145)]:undefined,_0x13c052=_0x37a566||_0x5e6ca6||_0x354654(0x157);initEnv(_0x13c052);const _0x9e722a=_0x1a57e0||_0x354654(0x130),_0x4e4d90=_0x52739c?'使用指定的应用AppCode:\x20'+_0x1108bd:_0x354654(0x14e)+_0x1108bd;useEffect(()=>{_0x12528b(!![]),_0x2059c6();},[]),useEffect(()=>{(_0x220a22||_0x4105f6)&&_0x22e44c();},[_0x220a22,_0x4105f6,_0x22e44c]);async function _0x2059c6(){const _0x155283=_0x354654;if(!_0x1108bd){_0x2cdbac(_0x155283(0x121));return;}try{logger[_0x155283(0x123)](process[_0x155283(0x146)]()),_0x27f5c1('正在获取数据集列表...');const {configArray:_0x3f1b36}=await fetchModelList(_0x1108bd);_0x4c7c0e(_0x3f1b36['length']);if(_0x3f1b36[_0x155283(0x154)]===0x0){_0x2cdbac(_0x155283(0x134));return;}let _0x41aa3b=_0x3f1b36;if(_0x3edc3a&&_0x3edc3a[_0x155283(0x154)]>0x0){_0x41aa3b=_0x3f1b36[_0x155283(0x13e)](_0x34f11d=>_0x3edc3a[_0x155283(0x13f)](_0x34f11d[_0x155283(0x147)]));const _0x13faa7=_0x41aa3b[_0x155283(0x12b)](_0x351340=>_0x351340[_0x155283(0x147)]),_0x5beb36=_0x3edc3a[_0x155283(0x13e)](_0x4e2796=>!_0x13faa7[_0x155283(0x13f)](_0x4e2796));_0x5beb36[_0x155283(0x154)]>0x0&&console[_0x155283(0x152)](_0x155283(0x15a)+_0x5beb36[_0x155283(0x12e)](',\x20')+_0x155283(0x159));if(_0x41aa3b[_0x155283(0x154)]===0x0){_0x2cdbac(_0x155283(0x12a)+_0x3edc3a[_0x155283(0x12e)](',\x20'));return;}console[_0x155283(0x152)]('\x1b[90m*\x20从\x20'+_0x3f1b36[_0x155283(0x154)]+_0x155283(0x125)+_0x41aa3b['length']+_0x155283(0x12f));}_0x27f5c1(_0x155283(0x127)+_0x41aa3b[_0x155283(0x154)]+_0x155283(0x142));const _0x1e01cb=await generateDatasetDocs(_0x41aa3b,_0x1108bd,_0x9e722a,(_0x307f93,_0x3f3114,_0x50b302)=>{const _0x28b1b6=_0x155283;_0x27f5c1(_0x28b1b6(0x127)+_0x50b302+_0x28b1b6(0x139)+_0x307f93+'/'+_0x3f3114+')');},_0x3e65fc);_0x2f7d1b(_0x1e01cb),_0x16808c(!![]);const _0x2d4040=_0x1e01cb[_0x155283(0x13e)](_0x61bd4d=>_0x61bd4d[_0x155283(0x14c)])[_0x155283(0x154)],_0x2c2ed3=_0x1e01cb[_0x155283(0x13e)](_0x46afcf=>!_0x46afcf[_0x155283(0x14c)])[_0x155283(0x154)];logger['success']('api-doc',_0x155283(0x12c),undefined,{'totalCount':_0x1e01cb[_0x155283(0x154)],'successCount':_0x2d4040,'failCount':_0x2c2ed3,'outputDir':_0x9e722a});}catch(_0x40ab5c){const _0x23653b=_0x40ab5c instanceof Error?_0x40ab5c['message']:String(_0x40ab5c);logger[_0x155283(0x155)](_0x155283(0x137),_0x155283(0x14d)+_0x23653b,{'appCode':_0x1108bd,'outputDir':_0x9e722a}),_0x2cdbac(_0x155283(0x14d)+_0x23653b);}finally{_0x12528b(![]);}}const _0x3f9add=_0x445ed2?.['filter'](_0x2ae926=>_0x2ae926[_0x354654(0x14c)])[_0x354654(0x154)]||0x0,_0x257200=_0x445ed2?.[_0x354654(0x13e)](_0xb702cf=>!_0xb702cf[_0x354654(0x14c)])[_0x354654(0x154)]||0x0;return a3_0xb76d19(Box,{'flexDirection':_0x354654(0x126),'children':[(_0x40204e||_0x220a22)&&a3_0xb76d19(Box,{'children':[a3_0x23b80f(Text,{'color':_0x354654(0x153),'children':'*\x20'}),a3_0x23b80f(Text,{'color':_0x52739c?_0x354654(0x156):_0x354654(0x14a),'children':_0x4e4d90})]}),_0x40204e&&a3_0x23b80f(Box,{'children':a3_0xb76d19(Text,{'children':[_0x354654(0x148),_0x543b29,_0x354654(0x143),_0x13c052,')']})}),_0x220a22&&_0x445ed2&&a3_0xb76d19(Box,{'flexDirection':_0x354654(0x126),'children':[a3_0x23b80f(Box,{'children':a3_0xb76d19(Text,{'color':_0x354654(0x12d),'children':[_0x354654(0x140),_0x3f9add,'\x20个',_0x257200>0x0&&_0x354654(0x133)+_0x257200+'\x20个']})}),a3_0x23b80f(Box,{'marginTop':0x1,'children':a3_0xb76d19(Text,{'color':_0x354654(0x153),'children':['*\x20共处理\x20',_0x3e003e,_0x354654(0x138)]})}),a3_0xb76d19(Box,{'marginTop':0x1,'children':[a3_0x23b80f(Text,{'color':'gray','children':_0x354654(0x144)}),a3_0x23b80f(Text,{'color':_0x354654(0x141),'children':_0x9e722a})]}),_0x3f9add>0x0&&a3_0xb76d19(a3_0x7b863,{'children':[a3_0x23b80f(Box,{'marginTop':0x1,'children':a3_0x23b80f(Text,{'color':_0x354654(0x153),'children':_0x354654(0x129)})}),_0x445ed2[_0x354654(0x13e)](_0x456b80=>_0x456b80['success'])[_0x354654(0x12b)]((_0x49e5b8,_0x577d91)=>a3_0xb76d19(Box,{'marginLeft':0x2,'children':[a3_0xb76d19(Text,{'color':'cyan','children':['•\x20',_0x49e5b8[_0x354654(0x13c)]]}),a3_0xb76d19(Text,{'color':'dim','children':[_0x354654(0x14b),_0x49e5b8['datasetName']]})]},_0x577d91))]}),_0x257200>0x0&&a3_0xb76d19(a3_0x7b863,{'children':[a3_0x23b80f(Box,{'marginTop':0x1,'children':a3_0x23b80f(Text,{'color':_0x354654(0x132),'children':'⚠️\x20以下数据集生成失败:'})}),_0x445ed2[_0x354654(0x13e)](_0x52e0a3=>!_0x52e0a3[_0x354654(0x14c)])['map']((_0x56c6b4,_0x43c09f)=>a3_0xb76d19(Box,{'marginLeft':0x2,'flexDirection':_0x354654(0x126),'children':[a3_0xb76d19(Text,{'color':'red','children':['•\x20',_0x56c6b4['datasetName'],'\x20(',_0x56c6b4[_0x354654(0x147)],')']}),_0x56c6b4['error']&&a3_0x23b80f(Box,{'marginLeft':0x2,'children':a3_0x23b80f(Text,{'color':_0x354654(0x14a),'children':_0x56c6b4['error']})})]},_0x43c09f))]})]}),_0x4105f6&&a3_0xb76d19(Box,{'flexDirection':_0x354654(0x126),'children':[a3_0x23b80f(Box,{'children':a3_0xb76d19(Text,{'color':_0x354654(0x122),'children':['❌\x20',_0x4105f6]})}),_0x4105f6[_0x354654(0x13f)]('登录')&&a3_0xb76d19(Box,{'marginTop':0x1,'children':[a3_0x23b80f(Text,{'color':'yellow','children':_0x354654(0x14f)}),a3_0x23b80f(Text,{'color':_0x354654(0x141),'children':_0x354654(0x13b)}),a3_0x23b80f(Text,{'color':_0x354654(0x132),'children':_0x354654(0x135)})]})]})]});};
1
+ (function(_0x286142,_0x280d9c){const _0x299761=a3_0x2a5e,_0x591b32=_0x286142();while(!![]){try{const _0x177d49=-parseInt(_0x299761(0xb2))/0x1*(parseInt(_0x299761(0xae))/0x2)+parseInt(_0x299761(0xe4))/0x3*(-parseInt(_0x299761(0xba))/0x4)+parseInt(_0x299761(0xe0))/0x5*(-parseInt(_0x299761(0xdb))/0x6)+-parseInt(_0x299761(0xe1))/0x7+parseInt(_0x299761(0xbb))/0x8+parseInt(_0x299761(0xd6))/0x9*(parseInt(_0x299761(0xc4))/0xa)+parseInt(_0x299761(0xd7))/0xb;if(_0x177d49===_0x280d9c)break;else _0x591b32['push'](_0x591b32['shift']());}catch(_0x30555b){_0x591b32['push'](_0x591b32['shift']());}}}(a3_0x3ff7,0x42232));import{jsx as a3_0x45f2af,jsxs as a3_0x4cd473,Fragment as a3_0x497e8b}from'react/jsx-runtime';import{useEffect,useState}from'react';import{Box,Text,useApp}from'ink';import{readConfig,getConfigAppCode}from'../utils/config.js';function a3_0x2a5e(_0x1c9dc3,_0x154753){const _0x3ff701=a3_0x3ff7();return a3_0x2a5e=function(_0x2a5e43,_0x206a15){_0x2a5e43=_0x2a5e43-0xaa;let _0x4917c7=_0x3ff701[_0x2a5e43];return _0x4917c7;},a3_0x2a5e(_0x1c9dc3,_0x154753);}function a3_0x3ff7(){const _0x3e4cde=['240232vybFjX','map','error','gray','\x20个数据集','🚀\x20','正在获取数据集列表...','datasetName','*\x20共处理\x20','10dTTFjI','./docs','column','使用指定的应用AppCode:\x20','dim','使用配置的应用AppCode:\x20','datasetCode','join','正在生成\x20','includes','指定的数据集代码都不存在:\x20','文档生成完成','\x20(环境:\x20','log','online','red','api-doc',',\x20失败\x20','1336374ZlyPxU','8032860MqIKnb','⚠️\x20以下数据集生成失败:','yellow','env','96084SgzjVM','message','white','√\x20文档生成完成!成功\x20','文档生成失败:\x20','55zOBehK','2004338JDpbWl','green','filter','2703rCyUwA','length','未提供应用AppCode,且配置中也没有默认值','\x1b[33m!\x20以下数据集代码不存在:\x20','filePath','34ooDMhg','success','cwd','未找到任何数据集','724VknBma','\x20重新登录后再试','\x1b[0m','💡\x20请使用\x20','cyan','string','*\x20生成的文档文件:','\x20个数据集的文档...','724FqAUpo'];a3_0x3ff7=function(){return _0x3e4cde;};return a3_0x3ff7();}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:_0x1c4cf2,env:_0x1b6f15,output:_0x35dcce,extraParams:_0x38c180,datasetCodes:_0x2b29bd})=>{const _0x2f9f40=a3_0x2a5e,{exit:_0x2913bc}=useApp(),[_0x2628c9,_0x2a7ace]=useState(![]),[_0x28bb05,_0x13ad5f]=useState(''),[_0x3fc13d,_0x50b862]=useState(![]),[_0x4b580f,_0x55b7b2]=useState(null),[_0x3da662,_0x3bc3fe]=useState(null),[_0x4e5553,_0x2a99a0]=useState(0x0),_0x55b99c=readConfig(),_0x357156=getConfigAppCode(),_0x51d244=_0x1c4cf2||_0x357156,_0x4076d1=typeof _0x55b99c?.[_0x2f9f40(0xda)]===_0x2f9f40(0xb7)?_0x55b99c['env']:undefined,_0x5e8925=_0x1b6f15||_0x4076d1||_0x2f9f40(0xd2);initEnv(_0x5e8925);const _0x174bd3=_0x35dcce||_0x2f9f40(0xc5),_0x50268f=_0x1c4cf2?_0x2f9f40(0xc7)+_0x51d244:_0x2f9f40(0xc9)+_0x51d244;useEffect(()=>{_0x2a7ace(!![]),_0x12a0ba();},[]),useEffect(()=>{(_0x3fc13d||_0x4b580f)&&_0x2913bc();},[_0x3fc13d,_0x4b580f,_0x2913bc]);async function _0x12a0ba(){const _0x1f5ce2=_0x2f9f40;if(!_0x51d244){_0x55b7b2(_0x1f5ce2(0xab));return;}try{logger['setLogPath'](process[_0x1f5ce2(0xb0)]()),_0x13ad5f(_0x1f5ce2(0xc1));const {configArray:_0x491a16}=await fetchModelList(_0x51d244);_0x2a99a0(_0x491a16[_0x1f5ce2(0xaa)]);if(_0x491a16[_0x1f5ce2(0xaa)]===0x0){_0x55b7b2(_0x1f5ce2(0xb1));return;}let _0x32bf8a=_0x491a16;if(_0x2b29bd&&_0x2b29bd['length']>0x0){_0x32bf8a=_0x491a16['filter'](_0x5e0292=>_0x2b29bd['includes'](_0x5e0292['datasetCode']));const _0x1a537c=_0x32bf8a[_0x1f5ce2(0xbc)](_0x6450e2=>_0x6450e2['datasetCode']),_0x75ab4f=_0x2b29bd['filter'](_0x3bd23e=>!_0x1a537c[_0x1f5ce2(0xcd)](_0x3bd23e));_0x75ab4f[_0x1f5ce2(0xaa)]>0x0&&console[_0x1f5ce2(0xd1)](_0x1f5ce2(0xac)+_0x75ab4f[_0x1f5ce2(0xcb)](',\x20')+_0x1f5ce2(0xb4));if(_0x32bf8a[_0x1f5ce2(0xaa)]===0x0){_0x55b7b2(_0x1f5ce2(0xce)+_0x2b29bd[_0x1f5ce2(0xcb)](',\x20'));return;}console[_0x1f5ce2(0xd1)]('\x1b[90m*\x20从\x20'+_0x491a16[_0x1f5ce2(0xaa)]+'\x20个数据集中筛选出\x20'+_0x32bf8a['length']+'\x20个匹配的数据集\x1b[0m');}_0x13ad5f(_0x1f5ce2(0xcc)+_0x32bf8a[_0x1f5ce2(0xaa)]+_0x1f5ce2(0xb9));const _0x29a40a=await generateDatasetDocs(_0x32bf8a,_0x51d244,_0x174bd3,(_0x10e9ea,_0x4d1444,_0x5886c9)=>{const _0x1ab09e=_0x1f5ce2;_0x13ad5f(_0x1ab09e(0xcc)+_0x5886c9+'.md\x20('+_0x10e9ea+'/'+_0x4d1444+')');},_0x38c180);_0x3bc3fe(_0x29a40a),_0x50b862(!![]);const _0xfc6a9e=_0x29a40a[_0x1f5ce2(0xe3)](_0x4b29d4=>_0x4b29d4[_0x1f5ce2(0xaf)])[_0x1f5ce2(0xaa)],_0x4a3e89=_0x29a40a['filter'](_0x2e8419=>!_0x2e8419[_0x1f5ce2(0xaf)])[_0x1f5ce2(0xaa)];logger[_0x1f5ce2(0xaf)](_0x1f5ce2(0xd4),_0x1f5ce2(0xcf),undefined,{'totalCount':_0x29a40a[_0x1f5ce2(0xaa)],'successCount':_0xfc6a9e,'failCount':_0x4a3e89,'outputDir':_0x174bd3});}catch(_0xd31a4f){const _0xabbbac=_0xd31a4f instanceof Error?_0xd31a4f[_0x1f5ce2(0xdc)]:String(_0xd31a4f);logger[_0x1f5ce2(0xbd)](_0x1f5ce2(0xd4),_0x1f5ce2(0xdf)+_0xabbbac,{'appCode':_0x51d244,'outputDir':_0x174bd3}),_0x55b7b2(_0x1f5ce2(0xdf)+_0xabbbac);}finally{_0x2a7ace(![]);}}const _0xec017=_0x3da662?.['filter'](_0x5ca79e=>_0x5ca79e[_0x2f9f40(0xaf)])['length']||0x0,_0x5683a3=_0x3da662?.['filter'](_0x4041d2=>!_0x4041d2[_0x2f9f40(0xaf)])[_0x2f9f40(0xaa)]||0x0;return a3_0x4cd473(Box,{'flexDirection':_0x2f9f40(0xc6),'children':[(_0x2628c9||_0x3fc13d)&&a3_0x4cd473(Box,{'children':[a3_0x45f2af(Text,{'color':_0x2f9f40(0xbe),'children':'*\x20'}),a3_0x45f2af(Text,{'color':_0x1c4cf2?_0x2f9f40(0xdd):_0x2f9f40(0xc8),'children':_0x50268f})]}),_0x2628c9&&a3_0x45f2af(Box,{'children':a3_0x4cd473(Text,{'children':[_0x2f9f40(0xc0),_0x28bb05,_0x2f9f40(0xd0),_0x5e8925,')']})}),_0x3fc13d&&_0x3da662&&a3_0x4cd473(Box,{'flexDirection':_0x2f9f40(0xc6),'children':[a3_0x45f2af(Box,{'children':a3_0x4cd473(Text,{'color':_0x2f9f40(0xe2),'children':[_0x2f9f40(0xde),_0xec017,'\x20个',_0x5683a3>0x0&&_0x2f9f40(0xd5)+_0x5683a3+'\x20个']})}),a3_0x45f2af(Box,{'marginTop':0x1,'children':a3_0x4cd473(Text,{'color':_0x2f9f40(0xbe),'children':[_0x2f9f40(0xc3),_0x4e5553,_0x2f9f40(0xbf)]})}),a3_0x4cd473(Box,{'marginTop':0x1,'children':[a3_0x45f2af(Text,{'color':_0x2f9f40(0xbe),'children':'*\x20输出目录:\x20'}),a3_0x45f2af(Text,{'color':'cyan','children':_0x174bd3})]}),_0xec017>0x0&&a3_0x4cd473(a3_0x497e8b,{'children':[a3_0x45f2af(Box,{'marginTop':0x1,'children':a3_0x45f2af(Text,{'color':_0x2f9f40(0xbe),'children':_0x2f9f40(0xb8)})}),_0x3da662[_0x2f9f40(0xe3)](_0x3c30bf=>_0x3c30bf[_0x2f9f40(0xaf)])[_0x2f9f40(0xbc)]((_0x3a878a,_0x4b1c84)=>a3_0x4cd473(Box,{'marginLeft':0x2,'children':[a3_0x4cd473(Text,{'color':_0x2f9f40(0xb6),'children':['•\x20',_0x3a878a[_0x2f9f40(0xad)]]}),a3_0x4cd473(Text,{'color':_0x2f9f40(0xc8),'children':['\x20-\x20',_0x3a878a[_0x2f9f40(0xc2)]]})]},_0x4b1c84))]}),_0x5683a3>0x0&&a3_0x4cd473(a3_0x497e8b,{'children':[a3_0x45f2af(Box,{'marginTop':0x1,'children':a3_0x45f2af(Text,{'color':_0x2f9f40(0xd9),'children':_0x2f9f40(0xd8)})}),_0x3da662[_0x2f9f40(0xe3)](_0x485982=>!_0x485982[_0x2f9f40(0xaf)])[_0x2f9f40(0xbc)]((_0x8ffc2c,_0x3daeb3)=>a3_0x4cd473(Box,{'marginLeft':0x2,'flexDirection':_0x2f9f40(0xc6),'children':[a3_0x4cd473(Text,{'color':_0x2f9f40(0xd3),'children':['•\x20',_0x8ffc2c['datasetName'],'\x20(',_0x8ffc2c[_0x2f9f40(0xca)],')']}),_0x8ffc2c['error']&&a3_0x45f2af(Box,{'marginLeft':0x2,'children':a3_0x45f2af(Text,{'color':'dim','children':_0x8ffc2c['error']})})]},_0x3daeb3))]})]}),_0x4b580f&&a3_0x4cd473(Box,{'flexDirection':_0x2f9f40(0xc6),'children':[a3_0x45f2af(Box,{'children':a3_0x4cd473(Text,{'color':'red','children':['❌\x20',_0x4b580f]})}),_0x4b580f[_0x2f9f40(0xcd)]('登录')&&a3_0x4cd473(Box,{'marginTop':0x1,'children':[a3_0x45f2af(Text,{'color':_0x2f9f40(0xd9),'children':_0x2f9f40(0xb5)}),a3_0x45f2af(Text,{'color':_0x2f9f40(0xb6),'children':'lovrabet\x20auth'}),a3_0x45f2af(Text,{'color':_0x2f9f40(0xd9),'children':_0x2f9f40(0xb3)})]})]})]});};
@@ -1 +1 @@
1
- const a4_0x13dda7=a4_0x2be0;(function(_0x461ab0,_0x338b2c){const _0x53d4bd=a4_0x2be0,_0x378e4c=_0x461ab0();while(!![]){try{const _0x409875=parseInt(_0x53d4bd(0x1ed))/0x1*(-parseInt(_0x53d4bd(0x1e6))/0x2)+-parseInt(_0x53d4bd(0x1f3))/0x3+-parseInt(_0x53d4bd(0x1f0))/0x4+-parseInt(_0x53d4bd(0x1eb))/0x5+-parseInt(_0x53d4bd(0x1fa))/0x6+parseInt(_0x53d4bd(0x1e5))/0x7+-parseInt(_0x53d4bd(0x1ef))/0x8*(-parseInt(_0x53d4bd(0x1e3))/0x9);if(_0x409875===_0x338b2c)break;else _0x378e4c['push'](_0x378e4c['shift']());}catch(_0x19a915){_0x378e4c['push'](_0x378e4c['shift']());}}}(a4_0x273d,0x77760));import{mkdirSync,writeFileSync}from'node:fs';import a4_0x472112 from'node:path';function a4_0x2be0(_0x2f7b6a,_0x418dd9){const _0x273de4=a4_0x273d();return a4_0x2be0=function(_0x2be095,_0x4cec8c){_0x2be095=_0x2be095-0x1df;let _0x433a61=_0x273de4[_0x2be095];return _0x433a61;},a4_0x2be0(_0x2f7b6a,_0x418dd9);}function a4_0x273d(){const _0x48732f=['join','application/json','获取文档失败\x20(','),HTTP状态码:\x20','error','text','✗\x20失败:\x20','响应数据格式错误\x20(','3739509NGKpjr','登录鉴权失败,登录已过期,请使用\x20lovrabet\x20auth\x20重新登录','2086630kuWDvO','2qkKorA','生成文档失败:\x20','.md\x20-\x20','\x20个数据集需要生成文档\x0a','data','645980Vwuaxq','log','105548AnkqcX','datasetCode','40OgAwuj','2159492dYYNyx','string','name','801297qxSmAv','等待\x203\x20秒...\x0a','json','✓\x20成功生成:\x20','POST','length','success','5067402nkGxGf','.md\x20(','markdown','./docs','message','push','utf8','\x0a共有\x20',']\x20正在生成:\x20','.md'];a4_0x273d=function(){return _0x48732f;};return a4_0x273d();}import{getCookie}from'../auth/get-cookie.js';import{getApiDomain}from'../constant/domain.js';import{logger}from'../utils/logger.js';export async function fetchDatasetDoc(_0x81ee6c){const _0x13ecaf=a4_0x2be0,{appCode:_0x51a02d,datasetCode:_0x5c5b5f,datasetId:_0x177179,extraParams:_0x1fdbe5}=_0x81ee6c,_0x4a51dc=getApiDomain(),_0x42eca4=_0x4a51dc+'/api/node-toolbox/api-doc-generator',_0x3c6f4e={'appCode':_0x51a02d,'datasetCode':_0x5c5b5f,'datasetId':_0x177179,..._0x1fdbe5||{}},_0x11010b=await fetch(_0x42eca4,{'method':_0x13ecaf(0x1f7),'headers':{'Content-Type':_0x13ecaf(0x205),'Cookie':getCookie()},'body':JSON['stringify'](_0x3c6f4e)});if(!_0x11010b['ok']){if(_0x11010b['status']===0x191)throw new Error(_0x13ecaf(0x1e4));let _0x38d5c3='';try{_0x38d5c3=await _0x11010b[_0x13ecaf(0x1e0)]();}catch(_0x21a7e3){}throw new Error(_0x13ecaf(0x206)+_0x5c5b5f+_0x13ecaf(0x207)+_0x11010b['status']+(_0x38d5c3?'\x0a'+_0x38d5c3:''));}const _0x4a9b9a=await _0x11010b[_0x13ecaf(0x1f5)]();if(!_0x4a9b9a[_0x13ecaf(0x1ea)]||typeof _0x4a9b9a[_0x13ecaf(0x1ea)][_0x13ecaf(0x1fc)]!==_0x13ecaf(0x1f1))throw new Error(_0x13ecaf(0x1e2)+_0x5c5b5f+'):缺少\x20data.markdown\x20字段');return _0x4a9b9a[_0x13ecaf(0x1ea)][_0x13ecaf(0x1fc)];}function delay(_0x18e218){return new Promise(_0x235af5=>setTimeout(_0x235af5,_0x18e218));}export async function generateDatasetDocs(_0x13924a,_0x230d48,_0x17ca29=a4_0x13dda7(0x1fd),_0x11892c,_0x51a40b){const _0xfeb2ae=a4_0x13dda7;mkdirSync(_0x17ca29,{'recursive':!![]});const _0x3cd12d=[],_0x26e902=_0x13924a[_0xfeb2ae(0x1f8)];console[_0xfeb2ae(0x1ec)](_0xfeb2ae(0x201)+_0x26e902+_0xfeb2ae(0x1e9));for(let _0x722004=0x0;_0x722004<_0x13924a['length'];_0x722004++){const _0x12b2af=_0x13924a[_0x722004],_0x5a9b44=_0x722004+0x1,_0x5808ac=_0x12b2af['tableName'];try{console[_0xfeb2ae(0x1ec)]('['+_0x5a9b44+'/'+_0x26e902+_0xfeb2ae(0x202)+_0x5808ac+_0xfeb2ae(0x1fb)+_0x12b2af[_0xfeb2ae(0x1f2)]+')');_0x11892c&&_0x11892c(_0x5a9b44,_0x26e902,_0x5808ac);const _0x5e3022=await fetchDatasetDoc({'appCode':_0x230d48,'datasetCode':_0x12b2af[_0xfeb2ae(0x1ee)],'datasetId':_0x12b2af['id'],'enableAI':![],'extraParams':_0x51a40b}),_0x3f0907=a4_0x472112[_0xfeb2ae(0x204)](_0x17ca29,_0x5808ac+'.md');writeFileSync(_0x3f0907,_0x5e3022,{'encoding':_0xfeb2ae(0x200)}),console['log'](_0xfeb2ae(0x1f6)+_0x5808ac+_0xfeb2ae(0x203)),logger[_0xfeb2ae(0x1f9)]('api-doc','生成文档成功:\x20'+_0x5808ac,undefined,{'datasetCode':_0x12b2af['datasetCode'],'datasetName':_0x12b2af['name'],'filePath':_0x3f0907,'progress':_0x5a9b44+'/'+_0x26e902}),_0x3cd12d[_0xfeb2ae(0x1ff)]({'datasetCode':_0x12b2af['datasetCode'],'datasetName':_0x12b2af[_0xfeb2ae(0x1f2)],'filePath':_0x3f0907,'success':!![]}),_0x5a9b44<_0x26e902&&await delay(0x1388);}catch(_0x956e29){const _0x67228d=_0x956e29 instanceof Error?_0x956e29[_0xfeb2ae(0x1fe)]:String(_0x956e29);console[_0xfeb2ae(0x1ec)](_0xfeb2ae(0x1e1)+_0x5808ac+_0xfeb2ae(0x1e8)+_0x67228d+'\x0a'),logger[_0xfeb2ae(0x1df)]('api-doc',_0xfeb2ae(0x1e7)+_0x12b2af['datasetCode'],{'datasetCode':_0x12b2af[_0xfeb2ae(0x1ee)],'datasetName':_0x12b2af['name'],'error':_0x67228d,'progress':_0x5a9b44+'/'+_0x26e902}),_0x3cd12d['push']({'datasetCode':_0x12b2af[_0xfeb2ae(0x1ee)],'datasetName':_0x12b2af[_0xfeb2ae(0x1f2)],'filePath':'','success':![],'error':_0x67228d}),_0x5a9b44<_0x26e902&&(console[_0xfeb2ae(0x1ec)](_0xfeb2ae(0x1f4)),await delay(0xbb8));}}return _0x3cd12d;}
1
+ const a4_0x2cca40=a4_0x41ad;(function(_0x5b97ac,_0x4ad9a5){const _0x36df8b=a4_0x41ad,_0x36b934=_0x5b97ac();while(!![]){try{const _0x3b943d=parseInt(_0x36df8b(0x1b8))/0x1*(-parseInt(_0x36df8b(0x1a8))/0x2)+parseInt(_0x36df8b(0x1c0))/0x3*(parseInt(_0x36df8b(0x1c2))/0x4)+-parseInt(_0x36df8b(0x1ba))/0x5+parseInt(_0x36df8b(0x1be))/0x6*(-parseInt(_0x36df8b(0x1bb))/0x7)+parseInt(_0x36df8b(0x1c8))/0x8*(parseInt(_0x36df8b(0x1bc))/0x9)+-parseInt(_0x36df8b(0x1c4))/0xa*(parseInt(_0x36df8b(0x1ac))/0xb)+parseInt(_0x36df8b(0x1b5))/0xc;if(_0x3b943d===_0x4ad9a5)break;else _0x36b934['push'](_0x36b934['shift']());}catch(_0x2b3e6e){_0x36b934['push'](_0x36b934['shift']());}}}(a4_0x54ff,0x9b8be));import{mkdirSync,writeFileSync}from'node:fs';import a4_0x523a89 from'node:path';import{getCookie}from'../auth/get-cookie.js';import{getApiDomain}from'../constant/domain.js';function a4_0x41ad(_0x2dde78,_0xb9a06b){const _0x54ff56=a4_0x54ff();return a4_0x41ad=function(_0x41add1,_0x6b3402){_0x41add1=_0x41add1-0x19e;let _0x14bb83=_0x54ff56[_0x41add1];return _0x14bb83;},a4_0x41ad(_0x2dde78,_0xb9a06b);}import{logger}from'../utils/logger.js';function a4_0x54ff(){const _0x3f057c=['stringify','log','生成文档失败:\x20','application/json','.md','message','36964620aydutC','markdown','生成文档成功:\x20','27141gPLmEc','data','2396220WKPUEu','5240837GjMHTu','9jvayuJ','获取文档失败\x20(','6VQMBel','\x0a共有\x20','9gCZaVm','✗\x20失败:\x20','67348JKPoyS','datasetCode','11581580HQhcGZ','api-doc','success','error','5218104qFVtqZ','✓\x20成功生成:\x20',']\x20正在生成:\x20','push','tableName','登录鉴权失败,登录已过期,请使用\x20lovrabet\x20auth\x20重新登录','\x20个数据集需要生成文档\x0a','./docs','length','.md\x20(','.md\x20-\x20','56qcAfkD','等待\x203\x20秒...\x0a','/api/node-toolbox/api-doc-generator','name','11dmjMGm','status','text'];a4_0x54ff=function(){return _0x3f057c;};return a4_0x54ff();}export async function fetchDatasetDoc(_0x4c6551){const _0xc477d5=a4_0x41ad,{appCode:_0x272ed1,datasetCode:_0x3784bc,datasetId:_0x42baae,extraParams:_0x397efe}=_0x4c6551,_0x4ca38e=getApiDomain(),_0x2935ce=_0x4ca38e+_0xc477d5(0x1aa),_0x233f50={'appCode':_0x272ed1,'datasetCode':_0x3784bc,'datasetId':_0x42baae,..._0x397efe||{}},_0x343b5e=await fetch(_0x2935ce,{'method':'POST','headers':{'Content-Type':_0xc477d5(0x1b2),'Cookie':getCookie()},'body':JSON[_0xc477d5(0x1af)](_0x233f50)});if(!_0x343b5e['ok']){if(_0x343b5e[_0xc477d5(0x1ad)]===0x191)throw new Error(_0xc477d5(0x1a2));let _0x21f4a3='';try{_0x21f4a3=await _0x343b5e[_0xc477d5(0x1ae)]();}catch(_0x37e9b4){}throw new Error(_0xc477d5(0x1bd)+_0x3784bc+'),HTTP状态码:\x20'+_0x343b5e[_0xc477d5(0x1ad)]+(_0x21f4a3?'\x0a'+_0x21f4a3:''));}const _0xf0fbe0=await _0x343b5e['json']();if(!_0xf0fbe0[_0xc477d5(0x1b9)]||typeof _0xf0fbe0[_0xc477d5(0x1b9)][_0xc477d5(0x1b6)]!=='string')throw new Error('响应数据格式错误\x20('+_0x3784bc+'):缺少\x20data.markdown\x20字段');return _0xf0fbe0[_0xc477d5(0x1b9)][_0xc477d5(0x1b6)];}function delay(_0xd6a6c1){return new Promise(_0xb738b8=>setTimeout(_0xb738b8,_0xd6a6c1));}export async function generateDatasetDocs(_0x27554d,_0x5d27c8,_0x4d11a2=a4_0x2cca40(0x1a4),_0x378c3d,_0x40045e){const _0x5df3ca=a4_0x2cca40;mkdirSync(_0x4d11a2,{'recursive':!![]});const _0x541e5c=[],_0x202412=_0x27554d[_0x5df3ca(0x1a5)];console['log'](_0x5df3ca(0x1bf)+_0x202412+_0x5df3ca(0x1a3));for(let _0x50db7e=0x0;_0x50db7e<_0x27554d[_0x5df3ca(0x1a5)];_0x50db7e++){const _0x29f87c=_0x27554d[_0x50db7e],_0x4bd1ee=_0x50db7e+0x1,_0x18c988=_0x29f87c[_0x5df3ca(0x1a1)];try{console[_0x5df3ca(0x1b0)]('['+_0x4bd1ee+'/'+_0x202412+_0x5df3ca(0x19f)+_0x18c988+_0x5df3ca(0x1a6)+_0x29f87c['name']+')');_0x378c3d&&_0x378c3d(_0x4bd1ee,_0x202412,_0x18c988);const _0xf33642=await fetchDatasetDoc({'appCode':_0x5d27c8,'datasetCode':_0x29f87c[_0x5df3ca(0x1c3)],'datasetId':_0x29f87c['id'],'enableAI':![],'extraParams':_0x40045e}),_0x211256=a4_0x523a89['join'](_0x4d11a2,_0x18c988+_0x5df3ca(0x1b3));writeFileSync(_0x211256,_0xf33642,{'encoding':'utf8'}),console[_0x5df3ca(0x1b0)](_0x5df3ca(0x19e)+_0x18c988+'.md'),logger[_0x5df3ca(0x1c6)](_0x5df3ca(0x1c5),_0x5df3ca(0x1b7)+_0x18c988,undefined,{'datasetCode':_0x29f87c[_0x5df3ca(0x1c3)],'datasetName':_0x29f87c[_0x5df3ca(0x1ab)],'filePath':_0x211256,'progress':_0x4bd1ee+'/'+_0x202412}),_0x541e5c['push']({'datasetCode':_0x29f87c[_0x5df3ca(0x1c3)],'datasetName':_0x29f87c['name'],'filePath':_0x211256,'success':!![]}),_0x4bd1ee<_0x202412&&await delay(0x1388);}catch(_0xde10a7){const _0x55e2d5=_0xde10a7 instanceof Error?_0xde10a7[_0x5df3ca(0x1b4)]:String(_0xde10a7);console['log'](_0x5df3ca(0x1c1)+_0x18c988+_0x5df3ca(0x1a7)+_0x55e2d5+'\x0a'),logger[_0x5df3ca(0x1c7)]('api-doc',_0x5df3ca(0x1b1)+_0x29f87c[_0x5df3ca(0x1c3)],{'datasetCode':_0x29f87c[_0x5df3ca(0x1c3)],'datasetName':_0x29f87c[_0x5df3ca(0x1ab)],'error':_0x55e2d5,'progress':_0x4bd1ee+'/'+_0x202412}),_0x541e5c[_0x5df3ca(0x1a0)]({'datasetCode':_0x29f87c['datasetCode'],'datasetName':_0x29f87c[_0x5df3ca(0x1ab)],'filePath':'','success':![],'error':_0x55e2d5}),_0x4bd1ee<_0x202412&&(console[_0x5df3ca(0x1b0)](_0x5df3ca(0x1a9)),await delay(0xbb8));}}return _0x541e5c;}
@@ -1 +1 @@
1
- (function(_0x28c1a1,_0x345f71){const _0x3b8fc5=a5_0x5430,_0x206476=_0x28c1a1();while(!![]){try{const _0x2cf85f=parseInt(_0x3b8fc5(0x123))/0x1+-parseInt(_0x3b8fc5(0x131))/0x2+parseInt(_0x3b8fc5(0x129))/0x3*(-parseInt(_0x3b8fc5(0x105))/0x4)+-parseInt(_0x3b8fc5(0x112))/0x5+parseInt(_0x3b8fc5(0xff))/0x6*(-parseInt(_0x3b8fc5(0x124))/0x7)+parseInt(_0x3b8fc5(0xfc))/0x8*(-parseInt(_0x3b8fc5(0xfe))/0x9)+parseInt(_0x3b8fc5(0x104))/0xa;if(_0x2cf85f===_0x345f71)break;else _0x206476['push'](_0x206476['shift']());}catch(_0x57fdb7){_0x206476['push'](_0x206476['shift']());}}}(a5_0x442e,0x6b65a));function a5_0x5430(_0x4d8849,_0x1f1efc){const _0x442eae=a5_0x442e();return a5_0x5430=function(_0x5430fc,_0xd7769c){_0x5430fc=_0x5430fc-0xfb;let _0x186083=_0x442eae[_0x5430fc];return _0x186083;},a5_0x5430(_0x4d8849,_0x1f1efc);}import{jsx as a5_0x59cac3,jsxs as a5_0x307464}from'react/jsx-runtime';import{useEffect,useState}from'react';import{Box,Text,useApp}from'ink';import{readConfig,getConfigAppCode}from'../utils/config.js';import{initEnv}from'../constant/env.js';import{generateApiFile}from'./generate-api-file.js';import{logger}from'../utils/logger.js';function a5_0x442e(){const _0x2038a7=['√\x20成功拉取\x20','originalCount','yellow','white','gray','\x20个数据集,生成','.ts','split','red','\x20from\x20\x27@/','length','拉取\x20API\x20配置失败:\x20','cwd','\x20个模型','cyan','column','725204HeiJAg','14oZWYSJ','env','setLogPath','import\x20','client','2634591XXcoAC','api','*\x20导入方式:','error','使用指定的应用AppCode:\x20','-client','{\x20lovrabetClient\x20}','api-pull','1740692NDjMOL','string','使用配置的应用AppCode:\x20','144WbuWbP','*\x20已生成文件:','383877CoPOgQ','1647402dXZPAE','./src/api/','modelCount','slice','\x20个,过滤重复','33004270AHOUIA','4aLAiad','💡\x20请使用\x20','green','endsWith','!\x20原始数据集\x20','duplicateCount','replace','🚀\x20正在从服务器拉取\x20API\x20配置...\x20(环境:\x20','message','dim','includes','-api','\x20个模型)','2601510MULjKF'];a5_0x442e=function(){return _0x2038a7;};return a5_0x442e();}import{fetchModelList}from'./fetch-model-list.js';export const ApiPullUI=({appCode:_0x208f66,env:_0x1e51e5,output:_0x4a4eb9})=>{const _0x553019=a5_0x5430,{exit:_0x531dd3}=useApp(),[_0x48be15,_0x5e72e5]=useState(![]),[_0x53809e,_0x57c05a]=useState(![]),[_0x4b802e,_0x875d53]=useState(null),[_0x2cd1d7,_0x49ee72]=useState(null),_0x5d64df=readConfig(),_0x11f9cd=getConfigAppCode(),_0x1e5724=_0x208f66||_0x11f9cd,_0x3578b8=typeof _0x5d64df?.[_0x553019(0x125)]===_0x553019(0x132)?_0x5d64df['env']:undefined,_0x49fd42=_0x1e51e5||_0x3578b8||'online';initEnv(_0x49fd42);const _0x47250d=_0x4a4eb9||_0x553019(0x100),_0x8300de=_0x208f66&&_0x208f66[_0x553019(0x10f)]('-')?_0x208f66[_0x553019(0x11a)]('-')[_0x553019(0x102)](0x1)['join']('-'):'',_0x55c9bb=_0x208f66?_0x553019(0x12d)+_0x1e5724:_0x553019(0xfb)+_0x1e5724,_0xce2d84=_0x8300de?_0x8300de+_0x553019(0x110):_0x553019(0x12a),_0x2a2ba5=_0x8300de?_0x8300de+_0x553019(0x12e):_0x553019(0x128);useEffect(()=>{_0x5e72e5(!![]),_0x8bcb6f();},[]),useEffect(()=>{(_0x53809e||_0x4b802e)&&_0x531dd3();},[_0x53809e,_0x4b802e,_0x531dd3]);async function _0x8bcb6f(){const _0x54302d=_0x553019;if(!_0x1e5724){_0x875d53('未提供应用AppCode,且配置中也没有默认值');return;}try{logger[_0x54302d(0x126)](process[_0x54302d(0x11f)]());const {configArray:_0x2be7c3}=await fetchModelList(_0x1e5724),_0x3bcb4e=_0x2be7c3[_0x54302d(0x11d)],_0x5cd535=!_0x208f66,_0x3b4cd9=await generateApiFile(_0x2be7c3,_0x8300de,_0x1e5724,_0x5cd535,_0x49fd42,_0x47250d),_0x548f2a=_0x47250d[_0x54302d(0x108)]('/')?_0x47250d:_0x47250d+'/';_0x49ee72({'api':''+_0x548f2a+_0xce2d84+_0x54302d(0x119),'client':''+_0x548f2a+_0x2a2ba5+'.ts','modelCount':_0x3b4cd9[_0x54302d(0x101)],'datasetCount':_0x3bcb4e,'originalCount':_0x3bcb4e,'duplicateCount':0x0}),_0x57c05a(!![]);}catch(_0x5ecf40){const _0x37b558=_0x5ecf40 instanceof Error?_0x5ecf40[_0x54302d(0x10d)]:String(_0x5ecf40);logger[_0x54302d(0x12c)](_0x54302d(0x130),_0x54302d(0x11e)+_0x37b558,{'appCode':_0x1e5724,'error':_0x37b558}),_0x875d53(_0x54302d(0x11e)+_0x37b558);}finally{_0x5e72e5(![]);}}return a5_0x307464(Box,{'flexDirection':_0x553019(0x122),'children':[(_0x48be15||_0x53809e)&&a5_0x307464(Box,{'children':[a5_0x59cac3(Text,{'color':_0x553019(0x117),'children':'*\x20'}),a5_0x59cac3(Text,{'color':_0x208f66?_0x553019(0x116):_0x553019(0x10e),'children':_0x55c9bb})]}),_0x48be15&&a5_0x59cac3(Box,{'children':a5_0x307464(Text,{'children':[_0x553019(0x10c),_0x49fd42,')']})}),_0x53809e&&_0x2cd1d7&&a5_0x307464(Box,{'flexDirection':_0x553019(0x122),'children':[a5_0x59cac3(Box,{'children':a5_0x307464(Text,{'color':_0x553019(0x107),'children':[_0x553019(0x113),_0x2cd1d7['datasetCount'],_0x553019(0x118),'\x20',_0x2cd1d7[_0x553019(0x101)],_0x553019(0x120)]})}),_0x2cd1d7[_0x553019(0x10a)]>0x0&&a5_0x59cac3(Box,{'marginTop':0x1,'children':a5_0x307464(Text,{'color':'yellow','children':[_0x553019(0x109),_0x2cd1d7[_0x553019(0x114)],_0x553019(0x103),'\x20',_0x2cd1d7[_0x553019(0x10a)],'\x20个']})}),a5_0x59cac3(Box,{'marginTop':0x1,'children':a5_0x59cac3(Text,{'color':'gray','children':_0x553019(0xfd)})}),a5_0x307464(Box,{'marginLeft':0x2,'children':[a5_0x307464(Text,{'color':_0x553019(0x121),'children':['•\x20',_0x2cd1d7[_0x553019(0x12a)]]}),a5_0x307464(Text,{'color':_0x553019(0x10e),'children':['\x20','-\x20模型配置文件\x20(',_0x2cd1d7[_0x553019(0x101)],_0x553019(0x111)]})]}),a5_0x307464(Box,{'marginLeft':0x2,'children':[a5_0x307464(Text,{'color':'cyan','children':['•\x20',_0x2cd1d7[_0x553019(0x128)]]}),a5_0x59cac3(Text,{'color':_0x553019(0x10e),'children':'\x20-\x20客户端实例文件'})]}),a5_0x59cac3(Box,{'marginTop':0x1,'children':a5_0x59cac3(Text,{'color':_0x553019(0x117),'children':_0x553019(0x12b)})}),a5_0x59cac3(Box,{'marginLeft':0x2,'children':a5_0x307464(Text,{'color':_0x553019(0x115),'children':[_0x553019(0x127),_0x553019(0x12f),_0x553019(0x11c),_0x2cd1d7[_0x553019(0x128)][_0x553019(0x10b)](/^\.\//,'')[_0x553019(0x10b)](_0x553019(0x119),''),'\x27']})})]}),_0x4b802e&&a5_0x307464(Box,{'flexDirection':'column','children':[a5_0x59cac3(Box,{'children':a5_0x307464(Text,{'color':_0x553019(0x11b),'children':['❌\x20',_0x4b802e]})}),_0x4b802e[_0x553019(0x10f)]('登录')&&a5_0x307464(Box,{'marginTop':0x1,'children':[a5_0x59cac3(Text,{'color':_0x553019(0x115),'children':_0x553019(0x106)}),a5_0x59cac3(Text,{'color':'cyan','children':'lovrabet\x20auth'}),a5_0x59cac3(Text,{'color':'yellow','children':'\x20重新登录后再试'})]})]})]});};
1
+ (function(_0x4f7dd8,_0x4cfce7){const _0x463d9f=a5_0x345b,_0x4e9a3c=_0x4f7dd8();while(!![]){try{const _0x2283d5=parseInt(_0x463d9f(0xf8))/0x1+-parseInt(_0x463d9f(0xf0))/0x2+parseInt(_0x463d9f(0x10e))/0x3+-parseInt(_0x463d9f(0xf9))/0x4+-parseInt(_0x463d9f(0x113))/0x5+-parseInt(_0x463d9f(0xe0))/0x6*(-parseInt(_0x463d9f(0xfd))/0x7)+parseInt(_0x463d9f(0xf3))/0x8;if(_0x2283d5===_0x4cfce7)break;else _0x4e9a3c['push'](_0x4e9a3c['shift']());}catch(_0x572bf7){_0x4e9a3c['push'](_0x4e9a3c['shift']());}}}(a5_0x2a97,0x6e4b8));import{jsx as a5_0x23c750,jsxs as a5_0x1fff73}from'react/jsx-runtime';import{useEffect,useState}from'react';function a5_0x345b(_0x75f31f,_0x5bf6f1){const _0x2a97c2=a5_0x2a97();return a5_0x345b=function(_0x345b01,_0x196bff){_0x345b01=_0x345b01-0xe0;let _0x4167e6=_0x2a97c2[_0x345b01];return _0x4167e6;},a5_0x345b(_0x75f31f,_0x5bf6f1);}import{Box,Text,useApp}from'ink';import{readConfig,getConfigAppCode}from'../utils/config.js';import{initEnv}from'../constant/env.js';import{generateApiFile}from'./generate-api-file.js';function a5_0x2a97(){const _0x3ba30e=['./src/api/','1720794qvjUlF','modelCount','\x20重新登录后再试','13943024ouxbSC','\x20个模型)','endsWith','-api','拉取\x20API\x20配置失败:\x20','447727dGEgRe','3395496yjLjyI','-\x20模型配置文件\x20(','使用配置的应用AppCode:\x20','lovrabet\x20auth','21BvsqPT','includes','使用指定的应用AppCode:\x20','duplicateCount','env','\x20-\x20客户端实例文件','slice','dim','api','\x20个模型','.ts','import\x20','originalCount','gray','{\x20lovrabetClient\x20}','join','online','1364580xPLFzp','cyan','string','\x20个,过滤重复','√\x20成功拉取\x20','2577125qjyHkJ','red','yellow','green','client','61998dobZsh','split','\x20个数据集,生成','white','🚀\x20正在从服务器拉取\x20API\x20配置...\x20(环境:\x20','length','message','replace','api-pull','setLogPath','\x20from\x20\x27@/','column','*\x20导入方式:','未提供应用AppCode,且配置中也没有默认值','error'];a5_0x2a97=function(){return _0x3ba30e;};return a5_0x2a97();}import{logger}from'../utils/logger.js';import{fetchModelList}from'./fetch-model-list.js';export const ApiPullUI=({appCode:_0x5da73e,env:_0x4c4c5b,output:_0x4cd02a})=>{const _0xca0c81=a5_0x345b,{exit:_0x20bfed}=useApp(),[_0x58bdd1,_0x34fa32]=useState(![]),[_0x1ece26,_0x528479]=useState(![]),[_0x2bd7b0,_0x4cd216]=useState(null),[_0x4c3b7d,_0xbf4007]=useState(null),_0x5535a4=readConfig(),_0x31000b=getConfigAppCode(),_0x48b989=_0x5da73e||_0x31000b,_0x51b4d4=typeof _0x5535a4?.[_0xca0c81(0x101)]===_0xca0c81(0x110)?_0x5535a4['env']:undefined,_0x1ce4a0=_0x4c4c5b||_0x51b4d4||_0xca0c81(0x10d);initEnv(_0x1ce4a0);const _0x1a2d3f=_0x4cd02a||_0xca0c81(0xef),_0x4d71f9=_0x5da73e&&_0x5da73e[_0xca0c81(0xfe)]('-')?_0x5da73e[_0xca0c81(0xe1)]('-')[_0xca0c81(0x103)](0x1)[_0xca0c81(0x10c)]('-'):'',_0x135e2d=_0x5da73e?_0xca0c81(0xff)+_0x48b989:_0xca0c81(0xfb)+_0x48b989,_0x38d1a1=_0x4d71f9?_0x4d71f9+_0xca0c81(0xf6):_0xca0c81(0x105),_0x2c2516=_0x4d71f9?_0x4d71f9+'-client':'client';useEffect(()=>{_0x34fa32(!![]),_0x587d74();},[]),useEffect(()=>{(_0x1ece26||_0x2bd7b0)&&_0x20bfed();},[_0x1ece26,_0x2bd7b0,_0x20bfed]);async function _0x587d74(){const _0x447232=_0xca0c81;if(!_0x48b989){_0x4cd216(_0x447232(0xed));return;}try{logger[_0x447232(0xe9)](process['cwd']());const {configArray:_0x51b89b}=await fetchModelList(_0x48b989),_0x3a78ec=_0x51b89b[_0x447232(0xe5)],_0x572640=!_0x5da73e,_0x5ba0c0=await generateApiFile(_0x51b89b,_0x4d71f9,_0x48b989,_0x572640,_0x1ce4a0,_0x1a2d3f),_0x3bce4c=_0x1a2d3f[_0x447232(0xf5)]('/')?_0x1a2d3f:_0x1a2d3f+'/';_0xbf4007({'api':''+_0x3bce4c+_0x38d1a1+_0x447232(0x107),'client':''+_0x3bce4c+_0x2c2516+'.ts','modelCount':_0x5ba0c0[_0x447232(0xf1)],'datasetCount':_0x3a78ec,'originalCount':_0x3a78ec,'duplicateCount':0x0}),_0x528479(!![]);}catch(_0x237492){const _0x22cdde=_0x237492 instanceof Error?_0x237492[_0x447232(0xe6)]:String(_0x237492);logger[_0x447232(0xee)](_0x447232(0xe8),_0x447232(0xf7)+_0x22cdde,{'appCode':_0x48b989,'error':_0x22cdde}),_0x4cd216(_0x447232(0xf7)+_0x22cdde);}finally{_0x34fa32(![]);}}return a5_0x1fff73(Box,{'flexDirection':'column','children':[(_0x58bdd1||_0x1ece26)&&a5_0x1fff73(Box,{'children':[a5_0x23c750(Text,{'color':_0xca0c81(0x10a),'children':'*\x20'}),a5_0x23c750(Text,{'color':_0x5da73e?_0xca0c81(0xe3):_0xca0c81(0x104),'children':_0x135e2d})]}),_0x58bdd1&&a5_0x23c750(Box,{'children':a5_0x1fff73(Text,{'children':[_0xca0c81(0xe4),_0x1ce4a0,')']})}),_0x1ece26&&_0x4c3b7d&&a5_0x1fff73(Box,{'flexDirection':_0xca0c81(0xeb),'children':[a5_0x23c750(Box,{'children':a5_0x1fff73(Text,{'color':_0xca0c81(0x116),'children':[_0xca0c81(0x112),_0x4c3b7d['datasetCount'],_0xca0c81(0xe2),'\x20',_0x4c3b7d[_0xca0c81(0xf1)],_0xca0c81(0x106)]})}),_0x4c3b7d[_0xca0c81(0x100)]>0x0&&a5_0x23c750(Box,{'marginTop':0x1,'children':a5_0x1fff73(Text,{'color':_0xca0c81(0x115),'children':['!\x20原始数据集\x20',_0x4c3b7d[_0xca0c81(0x109)],_0xca0c81(0x111),'\x20',_0x4c3b7d[_0xca0c81(0x100)],'\x20个']})}),a5_0x23c750(Box,{'marginTop':0x1,'children':a5_0x23c750(Text,{'color':_0xca0c81(0x10a),'children':'*\x20已生成文件:'})}),a5_0x1fff73(Box,{'marginLeft':0x2,'children':[a5_0x1fff73(Text,{'color':_0xca0c81(0x10f),'children':['•\x20',_0x4c3b7d[_0xca0c81(0x105)]]}),a5_0x1fff73(Text,{'color':_0xca0c81(0x104),'children':['\x20',_0xca0c81(0xfa),_0x4c3b7d[_0xca0c81(0xf1)],_0xca0c81(0xf4)]})]}),a5_0x1fff73(Box,{'marginLeft':0x2,'children':[a5_0x1fff73(Text,{'color':_0xca0c81(0x10f),'children':['•\x20',_0x4c3b7d[_0xca0c81(0x117)]]}),a5_0x23c750(Text,{'color':'dim','children':_0xca0c81(0x102)})]}),a5_0x23c750(Box,{'marginTop':0x1,'children':a5_0x23c750(Text,{'color':_0xca0c81(0x10a),'children':_0xca0c81(0xec)})}),a5_0x23c750(Box,{'marginLeft':0x2,'children':a5_0x1fff73(Text,{'color':_0xca0c81(0x115),'children':[_0xca0c81(0x108),_0xca0c81(0x10b),_0xca0c81(0xea),_0x4c3b7d[_0xca0c81(0x117)][_0xca0c81(0xe7)](/^\.\//,'')[_0xca0c81(0xe7)]('.ts',''),'\x27']})})]}),_0x2bd7b0&&a5_0x1fff73(Box,{'flexDirection':_0xca0c81(0xeb),'children':[a5_0x23c750(Box,{'children':a5_0x1fff73(Text,{'color':_0xca0c81(0x114),'children':['❌\x20',_0x2bd7b0]})}),_0x2bd7b0[_0xca0c81(0xfe)]('登录')&&a5_0x1fff73(Box,{'marginTop':0x1,'children':[a5_0x23c750(Text,{'color':'yellow','children':'💡\x20请使用\x20'}),a5_0x23c750(Text,{'color':_0xca0c81(0x10f),'children':_0xca0c81(0xfc)}),a5_0x23c750(Text,{'color':'yellow','children':_0xca0c81(0xf2)})]})]})]});};
@@ -1 +1 @@
1
- (function(_0x455d9a,_0xb5370f){const _0x5e5bdd=a6_0x2d1a,_0x57b596=_0x455d9a();while(!![]){try{const _0x199ef7=parseInt(_0x5e5bdd(0x7c))/0x1*(-parseInt(_0x5e5bdd(0x89))/0x2)+-parseInt(_0x5e5bdd(0x80))/0x3+-parseInt(_0x5e5bdd(0x8b))/0x4+-parseInt(_0x5e5bdd(0x8c))/0x5+-parseInt(_0x5e5bdd(0x86))/0x6+-parseInt(_0x5e5bdd(0x85))/0x7+parseInt(_0x5e5bdd(0x7f))/0x8*(parseInt(_0x5e5bdd(0x7d))/0x9);if(_0x199ef7===_0xb5370f)break;else _0x57b596['push'](_0x57b596['shift']());}catch(_0x395e61){_0x57b596['push'](_0x57b596['shift']());}}}(a6_0x5799,0xda787));function a6_0x5799(){const _0x9d4e36=['status','count','44hJKUAh','765GcVaJO','message','753568dttXcP','3713697xskuDd','登录鉴权失败,登录已过期,请使用\x20lovrabet\x20auth\x20重新登录','/api/node-toolbox/dataset/model-list?appcode=','未知错误','data','8525286nAEsYX','3624606MaPIlh','json','正在从服务器拉取模型列表...\x20(环境:\x20','79522XAKONg','success','3476488TpuzzF','7166505TQYUQr','获取数据集失败:\x20','&otype=array'];a6_0x5799=function(){return _0x9d4e36;};return a6_0x5799();}function a6_0x2d1a(_0x4a4775,_0x225645){const _0x5799a4=a6_0x5799();return a6_0x2d1a=function(_0x2d1ab5,_0x4bc033){_0x2d1ab5=_0x2d1ab5-0x7a;let _0x20e457=_0x5799a4[_0x2d1ab5];return _0x20e457;},a6_0x2d1a(_0x4a4775,_0x225645);}import{getCookie}from'../auth/get-cookie.js';import{getApiDomain}from'../constant/domain.js';import{logger}from'../utils/logger.js';import{getEnv}from'../constant/env.js';export async function fetchModelList(_0xa3e22e){const _0xdb3d40=a6_0x2d1a,_0x12baa8=getEnv(),_0x436f3d=getApiDomain()+_0xdb3d40(0x82)+_0xa3e22e+_0xdb3d40(0x8e);logger['info']('fetch-model-list',_0xdb3d40(0x88)+_0x12baa8+')',{'apiUrl':_0x436f3d});const _0x2c2633=await fetch(_0x436f3d,{'headers':{'Cookie':getCookie()}});if(!_0x2c2633['ok']){if(_0x2c2633[_0xdb3d40(0x7a)]===0x191)throw new Error(_0xdb3d40(0x81));throw new Error('获取数据集失败,HTTP状态码:\x20'+_0x2c2633[_0xdb3d40(0x7a)]);}const _0x26e70a=await _0x2c2633[_0xdb3d40(0x87)]();if(!_0x26e70a[_0xdb3d40(0x8a)])throw new Error(_0xdb3d40(0x8d)+(_0x26e70a[_0xdb3d40(0x7e)]||_0xdb3d40(0x83)));return{'configArray':_0x26e70a[_0xdb3d40(0x84)]['configArray'],'count':_0x26e70a[_0xdb3d40(0x84)][_0xdb3d40(0x7b)]};}
1
+ (function(_0xd657cb,_0x3d7c03){const _0x5e1be1=a6_0x6983,_0x222a2c=_0xd657cb();while(!![]){try{const _0x5553d5=parseInt(_0x5e1be1(0x14c))/0x1+-parseInt(_0x5e1be1(0x138))/0x2+-parseInt(_0x5e1be1(0x144))/0x3+-parseInt(_0x5e1be1(0x14b))/0x4*(parseInt(_0x5e1be1(0x149))/0x5)+-parseInt(_0x5e1be1(0x13e))/0x6+-parseInt(_0x5e1be1(0x148))/0x7*(-parseInt(_0x5e1be1(0x147))/0x8)+-parseInt(_0x5e1be1(0x140))/0x9*(-parseInt(_0x5e1be1(0x139))/0xa);if(_0x5553d5===_0x3d7c03)break;else _0x222a2c['push'](_0x222a2c['shift']());}catch(_0x3d31fa){_0x222a2c['push'](_0x222a2c['shift']());}}}(a6_0x2217,0x47612));function a6_0x2217(){const _0x3f775d=['获取数据集失败,HTTP状态码:\x20','1492632afodYE','登录鉴权失败,登录已过期,请使用\x20lovrabet\x20auth\x20重新登录','9MvBZYk','未知错误','/api/node-toolbox/dataset/model-list?appcode=','success','861780lCsXiF','count','data','40oMBkSw','234164ozgZxg','198895ILBVwc','&otype=array','20TVCmDA','490769jHQfnY','获取数据集失败:\x20','180722wnalyS','4596290rJMVON','fetch-model-list','info','status'];a6_0x2217=function(){return _0x3f775d;};return a6_0x2217();}import{getCookie}from'../auth/get-cookie.js';function a6_0x6983(_0x11e868,_0x4bb7fe){const _0x221722=a6_0x2217();return a6_0x6983=function(_0x6983d4,_0x427582){_0x6983d4=_0x6983d4-0x138;let _0x28e692=_0x221722[_0x6983d4];return _0x28e692;},a6_0x6983(_0x11e868,_0x4bb7fe);}import{getApiDomain}from'../constant/domain.js';import{logger}from'../utils/logger.js';import{getEnv}from'../constant/env.js';export async function fetchModelList(_0x4f2328){const _0x1bd3f3=a6_0x6983,_0x11e7d2=getEnv(),_0x29d326=getApiDomain()+_0x1bd3f3(0x142)+_0x4f2328+_0x1bd3f3(0x14a);logger[_0x1bd3f3(0x13b)](_0x1bd3f3(0x13a),'正在从服务器拉取模型列表...\x20(环境:\x20'+_0x11e7d2+')',{'apiUrl':_0x29d326});const _0x444b2a=await fetch(_0x29d326,{'headers':{'Cookie':getCookie()}});if(!_0x444b2a['ok']){if(_0x444b2a[_0x1bd3f3(0x13c)]===0x191)throw new Error(_0x1bd3f3(0x13f));throw new Error(_0x1bd3f3(0x13d)+_0x444b2a[_0x1bd3f3(0x13c)]);}const _0x49c7b8=await _0x444b2a['json']();if(!_0x49c7b8[_0x1bd3f3(0x143)])throw new Error(_0x1bd3f3(0x14d)+(_0x49c7b8['message']||_0x1bd3f3(0x141)));return{'configArray':_0x49c7b8[_0x1bd3f3(0x146)]['configArray'],'count':_0x49c7b8[_0x1bd3f3(0x146)][_0x1bd3f3(0x145)]};}
@@ -1 +1 @@
1
- const a7_0x5b7bcd=a7_0x5979;(function(_0x3bb9bc,_0x4da5c0){const _0x32e293=a7_0x5979,_0x32b8b8=_0x3bb9bc();while(!![]){try{const _0x47f58f=parseInt(_0x32e293(0xe4))/0x1*(parseInt(_0x32e293(0xc4))/0x2)+-parseInt(_0x32e293(0xc6))/0x3*(-parseInt(_0x32e293(0xbf))/0x4)+-parseInt(_0x32e293(0xd8))/0x5*(-parseInt(_0x32e293(0xc0))/0x6)+-parseInt(_0x32e293(0xc3))/0x7+parseInt(_0x32e293(0xe5))/0x8+parseInt(_0x32e293(0xc8))/0x9+-parseInt(_0x32e293(0xca))/0xa*(parseInt(_0x32e293(0xcf))/0xb);if(_0x47f58f===_0x4da5c0)break;else _0x32b8b8['push'](_0x32b8b8['shift']());}catch(_0x1ba9a6){_0x32b8b8['push'](_0x32b8b8['shift']());}}}(a7_0x2d8b,0x3049f));import a7_0x23ece7 from'prettier';import{mkdirSync,writeFileSync,readFileSync}from'node:fs';import a7_0x5f580c from'node:path';import{fileURLToPath}from'node:url';function a7_0x5979(_0x544401,_0x34809f){const _0x2d8b44=a7_0x2d8b();return a7_0x5979=function(_0x597944,_0x58c54d){_0x597944=_0x597944-0xbe;let _0x222d01=_0x2d8b44[_0x597944];return _0x222d01;},a7_0x5979(_0x544401,_0x34809f);}import{readConfig}from'../utils/config.js';import{TemplateReplacer}from'../utils/template-replacer.js';import{logger}from'../utils/logger.js';export async function generateApiFile(_0x703eda,_0x4e2747='',_0x4a61c4,_0x3c93ce=![],_0xf2e630,_0x4d03ec=a7_0x5b7bcd(0xcb)){const _0x5b2ddd=a7_0x5b7bcd,_0x51de21=readConfig(),_0x7fab66=_0x4a61c4||_0x51de21?.[_0x5b2ddd(0xc5)];if(typeof _0x7fab66!==_0x5b2ddd(0xe2)||!_0x7fab66)throw new Error(_0x5b2ddd(0xd4));const _0x5b7d5a=_0x3c93ce?_0x5b2ddd(0xdf):'\x22'+_0x7fab66+'\x22',_0x48bc99=typeof _0x51de21[_0x5b2ddd(0xe3)]===_0x5b2ddd(0xe2)?_0x51de21[_0x5b2ddd(0xe3)]:undefined,_0x45cd18=_0xf2e630||_0x48bc99||'online',_0x4da489=_0x45cd18!==_0x5b2ddd(0xd1);let _0x1cbf61;if(_0x3c93ce)_0x4da489?_0x1cbf61='{\x20apiConfigName:\x20'+_0x5b7d5a+',\x20env:\x20\x22'+_0x45cd18+_0x5b2ddd(0xd0):_0x1cbf61='';else{const _0x32397a=_0x4da489?_0x5b2ddd(0xd5)+_0x45cd18+'\x22':'';_0x1cbf61=_0x5b2ddd(0xcc)+_0x7fab66+'\x22'+_0x32397a+'\x20}';}const _0x1f183a=_0x4e2747?_0x4e2747+_0x5b2ddd(0xe6):_0x5b2ddd(0xdb),_0x222718=_0x4e2747?_0x4e2747+_0x5b2ddd(0xc2):'client',_0x4a9c54={};_0x703eda[_0x5b2ddd(0xd3)](_0x1e13c1=>{const _0x3e63ba=_0x5b2ddd;_0x4a9c54[_0x1e13c1['key']]={'tableName':_0x1e13c1[_0x3e63ba(0xd7)],'datasetCode':_0x1e13c1[_0x3e63ba(0xc1)],'name':_0x1e13c1['name']||''};});const _0x5ac97e=fileURLToPath(import.meta[_0x5b2ddd(0xe0)]),_0x5b0a22=a7_0x5f580c[_0x5b2ddd(0xe1)](a7_0x5f580c[_0x5b2ddd(0xda)](_0x5ac97e),'../..'),_0x4fa497=a7_0x5f580c[_0x5b2ddd(0xde)](_0x5b0a22,'templates/generate-api'),_0x436e19=a7_0x5f580c[_0x5b2ddd(0xde)](_0x4fa497,'api.ts.tpl'),_0x1e7e04=a7_0x5f580c[_0x5b2ddd(0xde)](_0x4fa497,'client.ts.tpl'),_0x1f3282=_0x4d03ec[_0x5b2ddd(0xdc)]('/')?_0x4d03ec['slice'](0x0,-0x1):_0x4d03ec;mkdirSync(_0x1f3282,{'recursive':!![]});const _0x1332a1=readFileSync(_0x436e19,'utf8'),_0xb73621=TemplateReplacer[_0x5b2ddd(0xdd)](_0x1332a1,_0x7fab66,_0x4a9c54,Object['keys'](_0x4a9c54)[0x0],_0x1f183a,_0x5b7d5a),_0x254c84=await a7_0x23ece7['format'](_0xb73621,{'parser':_0x5b2ddd(0xd9)}),_0x474849=_0x1f3282+'/'+_0x1f183a+_0x5b2ddd(0xbe);writeFileSync(_0x474849,_0x254c84,{'encoding':_0x5b2ddd(0xcd)});const _0x16aa6f=readFileSync(_0x1e7e04,_0x5b2ddd(0xcd)),_0x361de1=TemplateReplacer[_0x5b2ddd(0xdd)](_0x16aa6f,_0x7fab66,_0x4a9c54,Object[_0x5b2ddd(0xc7)](_0x4a9c54)[0x0],_0x1f183a,_0x5b7d5a,_0x1cbf61),_0x3bdfb2=await a7_0x23ece7[_0x5b2ddd(0xce)](_0x361de1,{'parser':_0x5b2ddd(0xd9)}),_0x496dde=_0x1f3282+'/'+_0x222718+_0x5b2ddd(0xbe);writeFileSync(_0x496dde,_0x3bdfb2,{'encoding':'utf8'});const _0x4e7363=Object[_0x5b2ddd(0xc7)](_0x4a9c54)['length'];return logger[_0x5b2ddd(0xd2)](_0x5b2ddd(0xc9),_0x5b2ddd(0xd6),undefined,{'apiFile':_0x474849,'clientFile':_0x496dde,'modelCount':_0x4e7363,'configName':_0x5b7d5a}),{'modelCount':_0x4e7363,'apiFilePath':_0x474849,'clientFilePath':_0x496dde,'configName':_0x5b7d5a};}function a7_0x2d8b(){const _0x5c3c11=['{\x20apiConfigName:\x20\x22','utf8','format','4334khlzdv','\x22\x20}','online','success','forEach','请先通过\x20`lovrabet\x20config\x20set\x20app\x20<value>`\x20配置应用\x20Code',',\x20env:\x20\x22','API\x20文件生成成功!','tableName','15CrnNam','typescript','dirname','api','endsWith','replaceApiContent','join','CONFIG_NAMES.DEFAULT','url','resolve','string','env','43kKAJiy','2432576LtBQjq','-api','.ts','88CaeiyE','450858QicJpf','datasetCode','-client','1836058BouMDJ','17830Hjswgd','app','5904UtKrzu','keys','1811907nzLFXU','init-api','17700KAfsBL','./src/api/'];a7_0x2d8b=function(){return _0x5c3c11;};return a7_0x2d8b();}
1
+ const a7_0xcd45c4=a7_0x59c7;(function(_0x12f553,_0x59afda){const _0x5eeef3=a7_0x59c7,_0x59f4a3=_0x12f553();while(!![]){try{const _0x2e838d=-parseInt(_0x5eeef3(0x1ce))/0x1+parseInt(_0x5eeef3(0x1d7))/0x2*(parseInt(_0x5eeef3(0x1d3))/0x3)+-parseInt(_0x5eeef3(0x1b2))/0x4*(parseInt(_0x5eeef3(0x1dd))/0x5)+parseInt(_0x5eeef3(0x1b9))/0x6+parseInt(_0x5eeef3(0x1b1))/0x7*(parseInt(_0x5eeef3(0x1cb))/0x8)+parseInt(_0x5eeef3(0x1d1))/0x9+-parseInt(_0x5eeef3(0x1be))/0xa;if(_0x2e838d===_0x59afda)break;else _0x59f4a3['push'](_0x59f4a3['shift']());}catch(_0x3bdbda){_0x59f4a3['push'](_0x59f4a3['shift']());}}}(a7_0x12b9,0x3d107));function a7_0x12b9(){const _0x7137f1=['2078811QkpLzg','endsWith','266151veLQBu','{\x20apiConfigName:\x20','app','api.ts.tpl','2nryMRl','string','-api','api','url','length','278790UdTLuo','client.ts.tpl','templates/generate-api','7ltciHz','8gyPyYq','API\x20文件生成成功!','join','.ts','name','./src/api/','success','1311702oVufWb','slice','\x22\x20}','key','resolve','2854930usbBKQ','{\x20apiConfigName:\x20\x22','client','dirname','tableName',',\x20env:\x20\x22','forEach','env','keys','init-api','typescript','online','utf8','3708808YHGwJU','format','请先通过\x20`lovrabet\x20config\x20set\x20app\x20<value>`\x20配置应用\x20Code','354786UEprJe','../..','replaceApiContent'];a7_0x12b9=function(){return _0x7137f1;};return a7_0x12b9();}import a7_0xe9f0aa from'prettier';import{mkdirSync,writeFileSync,readFileSync}from'node:fs';function a7_0x59c7(_0x109865,_0x7cded0){const _0x12b90b=a7_0x12b9();return a7_0x59c7=function(_0x59c71f,_0x2af503){_0x59c71f=_0x59c71f-0x1b0;let _0x50edc8=_0x12b90b[_0x59c71f];return _0x50edc8;},a7_0x59c7(_0x109865,_0x7cded0);}import a7_0x1d983f from'node:path';import{fileURLToPath}from'node:url';import{readConfig}from'../utils/config.js';import{TemplateReplacer}from'../utils/template-replacer.js';import{logger}from'../utils/logger.js';export async function generateApiFile(_0x4011ed,_0x4d8a0d='',_0x1d2927,_0x23099e=![],_0x44e5fe,_0x44d13d=a7_0xcd45c4(0x1b7)){const _0x1dedf8=a7_0xcd45c4,_0x2d4e0b=readConfig(),_0x22e124=_0x1d2927||_0x2d4e0b?.[_0x1dedf8(0x1d5)];if(typeof _0x22e124!==_0x1dedf8(0x1d8)||!_0x22e124)throw new Error(_0x1dedf8(0x1cd));const _0x15d1b2=_0x23099e?'CONFIG_NAMES.DEFAULT':'\x22'+_0x22e124+'\x22',_0x20af6a=typeof _0x2d4e0b[_0x1dedf8(0x1c5)]===_0x1dedf8(0x1d8)?_0x2d4e0b[_0x1dedf8(0x1c5)]:undefined,_0x145ea5=_0x44e5fe||_0x20af6a||_0x1dedf8(0x1c9),_0x2b4dd5=_0x145ea5!==_0x1dedf8(0x1c9);let _0x28c37b;if(_0x23099e)_0x2b4dd5?_0x28c37b=_0x1dedf8(0x1d4)+_0x15d1b2+_0x1dedf8(0x1c3)+_0x145ea5+_0x1dedf8(0x1bb):_0x28c37b='';else{const _0x213031=_0x2b4dd5?_0x1dedf8(0x1c3)+_0x145ea5+'\x22':'';_0x28c37b=_0x1dedf8(0x1bf)+_0x22e124+'\x22'+_0x213031+'\x20}';}const _0x583723=_0x4d8a0d?_0x4d8a0d+_0x1dedf8(0x1d9):_0x1dedf8(0x1da),_0x504e7d=_0x4d8a0d?_0x4d8a0d+'-client':_0x1dedf8(0x1c0),_0x12250b={};_0x4011ed[_0x1dedf8(0x1c4)](_0x361eef=>{const _0x381743=_0x1dedf8;_0x12250b[_0x361eef[_0x381743(0x1bc)]]={'tableName':_0x361eef[_0x381743(0x1c2)],'datasetCode':_0x361eef['datasetCode'],'name':_0x361eef[_0x381743(0x1b6)]||''};});const _0x4d37ff=fileURLToPath(import.meta[_0x1dedf8(0x1db)]),_0x77d21e=a7_0x1d983f[_0x1dedf8(0x1bd)](a7_0x1d983f[_0x1dedf8(0x1c1)](_0x4d37ff),_0x1dedf8(0x1cf)),_0x3f66ce=a7_0x1d983f[_0x1dedf8(0x1b4)](_0x77d21e,_0x1dedf8(0x1b0)),_0x3e7315=a7_0x1d983f['join'](_0x3f66ce,_0x1dedf8(0x1d6)),_0x398fea=a7_0x1d983f[_0x1dedf8(0x1b4)](_0x3f66ce,_0x1dedf8(0x1de)),_0x518f57=_0x44d13d[_0x1dedf8(0x1d2)]('/')?_0x44d13d[_0x1dedf8(0x1ba)](0x0,-0x1):_0x44d13d;mkdirSync(_0x518f57,{'recursive':!![]});const _0x542200=readFileSync(_0x3e7315,'utf8'),_0xf35407=TemplateReplacer[_0x1dedf8(0x1d0)](_0x542200,_0x22e124,_0x12250b,Object['keys'](_0x12250b)[0x0],_0x583723,_0x15d1b2),_0xbd4614=await a7_0xe9f0aa[_0x1dedf8(0x1cc)](_0xf35407,{'parser':_0x1dedf8(0x1c8)}),_0x5f3e29=_0x518f57+'/'+_0x583723+_0x1dedf8(0x1b5);writeFileSync(_0x5f3e29,_0xbd4614,{'encoding':_0x1dedf8(0x1ca)});const _0x2b7817=readFileSync(_0x398fea,_0x1dedf8(0x1ca)),_0xc10e75=TemplateReplacer['replaceApiContent'](_0x2b7817,_0x22e124,_0x12250b,Object[_0x1dedf8(0x1c6)](_0x12250b)[0x0],_0x583723,_0x15d1b2,_0x28c37b),_0x37f565=await a7_0xe9f0aa[_0x1dedf8(0x1cc)](_0xc10e75,{'parser':_0x1dedf8(0x1c8)}),_0x4a6fef=_0x518f57+'/'+_0x504e7d+_0x1dedf8(0x1b5);writeFileSync(_0x4a6fef,_0x37f565,{'encoding':_0x1dedf8(0x1ca)});const _0x8dd07b=Object[_0x1dedf8(0x1c6)](_0x12250b)[_0x1dedf8(0x1dc)];return logger[_0x1dedf8(0x1b8)](_0x1dedf8(0x1c7),_0x1dedf8(0x1b3),undefined,{'apiFile':_0x5f3e29,'clientFile':_0x4a6fef,'modelCount':_0x8dd07b,'configName':_0x15d1b2}),{'modelCount':_0x8dd07b,'apiFilePath':_0x5f3e29,'clientFilePath':_0x4a6fef,'configName':_0x15d1b2};}
package/lib/api/main.js CHANGED
@@ -1 +1 @@
1
- (function(_0x1761e1,_0x61665a){const _0x31c63e=a8_0x11fa,_0x4101d2=_0x1761e1();while(!![]){try{const _0x43009b=parseInt(_0x31c63e(0x1a3))/0x1+-parseInt(_0x31c63e(0x1b9))/0x2*(parseInt(_0x31c63e(0x1a8))/0x3)+-parseInt(_0x31c63e(0x1a4))/0x4+-parseInt(_0x31c63e(0x19a))/0x5+-parseInt(_0x31c63e(0x1a2))/0x6+-parseInt(_0x31c63e(0x1bf))/0x7*(parseInt(_0x31c63e(0x1a9))/0x8)+parseInt(_0x31c63e(0x1b6))/0x9;if(_0x43009b===_0x61665a)break;else _0x4101d2['push'](_0x4101d2['shift']());}catch(_0x3a2078){_0x4101d2['push'](_0x4101d2['shift']());}}}(a8_0x383b,0xd4b9a));function a8_0x383b(){const _0x2e4a91=['\x20\x20lovrabet\x20api\x20doc\x20--appcode\x20','\x20\x20lovrabet\x20api\x20pull\x20--appcode\x20<code>\x20\x20\x20\x20\x20\x20//\x20使用指定的\x20appcode','×\x20--datasetcode\x20参数不能为空','env','×\x20--params\x20参数不是有效的\x20JSON\x20格式','请使用\x20--appcode\x20参数,例如:','split','\x20\x20lovrabet\x20api\x20pull\x20--output\x20<dir>\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定输出目录(默认:\x20./src/api/)','Available\x20commands:','help','\x20\x20lovrabet\x20api\x20pull\x20--appcode\x20','message','\x1b[90m*\x20仅生成指定数据集的文档:\x20','1122270gZqEha','pull','filter','params','log','\x1b[90m*\x20使用配置的应用AppCode:\x20','exit','×\x20未配置\x20AppCode','6565650uhXMeW','1532499hHcIBd','3606292GLqZJS','Unknown\x20api\x20command:\x20','\x20\x20lovrabet\x20api\x20pull\x20--env\x20<env>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定环境(如:\x20daily,\x20online)','object','159edQEei','32lmavug','\x20\x20lovrabet\x20api\x20doc\x20--appcode\x20<code>\x20\x20\x20\x20\x20\x20\x20//\x20使用指定的\x20appcode','length','\x1b[90m\x20\x20(注:\x20--appcode\x20参数与配置一致,将使用默认配置)\x1b[0m','doc','\x20\x20lovrabet\x20api\x20doc\x20--env\x20<env>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定环境(如:\x20daily,\x20online)','error','isArray','output','join','\x20\x20\x202.\x20使用参数:\x20lovrabet\x20api\x20pull\x20--appcode\x20<app-code>','❌\x20错误:不再支持位置参数方式','map','30367728tDEgiT','\x20\x20\x202.\x20使用参数:\x20lovrabet\x20api\x20doc\x20--appcode\x20<app-code>','\x20\x20\x201.\x20配置默认值:\x20lovrabet\x20config\x20set\x20appcode\x20<app-code>','64814DkzJVE','\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\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文档','parse','flags','×\x20--params\x20参数必须是一个有效的\x20JSON\x20对象','170618IvyEDR','\x20\x20lovrabet\x20api\x20doc\x20--output\x20<dir>\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定文档输出目录(默认:\x20./docs)','input','appcode','trim','string','\x1b[0m'];a8_0x383b=function(){return _0x2e4a91;};return a8_0x383b();}import{jsx as a8_0x3af4af}from'react/jsx-runtime';import{render}from'ink';import{ApiPullUI}from'./api-pull-ui.js';import{ApiDocUI}from'./api-doc-ui.js';import{getConfigAppCode}from'../utils/config.js';function a8_0x11fa(_0x551937,_0x96580c){const _0x383bb4=a8_0x383b();return a8_0x11fa=function(_0x11faa5,_0x10a648){_0x11faa5=_0x11faa5-0x189;let _0x440e7d=_0x383bb4[_0x11faa5];return _0x440e7d;},a8_0x11fa(_0x551937,_0x96580c);}export async function apiCli(_0x114be6){const _0x3510c7=a8_0x11fa,_0x406272=_0x114be6[_0x3510c7(0x1c1)][0x1];if(_0x114be6['flags'][_0x3510c7(0x196)]){console[_0x3510c7(0x19e)](_0x3510c7(0x1ba));return;}if(_0x406272===_0x3510c7(0x19b)){_0x114be6[_0x3510c7(0x1c1)][0x2]&&(console[_0x3510c7(0x1af)](_0x3510c7(0x1b4)),console['log'](_0x3510c7(0x192)),console[_0x3510c7(0x19e)](_0x3510c7(0x197)+_0x114be6[_0x3510c7(0x1c1)][0x2]),process['exit'](0x1));const _0x59d477=getConfigAppCode();let _0x1be610=_0x114be6[_0x3510c7(0x1bd)][_0x3510c7(0x189)];const _0x20fd4b=typeof _0x114be6[_0x3510c7(0x1bd)]['env']===_0x3510c7(0x18b)?_0x114be6[_0x3510c7(0x1bd)][_0x3510c7(0x190)]:undefined,_0x49a465=_0x114be6[_0x3510c7(0x1bd)][_0x3510c7(0x1b1)];!_0x1be610&&!_0x59d477&&(console[_0x3510c7(0x1af)](_0x3510c7(0x1a1)),console['log']('!\x20请使用以下方式之一:'),console[_0x3510c7(0x19e)]('\x20\x20\x201.\x20配置默认值:\x20lovrabet\x20config\x20set\x20appcode\x20<app-code>'),console[_0x3510c7(0x19e)](_0x3510c7(0x1b3)),process[_0x3510c7(0x1a0)](0x1)),_0x1be610&&_0x59d477&&_0x1be610===_0x59d477&&(console[_0x3510c7(0x19e)](_0x3510c7(0x19f)+_0x1be610+_0x3510c7(0x18c)),console[_0x3510c7(0x19e)](_0x3510c7(0x1ac)),_0x1be610=undefined),render(a8_0x3af4af(ApiPullUI,{'appCode':_0x1be610,'env':_0x20fd4b,'output':_0x49a465}));}else{if(_0x406272===_0x3510c7(0x1ad)){_0x114be6[_0x3510c7(0x1c1)][0x2]&&(console[_0x3510c7(0x1af)](_0x3510c7(0x1b4)),console[_0x3510c7(0x19e)](_0x3510c7(0x192)),console[_0x3510c7(0x19e)](_0x3510c7(0x18d)+_0x114be6[_0x3510c7(0x1c1)][0x2]),process[_0x3510c7(0x1a0)](0x1));const _0x32bc26=getConfigAppCode();let _0x32da8b=_0x114be6[_0x3510c7(0x1bd)][_0x3510c7(0x189)];const _0x1a6c4f=typeof _0x114be6['flags'][_0x3510c7(0x190)]===_0x3510c7(0x18b)?_0x114be6[_0x3510c7(0x1bd)][_0x3510c7(0x190)]:undefined,_0x3a68e3=_0x114be6[_0x3510c7(0x1bd)][_0x3510c7(0x1b1)],_0xc0a64e=_0x114be6[_0x3510c7(0x1bd)][_0x3510c7(0x19d)],_0x328218=_0x114be6['flags']['datasetcode'];!_0x32da8b&&!_0x32bc26&&(console[_0x3510c7(0x1af)](_0x3510c7(0x1a1)),console[_0x3510c7(0x19e)]('!\x20请使用以下方式之一:'),console[_0x3510c7(0x19e)](_0x3510c7(0x1b8)),console['log'](_0x3510c7(0x1b7)),process[_0x3510c7(0x1a0)](0x1));_0x32da8b&&_0x32bc26&&_0x32da8b===_0x32bc26&&(console[_0x3510c7(0x19e)](_0x3510c7(0x19f)+_0x32da8b+'\x1b[0m'),_0x32da8b=undefined);let _0x4a2556;if(_0xc0a64e)try{_0x4a2556=JSON[_0x3510c7(0x1bc)](_0xc0a64e),(typeof _0x4a2556!==_0x3510c7(0x1a7)||_0x4a2556===null||Array[_0x3510c7(0x1b0)](_0x4a2556))&&(console[_0x3510c7(0x1af)](_0x3510c7(0x1be)),process[_0x3510c7(0x1a0)](0x1));}catch(_0x19f7ec){console['error'](_0x3510c7(0x191)),console[_0x3510c7(0x1af)]('\x20\x20错误:\x20'+(_0x19f7ec instanceof Error?_0x19f7ec[_0x3510c7(0x198)]:String(_0x19f7ec))),process[_0x3510c7(0x1a0)](0x1);}let _0x5ca3d9;_0x328218&&(_0x5ca3d9=_0x328218[_0x3510c7(0x193)](',')[_0x3510c7(0x1b5)](_0x289220=>_0x289220[_0x3510c7(0x18a)]())[_0x3510c7(0x19c)](_0x5eb8b3=>_0x5eb8b3[_0x3510c7(0x1ab)]>0x0),_0x5ca3d9[_0x3510c7(0x1ab)]===0x0&&(console[_0x3510c7(0x1af)](_0x3510c7(0x18f)),process[_0x3510c7(0x1a0)](0x1)),console[_0x3510c7(0x19e)](_0x3510c7(0x199)+_0x5ca3d9[_0x3510c7(0x1b2)](',\x20')+_0x3510c7(0x18c))),render(a8_0x3af4af(ApiDocUI,{'appCode':_0x32da8b,'env':_0x1a6c4f,'output':_0x3a68e3,'extraParams':_0x4a2556,'datasetCodes':_0x5ca3d9}));}else console[_0x3510c7(0x1af)](_0x3510c7(0x1a5)+_0x406272),console['log'](_0x3510c7(0x195)),console[_0x3510c7(0x19e)]('\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[_0x3510c7(0x19e)](_0x3510c7(0x18e)),console[_0x3510c7(0x19e)](_0x3510c7(0x194)),console[_0x3510c7(0x19e)](_0x3510c7(0x1a6)),console[_0x3510c7(0x19e)](''),console[_0x3510c7(0x19e)](_0x3510c7(0x1bb)),console[_0x3510c7(0x19e)](_0x3510c7(0x1aa)),console[_0x3510c7(0x19e)](_0x3510c7(0x1c0)),console[_0x3510c7(0x19e)](_0x3510c7(0x1ae)),process[_0x3510c7(0x1a0)](0x1);}}
1
+ (function(_0x2c66a0,_0x26b1f6){const _0x1fef5f=a8_0x2f3e,_0x3db866=_0x2c66a0();while(!![]){try{const _0x368497=parseInt(_0x1fef5f(0x1ae))/0x1*(-parseInt(_0x1fef5f(0x1a0))/0x2)+-parseInt(_0x1fef5f(0x1a9))/0x3+parseInt(_0x1fef5f(0x1b5))/0x4+-parseInt(_0x1fef5f(0x19f))/0x5*(parseInt(_0x1fef5f(0x195))/0x6)+parseInt(_0x1fef5f(0x1af))/0x7+-parseInt(_0x1fef5f(0x1b9))/0x8*(-parseInt(_0x1fef5f(0x18b))/0x9)+parseInt(_0x1fef5f(0x1b0))/0xa*(parseInt(_0x1fef5f(0x1a3))/0xb);if(_0x368497===_0x26b1f6)break;else _0x3db866['push'](_0x3db866['shift']());}catch(_0x1f1ea8){_0x3db866['push'](_0x3db866['shift']());}}}(a8_0x584c,0xc0f37));import{jsx as a8_0x2fbde3}from'react/jsx-runtime';import{render}from'ink';import{ApiPullUI}from'./api-pull-ui.js';function a8_0x2f3e(_0x31a4d9,_0xd40ece){const _0x584cec=a8_0x584c();return a8_0x2f3e=function(_0x2f3e6a,_0x567825){_0x2f3e6a=_0x2f3e6a-0x185;let _0xb68012=_0x584cec[_0x2f3e6a];return _0xb68012;},a8_0x2f3e(_0x31a4d9,_0xd40ece);}import{ApiDocUI}from'./api-doc-ui.js';import{getConfigAppCode}from'../utils/config.js';export async function apiCli(_0x25d9d6){const _0x1afb5e=a8_0x2f3e,_0x59fb7f=_0x25d9d6['input'][0x1];if(_0x25d9d6[_0x1afb5e(0x1a8)]['help']){console['log']('\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(_0x59fb7f===_0x1afb5e(0x19b)){_0x25d9d6['input'][0x2]&&(console[_0x1afb5e(0x192)](_0x1afb5e(0x1aa)),console['log'](_0x1afb5e(0x196)),console['log'](_0x1afb5e(0x19a)+_0x25d9d6['input'][0x2]),process[_0x1afb5e(0x1a4)](0x1));const _0x4a03fd=getConfigAppCode();let _0x54b88f=_0x25d9d6[_0x1afb5e(0x1a8)][_0x1afb5e(0x194)];const _0x368f13=typeof _0x25d9d6[_0x1afb5e(0x1a8)][_0x1afb5e(0x1ad)]===_0x1afb5e(0x1b2)?_0x25d9d6[_0x1afb5e(0x1a8)]['env']:undefined,_0x1ca673=_0x25d9d6[_0x1afb5e(0x1a8)]['output'];!_0x54b88f&&!_0x4a03fd&&(console['error'](_0x1afb5e(0x19c)),console[_0x1afb5e(0x1b3)]('!\x20请使用以下方式之一:'),console['log'](_0x1afb5e(0x1ba)),console[_0x1afb5e(0x1b3)](_0x1afb5e(0x18d)),process['exit'](0x1)),_0x54b88f&&_0x4a03fd&&_0x54b88f===_0x4a03fd&&(console[_0x1afb5e(0x1b3)](_0x1afb5e(0x186)+_0x54b88f+_0x1afb5e(0x193)),console['log'](_0x1afb5e(0x187)),_0x54b88f=undefined),render(a8_0x2fbde3(ApiPullUI,{'appCode':_0x54b88f,'env':_0x368f13,'output':_0x1ca673}));}else{if(_0x59fb7f===_0x1afb5e(0x199)){_0x25d9d6[_0x1afb5e(0x1b8)][0x2]&&(console['error'](_0x1afb5e(0x1aa)),console[_0x1afb5e(0x1b3)](_0x1afb5e(0x196)),console[_0x1afb5e(0x1b3)](_0x1afb5e(0x1b1)+_0x25d9d6[_0x1afb5e(0x1b8)][0x2]),process[_0x1afb5e(0x1a4)](0x1));const _0x37ec29=getConfigAppCode();let _0x5415e8=_0x25d9d6['flags']['appcode'];const _0x5b3d4e=typeof _0x25d9d6[_0x1afb5e(0x1a8)]['env']===_0x1afb5e(0x1b2)?_0x25d9d6[_0x1afb5e(0x1a8)][_0x1afb5e(0x1ad)]:undefined,_0x370c6f=_0x25d9d6['flags']['output'],_0x3751a3=_0x25d9d6['flags'][_0x1afb5e(0x1b4)],_0x1c590b=_0x25d9d6['flags'][_0x1afb5e(0x197)];!_0x5415e8&&!_0x37ec29&&(console[_0x1afb5e(0x192)](_0x1afb5e(0x19c)),console[_0x1afb5e(0x1b3)](_0x1afb5e(0x198)),console[_0x1afb5e(0x1b3)](_0x1afb5e(0x1ba)),console[_0x1afb5e(0x1b3)](_0x1afb5e(0x1bb)),process['exit'](0x1));_0x5415e8&&_0x37ec29&&_0x5415e8===_0x37ec29&&(console['log'](_0x1afb5e(0x186)+_0x5415e8+_0x1afb5e(0x193)),_0x5415e8=undefined);let _0x143d3e;if(_0x3751a3)try{_0x143d3e=JSON[_0x1afb5e(0x1ab)](_0x3751a3),(typeof _0x143d3e!==_0x1afb5e(0x18c)||_0x143d3e===null||Array[_0x1afb5e(0x1a6)](_0x143d3e))&&(console[_0x1afb5e(0x192)]('×\x20--params\x20参数必须是一个有效的\x20JSON\x20对象'),process['exit'](0x1));}catch(_0x53e56a){console[_0x1afb5e(0x192)](_0x1afb5e(0x18e)),console['error'](_0x1afb5e(0x190)+(_0x53e56a instanceof Error?_0x53e56a['message']:String(_0x53e56a))),process['exit'](0x1);}let _0x4e1b19;_0x1c590b&&(_0x4e1b19=_0x1c590b['split'](',')[_0x1afb5e(0x1ac)](_0x394d46=>_0x394d46['trim']())[_0x1afb5e(0x1b6)](_0x53081a=>_0x53081a[_0x1afb5e(0x1a5)]>0x0),_0x4e1b19[_0x1afb5e(0x1a5)]===0x0&&(console[_0x1afb5e(0x192)](_0x1afb5e(0x188)),process[_0x1afb5e(0x1a4)](0x1)),console[_0x1afb5e(0x1b3)](_0x1afb5e(0x18a)+_0x4e1b19[_0x1afb5e(0x19d)](',\x20')+_0x1afb5e(0x193))),render(a8_0x2fbde3(ApiDocUI,{'appCode':_0x5415e8,'env':_0x5b3d4e,'output':_0x370c6f,'extraParams':_0x143d3e,'datasetCodes':_0x4e1b19}));}else console['error'](_0x1afb5e(0x1a7)+_0x59fb7f),console[_0x1afb5e(0x1b3)](_0x1afb5e(0x191)),console[_0x1afb5e(0x1b3)](_0x1afb5e(0x1a2)),console[_0x1afb5e(0x1b3)]('\x20\x20lovrabet\x20api\x20pull\x20--appcode\x20<code>\x20\x20\x20\x20\x20\x20//\x20使用指定的\x20appcode'),console[_0x1afb5e(0x1b3)](_0x1afb5e(0x1a1)),console[_0x1afb5e(0x1b3)](_0x1afb5e(0x189)),console[_0x1afb5e(0x1b3)](''),console[_0x1afb5e(0x1b3)](_0x1afb5e(0x19e)),console[_0x1afb5e(0x1b3)](_0x1afb5e(0x185)),console[_0x1afb5e(0x1b3)](_0x1afb5e(0x18f)),console['log'](_0x1afb5e(0x1b7)),process[_0x1afb5e(0x1a4)](0x1);}}function a8_0x584c(){const _0x294112=['appcode','246wrqqQU','请使用\x20--appcode\x20参数,例如:','datasetcode','!\x20请使用以下方式之一:','doc','\x20\x20lovrabet\x20api\x20pull\x20--appcode\x20','pull','×\x20未配置\x20AppCode','join','\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文档','75745bIHQSh','2YizXuJ','\x20\x20lovrabet\x20api\x20pull\x20--output\x20<dir>\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定输出目录(默认:\x20./src/api/)','\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配置文件','11UzKWvl','exit','length','isArray','Unknown\x20api\x20command:\x20','flags','4443408nEHiaH','❌\x20错误:不再支持位置参数方式','parse','map','env','451082NOwUzQ','3208842ncUFUy','21838850YbTwqj','\x20\x20lovrabet\x20api\x20doc\x20--appcode\x20','string','log','params','1660120qtQmmN','filter','\x20\x20lovrabet\x20api\x20doc\x20--env\x20<env>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定环境(如:\x20daily,\x20online)','input','2290664GNqWKg','\x20\x20\x201.\x20配置默认值:\x20lovrabet\x20config\x20set\x20appcode\x20<app-code>','\x20\x20\x202.\x20使用参数:\x20lovrabet\x20api\x20doc\x20--appcode\x20<app-code>','\x20\x20lovrabet\x20api\x20doc\x20--appcode\x20<code>\x20\x20\x20\x20\x20\x20\x20//\x20使用指定的\x20appcode','\x1b[90m*\x20使用配置的应用AppCode:\x20','\x1b[90m\x20\x20(注:\x20--appcode\x20参数与配置一致,将使用默认配置)\x1b[0m','×\x20--datasetcode\x20参数不能为空','\x20\x20lovrabet\x20api\x20pull\x20--env\x20<env>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定环境(如:\x20daily,\x20online)','\x1b[90m*\x20仅生成指定数据集的文档:\x20','9ogxgJD','object','\x20\x20\x202.\x20使用参数:\x20lovrabet\x20api\x20pull\x20--appcode\x20<app-code>','×\x20--params\x20参数不是有效的\x20JSON\x20格式','\x20\x20lovrabet\x20api\x20doc\x20--output\x20<dir>\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定文档输出目录(默认:\x20./docs)','\x20\x20错误:\x20','Available\x20commands:','error','\x1b[0m'];a8_0x584c=function(){return _0x294112;};return a8_0x584c();}
@@ -1 +1 @@
1
- (function(_0x3c8d72,_0x7becde){const _0x5a87b4=a9_0x4209,_0x22b984=_0x3c8d72();while(!![]){try{const _0x3c13e9=-parseInt(_0x5a87b4(0x1b9))/0x1*(-parseInt(_0x5a87b4(0x1ae))/0x2)+-parseInt(_0x5a87b4(0x197))/0x3*(parseInt(_0x5a87b4(0x1a3))/0x4)+parseInt(_0x5a87b4(0x1a9))/0x5*(parseInt(_0x5a87b4(0x1a5))/0x6)+parseInt(_0x5a87b4(0x1b1))/0x7+-parseInt(_0x5a87b4(0x1a1))/0x8*(-parseInt(_0x5a87b4(0x199))/0x9)+parseInt(_0x5a87b4(0x1b7))/0xa*(-parseInt(_0x5a87b4(0x1aa))/0xb)+-parseInt(_0x5a87b4(0x1a7))/0xc*(parseInt(_0x5a87b4(0x1af))/0xd);if(_0x3c13e9===_0x7becde)break;else _0x22b984['push'](_0x22b984['shift']());}catch(_0x5020f2){_0x22b984['push'](_0x22b984['shift']());}}}(a9_0x1377,0x9a774));import{readConfig}from'../utils/config.js';import{initEnv}from'../constant/env.js';import{generateApiFile}from'./generate-api-file.js';function a9_0x4209(_0x9e3475,_0x4c1548){const _0x1377ac=a9_0x1377();return a9_0x4209=function(_0x4209b6,_0x409e82){_0x4209b6=_0x4209b6-0x197;let _0x214634=_0x1377ac[_0x4209b6];return _0x214634;},a9_0x4209(_0x9e3475,_0x4c1548);}import{logger}from'../utils/logger.js';function a9_0x1377(){const _0x221986=['51939MYMAli','API\x20配置拉取异常:\x20','create-api-pull','length','.ts\x20-\x20模型配置文件','test','×\x20文件前缀格式不正确。只能包含字母、数字、连字符和下划线,且必须以字母开头。','*\x20正在处理\x20','424HnKyRo','log','16348lSEEuh','-client','3054EsEblu','*\x20正在从服务器拉取\x20API\x20配置...\x20(环境:\x20','12iVxJCc','chdir','9665LIqjYc','935xSWBCE','trim','online','cwd','22094VRmwca','7005479xzkHgr','env','7848813DfdoGA','\x20个数据集,生成\x20','×\x20API\x20配置拉取异常:','client','API\x20配置拉取成功:\x20','\x20\x20\x20•\x20','20660OcvlVX','error','1oqvMBj','789GGADad','string'];a9_0x1377=function(){return _0x221986;};return a9_0x1377();}import{fetchModelList}from'./fetch-model-list.js';export async function pullApiSilent(_0xcb3a24,_0xec3ea,_0x76d6c,_0x3bdeae){const _0x579926=a9_0x4209;let _0xdf2bdc;try{const _0x389316=_0xec3ea?.[_0x579926(0x1ab)]()||'';if(_0x389316){const _0x470c05=/^[a-zA-Z][a-zA-Z0-9_-]*$/;if(!_0x470c05[_0x579926(0x19e)](_0x389316))return console[_0x579926(0x1b8)](_0x579926(0x19f)),![];}_0x76d6c&&(_0xdf2bdc=process[_0x579926(0x1ad)](),process[_0x579926(0x1a8)](_0x76d6c));const _0x3c4080=readConfig(),_0x296af2=typeof _0x3c4080[_0x579926(0x1b0)]===_0x579926(0x198)?_0x3c4080[_0x579926(0x1b0)]:undefined,_0xaf435=_0x3bdeae||_0x296af2||_0x579926(0x1ac);initEnv(_0xaf435),console['log'](_0x579926(0x1a6)+_0xaf435+')');const {configArray:_0x591194}=await fetchModelList(_0xcb3a24),_0x2f41a0=_0x389316?_0x389316+'-api':'api',_0x32f5df=_0x389316?_0x389316+_0x579926(0x1a4):_0x579926(0x1b4);console[_0x579926(0x1a2)]('*\x20开始生成\x20API\x20配置文件:'),console[_0x579926(0x1a2)](_0x579926(0x1b6)+_0x2f41a0+_0x579926(0x19d)),console[_0x579926(0x1a2)](_0x579926(0x1b6)+_0x32f5df+'.ts\x20-\x20客户端实例文件'),console['log'](_0x579926(0x1a0)+_0x591194['length']+'\x20个数据集...');const _0xe79236=await generateApiFile(_0x591194,_0x389316,_0xcb3a24,!![],_0xaf435);return console[_0x579926(0x1a2)]('√\x20成功拉取\x20'+_0x591194['length']+_0x579926(0x1b2)+_0xe79236['modelCount']+'\x20个模型'),_0x76d6c&&logger['info'](_0x579926(0x19b),_0x579926(0x1b5)+_0xcb3a24,{'projectPath':_0x76d6c,'appCode':_0xcb3a24,'datasetCount':_0x591194[_0x579926(0x19c)],'filePrefix':_0x389316}),!![];}catch(_0x385dd8){const _0x4b7276=_0x385dd8 instanceof Error?_0x385dd8['message']:String(_0x385dd8);return console[_0x579926(0x1b8)](_0x579926(0x1b3),_0x4b7276),_0x76d6c&&logger[_0x579926(0x1b8)](_0x579926(0x19b),_0x579926(0x19a)+_0x4b7276,{'appCode':_0xcb3a24,'projectPath':_0x76d6c}),![];}finally{_0xdf2bdc&&process[_0x579926(0x1a8)](_0xdf2bdc);}}
1
+ (function(_0x157063,_0x7420ee){const _0xb3866=a9_0x492c,_0x5d544d=_0x157063();while(!![]){try{const _0x4260ee=-parseInt(_0xb3866(0x1ae))/0x1*(-parseInt(_0xb3866(0x1ba))/0x2)+parseInt(_0xb3866(0x1bd))/0x3+-parseInt(_0xb3866(0x1c0))/0x4+-parseInt(_0xb3866(0x1aa))/0x5+parseInt(_0xb3866(0x1ad))/0x6*(parseInt(_0xb3866(0x1b4))/0x7)+parseInt(_0xb3866(0x1be))/0x8+parseInt(_0xb3866(0x1b0))/0x9*(-parseInt(_0xb3866(0x1b8))/0xa);if(_0x4260ee===_0x7420ee)break;else _0x5d544d['push'](_0x5d544d['shift']());}catch(_0x1d6b40){_0x5d544d['push'](_0x5d544d['shift']());}}}(a9_0x1358,0x5265b));import{readConfig}from'../utils/config.js';import{initEnv}from'../constant/env.js';function a9_0x1358(){const _0x5ca16b=['info','1150530hJBhSY','string','error','8694dRDHYp','305743MVCeZC','API\x20配置拉取异常:\x20','1238652ehLdFJ','length','trim','API\x20配置拉取成功:\x20','1036gYGlnL','cwd','\x20\x20\x20•\x20','env','40UYkZJD','create-api-pull','2gIYhDx','chdir','*\x20开始生成\x20API\x20配置文件:','1344990ANEHCL','4590344xMHejy','×\x20API\x20配置拉取异常:','1696804EBFYKM','.ts\x20-\x20客户端实例文件','√\x20成功拉取\x20','×\x20文件前缀格式不正确。只能包含字母、数字、连字符和下划线,且必须以字母开头。','message','test','-client','*\x20正在处理\x20','.ts\x20-\x20模型配置文件','log','\x20个数据集...','client','api','*\x20正在从服务器拉取\x20API\x20配置...\x20(环境:\x20'];a9_0x1358=function(){return _0x5ca16b;};return a9_0x1358();}function a9_0x492c(_0x3cfa7a,_0x114cf3){const _0x1358be=a9_0x1358();return a9_0x492c=function(_0x492c5d,_0x3df42f){_0x492c5d=_0x492c5d-0x19f;let _0x5162a6=_0x1358be[_0x492c5d];return _0x5162a6;},a9_0x492c(_0x3cfa7a,_0x114cf3);}import{generateApiFile}from'./generate-api-file.js';import{logger}from'../utils/logger.js';import{fetchModelList}from'./fetch-model-list.js';export async function pullApiSilent(_0x6205b2,_0x4a08a6,_0x5bd824,_0x47f51a){const _0x3ba698=a9_0x492c;let _0xcb3eb6;try{const _0x5834fb=_0x4a08a6?.[_0x3ba698(0x1b2)]()||'';if(_0x5834fb){const _0x14479f=/^[a-zA-Z][a-zA-Z0-9_-]*$/;if(!_0x14479f[_0x3ba698(0x1a0)](_0x5834fb))return console[_0x3ba698(0x1ac)](_0x3ba698(0x1c3)),![];}_0x5bd824&&(_0xcb3eb6=process[_0x3ba698(0x1b5)](),process['chdir'](_0x5bd824));const _0x3e28a3=readConfig(),_0x49aed4=typeof _0x3e28a3[_0x3ba698(0x1b7)]===_0x3ba698(0x1ab)?_0x3e28a3[_0x3ba698(0x1b7)]:undefined,_0x12a27e=_0x47f51a||_0x49aed4||'online';initEnv(_0x12a27e),console[_0x3ba698(0x1a4)](_0x3ba698(0x1a8)+_0x12a27e+')');const {configArray:_0x8e3913}=await fetchModelList(_0x6205b2),_0x20fa43=_0x5834fb?_0x5834fb+'-api':_0x3ba698(0x1a7),_0x530e11=_0x5834fb?_0x5834fb+_0x3ba698(0x1a1):_0x3ba698(0x1a6);console[_0x3ba698(0x1a4)](_0x3ba698(0x1bc)),console[_0x3ba698(0x1a4)](_0x3ba698(0x1b6)+_0x20fa43+_0x3ba698(0x1a3)),console[_0x3ba698(0x1a4)](_0x3ba698(0x1b6)+_0x530e11+_0x3ba698(0x1c1)),console[_0x3ba698(0x1a4)](_0x3ba698(0x1a2)+_0x8e3913[_0x3ba698(0x1b1)]+_0x3ba698(0x1a5));const _0x2787f4=await generateApiFile(_0x8e3913,_0x5834fb,_0x6205b2,!![],_0x12a27e);return console[_0x3ba698(0x1a4)](_0x3ba698(0x1c2)+_0x8e3913[_0x3ba698(0x1b1)]+'\x20个数据集,生成\x20'+_0x2787f4['modelCount']+'\x20个模型'),_0x5bd824&&logger[_0x3ba698(0x1a9)](_0x3ba698(0x1b9),_0x3ba698(0x1b3)+_0x6205b2,{'projectPath':_0x5bd824,'appCode':_0x6205b2,'datasetCount':_0x8e3913['length'],'filePrefix':_0x5834fb}),!![];}catch(_0x21ce87){const _0x17d5ae=_0x21ce87 instanceof Error?_0x21ce87[_0x3ba698(0x19f)]:String(_0x21ce87);return console[_0x3ba698(0x1ac)](_0x3ba698(0x1bf),_0x17d5ae),_0x5bd824&&logger[_0x3ba698(0x1ac)]('create-api-pull',_0x3ba698(0x1af)+_0x17d5ae,{'appCode':_0x6205b2,'projectPath':_0x5bd824}),![];}finally{_0xcb3eb6&&process[_0x3ba698(0x1bb)](_0xcb3eb6);}}
@@ -1 +1 @@
1
- function a10_0xb7b3(){const _0x1eda80=['*\x20同步菜单到\x20Lovrabet\x20平台','*\x20CSS\x20链接:\x20','已选择菜单','red','*\x20正在创建菜单...','\x20输入项目的\x20JS\x20资源链接(https://...)','*\x20JS\x20链接:\x20','done','downArrow','path','length','请至少选择一个菜单','281541zrovww','102840hiqvLU','CSS\x20链接','blue','dots','\x20输入项目的\x20CSS\x20资源链接(https://...)','菜单名称','创建菜单失败','15132060PNWari','\x20←\x20','5QivCfK','[✓]','gray','includes','CSS\x20链接无法访问','1897dmSFGV','2967056wgVDGR','[\x20]','yellow','return','4973706spWbRf','filter','lovrabet\x20auth','31192iDxMCe','JS\x20链接无法访问','column','input-js','!\x20未找到本地页面,请先创建页面','↑/↓:\x20移动光标\x20空格:\x20切换选中\x20a:\x20全选\x20i/r:\x20反选\x20Enter:\x20确认','cyan','delete','slice','299472mbfUCx','online','√\x20菜单创建完成','test','\x20正在获取线上菜单列表...','input-css','then','map','*\x20请选择要同步的菜单:','Lovrabet平台','size','trim','fill','creating','add','green','提示:使用\x20','local','backspace','main','max','selecting','has','label'];a10_0xb7b3=function(){return _0x1eda80;};return a10_0xb7b3();}const a10_0x2682f6=a10_0x4a0e;function a10_0x4a0e(_0x24042f,_0x22a1e2){const _0xb7b32d=a10_0xb7b3();return a10_0x4a0e=function(_0x4a0e29,_0x2052c7){_0x4a0e29=_0x4a0e29-0x1e3;let _0x583068=_0xb7b32d[_0x4a0e29];return _0x583068;},a10_0x4a0e(_0x24042f,_0x22a1e2);}(function(_0x3ed6fc,_0x9655d8){const _0x233238=a10_0x4a0e,_0x526134=_0x3ed6fc();while(!![]){try{const _0x47958c=-parseInt(_0x233238(0x1f8))/0x1+-parseInt(_0x233238(0x217))/0x2+-parseInt(_0x233238(0x1f7))/0x3+parseInt(_0x233238(0x207))/0x4*(parseInt(_0x233238(0x201))/0x5)+parseInt(_0x233238(0x20b))/0x6+-parseInt(_0x233238(0x206))/0x7*(-parseInt(_0x233238(0x20e))/0x8)+-parseInt(_0x233238(0x1ff))/0x9;if(_0x47958c===_0x9655d8)break;else _0x526134['push'](_0x526134['shift']());}catch(_0x2c1c16){_0x526134['push'](_0x526134['shift']());}}}(a10_0xb7b3,0x9261d));import{jsx as a10_0x5b784b,jsxs as a10_0x1dadf3,Fragment as a10_0x590dab}from'react/jsx-runtime';import{Text,Box,useInput,useApp,render}from'ink';import{useEffect,useState}from'react';import a10_0x54c496 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[a10_0x2682f6(0x1e6)]&&render(a10_0x5b784b(AppMenuSyncUI,{}));export function AppMenuSyncUI(){const _0x3be81c=a10_0x2682f6,{exit:_0x3b805d}=useApp(),{loading:_0xdc5b0f,menuList:_0xe11514,error:_0x4d66c2}=useGetOnlineMenuList(),_0x529108=getLocalPages(),_0x8d4da0=_0xe11514[_0x3be81c(0x21e)](_0x254c17=>_0x254c17[_0x3be81c(0x1f4)]),_0x1056dc=[_0x3be81c(0x1fd),..._0x529108['map'](_0x524ca2=>_0x524ca2[_0x3be81c(0x1ea)])],_0x4c0878=getStringWidth(getMaxWidth(_0x1056dc,0x4)),_0x493bf7=getStringWidth(getMaxWidth(['菜单名称'])),[_0x27343,_0x2ff6fd]=useState(_0x3be81c(0x1e8)),[_0x350e80,_0x4ba449]=useState(new Set()),[_0xf5fe48,_0x49ccde]=useState(0x0),[_0x430b50,_0x461cad]=useState(''),[_0x534313,_0x3007bc]=useState(''),[_0x12c740,_0x375d01]=useState(''),[_0x9fc392,_0xa84d09]=useState(''),[_0xd230b5,_0x2a78ab]=useState([]),_0x3564c3=_0x529108[_0x3be81c(0x21e)](_0x154f9d=>({'label':_0x154f9d[_0x3be81c(0x1ea)],'path':_0x154f9d[_0x3be81c(0x1f4)],'local':!![],'online':_0x8d4da0['includes'](_0x154f9d[_0x3be81c(0x1f4)])})),_0x1fa3c6=_0x529108[_0x3be81c(0x20c)](_0x23c3b3=>{const _0x1878f2=_0x3be81c;return!_0x8d4da0[_0x1878f2(0x204)](_0x23c3b3[_0x1878f2(0x1f4)]);});useEffect(()=>{const _0x487144=_0x3be81c;if(!_0xdc5b0f&&_0x529108[_0x487144(0x1f5)]>0x0&&_0x350e80[_0x487144(0x221)]===0x0){const _0x4a7509=new Set(_0x529108[_0x487144(0x21e)]((_0x5766c6,_0x4a6077)=>({'page':_0x5766c6,'index':_0x4a6077}))['filter'](({page:_0x2383b6})=>!_0x8d4da0[_0x487144(0x204)](_0x2383b6['path']))[_0x487144(0x21e)](({index:_0x23a1f6})=>_0x23a1f6));_0x4ba449(_0x4a7509);}},[_0xdc5b0f,_0x529108[_0x3be81c(0x1f5)],_0x8d4da0[_0x3be81c(0x1f5)]]),useInput(async(_0x573ef3,_0x3db37d)=>{const _0x19f8f8=_0x3be81c;if(_0x27343==='selecting'){if(_0x3db37d['upArrow']){_0x49ccde(_0x2f669b=>_0x2f669b>0x0?_0x2f669b-0x1:_0x529108['length']-0x1);return;}if(_0x3db37d[_0x19f8f8(0x1f3)]){_0x49ccde(_0x139b32=>_0x139b32<_0x529108[_0x19f8f8(0x1f5)]-0x1?_0x139b32+0x1:0x0);return;}if(_0x573ef3==='\x20'){_0x4ba449(_0x3c7d66=>{const _0x5c4cd6=_0x19f8f8,_0x2a1e12=new Set(_0x3c7d66);return _0x2a1e12[_0x5c4cd6(0x1e9)](_0xf5fe48)?_0x2a1e12[_0x5c4cd6(0x215)](_0xf5fe48):_0x2a1e12[_0x5c4cd6(0x225)](_0xf5fe48),_0x2a1e12;});return;}if(_0x573ef3==='a'||_0x573ef3==='A'){const _0x5d80ac=new Set(_0x529108[_0x19f8f8(0x21e)]((_0x50a435,_0x5f50d1)=>_0x5f50d1));_0x4ba449(_0x5d80ac);return;}if(_0x573ef3==='i'||_0x573ef3==='I'||_0x573ef3==='r'||_0x573ef3==='R'){_0x4ba449(_0x284b87=>{const _0x42c665=_0x19f8f8,_0x1bc45f=new Set();for(let _0x27b3da=0x0;_0x27b3da<_0x529108[_0x42c665(0x1f5)];_0x27b3da++){!_0x284b87[_0x42c665(0x1e9)](_0x27b3da)&&_0x1bc45f['add'](_0x27b3da);}return _0x1bc45f;});return;}if(_0x573ef3==='q'||_0x573ef3==='Q'){_0x3b805d();return;}if(_0x3db37d[_0x19f8f8(0x20a)]){if(_0x350e80['size']===0x0){_0xa84d09(_0x19f8f8(0x1f6));return;}const _0x1d3e0e=_0x529108[_0x19f8f8(0x20c)]((_0x934d51,_0x31ae48)=>_0x350e80['has'](_0x31ae48)),_0x5bad14=_0x1d3e0e[_0x19f8f8(0x21e)](_0x31bb11=>_0x31bb11[_0x19f8f8(0x1ea)])['join'](',\x20');_0x2a78ab([{'label':_0x19f8f8(0x1ed),'value':_0x350e80[_0x19f8f8(0x221)]+'\x20个'}]),_0xa84d09(''),_0x2ff6fd(_0x19f8f8(0x211));return;}return;}if(_0x27343==='input-js'){if(_0x3db37d[_0x19f8f8(0x20a)]){const _0x536621=_0x12c740['trim']();if(_0x536621==='')return;if(!isValidJsHttpsUrl(_0x536621)){_0xa84d09('请输入有效的\x20JS\x20https\x20链接');return;}if(!await isUrlReachable(_0x536621)){_0xa84d09(_0x19f8f8(0x20f));return;}_0x461cad(_0x536621),_0x2a78ab(_0x3e7fe9=>[..._0x3e7fe9,{'label':'JS\x20链接','value':_0x536621}]),_0x375d01(''),_0xa84d09(''),_0x2ff6fd(_0x19f8f8(0x21c));return;}if(_0x3db37d[_0x19f8f8(0x1e5)]||_0x3db37d[_0x19f8f8(0x215)]){_0x375d01(_0x52a4fe=>_0x52a4fe[_0x19f8f8(0x216)](0x0,-0x1)),_0xa84d09('');return;}_0x375d01(_0x3b0424=>_0x3b0424+_0x573ef3);return;}if(_0x27343===_0x19f8f8(0x21c)){if(_0x3db37d['return']){const _0x36b490=_0x12c740[_0x19f8f8(0x222)]();if(_0x36b490==='')return;if(!isValidCssHttpsUrl(_0x36b490)){_0xa84d09('请输入有效的\x20CSS\x20https\x20链接');return;}if(!await isUrlReachable(_0x36b490)){_0xa84d09(_0x19f8f8(0x205));return;}_0x3007bc(_0x36b490),_0x2a78ab(_0x5e0a19=>[..._0x5e0a19,{'label':_0x19f8f8(0x1f9),'value':_0x36b490}]),_0x375d01(''),_0xa84d09(''),_0x2ff6fd(_0x19f8f8(0x224));const _0x25f994=_0x529108[_0x19f8f8(0x20c)]((_0x3a3617,_0x5f592e)=>_0x350e80[_0x19f8f8(0x1e9)](_0x5f592e));createMenus(_0x25f994,[_0x430b50,_0x36b490])[_0x19f8f8(0x21d)](()=>{const _0x5a1fa4=_0x19f8f8;_0x2ff6fd(_0x5a1fa4(0x1f2)),setTimeout(()=>{_0x3b805d();},0x3e8);})['catch'](_0x13e49f=>{const _0x270747=_0x19f8f8;_0xa84d09(_0x13e49f['message']||_0x270747(0x1fe)),_0x2ff6fd(_0x270747(0x1e8));});return;}if(_0x3db37d[_0x19f8f8(0x1e5)]||_0x3db37d['delete']){_0x375d01(_0x493aac=>_0x493aac[_0x19f8f8(0x216)](0x0,-0x1)),_0xa84d09('');return;}_0x375d01(_0x432561=>_0x432561+_0x573ef3);return;}});if(_0xdc5b0f)return a10_0x1dadf3(Box,{'marginTop':0x1,'marginBottom':0x1,'children':[a10_0x5b784b(Text,{'children':'\x20\x20'}),a10_0x5b784b(a10_0x54c496,{'type':_0x3be81c(0x1fb)}),a10_0x5b784b(Text,{'children':_0x3be81c(0x21b)})]});if(_0x4d66c2)return a10_0x1dadf3(Box,{'flexDirection':_0x3be81c(0x210),'marginTop':0x1,'marginBottom':0x1,'children':[a10_0x1dadf3(Text,{'color':_0x3be81c(0x1ee),'children':['✗\x20',_0x4d66c2]}),a10_0x1dadf3(Box,{'marginTop':0x1,'children':[a10_0x5b784b(Text,{'color':_0x3be81c(0x203),'children':_0x3be81c(0x1e3)}),a10_0x5b784b(Text,{'color':'cyan','children':_0x3be81c(0x20d)}),a10_0x5b784b(Text,{'color':'gray','children':'\x20命令重新登录'})]})]});if(_0x529108[_0x3be81c(0x1f5)]===0x0)return a10_0x5b784b(Box,{'marginTop':0x1,'marginBottom':0x1,'children':a10_0x5b784b(Text,{'color':_0x3be81c(0x209),'children':_0x3be81c(0x212)})});return a10_0x1dadf3(Box,{'flexDirection':_0x3be81c(0x210),'marginTop':0x1,'marginBottom':0x1,'children':[_0x27343===_0x3be81c(0x1e8)&&a10_0x1dadf3(a10_0x590dab,{'children':[a10_0x1dadf3(Box,{'children':[a10_0x1dadf3(Text,{'bold':!![],'children':['\x20\x20',_0x3be81c(0x1fd),getRemainingSpaces(_0x4c0878,_0x3be81c(0x1fd))]}),a10_0x1dadf3(Text,{'bold':!![],'children':['本地',getRemainingSpaces(_0x493bf7,_0x3be81c(0x1fd))]}),a10_0x1dadf3(Text,{'bold':!![],'children':[_0x3be81c(0x220),getRemainingSpaces(_0x493bf7,_0x3be81c(0x1fd))]})]}),_0x3564c3[_0x3be81c(0x21e)](_0x21ab65=>a10_0x1dadf3(Box,{'children':[a10_0x1dadf3(Text,{'children':['\x20\x20',_0x21ab65[_0x3be81c(0x1ea)],getRemainingSpaces(_0x4c0878,_0x21ab65[_0x3be81c(0x1ea)])]}),a10_0x1dadf3(Text,{'color':_0x3be81c(0x226),'children':[_0x21ab65[_0x3be81c(0x1e4)]?'✓':'✗',getRemainingSpaces(_0x493bf7,'✓')]}),a10_0x1dadf3(Text,{'color':_0x21ab65[_0x3be81c(0x218)]?_0x3be81c(0x226):_0x3be81c(0x1ee),'children':[_0x21ab65[_0x3be81c(0x218)]?'✓':'✗',getRemainingSpaces(_0x493bf7,'✓')]})]},_0x21ab65['path']))]}),_0x27343==='selecting'&&_0xd230b5[_0x3be81c(0x1f5)]===0x0&&a10_0x5b784b(Box,{'marginTop':0x1,'children':a10_0x5b784b(Text,{'color':_0x3be81c(0x214),'children':_0x3be81c(0x1eb)})}),_0xd230b5[_0x3be81c(0x21e)]((_0x217b5a,_0xf5035b)=>a10_0x1dadf3(Box,{'children':[a10_0x1dadf3(Text,{'color':_0x3be81c(0x226),'children':['√\x20',_0x217b5a['label'],':\x20']}),a10_0x5b784b(Text,{'color':_0x3be81c(0x214),'children':_0x217b5a['value']})]},_0xf5035b)),_0x9fc392&&_0x27343===_0x3be81c(0x1e8)&&a10_0x5b784b(Box,{'marginTop':0x1,'children':a10_0x1dadf3(Text,{'color':'red','children':['✗\x20',_0x9fc392]})}),_0x27343==='selecting'&&a10_0x5b784b(a10_0x590dab,{'children':a10_0x1dadf3(Box,{'marginTop':_0xd230b5[_0x3be81c(0x1f5)]>0x0||_0x9fc392?0x1:0x0,'flexDirection':_0x3be81c(0x210),'children':[a10_0x5b784b(Text,{'bold':!![],'children':_0x3be81c(0x21f)}),_0x529108[_0x3be81c(0x21e)]((_0xc9a14c,_0x11ed3a)=>{const _0x26fe8c=_0x3be81c,_0x16746a=_0xf5fe48===_0x11ed3a,_0x294cf5=_0x350e80[_0x26fe8c(0x1e9)](_0x11ed3a),_0x4c8b8e=_0x8d4da0['includes'](_0xc9a14c['path']),_0x1e52b1=_0x4c8b8e?'更新':'新建';return a10_0x5b784b(Box,{'children':a10_0x1dadf3(Text,{'backgroundColor':_0x16746a?_0x26fe8c(0x1fa):undefined,'color':_0x16746a?'white':undefined,'children':['\x20\x20',_0x294cf5?_0x26fe8c(0x202):_0x26fe8c(0x208),'\x20',_0xc9a14c[_0x26fe8c(0x1ea)]]})},_0xc9a14c[_0x26fe8c(0x1f4)]);}),a10_0x5b784b(Box,{'marginTop':0x1,'children':a10_0x1dadf3(Text,{'color':_0x3be81c(0x203),'children':['\x20',_0x3be81c(0x213)]})})]})}),_0x27343===_0x3be81c(0x211)&&a10_0x1dadf3(a10_0x590dab,{'children':[a10_0x1dadf3(Box,{'children':[a10_0x5b784b(Text,{'children':_0x3be81c(0x1f1)}),a10_0x5b784b(Text,{'color':_0x3be81c(0x226),'children':_0x12c740}),_0x9fc392&&a10_0x1dadf3(Text,{'color':'red','children':[_0x3be81c(0x200),_0x9fc392]})]}),!_0x9fc392&&a10_0x5b784b(Box,{'children':a10_0x5b784b(Text,{'color':_0x3be81c(0x203),'children':_0x3be81c(0x1f0)})})]}),_0x27343==='input-css'&&a10_0x1dadf3(a10_0x590dab,{'children':[a10_0x1dadf3(Box,{'children':[a10_0x5b784b(Text,{'children':_0x3be81c(0x1ec)}),a10_0x5b784b(Text,{'color':'green','children':_0x12c740}),_0x9fc392&&a10_0x1dadf3(Text,{'color':_0x3be81c(0x1ee),'children':[_0x3be81c(0x200),_0x9fc392]})]}),!_0x9fc392&&a10_0x5b784b(Box,{'children':a10_0x5b784b(Text,{'color':'gray','children':_0x3be81c(0x1fc)})})]}),_0x27343===_0x3be81c(0x224)&&a10_0x5b784b(Box,{'children':a10_0x5b784b(Text,{'children':_0x3be81c(0x1ef)})}),_0x27343==='done'&&a10_0x5b784b(Box,{'children':a10_0x5b784b(Text,{'color':_0x3be81c(0x226),'children':_0x3be81c(0x219)})})]});}function getStringWidth(_0x4eac54){const _0xbe8590=a10_0x2682f6;let _0x4440c0=0x0;for(const _0x1429b3 of _0x4eac54){/[\u4e00-\u9fa5]/[_0xbe8590(0x21a)](_0x1429b3)?_0x4440c0+=0x2:_0x4440c0+=0x1;}return _0x4440c0;}function getRemainingSpaces(_0x1b480e,_0x118154){const _0x13440b=a10_0x2682f6,_0x56d868=getStringWidth(_0x118154);return Array(Math[_0x13440b(0x1e7)](0x0,_0x1b480e-_0x56d868))[_0x13440b(0x223)]('\x20')['join']('');}function getMaxWidth(_0x2ca47c,_0xa4f6b4=0x2){let _0x4ab61e='',_0x4d0175=0x0;for(const _0x258c02 of _0x2ca47c){const _0x1480b9=getStringWidth(_0x258c02);_0x1480b9>_0x4d0175&&(_0x4d0175=_0x1480b9,_0x4ab61e=_0x258c02);}return _0x4ab61e+'\x20'['repeat'](_0xa4f6b4);}
1
+ (function(_0x243faa,_0x37d16c){const _0x159ca1=a10_0x1182,_0x1e4f65=_0x243faa();while(!![]){try{const _0x4d619a=parseInt(_0x159ca1(0x14f))/0x1+parseInt(_0x159ca1(0x169))/0x2*(-parseInt(_0x159ca1(0x18d))/0x3)+parseInt(_0x159ca1(0x174))/0x4+parseInt(_0x159ca1(0x191))/0x5+-parseInt(_0x159ca1(0x15c))/0x6+parseInt(_0x159ca1(0x176))/0x7*(parseInt(_0x159ca1(0x154))/0x8)+-parseInt(_0x159ca1(0x18e))/0x9;if(_0x4d619a===_0x37d16c)break;else _0x1e4f65['push'](_0x1e4f65['shift']());}catch(_0x1e3fca){_0x1e4f65['push'](_0x1e4f65['shift']());}}}(a10_0x1f72,0xb8920));import{jsx as a10_0x216457,jsxs as a10_0x38ef37,Fragment as a10_0x3af1ea}from'react/jsx-runtime';function a10_0x1f72(){const _0x5ec79b=['green','repeat','backspace','creating','JS\x20链接','blue','*\x20请选择要同步的菜单:','5673528fhmFgD','size','value','!\x20未找到本地页面,请先创建页面','input-css','请至少选择一个菜单','提示:使用\x20','\x20输入项目的\x20JS\x20资源链接(https://...)','delete','\x20命令重新登录','[\x20]','*\x20CSS\x20链接:\x20','red','2LQuovZ','has','join','catch','菜单名称','online','√\x20菜单创建完成','gray','return','[✓]','\x20←\x20','5054132jKivBC','column','3025645exjpIz','input-js','selecting','length','*\x20同步菜单到\x20Lovrabet\x20平台','then','label','done','请输入有效的\x20CSS\x20https\x20链接','lovrabet\x20auth','local','fill','cyan','map','slice','message','请输入有效的\x20JS\x20https\x20链接','path','filter','add','JS\x20链接无法访问','white','trim','3396531dTjZFN','7694883RNrwcj','创建菜单失败','已选择菜单','6193515RowdxI','max','yellow','754281OVXYwb','\x20输入项目的\x20CSS\x20资源链接(https://...)','Lovrabet平台','dots','includes','8pLLSjB'];a10_0x1f72=function(){return _0x5ec79b;};return a10_0x1f72();}import{Text,Box,useInput,useApp,render}from'ink';import{useEffect,useState}from'react';import a10_0x5debbf 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_0x216457(AppMenuSyncUI,{}));export function AppMenuSyncUI(){const _0x328b63=a10_0x1182,{exit:_0x45a644}=useApp(),{loading:_0x1501a2,menuList:_0x1a726a,error:_0x1b80a4}=useGetOnlineMenuList(),_0x48fbc6=getLocalPages(),_0x1f5412=_0x1a726a[_0x328b63(0x183)](_0x35b119=>_0x35b119[_0x328b63(0x187)]),_0x42f753=[_0x328b63(0x16d),..._0x48fbc6[_0x328b63(0x183)](_0x49cb35=>_0x49cb35[_0x328b63(0x17c)])],_0x44b5e2=getStringWidth(getMaxWidth(_0x42f753,0x4)),_0x474db6=getStringWidth(getMaxWidth([_0x328b63(0x16d)])),[_0x24670a,_0x33f6d7]=useState(_0x328b63(0x178)),[_0x172106,_0xfc9ea4]=useState(new Set()),[_0x32a6f0,_0x4d760e]=useState(0x0),[_0x4ca1c4,_0x5b5f86]=useState(''),[_0x43d781,_0x115cf2]=useState(''),[_0x3c3210,_0x5e026f]=useState(''),[_0x5ad85c,_0x53c387]=useState(''),[_0x29f1ff,_0x3157a6]=useState([]),_0x1dcdad=_0x48fbc6[_0x328b63(0x183)](_0x1d665b=>({'label':_0x1d665b[_0x328b63(0x17c)],'path':_0x1d665b['path'],'local':!![],'online':_0x1f5412[_0x328b63(0x153)](_0x1d665b['path'])})),_0x45d227=_0x48fbc6['filter'](_0x43e811=>{const _0x587730=_0x328b63;return!_0x1f5412[_0x587730(0x153)](_0x43e811['path']);});useEffect(()=>{const _0x595de9=_0x328b63;if(!_0x1501a2&&_0x48fbc6['length']>0x0&&_0x172106[_0x595de9(0x15d)]===0x0){const _0x210e05=new Set(_0x48fbc6[_0x595de9(0x183)]((_0x1705ed,_0x9000b5)=>({'page':_0x1705ed,'index':_0x9000b5}))[_0x595de9(0x188)](({page:_0x5a21d1})=>!_0x1f5412[_0x595de9(0x153)](_0x5a21d1[_0x595de9(0x187)]))['map'](({index:_0x235165})=>_0x235165));_0xfc9ea4(_0x210e05);}},[_0x1501a2,_0x48fbc6[_0x328b63(0x179)],_0x1f5412[_0x328b63(0x179)]]),useInput(async(_0x439775,_0x502315)=>{const _0x5f424e=_0x328b63;if(_0x24670a===_0x5f424e(0x178)){if(_0x502315['upArrow']){_0x4d760e(_0x1796b7=>_0x1796b7>0x0?_0x1796b7-0x1:_0x48fbc6[_0x5f424e(0x179)]-0x1);return;}if(_0x502315['downArrow']){_0x4d760e(_0x180daa=>_0x180daa<_0x48fbc6[_0x5f424e(0x179)]-0x1?_0x180daa+0x1:0x0);return;}if(_0x439775==='\x20'){_0xfc9ea4(_0x25afe3=>{const _0x57d27b=_0x5f424e,_0x9414da=new Set(_0x25afe3);return _0x9414da[_0x57d27b(0x16a)](_0x32a6f0)?_0x9414da['delete'](_0x32a6f0):_0x9414da[_0x57d27b(0x189)](_0x32a6f0),_0x9414da;});return;}if(_0x439775==='a'||_0x439775==='A'){const _0x839088=new Set(_0x48fbc6[_0x5f424e(0x183)]((_0x7e4da4,_0x97769)=>_0x97769));_0xfc9ea4(_0x839088);return;}if(_0x439775==='i'||_0x439775==='I'||_0x439775==='r'||_0x439775==='R'){_0xfc9ea4(_0x45f770=>{const _0x12d090=_0x5f424e,_0x1cc7a2=new Set();for(let _0x25c135=0x0;_0x25c135<_0x48fbc6[_0x12d090(0x179)];_0x25c135++){!_0x45f770['has'](_0x25c135)&&_0x1cc7a2['add'](_0x25c135);}return _0x1cc7a2;});return;}if(_0x439775==='q'||_0x439775==='Q'){_0x45a644();return;}if(_0x502315[_0x5f424e(0x171)]){if(_0x172106[_0x5f424e(0x15d)]===0x0){_0x53c387(_0x5f424e(0x161));return;}const _0x15aec0=_0x48fbc6['filter']((_0x2c8369,_0xe9bc0b)=>_0x172106[_0x5f424e(0x16a)](_0xe9bc0b)),_0x108ce3=_0x15aec0[_0x5f424e(0x183)](_0x1b832d=>_0x1b832d['label'])['join'](',\x20');_0x3157a6([{'label':_0x5f424e(0x190),'value':_0x172106[_0x5f424e(0x15d)]+'\x20个'}]),_0x53c387(''),_0x33f6d7('input-js');return;}return;}if(_0x24670a===_0x5f424e(0x177)){if(_0x502315[_0x5f424e(0x171)]){const _0x16de70=_0x3c3210['trim']();if(_0x16de70==='')return;if(!isValidJsHttpsUrl(_0x16de70)){_0x53c387(_0x5f424e(0x186));return;}if(!await isUrlReachable(_0x16de70)){_0x53c387(_0x5f424e(0x18a));return;}_0x5b5f86(_0x16de70),_0x3157a6(_0x59bef5=>[..._0x59bef5,{'label':_0x5f424e(0x159),'value':_0x16de70}]),_0x5e026f(''),_0x53c387(''),_0x33f6d7(_0x5f424e(0x160));return;}if(_0x502315[_0x5f424e(0x157)]||_0x502315[_0x5f424e(0x164)]){_0x5e026f(_0x312b9c=>_0x312b9c[_0x5f424e(0x184)](0x0,-0x1)),_0x53c387('');return;}_0x5e026f(_0x3a9864=>_0x3a9864+_0x439775);return;}if(_0x24670a===_0x5f424e(0x160)){if(_0x502315[_0x5f424e(0x171)]){const _0x3efb2d=_0x3c3210[_0x5f424e(0x18c)]();if(_0x3efb2d==='')return;if(!isValidCssHttpsUrl(_0x3efb2d)){_0x53c387(_0x5f424e(0x17e));return;}if(!await isUrlReachable(_0x3efb2d)){_0x53c387('CSS\x20链接无法访问');return;}_0x115cf2(_0x3efb2d),_0x3157a6(_0x5344f9=>[..._0x5344f9,{'label':'CSS\x20链接','value':_0x3efb2d}]),_0x5e026f(''),_0x53c387(''),_0x33f6d7(_0x5f424e(0x158));const _0x1d8336=_0x48fbc6[_0x5f424e(0x188)]((_0xab9b87,_0x2e9f7e)=>_0x172106[_0x5f424e(0x16a)](_0x2e9f7e));createMenus(_0x1d8336,[_0x4ca1c4,_0x3efb2d])[_0x5f424e(0x17b)](()=>{const _0x44c214=_0x5f424e;_0x33f6d7(_0x44c214(0x17d)),setTimeout(()=>{_0x45a644();},0x3e8);})[_0x5f424e(0x16c)](_0x250d2e=>{const _0x29aafe=_0x5f424e;_0x53c387(_0x250d2e[_0x29aafe(0x185)]||_0x29aafe(0x18f)),_0x33f6d7('selecting');});return;}if(_0x502315[_0x5f424e(0x157)]||_0x502315[_0x5f424e(0x164)]){_0x5e026f(_0x77ee5=>_0x77ee5[_0x5f424e(0x184)](0x0,-0x1)),_0x53c387('');return;}_0x5e026f(_0x4ac09f=>_0x4ac09f+_0x439775);return;}});if(_0x1501a2)return a10_0x38ef37(Box,{'marginTop':0x1,'marginBottom':0x1,'children':[a10_0x216457(Text,{'children':'\x20\x20'}),a10_0x216457(a10_0x5debbf,{'type':_0x328b63(0x152)}),a10_0x216457(Text,{'children':'\x20正在获取线上菜单列表...'})]});if(_0x1b80a4)return a10_0x38ef37(Box,{'flexDirection':'column','marginTop':0x1,'marginBottom':0x1,'children':[a10_0x38ef37(Text,{'color':_0x328b63(0x168),'children':['✗\x20',_0x1b80a4]}),a10_0x38ef37(Box,{'marginTop':0x1,'children':[a10_0x216457(Text,{'color':_0x328b63(0x170),'children':_0x328b63(0x162)}),a10_0x216457(Text,{'color':'cyan','children':_0x328b63(0x17f)}),a10_0x216457(Text,{'color':_0x328b63(0x170),'children':_0x328b63(0x165)})]})]});if(_0x48fbc6[_0x328b63(0x179)]===0x0)return a10_0x216457(Box,{'marginTop':0x1,'marginBottom':0x1,'children':a10_0x216457(Text,{'color':_0x328b63(0x14e),'children':_0x328b63(0x15f)})});return a10_0x38ef37(Box,{'flexDirection':_0x328b63(0x175),'marginTop':0x1,'marginBottom':0x1,'children':[_0x24670a===_0x328b63(0x178)&&a10_0x38ef37(a10_0x3af1ea,{'children':[a10_0x38ef37(Box,{'children':[a10_0x38ef37(Text,{'bold':!![],'children':['\x20\x20',_0x328b63(0x16d),getRemainingSpaces(_0x44b5e2,_0x328b63(0x16d))]}),a10_0x38ef37(Text,{'bold':!![],'children':['本地',getRemainingSpaces(_0x474db6,_0x328b63(0x16d))]}),a10_0x38ef37(Text,{'bold':!![],'children':[_0x328b63(0x151),getRemainingSpaces(_0x474db6,_0x328b63(0x16d))]})]}),_0x1dcdad[_0x328b63(0x183)](_0x2e9072=>a10_0x38ef37(Box,{'children':[a10_0x38ef37(Text,{'children':['\x20\x20',_0x2e9072[_0x328b63(0x17c)],getRemainingSpaces(_0x44b5e2,_0x2e9072[_0x328b63(0x17c)])]}),a10_0x38ef37(Text,{'color':'green','children':[_0x2e9072[_0x328b63(0x180)]?'✓':'✗',getRemainingSpaces(_0x474db6,'✓')]}),a10_0x38ef37(Text,{'color':_0x2e9072[_0x328b63(0x16e)]?_0x328b63(0x155):_0x328b63(0x168),'children':[_0x2e9072['online']?'✓':'✗',getRemainingSpaces(_0x474db6,'✓')]})]},_0x2e9072[_0x328b63(0x187)]))]}),_0x24670a===_0x328b63(0x178)&&_0x29f1ff['length']===0x0&&a10_0x216457(Box,{'marginTop':0x1,'children':a10_0x216457(Text,{'color':_0x328b63(0x182),'children':_0x328b63(0x17a)})}),_0x29f1ff[_0x328b63(0x183)]((_0x3bc01c,_0x4c3a0c)=>a10_0x38ef37(Box,{'children':[a10_0x38ef37(Text,{'color':'green','children':['√\x20',_0x3bc01c[_0x328b63(0x17c)],':\x20']}),a10_0x216457(Text,{'color':_0x328b63(0x182),'children':_0x3bc01c[_0x328b63(0x15e)]})]},_0x4c3a0c)),_0x5ad85c&&_0x24670a===_0x328b63(0x178)&&a10_0x216457(Box,{'marginTop':0x1,'children':a10_0x38ef37(Text,{'color':_0x328b63(0x168),'children':['✗\x20',_0x5ad85c]})}),_0x24670a===_0x328b63(0x178)&&a10_0x216457(a10_0x3af1ea,{'children':a10_0x38ef37(Box,{'marginTop':_0x29f1ff[_0x328b63(0x179)]>0x0||_0x5ad85c?0x1:0x0,'flexDirection':'column','children':[a10_0x216457(Text,{'bold':!![],'children':_0x328b63(0x15b)}),_0x48fbc6[_0x328b63(0x183)]((_0x272e45,_0xc73f5f)=>{const _0x3f8585=_0x328b63,_0x30afa9=_0x32a6f0===_0xc73f5f,_0x193810=_0x172106[_0x3f8585(0x16a)](_0xc73f5f),_0x181a55=_0x1f5412[_0x3f8585(0x153)](_0x272e45['path']),_0x3fd810=_0x181a55?'更新':'新建';return a10_0x216457(Box,{'children':a10_0x38ef37(Text,{'backgroundColor':_0x30afa9?_0x3f8585(0x15a):undefined,'color':_0x30afa9?_0x3f8585(0x18b):undefined,'children':['\x20\x20',_0x193810?_0x3f8585(0x172):_0x3f8585(0x166),'\x20',_0x272e45[_0x3f8585(0x17c)]]})},_0x272e45[_0x3f8585(0x187)]);}),a10_0x216457(Box,{'marginTop':0x1,'children':a10_0x38ef37(Text,{'color':_0x328b63(0x170),'children':['\x20','↑/↓:\x20移动光标\x20空格:\x20切换选中\x20a:\x20全选\x20i/r:\x20反选\x20Enter:\x20确认']})})]})}),_0x24670a===_0x328b63(0x177)&&a10_0x38ef37(a10_0x3af1ea,{'children':[a10_0x38ef37(Box,{'children':[a10_0x216457(Text,{'children':'*\x20JS\x20链接:\x20'}),a10_0x216457(Text,{'color':'green','children':_0x3c3210}),_0x5ad85c&&a10_0x38ef37(Text,{'color':'red','children':[_0x328b63(0x173),_0x5ad85c]})]}),!_0x5ad85c&&a10_0x216457(Box,{'children':a10_0x216457(Text,{'color':'gray','children':_0x328b63(0x163)})})]}),_0x24670a===_0x328b63(0x160)&&a10_0x38ef37(a10_0x3af1ea,{'children':[a10_0x38ef37(Box,{'children':[a10_0x216457(Text,{'children':_0x328b63(0x167)}),a10_0x216457(Text,{'color':'green','children':_0x3c3210}),_0x5ad85c&&a10_0x38ef37(Text,{'color':_0x328b63(0x168),'children':[_0x328b63(0x173),_0x5ad85c]})]}),!_0x5ad85c&&a10_0x216457(Box,{'children':a10_0x216457(Text,{'color':_0x328b63(0x170),'children':_0x328b63(0x150)})})]}),_0x24670a===_0x328b63(0x158)&&a10_0x216457(Box,{'children':a10_0x216457(Text,{'children':'*\x20正在创建菜单...'})}),_0x24670a===_0x328b63(0x17d)&&a10_0x216457(Box,{'children':a10_0x216457(Text,{'color':_0x328b63(0x155),'children':_0x328b63(0x16f)})})]});}function a10_0x1182(_0x391b0c,_0x256046){const _0x1f7275=a10_0x1f72();return a10_0x1182=function(_0x11828e,_0x4742aa){_0x11828e=_0x11828e-0x14e;let _0x421361=_0x1f7275[_0x11828e];return _0x421361;},a10_0x1182(_0x391b0c,_0x256046);}function getStringWidth(_0x35f1ee){let _0x3f73b1=0x0;for(const _0x3f6160 of _0x35f1ee){/[\u4e00-\u9fa5]/['test'](_0x3f6160)?_0x3f73b1+=0x2:_0x3f73b1+=0x1;}return _0x3f73b1;}function getRemainingSpaces(_0x3ed366,_0xad5a4d){const _0xb8e8fe=a10_0x1182,_0x10f992=getStringWidth(_0xad5a4d);return Array(Math[_0xb8e8fe(0x192)](0x0,_0x3ed366-_0x10f992))[_0xb8e8fe(0x181)]('\x20')[_0xb8e8fe(0x16b)]('');}function getMaxWidth(_0x217079,_0x16c0e7=0x2){const _0x11ee1e=a10_0x1182;let _0x260d2f='',_0x3dcbaa=0x0;for(const _0x10a38f of _0x217079){const _0x47dd38=getStringWidth(_0x10a38f);_0x47dd38>_0x3dcbaa&&(_0x3dcbaa=_0x47dd38,_0x260d2f=_0x10a38f);}return _0x260d2f+'\x20'[_0x11ee1e(0x156)](_0x16c0e7);}