@lovrabet/cli 1.1.21 → 1.1.22

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 (65) 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/valid-url.js +1 -1
  16. package/lib/auth/auth-server-ui.js +1 -1
  17. package/lib/auth/auth-server.js +1 -1
  18. package/lib/auth/constant.js +1 -1
  19. package/lib/auth/get-cookie.js +1 -1
  20. package/lib/auth/is-session-valid.js +1 -1
  21. package/lib/auth/logout.js +1 -1
  22. package/lib/cli.js +1 -1
  23. package/lib/cmd/build-watch.js +1 -1
  24. package/lib/cmd/build.js +1 -1
  25. package/lib/cmd/logs.js +1 -1
  26. package/lib/cmd/preview.js +1 -1
  27. package/lib/cmd/start.js +1 -1
  28. package/lib/config/config-help.js +1 -1
  29. package/lib/config/main.js +1 -1
  30. package/lib/constant/domain.js +1 -1
  31. package/lib/constant/env.js +1 -1
  32. package/lib/create-app/enhanced-guided-create.js +1 -1
  33. package/lib/create-app/format-elapsed.js +1 -1
  34. package/lib/create-app/main.js +1 -1
  35. package/lib/create-app/task-finished.js +1 -1
  36. package/lib/create-app/task-loading.js +1 -1
  37. package/lib/create-app/task-running.js +1 -1
  38. package/lib/create-app/task-time.js +1 -1
  39. package/lib/create-app/use-copy-project-template.js +1 -1
  40. package/lib/create-app/use-format-code.js +1 -1
  41. package/lib/create-app/use-install-dependencies.js +1 -1
  42. package/lib/help.js +1 -1
  43. package/lib/init/main.js +1 -1
  44. package/lib/mcp/cursor.js +1 -1
  45. package/lib/mcp/main.js +1 -1
  46. package/lib/utils/config.js +1 -1
  47. package/lib/utils/copy-directory.js +1 -1
  48. package/lib/utils/http-client.js +1 -1
  49. package/lib/utils/logger.js +1 -1
  50. package/lib/utils/router-updater.js +1 -1
  51. package/lib/utils/sleep.js +1 -1
  52. package/lib/utils/template-replacer.js +1 -1
  53. package/package.json +1 -1
  54. package/templates/projects/sub-app-react-demo/CHANGELOG.md +16 -0
  55. package/templates/projects/sub-app-react-demo/README.md +163 -54
  56. package/templates/projects/sub-app-react-demo/package-lock.json +1347 -149
  57. package/templates/projects/sub-app-react-demo/package.json +2 -2
  58. package/templates/projects/sub-app-react-demo/src/layouts/MainLayout.tsx +286 -55
  59. package/templates/projects/sub-app-react-demo/src/pages/data-screen/index.tsx +526 -0
  60. package/templates/projects/sub-app-react-demo/src/pages/index.tsx +942 -87
  61. package/templates/projects/sub-app-react-demo/src/pages/intro/index.tsx +560 -0
  62. package/templates/projects/sub-app-react-demo/src/pages/sdk-demo/index.tsx +113 -118
  63. package/templates/projects/sub-app-react-demo/src/pages/workbench/index.tsx +469 -0
  64. package/templates/projects/sub-app-react-demo/src/style.css +39 -0
  65. package/templates/projects/sub-app-react-demo/bun.lock +0 -600
@@ -1 +1 @@
1
- (function(_0xf2badd,_0x1ef33e){const _0xc7b906=a0_0x3d95,_0x33b03b=_0xf2badd();while(!![]){try{const _0x56e24d=-parseInt(_0xc7b906(0x15f))/0x1*(parseInt(_0xc7b906(0x16c))/0x2)+-parseInt(_0xc7b906(0x175))/0x3+parseInt(_0xc7b906(0x170))/0x4+-parseInt(_0xc7b906(0x161))/0x5*(parseInt(_0xc7b906(0x16f))/0x6)+parseInt(_0xc7b906(0x15c))/0x7+parseInt(_0xc7b906(0x167))/0x8*(parseInt(_0xc7b906(0x15b))/0x9)+parseInt(_0xc7b906(0x179))/0xa*(-parseInt(_0xc7b906(0x177))/0xb);if(_0x56e24d===_0x1ef33e)break;else _0x33b03b['push'](_0x33b03b['shift']());}catch(_0x1d1ec2){_0x33b03b['push'](_0x33b03b['shift']());}}}(a0_0x5761,0xbd444));import{jsx as a0_0x2c861e,jsxs as a0_0x1cc710}from'react/jsx-runtime';import{useState}from'react';function a0_0x5761(){const _0xac53c6=['377892uIXExI','5985756BhIedv','gray','页面路径不合法','4SGDwrg','green','5pSiytd','red','test','\x20Step2:\x20','includes','页面路径\x20','192ESttlN','\x20直接回车确认,或输入自定义路由地址','slice','my-page','路径不能包含连续的\x20/','194146gFmiUC','endsWith','delete','782052KkJnwF','1293872xukYfw','路径不能以\x20/\x20开头或结尾','length','\x20←\x20','路径中的每个段只能以字母或数字开头,且只包含字母、数字、-\x20和\x20_','1123437VOkfwk','trim','187CRcRcH','backspace','304670LugwIh','return','页面路径长度不能超过\x20100\x20个字符','页面路由地址:\x20'];a0_0x5761=function(){return _0xac53c6;};return a0_0x5761();}function a0_0x3d95(_0x24c3ab,_0x3edb67){const _0x576138=a0_0x5761();return a0_0x3d95=function(_0x3d9566,_0x30620c){_0x3d9566=_0x3d9566-0x15b;let _0x2f9a3a=_0x576138[_0x3d9566];return _0x2f9a3a;},a0_0x3d95(_0x24c3ab,_0x3edb67);}import{Text,Box,useInput}from'ink';import a0_0x443f1e from'node:fs';export function InputProjectCode(_0x42df58){const _0x16c1e0=a0_0x3d95,{onSubmit:_0x25837d,pagePath:_0x232c12}=_0x42df58,[_0x40f013,_0xd42762]=useState(''),[_0x12fcec,_0x5d12e2]=useState(''),_0x54c025=_0x16c1e0(0x16a);function _0x247b4e(_0x1db0a1){const _0xef40c3=_0x16c1e0;if(_0x1db0a1[_0xef40c3(0x172)]>0x64)return{'valid':![],'message':_0xef40c3(0x17b)};if(_0x1db0a1['startsWith']('/')||_0x1db0a1[_0xef40c3(0x16d)]('/'))return{'valid':![],'message':_0xef40c3(0x171)};if(_0x1db0a1[_0xef40c3(0x165)]('//'))return{'valid':![],'message':_0xef40c3(0x16b)};const _0xa57262=_0x1db0a1['split']('/');for(const _0x3a34bf of _0xa57262){if(!_0x3a34bf)continue;const _0x12edab=/^[A-Za-z0-9][A-Za-z0-9_-]*$/;if(!_0x12edab[_0xef40c3(0x163)](_0x3a34bf))return{'valid':![],'message':_0xef40c3(0x174)};}return{'valid':!![]};}return useInput((_0x29a331,_0x5386c4)=>{const _0x22523e=_0x16c1e0;if(_0x5386c4[_0x22523e(0x17a)]){const _0x40a537=_0x40f013[_0x22523e(0x176)]()||_0x54c025;if(_0x12fcec)return;const _0x1c157f=_0x232c12+'/'+_0x40a537;if(a0_0x443f1e['existsSync'](_0x1c157f)){_0x5d12e2(_0x22523e(0x166)+_0x40a537+'\x20已存在,请使用其他路径');return;}_0x25837d(_0x40a537),_0xd42762(''),_0x5d12e2('');}else _0x5386c4[_0x22523e(0x178)]||_0x5386c4[_0x22523e(0x16e)]?_0xd42762(_0xeb5ca=>{const _0x4a6a0d=_0x22523e,_0x3e12be=_0xeb5ca[_0x4a6a0d(0x169)](0x0,-0x1),{valid:_0x2fe34f,message:_0x5a4d9e}=_0x247b4e(_0x3e12be);return _0x5d12e2(_0x2fe34f?'':_0x5a4d9e||_0x4a6a0d(0x15e)),_0x3e12be;}):_0xd42762(_0x235f77=>{const _0x4484d4=_0x22523e,_0x359e70=_0x235f77+_0x29a331,{valid:_0x56bef1,message:_0x5e301d}=_0x247b4e(_0x359e70);return _0x5d12e2(_0x56bef1?'':_0x5e301d||_0x4484d4(0x15e)),_0x359e70;});}),a0_0x1cc710(Box,{'flexDirection':'column','children':[a0_0x1cc710(Box,{'children':[a0_0x2c861e(Text,{'color':_0x16c1e0(0x15d),'children':_0x16c1e0(0x164)}),a0_0x2c861e(Text,{'children':_0x16c1e0(0x17c)}),_0x40f013?a0_0x2c861e(Text,{'color':_0x16c1e0(0x160),'children':_0x40f013}):a0_0x2c861e(Text,{'color':'gray','children':_0x54c025}),_0x12fcec&&a0_0x1cc710(Text,{'color':_0x16c1e0(0x162),'children':[_0x16c1e0(0x173),_0x12fcec]})]}),!_0x12fcec&&!_0x40f013&&a0_0x2c861e(Box,{'children':a0_0x2c861e(Text,{'color':'gray','children':_0x16c1e0(0x168)})})]});}
1
+ (function(_0x25eaf3,_0x35fa91){const _0x4cb01c=a0_0x18d3,_0x525969=_0x25eaf3();while(!![]){try{const _0x7d4a95=-parseInt(_0x4cb01c(0x1b3))/0x1+-parseInt(_0x4cb01c(0x19e))/0x2*(parseInt(_0x4cb01c(0x1ba))/0x3)+parseInt(_0x4cb01c(0x1ab))/0x4*(parseInt(_0x4cb01c(0x1bd))/0x5)+-parseInt(_0x4cb01c(0x1b8))/0x6+-parseInt(_0x4cb01c(0x1aa))/0x7*(-parseInt(_0x4cb01c(0x1a1))/0x8)+parseInt(_0x4cb01c(0x1bc))/0x9*(parseInt(_0x4cb01c(0x1a5))/0xa)+-parseInt(_0x4cb01c(0x1a4))/0xb;if(_0x7d4a95===_0x35fa91)break;else _0x525969['push'](_0x525969['shift']());}catch(_0x2fff04){_0x525969['push'](_0x525969['shift']());}}}(a0_0x4cc1,0xee20b));import{jsx as a0_0x51c09a,jsxs as a0_0x153f75}from'react/jsx-runtime';function a0_0x18d3(_0x30eab2,_0x3f2619){const _0x4cc11a=a0_0x4cc1();return a0_0x18d3=function(_0x18d3c8,_0x2ba532){_0x18d3c8=_0x18d3c8-0x19d;let _0x46318f=_0x4cc11a[_0x18d3c8];return _0x46318f;},a0_0x18d3(_0x30eab2,_0x3f2619);}import{useState}from'react';function a0_0x4cc1(){const _0x53f8f5=['页面路径不合法','2438194tflEqn','19125100kBHdmu','split','green','\x20已存在,请使用其他路径','slice','584017eaYXuF','12dLpzLU','\x20直接回车确认,或输入自定义路由地址','路径中的每个段只能以字母或数字开头,且只包含字母、数字、-\x20和\x20_','\x20←\x20','trim','页面路径长度不能超过\x20100\x20个字符','页面路由地址:\x20','路径不能包含连续的\x20/','137137JiXfCK','test','column','includes','delete','6261516UTwHHP','路径不能以\x20/\x20开头或结尾','14139ypBCpa','endsWith','9Vqbemd','2614965RBOszX','existsSync','610IEdRRE','gray','backspace','32wULzgu','页面路径\x20'];a0_0x4cc1=function(){return _0x53f8f5;};return a0_0x4cc1();}import{Text,Box,useInput}from'ink';import a0_0x37cfcf from'node:fs';export function InputProjectCode(_0x22f568){const _0x246bbc=a0_0x18d3,{onSubmit:_0xcf8980,pagePath:_0x3b95fe}=_0x22f568,[_0x51a166,_0x52c50d]=useState(''),[_0x6406eb,_0x51395d]=useState(''),_0x599186='my-page';function _0xdf3840(_0x40afc7){const _0x3c2190=a0_0x18d3;if(_0x40afc7['length']>0x64)return{'valid':![],'message':_0x3c2190(0x1b0)};if(_0x40afc7['startsWith']('/')||_0x40afc7[_0x3c2190(0x1bb)]('/'))return{'valid':![],'message':_0x3c2190(0x1b9)};if(_0x40afc7[_0x3c2190(0x1b6)]('//'))return{'valid':![],'message':_0x3c2190(0x1b2)};const _0x499406=_0x40afc7[_0x3c2190(0x1a6)]('/');for(const _0x399248 of _0x499406){if(!_0x399248)continue;const _0x19f91f=/^[A-Za-z0-9][A-Za-z0-9_-]*$/;if(!_0x19f91f[_0x3c2190(0x1b4)](_0x399248))return{'valid':![],'message':_0x3c2190(0x1ad)};}return{'valid':!![]};}return useInput((_0x1e577c,_0x5a475e)=>{const _0x7acb48=a0_0x18d3;if(_0x5a475e['return']){const _0x138c66=_0x51a166[_0x7acb48(0x1af)]()||_0x599186;if(_0x6406eb)return;const _0x463d69=_0x3b95fe+'/'+_0x138c66;if(a0_0x37cfcf[_0x7acb48(0x19d)](_0x463d69)){_0x51395d(_0x7acb48(0x1a2)+_0x138c66+_0x7acb48(0x1a8));return;}_0xcf8980(_0x138c66),_0x52c50d(''),_0x51395d('');}else _0x5a475e[_0x7acb48(0x1a0)]||_0x5a475e[_0x7acb48(0x1b7)]?_0x52c50d(_0x210760=>{const _0x47e1da=_0x7acb48,_0x288ec2=_0x210760[_0x47e1da(0x1a9)](0x0,-0x1),{valid:_0x4d1381,message:_0x5d575c}=_0xdf3840(_0x288ec2);return _0x51395d(_0x4d1381?'':_0x5d575c||_0x47e1da(0x1a3)),_0x288ec2;}):_0x52c50d(_0x8c092d=>{const _0x5867b6=_0x8c092d+_0x1e577c,{valid:_0x3b4602,message:_0x1a4bc8}=_0xdf3840(_0x5867b6);return _0x51395d(_0x3b4602?'':_0x1a4bc8||'页面路径不合法'),_0x5867b6;});}),a0_0x153f75(Box,{'flexDirection':_0x246bbc(0x1b5),'children':[a0_0x153f75(Box,{'children':[a0_0x51c09a(Text,{'color':_0x246bbc(0x19f),'children':'\x20Step2:\x20'}),a0_0x51c09a(Text,{'children':_0x246bbc(0x1b1)}),_0x51a166?a0_0x51c09a(Text,{'color':_0x246bbc(0x1a7),'children':_0x51a166}):a0_0x51c09a(Text,{'color':_0x246bbc(0x19f),'children':_0x599186}),_0x6406eb&&a0_0x153f75(Text,{'color':'red','children':[_0x246bbc(0x1ae),_0x6406eb]})]}),!_0x6406eb&&!_0x51a166&&a0_0x51c09a(Box,{'children':a0_0x51c09a(Text,{'color':_0x246bbc(0x19f),'children':_0x246bbc(0x1ac)})})]});}
@@ -1 +1 @@
1
- const a1_0x33bf2e=a1_0x1974;(function(_0x419844,_0x195be2){const _0x26a001=a1_0x1974,_0x41a9dc=_0x419844();while(!![]){try{const _0x12b23a=parseInt(_0x26a001(0xfb))/0x1*(-parseInt(_0x26a001(0x116))/0x2)+-parseInt(_0x26a001(0x10f))/0x3*(-parseInt(_0x26a001(0xff))/0x4)+-parseInt(_0x26a001(0xf7))/0x5*(parseInt(_0x26a001(0x103))/0x6)+parseInt(_0x26a001(0x108))/0x7*(-parseInt(_0x26a001(0x102))/0x8)+-parseInt(_0x26a001(0xf9))/0x9+-parseInt(_0x26a001(0xf8))/0xa*(-parseInt(_0x26a001(0xf5))/0xb)+parseInt(_0x26a001(0xfe))/0xc;if(_0x12b23a===_0x195be2)break;else _0x41a9dc['push'](_0x41a9dc['shift']());}catch(_0x1fb545){_0x41a9dc['push'](_0x41a9dc['shift']());}}}(a1_0x1a63,0x88c83));import{jsx as a1_0x4c02e7,jsxs as a1_0x2efb90,Fragment as a1_0x127cc3}from'react/jsx-runtime';function a1_0x1a63(){const _0x5a54c3=['src','开始添加页面:\x20','column','cyan','\x20Step1:\x20','3beAWOL','../../templates/pages','页面添加成功:\x20','resolve','green','setLogPath','pages','108382NxTRLi','gray','页面添加失败:\x20','已选择页面模板\x20','已输入的页面路由\x20','dirname','33JKRncp','\x20*\x20页面路径:\x20','6950HlPKZS','1011200SCYSKG','5847696wynUvS','add-page','7KxHGNA','join','cwd','23968644uaREUW','1641508SdeCkE','error','\x20*\x20页面创建成功!','8lsKTwM','438kdOlHV','url','now','finally','正在创建页面,请稍候…','7142198eoKjvD','\x20*\x20路由地址:\x20'];a1_0x1a63=function(){return _0x5a54c3;};return a1_0x1a63();}import{fileURLToPath}from'node:url';import a1_0x58e6a7 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';function a1_0x1974(_0x5522b7,_0x2792f7){const _0x1a63c9=a1_0x1a63();return a1_0x1974=function(_0x1974b3,_0x5b5889){_0x1974b3=_0x1974b3-0xf0;let _0x21e13c=_0x1a63c9[_0x1974b3];return _0x21e13c;},a1_0x1974(_0x5522b7,_0x2792f7);}import{TemplateReplacer}from'../utils/template-replacer.js';const __dirname=a1_0x58e6a7[a1_0x33bf2e(0xf4)](fileURLToPath(import.meta[a1_0x33bf2e(0x104)])),pageTemplateDir=a1_0x58e6a7['resolve'](__dirname,a1_0x33bf2e(0x110)),projectDir=process[a1_0x33bf2e(0xfd)]();export const AddPage=()=>{const _0x12ee93=a1_0x33bf2e,{exit:_0x516044}=useApp(),[_0x416a10,_0x321277]=useState(''),[_0x386c34,_0x3d9914]=useState(''),[_0x14ab22,_0x340640]=useState(![]),[_0x40a0b2,_0x4675d7]=useState(![]),_0x54b5ba=a1_0x58e6a7['join'](projectDir,_0x12ee93(0x10a),_0x12ee93(0x115)),_0x47cce6=a1_0x58e6a7[_0x12ee93(0xfc)](_0x54b5ba,_0x386c34),_0x4fb057=a1_0x58e6a7['join']('src','pages',_0x386c34);useEffect(()=>{const _0xb9b331=_0x12ee93,_0xb1af51=a1_0x58e6a7[_0xb9b331(0x112)](pageTemplateDir,_0x416a10);if(_0x416a10&&_0x386c34){_0x340640(!![]),logger[_0xb9b331(0x114)](process['cwd']());const _0x5d6a34=Date['now']();logger['info'](_0xb9b331(0xfa),_0xb9b331(0x10b)+_0x386c34,{'template':_0x416a10,'targetPath':_0x4fb057}),TemplateReplacer['processTemplate'](_0xb1af51,a1_0x58e6a7['join'](_0x54b5ba,_0x386c34),_0x386c34,_0x416a10)['then'](()=>{const _0xfe9e3e=_0xb9b331,_0x4be9f6=Date[_0xfe9e3e(0x105)]()-_0x5d6a34;logger['success']('add-page',_0xfe9e3e(0x111)+_0x386c34,_0x4be9f6,{'template':_0x416a10,'targetPath':_0x4fb057,'routePath':_0x386c34}),_0x4675d7(!![]);})['catch'](_0x565e96=>{const _0x2bd84b=_0xb9b331,_0x1ffedb=Date[_0x2bd84b(0x105)]()-_0x5d6a34;logger[_0x2bd84b(0x100)](_0x2bd84b(0xfa),_0x2bd84b(0xf1)+_0x386c34,{'template':_0x416a10,'targetPath':_0x4fb057,'error':_0x565e96 instanceof Error?_0x565e96['message']:String(_0x565e96),'duration':_0x1ffedb});})[_0xb9b331(0x106)](()=>{_0x340640(![]);});}},[_0x416a10,_0x386c34]),useEffect(()=>{_0x40a0b2&&setTimeout(()=>{_0x516044();});},[_0x40a0b2]);if(_0x416a10)return a1_0x2efb90(Box,{'flexDirection':_0x12ee93(0x10c),'paddingY':0x1,'children':[a1_0x2efb90(Box,{'children':[a1_0x4c02e7(Text,{'color':_0x12ee93(0xf0),'children':_0x12ee93(0x10e)}),a1_0x4c02e7(Text,{'children':_0x12ee93(0xf2)}),a1_0x4c02e7(Text,{'color':_0x12ee93(0x113),'children':_0x416a10})]}),_0x386c34?a1_0x2efb90(Box,{'children':[a1_0x4c02e7(Text,{'color':'gray','children':'\x20Step2:\x20'}),a1_0x4c02e7(Text,{'children':_0x12ee93(0xf3)}),a1_0x4c02e7(Text,{'color':_0x12ee93(0x113),'children':_0x386c34})]}):a1_0x4c02e7(InputProjectCode,{'pagePath':_0x47cce6,'onSubmit':_0x3d9914}),_0x386c34&&_0x14ab22?a1_0x2efb90(Box,{'marginTop':0x1,'children':[a1_0x4c02e7(Box,{'width':'4'}),a1_0x4c02e7(Text,{'children':_0x12ee93(0x107)})]}):null,_0x40a0b2?a1_0x2efb90(a1_0x127cc3,{'children':[a1_0x4c02e7(Box,{'marginTop':0x1,'children':a1_0x4c02e7(Text,{'color':_0x12ee93(0xf0),'children':_0x12ee93(0x101)})}),a1_0x2efb90(Box,{'children':[a1_0x4c02e7(Text,{'color':_0x12ee93(0xf0),'children':_0x12ee93(0xf6)}),a1_0x4c02e7(Text,{'color':_0x12ee93(0x113),'children':_0x4fb057})]}),a1_0x2efb90(Box,{'children':[a1_0x4c02e7(Text,{'color':_0x12ee93(0xf0),'children':_0x12ee93(0x109)}),a1_0x2efb90(Text,{'color':_0x12ee93(0x113),'children':['/',_0x386c34]})]}),a1_0x4c02e7(Box,{'marginTop':0x1,'children':a1_0x4c02e7(Text,{'color':_0x12ee93(0x10d),'children':'\x20*\x20页面文件已创建,可直接通过路由访问'})})]}):null]});return a1_0x4c02e7(SelectPageTemplate,{'onSelect':_0x321277});};
1
+ const a1_0x4d5b10=a1_0x4740;(function(_0x303bde,_0x1b7cc8){const _0x3114e2=a1_0x4740,_0xc95ea8=_0x303bde();while(!![]){try{const _0x54e037=-parseInt(_0x3114e2(0x1f9))/0x1*(-parseInt(_0x3114e2(0x1de))/0x2)+parseInt(_0x3114e2(0x1ff))/0x3+-parseInt(_0x3114e2(0x1f0))/0x4+parseInt(_0x3114e2(0x1e9))/0x5*(parseInt(_0x3114e2(0x1fe))/0x6)+parseInt(_0x3114e2(0x1e8))/0x7*(parseInt(_0x3114e2(0x1e2))/0x8)+-parseInt(_0x3114e2(0x1f3))/0x9+-parseInt(_0x3114e2(0x1ed))/0xa*(parseInt(_0x3114e2(0x1eb))/0xb);if(_0x54e037===_0x1b7cc8)break;else _0xc95ea8['push'](_0xc95ea8['shift']());}catch(_0x3d1dd2){_0xc95ea8['push'](_0xc95ea8['shift']());}}}(a1_0x1126,0x35644));import{jsx as a1_0x48abd6,jsxs as a1_0x5cf44a,Fragment as a1_0xd73a}from'react/jsx-runtime';import{fileURLToPath}from'node:url';import a1_0x1f39fb from'node:path';import{useEffect,useState}from'react';import{Box,Text,useApp}from'ink';import{SelectPageTemplate}from'./select-page-template.js';function a1_0x4740(_0x147a1b,_0x1cc9c6){const _0x11263f=a1_0x1126();return a1_0x4740=function(_0x47409c,_0x4673a7){_0x47409c=_0x47409c-0x1de;let _0x48bb4b=_0x11263f[_0x47409c];return _0x48bb4b;},a1_0x4740(_0x147a1b,_0x1cc9c6);}import{InputProjectCode}from'./input-page-router.js';import{logger}from'../utils/logger.js';import{TemplateReplacer}from'../utils/template-replacer.js';const __dirname=a1_0x1f39fb['dirname'](fileURLToPath(import.meta[a1_0x4d5b10(0x1f5)])),pageTemplateDir=a1_0x1f39fb[a1_0x4d5b10(0x1f2)](__dirname,a1_0x4d5b10(0x200)),projectDir=process[a1_0x4d5b10(0x1ea)]();function a1_0x1126(){const _0x425b63=['正在创建页面,请稍候…','join','setLogPath','error','431431FWNHyd','170laYhES','cwd','412731wGjcfn','finally','30DQNRFS','column','开始添加页面:\x20','900728uXvVLJ','gray','resolve','1859814yytCVa','green','url','pages','页面添加失败:\x20','src','56SCdGTp','\x20*\x20页面文件已创建,可直接通过路由访问','now','\x20*\x20路由地址:\x20','catch','41466wVYhVd','224682rMqHnA','../../templates/pages','\x20Step1:\x20','已输入的页面路由\x20','\x20*\x20页面创建成功!','add-page','778GcyLxS','已选择页面模板\x20','then','\x20Step2:\x20','56BFPxbq','success'];a1_0x1126=function(){return _0x425b63;};return a1_0x1126();}export const AddPage=()=>{const _0x218702=a1_0x4d5b10,{exit:_0x39ac1d}=useApp(),[_0x268b39,_0x3693d0]=useState(''),[_0x37726a,_0x1e130f]=useState(''),[_0xd6178,_0x592c85]=useState(![]),[_0x3f3ca3,_0x4e3acd]=useState(![]),_0x3ee390=a1_0x1f39fb['join'](projectDir,_0x218702(0x1f8),_0x218702(0x1f6)),_0x3bba92=a1_0x1f39fb[_0x218702(0x1e5)](_0x3ee390,_0x37726a),_0x56b087=a1_0x1f39fb[_0x218702(0x1e5)](_0x218702(0x1f8),_0x218702(0x1f6),_0x37726a);useEffect(()=>{const _0x8251fa=_0x218702,_0x4f6ff4=a1_0x1f39fb[_0x8251fa(0x1f2)](pageTemplateDir,_0x268b39);if(_0x268b39&&_0x37726a){_0x592c85(!![]),logger[_0x8251fa(0x1e6)](process[_0x8251fa(0x1ea)]());const _0x213ee9=Date['now']();logger['info']('add-page',_0x8251fa(0x1ef)+_0x37726a,{'template':_0x268b39,'targetPath':_0x56b087}),TemplateReplacer['processTemplate'](_0x4f6ff4,a1_0x1f39fb[_0x8251fa(0x1e5)](_0x3ee390,_0x37726a),_0x37726a,_0x268b39)[_0x8251fa(0x1e0)](()=>{const _0x469984=_0x8251fa,_0x5a8224=Date[_0x469984(0x1fb)]()-_0x213ee9;logger[_0x469984(0x1e3)](_0x469984(0x204),'页面添加成功:\x20'+_0x37726a,_0x5a8224,{'template':_0x268b39,'targetPath':_0x56b087,'routePath':_0x37726a}),_0x4e3acd(!![]);})[_0x8251fa(0x1fd)](_0xa8fc69=>{const _0x229ddc=_0x8251fa,_0x546067=Date[_0x229ddc(0x1fb)]()-_0x213ee9;logger[_0x229ddc(0x1e7)](_0x229ddc(0x204),_0x229ddc(0x1f7)+_0x37726a,{'template':_0x268b39,'targetPath':_0x56b087,'error':_0xa8fc69 instanceof Error?_0xa8fc69['message']:String(_0xa8fc69),'duration':_0x546067});})[_0x8251fa(0x1ec)](()=>{_0x592c85(![]);});}},[_0x268b39,_0x37726a]),useEffect(()=>{_0x3f3ca3&&setTimeout(()=>{_0x39ac1d();});},[_0x3f3ca3]);if(_0x268b39)return a1_0x5cf44a(Box,{'flexDirection':_0x218702(0x1ee),'paddingY':0x1,'children':[a1_0x5cf44a(Box,{'children':[a1_0x48abd6(Text,{'color':'gray','children':_0x218702(0x201)}),a1_0x48abd6(Text,{'children':_0x218702(0x1df)}),a1_0x48abd6(Text,{'color':_0x218702(0x1f4),'children':_0x268b39})]}),_0x37726a?a1_0x5cf44a(Box,{'children':[a1_0x48abd6(Text,{'color':_0x218702(0x1f1),'children':_0x218702(0x1e1)}),a1_0x48abd6(Text,{'children':_0x218702(0x202)}),a1_0x48abd6(Text,{'color':_0x218702(0x1f4),'children':_0x37726a})]}):a1_0x48abd6(InputProjectCode,{'pagePath':_0x3bba92,'onSubmit':_0x1e130f}),_0x37726a&&_0xd6178?a1_0x5cf44a(Box,{'marginTop':0x1,'children':[a1_0x48abd6(Box,{'width':'4'}),a1_0x48abd6(Text,{'children':_0x218702(0x1e4)})]}):null,_0x3f3ca3?a1_0x5cf44a(a1_0xd73a,{'children':[a1_0x48abd6(Box,{'marginTop':0x1,'children':a1_0x48abd6(Text,{'color':'gray','children':_0x218702(0x203)})}),a1_0x5cf44a(Box,{'children':[a1_0x48abd6(Text,{'color':_0x218702(0x1f1),'children':'\x20*\x20页面路径:\x20'}),a1_0x48abd6(Text,{'color':_0x218702(0x1f4),'children':_0x56b087})]}),a1_0x5cf44a(Box,{'children':[a1_0x48abd6(Text,{'color':_0x218702(0x1f1),'children':_0x218702(0x1fc)}),a1_0x5cf44a(Text,{'color':_0x218702(0x1f4),'children':['/',_0x37726a]})]}),a1_0x48abd6(Box,{'marginTop':0x1,'children':a1_0x48abd6(Text,{'color':'cyan','children':_0x218702(0x1fa)})})]}):null]});return a1_0x48abd6(SelectPageTemplate,{'onSelect':_0x3693d0});};
@@ -1 +1 @@
1
- function a2_0x1682(_0x35b607,_0x3fbec2){const _0x2669f8=a2_0x2669();return a2_0x1682=function(_0x168271,_0x5341bf){_0x168271=_0x168271-0x1e0;let _0x4d1d5f=_0x2669f8[_0x168271];return _0x4d1d5f;},a2_0x1682(_0x35b607,_0x3fbec2);}(function(_0x383fc3,_0x1efda9){const _0x2755d2=a2_0x1682,_0x11f6a3=_0x383fc3();while(!![]){try{const _0x25cc37=-parseInt(_0x2755d2(0x200))/0x1*(parseInt(_0x2755d2(0x1e9))/0x2)+parseInt(_0x2755d2(0x1ef))/0x3+-parseInt(_0x2755d2(0x1ec))/0x4+-parseInt(_0x2755d2(0x1f9))/0x5*(-parseInt(_0x2755d2(0x201))/0x6)+-parseInt(_0x2755d2(0x1f5))/0x7*(parseInt(_0x2755d2(0x1e4))/0x8)+-parseInt(_0x2755d2(0x1e7))/0x9+-parseInt(_0x2755d2(0x1f6))/0xa*(-parseInt(_0x2755d2(0x1f3))/0xb);if(_0x25cc37===_0x1efda9)break;else _0x11f6a3['push'](_0x11f6a3['shift']());}catch(_0x129187){_0x11f6a3['push'](_0x11f6a3['shift']());}}}(a2_0x2669,0xcb8b4));import{jsx as a2_0x582d49,jsxs as a2_0x3b592b}from'react/jsx-runtime';import{useState,useEffect}from'react';import{Text,Box,useInput}from'ink';import{readdir}from'node:fs/promises';function a2_0x2669(){const _0x47672b=['6KBvdVB','\x20Step1:\x20','error','\x20\x20\x20\x20\x20\x20\x20\x20','join','filter','9807416aNfQgB','downArrow','blank','12158802jCNNXi','获取模板列表失败:','16jpOzWJ','length','resolve','2229128yHHghC','localeCompare','gray','1461753KWaHYI','label','请选择您要创建的页面模板','正在加载页面模板...','341qnkYuS','sdk-fetch','7HvDtvD','1071410xWPejm','return','column','2674285UosoNG','map','dirname','templates/pages','sort','name','../..','46947fQwnds'];a2_0x2669=function(){return _0x47672b;};return a2_0x2669();}import a2_0x1658c0 from'node:path';import{fileURLToPath}from'node:url';async function getTemplateList(){const _0xe8b60e=a2_0x1682;try{const _0x1e7305=fileURLToPath(import.meta['url']),_0xdf1dac=a2_0x1658c0[_0xe8b60e(0x1eb)](a2_0x1658c0[_0xe8b60e(0x1fb)](_0x1e7305),_0xe8b60e(0x1ff)),_0x12adf8=a2_0x1658c0[_0xe8b60e(0x1e2)](_0xdf1dac,_0xe8b60e(0x1fc)),_0x7b8214=await readdir(_0x12adf8,{'withFileTypes':!![]}),_0x372136=_0x7b8214[_0xe8b60e(0x1e3)](_0xefa308=>_0xefa308['isDirectory']())[_0xe8b60e(0x1fa)](_0x262e0f=>({'label':_0x262e0f[_0xe8b60e(0x1fe)]}))[_0xe8b60e(0x1fd)]((_0x200da6,_0x1549df)=>_0x200da6[_0xe8b60e(0x1f0)][_0xe8b60e(0x1ed)](_0x1549df[_0xe8b60e(0x1f0)]));return _0x372136;}catch(_0x2d77ce){return console[_0xe8b60e(0x1e0)](_0xe8b60e(0x1e8),_0x2d77ce),[{'label':_0xe8b60e(0x1e6)},{'label':_0xe8b60e(0x1f4)}];}}export function SelectPageTemplate(_0x456ab2){const _0x30205b=a2_0x1682,[_0x4d325e,_0x5a9fe2]=useState(0x0),[_0x447345,_0x563e4e]=useState([]),[_0x1142f7,_0x27d092]=useState(!![]);useEffect(()=>{async function _0x1e44b9(){const _0x43100b=await getTemplateList();_0x563e4e(_0x43100b),_0x27d092(![]);}_0x1e44b9();},[]),useInput((_0x4f53ab,_0x478ffe)=>{const _0x38d5e9=a2_0x1682;if(_0x1142f7)return;if(_0x478ffe[_0x38d5e9(0x1f7)]){const _0x460bae=_0x447345[_0x4d325e];_0x460bae&&_0x456ab2['onSelect'](_0x460bae[_0x38d5e9(0x1f0)]);}_0x478ffe['upArrow']&&_0x5a9fe2(_0x2c1885=>_0x2c1885===0x0?_0x447345[_0x38d5e9(0x1ea)]-0x1:_0x2c1885-0x1),_0x478ffe[_0x38d5e9(0x1e5)]&&_0x5a9fe2(_0x15aeb8=>_0x15aeb8===_0x447345[_0x38d5e9(0x1ea)]-0x1?0x0:_0x15aeb8+0x1);});if(_0x1142f7)return a2_0x582d49(Box,{'flexDirection':_0x30205b(0x1f8),'paddingY':0x1,'children':a2_0x3b592b(Box,{'children':[a2_0x582d49(Text,{'color':'gray','children':_0x30205b(0x202)}),a2_0x582d49(Text,{'children':_0x30205b(0x1f2)})]})});return a2_0x3b592b(Box,{'flexDirection':'column','paddingY':0x1,'children':[a2_0x3b592b(Box,{'children':[a2_0x582d49(Text,{'color':_0x30205b(0x1ee),'children':_0x30205b(0x202)}),a2_0x582d49(Text,{'children':_0x30205b(0x1f1)})]}),_0x447345[_0x30205b(0x1fa)]((_0x5ddaa2,_0x4bc306)=>{const _0x448d23=_0x30205b,_0x5c4594=_0x4bc306===_0x4d325e,_0x38464a=_0x5c4594?'\x20\x20\x20\x20\x20\x20>\x20'+_0x5ddaa2[_0x448d23(0x1f0)]:_0x448d23(0x1e1)+_0x5ddaa2[_0x448d23(0x1f0)];return a2_0x582d49(Box,{'children':a2_0x582d49(Text,{'color':_0x5c4594?'green':undefined,'children':_0x38464a})},_0x38464a);})]});}
1
+ (function(_0x592dd2,_0x392a2f){const _0x46f3a9=a2_0xa248,_0x5f3c9d=_0x592dd2();while(!![]){try{const _0x3b8d1f=parseInt(_0x46f3a9(0xf0))/0x1*(-parseInt(_0x46f3a9(0xfe))/0x2)+parseInt(_0x46f3a9(0x105))/0x3+parseInt(_0x46f3a9(0x10d))/0x4+parseInt(_0x46f3a9(0x10c))/0x5*(parseInt(_0x46f3a9(0x10f))/0x6)+parseInt(_0x46f3a9(0xf9))/0x7+-parseInt(_0x46f3a9(0xfd))/0x8*(parseInt(_0x46f3a9(0xee))/0x9)+-parseInt(_0x46f3a9(0x108))/0xa;if(_0x3b8d1f===_0x392a2f)break;else _0x5f3c9d['push'](_0x5f3c9d['shift']());}catch(_0x5cf000){_0x5f3c9d['push'](_0x5f3c9d['shift']());}}}(a2_0x415b,0xc78e2));import{jsx as a2_0x51b22f,jsxs as a2_0xebab2a}from'react/jsx-runtime';import{useState,useEffect}from'react';function a2_0x415b(){const _0xb065b1=['error','templates/pages','onSelect','label','column','resolve','filter','\x20\x20\x20\x20\x20\x20>\x20','9842420bNvLFO','map','green','sort','4950032KqNXBA','17156eUimnq','正在加载页面模板...','localeCompare','return','gray','\x20\x20\x20\x20\x20\x20\x20\x20','sdk-fetch','3247212ssaMkD','length','请选择您要创建的页面模板','15913720OOGAHl','isDirectory','downArrow','\x20Step1:\x20','1243595OUYanJ','1916664ZzeAxE','blank','24uVclsJ','9OoEsAo','join','109CMFbrt'];a2_0x415b=function(){return _0xb065b1;};return a2_0x415b();}function a2_0xa248(_0x13279a,_0x532166){const _0x415bb6=a2_0x415b();return a2_0xa248=function(_0xa248b9,_0x25c90a){_0xa248b9=_0xa248b9-0xee;let _0x86c610=_0x415bb6[_0xa248b9];return _0x86c610;},a2_0xa248(_0x13279a,_0x532166);}import{Text,Box,useInput}from'ink';import{readdir}from'node:fs/promises';import a2_0xd2d4ca from'node:path';import{fileURLToPath}from'node:url';async function getTemplateList(){const _0x59ca50=a2_0xa248;try{const _0x3bab79=fileURLToPath(import.meta['url']),_0x27c3ee=a2_0xd2d4ca[_0x59ca50(0xf6)](a2_0xd2d4ca['dirname'](_0x3bab79),'../..'),_0x11a1c8=a2_0xd2d4ca[_0x59ca50(0xef)](_0x27c3ee,_0x59ca50(0xf2)),_0xdd6345=await readdir(_0x11a1c8,{'withFileTypes':!![]}),_0x20659c=_0xdd6345[_0x59ca50(0xf7)](_0x3d92d7=>_0x3d92d7[_0x59ca50(0x109)]())[_0x59ca50(0xfa)](_0x1057f4=>({'label':_0x1057f4['name']}))[_0x59ca50(0xfc)]((_0x4464be,_0xd0f9ba)=>_0x4464be['label'][_0x59ca50(0x100)](_0xd0f9ba[_0x59ca50(0xf4)]));return _0x20659c;}catch(_0x33b486){return console[_0x59ca50(0xf1)]('获取模板列表失败:',_0x33b486),[{'label':_0x59ca50(0x10e)},{'label':_0x59ca50(0x104)}];}}export function SelectPageTemplate(_0x1105d1){const _0x1a3661=a2_0xa248,[_0x24b116,_0x34942e]=useState(0x0),[_0x554198,_0x4926e8]=useState([]),[_0x36a9cb,_0x57e06d]=useState(!![]);useEffect(()=>{async function _0x3e0e89(){const _0x2f50a5=await getTemplateList();_0x4926e8(_0x2f50a5),_0x57e06d(![]);}_0x3e0e89();},[]),useInput((_0x303ec6,_0xea48ff)=>{const _0x388a23=a2_0xa248;if(_0x36a9cb)return;if(_0xea48ff[_0x388a23(0x101)]){const _0x4ed3b8=_0x554198[_0x24b116];_0x4ed3b8&&_0x1105d1[_0x388a23(0xf3)](_0x4ed3b8[_0x388a23(0xf4)]);}_0xea48ff['upArrow']&&_0x34942e(_0x5a80e6=>_0x5a80e6===0x0?_0x554198[_0x388a23(0x106)]-0x1:_0x5a80e6-0x1),_0xea48ff[_0x388a23(0x10a)]&&_0x34942e(_0x2e9cf9=>_0x2e9cf9===_0x554198[_0x388a23(0x106)]-0x1?0x0:_0x2e9cf9+0x1);});if(_0x36a9cb)return a2_0x51b22f(Box,{'flexDirection':'column','paddingY':0x1,'children':a2_0xebab2a(Box,{'children':[a2_0x51b22f(Text,{'color':_0x1a3661(0x102),'children':'\x20Step1:\x20'}),a2_0x51b22f(Text,{'children':_0x1a3661(0xff)})]})});return a2_0xebab2a(Box,{'flexDirection':_0x1a3661(0xf5),'paddingY':0x1,'children':[a2_0xebab2a(Box,{'children':[a2_0x51b22f(Text,{'color':_0x1a3661(0x102),'children':_0x1a3661(0x10b)}),a2_0x51b22f(Text,{'children':_0x1a3661(0x107)})]}),_0x554198[_0x1a3661(0xfa)]((_0x48ae1a,_0x3b14ab)=>{const _0x5314f9=_0x1a3661,_0x3c0b68=_0x3b14ab===_0x24b116,_0x286fd5=_0x3c0b68?_0x5314f9(0xf8)+_0x48ae1a['label']:_0x5314f9(0x103)+_0x48ae1a[_0x5314f9(0xf4)];return a2_0x51b22f(Box,{'children':a2_0x51b22f(Text,{'color':_0x3c0b68?_0x5314f9(0xfb):undefined,'children':_0x286fd5})},_0x286fd5);})]});}
@@ -1 +1 @@
1
- (function(_0x25fb44,_0x18ab80){const _0x359152=a3_0x49c0,_0x50ff38=_0x25fb44();while(!![]){try{const _0x23fd69=parseInt(_0x359152(0x1ae))/0x1*(parseInt(_0x359152(0x188))/0x2)+-parseInt(_0x359152(0x1b0))/0x3*(parseInt(_0x359152(0x191))/0x4)+-parseInt(_0x359152(0x184))/0x5*(parseInt(_0x359152(0x1a2))/0x6)+-parseInt(_0x359152(0x18d))/0x7*(-parseInt(_0x359152(0x189))/0x8)+parseInt(_0x359152(0x1ab))/0x9*(-parseInt(_0x359152(0x19e))/0xa)+-parseInt(_0x359152(0x183))/0xb+parseInt(_0x359152(0x1ac))/0xc;if(_0x23fd69===_0x18ab80)break;else _0x50ff38['push'](_0x50ff38['shift']());}catch(_0x513477){_0x50ff38['push'](_0x50ff38['shift']());}}}(a3_0x1bee,0x66148));import{jsx as a3_0x483217,jsxs as a3_0x62b9f2,Fragment as a3_0x3edc6d}from'react/jsx-runtime';import{useEffect,useState}from'react';function a3_0x1bee(){const _0xaa500b=['white','15tRbfCT','map','error','column','red','*\x20共处理\x20','green','cyan','log','online','文档生成失败:\x20','2331373VjIGWd','25QLUQoD','*\x20生成的文档文件:','\x20个匹配的数据集\x1b[0m','yellow','2RUunLV','8sddnZi','\x20个数据集的文档...','includes','dim','640829GQBsSh','√\x20文档生成完成!成功\x20','\x20个数据集中筛选出\x20','指定的数据集代码都不存在:\x20','425844gsUJVb','api-doc','cwd','string','⚠️\x20以下数据集生成失败:','.md\x20(','env','💡\x20请使用\x20','使用配置的应用AppCode:\x20','\x1b[33m!\x20以下数据集代码不存在:\x20','gray','\x1b[90m*\x20从\x20','未提供应用AppCode,且配置中也没有默认值','6515830lYWxmv','datasetCode','filter',',\x20失败\x20','157218osYqaN','\x20-\x20','使用指定的应用AppCode:\x20','文档生成完成','正在生成\x20','length','join','setLogPath','🚀\x20','9FrgryZ','13298616osiwQg','success','745201utHPfQ'];a3_0x1bee=function(){return _0xaa500b;};return a3_0x1bee();}import{Box,Text,useApp}from'ink';import{readConfig,getConfigAppCode}from'../utils/config.js';import{initEnv}from'../constant/env.js';function a3_0x49c0(_0x313889,_0x9c2d87){const _0x1bee80=a3_0x1bee();return a3_0x49c0=function(_0x49c070,_0x937c89){_0x49c070=_0x49c070-0x181;let _0x2902c2=_0x1bee80[_0x49c070];return _0x2902c2;},a3_0x49c0(_0x313889,_0x9c2d87);}import{fetchModelList}from'./fetch-model-list.js';import{generateDatasetDocs}from'./api-doc.js';import{logger}from'../utils/logger.js';export const ApiDocUI=({appCode:_0x26edfb,env:_0x4c5112,output:_0xed4ba6,extraParams:_0xb94a1d,datasetCodes:_0x10de04})=>{const _0x3a7ba5=a3_0x49c0,{exit:_0x92c203}=useApp(),[_0x45dca3,_0x59c95d]=useState(![]),[_0x36ca44,_0x4e6a86]=useState(''),[_0x452631,_0x55f5a7]=useState(![]),[_0xddf37f,_0x54ee24]=useState(null),[_0x34d9a1,_0x23aa1f]=useState(null),[_0x2b7746,_0x16385d]=useState(0x0),_0x40b80c=readConfig(),_0x7d88f7=getConfigAppCode(),_0x2aa25d=_0x26edfb||_0x7d88f7,_0x29c09f=typeof _0x40b80c?.[_0x3a7ba5(0x197)]===_0x3a7ba5(0x194)?_0x40b80c['env']:undefined,_0x6f0122=_0x4c5112||_0x29c09f||_0x3a7ba5(0x181);initEnv(_0x6f0122);const _0x468458=_0xed4ba6||'./docs',_0x55fded=_0x26edfb?_0x3a7ba5(0x1a4)+_0x2aa25d:_0x3a7ba5(0x199)+_0x2aa25d;useEffect(()=>{_0x59c95d(!![]),_0x975e9();},[]),useEffect(()=>{(_0x452631||_0xddf37f)&&_0x92c203();},[_0x452631,_0xddf37f,_0x92c203]);async function _0x975e9(){const _0x428c88=_0x3a7ba5;if(!_0x2aa25d){_0x54ee24(_0x428c88(0x19d));return;}try{logger[_0x428c88(0x1a9)](process[_0x428c88(0x193)]()),_0x4e6a86('正在获取数据集列表...');const {configArray:_0x210ccf}=await fetchModelList(_0x2aa25d);_0x16385d(_0x210ccf[_0x428c88(0x1a7)]);if(_0x210ccf['length']===0x0){_0x54ee24('未找到任何数据集');return;}let _0x2b70c5=_0x210ccf;if(_0x10de04&&_0x10de04['length']>0x0){_0x2b70c5=_0x210ccf['filter'](_0x87d3ee=>_0x10de04[_0x428c88(0x18b)](_0x87d3ee[_0x428c88(0x19f)]));const _0x5d0308=_0x2b70c5[_0x428c88(0x1b1)](_0x114538=>_0x114538[_0x428c88(0x19f)]),_0x31bee1=_0x10de04[_0x428c88(0x1a0)](_0x2fedd0=>!_0x5d0308[_0x428c88(0x18b)](_0x2fedd0));_0x31bee1[_0x428c88(0x1a7)]>0x0&&console[_0x428c88(0x1b8)](_0x428c88(0x19a)+_0x31bee1[_0x428c88(0x1a8)](',\x20')+'\x1b[0m');if(_0x2b70c5[_0x428c88(0x1a7)]===0x0){_0x54ee24(_0x428c88(0x190)+_0x10de04[_0x428c88(0x1a8)](',\x20'));return;}console[_0x428c88(0x1b8)](_0x428c88(0x19c)+_0x210ccf[_0x428c88(0x1a7)]+_0x428c88(0x18f)+_0x2b70c5[_0x428c88(0x1a7)]+_0x428c88(0x186));}_0x4e6a86(_0x428c88(0x1a6)+_0x2b70c5[_0x428c88(0x1a7)]+_0x428c88(0x18a));const _0x104fa4=await generateDatasetDocs(_0x2b70c5,_0x2aa25d,_0x468458,(_0x425d61,_0x3640be,_0x21678f)=>{const _0x6c6812=_0x428c88;_0x4e6a86('正在生成\x20'+_0x21678f+_0x6c6812(0x196)+_0x425d61+'/'+_0x3640be+')');},_0xb94a1d);_0x23aa1f(_0x104fa4),_0x55f5a7(!![]);const _0x23b12a=_0x104fa4[_0x428c88(0x1a0)](_0x222eb5=>_0x222eb5[_0x428c88(0x1ad)])[_0x428c88(0x1a7)],_0x40f16b=_0x104fa4[_0x428c88(0x1a0)](_0x34d349=>!_0x34d349['success'])[_0x428c88(0x1a7)];logger['success'](_0x428c88(0x192),_0x428c88(0x1a5),undefined,{'totalCount':_0x104fa4[_0x428c88(0x1a7)],'successCount':_0x23b12a,'failCount':_0x40f16b,'outputDir':_0x468458});}catch(_0x4b89ef){const _0x3ed141=_0x4b89ef instanceof Error?_0x4b89ef['message']:String(_0x4b89ef);logger[_0x428c88(0x1b2)](_0x428c88(0x192),_0x428c88(0x182)+_0x3ed141,{'appCode':_0x2aa25d,'outputDir':_0x468458}),_0x54ee24(_0x428c88(0x182)+_0x3ed141);}finally{_0x59c95d(![]);}}const _0x3d0656=_0x34d9a1?.['filter'](_0x419b04=>_0x419b04[_0x3a7ba5(0x1ad)])[_0x3a7ba5(0x1a7)]||0x0,_0x326d5c=_0x34d9a1?.[_0x3a7ba5(0x1a0)](_0x28619c=>!_0x28619c[_0x3a7ba5(0x1ad)])[_0x3a7ba5(0x1a7)]||0x0;return a3_0x62b9f2(Box,{'flexDirection':_0x3a7ba5(0x1b3),'children':[(_0x45dca3||_0x452631)&&a3_0x62b9f2(Box,{'children':[a3_0x483217(Text,{'color':_0x3a7ba5(0x19b),'children':'*\x20'}),a3_0x483217(Text,{'color':_0x26edfb?_0x3a7ba5(0x1af):_0x3a7ba5(0x18c),'children':_0x55fded})]}),_0x45dca3&&a3_0x483217(Box,{'children':a3_0x62b9f2(Text,{'children':[_0x3a7ba5(0x1aa),_0x36ca44,'\x20(环境:\x20',_0x6f0122,')']})}),_0x452631&&_0x34d9a1&&a3_0x62b9f2(Box,{'flexDirection':_0x3a7ba5(0x1b3),'children':[a3_0x483217(Box,{'children':a3_0x62b9f2(Text,{'color':_0x3a7ba5(0x1b6),'children':[_0x3a7ba5(0x18e),_0x3d0656,'\x20个',_0x326d5c>0x0&&_0x3a7ba5(0x1a1)+_0x326d5c+'\x20个']})}),a3_0x483217(Box,{'marginTop':0x1,'children':a3_0x62b9f2(Text,{'color':_0x3a7ba5(0x19b),'children':[_0x3a7ba5(0x1b5),_0x2b7746,'\x20个数据集']})}),a3_0x62b9f2(Box,{'marginTop':0x1,'children':[a3_0x483217(Text,{'color':_0x3a7ba5(0x19b),'children':'*\x20输出目录:\x20'}),a3_0x483217(Text,{'color':_0x3a7ba5(0x1b7),'children':_0x468458})]}),_0x3d0656>0x0&&a3_0x62b9f2(a3_0x3edc6d,{'children':[a3_0x483217(Box,{'marginTop':0x1,'children':a3_0x483217(Text,{'color':_0x3a7ba5(0x19b),'children':_0x3a7ba5(0x185)})}),_0x34d9a1[_0x3a7ba5(0x1a0)](_0x13c614=>_0x13c614[_0x3a7ba5(0x1ad)])[_0x3a7ba5(0x1b1)]((_0x5e3b27,_0x4e090c)=>a3_0x62b9f2(Box,{'marginLeft':0x2,'children':[a3_0x62b9f2(Text,{'color':_0x3a7ba5(0x1b7),'children':['•\x20',_0x5e3b27['filePath']]}),a3_0x62b9f2(Text,{'color':'dim','children':[_0x3a7ba5(0x1a3),_0x5e3b27['datasetName']]})]},_0x4e090c))]}),_0x326d5c>0x0&&a3_0x62b9f2(a3_0x3edc6d,{'children':[a3_0x483217(Box,{'marginTop':0x1,'children':a3_0x483217(Text,{'color':_0x3a7ba5(0x187),'children':_0x3a7ba5(0x195)})}),_0x34d9a1['filter'](_0x30be2d=>!_0x30be2d[_0x3a7ba5(0x1ad)])['map']((_0x169afb,_0x5b16de)=>a3_0x62b9f2(Box,{'marginLeft':0x2,'flexDirection':_0x3a7ba5(0x1b3),'children':[a3_0x62b9f2(Text,{'color':_0x3a7ba5(0x1b4),'children':['•\x20',_0x169afb['datasetName'],'\x20(',_0x169afb[_0x3a7ba5(0x19f)],')']}),_0x169afb[_0x3a7ba5(0x1b2)]&&a3_0x483217(Box,{'marginLeft':0x2,'children':a3_0x483217(Text,{'color':_0x3a7ba5(0x18c),'children':_0x169afb[_0x3a7ba5(0x1b2)]})})]},_0x5b16de))]})]}),_0xddf37f&&a3_0x62b9f2(Box,{'flexDirection':_0x3a7ba5(0x1b3),'children':[a3_0x483217(Box,{'children':a3_0x62b9f2(Text,{'color':_0x3a7ba5(0x1b4),'children':['❌\x20',_0xddf37f]})}),_0xddf37f['includes']('登录')&&a3_0x62b9f2(Box,{'marginTop':0x1,'children':[a3_0x483217(Text,{'color':_0x3a7ba5(0x187),'children':_0x3a7ba5(0x198)}),a3_0x483217(Text,{'color':_0x3a7ba5(0x1b7),'children':'lovrabet\x20auth'}),a3_0x483217(Text,{'color':_0x3a7ba5(0x187),'children':'\x20重新登录后再试'})]})]})]});};
1
+ (function(_0x2ff4f9,_0x491307){const _0x31fb62=a3_0x5ca1,_0x4a7b2a=_0x2ff4f9();while(!![]){try{const _0x27977a=-parseInt(_0x31fb62(0x79))/0x1+parseInt(_0x31fb62(0x92))/0x2*(-parseInt(_0x31fb62(0x8d))/0x3)+-parseInt(_0x31fb62(0x8f))/0x4*(parseInt(_0x31fb62(0x6d))/0x5)+-parseInt(_0x31fb62(0x9d))/0x6+-parseInt(_0x31fb62(0x7f))/0x7*(-parseInt(_0x31fb62(0xa2))/0x8)+-parseInt(_0x31fb62(0x99))/0x9+parseInt(_0x31fb62(0x90))/0xa*(parseInt(_0x31fb62(0x73))/0xb);if(_0x27977a===_0x491307)break;else _0x4a7b2a['push'](_0x4a7b2a['shift']());}catch(_0x11ef8f){_0x4a7b2a['push'](_0x4a7b2a['shift']());}}}(a3_0x43b0,0x992d8));import{jsx as a3_0x1b2315,jsxs as a3_0x17e896,Fragment as a3_0x39e4d8}from'react/jsx-runtime';import{useEffect,useState}from'react';import{Box,Text,useApp}from'ink';import{readConfig,getConfigAppCode}from'../utils/config.js';import{initEnv}from'../constant/env.js';import{fetchModelList}from'./fetch-model-list.js';import{generateDatasetDocs}from'./api-doc.js';function a3_0x5ca1(_0x18c49d,_0x5b4e1d){const _0x43b0c6=a3_0x43b0();return a3_0x5ca1=function(_0x5ca1a0,_0x4181a3){_0x5ca1a0=_0x5ca1a0-0x6c;let _0x14749d=_0x43b0c6[_0x5ca1a0];return _0x14749d;},a3_0x5ca1(_0x18c49d,_0x5b4e1d);}function a3_0x43b0(){const _0x48bebc=['\x20个数据集的文档...','*\x20共处理\x20','1066014oPGukz','*\x20生成的文档文件:','dim','正在获取数据集列表...','⚠️\x20以下数据集生成失败:','\x20个数据集中筛选出\x20','56nFGKmZ','\x20-\x20','使用指定的应用AppCode:\x20','√\x20文档生成完成!成功\x20','green','💡\x20请使用\x20','map','red','gray','.md\x20(','./docs','\x20(环境:\x20','yellow','column','133995guJOiK','指定的数据集代码都不存在:\x20','8llyGup','80FLNheC','文档生成失败:\x20','12eCsJyB','string','error','filePath','includes','*\x20输出目录:\x20','message','5416857UKHvcq','\x20重新登录后再试','未找到任何数据集','datasetCode','6499482NdtICZ','\x20个匹配的数据集\x1b[0m','api-doc','online','setLogPath','537808jrfzPu','🚀\x20','正在生成\x20','datasetName','cyan','2334410HotJkD','\x1b[90m*\x20从\x20','success','filter','log','cwd','5558432lunRiD','env','\x1b[33m!\x20以下数据集代码不存在:\x20','length'];a3_0x43b0=function(){return _0x48bebc;};return a3_0x43b0();}import{logger}from'../utils/logger.js';export const ApiDocUI=({appCode:_0x55d330,env:_0x117b58,output:_0x3a2d93,extraParams:_0x1b72f1,datasetCodes:_0x4ad5c1})=>{const _0x5aadc4=a3_0x5ca1,{exit:_0x75d2ec}=useApp(),[_0x7cd7fd,_0x160c56]=useState(![]),[_0x1f0d27,_0x299b46]=useState(''),[_0x595da2,_0x1cc950]=useState(![]),[_0x4af42f,_0x48bc5c]=useState(null),[_0x527a51,_0x2fce9e]=useState(null),[_0x2dae11,_0x1e3ae7]=useState(0x0),_0x510e66=readConfig(),_0x2cc9db=getConfigAppCode(),_0x2dd49f=_0x55d330||_0x2cc9db,_0x5df51e=typeof _0x510e66?.[_0x5aadc4(0x74)]===_0x5aadc4(0x93)?_0x510e66[_0x5aadc4(0x74)]:undefined,_0x76878d=_0x117b58||_0x5df51e||_0x5aadc4(0xa0);initEnv(_0x76878d);const _0x57751e=_0x3a2d93||_0x5aadc4(0x89),_0x38b1d2=_0x55d330?_0x5aadc4(0x81)+_0x2dd49f:'使用配置的应用AppCode:\x20'+_0x2dd49f;useEffect(()=>{_0x160c56(!![]),_0x3a2011();},[]),useEffect(()=>{(_0x595da2||_0x4af42f)&&_0x75d2ec();},[_0x595da2,_0x4af42f,_0x75d2ec]);async function _0x3a2011(){const _0x344ac5=_0x5aadc4;if(!_0x2dd49f){_0x48bc5c('未提供应用AppCode,且配置中也没有默认值');return;}try{logger[_0x344ac5(0xa1)](process[_0x344ac5(0x72)]()),_0x299b46(_0x344ac5(0x7c));const {configArray:_0x3781b5}=await fetchModelList(_0x2dd49f);_0x1e3ae7(_0x3781b5[_0x344ac5(0x76)]);if(_0x3781b5[_0x344ac5(0x76)]===0x0){_0x48bc5c(_0x344ac5(0x9b));return;}let _0x468b8c=_0x3781b5;if(_0x4ad5c1&&_0x4ad5c1[_0x344ac5(0x76)]>0x0){_0x468b8c=_0x3781b5[_0x344ac5(0x70)](_0x110d4a=>_0x4ad5c1['includes'](_0x110d4a[_0x344ac5(0x9c)]));const _0x585d6f=_0x468b8c[_0x344ac5(0x85)](_0x44b812=>_0x44b812[_0x344ac5(0x9c)]),_0x2e0343=_0x4ad5c1[_0x344ac5(0x70)](_0x4c0cd6=>!_0x585d6f['includes'](_0x4c0cd6));_0x2e0343[_0x344ac5(0x76)]>0x0&&console[_0x344ac5(0x71)](_0x344ac5(0x75)+_0x2e0343['join'](',\x20')+'\x1b[0m');if(_0x468b8c[_0x344ac5(0x76)]===0x0){_0x48bc5c(_0x344ac5(0x8e)+_0x4ad5c1['join'](',\x20'));return;}console[_0x344ac5(0x71)](_0x344ac5(0x6e)+_0x3781b5['length']+_0x344ac5(0x7e)+_0x468b8c['length']+_0x344ac5(0x9e));}_0x299b46(_0x344ac5(0xa4)+_0x468b8c['length']+_0x344ac5(0x77));const _0x3eb729=await generateDatasetDocs(_0x468b8c,_0x2dd49f,_0x57751e,(_0x33b0b4,_0x4f43e1,_0x51058b)=>{const _0x3a616a=_0x344ac5;_0x299b46(_0x3a616a(0xa4)+_0x51058b+_0x3a616a(0x88)+_0x33b0b4+'/'+_0x4f43e1+')');},_0x1b72f1);_0x2fce9e(_0x3eb729),_0x1cc950(!![]);const _0x516377=_0x3eb729[_0x344ac5(0x70)](_0x2b7641=>_0x2b7641[_0x344ac5(0x6f)])[_0x344ac5(0x76)],_0x273fde=_0x3eb729[_0x344ac5(0x70)](_0x548ce6=>!_0x548ce6[_0x344ac5(0x6f)])[_0x344ac5(0x76)];logger[_0x344ac5(0x6f)](_0x344ac5(0x9f),'文档生成完成',undefined,{'totalCount':_0x3eb729['length'],'successCount':_0x516377,'failCount':_0x273fde,'outputDir':_0x57751e});}catch(_0x360cd7){const _0x9b7637=_0x360cd7 instanceof Error?_0x360cd7[_0x344ac5(0x98)]:String(_0x360cd7);logger[_0x344ac5(0x94)](_0x344ac5(0x9f),'文档生成失败:\x20'+_0x9b7637,{'appCode':_0x2dd49f,'outputDir':_0x57751e}),_0x48bc5c(_0x344ac5(0x91)+_0x9b7637);}finally{_0x160c56(![]);}}const _0x51d213=_0x527a51?.[_0x5aadc4(0x70)](_0x268b9e=>_0x268b9e[_0x5aadc4(0x6f)])[_0x5aadc4(0x76)]||0x0,_0x50f3c0=_0x527a51?.[_0x5aadc4(0x70)](_0x1b5e56=>!_0x1b5e56[_0x5aadc4(0x6f)])['length']||0x0;return a3_0x17e896(Box,{'flexDirection':_0x5aadc4(0x8c),'children':[(_0x7cd7fd||_0x595da2)&&a3_0x17e896(Box,{'children':[a3_0x1b2315(Text,{'color':_0x5aadc4(0x87),'children':'*\x20'}),a3_0x1b2315(Text,{'color':_0x55d330?'white':_0x5aadc4(0x7b),'children':_0x38b1d2})]}),_0x7cd7fd&&a3_0x1b2315(Box,{'children':a3_0x17e896(Text,{'children':[_0x5aadc4(0xa3),_0x1f0d27,_0x5aadc4(0x8a),_0x76878d,')']})}),_0x595da2&&_0x527a51&&a3_0x17e896(Box,{'flexDirection':_0x5aadc4(0x8c),'children':[a3_0x1b2315(Box,{'children':a3_0x17e896(Text,{'color':_0x5aadc4(0x83),'children':[_0x5aadc4(0x82),_0x51d213,'\x20个',_0x50f3c0>0x0&&',\x20失败\x20'+_0x50f3c0+'\x20个']})}),a3_0x1b2315(Box,{'marginTop':0x1,'children':a3_0x17e896(Text,{'color':_0x5aadc4(0x87),'children':[_0x5aadc4(0x78),_0x2dae11,'\x20个数据集']})}),a3_0x17e896(Box,{'marginTop':0x1,'children':[a3_0x1b2315(Text,{'color':_0x5aadc4(0x87),'children':_0x5aadc4(0x97)}),a3_0x1b2315(Text,{'color':_0x5aadc4(0x6c),'children':_0x57751e})]}),_0x51d213>0x0&&a3_0x17e896(a3_0x39e4d8,{'children':[a3_0x1b2315(Box,{'marginTop':0x1,'children':a3_0x1b2315(Text,{'color':_0x5aadc4(0x87),'children':_0x5aadc4(0x7a)})}),_0x527a51['filter'](_0x1d34d6=>_0x1d34d6['success'])[_0x5aadc4(0x85)]((_0x3a01d7,_0x459572)=>a3_0x17e896(Box,{'marginLeft':0x2,'children':[a3_0x17e896(Text,{'color':_0x5aadc4(0x6c),'children':['•\x20',_0x3a01d7[_0x5aadc4(0x95)]]}),a3_0x17e896(Text,{'color':_0x5aadc4(0x7b),'children':[_0x5aadc4(0x80),_0x3a01d7[_0x5aadc4(0xa5)]]})]},_0x459572))]}),_0x50f3c0>0x0&&a3_0x17e896(a3_0x39e4d8,{'children':[a3_0x1b2315(Box,{'marginTop':0x1,'children':a3_0x1b2315(Text,{'color':_0x5aadc4(0x8b),'children':_0x5aadc4(0x7d)})}),_0x527a51[_0x5aadc4(0x70)](_0x1d4c1d=>!_0x1d4c1d[_0x5aadc4(0x6f)])[_0x5aadc4(0x85)]((_0x494473,_0x5b387a)=>a3_0x17e896(Box,{'marginLeft':0x2,'flexDirection':_0x5aadc4(0x8c),'children':[a3_0x17e896(Text,{'color':_0x5aadc4(0x86),'children':['•\x20',_0x494473[_0x5aadc4(0xa5)],'\x20(',_0x494473[_0x5aadc4(0x9c)],')']}),_0x494473[_0x5aadc4(0x94)]&&a3_0x1b2315(Box,{'marginLeft':0x2,'children':a3_0x1b2315(Text,{'color':_0x5aadc4(0x7b),'children':_0x494473[_0x5aadc4(0x94)]})})]},_0x5b387a))]})]}),_0x4af42f&&a3_0x17e896(Box,{'flexDirection':'column','children':[a3_0x1b2315(Box,{'children':a3_0x17e896(Text,{'color':_0x5aadc4(0x86),'children':['❌\x20',_0x4af42f]})}),_0x4af42f[_0x5aadc4(0x96)]('登录')&&a3_0x17e896(Box,{'marginTop':0x1,'children':[a3_0x1b2315(Text,{'color':_0x5aadc4(0x8b),'children':_0x5aadc4(0x84)}),a3_0x1b2315(Text,{'color':_0x5aadc4(0x6c),'children':'lovrabet\x20auth'}),a3_0x1b2315(Text,{'color':'yellow','children':_0x5aadc4(0x9a)})]})]})]});};
@@ -1 +1 @@
1
- (function(_0x5299bf,_0xd0b11a){const _0x57a63b=a4_0x1656,_0x1ad7a2=_0x5299bf();while(!![]){try{const _0x21e10c=parseInt(_0x57a63b(0x1e4))/0x1+-parseInt(_0x57a63b(0x1da))/0x2+parseInt(_0x57a63b(0x1e5))/0x3*(parseInt(_0x57a63b(0x1e2))/0x4)+parseInt(_0x57a63b(0x1c3))/0x5+parseInt(_0x57a63b(0x1db))/0x6+parseInt(_0x57a63b(0x1e1))/0x7+-parseInt(_0x57a63b(0x1cb))/0x8*(parseInt(_0x57a63b(0x1c4))/0x9);if(_0x21e10c===_0xd0b11a)break;else _0x1ad7a2['push'](_0x1ad7a2['shift']());}catch(_0x8ac420){_0x1ad7a2['push'](_0x1ad7a2['shift']());}}}(a4_0xadbf,0x89a16));import{mkdirSync,writeFileSync}from'node:fs';import a4_0x49944e from'node:path';import{getCookie}from'../auth/get-cookie.js';import{getApiDomain}from'../constant/domain.js';function a4_0xadbf(){const _0x22f871=['生成文档失败:\x20','status','\x20个数据集需要生成文档\x0a','.md','application/json','/api/node-toolbox/api-doc-generator','join','name','):缺少\x20data.markdown\x20字段','✓\x20成功生成:\x20','markdown','564094MYkjfU','4974660EgYgGr','等待\x203\x20秒...\x0a','datasetCode','.md\x20-\x20','tableName','api-doc','6995625saQCyW','31028UxFdGQ','.md\x20(','239556UBxlrk','345DSvUyV','json','POST','length','error','生成文档成功:\x20','push','2764430bzeDLB','5769ErxDEn','),HTTP状态码:\x20','message',']\x20正在生成:\x20','获取文档失败\x20(','登录鉴权失败,登录已过期,请使用\x20lovrabet\x20auth\x20重新登录','log','33288alKoyZ','text','string','data'];a4_0xadbf=function(){return _0x22f871;};return a4_0xadbf();}import{logger}from'../utils/logger.js';export async function fetchDatasetDoc(_0x27b88b){const _0x48767c=a4_0x1656,{appCode:_0x42167a,datasetCode:_0x5e6715,datasetId:_0x4810d0,extraParams:_0x298031}=_0x27b88b,_0x9619a0=getApiDomain(),_0x14f0d9=_0x9619a0+_0x48767c(0x1d4),_0x5a3e1a={'appCode':_0x42167a,'datasetCode':_0x5e6715,'datasetId':_0x4810d0,..._0x298031||{}},_0x2b1068=await fetch(_0x14f0d9,{'method':_0x48767c(0x1e7),'headers':{'Content-Type':_0x48767c(0x1d3),'Cookie':getCookie()},'body':JSON['stringify'](_0x5a3e1a)});if(!_0x2b1068['ok']){if(_0x2b1068[_0x48767c(0x1d0)]===0x191)throw new Error(_0x48767c(0x1c9));let _0x481307='';try{_0x481307=await _0x2b1068[_0x48767c(0x1cc)]();}catch(_0x360f91){}throw new Error(_0x48767c(0x1c8)+_0x5e6715+_0x48767c(0x1c5)+_0x2b1068[_0x48767c(0x1d0)]+(_0x481307?'\x0a'+_0x481307:''));}const _0x39250c=await _0x2b1068[_0x48767c(0x1e6)]();if(!_0x39250c[_0x48767c(0x1ce)]||typeof _0x39250c['data'][_0x48767c(0x1d9)]!==_0x48767c(0x1cd))throw new Error('响应数据格式错误\x20('+_0x5e6715+_0x48767c(0x1d7));return _0x39250c['data'][_0x48767c(0x1d9)];}function delay(_0xa8c9c5){return new Promise(_0x2a6f55=>setTimeout(_0x2a6f55,_0xa8c9c5));}function a4_0x1656(_0x3266d9,_0x2d3518){const _0xadbf44=a4_0xadbf();return a4_0x1656=function(_0x1656a2,_0x38b39a){_0x1656a2=_0x1656a2-0x1c1;let _0x3942dc=_0xadbf44[_0x1656a2];return _0x3942dc;},a4_0x1656(_0x3266d9,_0x2d3518);}export async function generateDatasetDocs(_0x3f85b8,_0x4a42ca,_0x302c2f='./docs',_0x5df182,_0x2a8076){const _0x237979=a4_0x1656;mkdirSync(_0x302c2f,{'recursive':!![]});const _0x14b072=[],_0x2f9fb7=_0x3f85b8[_0x237979(0x1e8)];console[_0x237979(0x1ca)]('\x0a共有\x20'+_0x2f9fb7+_0x237979(0x1d1));for(let _0x5c625b=0x0;_0x5c625b<_0x3f85b8['length'];_0x5c625b++){const _0x2989fe=_0x3f85b8[_0x5c625b],_0x546a09=_0x5c625b+0x1,_0x3c5cfb=_0x2989fe[_0x237979(0x1df)];try{console[_0x237979(0x1ca)]('['+_0x546a09+'/'+_0x2f9fb7+_0x237979(0x1c7)+_0x3c5cfb+_0x237979(0x1e3)+_0x2989fe[_0x237979(0x1d6)]+')');_0x5df182&&_0x5df182(_0x546a09,_0x2f9fb7,_0x3c5cfb);const _0x41b777=await fetchDatasetDoc({'appCode':_0x4a42ca,'datasetCode':_0x2989fe[_0x237979(0x1dd)],'datasetId':_0x2989fe['id'],'enableAI':![],'extraParams':_0x2a8076}),_0x1a42b4=a4_0x49944e[_0x237979(0x1d5)](_0x302c2f,_0x3c5cfb+_0x237979(0x1d2));writeFileSync(_0x1a42b4,_0x41b777,{'encoding':'utf8'}),console[_0x237979(0x1ca)](_0x237979(0x1d8)+_0x3c5cfb+_0x237979(0x1d2)),logger['success']('api-doc',_0x237979(0x1c1)+_0x3c5cfb,undefined,{'datasetCode':_0x2989fe[_0x237979(0x1dd)],'datasetName':_0x2989fe[_0x237979(0x1d6)],'filePath':_0x1a42b4,'progress':_0x546a09+'/'+_0x2f9fb7}),_0x14b072['push']({'datasetCode':_0x2989fe[_0x237979(0x1dd)],'datasetName':_0x2989fe[_0x237979(0x1d6)],'filePath':_0x1a42b4,'success':!![]}),_0x546a09<_0x2f9fb7&&await delay(0x1388);}catch(_0x35c62a){const _0x2fff2f=_0x35c62a instanceof Error?_0x35c62a[_0x237979(0x1c6)]:String(_0x35c62a);console[_0x237979(0x1ca)]('✗\x20失败:\x20'+_0x3c5cfb+_0x237979(0x1de)+_0x2fff2f+'\x0a'),logger[_0x237979(0x1e9)](_0x237979(0x1e0),_0x237979(0x1cf)+_0x2989fe[_0x237979(0x1dd)],{'datasetCode':_0x2989fe['datasetCode'],'datasetName':_0x2989fe[_0x237979(0x1d6)],'error':_0x2fff2f,'progress':_0x546a09+'/'+_0x2f9fb7}),_0x14b072[_0x237979(0x1c2)]({'datasetCode':_0x2989fe[_0x237979(0x1dd)],'datasetName':_0x2989fe['name'],'filePath':'','success':![],'error':_0x2fff2f}),_0x546a09<_0x2f9fb7&&(console[_0x237979(0x1ca)](_0x237979(0x1dc)),await delay(0xbb8));}}return _0x14b072;}
1
+ const a4_0x5bd74f=a4_0x527f;(function(_0x443084,_0x86a1b1){const _0x35bc0a=a4_0x527f,_0x48e003=_0x443084();while(!![]){try{const _0x5dc365=parseInt(_0x35bc0a(0x11b))/0x1+parseInt(_0x35bc0a(0x125))/0x2+parseInt(_0x35bc0a(0x124))/0x3*(parseInt(_0x35bc0a(0x12c))/0x4)+parseInt(_0x35bc0a(0x12b))/0x5*(-parseInt(_0x35bc0a(0x145))/0x6)+parseInt(_0x35bc0a(0x121))/0x7+parseInt(_0x35bc0a(0x139))/0x8*(-parseInt(_0x35bc0a(0x13e))/0x9)+-parseInt(_0x35bc0a(0x12a))/0xa*(parseInt(_0x35bc0a(0x133))/0xb);if(_0x5dc365===_0x86a1b1)break;else _0x48e003['push'](_0x48e003['shift']());}catch(_0x20ed71){_0x48e003['push'](_0x48e003['shift']());}}}(a4_0x36ef,0x55688));import{mkdirSync,writeFileSync}from'node:fs';import a4_0x1a9c47 from'node:path';import{getCookie}from'../auth/get-cookie.js';import{getApiDomain}from'../constant/domain.js';import{logger}from'../utils/logger.js';export async function fetchDatasetDoc(_0x478235){const _0x2d399c=a4_0x527f,{appCode:_0x1b6138,datasetCode:_0x55bd3b,datasetId:_0xdac093,extraParams:_0x318b5d}=_0x478235,_0x3119ff=getApiDomain(),_0xf2b82f=_0x3119ff+_0x2d399c(0x130),_0x3516e2={'appCode':_0x1b6138,'datasetCode':_0x55bd3b,'datasetId':_0xdac093,..._0x318b5d||{}},_0x49806a=await fetch(_0xf2b82f,{'method':_0x2d399c(0x123),'headers':{'Content-Type':_0x2d399c(0x11d),'Cookie':getCookie()},'body':JSON[_0x2d399c(0x13a)](_0x3516e2)});if(!_0x49806a['ok']){if(_0x49806a['status']===0x191)throw new Error(_0x2d399c(0x136));let _0x3bdf8b='';try{_0x3bdf8b=await _0x49806a['text']();}catch(_0x54b523){}throw new Error(_0x2d399c(0x132)+_0x55bd3b+_0x2d399c(0x146)+_0x49806a[_0x2d399c(0x11f)]+(_0x3bdf8b?'\x0a'+_0x3bdf8b:''));}const _0x135059=await _0x49806a[_0x2d399c(0x11e)]();if(!_0x135059[_0x2d399c(0x144)]||typeof _0x135059[_0x2d399c(0x144)][_0x2d399c(0x12d)]!=='string')throw new Error('响应数据格式错误\x20('+_0x55bd3b+_0x2d399c(0x129));return _0x135059[_0x2d399c(0x144)]['markdown'];}function delay(_0x5ebf4f){return new Promise(_0xf3ec38=>setTimeout(_0xf3ec38,_0x5ebf4f));}function a4_0x36ef(){const _0x3a9857=['./docs','2632987YSHOHA','tableName','POST','9QalUhY','628974yXXtMy','utf8','\x20个数据集需要生成文档\x0a','生成文档失败:\x20','):缺少\x20data.markdown\x20字段','252710VEczwp','219430TWqpCC','227692KUCkHf','markdown','error','name','/api/node-toolbox/api-doc-generator','log','获取文档失败\x20(','121lmIdwH','等待\x203\x20秒...\x0a','message','登录鉴权失败,登录已过期,请使用\x20lovrabet\x20auth\x20重新登录','✗\x20失败:\x20','api-doc','4200jAMNuW','stringify','\x0a共有\x20','.md\x20(','.md','6111DHpMIR','✓\x20成功生成:\x20','push','length','datasetCode','生成文档成功:\x20','data','24dsCWUt','),HTTP状态码:\x20','298435joFJfE','join','application/json','json','status'];a4_0x36ef=function(){return _0x3a9857;};return a4_0x36ef();}function a4_0x527f(_0x3ed9c7,_0x59df5d){const _0x36efa3=a4_0x36ef();return a4_0x527f=function(_0x527f03,_0x232389){_0x527f03=_0x527f03-0x11b;let _0x1e47b8=_0x36efa3[_0x527f03];return _0x1e47b8;},a4_0x527f(_0x3ed9c7,_0x59df5d);}export async function generateDatasetDocs(_0x37019c,_0x4fa2c4,_0x4754c8=a4_0x5bd74f(0x120),_0x5374cb,_0x4adfc9){const _0x257cf0=a4_0x5bd74f;mkdirSync(_0x4754c8,{'recursive':!![]});const _0x42f8ef=[],_0x292405=_0x37019c[_0x257cf0(0x141)];console[_0x257cf0(0x131)](_0x257cf0(0x13b)+_0x292405+_0x257cf0(0x127));for(let _0x2f4059=0x0;_0x2f4059<_0x37019c[_0x257cf0(0x141)];_0x2f4059++){const _0x3ec249=_0x37019c[_0x2f4059],_0x58dde5=_0x2f4059+0x1,_0x2e7e3b=_0x3ec249[_0x257cf0(0x122)];try{console[_0x257cf0(0x131)]('['+_0x58dde5+'/'+_0x292405+']\x20正在生成:\x20'+_0x2e7e3b+_0x257cf0(0x13c)+_0x3ec249[_0x257cf0(0x12f)]+')');_0x5374cb&&_0x5374cb(_0x58dde5,_0x292405,_0x2e7e3b);const _0x37ab27=await fetchDatasetDoc({'appCode':_0x4fa2c4,'datasetCode':_0x3ec249[_0x257cf0(0x142)],'datasetId':_0x3ec249['id'],'enableAI':![],'extraParams':_0x4adfc9}),_0x432abe=a4_0x1a9c47[_0x257cf0(0x11c)](_0x4754c8,_0x2e7e3b+'.md');writeFileSync(_0x432abe,_0x37ab27,{'encoding':_0x257cf0(0x126)}),console[_0x257cf0(0x131)](_0x257cf0(0x13f)+_0x2e7e3b+_0x257cf0(0x13d)),logger['success'](_0x257cf0(0x138),_0x257cf0(0x143)+_0x2e7e3b,undefined,{'datasetCode':_0x3ec249[_0x257cf0(0x142)],'datasetName':_0x3ec249[_0x257cf0(0x12f)],'filePath':_0x432abe,'progress':_0x58dde5+'/'+_0x292405}),_0x42f8ef[_0x257cf0(0x140)]({'datasetCode':_0x3ec249[_0x257cf0(0x142)],'datasetName':_0x3ec249[_0x257cf0(0x12f)],'filePath':_0x432abe,'success':!![]}),_0x58dde5<_0x292405&&await delay(0x1388);}catch(_0x521229){const _0x2955b0=_0x521229 instanceof Error?_0x521229[_0x257cf0(0x135)]:String(_0x521229);console[_0x257cf0(0x131)](_0x257cf0(0x137)+_0x2e7e3b+'.md\x20-\x20'+_0x2955b0+'\x0a'),logger[_0x257cf0(0x12e)](_0x257cf0(0x138),_0x257cf0(0x128)+_0x3ec249[_0x257cf0(0x142)],{'datasetCode':_0x3ec249[_0x257cf0(0x142)],'datasetName':_0x3ec249[_0x257cf0(0x12f)],'error':_0x2955b0,'progress':_0x58dde5+'/'+_0x292405}),_0x42f8ef[_0x257cf0(0x140)]({'datasetCode':_0x3ec249[_0x257cf0(0x142)],'datasetName':_0x3ec249[_0x257cf0(0x12f)],'filePath':'','success':![],'error':_0x2955b0}),_0x58dde5<_0x292405&&(console[_0x257cf0(0x131)](_0x257cf0(0x134)),await delay(0xbb8));}}return _0x42f8ef;}
@@ -1 +1 @@
1
- (function(_0x4e5ae4,_0x551bac){const _0x15027a=a5_0x5673,_0x4d0b45=_0x4e5ae4();while(!![]){try{const _0x328bf2=-parseInt(_0x15027a(0xd7))/0x1+-parseInt(_0x15027a(0xd8))/0x2+parseInt(_0x15027a(0xc4))/0x3*(parseInt(_0x15027a(0xd1))/0x4)+-parseInt(_0x15027a(0xdc))/0x5*(-parseInt(_0x15027a(0xec))/0x6)+parseInt(_0x15027a(0xe7))/0x7+parseInt(_0x15027a(0xd5))/0x8+-parseInt(_0x15027a(0xbf))/0x9;if(_0x328bf2===_0x551bac)break;else _0x4d0b45['push'](_0x4d0b45['shift']());}catch(_0x1f7828){_0x4d0b45['push'](_0x4d0b45['shift']());}}}(a5_0xc2d1,0x52ccf));import{jsx as a5_0x53b280,jsxs as a5_0x31c783}from'react/jsx-runtime';import{useEffect,useState}from'react';import{Box,Text,useApp}from'ink';function a5_0xc2d1(){const _0x33ad80=['endsWith','join','green','cwd','\x20个,过滤重复','\x20个模型)','lovrabet\x20auth','\x20个模型','env','{\x20lovrabetClient\x20}','4270287ZKIxaj','未提供应用AppCode,且配置中也没有默认值','setLogPath','modelCount','\x20-\x20客户端实例文件','18mtzJNA','online','-\x20模型配置文件\x20(','拉取\x20API\x20配置失败:\x20','api-pull','使用指定的应用AppCode:\x20','duplicateCount','column','client','6161985dTzCBD','slice','-api','*\x20导入方式:','includes','3ZwmmIr','red','\x20个数据集,生成','api','gray','message','split','!\x20原始数据集\x20','🚀\x20正在从服务器拉取\x20API\x20配置...\x20(环境:\x20','💡\x20请使用\x20','.ts','./src/api/','originalCount','1439324YTrBNg','import\x20','error','white','1422264QOqKNR','replace','233658VHBOiI','99070AKsNij','dim','yellow','cyan','265590jZCMsv'];a5_0xc2d1=function(){return _0x33ad80;};return a5_0xc2d1();}import{readConfig,getConfigAppCode}from'../utils/config.js';import{initEnv}from'../constant/env.js';function a5_0x5673(_0x57dfce,_0x5a627d){const _0xc2d194=a5_0xc2d1();return a5_0x5673=function(_0x56739e,_0x5968c9){_0x56739e=_0x56739e-0xb8;let _0x3d358c=_0xc2d194[_0x56739e];return _0x3d358c;},a5_0x5673(_0x57dfce,_0x5a627d);}import{generateApiFile}from'./generate-api-file.js';import{logger}from'../utils/logger.js';import{fetchModelList}from'./fetch-model-list.js';export const ApiPullUI=({appCode:_0x3951dd,env:_0x3c3c0a,output:_0x2213ad})=>{const _0x4ccd03=a5_0x5673,{exit:_0x511f6e}=useApp(),[_0x538fde,_0x3b55a0]=useState(![]),[_0x17abe6,_0x34d9a6]=useState(![]),[_0x1f06df,_0x1688eb]=useState(null),[_0x331849,_0x3efff4]=useState(null),_0x144316=readConfig(),_0x39157c=getConfigAppCode(),_0x55f717=_0x3951dd||_0x39157c,_0x9d6014=typeof _0x144316?.['env']==='string'?_0x144316[_0x4ccd03(0xe5)]:undefined,_0x36817e=_0x3c3c0a||_0x9d6014||_0x4ccd03(0xed);initEnv(_0x36817e);const _0x510648=_0x2213ad||_0x4ccd03(0xcf),_0x3bc9fe=_0x3951dd&&_0x3951dd[_0x4ccd03(0xc3)]('-')?_0x3951dd[_0x4ccd03(0xca)]('-')[_0x4ccd03(0xc0)](0x1)[_0x4ccd03(0xde)]('-'):'',_0x2408e3=_0x3951dd?_0x4ccd03(0xbb)+_0x55f717:'使用配置的应用AppCode:\x20'+_0x55f717,_0x5b135d=_0x3bc9fe?_0x3bc9fe+_0x4ccd03(0xc1):_0x4ccd03(0xc7),_0x26e930=_0x3bc9fe?_0x3bc9fe+'-client':'client';useEffect(()=>{_0x3b55a0(!![]),_0x44d569();},[]),useEffect(()=>{(_0x17abe6||_0x1f06df)&&_0x511f6e();},[_0x17abe6,_0x1f06df,_0x511f6e]);async function _0x44d569(){const _0x40be35=_0x4ccd03;if(!_0x55f717){_0x1688eb(_0x40be35(0xe8));return;}try{logger[_0x40be35(0xe9)](process[_0x40be35(0xe0)]());const {configArray:_0x5d0e85}=await fetchModelList(_0x55f717),_0x3c9b0b=_0x5d0e85['length'],_0x2603e5=!_0x3951dd,_0x5e04c7=await generateApiFile(_0x5d0e85,_0x3bc9fe,_0x55f717,_0x2603e5,_0x36817e,_0x510648),_0x49739c=_0x510648[_0x40be35(0xdd)]('/')?_0x510648:_0x510648+'/';_0x3efff4({'api':''+_0x49739c+_0x5b135d+'.ts','client':''+_0x49739c+_0x26e930+_0x40be35(0xce),'modelCount':_0x5e04c7[_0x40be35(0xea)],'datasetCount':_0x3c9b0b,'originalCount':_0x3c9b0b,'duplicateCount':0x0}),_0x34d9a6(!![]);}catch(_0x2cedb6){const _0x18f54a=_0x2cedb6 instanceof Error?_0x2cedb6[_0x40be35(0xc9)]:String(_0x2cedb6);logger[_0x40be35(0xd3)](_0x40be35(0xba),'拉取\x20API\x20配置失败:\x20'+_0x18f54a,{'appCode':_0x55f717,'error':_0x18f54a}),_0x1688eb(_0x40be35(0xb9)+_0x18f54a);}finally{_0x3b55a0(![]);}}return a5_0x31c783(Box,{'flexDirection':_0x4ccd03(0xbd),'children':[(_0x538fde||_0x17abe6)&&a5_0x31c783(Box,{'children':[a5_0x53b280(Text,{'color':'gray','children':'*\x20'}),a5_0x53b280(Text,{'color':_0x3951dd?_0x4ccd03(0xd4):'dim','children':_0x2408e3})]}),_0x538fde&&a5_0x53b280(Box,{'children':a5_0x31c783(Text,{'children':[_0x4ccd03(0xcc),_0x36817e,')']})}),_0x17abe6&&_0x331849&&a5_0x31c783(Box,{'flexDirection':'column','children':[a5_0x53b280(Box,{'children':a5_0x31c783(Text,{'color':_0x4ccd03(0xdf),'children':['√\x20成功拉取\x20',_0x331849['datasetCount'],_0x4ccd03(0xc6),'\x20',_0x331849['modelCount'],_0x4ccd03(0xe4)]})}),_0x331849['duplicateCount']>0x0&&a5_0x53b280(Box,{'marginTop':0x1,'children':a5_0x31c783(Text,{'color':_0x4ccd03(0xda),'children':[_0x4ccd03(0xcb),_0x331849[_0x4ccd03(0xd0)],_0x4ccd03(0xe1),'\x20',_0x331849[_0x4ccd03(0xbc)],'\x20个']})}),a5_0x53b280(Box,{'marginTop':0x1,'children':a5_0x53b280(Text,{'color':_0x4ccd03(0xc8),'children':'*\x20已生成文件:'})}),a5_0x31c783(Box,{'marginLeft':0x2,'children':[a5_0x31c783(Text,{'color':'cyan','children':['•\x20',_0x331849[_0x4ccd03(0xc7)]]}),a5_0x31c783(Text,{'color':_0x4ccd03(0xd9),'children':['\x20',_0x4ccd03(0xb8),_0x331849[_0x4ccd03(0xea)],_0x4ccd03(0xe2)]})]}),a5_0x31c783(Box,{'marginLeft':0x2,'children':[a5_0x31c783(Text,{'color':_0x4ccd03(0xdb),'children':['•\x20',_0x331849[_0x4ccd03(0xbe)]]}),a5_0x53b280(Text,{'color':_0x4ccd03(0xd9),'children':_0x4ccd03(0xeb)})]}),a5_0x53b280(Box,{'marginTop':0x1,'children':a5_0x53b280(Text,{'color':_0x4ccd03(0xc8),'children':_0x4ccd03(0xc2)})}),a5_0x53b280(Box,{'marginLeft':0x2,'children':a5_0x31c783(Text,{'color':_0x4ccd03(0xda),'children':[_0x4ccd03(0xd2),_0x4ccd03(0xe6),'\x20from\x20\x27@/',_0x331849['client'][_0x4ccd03(0xd6)](/^\.\//,'')[_0x4ccd03(0xd6)]('.ts',''),'\x27']})})]}),_0x1f06df&&a5_0x31c783(Box,{'flexDirection':_0x4ccd03(0xbd),'children':[a5_0x53b280(Box,{'children':a5_0x31c783(Text,{'color':_0x4ccd03(0xc5),'children':['❌\x20',_0x1f06df]})}),_0x1f06df[_0x4ccd03(0xc3)]('登录')&&a5_0x31c783(Box,{'marginTop':0x1,'children':[a5_0x53b280(Text,{'color':_0x4ccd03(0xda),'children':_0x4ccd03(0xcd)}),a5_0x53b280(Text,{'color':_0x4ccd03(0xdb),'children':_0x4ccd03(0xe3)}),a5_0x53b280(Text,{'color':_0x4ccd03(0xda),'children':'\x20重新登录后再试'})]})]})]});};
1
+ (function(_0x243d82,_0x270009){const _0x2088a3=a5_0x4151,_0x3814da=_0x243d82();while(!![]){try{const _0x2f1a78=-parseInt(_0x2088a3(0x155))/0x1*(-parseInt(_0x2088a3(0x12f))/0x2)+parseInt(_0x2088a3(0x144))/0x3*(parseInt(_0x2088a3(0x15a))/0x4)+-parseInt(_0x2088a3(0x130))/0x5+-parseInt(_0x2088a3(0x12b))/0x6*(-parseInt(_0x2088a3(0x135))/0x7)+parseInt(_0x2088a3(0x13a))/0x8*(parseInt(_0x2088a3(0x128))/0x9)+-parseInt(_0x2088a3(0x14f))/0xa*(-parseInt(_0x2088a3(0x141))/0xb)+parseInt(_0x2088a3(0x136))/0xc*(-parseInt(_0x2088a3(0x13f))/0xd);if(_0x2f1a78===_0x270009)break;else _0x3814da['push'](_0x3814da['shift']());}catch(_0x4bb84a){_0x3814da['push'](_0x3814da['shift']());}}}(a5_0x195e,0x4107a));import{jsx as a5_0x314ccc,jsxs as a5_0x55b09a}from'react/jsx-runtime';import{useEffect,useState}from'react';import{Box,Text,useApp}from'ink';import{readConfig,getConfigAppCode}from'../utils/config.js';function a5_0x4151(_0x34bf82,_0x284a01){const _0x195e55=a5_0x195e();return a5_0x4151=function(_0x415100,_0x17eded){_0x415100=_0x415100-0x120;let _0x5d683c=_0x195e55[_0x415100];return _0x5d683c;},a5_0x4151(_0x34bf82,_0x284a01);}import{initEnv}from'../constant/env.js';import{generateApiFile}from'./generate-api-file.js';import{logger}from'../utils/logger.js';import{fetchModelList}from'./fetch-model-list.js';function a5_0x195e(){const _0x5c7b4b=['\x20个模型)','10zGKAhj','yellow','green','使用指定的应用AppCode:\x20','*\x20导入方式:','17688gBUrPg','api-pull','originalCount','datasetCount','endsWith','!\x20原始数据集\x20','gray','√\x20成功拉取\x20','replace','31599xOVffI','split','拉取\x20API\x20配置失败:\x20','388854nKMNOd','cwd','cyan','length','76022lwavBS','2236120Qtxgvc','message','join','🚀\x20正在从服务器拉取\x20API\x20配置...\x20(环境:\x20','使用配置的应用AppCode:\x20','21KqBfer','516qlwAGi','red','\x20重新登录后再试','{\x20lovrabetClient\x20}','408POURNA','column','client','modelCount','*\x20已生成文件:','47879xKGoJJ','\x20个模型','11tRomSS','💡\x20请使用\x20','env','24VQEcUf','.ts','error','api','import\x20','\x20-\x20客户端实例文件','lovrabet\x20auth','duplicateCount','includes','slice','setLogPath','829810hwQwPP','\x20from\x20\x27@/','string','-api','white'];a5_0x195e=function(){return _0x5c7b4b;};return a5_0x195e();}export const ApiPullUI=({appCode:_0x5871f1,env:_0x428aeb,output:_0x27d8c2})=>{const _0x443bc6=a5_0x4151,{exit:_0x9ab12c}=useApp(),[_0x454784,_0x34e3ff]=useState(![]),[_0x41d2a2,_0x554b81]=useState(![]),[_0x2bd669,_0x4a4300]=useState(null),[_0xdfb96a,_0x391ce7]=useState(null),_0x55892d=readConfig(),_0x439d40=getConfigAppCode(),_0x54dbfa=_0x5871f1||_0x439d40,_0x4061e8=typeof _0x55892d?.[_0x443bc6(0x143)]===_0x443bc6(0x151)?_0x55892d[_0x443bc6(0x143)]:undefined,_0x2ef8c1=_0x428aeb||_0x4061e8||'online';initEnv(_0x2ef8c1);const _0x2481c4=_0x27d8c2||'./src/api/',_0x5eb6b0=_0x5871f1&&_0x5871f1[_0x443bc6(0x14c)]('-')?_0x5871f1[_0x443bc6(0x129)]('-')[_0x443bc6(0x14d)](0x1)[_0x443bc6(0x132)]('-'):'',_0x1c4b02=_0x5871f1?_0x443bc6(0x158)+_0x54dbfa:_0x443bc6(0x134)+_0x54dbfa,_0xf214be=_0x5eb6b0?_0x5eb6b0+_0x443bc6(0x152):_0x443bc6(0x147),_0x187cce=_0x5eb6b0?_0x5eb6b0+'-client':_0x443bc6(0x13c);useEffect(()=>{_0x34e3ff(!![]),_0x443831();},[]),useEffect(()=>{(_0x41d2a2||_0x2bd669)&&_0x9ab12c();},[_0x41d2a2,_0x2bd669,_0x9ab12c]);async function _0x443831(){const _0x2176df=_0x443bc6;if(!_0x54dbfa){_0x4a4300('未提供应用AppCode,且配置中也没有默认值');return;}try{logger[_0x2176df(0x14e)](process[_0x2176df(0x12c)]());const {configArray:_0x373c62}=await fetchModelList(_0x54dbfa),_0x5cef2c=_0x373c62[_0x2176df(0x12e)],_0x1ebbb1=!_0x5871f1,_0x50dbb9=await generateApiFile(_0x373c62,_0x5eb6b0,_0x54dbfa,_0x1ebbb1,_0x2ef8c1,_0x2481c4),_0x8bb0ed=_0x2481c4[_0x2176df(0x123)]('/')?_0x2481c4:_0x2481c4+'/';_0x391ce7({'api':''+_0x8bb0ed+_0xf214be+'.ts','client':''+_0x8bb0ed+_0x187cce+_0x2176df(0x145),'modelCount':_0x50dbb9[_0x2176df(0x13d)],'datasetCount':_0x5cef2c,'originalCount':_0x5cef2c,'duplicateCount':0x0}),_0x554b81(!![]);}catch(_0x2d481b){const _0x12a023=_0x2d481b instanceof Error?_0x2d481b[_0x2176df(0x131)]:String(_0x2d481b);logger[_0x2176df(0x146)](_0x2176df(0x120),_0x2176df(0x12a)+_0x12a023,{'appCode':_0x54dbfa,'error':_0x12a023}),_0x4a4300(_0x2176df(0x12a)+_0x12a023);}finally{_0x34e3ff(![]);}}return a5_0x55b09a(Box,{'flexDirection':_0x443bc6(0x13b),'children':[(_0x454784||_0x41d2a2)&&a5_0x55b09a(Box,{'children':[a5_0x314ccc(Text,{'color':_0x443bc6(0x125),'children':'*\x20'}),a5_0x314ccc(Text,{'color':_0x5871f1?_0x443bc6(0x153):'dim','children':_0x1c4b02})]}),_0x454784&&a5_0x314ccc(Box,{'children':a5_0x55b09a(Text,{'children':[_0x443bc6(0x133),_0x2ef8c1,')']})}),_0x41d2a2&&_0xdfb96a&&a5_0x55b09a(Box,{'flexDirection':_0x443bc6(0x13b),'children':[a5_0x314ccc(Box,{'children':a5_0x55b09a(Text,{'color':_0x443bc6(0x157),'children':[_0x443bc6(0x126),_0xdfb96a[_0x443bc6(0x122)],'\x20个数据集,生成','\x20',_0xdfb96a[_0x443bc6(0x13d)],_0x443bc6(0x140)]})}),_0xdfb96a[_0x443bc6(0x14b)]>0x0&&a5_0x314ccc(Box,{'marginTop':0x1,'children':a5_0x55b09a(Text,{'color':'yellow','children':[_0x443bc6(0x124),_0xdfb96a[_0x443bc6(0x121)],'\x20个,过滤重复','\x20',_0xdfb96a[_0x443bc6(0x14b)],'\x20个']})}),a5_0x314ccc(Box,{'marginTop':0x1,'children':a5_0x314ccc(Text,{'color':_0x443bc6(0x125),'children':_0x443bc6(0x13e)})}),a5_0x55b09a(Box,{'marginLeft':0x2,'children':[a5_0x55b09a(Text,{'color':_0x443bc6(0x12d),'children':['•\x20',_0xdfb96a[_0x443bc6(0x147)]]}),a5_0x55b09a(Text,{'color':'dim','children':['\x20','-\x20模型配置文件\x20(',_0xdfb96a[_0x443bc6(0x13d)],_0x443bc6(0x154)]})]}),a5_0x55b09a(Box,{'marginLeft':0x2,'children':[a5_0x55b09a(Text,{'color':_0x443bc6(0x12d),'children':['•\x20',_0xdfb96a[_0x443bc6(0x13c)]]}),a5_0x314ccc(Text,{'color':'dim','children':_0x443bc6(0x149)})]}),a5_0x314ccc(Box,{'marginTop':0x1,'children':a5_0x314ccc(Text,{'color':_0x443bc6(0x125),'children':_0x443bc6(0x159)})}),a5_0x314ccc(Box,{'marginLeft':0x2,'children':a5_0x55b09a(Text,{'color':_0x443bc6(0x156),'children':[_0x443bc6(0x148),_0x443bc6(0x139),_0x443bc6(0x150),_0xdfb96a[_0x443bc6(0x13c)][_0x443bc6(0x127)](/^\.\//,'')[_0x443bc6(0x127)](_0x443bc6(0x145),''),'\x27']})})]}),_0x2bd669&&a5_0x55b09a(Box,{'flexDirection':'column','children':[a5_0x314ccc(Box,{'children':a5_0x55b09a(Text,{'color':_0x443bc6(0x137),'children':['❌\x20',_0x2bd669]})}),_0x2bd669['includes']('登录')&&a5_0x55b09a(Box,{'marginTop':0x1,'children':[a5_0x314ccc(Text,{'color':_0x443bc6(0x156),'children':_0x443bc6(0x142)}),a5_0x314ccc(Text,{'color':_0x443bc6(0x12d),'children':_0x443bc6(0x14a)}),a5_0x314ccc(Text,{'color':'yellow','children':_0x443bc6(0x138)})]})]})]});};
@@ -1 +1 @@
1
- (function(_0x25855b,_0x596ded){const _0x1ed933=a6_0x4900,_0xba3854=_0x25855b();while(!![]){try{const _0x121233=parseInt(_0x1ed933(0x1e1))/0x1+parseInt(_0x1ed933(0x1ed))/0x2*(-parseInt(_0x1ed933(0x1d8))/0x3)+-parseInt(_0x1ed933(0x1d6))/0x4*(-parseInt(_0x1ed933(0x1e5))/0x5)+-parseInt(_0x1ed933(0x1d7))/0x6*(-parseInt(_0x1ed933(0x1eb))/0x7)+parseInt(_0x1ed933(0x1e0))/0x8*(-parseInt(_0x1ed933(0x1dd))/0x9)+parseInt(_0x1ed933(0x1e4))/0xa+-parseInt(_0x1ed933(0x1e8))/0xb*(parseInt(_0x1ed933(0x1d9))/0xc);if(_0x121233===_0x596ded)break;else _0xba3854['push'](_0xba3854['shift']());}catch(_0x433bc1){_0xba3854['push'](_0xba3854['shift']());}}}(a6_0x30ed,0xb2f33));function a6_0x30ed(){const _0x3d10ca=['success','1672jlYWjx','data','获取数据集失败,HTTP状态码:\x20','13412PpPyAL','message','380092YvsbDI','count','1592068tnczBv','276pjiCDL','3EnTtlx','130392MiyUHv','/api/node-toolbox/dataset/model-list?appcode=','configArray','获取数据集失败:\x20','36hrbAbA','登录鉴权失败,登录已过期,请使用\x20lovrabet\x20auth\x20重新登录','fetch-model-list','2202352EHjbTv','1112475avzlin','&otype=array','info','12811710QVsBSS','15WzHBuu','status'];a6_0x30ed=function(){return _0x3d10ca;};return a6_0x30ed();}function a6_0x4900(_0x111fad,_0x4e62d3){const _0x30ed9a=a6_0x30ed();return a6_0x4900=function(_0x4900dc,_0x3af911){_0x4900dc=_0x4900dc-0x1d6;let _0x4118e3=_0x30ed9a[_0x4900dc];return _0x4118e3;},a6_0x4900(_0x111fad,_0x4e62d3);}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(_0x5b2bb2){const _0x40b35f=a6_0x4900,_0x300f15=getEnv(),_0xbc3590=getApiDomain()+_0x40b35f(0x1da)+_0x5b2bb2+_0x40b35f(0x1e2);logger[_0x40b35f(0x1e3)](_0x40b35f(0x1df),'正在从服务器拉取模型列表...\x20(环境:\x20'+_0x300f15+')',{'apiUrl':_0xbc3590});const _0x5ddecb=await fetch(_0xbc3590,{'headers':{'Cookie':getCookie()}});if(!_0x5ddecb['ok']){if(_0x5ddecb[_0x40b35f(0x1e6)]===0x191)throw new Error(_0x40b35f(0x1de));throw new Error(_0x40b35f(0x1ea)+_0x5ddecb[_0x40b35f(0x1e6)]);}const _0x507eae=await _0x5ddecb['json']();if(!_0x507eae[_0x40b35f(0x1e7)])throw new Error(_0x40b35f(0x1dc)+(_0x507eae[_0x40b35f(0x1ec)]||'未知错误'));return{'configArray':_0x507eae['data'][_0x40b35f(0x1db)],'count':_0x507eae[_0x40b35f(0x1e9)][_0x40b35f(0x1ee)]};}
1
+ (function(_0x449dcf,_0x1ac3a1){const _0x49279b=a6_0x13dc,_0x1425e7=_0x449dcf();while(!![]){try{const _0x5463e2=parseInt(_0x49279b(0x8b))/0x1*(parseInt(_0x49279b(0x84))/0x2)+parseInt(_0x49279b(0x8d))/0x3*(-parseInt(_0x49279b(0x96))/0x4)+parseInt(_0x49279b(0x86))/0x5*(parseInt(_0x49279b(0x85))/0x6)+parseInt(_0x49279b(0x94))/0x7+parseInt(_0x49279b(0x87))/0x8*(parseInt(_0x49279b(0x8c))/0x9)+parseInt(_0x49279b(0x9a))/0xa+-parseInt(_0x49279b(0x8e))/0xb;if(_0x5463e2===_0x1ac3a1)break;else _0x1425e7['push'](_0x1425e7['shift']());}catch(_0x22db25){_0x1425e7['push'](_0x1425e7['shift']());}}}(a6_0x29e5,0x7290b));import{getCookie}from'../auth/get-cookie.js';import{getApiDomain}from'../constant/domain.js';import{logger}from'../utils/logger.js';function a6_0x13dc(_0x1a76a9,_0x15a70c){const _0x29e5ef=a6_0x29e5();return a6_0x13dc=function(_0x13dc94,_0x592130){_0x13dc94=_0x13dc94-0x83;let _0x1787fd=_0x29e5ef[_0x13dc94];return _0x1787fd;},a6_0x13dc(_0x1a76a9,_0x15a70c);}import{getEnv}from'../constant/env.js';function a6_0x29e5(){const _0x4f7522=['登录鉴权失败,登录已过期,请使用\x20lovrabet\x20auth\x20重新登录','/api/node-toolbox/dataset/model-list?appcode=','json','正在从服务器拉取模型列表...\x20(环境:\x20','data','110488VBEbQc','count','3678556oZEVxg','fetch-model-list','info','&otype=array','6504200ytwfbH','status','44GmbUdN','1634982bhtGMD','5wBeexu','30552EZJlyf','获取数据集失败,HTTP状态码:\x20','未知错误','获取数据集失败:\x20','20067hMIfXv','900XPSsHr','3zXLQvn','4104947WSGCyR'];a6_0x29e5=function(){return _0x4f7522;};return a6_0x29e5();}export async function fetchModelList(_0x7eeb3a){const _0x2ad290=a6_0x13dc,_0x5d2dce=getEnv(),_0x24ecee=getApiDomain()+_0x2ad290(0x90)+_0x7eeb3a+_0x2ad290(0x99);logger[_0x2ad290(0x98)](_0x2ad290(0x97),_0x2ad290(0x92)+_0x5d2dce+')',{'apiUrl':_0x24ecee});const _0x40f54b=await fetch(_0x24ecee,{'headers':{'Cookie':getCookie()}});if(!_0x40f54b['ok']){if(_0x40f54b[_0x2ad290(0x83)]===0x191)throw new Error(_0x2ad290(0x8f));throw new Error(_0x2ad290(0x88)+_0x40f54b[_0x2ad290(0x83)]);}const _0x381e72=await _0x40f54b[_0x2ad290(0x91)]();if(!_0x381e72['success'])throw new Error(_0x2ad290(0x8a)+(_0x381e72['message']||_0x2ad290(0x89)));return{'configArray':_0x381e72['data']['configArray'],'count':_0x381e72[_0x2ad290(0x93)][_0x2ad290(0x95)]};}
@@ -1 +1 @@
1
- const a7_0x2980aa=a7_0x4d36;(function(_0x5b26cd,_0x4a27f3){const _0x3681ec=a7_0x4d36,_0xbf76b0=_0x5b26cd();while(!![]){try{const _0x102ca9=-parseInt(_0x3681ec(0x10e))/0x1*(parseInt(_0x3681ec(0xf7))/0x2)+-parseInt(_0x3681ec(0xf0))/0x3*(parseInt(_0x3681ec(0x104))/0x4)+-parseInt(_0x3681ec(0xea))/0x5+parseInt(_0x3681ec(0x102))/0x6*(parseInt(_0x3681ec(0xed))/0x7)+-parseInt(_0x3681ec(0xe8))/0x8+parseInt(_0x3681ec(0x110))/0x9+parseInt(_0x3681ec(0xef))/0xa;if(_0x102ca9===_0x4a27f3)break;else _0xbf76b0['push'](_0xbf76b0['shift']());}catch(_0x2c9442){_0xbf76b0['push'](_0xbf76b0['shift']());}}}(a7_0x7870,0x48704));import a7_0x59bf3d from'prettier';import{mkdirSync,writeFileSync,readFileSync}from'node:fs';import a7_0x1d047d from'node:path';function a7_0x7870(){const _0x57ac54=['CONFIG_NAMES.DEFAULT','./src/api/','success','app','58WXpdsV','slice','env','-api','tableName','请先通过\x20`lovrabet\x20config\x20set\x20app\x20<value>`\x20配置应用\x20Code','{\x20apiConfigName:\x20','templates/generate-api','join','api',',\x20env:\x20\x22','117246VODfhz','-client','46456dAYJJi','format','string','dirname','url','name','utf8','client','api.ts.tpl','online','2414knjAwt','endsWith','1692819UUwbaR','.ts','API\x20文件生成成功!','625992LZKavU','replaceApiContent','1709350ticMei','key','forEach','133MCWzQi','datasetCode','6223390YzHpPH','102aJxrwF','resolve','typescript'];a7_0x7870=function(){return _0x57ac54;};return a7_0x7870();}import{fileURLToPath}from'node:url';import{readConfig}from'../utils/config.js';import{TemplateReplacer}from'../utils/template-replacer.js';import{logger}from'../utils/logger.js';function a7_0x4d36(_0x7ff116,_0x4a4122){const _0x78708d=a7_0x7870();return a7_0x4d36=function(_0x4d36dc,_0xa3b8cd){_0x4d36dc=_0x4d36dc-0xe6;let _0x48d0d2=_0x78708d[_0x4d36dc];return _0x48d0d2;},a7_0x4d36(_0x7ff116,_0x4a4122);}export async function generateApiFile(_0x538582,_0x1dbc34='',_0x50a7ce,_0x5a8405=![],_0x48dbe2,_0x8ac8b=a7_0x2980aa(0xf4)){const _0x26fc78=a7_0x2980aa,_0x3bfa3a=readConfig(),_0x13ed77=_0x50a7ce||_0x3bfa3a?.[_0x26fc78(0xf6)];if(typeof _0x13ed77!==_0x26fc78(0x106)||!_0x13ed77)throw new Error(_0x26fc78(0xfc));const _0x2f68be=_0x5a8405?_0x26fc78(0xf3):'\x22'+_0x13ed77+'\x22',_0x578a64=typeof _0x3bfa3a[_0x26fc78(0xf9)]===_0x26fc78(0x106)?_0x3bfa3a[_0x26fc78(0xf9)]:undefined,_0x4e8a71=_0x48dbe2||_0x578a64||'online',_0x30cd20=_0x4e8a71!==_0x26fc78(0x10d);let _0x239b2f;if(_0x5a8405)_0x30cd20?_0x239b2f=_0x26fc78(0xfd)+_0x2f68be+',\x20env:\x20\x22'+_0x4e8a71+'\x22\x20}':_0x239b2f='';else{const _0x2bf076=_0x30cd20?_0x26fc78(0x101)+_0x4e8a71+'\x22':'';_0x239b2f='{\x20apiConfigName:\x20\x22'+_0x13ed77+'\x22'+_0x2bf076+'\x20}';}const _0x20bbca=_0x1dbc34?_0x1dbc34+_0x26fc78(0xfa):_0x26fc78(0x100),_0x49be4e=_0x1dbc34?_0x1dbc34+_0x26fc78(0x103):_0x26fc78(0x10b),_0x163877={};_0x538582[_0x26fc78(0xec)](_0x544d9f=>{const _0x241f0e=_0x26fc78;_0x163877[_0x544d9f[_0x241f0e(0xeb)]]={'tableName':_0x544d9f[_0x241f0e(0xfb)],'datasetCode':_0x544d9f[_0x241f0e(0xee)],'name':_0x544d9f[_0x241f0e(0x109)]||''};});const _0x47ec1a=fileURLToPath(import.meta[_0x26fc78(0x108)]),_0x161241=a7_0x1d047d[_0x26fc78(0xf1)](a7_0x1d047d[_0x26fc78(0x107)](_0x47ec1a),'../..'),_0x52f1b7=a7_0x1d047d[_0x26fc78(0xff)](_0x161241,_0x26fc78(0xfe)),_0x102fd0=a7_0x1d047d[_0x26fc78(0xff)](_0x52f1b7,_0x26fc78(0x10c)),_0x4595fd=a7_0x1d047d[_0x26fc78(0xff)](_0x52f1b7,'client.ts.tpl'),_0x178904=_0x8ac8b[_0x26fc78(0x10f)]('/')?_0x8ac8b[_0x26fc78(0xf8)](0x0,-0x1):_0x8ac8b;mkdirSync(_0x178904,{'recursive':!![]});const _0x3f28b9=readFileSync(_0x102fd0,'utf8'),_0xf23b24=TemplateReplacer[_0x26fc78(0xe9)](_0x3f28b9,_0x13ed77,_0x163877,Object['keys'](_0x163877)[0x0],_0x20bbca,_0x2f68be),_0x46fc78=await a7_0x59bf3d['format'](_0xf23b24,{'parser':_0x26fc78(0xf2)}),_0x3893a3=_0x178904+'/'+_0x20bbca+'.ts';writeFileSync(_0x3893a3,_0x46fc78,{'encoding':_0x26fc78(0x10a)});const _0x359e32=readFileSync(_0x4595fd,_0x26fc78(0x10a)),_0x2c48f3=TemplateReplacer['replaceApiContent'](_0x359e32,_0x13ed77,_0x163877,Object['keys'](_0x163877)[0x0],_0x20bbca,_0x2f68be,_0x239b2f),_0x1843f0=await a7_0x59bf3d[_0x26fc78(0x105)](_0x2c48f3,{'parser':_0x26fc78(0xf2)}),_0x202ae0=_0x178904+'/'+_0x49be4e+_0x26fc78(0xe6);writeFileSync(_0x202ae0,_0x1843f0,{'encoding':_0x26fc78(0x10a)});const _0x10a710=Object['keys'](_0x163877)['length'];return logger[_0x26fc78(0xf5)]('init-api',_0x26fc78(0xe7),undefined,{'apiFile':_0x3893a3,'clientFile':_0x202ae0,'modelCount':_0x10a710,'configName':_0x2f68be}),{'modelCount':_0x10a710,'apiFilePath':_0x3893a3,'clientFilePath':_0x202ae0,'configName':_0x2f68be};}
1
+ const a7_0x13d324=a7_0x31c6;(function(_0x274ad2,_0x1b649b){const _0x2e5f65=a7_0x31c6,_0x20062f=_0x274ad2();while(!![]){try{const _0x5c2726=-parseInt(_0x2e5f65(0xc2))/0x1+parseInt(_0x2e5f65(0xb2))/0x2*(parseInt(_0x2e5f65(0xae))/0x3)+parseInt(_0x2e5f65(0xa9))/0x4*(-parseInt(_0x2e5f65(0xa8))/0x5)+parseInt(_0x2e5f65(0xc7))/0x6*(parseInt(_0x2e5f65(0xaf))/0x7)+-parseInt(_0x2e5f65(0xbb))/0x8*(parseInt(_0x2e5f65(0x9c))/0x9)+-parseInt(_0x2e5f65(0xa0))/0xa+parseInt(_0x2e5f65(0xa2))/0xb;if(_0x5c2726===_0x1b649b)break;else _0x20062f['push'](_0x20062f['shift']());}catch(_0xca9b9e){_0x20062f['push'](_0x20062f['shift']());}}}(a7_0x38fe,0xd7780));function a7_0x31c6(_0x542318,_0x136bdd){const _0x38fecc=a7_0x38fe();return a7_0x31c6=function(_0x31c6db,_0x42c83e){_0x31c6db=_0x31c6db-0x9a;let _0x4df552=_0x38fecc[_0x31c6db];return _0x4df552;},a7_0x31c6(_0x542318,_0x136bdd);}import a7_0x40c6d0 from'prettier';import{mkdirSync,writeFileSync,readFileSync}from'node:fs';import a7_0x6bca5d from'node:path';function a7_0x38fe(){const _0x2e8a26=['195688lIjagM','app','{\x20apiConfigName:\x20\x22','../..','utf8','datasetCode','key','1194171zVRmWT','-api','typescript',',\x20env:\x20\x22','keys','3083604UfunzG','请先通过\x20`lovrabet\x20config\x20set\x20app\x20<value>`\x20配置应用\x20Code','replaceApiContent','603UTKIfL','join','dirname','-client','9704160icfUxm','name','37422594csFrDB','./src/api/','CONFIG_NAMES.DEFAULT','url','forEach','api','1025CcBAjv','6128qiaDUD','{\x20apiConfigName:\x20','format','resolve','success','12978qyDqtc','21kQjEuy','client','string','26gtVTlW','\x22\x20}','length','online','slice','.ts','env','client.ts.tpl','templates/generate-api'];a7_0x38fe=function(){return _0x2e8a26;};return a7_0x38fe();}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(_0x4212a8,_0x3c1d47='',_0xd8f85f,_0x14f7c7=![],_0x1c11d1,_0x266f58=a7_0x13d324(0xa3)){const _0x325a64=a7_0x13d324,_0x103f2b=readConfig(),_0x322a80=_0xd8f85f||_0x103f2b?.[_0x325a64(0xbc)];if(typeof _0x322a80!=='string'||!_0x322a80)throw new Error(_0x325a64(0x9a));const _0x2db36d=_0x14f7c7?_0x325a64(0xa4):'\x22'+_0x322a80+'\x22',_0x186470=typeof _0x103f2b['env']===_0x325a64(0xb1)?_0x103f2b[_0x325a64(0xb8)]:undefined,_0x1c2690=_0x1c11d1||_0x186470||_0x325a64(0xb5),_0x2a9bd9=_0x1c2690!==_0x325a64(0xb5);let _0x53d8a1;if(_0x14f7c7)_0x2a9bd9?_0x53d8a1=_0x325a64(0xaa)+_0x2db36d+_0x325a64(0xc5)+_0x1c2690+_0x325a64(0xb3):_0x53d8a1='';else{const _0x4972cd=_0x2a9bd9?',\x20env:\x20\x22'+_0x1c2690+'\x22':'';_0x53d8a1=_0x325a64(0xbd)+_0x322a80+'\x22'+_0x4972cd+'\x20}';}const _0x5f3e86=_0x3c1d47?_0x3c1d47+_0x325a64(0xc3):_0x325a64(0xa7),_0x1cf260=_0x3c1d47?_0x3c1d47+_0x325a64(0x9f):_0x325a64(0xb0),_0x1baec6={};_0x4212a8[_0x325a64(0xa6)](_0x130763=>{const _0x3bc47f=_0x325a64;_0x1baec6[_0x130763[_0x3bc47f(0xc1)]]={'tableName':_0x130763['tableName'],'datasetCode':_0x130763[_0x3bc47f(0xc0)],'name':_0x130763[_0x3bc47f(0xa1)]||''};});const _0x1e74d5=fileURLToPath(import.meta[_0x325a64(0xa5)]),_0x5eb7d4=a7_0x6bca5d[_0x325a64(0xac)](a7_0x6bca5d[_0x325a64(0x9e)](_0x1e74d5),_0x325a64(0xbe)),_0x3ac53d=a7_0x6bca5d['join'](_0x5eb7d4,_0x325a64(0xba)),_0x4c3284=a7_0x6bca5d['join'](_0x3ac53d,'api.ts.tpl'),_0x39ace5=a7_0x6bca5d[_0x325a64(0x9d)](_0x3ac53d,_0x325a64(0xb9)),_0x2b7f23=_0x266f58['endsWith']('/')?_0x266f58[_0x325a64(0xb6)](0x0,-0x1):_0x266f58;mkdirSync(_0x2b7f23,{'recursive':!![]});const _0x156c75=readFileSync(_0x4c3284,_0x325a64(0xbf)),_0x32b01c=TemplateReplacer[_0x325a64(0x9b)](_0x156c75,_0x322a80,_0x1baec6,Object[_0x325a64(0xc6)](_0x1baec6)[0x0],_0x5f3e86,_0x2db36d),_0x3ced2f=await a7_0x40c6d0[_0x325a64(0xab)](_0x32b01c,{'parser':_0x325a64(0xc4)}),_0xd7534=_0x2b7f23+'/'+_0x5f3e86+'.ts';writeFileSync(_0xd7534,_0x3ced2f,{'encoding':_0x325a64(0xbf)});const _0x12ae2b=readFileSync(_0x39ace5,'utf8'),_0x2945af=TemplateReplacer[_0x325a64(0x9b)](_0x12ae2b,_0x322a80,_0x1baec6,Object['keys'](_0x1baec6)[0x0],_0x5f3e86,_0x2db36d,_0x53d8a1),_0x2a1dcb=await a7_0x40c6d0['format'](_0x2945af,{'parser':_0x325a64(0xc4)}),_0x3227bd=_0x2b7f23+'/'+_0x1cf260+_0x325a64(0xb7);writeFileSync(_0x3227bd,_0x2a1dcb,{'encoding':_0x325a64(0xbf)});const _0x5926e3=Object[_0x325a64(0xc6)](_0x1baec6)[_0x325a64(0xb4)];return logger[_0x325a64(0xad)]('init-api','API\x20文件生成成功!',undefined,{'apiFile':_0xd7534,'clientFile':_0x3227bd,'modelCount':_0x5926e3,'configName':_0x2db36d}),{'modelCount':_0x5926e3,'apiFilePath':_0xd7534,'clientFilePath':_0x3227bd,'configName':_0x2db36d};}
package/lib/api/main.js CHANGED
@@ -1 +1 @@
1
- (function(_0x245f6c,_0x3907a7){const _0x23ca09=a8_0x5923,_0x58bd4e=_0x245f6c();while(!![]){try{const _0x2fd919=-parseInt(_0x23ca09(0x119))/0x1+parseInt(_0x23ca09(0x107))/0x2+parseInt(_0x23ca09(0xec))/0x3*(-parseInt(_0x23ca09(0xf3))/0x4)+-parseInt(_0x23ca09(0xfe))/0x5+parseInt(_0x23ca09(0xfb))/0x6+parseInt(_0x23ca09(0x116))/0x7*(-parseInt(_0x23ca09(0x101))/0x8)+-parseInt(_0x23ca09(0xff))/0x9*(-parseInt(_0x23ca09(0x113))/0xa);if(_0x2fd919===_0x3907a7)break;else _0x58bd4e['push'](_0x58bd4e['shift']());}catch(_0x4a20ef){_0x58bd4e['push'](_0x58bd4e['shift']());}}}(a8_0x58da,0xdd1d2));import{jsx as a8_0x600b89}from'react/jsx-runtime';function a8_0x58da(){const _0x3b83ee=['\x20\x20\x202.\x20使用参数:\x20lovrabet\x20api\x20doc\x20--appcode\x20<app-code>','4bhphJg','\x20\x20lovrabet\x20api\x20doc\x20--appcode\x20<code>\x20\x20\x20\x20\x20\x20\x20//\x20使用指定的\x20appcode','doc','trim','env','请使用\x20--appcode\x20参数,例如:','!\x20请使用以下方式之一:','\x20\x20lovrabet\x20api\x20pull\x20--appcode\x20','3626898SSkYEX','input','log','3718755FmeLjP','189oEyIzZ','help','6532232ADDmvD','Available\x20commands:','\x1b[90m*\x20仅生成指定数据集的文档:\x20','\x1b[90m*\x20使用配置的应用AppCode:\x20','\x20\x20错误:\x20','×\x20--params\x20参数不是有效的\x20JSON\x20格式','3605098gizgBt','string','\x20\x20\x202.\x20使用参数:\x20lovrabet\x20api\x20pull\x20--appcode\x20<app-code>','\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配置文件','object','join','length','parse','\x20\x20lovrabet\x20api\x20pull\x20--appcode\x20<code>\x20\x20\x20\x20\x20\x20//\x20使用指定的\x20appcode','\x20\x20\x201.\x20配置默认值:\x20lovrabet\x20config\x20set\x20appcode\x20<app-code>','\x20\x20lovrabet\x20api\x20pull\x20--env\x20<env>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定环境(如:\x20daily,\x20online)','×\x20--datasetcode\x20参数不能为空','287340jqirIG','\x20\x20lovrabet\x20api\x20doc\x20--output\x20<dir>\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定文档输出目录(默认:\x20./docs)','error','7UfKQQA','exit','flags','39277xzQEoP','\x1b[90m\x20\x20(注:\x20--appcode\x20参数与配置一致,将使用默认配置)\x1b[0m','\x20\x20lovrabet\x20api\x20pull\x20--output\x20<dir>\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定输出目录(默认:\x20./src/api/)','pull','appcode','×\x20未配置\x20AppCode','❌\x20错误:不再支持位置参数方式','1515621hmRKgW','\x1b[0m','output','message','filter','\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文档'];a8_0x58da=function(){return _0x3b83ee;};return a8_0x58da();}function a8_0x5923(_0x312c54,_0x342e81){const _0x58da00=a8_0x58da();return a8_0x5923=function(_0x592309,_0x1f7b62){_0x592309=_0x592309-0xe6;let _0x16c55f=_0x58da00[_0x592309];return _0x16c55f;},a8_0x5923(_0x312c54,_0x342e81);}import{render}from'ink';import{ApiPullUI}from'./api-pull-ui.js';import{ApiDocUI}from'./api-doc-ui.js';import{getConfigAppCode}from'../utils/config.js';export async function apiCli(_0x535938){const _0xb570bb=a8_0x5923,_0x363106=_0x535938['input'][0x1];if(_0x535938[_0xb570bb(0x118)][_0xb570bb(0x100)]){console[_0xb570bb(0xfd)]('\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(_0x363106===_0xb570bb(0xe8)){_0x535938[_0xb570bb(0xfc)][0x2]&&(console[_0xb570bb(0x115)](_0xb570bb(0xeb)),console[_0xb570bb(0xfd)](_0xb570bb(0xf8)),console[_0xb570bb(0xfd)](_0xb570bb(0xfa)+_0x535938[_0xb570bb(0xfc)][0x2]),process[_0xb570bb(0x117)](0x1));const _0x591491=getConfigAppCode();let _0x57eb6c=_0x535938[_0xb570bb(0x118)][_0xb570bb(0xe9)];const _0x179d7d=typeof _0x535938[_0xb570bb(0x118)][_0xb570bb(0xf7)]===_0xb570bb(0x108)?_0x535938[_0xb570bb(0x118)]['env']:undefined,_0x5fd306=_0x535938[_0xb570bb(0x118)][_0xb570bb(0xee)];!_0x57eb6c&&!_0x591491&&(console[_0xb570bb(0x115)](_0xb570bb(0xea)),console[_0xb570bb(0xfd)](_0xb570bb(0xf9)),console[_0xb570bb(0xfd)](_0xb570bb(0x110)),console[_0xb570bb(0xfd)](_0xb570bb(0x109)),process[_0xb570bb(0x117)](0x1)),_0x57eb6c&&_0x591491&&_0x57eb6c===_0x591491&&(console[_0xb570bb(0xfd)](_0xb570bb(0x104)+_0x57eb6c+_0xb570bb(0xed)),console[_0xb570bb(0xfd)](_0xb570bb(0xe6)),_0x57eb6c=undefined),render(a8_0x600b89(ApiPullUI,{'appCode':_0x57eb6c,'env':_0x179d7d,'output':_0x5fd306}));}else{if(_0x363106===_0xb570bb(0xf5)){_0x535938[_0xb570bb(0xfc)][0x2]&&(console[_0xb570bb(0x115)]('❌\x20错误:不再支持位置参数方式'),console[_0xb570bb(0xfd)](_0xb570bb(0xf8)),console[_0xb570bb(0xfd)]('\x20\x20lovrabet\x20api\x20doc\x20--appcode\x20'+_0x535938[_0xb570bb(0xfc)][0x2]),process[_0xb570bb(0x117)](0x1));const _0x2731dd=getConfigAppCode();let _0x2ae9ee=_0x535938[_0xb570bb(0x118)][_0xb570bb(0xe9)];const _0x15c93f=typeof _0x535938[_0xb570bb(0x118)][_0xb570bb(0xf7)]===_0xb570bb(0x108)?_0x535938[_0xb570bb(0x118)]['env']:undefined,_0x1e1a10=_0x535938[_0xb570bb(0x118)][_0xb570bb(0xee)],_0x3a0840=_0x535938[_0xb570bb(0x118)]['params'],_0x849826=_0x535938[_0xb570bb(0x118)]['datasetcode'];!_0x2ae9ee&&!_0x2731dd&&(console[_0xb570bb(0x115)](_0xb570bb(0xea)),console[_0xb570bb(0xfd)](_0xb570bb(0xf9)),console[_0xb570bb(0xfd)](_0xb570bb(0x110)),console[_0xb570bb(0xfd)](_0xb570bb(0xf2)),process['exit'](0x1));_0x2ae9ee&&_0x2731dd&&_0x2ae9ee===_0x2731dd&&(console[_0xb570bb(0xfd)](_0xb570bb(0x104)+_0x2ae9ee+_0xb570bb(0xed)),_0x2ae9ee=undefined);let _0x1fa6af;if(_0x3a0840)try{_0x1fa6af=JSON[_0xb570bb(0x10e)](_0x3a0840),(typeof _0x1fa6af!==_0xb570bb(0x10b)||_0x1fa6af===null||Array['isArray'](_0x1fa6af))&&(console[_0xb570bb(0x115)]('×\x20--params\x20参数必须是一个有效的\x20JSON\x20对象'),process[_0xb570bb(0x117)](0x1));}catch(_0x5c01f5){console[_0xb570bb(0x115)](_0xb570bb(0x106)),console[_0xb570bb(0x115)](_0xb570bb(0x105)+(_0x5c01f5 instanceof Error?_0x5c01f5[_0xb570bb(0xef)]:String(_0x5c01f5))),process[_0xb570bb(0x117)](0x1);}let _0x4c6fc7;_0x849826&&(_0x4c6fc7=_0x849826['split'](',')['map'](_0x33a398=>_0x33a398[_0xb570bb(0xf6)]())[_0xb570bb(0xf0)](_0xd32741=>_0xd32741[_0xb570bb(0x10d)]>0x0),_0x4c6fc7[_0xb570bb(0x10d)]===0x0&&(console[_0xb570bb(0x115)](_0xb570bb(0x112)),process[_0xb570bb(0x117)](0x1)),console['log'](_0xb570bb(0x103)+_0x4c6fc7[_0xb570bb(0x10c)](',\x20')+_0xb570bb(0xed))),render(a8_0x600b89(ApiDocUI,{'appCode':_0x2ae9ee,'env':_0x15c93f,'output':_0x1e1a10,'extraParams':_0x1fa6af,'datasetCodes':_0x4c6fc7}));}else console[_0xb570bb(0x115)]('Unknown\x20api\x20command:\x20'+_0x363106),console[_0xb570bb(0xfd)](_0xb570bb(0x102)),console[_0xb570bb(0xfd)](_0xb570bb(0x10a)),console['log'](_0xb570bb(0x10f)),console[_0xb570bb(0xfd)](_0xb570bb(0xe7)),console[_0xb570bb(0xfd)](_0xb570bb(0x111)),console['log'](''),console['log'](_0xb570bb(0xf1)),console[_0xb570bb(0xfd)](_0xb570bb(0xf4)),console[_0xb570bb(0xfd)](_0xb570bb(0x114)),console[_0xb570bb(0xfd)]('\x20\x20lovrabet\x20api\x20doc\x20--env\x20<env>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定环境(如:\x20daily,\x20online)'),process[_0xb570bb(0x117)](0x1);}}
1
+ (function(_0x4ec264,_0x589fa3){const _0x38f173=a8_0x92b0,_0x195b37=_0x4ec264();while(!![]){try{const _0x561000=parseInt(_0x38f173(0xf5))/0x1*(parseInt(_0x38f173(0xe9))/0x2)+parseInt(_0x38f173(0x10a))/0x3*(-parseInt(_0x38f173(0xf2))/0x4)+parseInt(_0x38f173(0x10b))/0x5*(-parseInt(_0x38f173(0xe3))/0x6)+-parseInt(_0x38f173(0x113))/0x7+-parseInt(_0x38f173(0x10d))/0x8*(-parseInt(_0x38f173(0xf9))/0x9)+parseInt(_0x38f173(0xf4))/0xa*(-parseInt(_0x38f173(0x10c))/0xb)+-parseInt(_0x38f173(0x106))/0xc*(-parseInt(_0x38f173(0x115))/0xd);if(_0x561000===_0x589fa3)break;else _0x195b37['push'](_0x195b37['shift']());}catch(_0x56d27e){_0x195b37['push'](_0x195b37['shift']());}}}(a8_0x112f,0x82d2e));import{jsx as a8_0x447a46}from'react/jsx-runtime';function a8_0x92b0(_0x48ff4a,_0x44a008){const _0x112fa9=a8_0x112f();return a8_0x92b0=function(_0x92b0e0,_0x3ac0eb){_0x92b0e0=_0x92b0e0-0xe3;let _0x5e71ab=_0x112fa9[_0x92b0e0];return _0x5e71ab;},a8_0x92b0(_0x48ff4a,_0x44a008);}import{render}from'ink';import{ApiPullUI}from'./api-pull-ui.js';import{ApiDocUI}from'./api-doc-ui.js';function a8_0x112f(){const _0x21a365=['join','string','\x20\x20lovrabet\x20api\x20pull\x20--appcode\x20','!\x20请使用以下方式之一:','Unknown\x20api\x20command:\x20','×\x20未配置\x20AppCode','help','×\x20--params\x20参数必须是一个有效的\x20JSON\x20对象','131556TxVLYE','\x20\x20\x202.\x20使用参数:\x20lovrabet\x20api\x20pull\x20--appcode\x20<app-code>','5049380ZEPpOn','56063vVBMov','log','split','Available\x20commands:','9QcuVSd','exit','trim','❌\x20错误:不再支持位置参数方式','请使用\x20--appcode\x20参数,例如:','\x1b[90m*\x20使用配置的应用AppCode:\x20','\x20\x20lovrabet\x20api\x20doc\x20--env\x20<env>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定环境(如:\x20daily,\x20online)','\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文档','length','env','flags','appcode','params','216iIhUiX','filter','\x20\x20lovrabet\x20api\x20pull\x20--env\x20<env>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定环境(如:\x20daily,\x20online)','input','87xUcqSl','476810USVwnR','11ZEJCJG','1192264LMzvvF','\x20\x20\x201.\x20配置默认值:\x20lovrabet\x20config\x20set\x20appcode\x20<app-code>','\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配置文件','datasetcode','error','71603zBcVdc','\x20\x20lovrabet\x20api\x20doc\x20--output\x20<dir>\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定文档输出目录(默认:\x20./docs)','1713023tacpFk','36RSnGzI','×\x20--params\x20参数不是有效的\x20JSON\x20格式','\x1b[0m','isArray','\x20\x20lovrabet\x20api\x20pull\x20--appcode\x20<code>\x20\x20\x20\x20\x20\x20//\x20使用指定的\x20appcode','\x20\x20\x202.\x20使用参数:\x20lovrabet\x20api\x20doc\x20--appcode\x20<app-code>','2YUoBOA'];a8_0x112f=function(){return _0x21a365;};return a8_0x112f();}import{getConfigAppCode}from'../utils/config.js';export async function apiCli(_0xd28b47){const _0x1c1971=a8_0x92b0,_0x887189=_0xd28b47['input'][0x1];if(_0xd28b47['flags'][_0x1c1971(0xf0)]){console[_0x1c1971(0xf6)]('\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(_0x887189==='pull'){_0xd28b47[_0x1c1971(0x109)][0x2]&&(console['error']('❌\x20错误:不再支持位置参数方式'),console[_0x1c1971(0xf6)](_0x1c1971(0xfd)),console[_0x1c1971(0xf6)](_0x1c1971(0xec)+_0xd28b47['input'][0x2]),process['exit'](0x1));const _0x49eae4=getConfigAppCode();let _0x365046=_0xd28b47['flags'][_0x1c1971(0x104)];const _0x532e3a=typeof _0xd28b47[_0x1c1971(0x103)][_0x1c1971(0x102)]==='string'?_0xd28b47[_0x1c1971(0x103)][_0x1c1971(0x102)]:undefined,_0x492e51=_0xd28b47[_0x1c1971(0x103)]['output'];!_0x365046&&!_0x49eae4&&(console[_0x1c1971(0x112)](_0x1c1971(0xef)),console[_0x1c1971(0xf6)](_0x1c1971(0xed)),console['log'](_0x1c1971(0x10e)),console['log'](_0x1c1971(0xf3)),process[_0x1c1971(0xfa)](0x1)),_0x365046&&_0x49eae4&&_0x365046===_0x49eae4&&(console[_0x1c1971(0xf6)]('\x1b[90m*\x20使用配置的应用AppCode:\x20'+_0x365046+'\x1b[0m'),console['log']('\x1b[90m\x20\x20(注:\x20--appcode\x20参数与配置一致,将使用默认配置)\x1b[0m'),_0x365046=undefined),render(a8_0x447a46(ApiPullUI,{'appCode':_0x365046,'env':_0x532e3a,'output':_0x492e51}));}else{if(_0x887189==='doc'){_0xd28b47['input'][0x2]&&(console[_0x1c1971(0x112)](_0x1c1971(0xfc)),console[_0x1c1971(0xf6)](_0x1c1971(0xfd)),console['log']('\x20\x20lovrabet\x20api\x20doc\x20--appcode\x20'+_0xd28b47[_0x1c1971(0x109)][0x2]),process[_0x1c1971(0xfa)](0x1));const _0x28c3ba=getConfigAppCode();let _0x50307e=_0xd28b47['flags'][_0x1c1971(0x104)];const _0x25859c=typeof _0xd28b47[_0x1c1971(0x103)][_0x1c1971(0x102)]===_0x1c1971(0xeb)?_0xd28b47[_0x1c1971(0x103)][_0x1c1971(0x102)]:undefined,_0x15baf9=_0xd28b47[_0x1c1971(0x103)]['output'],_0x331de6=_0xd28b47[_0x1c1971(0x103)][_0x1c1971(0x105)],_0x5d9dd5=_0xd28b47['flags'][_0x1c1971(0x111)];!_0x50307e&&!_0x28c3ba&&(console[_0x1c1971(0x112)]('×\x20未配置\x20AppCode'),console[_0x1c1971(0xf6)](_0x1c1971(0xed)),console['log']('\x20\x20\x201.\x20配置默认值:\x20lovrabet\x20config\x20set\x20appcode\x20<app-code>'),console[_0x1c1971(0xf6)](_0x1c1971(0xe8)),process[_0x1c1971(0xfa)](0x1));_0x50307e&&_0x28c3ba&&_0x50307e===_0x28c3ba&&(console[_0x1c1971(0xf6)](_0x1c1971(0xfe)+_0x50307e+_0x1c1971(0xe5)),_0x50307e=undefined);let _0x188309;if(_0x331de6)try{_0x188309=JSON['parse'](_0x331de6),(typeof _0x188309!=='object'||_0x188309===null||Array[_0x1c1971(0xe6)](_0x188309))&&(console['error'](_0x1c1971(0xf1)),process['exit'](0x1));}catch(_0x29f661){console[_0x1c1971(0x112)](_0x1c1971(0xe4)),console[_0x1c1971(0x112)]('\x20\x20错误:\x20'+(_0x29f661 instanceof Error?_0x29f661['message']:String(_0x29f661))),process[_0x1c1971(0xfa)](0x1);}let _0x53020f;_0x5d9dd5&&(_0x53020f=_0x5d9dd5[_0x1c1971(0xf7)](',')['map'](_0x23b024=>_0x23b024[_0x1c1971(0xfb)]())[_0x1c1971(0x107)](_0x1c7abc=>_0x1c7abc[_0x1c1971(0x101)]>0x0),_0x53020f['length']===0x0&&(console[_0x1c1971(0x112)]('×\x20--datasetcode\x20参数不能为空'),process['exit'](0x1)),console['log']('\x1b[90m*\x20仅生成指定数据集的文档:\x20'+_0x53020f[_0x1c1971(0xea)](',\x20')+_0x1c1971(0xe5))),render(a8_0x447a46(ApiDocUI,{'appCode':_0x50307e,'env':_0x25859c,'output':_0x15baf9,'extraParams':_0x188309,'datasetCodes':_0x53020f}));}else console[_0x1c1971(0x112)](_0x1c1971(0xee)+_0x887189),console[_0x1c1971(0xf6)](_0x1c1971(0xf8)),console[_0x1c1971(0xf6)](_0x1c1971(0x110)),console[_0x1c1971(0xf6)](_0x1c1971(0xe7)),console[_0x1c1971(0xf6)](_0x1c1971(0x10f)),console[_0x1c1971(0xf6)](_0x1c1971(0x108)),console[_0x1c1971(0xf6)](''),console[_0x1c1971(0xf6)](_0x1c1971(0x100)),console['log']('\x20\x20lovrabet\x20api\x20doc\x20--appcode\x20<code>\x20\x20\x20\x20\x20\x20\x20//\x20使用指定的\x20appcode'),console['log'](_0x1c1971(0x114)),console[_0x1c1971(0xf6)](_0x1c1971(0xff)),process['exit'](0x1);}}
@@ -1 +1 @@
1
- (function(_0x5bbe23,_0x38e366){const _0x2d4543=a9_0xe594,_0x48d369=_0x5bbe23();while(!![]){try{const _0x362d47=-parseInt(_0x2d4543(0xc7))/0x1+parseInt(_0x2d4543(0xb7))/0x2*(parseInt(_0x2d4543(0xd5))/0x3)+-parseInt(_0x2d4543(0xc5))/0x4*(-parseInt(_0x2d4543(0xba))/0x5)+parseInt(_0x2d4543(0xc2))/0x6+parseInt(_0x2d4543(0xd7))/0x7+-parseInt(_0x2d4543(0xbd))/0x8+-parseInt(_0x2d4543(0xc0))/0x9;if(_0x362d47===_0x38e366)break;else _0x48d369['push'](_0x48d369['shift']());}catch(_0x588859){_0x48d369['push'](_0x48d369['shift']());}}}(a9_0x2ed4,0x881c8));import{readConfig}from'../utils/config.js';function a9_0x2ed4(){const _0x1c1f6c=['-client','info','40eCyBCz','chdir','275838fybhqE','modelCount','length','\x20个模型','API\x20配置拉取成功:\x20','cwd','\x20个数据集,生成\x20','error','.ts\x20-\x20模型配置文件','trim','log','api','*\x20正在处理\x20','env','12NusLbp','\x20\x20\x20•\x20','211365wOKOUX','.ts\x20-\x20客户端实例文件','message','180484yYjqZF','string','*\x20开始生成\x20API\x20配置文件:','42505ISASrW','*\x20正在从服务器拉取\x20API\x20配置...\x20(环境:\x20','test','1899736WKkAgs','client','×\x20文件前缀格式不正确。只能包含字母、数字、连字符和下划线,且必须以字母开头。','3572235acdPho','online','5949354GARkqS'];a9_0x2ed4=function(){return _0x1c1f6c;};return a9_0x2ed4();}import{initEnv}from'../constant/env.js';import{generateApiFile}from'./generate-api-file.js';function a9_0xe594(_0x1540c6,_0x197bc7){const _0x2ed43f=a9_0x2ed4();return a9_0xe594=function(_0xe59479,_0xcd100c){_0xe59479=_0xe59479-0xb7;let _0x17ce99=_0x2ed43f[_0xe59479];return _0x17ce99;},a9_0xe594(_0x1540c6,_0x197bc7);}import{logger}from'../utils/logger.js';import{fetchModelList}from'./fetch-model-list.js';export async function pullApiSilent(_0x537615,_0x17c45f,_0x3076d1,_0x27ab0d){const _0x4f6a89=a9_0xe594;let _0x3bd408;try{const _0x50ebfa=_0x17c45f?.[_0x4f6a89(0xd0)]()||'';if(_0x50ebfa){const _0x1f00ef=/^[a-zA-Z][a-zA-Z0-9_-]*$/;if(!_0x1f00ef[_0x4f6a89(0xbc)](_0x50ebfa))return console['error'](_0x4f6a89(0xbf)),![];}_0x3076d1&&(_0x3bd408=process[_0x4f6a89(0xcc)](),process['chdir'](_0x3076d1));const _0x28ec47=readConfig(),_0x2cba6a=typeof _0x28ec47['env']===_0x4f6a89(0xb8)?_0x28ec47[_0x4f6a89(0xd4)]:undefined,_0x3c7851=_0x27ab0d||_0x2cba6a||_0x4f6a89(0xc1);initEnv(_0x3c7851),console[_0x4f6a89(0xd1)](_0x4f6a89(0xbb)+_0x3c7851+')');const {configArray:_0x509feb}=await fetchModelList(_0x537615),_0xee7722=_0x50ebfa?_0x50ebfa+'-api':_0x4f6a89(0xd2),_0x31cd50=_0x50ebfa?_0x50ebfa+_0x4f6a89(0xc3):_0x4f6a89(0xbe);console[_0x4f6a89(0xd1)](_0x4f6a89(0xb9)),console[_0x4f6a89(0xd1)](_0x4f6a89(0xd6)+_0xee7722+_0x4f6a89(0xcf)),console[_0x4f6a89(0xd1)](_0x4f6a89(0xd6)+_0x31cd50+_0x4f6a89(0xd8)),console['log'](_0x4f6a89(0xd3)+_0x509feb[_0x4f6a89(0xc9)]+'\x20个数据集...');const _0x3dbfeb=await generateApiFile(_0x509feb,_0x50ebfa,_0x537615,!![],_0x3c7851);return console[_0x4f6a89(0xd1)]('√\x20成功拉取\x20'+_0x509feb['length']+_0x4f6a89(0xcd)+_0x3dbfeb[_0x4f6a89(0xc8)]+_0x4f6a89(0xca)),_0x3076d1&&logger[_0x4f6a89(0xc4)]('create-api-pull',_0x4f6a89(0xcb)+_0x537615,{'projectPath':_0x3076d1,'appCode':_0x537615,'datasetCount':_0x509feb[_0x4f6a89(0xc9)],'filePrefix':_0x50ebfa}),!![];}catch(_0x10e574){const _0x2e1b0e=_0x10e574 instanceof Error?_0x10e574[_0x4f6a89(0xd9)]:String(_0x10e574);return console[_0x4f6a89(0xce)]('×\x20API\x20配置拉取异常:',_0x2e1b0e),_0x3076d1&&logger[_0x4f6a89(0xce)]('create-api-pull','API\x20配置拉取异常:\x20'+_0x2e1b0e,{'appCode':_0x537615,'projectPath':_0x3076d1}),![];}finally{_0x3bd408&&process[_0x4f6a89(0xc6)](_0x3bd408);}}
1
+ (function(_0x1a6377,_0x21b25c){const _0x12a8b8=a9_0x2d20,_0x32968c=_0x1a6377();while(!![]){try{const _0x475232=-parseInt(_0x12a8b8(0x171))/0x1*(-parseInt(_0x12a8b8(0x172))/0x2)+parseInt(_0x12a8b8(0x166))/0x3+-parseInt(_0x12a8b8(0x164))/0x4+parseInt(_0x12a8b8(0x159))/0x5+parseInt(_0x12a8b8(0x16a))/0x6*(parseInt(_0x12a8b8(0x16e))/0x7)+parseInt(_0x12a8b8(0x165))/0x8*(parseInt(_0x12a8b8(0x168))/0x9)+-parseInt(_0x12a8b8(0x170))/0xa*(parseInt(_0x12a8b8(0x16b))/0xb);if(_0x475232===_0x21b25c)break;else _0x32968c['push'](_0x32968c['shift']());}catch(_0x5af4d0){_0x32968c['push'](_0x32968c['shift']());}}}(a9_0xa2ea,0x29aca));import{readConfig}from'../utils/config.js';import{initEnv}from'../constant/env.js';function a9_0x2d20(_0x44b2e5,_0x47437c){const _0xa2ea93=a9_0xa2ea();return a9_0x2d20=function(_0x2d2018,_0x3c3fab){_0x2d2018=_0x2d2018-0x153;let _0x47520d=_0xa2ea93[_0x2d2018];return _0x47520d;},a9_0x2d20(_0x44b2e5,_0x47437c);}import{generateApiFile}from'./generate-api-file.js';import{logger}from'../utils/logger.js';import{fetchModelList}from'./fetch-model-list.js';export async function pullApiSilent(_0x4fe8f8,_0x4dbfb4,_0x550159,_0x3c2d4e){const _0x400036=a9_0x2d20;let _0x2c616c;try{const _0x37c408=_0x4dbfb4?.[_0x400036(0x16d)]()||'';if(_0x37c408){const _0x356209=/^[a-zA-Z][a-zA-Z0-9_-]*$/;if(!_0x356209[_0x400036(0x174)](_0x37c408))return console[_0x400036(0x161)](_0x400036(0x15a)),![];}_0x550159&&(_0x2c616c=process['cwd'](),process[_0x400036(0x162)](_0x550159));const _0x5996d6=readConfig(),_0x583c5=typeof _0x5996d6['env']==='string'?_0x5996d6[_0x400036(0x158)]:undefined,_0x109693=_0x3c2d4e||_0x583c5||_0x400036(0x15b);initEnv(_0x109693),console['log']('*\x20正在从服务器拉取\x20API\x20配置...\x20(环境:\x20'+_0x109693+')');const {configArray:_0x17f211}=await fetchModelList(_0x4fe8f8),_0x15dadb=_0x37c408?_0x37c408+_0x400036(0x173):_0x400036(0x154),_0x5750b3=_0x37c408?_0x37c408+_0x400036(0x156):_0x400036(0x15c);console[_0x400036(0x15f)](_0x400036(0x15d)),console[_0x400036(0x15f)]('\x20\x20\x20•\x20'+_0x15dadb+'.ts\x20-\x20模型配置文件'),console[_0x400036(0x15f)](_0x400036(0x167)+_0x5750b3+_0x400036(0x160)),console['log'](_0x400036(0x169)+_0x17f211['length']+'\x20个数据集...');const _0x46fe20=await generateApiFile(_0x17f211,_0x37c408,_0x4fe8f8,!![],_0x109693);return console['log']('√\x20成功拉取\x20'+_0x17f211[_0x400036(0x16c)]+_0x400036(0x153)+_0x46fe20['modelCount']+'\x20个模型'),_0x550159&&logger['info'](_0x400036(0x155),_0x400036(0x16f)+_0x4fe8f8,{'projectPath':_0x550159,'appCode':_0x4fe8f8,'datasetCount':_0x17f211[_0x400036(0x16c)],'filePrefix':_0x37c408}),!![];}catch(_0x3d3127){const _0x4bea6a=_0x3d3127 instanceof Error?_0x3d3127[_0x400036(0x15e)]:String(_0x3d3127);return console[_0x400036(0x161)](_0x400036(0x157),_0x4bea6a),_0x550159&&logger['error'](_0x400036(0x155),_0x400036(0x163)+_0x4bea6a,{'appCode':_0x4fe8f8,'projectPath':_0x550159}),![];}finally{_0x2c616c&&process[_0x400036(0x162)](_0x2c616c);}}function a9_0xa2ea(){const _0x1d5dfe=['log','.ts\x20-\x20客户端实例文件','error','chdir','API\x20配置拉取异常:\x20','1202648eGDhUv','278976zzrUjX','46260erfjWA','\x20\x20\x20•\x20','81dccXMu','*\x20正在处理\x20','29448AcaWVt','183821ZesJNC','length','trim','189LfyQEF','API\x20配置拉取成功:\x20','210QuYSas','3391SUBhNU','168koGwfo','-api','test','\x20个数据集,生成\x20','api','create-api-pull','-client','×\x20API\x20配置拉取异常:','env','378315EKuWXg','×\x20文件前缀格式不正确。只能包含字母、数字、连字符和下划线,且必须以字母开头。','online','client','*\x20开始生成\x20API\x20配置文件:','message'];a9_0xa2ea=function(){return _0x1d5dfe;};return a9_0xa2ea();}
@@ -1 +1 @@
1
- function a10_0xf4f3(_0x2b3f98,_0x1b43cf){const _0x61037b=a10_0x6103();return a10_0xf4f3=function(_0xf4f3a,_0x821423){_0xf4f3a=_0xf4f3a-0x148;let _0x1685c0=_0x61037b[_0xf4f3a];return _0x1685c0;},a10_0xf4f3(_0x2b3f98,_0x1b43cf);}(function(_0x4fbd35,_0x256672){const _0x51d5e4=a10_0xf4f3,_0x1af409=_0x4fbd35();while(!![]){try{const _0x5de459=-parseInt(_0x51d5e4(0x15a))/0x1*(parseInt(_0x51d5e4(0x14f))/0x2)+-parseInt(_0x51d5e4(0x169))/0x3+parseInt(_0x51d5e4(0x17b))/0x4*(parseInt(_0x51d5e4(0x178))/0x5)+parseInt(_0x51d5e4(0x16b))/0x6*(parseInt(_0x51d5e4(0x172))/0x7)+parseInt(_0x51d5e4(0x171))/0x8+parseInt(_0x51d5e4(0x170))/0x9*(parseInt(_0x51d5e4(0x189))/0xa)+parseInt(_0x51d5e4(0x154))/0xb;if(_0x5de459===_0x256672)break;else _0x1af409['push'](_0x1af409['shift']());}catch(_0x2fa4ac){_0x1af409['push'](_0x1af409['shift']());}}}(a10_0x6103,0x23f36));import{jsx as a10_0x4da0a5,jsxs as a10_0x4b3517,Fragment as a10_0x2fce08}from'react/jsx-runtime';import{Text,Box,useInput,useApp,render}from'ink';import{useEffect,useState}from'react';import a10_0x5af0a7 from'ink-spinner';import{useGetOnlineMenuList}from'./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_0x4da0a5(AppMenuSyncUI,{}));function a10_0x6103(){const _0x2395ba=['\x20输入项目的\x20CSS\x20资源链接(https://...)','提示:使用\x20','CSS\x20链接','\x20正在获取线上菜单列表...','selecting','已选择菜单','cyan','column','return','854865IgXxDC','\x20输入项目的\x20JS\x20资源链接(https://...)','138jgjGvS','has','online','input-js','gray','1899KFpARi','1464008YJhYGz','23191buciBV','join','请至少选择一个菜单','then','trim','*\x20同步菜单到\x20Lovrabet\x20平台','10mJcvej','请输入有效的\x20CSS\x20https\x20链接','↑/↓:\x20移动光标\x20空格:\x20切换选中\x20a:\x20全选\x20i/r:\x20反选\x20Enter:\x20确认','15172xsUgEE','path','test','red','value','dots','*\x20正在创建菜单...','green','\x20←\x20','creating','map','*\x20请选择要同步的菜单:','label','max','7430UDIacd','local','input-css','[✓]','white','请输入有效的\x20JS\x20https\x20链接','*\x20CSS\x20链接:\x20','!\x20未找到本地页面,请先创建页面','includes','backspace','fill','菜单名称','lovrabet\x20auth','[\x20]','catch','16GJTTYd','创建菜单失败','message','*\x20JS\x20链接:\x20','done','1231846XoLLlA','delete','yellow','√\x20菜单创建完成','length','add','12917KLPEYP','slice','blue','filter','downArrow','size'];a10_0x6103=function(){return _0x2395ba;};return a10_0x6103();}export function AppMenuSyncUI(){const _0x35bcde=a10_0xf4f3,{exit:_0x547f6e}=useApp(),{loading:_0x505269,menuList:_0x31bf04,error:_0x10abe3}=useGetOnlineMenuList(),_0x156199=getLocalPages(),_0x2b7843=_0x31bf04['map'](_0xc135b5=>_0xc135b5['path']),_0x3c8587=[_0x35bcde(0x14b),..._0x156199['map'](_0x2c92d2=>_0x2c92d2['label'])],_0x4f72d0=getStringWidth(getMaxWidth(_0x3c8587,0x4)),_0x1e4dbc=getStringWidth(getMaxWidth([_0x35bcde(0x14b)])),[_0x11b275,_0xbe8ec6]=useState(_0x35bcde(0x164)),[_0x49f419,_0x475f59]=useState(new Set()),[_0x5c3a86,_0x13337e]=useState(0x0),[_0x95ad9e,_0x1cd770]=useState(''),[_0x30d1ac,_0x335b10]=useState(''),[_0x289ef7,_0x5b1547]=useState(''),[_0x309aeb,_0x3138bc]=useState(''),[_0x51b42c,_0xbb7f31]=useState([]),_0x1d5a13=_0x156199[_0x35bcde(0x185)](_0x166339=>({'label':_0x166339[_0x35bcde(0x187)],'path':_0x166339['path'],'local':!![],'online':_0x2b7843['includes'](_0x166339[_0x35bcde(0x17c)])})),_0xdaed31=_0x156199['filter'](_0x54f55d=>{const _0x165052=_0x35bcde;return!_0x2b7843[_0x165052(0x148)](_0x54f55d[_0x165052(0x17c)]);});useEffect(()=>{const _0x23ed13=_0x35bcde;if(!_0x505269&&_0x156199['length']>0x0&&_0x49f419[_0x23ed13(0x15f)]===0x0){const _0x59a68b=new Set(_0x156199[_0x23ed13(0x185)]((_0x1a0de5,_0x1c0a9f)=>({'page':_0x1a0de5,'index':_0x1c0a9f}))[_0x23ed13(0x15d)](({page:_0x1e08e9})=>!_0x2b7843[_0x23ed13(0x148)](_0x1e08e9[_0x23ed13(0x17c)]))[_0x23ed13(0x185)](({index:_0x4adb88})=>_0x4adb88));_0x475f59(_0x59a68b);}},[_0x505269,_0x156199[_0x35bcde(0x158)],_0x2b7843['length']]),useInput(async(_0x4f8f37,_0x2189a7)=>{const _0x367d44=_0x35bcde;if(_0x11b275===_0x367d44(0x164)){if(_0x2189a7['upArrow']){_0x13337e(_0x598d59=>_0x598d59>0x0?_0x598d59-0x1:_0x156199[_0x367d44(0x158)]-0x1);return;}if(_0x2189a7[_0x367d44(0x15e)]){_0x13337e(_0x5d9c3a=>_0x5d9c3a<_0x156199['length']-0x1?_0x5d9c3a+0x1:0x0);return;}if(_0x4f8f37==='\x20'){_0x475f59(_0x4fc3d3=>{const _0x5c1a28=_0x367d44,_0x4519c0=new Set(_0x4fc3d3);return _0x4519c0['has'](_0x5c3a86)?_0x4519c0['delete'](_0x5c3a86):_0x4519c0[_0x5c1a28(0x159)](_0x5c3a86),_0x4519c0;});return;}if(_0x4f8f37==='a'||_0x4f8f37==='A'){const _0x108d43=new Set(_0x156199['map']((_0x3daaea,_0x585b6c)=>_0x585b6c));_0x475f59(_0x108d43);return;}if(_0x4f8f37==='i'||_0x4f8f37==='I'||_0x4f8f37==='r'||_0x4f8f37==='R'){_0x475f59(_0x5d2f75=>{const _0x1fe56e=_0x367d44,_0x212422=new Set();for(let _0x565853=0x0;_0x565853<_0x156199['length'];_0x565853++){!_0x5d2f75[_0x1fe56e(0x16c)](_0x565853)&&_0x212422[_0x1fe56e(0x159)](_0x565853);}return _0x212422;});return;}if(_0x4f8f37==='q'||_0x4f8f37==='Q'){_0x547f6e();return;}if(_0x2189a7['return']){if(_0x49f419[_0x367d44(0x15f)]===0x0){_0x3138bc(_0x367d44(0x174));return;}const _0x2606fc=_0x156199[_0x367d44(0x15d)]((_0x2682f8,_0x3dc0e4)=>_0x49f419[_0x367d44(0x16c)](_0x3dc0e4)),_0x19e5b9=_0x2606fc['map'](_0x7a5652=>_0x7a5652['label'])[_0x367d44(0x173)](',\x20');_0xbb7f31([{'label':_0x367d44(0x165),'value':_0x49f419[_0x367d44(0x15f)]+'\x20个'}]),_0x3138bc(''),_0xbe8ec6('input-js');return;}return;}if(_0x11b275==='input-js'){if(_0x2189a7[_0x367d44(0x168)]){const _0x207e45=_0x289ef7[_0x367d44(0x176)]();if(_0x207e45==='')return;if(!isValidJsHttpsUrl(_0x207e45)){_0x3138bc(_0x367d44(0x18e));return;}if(!await isUrlReachable(_0x207e45)){_0x3138bc('JS\x20链接无法访问');return;}_0x1cd770(_0x207e45),_0xbb7f31(_0x677c21=>[..._0x677c21,{'label':'JS\x20链接','value':_0x207e45}]),_0x5b1547(''),_0x3138bc(''),_0xbe8ec6(_0x367d44(0x18b));return;}if(_0x2189a7[_0x367d44(0x149)]||_0x2189a7[_0x367d44(0x155)]){_0x5b1547(_0x50f363=>_0x50f363[_0x367d44(0x15b)](0x0,-0x1)),_0x3138bc('');return;}_0x5b1547(_0x4b3dd2=>_0x4b3dd2+_0x4f8f37);return;}if(_0x11b275===_0x367d44(0x18b)){if(_0x2189a7['return']){const _0x2d067b=_0x289ef7['trim']();if(_0x2d067b==='')return;if(!isValidCssHttpsUrl(_0x2d067b)){_0x3138bc(_0x367d44(0x179));return;}if(!await isUrlReachable(_0x2d067b)){_0x3138bc('CSS\x20链接无法访问');return;}_0x335b10(_0x2d067b),_0xbb7f31(_0x15da57=>[..._0x15da57,{'label':_0x367d44(0x162),'value':_0x2d067b}]),_0x5b1547(''),_0x3138bc(''),_0xbe8ec6('creating');const _0x31a944=_0x156199['filter']((_0x43617c,_0x913980)=>_0x49f419['has'](_0x913980));createMenus(_0x31a944,[_0x95ad9e,_0x2d067b])[_0x367d44(0x175)](()=>{_0xbe8ec6('done'),setTimeout(()=>{_0x547f6e();},0x3e8);})[_0x367d44(0x14e)](_0x163e25=>{const _0x42955c=_0x367d44;_0x3138bc(_0x163e25[_0x42955c(0x151)]||_0x42955c(0x150)),_0xbe8ec6(_0x42955c(0x164));});return;}if(_0x2189a7[_0x367d44(0x149)]||_0x2189a7[_0x367d44(0x155)]){_0x5b1547(_0x4b02f5=>_0x4b02f5[_0x367d44(0x15b)](0x0,-0x1)),_0x3138bc('');return;}_0x5b1547(_0x4855cd=>_0x4855cd+_0x4f8f37);return;}});if(_0x505269)return a10_0x4b3517(Box,{'marginTop':0x1,'marginBottom':0x1,'children':[a10_0x4da0a5(Text,{'children':'\x20\x20'}),a10_0x4da0a5(a10_0x5af0a7,{'type':_0x35bcde(0x180)}),a10_0x4da0a5(Text,{'children':_0x35bcde(0x163)})]});if(_0x10abe3)return a10_0x4b3517(Box,{'flexDirection':_0x35bcde(0x167),'marginTop':0x1,'marginBottom':0x1,'children':[a10_0x4b3517(Text,{'color':_0x35bcde(0x17e),'children':['✗\x20',_0x10abe3]}),a10_0x4b3517(Box,{'marginTop':0x1,'children':[a10_0x4da0a5(Text,{'color':'gray','children':_0x35bcde(0x161)}),a10_0x4da0a5(Text,{'color':_0x35bcde(0x166),'children':_0x35bcde(0x14c)}),a10_0x4da0a5(Text,{'color':_0x35bcde(0x16f),'children':'\x20命令重新登录'})]})]});if(_0x156199[_0x35bcde(0x158)]===0x0)return a10_0x4da0a5(Box,{'marginTop':0x1,'marginBottom':0x1,'children':a10_0x4da0a5(Text,{'color':_0x35bcde(0x156),'children':_0x35bcde(0x190)})});return a10_0x4b3517(Box,{'flexDirection':_0x35bcde(0x167),'marginTop':0x1,'marginBottom':0x1,'children':[_0x11b275===_0x35bcde(0x164)&&a10_0x4b3517(a10_0x2fce08,{'children':[a10_0x4b3517(Box,{'children':[a10_0x4b3517(Text,{'bold':!![],'children':['\x20\x20','菜单名称',getRemainingSpaces(_0x4f72d0,_0x35bcde(0x14b))]}),a10_0x4b3517(Text,{'bold':!![],'children':['本地',getRemainingSpaces(_0x1e4dbc,_0x35bcde(0x14b))]}),a10_0x4b3517(Text,{'bold':!![],'children':['Lovrabet平台',getRemainingSpaces(_0x1e4dbc,_0x35bcde(0x14b))]})]}),_0x1d5a13[_0x35bcde(0x185)](_0x2d5c44=>a10_0x4b3517(Box,{'children':[a10_0x4b3517(Text,{'children':['\x20\x20',_0x2d5c44[_0x35bcde(0x187)],getRemainingSpaces(_0x4f72d0,_0x2d5c44['label'])]}),a10_0x4b3517(Text,{'color':_0x35bcde(0x182),'children':[_0x2d5c44[_0x35bcde(0x18a)]?'✓':'✗',getRemainingSpaces(_0x1e4dbc,'✓')]}),a10_0x4b3517(Text,{'color':_0x2d5c44[_0x35bcde(0x16d)]?'green':_0x35bcde(0x17e),'children':[_0x2d5c44['online']?'✓':'✗',getRemainingSpaces(_0x1e4dbc,'✓')]})]},_0x2d5c44[_0x35bcde(0x17c)]))]}),_0x11b275==='selecting'&&_0x51b42c['length']===0x0&&a10_0x4da0a5(Box,{'marginTop':0x1,'children':a10_0x4da0a5(Text,{'color':_0x35bcde(0x166),'children':_0x35bcde(0x177)})}),_0x51b42c[_0x35bcde(0x185)]((_0x2c9069,_0x581168)=>a10_0x4b3517(Box,{'children':[a10_0x4b3517(Text,{'color':_0x35bcde(0x182),'children':['√\x20',_0x2c9069[_0x35bcde(0x187)],':\x20']}),a10_0x4da0a5(Text,{'color':_0x35bcde(0x166),'children':_0x2c9069[_0x35bcde(0x17f)]})]},_0x581168)),_0x309aeb&&_0x11b275===_0x35bcde(0x164)&&a10_0x4da0a5(Box,{'marginTop':0x1,'children':a10_0x4b3517(Text,{'color':_0x35bcde(0x17e),'children':['✗\x20',_0x309aeb]})}),_0x11b275===_0x35bcde(0x164)&&a10_0x4da0a5(a10_0x2fce08,{'children':a10_0x4b3517(Box,{'marginTop':_0x51b42c[_0x35bcde(0x158)]>0x0||_0x309aeb?0x1:0x0,'flexDirection':_0x35bcde(0x167),'children':[a10_0x4da0a5(Text,{'bold':!![],'children':_0x35bcde(0x186)}),_0x156199[_0x35bcde(0x185)]((_0x260ede,_0x30b55f)=>{const _0x7ffbf2=_0x35bcde,_0x188423=_0x5c3a86===_0x30b55f,_0x353baa=_0x49f419[_0x7ffbf2(0x16c)](_0x30b55f),_0x4490a5=_0x2b7843['includes'](_0x260ede['path']),_0x13014f=_0x4490a5?'更新':'新建';return a10_0x4da0a5(Box,{'children':a10_0x4b3517(Text,{'backgroundColor':_0x188423?_0x7ffbf2(0x15c):undefined,'color':_0x188423?_0x7ffbf2(0x18d):undefined,'children':['\x20\x20',_0x353baa?_0x7ffbf2(0x18c):_0x7ffbf2(0x14d),'\x20',_0x260ede['label']]})},_0x260ede[_0x7ffbf2(0x17c)]);}),a10_0x4da0a5(Box,{'marginTop':0x1,'children':a10_0x4b3517(Text,{'color':_0x35bcde(0x16f),'children':['\x20',_0x35bcde(0x17a)]})})]})}),_0x11b275===_0x35bcde(0x16e)&&a10_0x4b3517(a10_0x2fce08,{'children':[a10_0x4b3517(Box,{'children':[a10_0x4da0a5(Text,{'children':_0x35bcde(0x152)}),a10_0x4da0a5(Text,{'color':_0x35bcde(0x182),'children':_0x289ef7}),_0x309aeb&&a10_0x4b3517(Text,{'color':'red','children':[_0x35bcde(0x183),_0x309aeb]})]}),!_0x309aeb&&a10_0x4da0a5(Box,{'children':a10_0x4da0a5(Text,{'color':_0x35bcde(0x16f),'children':_0x35bcde(0x16a)})})]}),_0x11b275===_0x35bcde(0x18b)&&a10_0x4b3517(a10_0x2fce08,{'children':[a10_0x4b3517(Box,{'children':[a10_0x4da0a5(Text,{'children':_0x35bcde(0x18f)}),a10_0x4da0a5(Text,{'color':_0x35bcde(0x182),'children':_0x289ef7}),_0x309aeb&&a10_0x4b3517(Text,{'color':_0x35bcde(0x17e),'children':[_0x35bcde(0x183),_0x309aeb]})]}),!_0x309aeb&&a10_0x4da0a5(Box,{'children':a10_0x4da0a5(Text,{'color':_0x35bcde(0x16f),'children':_0x35bcde(0x160)})})]}),_0x11b275===_0x35bcde(0x184)&&a10_0x4da0a5(Box,{'children':a10_0x4da0a5(Text,{'children':_0x35bcde(0x181)})}),_0x11b275===_0x35bcde(0x153)&&a10_0x4da0a5(Box,{'children':a10_0x4da0a5(Text,{'color':_0x35bcde(0x182),'children':_0x35bcde(0x157)})})]});}function getStringWidth(_0x29da9e){const _0x4a0836=a10_0xf4f3;let _0x1e0263=0x0;for(const _0x3c2634 of _0x29da9e){/[\u4e00-\u9fa5]/[_0x4a0836(0x17d)](_0x3c2634)?_0x1e0263+=0x2:_0x1e0263+=0x1;}return _0x1e0263;}function getRemainingSpaces(_0x171f4b,_0x4bd102){const _0x1ffe9c=a10_0xf4f3,_0x59d16a=getStringWidth(_0x4bd102);return Array(Math[_0x1ffe9c(0x188)](0x0,_0x171f4b-_0x59d16a))[_0x1ffe9c(0x14a)]('\x20')[_0x1ffe9c(0x173)]('');}function getMaxWidth(_0x4397fe,_0x40b9c1=0x2){let _0x4c1e87='',_0xcaa174=0x0;for(const _0x16534e of _0x4397fe){const _0x58033e=getStringWidth(_0x16534e);_0x58033e>_0xcaa174&&(_0xcaa174=_0x58033e,_0x4c1e87=_0x16534e);}return _0x4c1e87+'\x20'['repeat'](_0x40b9c1);}
1
+ const a10_0x1dd982=a10_0x1cf9;(function(_0x1408de,_0x147ff5){const _0xed800=a10_0x1cf9,_0x121c9d=_0x1408de();while(!![]){try{const _0x18b030=-parseInt(_0xed800(0xbf))/0x1+-parseInt(_0xed800(0xe5))/0x2*(-parseInt(_0xed800(0xd2))/0x3)+-parseInt(_0xed800(0xbe))/0x4+parseInt(_0xed800(0xf3))/0x5+parseInt(_0xed800(0xb6))/0x6+-parseInt(_0xed800(0xd0))/0x7+parseInt(_0xed800(0xfc))/0x8;if(_0x18b030===_0x147ff5)break;else _0x121c9d['push'](_0x121c9d['shift']());}catch(_0x3d301e){_0x121c9d['push'](_0x121c9d['shift']());}}}(a10_0x1ae3,0x1a961));import{jsx as a10_0x3ed4a4,jsxs as a10_0x1c6962,Fragment as a10_0x42d9cd}from'react/jsx-runtime';import{Text,Box,useInput,useApp,render}from'ink';function a10_0x1ae3(){const _0x38b268=['green','CSS\x20链接无法访问','[\x20]','test','slice','online','创建菜单失败','*\x20同步菜单到\x20Lovrabet\x20平台','join','√\x20菜单创建完成','white','selecting','then','27642GxPRvv','fill','return','[✓]','请输入有效的\x20CSS\x20https\x20链接','input-js','cyan','请至少选择一个菜单','*\x20正在创建菜单...','已选择菜单','CSS\x20链接','delete','Lovrabet平台','done','898520mNiQXD','\x20正在获取线上菜单列表...','includes','column','lovrabet\x20auth','creating','downArrow','has','提示:使用\x20','1087232CfVCcL','yellow','input-css','644406LHImgA','\x20输入项目的\x20CSS\x20资源链接(https://...)','backspace','trim','value','\x20输入项目的\x20JS\x20资源链接(https://...)','length','max','500424tneGcB','208517djLbnR','*\x20CSS\x20链接:\x20','red','*\x20请选择要同步的菜单:','add','upArrow','filter','path','gray','label','catch','!\x20未找到本地页面,请先创建页面','size','菜单名称','blue','请输入有效的\x20JS\x20https\x20链接','message','443905hRKXUY','JS\x20链接','18JULmdm','\x20命令重新登录','main','map','dots','\x20←\x20'];a10_0x1ae3=function(){return _0x38b268;};return a10_0x1ae3();}import{useEffect,useState}from'react';import a10_0x1cb42e from'ink-spinner';function a10_0x1cf9(_0x4a1e70,_0x70e7b5){const _0x1ae3eb=a10_0x1ae3();return a10_0x1cf9=function(_0x1cf94a,_0xa0785e){_0x1cf94a=_0x1cf94a-0xb4;let _0x1ea02b=_0x1ae3eb[_0x1cf94a];return _0x1ea02b;},a10_0x1cf9(_0x4a1e70,_0x70e7b5);}import{useGetOnlineMenuList}from'./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_0x1dd982(0xd4)]&&render(a10_0x3ed4a4(AppMenuSyncUI,{}));export function AppMenuSyncUI(){const _0x551a7a=a10_0x1dd982,{exit:_0x48b9d4}=useApp(),{loading:_0x492cfb,menuList:_0xf34d31,error:_0x25fcc8}=useGetOnlineMenuList(),_0x2b64bc=getLocalPages(),_0x3ee8b0=_0xf34d31['map'](_0x5360b6=>_0x5360b6[_0x551a7a(0xc6)]),_0x5bb26e=['菜单名称',..._0x2b64bc[_0x551a7a(0xd5)](_0x1099f5=>_0x1099f5[_0x551a7a(0xc8)])],_0x4ed6f4=getStringWidth(getMaxWidth(_0x5bb26e,0x4)),_0x525c9c=getStringWidth(getMaxWidth([_0x551a7a(0xcc)])),[_0xbeb295,_0x5aba0b]=useState('selecting'),[_0x39d6ec,_0x2b7779]=useState(new Set()),[_0x22f7d4,_0x2ac4e0]=useState(0x0),[_0x59185c,_0x2cddea]=useState(''),[_0x445ce4,_0x1f54d3]=useState(''),[_0x58875e,_0x3925ce]=useState(''),[_0xff7e98,_0x873963]=useState(''),[_0xcfa06c,_0x2eedb9]=useState([]),_0x3db8ed=_0x2b64bc['map'](_0x55b4dc=>({'label':_0x55b4dc['label'],'path':_0x55b4dc[_0x551a7a(0xc6)],'local':!![],'online':_0x3ee8b0[_0x551a7a(0xf5)](_0x55b4dc[_0x551a7a(0xc6)])})),_0x3d05de=_0x2b64bc[_0x551a7a(0xc5)](_0x1a6837=>{const _0xee5223=_0x551a7a;return!_0x3ee8b0['includes'](_0x1a6837[_0xee5223(0xc6)]);});useEffect(()=>{const _0x1fb798=_0x551a7a;if(!_0x492cfb&&_0x2b64bc[_0x1fb798(0xbc)]>0x0&&_0x39d6ec[_0x1fb798(0xcb)]===0x0){const _0x12df03=new Set(_0x2b64bc[_0x1fb798(0xd5)]((_0x1d74a2,_0x4ddaa1)=>({'page':_0x1d74a2,'index':_0x4ddaa1}))[_0x1fb798(0xc5)](({page:_0x305586})=>!_0x3ee8b0[_0x1fb798(0xf5)](_0x305586[_0x1fb798(0xc6)]))['map'](({index:_0xc2adf1})=>_0xc2adf1));_0x2b7779(_0x12df03);}},[_0x492cfb,_0x2b64bc[_0x551a7a(0xbc)],_0x3ee8b0[_0x551a7a(0xbc)]]),useInput(async(_0x29acfa,_0x30e4ee)=>{const _0x5e7669=_0x551a7a;if(_0xbeb295===_0x5e7669(0xe3)){if(_0x30e4ee[_0x5e7669(0xc4)]){_0x2ac4e0(_0x566d8f=>_0x566d8f>0x0?_0x566d8f-0x1:_0x2b64bc[_0x5e7669(0xbc)]-0x1);return;}if(_0x30e4ee[_0x5e7669(0xf9)]){_0x2ac4e0(_0x3074d3=>_0x3074d3<_0x2b64bc[_0x5e7669(0xbc)]-0x1?_0x3074d3+0x1:0x0);return;}if(_0x29acfa==='\x20'){_0x2b7779(_0x3628bd=>{const _0x530937=_0x5e7669,_0x25e295=new Set(_0x3628bd);return _0x25e295['has'](_0x22f7d4)?_0x25e295[_0x530937(0xf0)](_0x22f7d4):_0x25e295['add'](_0x22f7d4),_0x25e295;});return;}if(_0x29acfa==='a'||_0x29acfa==='A'){const _0x1813b7=new Set(_0x2b64bc['map']((_0x1832da,_0x345bd6)=>_0x345bd6));_0x2b7779(_0x1813b7);return;}if(_0x29acfa==='i'||_0x29acfa==='I'||_0x29acfa==='r'||_0x29acfa==='R'){_0x2b7779(_0x1c5cb7=>{const _0x3043fb=_0x5e7669,_0x5b4adb=new Set();for(let _0x10a142=0x0;_0x10a142<_0x2b64bc['length'];_0x10a142++){!_0x1c5cb7[_0x3043fb(0xfa)](_0x10a142)&&_0x5b4adb[_0x3043fb(0xc3)](_0x10a142);}return _0x5b4adb;});return;}if(_0x29acfa==='q'||_0x29acfa==='Q'){_0x48b9d4();return;}if(_0x30e4ee[_0x5e7669(0xe7)]){if(_0x39d6ec[_0x5e7669(0xcb)]===0x0){_0x873963(_0x5e7669(0xec));return;}const _0x15bb3f=_0x2b64bc['filter']((_0x1b9b1a,_0x4a1cab)=>_0x39d6ec['has'](_0x4a1cab)),_0x47f200=_0x15bb3f[_0x5e7669(0xd5)](_0x48a313=>_0x48a313[_0x5e7669(0xc8)])['join'](',\x20');_0x2eedb9([{'label':_0x5e7669(0xee),'value':_0x39d6ec['size']+'\x20个'}]),_0x873963(''),_0x5aba0b(_0x5e7669(0xea));return;}return;}if(_0xbeb295===_0x5e7669(0xea)){if(_0x30e4ee[_0x5e7669(0xe7)]){const _0x49c428=_0x58875e[_0x5e7669(0xb9)]();if(_0x49c428==='')return;if(!isValidJsHttpsUrl(_0x49c428)){_0x873963(_0x5e7669(0xce));return;}if(!await isUrlReachable(_0x49c428)){_0x873963('JS\x20链接无法访问');return;}_0x2cddea(_0x49c428),_0x2eedb9(_0x3d8be5=>[..._0x3d8be5,{'label':_0x5e7669(0xd1),'value':_0x49c428}]),_0x3925ce(''),_0x873963(''),_0x5aba0b(_0x5e7669(0xb5));return;}if(_0x30e4ee[_0x5e7669(0xb8)]||_0x30e4ee[_0x5e7669(0xf0)]){_0x3925ce(_0x252b8d=>_0x252b8d[_0x5e7669(0xdc)](0x0,-0x1)),_0x873963('');return;}_0x3925ce(_0x387132=>_0x387132+_0x29acfa);return;}if(_0xbeb295===_0x5e7669(0xb5)){if(_0x30e4ee['return']){const _0x5b81d6=_0x58875e[_0x5e7669(0xb9)]();if(_0x5b81d6==='')return;if(!isValidCssHttpsUrl(_0x5b81d6)){_0x873963(_0x5e7669(0xe9));return;}if(!await isUrlReachable(_0x5b81d6)){_0x873963(_0x5e7669(0xd9));return;}_0x1f54d3(_0x5b81d6),_0x2eedb9(_0x2b99e9=>[..._0x2b99e9,{'label':_0x5e7669(0xef),'value':_0x5b81d6}]),_0x3925ce(''),_0x873963(''),_0x5aba0b(_0x5e7669(0xf8));const _0x4d10a6=_0x2b64bc[_0x5e7669(0xc5)]((_0xd33864,_0x48cc69)=>_0x39d6ec[_0x5e7669(0xfa)](_0x48cc69));createMenus(_0x4d10a6,[_0x59185c,_0x5b81d6])[_0x5e7669(0xe4)](()=>{_0x5aba0b('done'),setTimeout(()=>{_0x48b9d4();},0x3e8);})[_0x5e7669(0xc9)](_0x40ec09=>{const _0x1338fc=_0x5e7669;_0x873963(_0x40ec09[_0x1338fc(0xcf)]||_0x1338fc(0xde)),_0x5aba0b(_0x1338fc(0xe3));});return;}if(_0x30e4ee['backspace']||_0x30e4ee[_0x5e7669(0xf0)]){_0x3925ce(_0x2655c3=>_0x2655c3[_0x5e7669(0xdc)](0x0,-0x1)),_0x873963('');return;}_0x3925ce(_0x50b08d=>_0x50b08d+_0x29acfa);return;}});if(_0x492cfb)return a10_0x1c6962(Box,{'marginTop':0x1,'marginBottom':0x1,'children':[a10_0x3ed4a4(Text,{'children':'\x20\x20'}),a10_0x3ed4a4(a10_0x1cb42e,{'type':_0x551a7a(0xd6)}),a10_0x3ed4a4(Text,{'children':_0x551a7a(0xf4)})]});if(_0x25fcc8)return a10_0x1c6962(Box,{'flexDirection':_0x551a7a(0xf6),'marginTop':0x1,'marginBottom':0x1,'children':[a10_0x1c6962(Text,{'color':_0x551a7a(0xc1),'children':['✗\x20',_0x25fcc8]}),a10_0x1c6962(Box,{'marginTop':0x1,'children':[a10_0x3ed4a4(Text,{'color':_0x551a7a(0xc7),'children':_0x551a7a(0xfb)}),a10_0x3ed4a4(Text,{'color':_0x551a7a(0xeb),'children':_0x551a7a(0xf7)}),a10_0x3ed4a4(Text,{'color':_0x551a7a(0xc7),'children':_0x551a7a(0xd3)})]})]});if(_0x2b64bc[_0x551a7a(0xbc)]===0x0)return a10_0x3ed4a4(Box,{'marginTop':0x1,'marginBottom':0x1,'children':a10_0x3ed4a4(Text,{'color':_0x551a7a(0xb4),'children':_0x551a7a(0xca)})});return a10_0x1c6962(Box,{'flexDirection':_0x551a7a(0xf6),'marginTop':0x1,'marginBottom':0x1,'children':[_0xbeb295===_0x551a7a(0xe3)&&a10_0x1c6962(a10_0x42d9cd,{'children':[a10_0x1c6962(Box,{'children':[a10_0x1c6962(Text,{'bold':!![],'children':['\x20\x20','菜单名称',getRemainingSpaces(_0x4ed6f4,_0x551a7a(0xcc))]}),a10_0x1c6962(Text,{'bold':!![],'children':['本地',getRemainingSpaces(_0x525c9c,_0x551a7a(0xcc))]}),a10_0x1c6962(Text,{'bold':!![],'children':[_0x551a7a(0xf1),getRemainingSpaces(_0x525c9c,_0x551a7a(0xcc))]})]}),_0x3db8ed[_0x551a7a(0xd5)](_0x44401b=>a10_0x1c6962(Box,{'children':[a10_0x1c6962(Text,{'children':['\x20\x20',_0x44401b[_0x551a7a(0xc8)],getRemainingSpaces(_0x4ed6f4,_0x44401b['label'])]}),a10_0x1c6962(Text,{'color':_0x551a7a(0xd8),'children':[_0x44401b['local']?'✓':'✗',getRemainingSpaces(_0x525c9c,'✓')]}),a10_0x1c6962(Text,{'color':_0x44401b[_0x551a7a(0xdd)]?'green':'red','children':[_0x44401b[_0x551a7a(0xdd)]?'✓':'✗',getRemainingSpaces(_0x525c9c,'✓')]})]},_0x44401b['path']))]}),_0xbeb295===_0x551a7a(0xe3)&&_0xcfa06c[_0x551a7a(0xbc)]===0x0&&a10_0x3ed4a4(Box,{'marginTop':0x1,'children':a10_0x3ed4a4(Text,{'color':_0x551a7a(0xeb),'children':_0x551a7a(0xdf)})}),_0xcfa06c['map']((_0x35cc44,_0x4bc6a2)=>a10_0x1c6962(Box,{'children':[a10_0x1c6962(Text,{'color':_0x551a7a(0xd8),'children':['√\x20',_0x35cc44[_0x551a7a(0xc8)],':\x20']}),a10_0x3ed4a4(Text,{'color':'cyan','children':_0x35cc44[_0x551a7a(0xba)]})]},_0x4bc6a2)),_0xff7e98&&_0xbeb295==='selecting'&&a10_0x3ed4a4(Box,{'marginTop':0x1,'children':a10_0x1c6962(Text,{'color':_0x551a7a(0xc1),'children':['✗\x20',_0xff7e98]})}),_0xbeb295===_0x551a7a(0xe3)&&a10_0x3ed4a4(a10_0x42d9cd,{'children':a10_0x1c6962(Box,{'marginTop':_0xcfa06c['length']>0x0||_0xff7e98?0x1:0x0,'flexDirection':'column','children':[a10_0x3ed4a4(Text,{'bold':!![],'children':_0x551a7a(0xc2)}),_0x2b64bc[_0x551a7a(0xd5)]((_0x247204,_0x346716)=>{const _0x419a01=_0x551a7a,_0x894fdb=_0x22f7d4===_0x346716,_0x54fa7=_0x39d6ec[_0x419a01(0xfa)](_0x346716),_0x566fc1=_0x3ee8b0[_0x419a01(0xf5)](_0x247204[_0x419a01(0xc6)]),_0x5a9005=_0x566fc1?'更新':'新建';return a10_0x3ed4a4(Box,{'children':a10_0x1c6962(Text,{'backgroundColor':_0x894fdb?_0x419a01(0xcd):undefined,'color':_0x894fdb?_0x419a01(0xe2):undefined,'children':['\x20\x20',_0x54fa7?_0x419a01(0xe8):_0x419a01(0xda),'\x20',_0x247204[_0x419a01(0xc8)]]})},_0x247204[_0x419a01(0xc6)]);}),a10_0x3ed4a4(Box,{'marginTop':0x1,'children':a10_0x1c6962(Text,{'color':_0x551a7a(0xc7),'children':['\x20','↑/↓:\x20移动光标\x20空格:\x20切换选中\x20a:\x20全选\x20i/r:\x20反选\x20Enter:\x20确认']})})]})}),_0xbeb295===_0x551a7a(0xea)&&a10_0x1c6962(a10_0x42d9cd,{'children':[a10_0x1c6962(Box,{'children':[a10_0x3ed4a4(Text,{'children':'*\x20JS\x20链接:\x20'}),a10_0x3ed4a4(Text,{'color':'green','children':_0x58875e}),_0xff7e98&&a10_0x1c6962(Text,{'color':'red','children':[_0x551a7a(0xd7),_0xff7e98]})]}),!_0xff7e98&&a10_0x3ed4a4(Box,{'children':a10_0x3ed4a4(Text,{'color':_0x551a7a(0xc7),'children':_0x551a7a(0xbb)})})]}),_0xbeb295===_0x551a7a(0xb5)&&a10_0x1c6962(a10_0x42d9cd,{'children':[a10_0x1c6962(Box,{'children':[a10_0x3ed4a4(Text,{'children':_0x551a7a(0xc0)}),a10_0x3ed4a4(Text,{'color':'green','children':_0x58875e}),_0xff7e98&&a10_0x1c6962(Text,{'color':'red','children':[_0x551a7a(0xd7),_0xff7e98]})]}),!_0xff7e98&&a10_0x3ed4a4(Box,{'children':a10_0x3ed4a4(Text,{'color':_0x551a7a(0xc7),'children':_0x551a7a(0xb7)})})]}),_0xbeb295===_0x551a7a(0xf8)&&a10_0x3ed4a4(Box,{'children':a10_0x3ed4a4(Text,{'children':_0x551a7a(0xed)})}),_0xbeb295===_0x551a7a(0xf2)&&a10_0x3ed4a4(Box,{'children':a10_0x3ed4a4(Text,{'color':_0x551a7a(0xd8),'children':_0x551a7a(0xe1)})})]});}function getStringWidth(_0x10864b){const _0x557384=a10_0x1dd982;let _0x1acfd3=0x0;for(const _0x2bacde of _0x10864b){/[\u4e00-\u9fa5]/[_0x557384(0xdb)](_0x2bacde)?_0x1acfd3+=0x2:_0x1acfd3+=0x1;}return _0x1acfd3;}function getRemainingSpaces(_0x32d918,_0x794526){const _0x51eb1b=a10_0x1dd982,_0x4800a9=getStringWidth(_0x794526);return Array(Math[_0x51eb1b(0xbd)](0x0,_0x32d918-_0x4800a9))[_0x51eb1b(0xe6)]('\x20')[_0x51eb1b(0xe0)]('');}function getMaxWidth(_0x58aa70,_0x55128b=0x2){let _0x40758a='',_0x1da045=0x0;for(const _0x578e42 of _0x58aa70){const _0x30ed7e=getStringWidth(_0x578e42);_0x30ed7e>_0x1da045&&(_0x1da045=_0x30ed7e,_0x40758a=_0x578e42);}return _0x40758a+'\x20'['repeat'](_0x55128b);}