@lovrabet/cli 1.2.1-beta.4 → 1.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (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/use-get-online-menu-list.js +1 -1
  16. package/lib/app-menu/utils.js +1 -1
  17. package/lib/app-menu/valid-url.js +1 -1
  18. package/lib/app-menu-update-cdn/current-content.js +1 -1
  19. package/lib/app-menu-update-cdn/input-cdn-asset.js +1 -1
  20. package/lib/app-menu-update-cdn/main.js +1 -1
  21. package/lib/app-menu-update-cdn/update-menu-cdn-url.js +1 -1
  22. package/lib/auth/auth-server-ui.js +1 -1
  23. package/lib/auth/auth-server.js +1 -1
  24. package/lib/auth/constant.js +1 -1
  25. package/lib/auth/get-cookie.js +1 -1
  26. package/lib/auth/is-session-valid.js +1 -1
  27. package/lib/auth/logout.js +1 -1
  28. package/lib/cli.js +1 -1
  29. package/lib/cmd/build-watch.js +1 -1
  30. package/lib/cmd/build.js +1 -1
  31. package/lib/cmd/logs.js +1 -1
  32. package/lib/cmd/preview.js +1 -1
  33. package/lib/cmd/start.js +1 -1
  34. package/lib/config/config-help.js +1 -1
  35. package/lib/config/main.js +1 -1
  36. package/lib/constant/domain.js +1 -1
  37. package/lib/constant/env.js +1 -1
  38. package/lib/create-app/enhanced-guided-create.js +1 -1
  39. package/lib/create-app/format-elapsed.js +1 -1
  40. package/lib/create-app/main.js +1 -1
  41. package/lib/create-app/task-finished.js +1 -1
  42. package/lib/create-app/task-loading.js +1 -1
  43. package/lib/create-app/task-running.js +1 -1
  44. package/lib/create-app/task-time.js +1 -1
  45. package/lib/create-app/use-copy-project-template.js +1 -1
  46. package/lib/create-app/use-format-code.js +1 -1
  47. package/lib/create-app/use-install-dependencies.js +1 -1
  48. package/lib/help.js +1 -1
  49. package/lib/init/main.js +1 -1
  50. package/lib/mcp/cursor.js +1 -1
  51. package/lib/mcp/main.js +1 -1
  52. package/lib/utils/check-sdk-version.js +1 -1
  53. package/lib/utils/config.js +1 -1
  54. package/lib/utils/copy-directory.js +1 -1
  55. package/lib/utils/http-client.js +1 -1
  56. package/lib/utils/logger.js +1 -1
  57. package/lib/utils/router-updater.js +1 -1
  58. package/lib/utils/sleep.js +1 -1
  59. package/lib/utils/template-replacer.js +1 -1
  60. package/package.json +3 -3
  61. package/templates/projects/sub-app-react-demo/package.json +2 -2
  62. package/templates/projects/sub-app-react-demo/src/api/api.ts +42 -25
  63. package/templates/projects/sub-app-react-demo/src/api/client.ts +11 -10
  64. package/templates/projects/sub-app-react-demo/src/pages/sdk-demo/index.tsx +72 -19
  65. package/templates/projects/sub-app-react-demo/package-lock.json +0 -4062
@@ -1 +1 @@
1
- (function(_0xd0a3a1,_0x4f7354){const _0xd0a705=a0_0x6397,_0x4ea7c3=_0xd0a3a1();while(!![]){try{const _0x3ad818=-parseInt(_0xd0a705(0xb3))/0x1*(parseInt(_0xd0a705(0xb0))/0x2)+-parseInt(_0xd0a705(0xc4))/0x3+parseInt(_0xd0a705(0xba))/0x4+-parseInt(_0xd0a705(0xb6))/0x5*(-parseInt(_0xd0a705(0xc6))/0x6)+parseInt(_0xd0a705(0xbe))/0x7+-parseInt(_0xd0a705(0xb1))/0x8+parseInt(_0xd0a705(0xbd))/0x9;if(_0x3ad818===_0x4f7354)break;else _0x4ea7c3['push'](_0x4ea7c3['shift']());}catch(_0x5e4c50){_0x4ea7c3['push'](_0x4ea7c3['shift']());}}}(a0_0x1ee4,0xdb914));function a0_0x1ee4(){const _0x4a868a=['8151EfGLgP','路径中的每个段只能以字母或数字开头,且只包含字母、数字、-\x20和\x20_','green','586120FmizuD','\x20Step2:\x20','existsSync','my-page','2043056FuIZvq','backspace','return','27343278MYVDiC','1310218WiVLNq','页面路径不合法','页面路由地址:\x20','\x20←\x20','\x20已存在,请使用其他路径','gray','4457520PAQLiM','页面路径\x20','48hIBFxf','includes','test','red','路径不能以\x20/\x20开头或结尾','delete','路径不能包含连续的\x20/','218QIxWpq','11201800EXvXQQ','length'];a0_0x1ee4=function(){return _0x4a868a;};return a0_0x1ee4();}import{jsx as a0_0xf68e8,jsxs as a0_0x4fbbf5}from'react/jsx-runtime';function a0_0x6397(_0x5839a8,_0x1a6321){_0x5839a8=_0x5839a8-0xaf;const _0x1ee49a=a0_0x1ee4();let _0x63978c=_0x1ee49a[_0x5839a8];return _0x63978c;}import{useState}from'react';import{Text,Box,useInput}from'ink';import a0_0x46ee8f from'node:fs';export function InputProjectCode(_0x350c2f){const _0x4c9e86=a0_0x6397,{onSubmit:_0x336c4b,pagePath:_0x5a6d41}=_0x350c2f,[_0x37db15,_0x14c367]=useState(''),[_0xf4358f,_0x107108]=useState(''),_0x87e7cb=_0x4c9e86(0xb9);function _0x20db1b(_0x59a9bd){const _0x2c5530=_0x4c9e86;if(_0x59a9bd[_0x2c5530(0xb2)]>0x64)return{'valid':![],'message':'页面路径长度不能超过\x20100\x20个字符'};if(_0x59a9bd['startsWith']('/')||_0x59a9bd['endsWith']('/'))return{'valid':![],'message':_0x2c5530(0xca)};if(_0x59a9bd[_0x2c5530(0xc7)]('//'))return{'valid':![],'message':_0x2c5530(0xaf)};const _0x34f485=_0x59a9bd['split']('/');for(const _0x423f6d of _0x34f485){if(!_0x423f6d)continue;const _0x5ecc51=/^[A-Za-z0-9][A-Za-z0-9_-]*$/;if(!_0x5ecc51[_0x2c5530(0xc8)](_0x423f6d))return{'valid':![],'message':_0x2c5530(0xb4)};}return{'valid':!![]};}return useInput((_0x172179,_0x28ec39)=>{const _0x4c58f5=_0x4c9e86;if(_0x28ec39[_0x4c58f5(0xbc)]){const _0x2d5be0=_0x37db15['trim']()||_0x87e7cb;if(_0xf4358f)return;const _0x37a600=_0x5a6d41+'/'+_0x2d5be0;if(a0_0x46ee8f[_0x4c58f5(0xb8)](_0x37a600)){_0x107108(_0x4c58f5(0xc5)+_0x2d5be0+_0x4c58f5(0xc2));return;}_0x336c4b(_0x2d5be0),_0x14c367(''),_0x107108('');}else _0x28ec39[_0x4c58f5(0xbb)]||_0x28ec39[_0x4c58f5(0xcb)]?_0x14c367(_0x274a0c=>{const _0x54d73f=_0x4c58f5,_0x2fc315=_0x274a0c['slice'](0x0,-0x1),{valid:_0x5edbfc,message:_0x5be162}=_0x20db1b(_0x2fc315);return _0x107108(_0x5edbfc?'':_0x5be162||_0x54d73f(0xbf)),_0x2fc315;}):_0x14c367(_0x3d8a06=>{const _0x128c62=_0x4c58f5,_0x519d97=_0x3d8a06+_0x172179,{valid:_0x3e1580,message:_0x12e50f}=_0x20db1b(_0x519d97);return _0x107108(_0x3e1580?'':_0x12e50f||_0x128c62(0xbf)),_0x519d97;});}),a0_0x4fbbf5(Box,{'flexDirection':'column','children':[a0_0x4fbbf5(Box,{'children':[a0_0xf68e8(Text,{'color':'gray','children':_0x4c9e86(0xb7)}),a0_0xf68e8(Text,{'children':_0x4c9e86(0xc0)}),_0x37db15?a0_0xf68e8(Text,{'color':_0x4c9e86(0xb5),'children':_0x37db15}):a0_0xf68e8(Text,{'color':_0x4c9e86(0xc3),'children':_0x87e7cb}),_0xf4358f&&a0_0x4fbbf5(Text,{'color':_0x4c9e86(0xc9),'children':[_0x4c9e86(0xc1),_0xf4358f]})]}),!_0xf4358f&&!_0x37db15&&a0_0xf68e8(Box,{'children':a0_0xf68e8(Text,{'color':_0x4c9e86(0xc3),'children':'\x20直接回车确认,或输入自定义路由地址'})})]});}
1
+ (function(_0x20693c,_0x2eb089){const _0x5a4ec8=a0_0x48fb,_0x24fc86=_0x20693c();while(!![]){try{const _0x59195b=parseInt(_0x5a4ec8(0xc5))/0x1+parseInt(_0x5a4ec8(0xbe))/0x2+-parseInt(_0x5a4ec8(0xb8))/0x3+-parseInt(_0x5a4ec8(0xb3))/0x4*(parseInt(_0x5a4ec8(0xb0))/0x5)+parseInt(_0x5a4ec8(0xac))/0x6+-parseInt(_0x5a4ec8(0xc6))/0x7+parseInt(_0x5a4ec8(0xc1))/0x8*(parseInt(_0x5a4ec8(0xae))/0x9);if(_0x59195b===_0x2eb089)break;else _0x24fc86['push'](_0x24fc86['shift']());}catch(_0x4b9f2c){_0x24fc86['push'](_0x24fc86['shift']());}}}(a0_0x126b,0xc9744));import{jsx as a0_0x5031ed,jsxs as a0_0x2cd054}from'react/jsx-runtime';import{useState}from'react';import{Text,Box,useInput}from'ink';import a0_0x3a2438 from'node:fs';function a0_0x48fb(_0x585e0e,_0x23ee2e){_0x585e0e=_0x585e0e-0xac;const _0x126b7f=a0_0x126b();let _0x48fb11=_0x126b7f[_0x585e0e];return _0x48fb11;}export function InputProjectCode(_0x1e4550){const _0x321873=a0_0x48fb,{onSubmit:_0x597fba,pagePath:_0x2c06c2}=_0x1e4550,[_0x36c228,_0x2e1c87]=useState(''),[_0x29ebdc,_0x364fbe]=useState(''),_0x2e907e=_0x321873(0xbb);function _0x5cf640(_0x220cf6){const _0x34dd2b=_0x321873;if(_0x220cf6[_0x34dd2b(0xc7)]>0x64)return{'valid':![],'message':_0x34dd2b(0xb4)};if(_0x220cf6[_0x34dd2b(0xc9)]('/')||_0x220cf6[_0x34dd2b(0xb6)]('/'))return{'valid':![],'message':'路径不能以\x20/\x20开头或结尾'};if(_0x220cf6[_0x34dd2b(0xbc)]('//'))return{'valid':![],'message':_0x34dd2b(0xaf)};const _0x52ce67=_0x220cf6['split']('/');for(const _0x546d88 of _0x52ce67){if(!_0x546d88)continue;const _0x4352dd=/^[A-Za-z0-9][A-Za-z0-9_-]*$/;if(!_0x4352dd[_0x34dd2b(0xb2)](_0x546d88))return{'valid':![],'message':_0x34dd2b(0xc2)};}return{'valid':!![]};}return useInput((_0x449c5e,_0x1a07da)=>{const _0x351921=_0x321873;if(_0x1a07da[_0x351921(0xc0)]){const _0x145c45=_0x36c228[_0x351921(0xb9)]()||_0x2e907e;if(_0x29ebdc)return;const _0x29ef65=_0x2c06c2+'/'+_0x145c45;if(a0_0x3a2438[_0x351921(0xbd)](_0x29ef65)){_0x364fbe(_0x351921(0xc8)+_0x145c45+_0x351921(0xc3));return;}_0x597fba(_0x145c45),_0x2e1c87(''),_0x364fbe('');}else _0x1a07da[_0x351921(0xb7)]||_0x1a07da[_0x351921(0xad)]?_0x2e1c87(_0x5bfcb6=>{const _0x2bed01=_0x351921,_0x106677=_0x5bfcb6[_0x2bed01(0xcb)](0x0,-0x1),{valid:_0x42bbe6,message:_0x3fde34}=_0x5cf640(_0x106677);return _0x364fbe(_0x42bbe6?'':_0x3fde34||_0x2bed01(0xba)),_0x106677;}):_0x2e1c87(_0x1d13f1=>{const _0x2ce617=_0x1d13f1+_0x449c5e,{valid:_0x4add5f,message:_0x1b9800}=_0x5cf640(_0x2ce617);return _0x364fbe(_0x4add5f?'':_0x1b9800||'页面路径不合法'),_0x2ce617;});}),a0_0x2cd054(Box,{'flexDirection':'column','children':[a0_0x2cd054(Box,{'children':[a0_0x5031ed(Text,{'color':'gray','children':'\x20Step2:\x20'}),a0_0x5031ed(Text,{'children':_0x321873(0xb1)}),_0x36c228?a0_0x5031ed(Text,{'color':_0x321873(0xbf),'children':_0x36c228}):a0_0x5031ed(Text,{'color':_0x321873(0xca),'children':_0x2e907e}),_0x29ebdc&&a0_0x2cd054(Text,{'color':'red','children':[_0x321873(0xb5),_0x29ebdc]})]}),!_0x29ebdc&&!_0x36c228&&a0_0x5031ed(Box,{'children':a0_0x5031ed(Text,{'color':'gray','children':_0x321873(0xc4)})})]});}function a0_0x126b(){const _0x28b114=['backspace','3744879HWzLgX','trim','页面路径不合法','my-page','includes','existsSync','2098846YsVpAC','green','return','104yGZZrf','路径中的每个段只能以字母或数字开头,且只包含字母、数字、-\x20和\x20_','\x20已存在,请使用其他路径','\x20直接回车确认,或输入自定义路由地址','1101371yNbepQ','8997079KKStTk','length','页面路径\x20','startsWith','gray','slice','411198MLjdTF','delete','1592559ATbMcQ','路径不能包含连续的\x20/','725590YVfauP','页面路由地址:\x20','test','32HKQFqB','页面路径长度不能超过\x20100\x20个字符','\x20←\x20','endsWith'];a0_0x126b=function(){return _0x28b114;};return a0_0x126b();}
@@ -1 +1 @@
1
- const a1_0x1e8901=a1_0x57b7;(function(_0x6ac0df,_0x5ed4cd){const _0x3f5019=a1_0x57b7,_0x1213e8=_0x6ac0df();while(!![]){try{const _0x4217c9=-parseInt(_0x3f5019(0x162))/0x1*(parseInt(_0x3f5019(0x163))/0x2)+parseInt(_0x3f5019(0x15c))/0x3*(parseInt(_0x3f5019(0x15e))/0x4)+parseInt(_0x3f5019(0x16b))/0x5+-parseInt(_0x3f5019(0x179))/0x6*(parseInt(_0x3f5019(0x177))/0x7)+parseInt(_0x3f5019(0x16a))/0x8*(-parseInt(_0x3f5019(0x168))/0x9)+-parseInt(_0x3f5019(0x164))/0xa*(-parseInt(_0x3f5019(0x16e))/0xb)+-parseInt(_0x3f5019(0x16d))/0xc*(parseInt(_0x3f5019(0x176))/0xd);if(_0x4217c9===_0x5ed4cd)break;else _0x1213e8['push'](_0x1213e8['shift']());}catch(_0x38098f){_0x1213e8['push'](_0x1213e8['shift']());}}}(a1_0x3208,0xb2adc));import{jsx as a1_0x3d0d88,jsxs as a1_0x4d9e70,Fragment as a1_0x2ba8ce}from'react/jsx-runtime';import{fileURLToPath}from'node:url';import a1_0x3eb56b from'node:path';import{useEffect,useState}from'react';import{Box,Text,useApp}from'ink';import{SelectPageTemplate}from'./select-page-template.js';function a1_0x57b7(_0x3bf60e,_0x15acba){_0x3bf60e=_0x3bf60e-0x15a;const _0x32087f=a1_0x3208();let _0x57b7bd=_0x32087f[_0x3bf60e];return _0x57b7bd;}import{InputProjectCode}from'./input-page-router.js';import{logger}from'../utils/logger.js';import{TemplateReplacer}from'../utils/template-replacer.js';function a1_0x3208(){const _0x185bba=['cwd','src','91hJtltT','147KiywQf','\x20*\x20页面路径:\x20','172218UTzjsT','页面添加成功:\x20','\x20Step2:\x20','processTemplate','gray','error','success','then','开始添加页面:\x20','\x20*\x20页面创建成功!','\x20*\x20页面文件已创建,可直接通过路由访问','1975737asXohI','\x20Step1:\x20','4dGrPEU','message','join','正在创建页面,请稍候…','29GEGnCK','23602nuyJcf','30eyrTCd','已输入的页面路由\x20','页面添加失败:\x20','add-page','45urdcBb','green','13264WqbJeT','432470jVsHKo','setLogPath','436068ymugNW','4379650juINes','now','已选择页面模板\x20','dirname','resolve','cyan'];a1_0x3208=function(){return _0x185bba;};return a1_0x3208();}const __dirname=a1_0x3eb56b[a1_0x1e8901(0x171)](fileURLToPath(import.meta.url)),pageTemplateDir=a1_0x3eb56b['resolve'](__dirname,'../../templates/pages'),projectDir=process[a1_0x1e8901(0x174)]();export const AddPage=()=>{const _0x3b0e3d=a1_0x1e8901,{exit:_0x136241}=useApp(),[_0x266767,_0x3ee077]=useState(''),[_0x5d4cea,_0x5c262c]=useState(''),[_0x38df6c,_0x2a6db6]=useState(![]),[_0x3b23a7,_0xba0db6]=useState(![]),_0x2edc7c=a1_0x3eb56b[_0x3b0e3d(0x160)](projectDir,'src','pages'),_0x1328b4=a1_0x3eb56b['join'](_0x2edc7c,_0x5d4cea),_0x2cdd15=a1_0x3eb56b[_0x3b0e3d(0x160)](_0x3b0e3d(0x175),'pages',_0x5d4cea);useEffect(()=>{const _0x374205=_0x3b0e3d,_0x235171=a1_0x3eb56b[_0x374205(0x172)](pageTemplateDir,_0x266767);if(_0x266767&&_0x5d4cea){_0x2a6db6(!![]),logger[_0x374205(0x16c)](process['cwd']());const _0x18f629=Date['now']();logger['info'](_0x374205(0x167),_0x374205(0x181)+_0x5d4cea,{'template':_0x266767,'targetPath':_0x2cdd15}),TemplateReplacer[_0x374205(0x17c)](_0x235171,a1_0x3eb56b[_0x374205(0x160)](_0x2edc7c,_0x5d4cea),_0x5d4cea,_0x266767)[_0x374205(0x180)](()=>{const _0x2d7c30=_0x374205,_0x4588f1=Date[_0x2d7c30(0x16f)]()-_0x18f629;logger[_0x2d7c30(0x17f)]('add-page',_0x2d7c30(0x17a)+_0x5d4cea,_0x4588f1,{'template':_0x266767,'targetPath':_0x2cdd15,'routePath':_0x5d4cea}),_0xba0db6(!![]);})['catch'](_0x11c8c4=>{const _0x555b10=_0x374205,_0x4728e1=Date[_0x555b10(0x16f)]()-_0x18f629;logger[_0x555b10(0x17e)](_0x555b10(0x167),_0x555b10(0x166)+_0x5d4cea,{'template':_0x266767,'targetPath':_0x2cdd15,'error':_0x11c8c4 instanceof Error?_0x11c8c4[_0x555b10(0x15f)]:String(_0x11c8c4),'duration':_0x4728e1});})['finally'](()=>{_0x2a6db6(![]);});}},[_0x266767,_0x5d4cea]),useEffect(()=>{_0x3b23a7&&setTimeout(()=>{_0x136241();});},[_0x3b23a7]);if(_0x266767)return a1_0x4d9e70(Box,{'flexDirection':'column','paddingY':0x1,'children':[a1_0x4d9e70(Box,{'children':[a1_0x3d0d88(Text,{'color':_0x3b0e3d(0x17d),'children':_0x3b0e3d(0x15d)}),a1_0x3d0d88(Text,{'children':_0x3b0e3d(0x170)}),a1_0x3d0d88(Text,{'color':'green','children':_0x266767})]}),_0x5d4cea?a1_0x4d9e70(Box,{'children':[a1_0x3d0d88(Text,{'color':_0x3b0e3d(0x17d),'children':_0x3b0e3d(0x17b)}),a1_0x3d0d88(Text,{'children':_0x3b0e3d(0x165)}),a1_0x3d0d88(Text,{'color':'green','children':_0x5d4cea})]}):a1_0x3d0d88(InputProjectCode,{'pagePath':_0x1328b4,'onSubmit':_0x5c262c}),_0x5d4cea&&_0x38df6c?a1_0x4d9e70(Box,{'marginTop':0x1,'children':[a1_0x3d0d88(Box,{'width':'4'}),a1_0x3d0d88(Text,{'children':_0x3b0e3d(0x161)})]}):null,_0x3b23a7?a1_0x4d9e70(a1_0x2ba8ce,{'children':[a1_0x3d0d88(Box,{'marginTop':0x1,'children':a1_0x3d0d88(Text,{'color':_0x3b0e3d(0x17d),'children':_0x3b0e3d(0x15a)})}),a1_0x4d9e70(Box,{'children':[a1_0x3d0d88(Text,{'color':_0x3b0e3d(0x17d),'children':_0x3b0e3d(0x178)}),a1_0x3d0d88(Text,{'color':'green','children':_0x2cdd15})]}),a1_0x4d9e70(Box,{'children':[a1_0x3d0d88(Text,{'color':'gray','children':'\x20*\x20路由地址:\x20'}),a1_0x4d9e70(Text,{'color':_0x3b0e3d(0x169),'children':['/',_0x5d4cea]})]}),a1_0x3d0d88(Box,{'marginTop':0x1,'children':a1_0x3d0d88(Text,{'color':_0x3b0e3d(0x173),'children':_0x3b0e3d(0x15b)})})]}):null]});return a1_0x3d0d88(SelectPageTemplate,{'onSelect':_0x3ee077});};
1
+ const a1_0x26742a=a1_0x5e12;(function(_0xfc64f6,_0x5a9c5b){const _0x55af79=a1_0x5e12,_0x29b3c1=_0xfc64f6();while(!![]){try{const _0x3a524b=-parseInt(_0x55af79(0xe7))/0x1*(parseInt(_0x55af79(0xe9))/0x2)+parseInt(_0x55af79(0xed))/0x3+-parseInt(_0x55af79(0xf9))/0x4+-parseInt(_0x55af79(0xfd))/0x5*(parseInt(_0x55af79(0xf0))/0x6)+parseInt(_0x55af79(0xf3))/0x7+parseInt(_0x55af79(0xe5))/0x8+parseInt(_0x55af79(0xf1))/0x9;if(_0x3a524b===_0x5a9c5b)break;else _0x29b3c1['push'](_0x29b3c1['shift']());}catch(_0x4a0db8){_0x29b3c1['push'](_0x29b3c1['shift']());}}}(a1_0x30e9,0x9f7a4));function a1_0x5e12(_0x540e6c,_0x51fef3){_0x540e6c=_0x540e6c-0xdd;const _0x30e9d3=a1_0x30e9();let _0x5e127c=_0x30e9d3[_0x540e6c];return _0x5e127c;}import{jsx as a1_0x2b6d69,jsxs as a1_0x2c75c0,Fragment as a1_0x2a5c65}from'react/jsx-runtime';import{fileURLToPath}from'node:url';import a1_0x2c6168 from'node:path';import{useEffect,useState}from'react';import{Box,Text,useApp}from'ink';import{SelectPageTemplate}from'./select-page-template.js';import{InputProjectCode}from'./input-page-router.js';import{logger}from'../utils/logger.js';import{TemplateReplacer}from'../utils/template-replacer.js';const __dirname=a1_0x2c6168['dirname'](fileURLToPath(import.meta.url)),pageTemplateDir=a1_0x2c6168['resolve'](__dirname,a1_0x26742a(0xe8)),projectDir=process['cwd']();export const AddPage=()=>{const _0x5e0dce=a1_0x26742a,{exit:_0x5bf6dc}=useApp(),[_0x1093dc,_0x293254]=useState(''),[_0xb4d079,_0x502d06]=useState(''),[_0x133c50,_0x3075c0]=useState(![]),[_0x2b826b,_0x15f9de]=useState(![]),_0x23ffa3=a1_0x2c6168['join'](projectDir,_0x5e0dce(0xec),_0x5e0dce(0xf5)),_0x4c81f5=a1_0x2c6168[_0x5e0dce(0xfb)](_0x23ffa3,_0xb4d079),_0x41ef7c=a1_0x2c6168[_0x5e0dce(0xfb)](_0x5e0dce(0xec),_0x5e0dce(0xf5),_0xb4d079);useEffect(()=>{const _0x46e56b=_0x5e0dce,_0x21644e=a1_0x2c6168[_0x46e56b(0xdd)](pageTemplateDir,_0x1093dc);if(_0x1093dc&&_0xb4d079){_0x3075c0(!![]),logger[_0x46e56b(0xe6)](process['cwd']());const _0x1883f7=Date[_0x46e56b(0xee)]();logger[_0x46e56b(0xe0)](_0x46e56b(0xf6),_0x46e56b(0xf8)+_0xb4d079,{'template':_0x1093dc,'targetPath':_0x41ef7c}),TemplateReplacer['processTemplate'](_0x21644e,a1_0x2c6168[_0x46e56b(0xfb)](_0x23ffa3,_0xb4d079),_0xb4d079,_0x1093dc)[_0x46e56b(0xfc)](()=>{const _0x4c7302=_0x46e56b,_0x2e72a7=Date[_0x4c7302(0xee)]()-_0x1883f7;logger['success'](_0x4c7302(0xf6),_0x4c7302(0xeb)+_0xb4d079,_0x2e72a7,{'template':_0x1093dc,'targetPath':_0x41ef7c,'routePath':_0xb4d079}),_0x15f9de(!![]);})[_0x46e56b(0xef)](_0x1e92c3=>{const _0x107b4e=_0x46e56b,_0x31c7a9=Date[_0x107b4e(0xee)]()-_0x1883f7;logger['error'](_0x107b4e(0xf6),'页面添加失败:\x20'+_0xb4d079,{'template':_0x1093dc,'targetPath':_0x41ef7c,'error':_0x1e92c3 instanceof Error?_0x1e92c3[_0x107b4e(0xf7)]:String(_0x1e92c3),'duration':_0x31c7a9});})[_0x46e56b(0xdf)](()=>{_0x3075c0(![]);});}},[_0x1093dc,_0xb4d079]),useEffect(()=>{_0x2b826b&&setTimeout(()=>{_0x5bf6dc();});},[_0x2b826b]);if(_0x1093dc)return a1_0x2c75c0(Box,{'flexDirection':'column','paddingY':0x1,'children':[a1_0x2c75c0(Box,{'children':[a1_0x2b6d69(Text,{'color':'gray','children':_0x5e0dce(0xde)}),a1_0x2b6d69(Text,{'children':_0x5e0dce(0xe2)}),a1_0x2b6d69(Text,{'color':_0x5e0dce(0xe4),'children':_0x1093dc})]}),_0xb4d079?a1_0x2c75c0(Box,{'children':[a1_0x2b6d69(Text,{'color':_0x5e0dce(0xea),'children':_0x5e0dce(0xfa)}),a1_0x2b6d69(Text,{'children':'已输入的页面路由\x20'}),a1_0x2b6d69(Text,{'color':'green','children':_0xb4d079})]}):a1_0x2b6d69(InputProjectCode,{'pagePath':_0x4c81f5,'onSubmit':_0x502d06}),_0xb4d079&&_0x133c50?a1_0x2c75c0(Box,{'marginTop':0x1,'children':[a1_0x2b6d69(Box,{'width':'4'}),a1_0x2b6d69(Text,{'children':'正在创建页面,请稍候…'})]}):null,_0x2b826b?a1_0x2c75c0(a1_0x2a5c65,{'children':[a1_0x2b6d69(Box,{'marginTop':0x1,'children':a1_0x2b6d69(Text,{'color':_0x5e0dce(0xea),'children':'\x20*\x20页面创建成功!'})}),a1_0x2c75c0(Box,{'children':[a1_0x2b6d69(Text,{'color':_0x5e0dce(0xea),'children':_0x5e0dce(0xf2)}),a1_0x2b6d69(Text,{'color':'green','children':_0x41ef7c})]}),a1_0x2c75c0(Box,{'children':[a1_0x2b6d69(Text,{'color':_0x5e0dce(0xea),'children':_0x5e0dce(0xe3)}),a1_0x2c75c0(Text,{'color':_0x5e0dce(0xe4),'children':['/',_0xb4d079]})]}),a1_0x2b6d69(Box,{'marginTop':0x1,'children':a1_0x2b6d69(Text,{'color':_0x5e0dce(0xe1),'children':_0x5e0dce(0xf4)})})]}):null]});return a1_0x2b6d69(SelectPageTemplate,{'onSelect':_0x293254});};function a1_0x30e9(){const _0x4508bd=['已选择页面模板\x20','\x20*\x20路由地址:\x20','green','2169968RZyVPJ','setLogPath','37NsYmZH','../../templates/pages','41514KcjWcC','gray','页面添加成功:\x20','src','2582307uuHCMn','now','catch','90KTVUFc','13555791dFJfGU','\x20*\x20页面路径:\x20','2819789rPyuzQ','\x20*\x20页面文件已创建,可直接通过路由访问','pages','add-page','message','开始添加页面:\x20','2824468ZTaPTD','\x20Step2:\x20','join','then','304565UFMQfd','resolve','\x20Step1:\x20','finally','info','cyan'];a1_0x30e9=function(){return _0x4508bd;};return a1_0x30e9();}
@@ -1 +1 @@
1
- function a2_0x5b6e(){const _0x153ba1=['获取模板列表失败:','请选择您要创建的页面模板','templates/pages','\x20Step1:\x20','385394IkhUvo','column','200tsbrCO','name','217690xoQctu','downArrow','gray','return','green','upArrow','\x20\x20\x20\x20\x20\x20>\x20','\x20\x20\x20\x20\x20\x20\x20\x20','sdk-fetch','label','1954GFoKPm','753XGGlVz','error','sort','2165250HnsQhL','filter','833uzpFlZ','772828pPWqXV','56358rqDExi','resolve','localeCompare','50pYRWQl','onSelect','map','dirname','12006DJcjRe','../..','join'];a2_0x5b6e=function(){return _0x153ba1;};return a2_0x5b6e();}(function(_0x5ddf28,_0x5dd3ea){const _0x331422=a2_0x30ea,_0x5f836c=_0x5ddf28();while(!![]){try{const _0x235443=parseInt(_0x331422(0x10a))/0x1+-parseInt(_0x331422(0xf4))/0x2*(-parseInt(_0x331422(0xf5))/0x3)+-parseInt(_0x331422(0xfb))/0x4+-parseInt(_0x331422(0xf8))/0x5+-parseInt(_0x331422(0x103))/0x6*(-parseInt(_0x331422(0xfa))/0x7)+-parseInt(_0x331422(0xe8))/0x8*(-parseInt(_0x331422(0xfc))/0x9)+-parseInt(_0x331422(0xff))/0xa*(parseInt(_0x331422(0xea))/0xb);if(_0x235443===_0x5dd3ea)break;else _0x5f836c['push'](_0x5f836c['shift']());}catch(_0x2b324c){_0x5f836c['push'](_0x5f836c['shift']());}}}(a2_0x5b6e,0x49433));import{jsx as a2_0x1ad7a1,jsxs as a2_0xa2a73}from'react/jsx-runtime';import{useState,useEffect}from'react';function a2_0x30ea(_0xfda303,_0x24107a){_0xfda303=_0xfda303-0xe8;const _0x5b6ec4=a2_0x5b6e();let _0x30ea49=_0x5b6ec4[_0xfda303];return _0x30ea49;}import{Text,Box,useInput}from'ink';import{readdir}from'node:fs/promises';import a2_0x1a99c7 from'node:path';import{fileURLToPath}from'node:url';async function getTemplateList(){const _0x671ed1=a2_0x30ea;try{const _0x56088c=fileURLToPath(import.meta.url),_0x36d223=a2_0x1a99c7[_0x671ed1(0xfd)](a2_0x1a99c7[_0x671ed1(0x102)](_0x56088c),_0x671ed1(0x104)),_0x4a1fbb=a2_0x1a99c7[_0x671ed1(0x105)](_0x36d223,_0x671ed1(0x108)),_0x3d6b5e=await readdir(_0x4a1fbb,{'withFileTypes':!![]}),_0x5d15e8=_0x3d6b5e[_0x671ed1(0xf9)](_0x239496=>_0x239496['isDirectory']())['map'](_0x5cf543=>({'label':_0x5cf543[_0x671ed1(0xe9)]}))[_0x671ed1(0xf7)]((_0x24e540,_0x38ce68)=>_0x24e540['label'][_0x671ed1(0xfe)](_0x38ce68['label']));return _0x5d15e8;}catch(_0x32b4af){return console[_0x671ed1(0xf6)](_0x671ed1(0x106),_0x32b4af),[{'label':'blank'},{'label':_0x671ed1(0xf2)}];}}export function SelectPageTemplate(_0x356262){const _0x34955d=a2_0x30ea,[_0x1fa3a6,_0x5e6e5c]=useState(0x0),[_0x4815f4,_0x12d935]=useState([]),[_0x58d543,_0x1a0f96]=useState(!![]);useEffect(()=>{async function _0x359ff1(){const _0xe09500=await getTemplateList();_0x12d935(_0xe09500),_0x1a0f96(![]);}_0x359ff1();},[]),useInput((_0x5aec49,_0x5b3d0d)=>{const _0x638fa2=a2_0x30ea;if(_0x58d543)return;if(_0x5b3d0d[_0x638fa2(0xed)]){const _0x7bb462=_0x4815f4[_0x1fa3a6];_0x7bb462&&_0x356262[_0x638fa2(0x100)](_0x7bb462['label']);}_0x5b3d0d[_0x638fa2(0xef)]&&_0x5e6e5c(_0x501b05=>_0x501b05===0x0?_0x4815f4['length']-0x1:_0x501b05-0x1),_0x5b3d0d[_0x638fa2(0xeb)]&&_0x5e6e5c(_0x17e170=>_0x17e170===_0x4815f4['length']-0x1?0x0:_0x17e170+0x1);});if(_0x58d543)return a2_0x1ad7a1(Box,{'flexDirection':_0x34955d(0x10b),'paddingY':0x1,'children':a2_0xa2a73(Box,{'children':[a2_0x1ad7a1(Text,{'color':_0x34955d(0xec),'children':_0x34955d(0x109)}),a2_0x1ad7a1(Text,{'children':'正在加载页面模板...'})]})});return a2_0xa2a73(Box,{'flexDirection':_0x34955d(0x10b),'paddingY':0x1,'children':[a2_0xa2a73(Box,{'children':[a2_0x1ad7a1(Text,{'color':'gray','children':_0x34955d(0x109)}),a2_0x1ad7a1(Text,{'children':_0x34955d(0x107)})]}),_0x4815f4[_0x34955d(0x101)]((_0x271e24,_0x10c02a)=>{const _0x15250b=_0x34955d,_0x10e7f2=_0x10c02a===_0x1fa3a6,_0x286bb2=_0x10e7f2?_0x15250b(0xf0)+_0x271e24[_0x15250b(0xf3)]:_0x15250b(0xf1)+_0x271e24[_0x15250b(0xf3)];return a2_0x1ad7a1(Box,{'children':a2_0x1ad7a1(Text,{'color':_0x10e7f2?_0x15250b(0xee):undefined,'children':_0x286bb2})},_0x286bb2);})]});}
1
+ function a2_0x382a(_0x4544b5,_0x1c5554){_0x4544b5=_0x4544b5-0x1f0;const _0x301e36=a2_0x301e();let _0x382aa8=_0x301e36[_0x4544b5];return _0x382aa8;}(function(_0x18d8a6,_0x3514f3){const _0x5bf608=a2_0x382a,_0xac3dff=_0x18d8a6();while(!![]){try{const _0x6d7fb=-parseInt(_0x5bf608(0x1f0))/0x1+-parseInt(_0x5bf608(0x20c))/0x2+parseInt(_0x5bf608(0x20a))/0x3+parseInt(_0x5bf608(0x20f))/0x4*(-parseInt(_0x5bf608(0x1f6))/0x5)+-parseInt(_0x5bf608(0x207))/0x6*(-parseInt(_0x5bf608(0x206))/0x7)+parseInt(_0x5bf608(0x1fc))/0x8+parseInt(_0x5bf608(0x203))/0x9*(-parseInt(_0x5bf608(0x205))/0xa);if(_0x6d7fb===_0x3514f3)break;else _0xac3dff['push'](_0xac3dff['shift']());}catch(_0x2ab9e3){_0xac3dff['push'](_0xac3dff['shift']());}}}(a2_0x301e,0x1caba));import{jsx as a2_0x36cc34,jsxs as a2_0x494086}from'react/jsx-runtime';import{useState,useEffect}from'react';import{Text,Box,useInput}from'ink';import{readdir}from'node:fs/promises';import a2_0x4ef157 from'node:path';import{fileURLToPath}from'node:url';async function getTemplateList(){const _0x15442c=a2_0x382a;try{const _0x5c90a4=fileURLToPath(import.meta.url),_0x4f85d0=a2_0x4ef157[_0x15442c(0x1f8)](a2_0x4ef157[_0x15442c(0x1f7)](_0x5c90a4),'../..'),_0x3738b6=a2_0x4ef157[_0x15442c(0x20b)](_0x4f85d0,'templates/pages'),_0x2f23cc=await readdir(_0x3738b6,{'withFileTypes':!![]}),_0x3ef325=_0x2f23cc[_0x15442c(0x201)](_0x4ece46=>_0x4ece46[_0x15442c(0x209)]())[_0x15442c(0x202)](_0x3d40d2=>({'label':_0x3d40d2[_0x15442c(0x1ff)]}))[_0x15442c(0x20e)]((_0x39a885,_0xe9ccd0)=>_0x39a885[_0x15442c(0x210)][_0x15442c(0x204)](_0xe9ccd0['label']));return _0x3ef325;}catch(_0x5a7a1c){return console[_0x15442c(0x1f9)]('获取模板列表失败:',_0x5a7a1c),[{'label':_0x15442c(0x1f1)},{'label':_0x15442c(0x1fb)}];}}function a2_0x301e(){const _0x7b8ab6=['196801gtJXLy','blank','\x20Step1:\x20','green','正在加载页面模板...','length','573715caImQr','dirname','resolve','error','\x20\x20\x20\x20\x20\x20>\x20','sdk-fetch','1505352VWfxtO','upArrow','column','name','\x20\x20\x20\x20\x20\x20\x20\x20','filter','map','81EBNmPc','localeCompare','37340NtINEu','196AsSMqt','27954vBMXAR','downArrow','isDirectory','456105DXkvYB','join','16144rFVYrY','gray','sort','4ZYRREu','label'];a2_0x301e=function(){return _0x7b8ab6;};return a2_0x301e();}export function SelectPageTemplate(_0x2261d2){const _0x32ba42=a2_0x382a,[_0x37e744,_0x28cc68]=useState(0x0),[_0x598aa7,_0x248125]=useState([]),[_0x339fea,_0x593266]=useState(!![]);useEffect(()=>{async function _0x597dd9(){const _0x22a78e=await getTemplateList();_0x248125(_0x22a78e),_0x593266(![]);}_0x597dd9();},[]),useInput((_0x9906d9,_0x194c24)=>{const _0x38e7a2=a2_0x382a;if(_0x339fea)return;if(_0x194c24['return']){const _0x9e43e4=_0x598aa7[_0x37e744];_0x9e43e4&&_0x2261d2['onSelect'](_0x9e43e4['label']);}_0x194c24[_0x38e7a2(0x1fd)]&&_0x28cc68(_0x2f7bd8=>_0x2f7bd8===0x0?_0x598aa7[_0x38e7a2(0x1f5)]-0x1:_0x2f7bd8-0x1),_0x194c24[_0x38e7a2(0x208)]&&_0x28cc68(_0x23083c=>_0x23083c===_0x598aa7[_0x38e7a2(0x1f5)]-0x1?0x0:_0x23083c+0x1);});if(_0x339fea)return a2_0x36cc34(Box,{'flexDirection':_0x32ba42(0x1fe),'paddingY':0x1,'children':a2_0x494086(Box,{'children':[a2_0x36cc34(Text,{'color':_0x32ba42(0x20d),'children':_0x32ba42(0x1f2)}),a2_0x36cc34(Text,{'children':_0x32ba42(0x1f4)})]})});return a2_0x494086(Box,{'flexDirection':'column','paddingY':0x1,'children':[a2_0x494086(Box,{'children':[a2_0x36cc34(Text,{'color':_0x32ba42(0x20d),'children':_0x32ba42(0x1f2)}),a2_0x36cc34(Text,{'children':'请选择您要创建的页面模板'})]}),_0x598aa7[_0x32ba42(0x202)]((_0x1b3852,_0x4f420f)=>{const _0x44318b=_0x32ba42,_0x258a9e=_0x4f420f===_0x37e744,_0x317844=_0x258a9e?_0x44318b(0x1fa)+_0x1b3852['label']:_0x44318b(0x200)+_0x1b3852[_0x44318b(0x210)];return a2_0x36cc34(Box,{'children':a2_0x36cc34(Text,{'color':_0x258a9e?_0x44318b(0x1f3):undefined,'children':_0x317844})},_0x317844);})]});}
@@ -1 +1 @@
1
- (function(_0x4da37e,_0x4cb8de){const _0x3c6e92=a3_0x47da,_0x488704=_0x4da37e();while(!![]){try{const _0x47da60=-parseInt(_0x3c6e92(0x179))/0x1+-parseInt(_0x3c6e92(0x172))/0x2+parseInt(_0x3c6e92(0x174))/0x3*(-parseInt(_0x3c6e92(0x186))/0x4)+parseInt(_0x3c6e92(0x19a))/0x5*(parseInt(_0x3c6e92(0x176))/0x6)+parseInt(_0x3c6e92(0x18d))/0x7*(parseInt(_0x3c6e92(0x166))/0x8)+-parseInt(_0x3c6e92(0x18f))/0x9+-parseInt(_0x3c6e92(0x16e))/0xa*(-parseInt(_0x3c6e92(0x198))/0xb);if(_0x47da60===_0x4cb8de)break;else _0x488704['push'](_0x488704['shift']());}catch(_0x7ca084){_0x488704['push'](_0x488704['shift']());}}}(a3_0x1701,0xc9133));import{jsx as a3_0x509f6a,jsxs as a3_0x4a0583,Fragment as a3_0x3dc7ea}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';function a3_0x47da(_0x5b0882,_0x45b7c1){_0x5b0882=_0x5b0882-0x160;const _0x170196=a3_0x1701();let _0x47daa1=_0x170196[_0x5b0882];return _0x47daa1;}import{generateDatasetDocs}from'./api-doc.js';function a3_0x1701(){const _0x21710f=['./docs','cyan','cwd','文档生成失败:\x20','未提供应用AppCode,且配置中也没有默认值','column','message','\x20个数据集','332DeGXfm','正在获取数据集列表...','\x1b[33m!\x20以下数据集代码不存在:\x20','log','red','正在生成\x20','datasetCode','7XWFidF','online','4972167xfFftu','\x1b[0m','datasetName','💡\x20请使用\x20','文档生成完成','\x20个匹配的数据集\x1b[0m','setLogPath','lovrabet\x20auth','white','11MXCXtT','includes','935245DkrdxC','\x20(环境:\x20','join','\x20-\x20','success','length','gray','*\x20输出目录:\x20','1387192VhpcNH','green','\x20个数据集的文档...','yellow','*\x20生成的文档文件:','🚀\x20','dim','√\x20文档生成完成!成功\x20','28640120ogdjfq','\x20重新登录后再试','使用指定的应用AppCode:\x20','error','2184002EJCEAS','\x1b[90m*\x20从\x20','12642CEnWHQ','filePath','12SJiWBp','api-doc','filter','593680wAftxh','map','指定的数据集代码都不存在:\x20','使用配置的应用AppCode:\x20','⚠️\x20以下数据集生成失败:'];a3_0x1701=function(){return _0x21710f;};return a3_0x1701();}import{logger}from'../utils/logger.js';export const ApiDocUI=({appCode:_0x305179,env:_0x4cbce3,output:_0x2b7779,extraParams:_0x288f4a,datasetCodes:_0x3cf7b6})=>{const _0x382f83=a3_0x47da,{exit:_0x578176}=useApp(),[_0x31f342,_0x2013ba]=useState(![]),[_0x627c70,_0x227794]=useState(''),[_0x114c8a,_0x3679dc]=useState(![]),[_0x386800,_0x309466]=useState(null),[_0x42fba7,_0x40cb5c]=useState(null),[_0x5546b0,_0x4c597f]=useState(0x0),_0x785096=readConfig(),_0x3bdc8b=getConfigAppCode(),_0x28ff37=_0x305179||_0x3bdc8b,_0x3d9756=typeof _0x785096?.['env']==='string'?_0x785096['env']:undefined,_0x54df0a=_0x4cbce3||_0x3d9756||_0x382f83(0x18e);initEnv(_0x54df0a);const _0xee83a=_0x2b7779||_0x382f83(0x17e),_0x26334b=_0x305179?_0x382f83(0x170)+_0x28ff37:_0x382f83(0x17c)+_0x28ff37;useEffect(()=>{_0x2013ba(!![]),_0x18bf54();},[]),useEffect(()=>{(_0x114c8a||_0x386800)&&_0x578176();},[_0x114c8a,_0x386800,_0x578176]);async function _0x18bf54(){const _0x2f7bdf=_0x382f83;if(!_0x28ff37){_0x309466(_0x2f7bdf(0x182));return;}try{logger[_0x2f7bdf(0x195)](process[_0x2f7bdf(0x180)]()),_0x227794(_0x2f7bdf(0x187));const {configArray:_0x57f8e4}=await fetchModelList(_0x28ff37);_0x4c597f(_0x57f8e4['length']);if(_0x57f8e4[_0x2f7bdf(0x163)]===0x0){_0x309466('未找到任何数据集');return;}let _0x565a94=_0x57f8e4;if(_0x3cf7b6&&_0x3cf7b6[_0x2f7bdf(0x163)]>0x0){_0x565a94=_0x57f8e4[_0x2f7bdf(0x178)](_0x35d43d=>_0x3cf7b6[_0x2f7bdf(0x199)](_0x35d43d[_0x2f7bdf(0x18c)]));const _0x48761c=_0x565a94[_0x2f7bdf(0x17a)](_0x4fc837=>_0x4fc837[_0x2f7bdf(0x18c)]),_0x2ba17b=_0x3cf7b6['filter'](_0x3b0906=>!_0x48761c[_0x2f7bdf(0x199)](_0x3b0906));_0x2ba17b[_0x2f7bdf(0x163)]>0x0&&console[_0x2f7bdf(0x189)](_0x2f7bdf(0x188)+_0x2ba17b[_0x2f7bdf(0x160)](',\x20')+_0x2f7bdf(0x190));if(_0x565a94[_0x2f7bdf(0x163)]===0x0){_0x309466(_0x2f7bdf(0x17b)+_0x3cf7b6[_0x2f7bdf(0x160)](',\x20'));return;}console[_0x2f7bdf(0x189)](_0x2f7bdf(0x173)+_0x57f8e4[_0x2f7bdf(0x163)]+'\x20个数据集中筛选出\x20'+_0x565a94['length']+_0x2f7bdf(0x194));}_0x227794(_0x2f7bdf(0x18b)+_0x565a94[_0x2f7bdf(0x163)]+_0x2f7bdf(0x168));const _0x36b818=await generateDatasetDocs(_0x565a94,_0x28ff37,_0xee83a,(_0x2e176b,_0x56cb13,_0x5a9c6e)=>{const _0x425031=_0x2f7bdf;_0x227794(_0x425031(0x18b)+_0x5a9c6e+'.md\x20('+_0x2e176b+'/'+_0x56cb13+')');},_0x288f4a);_0x40cb5c(_0x36b818),_0x3679dc(!![]);const _0xd13e84=_0x36b818[_0x2f7bdf(0x178)](_0x42f129=>_0x42f129['success'])[_0x2f7bdf(0x163)],_0x144807=_0x36b818[_0x2f7bdf(0x178)](_0x33f1a5=>!_0x33f1a5['success'])[_0x2f7bdf(0x163)];logger[_0x2f7bdf(0x162)](_0x2f7bdf(0x177),_0x2f7bdf(0x193),undefined,{'totalCount':_0x36b818[_0x2f7bdf(0x163)],'successCount':_0xd13e84,'failCount':_0x144807,'outputDir':_0xee83a});}catch(_0x485f35){const _0x3aec49=_0x485f35 instanceof Error?_0x485f35[_0x2f7bdf(0x184)]:String(_0x485f35);logger[_0x2f7bdf(0x171)]('api-doc',_0x2f7bdf(0x181)+_0x3aec49,{'appCode':_0x28ff37,'outputDir':_0xee83a}),_0x309466(_0x2f7bdf(0x181)+_0x3aec49);}finally{_0x2013ba(![]);}}const _0x2aa961=_0x42fba7?.[_0x382f83(0x178)](_0x4182af=>_0x4182af['success'])['length']||0x0,_0x44192b=_0x42fba7?.[_0x382f83(0x178)](_0x1acc5e=>!_0x1acc5e['success'])[_0x382f83(0x163)]||0x0;return a3_0x4a0583(Box,{'flexDirection':_0x382f83(0x183),'children':[(_0x31f342||_0x114c8a)&&a3_0x4a0583(Box,{'children':[a3_0x509f6a(Text,{'color':_0x382f83(0x164),'children':'*\x20'}),a3_0x509f6a(Text,{'color':_0x305179?_0x382f83(0x197):_0x382f83(0x16c),'children':_0x26334b})]}),_0x31f342&&a3_0x509f6a(Box,{'children':a3_0x4a0583(Text,{'children':[_0x382f83(0x16b),_0x627c70,_0x382f83(0x19b),_0x54df0a,')']})}),_0x114c8a&&_0x42fba7&&a3_0x4a0583(Box,{'flexDirection':_0x382f83(0x183),'children':[a3_0x509f6a(Box,{'children':a3_0x4a0583(Text,{'color':_0x382f83(0x167),'children':[_0x382f83(0x16d),_0x2aa961,'\x20个',_0x44192b>0x0&&',\x20失败\x20'+_0x44192b+'\x20个']})}),a3_0x509f6a(Box,{'marginTop':0x1,'children':a3_0x4a0583(Text,{'color':'gray','children':['*\x20共处理\x20',_0x5546b0,_0x382f83(0x185)]})}),a3_0x4a0583(Box,{'marginTop':0x1,'children':[a3_0x509f6a(Text,{'color':_0x382f83(0x164),'children':_0x382f83(0x165)}),a3_0x509f6a(Text,{'color':_0x382f83(0x17f),'children':_0xee83a})]}),_0x2aa961>0x0&&a3_0x4a0583(a3_0x3dc7ea,{'children':[a3_0x509f6a(Box,{'marginTop':0x1,'children':a3_0x509f6a(Text,{'color':_0x382f83(0x164),'children':_0x382f83(0x16a)})}),_0x42fba7[_0x382f83(0x178)](_0x20ac01=>_0x20ac01[_0x382f83(0x162)])[_0x382f83(0x17a)]((_0x11eb5b,_0x165c16)=>a3_0x4a0583(Box,{'marginLeft':0x2,'children':[a3_0x4a0583(Text,{'color':'cyan','children':['•\x20',_0x11eb5b[_0x382f83(0x175)]]}),a3_0x4a0583(Text,{'color':_0x382f83(0x16c),'children':[_0x382f83(0x161),_0x11eb5b['datasetName']]})]},_0x165c16))]}),_0x44192b>0x0&&a3_0x4a0583(a3_0x3dc7ea,{'children':[a3_0x509f6a(Box,{'marginTop':0x1,'children':a3_0x509f6a(Text,{'color':_0x382f83(0x169),'children':_0x382f83(0x17d)})}),_0x42fba7[_0x382f83(0x178)](_0x2034b0=>!_0x2034b0[_0x382f83(0x162)])['map']((_0x220f70,_0x16536f)=>a3_0x4a0583(Box,{'marginLeft':0x2,'flexDirection':_0x382f83(0x183),'children':[a3_0x4a0583(Text,{'color':_0x382f83(0x18a),'children':['•\x20',_0x220f70[_0x382f83(0x191)],'\x20(',_0x220f70[_0x382f83(0x18c)],')']}),_0x220f70['error']&&a3_0x509f6a(Box,{'marginLeft':0x2,'children':a3_0x509f6a(Text,{'color':'dim','children':_0x220f70[_0x382f83(0x171)]})})]},_0x16536f))]})]}),_0x386800&&a3_0x4a0583(Box,{'flexDirection':'column','children':[a3_0x509f6a(Box,{'children':a3_0x4a0583(Text,{'color':_0x382f83(0x18a),'children':['❌\x20',_0x386800]})}),_0x386800[_0x382f83(0x199)]('登录')&&a3_0x4a0583(Box,{'marginTop':0x1,'children':[a3_0x509f6a(Text,{'color':_0x382f83(0x169),'children':_0x382f83(0x192)}),a3_0x509f6a(Text,{'color':_0x382f83(0x17f),'children':_0x382f83(0x196)}),a3_0x509f6a(Text,{'color':_0x382f83(0x169),'children':_0x382f83(0x16f)})]})]})]});};
1
+ (function(_0x437a77,_0x38d0ec){const _0x1dd06e=a3_0x276a,_0x58f70f=_0x437a77();while(!![]){try{const _0x3b5220=parseInt(_0x1dd06e(0xe0))/0x1+parseInt(_0x1dd06e(0xb6))/0x2+parseInt(_0x1dd06e(0xe4))/0x3*(parseInt(_0x1dd06e(0xe7))/0x4)+-parseInt(_0x1dd06e(0xb4))/0x5*(parseInt(_0x1dd06e(0xe2))/0x6)+-parseInt(_0x1dd06e(0xcb))/0x7*(-parseInt(_0x1dd06e(0xb2))/0x8)+-parseInt(_0x1dd06e(0xb9))/0x9*(parseInt(_0x1dd06e(0xca))/0xa)+-parseInt(_0x1dd06e(0xdd))/0xb*(parseInt(_0x1dd06e(0xe9))/0xc);if(_0x3b5220===_0x38d0ec)break;else _0x58f70f['push'](_0x58f70f['shift']());}catch(_0x383063){_0x58f70f['push'](_0x58f70f['shift']());}}}(a3_0x2b69,0x26e21));import{jsx as a3_0x16eadc,jsxs as a3_0x525331,Fragment as a3_0x5a7847}from'react/jsx-runtime';function a3_0x2b69(){const _0x152496=['log','\x20个匹配的数据集\x1b[0m','589699bZogKC','文档生成完成','map','112003nhAAhq',',\x20失败\x20','48kAFWBD','column','6mdbhpV','api-doc','cyan','385772WEHWBk','setLogPath','12HYKoTf','💡\x20请使用\x20','\x20个数据集中筛选出\x20','join','\x1b[33m!\x20以下数据集代码不存在:\x20','8SQzkkc','cwd','146915sOTMbp','*\x20输出目录:\x20','200426jjSEBC','gray','white','261qyarQo','使用配置的应用AppCode:\x20','filter','使用指定的应用AppCode:\x20','√\x20文档生成完成!成功\x20','filePath','.md\x20(','string','未提供应用AppCode,且配置中也没有默认值','message','\x20个数据集','\x20(环境:\x20','dim','\x1b[0m','\x1b[90m*\x20从\x20','./docs','未找到任何数据集','34130DVXfTC','992691XIpaGn','lovrabet\x20auth','正在生成\x20','length','\x20-\x20','yellow','datasetName','文档生成失败:\x20','datasetCode','success','*\x20共处理\x20','*\x20生成的文档文件:','指定的数据集代码都不存在:\x20','error','includes','🚀\x20'];a3_0x2b69=function(){return _0x152496;};return a3_0x2b69();}import{useEffect,useState}from'react';import{Box,Text,useApp}from'ink';import{readConfig,getConfigAppCode}from'../utils/config.js';import{initEnv}from'../constant/env.js';import{fetchModelList}from'./fetch-model-list.js';function a3_0x276a(_0x15c36c,_0x3c3167){_0x15c36c=_0x15c36c-0xb1;const _0x2b6979=a3_0x2b69();let _0x276a4d=_0x2b6979[_0x15c36c];return _0x276a4d;}import{generateDatasetDocs}from'./api-doc.js';import{logger}from'../utils/logger.js';export const ApiDocUI=({appCode:_0x4af946,env:_0x230091,output:_0x29c5ac,extraParams:_0x5329e1,datasetCodes:_0x2a2dba})=>{const _0x5b1ef4=a3_0x276a,{exit:_0x46fc66}=useApp(),[_0x2d9152,_0x22a36e]=useState(![]),[_0x3bb0b3,_0x49c44e]=useState(''),[_0x485e0e,_0x3f5cef]=useState(![]),[_0x3a4aeb,_0xaa03f2]=useState(null),[_0x29180a,_0x27580f]=useState(null),[_0x1ce184,_0x3955c8]=useState(0x0),_0x5a7757=readConfig(),_0x45c7bf=getConfigAppCode(),_0x5153a5=_0x4af946||_0x45c7bf,_0x261518=typeof _0x5a7757?.['env']===_0x5b1ef4(0xc0)?_0x5a7757['env']:undefined,_0x336cff=_0x230091||_0x261518||'online';initEnv(_0x336cff);const _0x5171a7=_0x29c5ac||_0x5b1ef4(0xc8),_0x3ddb0d=_0x4af946?_0x5b1ef4(0xbc)+_0x5153a5:_0x5b1ef4(0xba)+_0x5153a5;useEffect(()=>{_0x22a36e(!![]),_0xf0b53b();},[]),useEffect(()=>{(_0x485e0e||_0x3a4aeb)&&_0x46fc66();},[_0x485e0e,_0x3a4aeb,_0x46fc66]);async function _0xf0b53b(){const _0x189944=_0x5b1ef4;if(!_0x5153a5){_0xaa03f2(_0x189944(0xc1));return;}try{logger[_0x189944(0xe8)](process[_0x189944(0xb3)]()),_0x49c44e('正在获取数据集列表...');const {configArray:_0x3cbd95}=await fetchModelList(_0x5153a5);_0x3955c8(_0x3cbd95[_0x189944(0xce)]);if(_0x3cbd95[_0x189944(0xce)]===0x0){_0xaa03f2(_0x189944(0xc9));return;}let _0x4c383d=_0x3cbd95;if(_0x2a2dba&&_0x2a2dba[_0x189944(0xce)]>0x0){_0x4c383d=_0x3cbd95[_0x189944(0xbb)](_0x477d90=>_0x2a2dba[_0x189944(0xd9)](_0x477d90[_0x189944(0xd3)]));const _0x7db333=_0x4c383d[_0x189944(0xdf)](_0x30b0ff=>_0x30b0ff[_0x189944(0xd3)]),_0x2fce1b=_0x2a2dba[_0x189944(0xbb)](_0xb791bd=>!_0x7db333[_0x189944(0xd9)](_0xb791bd));_0x2fce1b[_0x189944(0xce)]>0x0&&console['log'](_0x189944(0xb1)+_0x2fce1b['join'](',\x20')+_0x189944(0xc6));if(_0x4c383d[_0x189944(0xce)]===0x0){_0xaa03f2(_0x189944(0xd7)+_0x2a2dba[_0x189944(0xec)](',\x20'));return;}console[_0x189944(0xdb)](_0x189944(0xc7)+_0x3cbd95[_0x189944(0xce)]+_0x189944(0xeb)+_0x4c383d[_0x189944(0xce)]+_0x189944(0xdc));}_0x49c44e(_0x189944(0xcd)+_0x4c383d[_0x189944(0xce)]+'\x20个数据集的文档...');const _0x98d50b=await generateDatasetDocs(_0x4c383d,_0x5153a5,_0x5171a7,(_0x4c8087,_0x253201,_0x56c12b)=>{const _0x381bf8=_0x189944;_0x49c44e(_0x381bf8(0xcd)+_0x56c12b+_0x381bf8(0xbf)+_0x4c8087+'/'+_0x253201+')');},_0x5329e1);_0x27580f(_0x98d50b),_0x3f5cef(!![]);const _0x12f57b=_0x98d50b[_0x189944(0xbb)](_0x10ce46=>_0x10ce46['success'])[_0x189944(0xce)],_0x2713a9=_0x98d50b['filter'](_0x2aa44a=>!_0x2aa44a[_0x189944(0xd4)])['length'];logger[_0x189944(0xd4)](_0x189944(0xe5),_0x189944(0xde),undefined,{'totalCount':_0x98d50b[_0x189944(0xce)],'successCount':_0x12f57b,'failCount':_0x2713a9,'outputDir':_0x5171a7});}catch(_0x2d7f73){const _0x13d76f=_0x2d7f73 instanceof Error?_0x2d7f73[_0x189944(0xc2)]:String(_0x2d7f73);logger[_0x189944(0xd8)](_0x189944(0xe5),_0x189944(0xd2)+_0x13d76f,{'appCode':_0x5153a5,'outputDir':_0x5171a7}),_0xaa03f2(_0x189944(0xd2)+_0x13d76f);}finally{_0x22a36e(![]);}}const _0x4ffb46=_0x29180a?.[_0x5b1ef4(0xbb)](_0x818cb9=>_0x818cb9['success'])['length']||0x0,_0x2ad7fe=_0x29180a?.[_0x5b1ef4(0xbb)](_0x5eef8c=>!_0x5eef8c[_0x5b1ef4(0xd4)])['length']||0x0;return a3_0x525331(Box,{'flexDirection':_0x5b1ef4(0xe3),'children':[(_0x2d9152||_0x485e0e)&&a3_0x525331(Box,{'children':[a3_0x16eadc(Text,{'color':_0x5b1ef4(0xb7),'children':'*\x20'}),a3_0x16eadc(Text,{'color':_0x4af946?_0x5b1ef4(0xb8):_0x5b1ef4(0xc5),'children':_0x3ddb0d})]}),_0x2d9152&&a3_0x16eadc(Box,{'children':a3_0x525331(Text,{'children':[_0x5b1ef4(0xda),_0x3bb0b3,_0x5b1ef4(0xc4),_0x336cff,')']})}),_0x485e0e&&_0x29180a&&a3_0x525331(Box,{'flexDirection':_0x5b1ef4(0xe3),'children':[a3_0x16eadc(Box,{'children':a3_0x525331(Text,{'color':'green','children':[_0x5b1ef4(0xbd),_0x4ffb46,'\x20个',_0x2ad7fe>0x0&&_0x5b1ef4(0xe1)+_0x2ad7fe+'\x20个']})}),a3_0x16eadc(Box,{'marginTop':0x1,'children':a3_0x525331(Text,{'color':_0x5b1ef4(0xb7),'children':[_0x5b1ef4(0xd5),_0x1ce184,_0x5b1ef4(0xc3)]})}),a3_0x525331(Box,{'marginTop':0x1,'children':[a3_0x16eadc(Text,{'color':'gray','children':_0x5b1ef4(0xb5)}),a3_0x16eadc(Text,{'color':_0x5b1ef4(0xe6),'children':_0x5171a7})]}),_0x4ffb46>0x0&&a3_0x525331(a3_0x5a7847,{'children':[a3_0x16eadc(Box,{'marginTop':0x1,'children':a3_0x16eadc(Text,{'color':_0x5b1ef4(0xb7),'children':_0x5b1ef4(0xd6)})}),_0x29180a['filter'](_0x189663=>_0x189663[_0x5b1ef4(0xd4)])[_0x5b1ef4(0xdf)]((_0x249e6b,_0x69a65)=>a3_0x525331(Box,{'marginLeft':0x2,'children':[a3_0x525331(Text,{'color':_0x5b1ef4(0xe6),'children':['•\x20',_0x249e6b[_0x5b1ef4(0xbe)]]}),a3_0x525331(Text,{'color':_0x5b1ef4(0xc5),'children':[_0x5b1ef4(0xcf),_0x249e6b[_0x5b1ef4(0xd1)]]})]},_0x69a65))]}),_0x2ad7fe>0x0&&a3_0x525331(a3_0x5a7847,{'children':[a3_0x16eadc(Box,{'marginTop':0x1,'children':a3_0x16eadc(Text,{'color':_0x5b1ef4(0xd0),'children':'⚠️\x20以下数据集生成失败:'})}),_0x29180a['filter'](_0x24f49d=>!_0x24f49d[_0x5b1ef4(0xd4)])[_0x5b1ef4(0xdf)]((_0x8ea86e,_0x4353e1)=>a3_0x525331(Box,{'marginLeft':0x2,'flexDirection':_0x5b1ef4(0xe3),'children':[a3_0x525331(Text,{'color':'red','children':['•\x20',_0x8ea86e[_0x5b1ef4(0xd1)],'\x20(',_0x8ea86e[_0x5b1ef4(0xd3)],')']}),_0x8ea86e[_0x5b1ef4(0xd8)]&&a3_0x16eadc(Box,{'marginLeft':0x2,'children':a3_0x16eadc(Text,{'color':_0x5b1ef4(0xc5),'children':_0x8ea86e[_0x5b1ef4(0xd8)]})})]},_0x4353e1))]})]}),_0x3a4aeb&&a3_0x525331(Box,{'flexDirection':_0x5b1ef4(0xe3),'children':[a3_0x16eadc(Box,{'children':a3_0x525331(Text,{'color':'red','children':['❌\x20',_0x3a4aeb]})}),_0x3a4aeb[_0x5b1ef4(0xd9)]('登录')&&a3_0x525331(Box,{'marginTop':0x1,'children':[a3_0x16eadc(Text,{'color':_0x5b1ef4(0xd0),'children':_0x5b1ef4(0xea)}),a3_0x16eadc(Text,{'color':_0x5b1ef4(0xe6),'children':_0x5b1ef4(0xcc)}),a3_0x16eadc(Text,{'color':_0x5b1ef4(0xd0),'children':'\x20重新登录后再试'})]})]})]});};
@@ -1 +1 @@
1
- const a4_0x2f87cd=a4_0x3554;(function(_0x1ed4e7,_0x30c2d8){const _0x176767=a4_0x3554,_0x3c6bdb=_0x1ed4e7();while(!![]){try{const _0xa3951a=parseInt(_0x176767(0x99))/0x1*(parseInt(_0x176767(0x9e))/0x2)+-parseInt(_0x176767(0x93))/0x3*(parseInt(_0x176767(0x91))/0x4)+parseInt(_0x176767(0x8f))/0x5+parseInt(_0x176767(0x88))/0x6*(-parseInt(_0x176767(0x7f))/0x7)+parseInt(_0x176767(0x7c))/0x8+-parseInt(_0x176767(0x9d))/0x9*(-parseInt(_0x176767(0x86))/0xa)+-parseInt(_0x176767(0x7a))/0xb*(parseInt(_0x176767(0x80))/0xc);if(_0xa3951a===_0x30c2d8)break;else _0x3c6bdb['push'](_0x3c6bdb['shift']());}catch(_0x543916){_0x3c6bdb['push'](_0x3c6bdb['shift']());}}}(a4_0x3934,0xa0ccb));import{mkdirSync,writeFileSync}from'node:fs';import a4_0x5befce from'node:path';import{getCookie}from'../auth/get-cookie.js';function a4_0x3554(_0x2642a5,_0x5af38a){_0x2642a5=_0x2642a5-0x76;const _0x39346b=a4_0x3934();let _0x3554d2=_0x39346b[_0x2642a5];return _0x3554d2;}import{getApiDomain}from'../constant/domain.js';import{logger}from'../utils/logger.js';export async function fetchDatasetDoc(_0xa2c3e0){const _0x2c0738=a4_0x3554,{appCode:_0x3446c1,datasetCode:_0x5ba858,datasetId:_0x96133,extraParams:_0x3519e7}=_0xa2c3e0,_0x1f1265=getApiDomain(),_0x29f768=_0x1f1265+_0x2c0738(0x7b),_0x5d3a26={'appCode':_0x3446c1,'datasetCode':_0x5ba858,'datasetId':_0x96133,..._0x3519e7||{}},_0x2c65c9=await fetch(_0x29f768,{'method':_0x2c0738(0x8c),'headers':{'Content-Type':'application/json','Cookie':getCookie()},'body':JSON[_0x2c0738(0x7e)](_0x5d3a26)});if(!_0x2c65c9['ok']){if(_0x2c65c9[_0x2c0738(0x81)]===0x191)throw new Error(_0x2c0738(0x89));let _0x49c259='';try{_0x49c259=await _0x2c65c9[_0x2c0738(0x84)]();}catch(_0x3ffc33){}throw new Error(_0x2c0738(0x85)+_0x5ba858+'),HTTP状态码:\x20'+_0x2c65c9[_0x2c0738(0x81)]+(_0x49c259?'\x0a'+_0x49c259:''));}const _0x467753=await _0x2c65c9['json']();if(!_0x467753[_0x2c0738(0x8a)]||typeof _0x467753[_0x2c0738(0x8a)][_0x2c0738(0x8e)]!==_0x2c0738(0x78))throw new Error('响应数据格式错误\x20('+_0x5ba858+'):缺少\x20data.markdown\x20字段');return _0x467753[_0x2c0738(0x8a)][_0x2c0738(0x8e)];}function delay(_0x2d4c60){return new Promise(_0x240061=>setTimeout(_0x240061,_0x2d4c60));}export async function generateDatasetDocs(_0x5a1099,_0x1d7471,_0x15ed7f=a4_0x2f87cd(0x9a),_0x453c10,_0x4890c3){const _0x6e9a98=a4_0x2f87cd;mkdirSync(_0x15ed7f,{'recursive':!![]});const _0x2a2cd2=[],_0x54675c=_0x5a1099[_0x6e9a98(0x79)];console[_0x6e9a98(0x98)](_0x6e9a98(0x87)+_0x54675c+_0x6e9a98(0xa1));for(let _0x29b694=0x0;_0x29b694<_0x5a1099[_0x6e9a98(0x79)];_0x29b694++){const _0x3570e5=_0x5a1099[_0x29b694],_0x560618=_0x29b694+0x1,_0x1f9112=_0x3570e5[_0x6e9a98(0xa0)];try{console[_0x6e9a98(0x98)]('['+_0x560618+'/'+_0x54675c+_0x6e9a98(0x95)+_0x1f9112+_0x6e9a98(0x8b)+_0x3570e5[_0x6e9a98(0x7d)]+')');_0x453c10&&_0x453c10(_0x560618,_0x54675c,_0x1f9112);const _0xc4d1c7=await fetchDatasetDoc({'appCode':_0x1d7471,'datasetCode':_0x3570e5[_0x6e9a98(0xa2)],'datasetId':_0x3570e5['id'],'enableAI':![],'extraParams':_0x4890c3}),_0x52db75=a4_0x5befce[_0x6e9a98(0x76)](_0x15ed7f,_0x1f9112+_0x6e9a98(0x9b));writeFileSync(_0x52db75,_0xc4d1c7,{'encoding':_0x6e9a98(0x9c)}),console['log'](_0x6e9a98(0x9f)+_0x1f9112+'.md'),logger[_0x6e9a98(0x92)](_0x6e9a98(0x97),_0x6e9a98(0x83)+_0x1f9112,undefined,{'datasetCode':_0x3570e5[_0x6e9a98(0xa2)],'datasetName':_0x3570e5['name'],'filePath':_0x52db75,'progress':_0x560618+'/'+_0x54675c}),_0x2a2cd2['push']({'datasetCode':_0x3570e5['datasetCode'],'datasetName':_0x3570e5[_0x6e9a98(0x7d)],'filePath':_0x52db75,'success':!![]}),_0x560618<_0x54675c&&await delay(0x1388);}catch(_0x10931f){const _0x9cc224=_0x10931f instanceof Error?_0x10931f[_0x6e9a98(0xa3)]:String(_0x10931f);console[_0x6e9a98(0x98)](_0x6e9a98(0x77)+_0x1f9112+_0x6e9a98(0x94)+_0x9cc224+'\x0a'),logger[_0x6e9a98(0x90)]('api-doc',_0x6e9a98(0x96)+_0x3570e5[_0x6e9a98(0xa2)],{'datasetCode':_0x3570e5['datasetCode'],'datasetName':_0x3570e5[_0x6e9a98(0x7d)],'error':_0x9cc224,'progress':_0x560618+'/'+_0x54675c}),_0x2a2cd2[_0x6e9a98(0x8d)]({'datasetCode':_0x3570e5[_0x6e9a98(0xa2)],'datasetName':_0x3570e5['name'],'filePath':'','success':![],'error':_0x9cc224}),_0x560618<_0x54675c&&(console['log'](_0x6e9a98(0x82)),await delay(0xbb8));}}return _0x2a2cd2;}function a4_0x3934(){const _0xe4e6b=['796426uYigAA','✓\x20成功生成:\x20','tableName','\x20个数据集需要生成文档\x0a','datasetCode','message','join','✗\x20失败:\x20','string','length','88BwtQUe','/api/node-toolbox/api-doc-generator','9700128delArX','name','stringify','3409lmWjHw','296268gedCCv','status','等待\x203\x20秒...\x0a','生成文档成功:\x20','text','获取文档失败\x20(','10TnBDRl','\x0a共有\x20','11856ikMeTH','登录鉴权失败,登录已过期,请使用\x20lovrabet\x20auth\x20重新登录','data','.md\x20(','POST','push','markdown','2438850jhtjIk','error','26916akZnXt','success','435eSavzR','.md\x20-\x20',']\x20正在生成:\x20','生成文档失败:\x20','api-doc','log','1UVgFkI','./docs','.md','utf8','6260985VZfuwB'];a4_0x3934=function(){return _0xe4e6b;};return a4_0x3934();}
1
+ function a4_0x4ff9(){const _0x174f3f=['登录鉴权失败,登录已过期,请使用\x20lovrabet\x20auth\x20重新登录','40995xHXguY','5614085DIvyju','.md','530KjsXzB','name','datasetCode','POST','data','markdown','6VNeBhq','✓\x20成功生成:\x20','4501488jSkAbv','获取文档失败\x20(','stringify','.md\x20(','log','string','生成文档成功:\x20','json','253588ibWkvq','join','length','\x20个数据集需要生成文档\x0a','5936612zPanme','✗\x20失败:\x20','status','/api/node-toolbox/api-doc-generator','1281wfuivU','等待\x203\x20秒...\x0a','push','api-doc','19320COyUCT','4cvbJsw','message',']\x20正在生成:\x20','437331uHbQkI','15QvKwsC','./docs','):缺少\x20data.markdown\x20字段'];a4_0x4ff9=function(){return _0x174f3f;};return a4_0x4ff9();}const a4_0x5c3066=a4_0x26a5;(function(_0x2495c1,_0x42b1d6){const _0xdde389=a4_0x26a5,_0x5cf4de=_0x2495c1();while(!![]){try{const _0xef80b3=-parseInt(_0xdde389(0x80))/0x1*(parseInt(_0xdde389(0x7d))/0x2)+-parseInt(_0xdde389(0x81))/0x3*(-parseInt(_0xdde389(0x70))/0x4)+-parseInt(_0xdde389(0x86))/0x5*(-parseInt(_0xdde389(0x8e))/0x6)+parseInt(_0xdde389(0x78))/0x7*(parseInt(_0xdde389(0x7c))/0x8)+-parseInt(_0xdde389(0x85))/0x9*(parseInt(_0xdde389(0x88))/0xa)+-parseInt(_0xdde389(0x74))/0xb+parseInt(_0xdde389(0x90))/0xc;if(_0xef80b3===_0x42b1d6)break;else _0x5cf4de['push'](_0x5cf4de['shift']());}catch(_0x31061f){_0x5cf4de['push'](_0x5cf4de['shift']());}}}(a4_0x4ff9,0x92c0e));import{mkdirSync,writeFileSync}from'node:fs';import a4_0x347b94 from'node:path';import{getCookie}from'../auth/get-cookie.js';function a4_0x26a5(_0x2575a9,_0x18f3e4){_0x2575a9=_0x2575a9-0x70;const _0x4ff9c3=a4_0x4ff9();let _0x26a5f0=_0x4ff9c3[_0x2575a9];return _0x26a5f0;}import{getApiDomain}from'../constant/domain.js';import{logger}from'../utils/logger.js';export async function fetchDatasetDoc(_0x5d9c5e){const _0x3322d7=a4_0x26a5,{appCode:_0x101467,datasetCode:_0xa0ecea,datasetId:_0x2e8780,extraParams:_0x1b468a}=_0x5d9c5e,_0x3a1872=getApiDomain(),_0x2dd786=_0x3a1872+_0x3322d7(0x77),_0x13d014={'appCode':_0x101467,'datasetCode':_0xa0ecea,'datasetId':_0x2e8780,..._0x1b468a||{}},_0x5947cf=await fetch(_0x2dd786,{'method':_0x3322d7(0x8b),'headers':{'Content-Type':'application/json','Cookie':getCookie()},'body':JSON[_0x3322d7(0x92)](_0x13d014)});if(!_0x5947cf['ok']){if(_0x5947cf[_0x3322d7(0x76)]===0x191)throw new Error(_0x3322d7(0x84));let _0x96d280='';try{_0x96d280=await _0x5947cf['text']();}catch(_0x3cb91d){}throw new Error(_0x3322d7(0x91)+_0xa0ecea+'),HTTP状态码:\x20'+_0x5947cf[_0x3322d7(0x76)]+(_0x96d280?'\x0a'+_0x96d280:''));}const _0x6074ea=await _0x5947cf[_0x3322d7(0x97)]();if(!_0x6074ea[_0x3322d7(0x8c)]||typeof _0x6074ea[_0x3322d7(0x8c)][_0x3322d7(0x8d)]!==_0x3322d7(0x95))throw new Error('响应数据格式错误\x20('+_0xa0ecea+_0x3322d7(0x83));return _0x6074ea['data']['markdown'];}function delay(_0x503e9e){return new Promise(_0x17a383=>setTimeout(_0x17a383,_0x503e9e));}export async function generateDatasetDocs(_0x204cee,_0xcacbae,_0x1fcb58=a4_0x5c3066(0x82),_0x46a778,_0x1fff1f){const _0x2557b4=a4_0x5c3066;mkdirSync(_0x1fcb58,{'recursive':!![]});const _0x2e6d54=[],_0x5837a6=_0x204cee[_0x2557b4(0x72)];console[_0x2557b4(0x94)]('\x0a共有\x20'+_0x5837a6+_0x2557b4(0x73));for(let _0x22a1f1=0x0;_0x22a1f1<_0x204cee[_0x2557b4(0x72)];_0x22a1f1++){const _0x23d793=_0x204cee[_0x22a1f1],_0x16330a=_0x22a1f1+0x1,_0x1f96e9=_0x23d793['tableName'];try{console[_0x2557b4(0x94)]('['+_0x16330a+'/'+_0x5837a6+_0x2557b4(0x7f)+_0x1f96e9+_0x2557b4(0x93)+_0x23d793[_0x2557b4(0x89)]+')');_0x46a778&&_0x46a778(_0x16330a,_0x5837a6,_0x1f96e9);const _0x3b4820=await fetchDatasetDoc({'appCode':_0xcacbae,'datasetCode':_0x23d793[_0x2557b4(0x8a)],'datasetId':_0x23d793['id'],'enableAI':![],'extraParams':_0x1fff1f}),_0x116e46=a4_0x347b94[_0x2557b4(0x71)](_0x1fcb58,_0x1f96e9+'.md');writeFileSync(_0x116e46,_0x3b4820,{'encoding':'utf8'}),console[_0x2557b4(0x94)](_0x2557b4(0x8f)+_0x1f96e9+_0x2557b4(0x87)),logger['success']('api-doc',_0x2557b4(0x96)+_0x1f96e9,undefined,{'datasetCode':_0x23d793['datasetCode'],'datasetName':_0x23d793[_0x2557b4(0x89)],'filePath':_0x116e46,'progress':_0x16330a+'/'+_0x5837a6}),_0x2e6d54[_0x2557b4(0x7a)]({'datasetCode':_0x23d793['datasetCode'],'datasetName':_0x23d793[_0x2557b4(0x89)],'filePath':_0x116e46,'success':!![]}),_0x16330a<_0x5837a6&&await delay(0x1388);}catch(_0x40408a){const _0x57e163=_0x40408a instanceof Error?_0x40408a[_0x2557b4(0x7e)]:String(_0x40408a);console['log'](_0x2557b4(0x75)+_0x1f96e9+'.md\x20-\x20'+_0x57e163+'\x0a'),logger['error'](_0x2557b4(0x7b),'生成文档失败:\x20'+_0x23d793[_0x2557b4(0x8a)],{'datasetCode':_0x23d793[_0x2557b4(0x8a)],'datasetName':_0x23d793[_0x2557b4(0x89)],'error':_0x57e163,'progress':_0x16330a+'/'+_0x5837a6}),_0x2e6d54[_0x2557b4(0x7a)]({'datasetCode':_0x23d793[_0x2557b4(0x8a)],'datasetName':_0x23d793[_0x2557b4(0x89)],'filePath':'','success':![],'error':_0x57e163}),_0x16330a<_0x5837a6&&(console['log'](_0x2557b4(0x79)),await delay(0xbb8));}}return _0x2e6d54;}
@@ -1 +1 @@
1
- function a5_0x1d47(_0x1b86fb,_0x283a68){_0x1b86fb=_0x1b86fb-0x1b7;const _0x150636=a5_0x1506();let _0x1d4711=_0x150636[_0x1b86fb];return _0x1d4711;}(function(_0x1a4c3b,_0x1e8112){const _0x2834d2=a5_0x1d47,_0x4bb38d=_0x1a4c3b();while(!![]){try{const _0x374771=parseInt(_0x2834d2(0x1e8))/0x1+-parseInt(_0x2834d2(0x1e0))/0x2*(-parseInt(_0x2834d2(0x1c9))/0x3)+parseInt(_0x2834d2(0x1bd))/0x4+parseInt(_0x2834d2(0x1b8))/0x5*(-parseInt(_0x2834d2(0x1d5))/0x6)+parseInt(_0x2834d2(0x1c2))/0x7+parseInt(_0x2834d2(0x1ed))/0x8+-parseInt(_0x2834d2(0x1ea))/0x9*(parseInt(_0x2834d2(0x1d3))/0xa);if(_0x374771===_0x1e8112)break;else _0x4bb38d['push'](_0x4bb38d['shift']());}catch(_0x4e3ada){_0x4bb38d['push'](_0x4bb38d['shift']());}}}(a5_0x1506,0x7a816));import{jsx as a5_0x50ae97,jsxs as a5_0x5337fc}from'react/jsx-runtime';import{useEffect,useState}from'react';function a5_0x1506(){const _0x2f961b=['client','originalCount','拉取\x20API\x20配置失败:\x20','api-pull','6TKAwuN','string','green','-client','length','duplicateCount','*\x20导入方式:','\x20个模型','lovrabet\x20auth','replace','10IkDeYA','\x20个模型)','164244tlSFMO','gray','import\x20','\x20重新登录后再试','cyan','√\x20成功拉取\x20','datasetCount','setLogPath','*\x20已生成文件:','env','api','267724lUlFfJ','red','\x20-\x20客户端实例文件','dim','column','.ts','-\x20模型配置文件\x20(','endsWith','666175vzFdsR','join','11755323HvvXKF','使用指定的应用AppCode:\x20','\x20个,过滤重复','734400oKprvX','modelCount','{\x20lovrabetClient\x20}','white','\x20个数据集,生成','5LIeFxZ','./src/api/','online','未提供应用AppCode,且配置中也没有默认值','使用配置的应用AppCode:\x20','1286616WaYKFL','🚀\x20正在从服务器拉取\x20API\x20配置...\x20(环境:\x20','!\x20原始数据集\x20','includes','message','3415650jVIKKd','error','split'];a5_0x1506=function(){return _0x2f961b;};return a5_0x1506();}import{Box,Text,useApp}from'ink';import{readConfig,getConfigAppCode}from'../utils/config.js';import{initEnv}from'../constant/env.js';import{generateApiFile}from'./generate-api-file.js';import{logger}from'../utils/logger.js';import{fetchModelList}from'./fetch-model-list.js';export const ApiPullUI=({appCode:_0x4d6d78,env:_0x4d648b,output:_0x1b4f25})=>{const _0x1d8e1f=a5_0x1d47,{exit:_0xe131a3}=useApp(),[_0x5eaad9,_0x341ec8]=useState(![]),[_0x6fdb56,_0x2d496a]=useState(![]),[_0x2da05f,_0x52bfad]=useState(null),[_0x1b7b49,_0x223414]=useState(null),_0x420b7b=readConfig(),_0x34610e=getConfigAppCode(),_0x54e9ef=_0x4d6d78||_0x34610e,_0x38be39=typeof _0x420b7b?.[_0x1d8e1f(0x1de)]===_0x1d8e1f(0x1ca)?_0x420b7b[_0x1d8e1f(0x1de)]:undefined,_0x44e1a7=_0x4d648b||_0x38be39||_0x1d8e1f(0x1ba);initEnv(_0x44e1a7);const _0x557f97=_0x1b4f25||_0x1d8e1f(0x1b9),_0x2f3dde=_0x4d6d78&&_0x4d6d78[_0x1d8e1f(0x1c0)]('-')?_0x4d6d78[_0x1d8e1f(0x1c4)]('-')['slice'](0x1)[_0x1d8e1f(0x1e9)]('-'):'',_0x3e8fbd=_0x4d6d78?_0x1d8e1f(0x1eb)+_0x54e9ef:_0x1d8e1f(0x1bc)+_0x54e9ef,_0x3363ab=_0x2f3dde?_0x2f3dde+'-api':_0x1d8e1f(0x1df),_0x2af79b=_0x2f3dde?_0x2f3dde+_0x1d8e1f(0x1cc):_0x1d8e1f(0x1c5);useEffect(()=>{_0x341ec8(!![]),_0x4a856e();},[]),useEffect(()=>{(_0x6fdb56||_0x2da05f)&&_0xe131a3();},[_0x6fdb56,_0x2da05f,_0xe131a3]);async function _0x4a856e(){const _0xb66bd9=_0x1d8e1f;if(!_0x54e9ef){_0x52bfad(_0xb66bd9(0x1bb));return;}try{logger[_0xb66bd9(0x1dc)](process['cwd']());const {configArray:_0x24751b}=await fetchModelList(_0x54e9ef),_0x498ce2=_0x24751b[_0xb66bd9(0x1cd)],_0x13b249=!_0x4d6d78,_0x3c1a25=await generateApiFile(_0x24751b,_0x2f3dde,_0x54e9ef,_0x13b249,_0x44e1a7,_0x557f97),_0x338256=_0x557f97[_0xb66bd9(0x1e7)]('/')?_0x557f97:_0x557f97+'/';_0x223414({'api':''+_0x338256+_0x3363ab+_0xb66bd9(0x1e5),'client':''+_0x338256+_0x2af79b+'.ts','modelCount':_0x3c1a25['modelCount'],'datasetCount':_0x498ce2,'originalCount':_0x498ce2,'duplicateCount':0x0}),_0x2d496a(!![]);}catch(_0x23579a){const _0x12ca4e=_0x23579a instanceof Error?_0x23579a[_0xb66bd9(0x1c1)]:String(_0x23579a);logger[_0xb66bd9(0x1c3)](_0xb66bd9(0x1c8),_0xb66bd9(0x1c7)+_0x12ca4e,{'appCode':_0x54e9ef,'error':_0x12ca4e}),_0x52bfad(_0xb66bd9(0x1c7)+_0x12ca4e);}finally{_0x341ec8(![]);}}return a5_0x5337fc(Box,{'flexDirection':_0x1d8e1f(0x1e4),'children':[(_0x5eaad9||_0x6fdb56)&&a5_0x5337fc(Box,{'children':[a5_0x50ae97(Text,{'color':_0x1d8e1f(0x1d6),'children':'*\x20'}),a5_0x50ae97(Text,{'color':_0x4d6d78?_0x1d8e1f(0x1f0):_0x1d8e1f(0x1e3),'children':_0x3e8fbd})]}),_0x5eaad9&&a5_0x50ae97(Box,{'children':a5_0x5337fc(Text,{'children':[_0x1d8e1f(0x1be),_0x44e1a7,')']})}),_0x6fdb56&&_0x1b7b49&&a5_0x5337fc(Box,{'flexDirection':'column','children':[a5_0x50ae97(Box,{'children':a5_0x5337fc(Text,{'color':_0x1d8e1f(0x1cb),'children':[_0x1d8e1f(0x1da),_0x1b7b49[_0x1d8e1f(0x1db)],_0x1d8e1f(0x1b7),'\x20',_0x1b7b49[_0x1d8e1f(0x1ee)],_0x1d8e1f(0x1d0)]})}),_0x1b7b49[_0x1d8e1f(0x1ce)]>0x0&&a5_0x50ae97(Box,{'marginTop':0x1,'children':a5_0x5337fc(Text,{'color':'yellow','children':[_0x1d8e1f(0x1bf),_0x1b7b49[_0x1d8e1f(0x1c6)],_0x1d8e1f(0x1ec),'\x20',_0x1b7b49[_0x1d8e1f(0x1ce)],'\x20个']})}),a5_0x50ae97(Box,{'marginTop':0x1,'children':a5_0x50ae97(Text,{'color':_0x1d8e1f(0x1d6),'children':_0x1d8e1f(0x1dd)})}),a5_0x5337fc(Box,{'marginLeft':0x2,'children':[a5_0x5337fc(Text,{'color':'cyan','children':['•\x20',_0x1b7b49[_0x1d8e1f(0x1df)]]}),a5_0x5337fc(Text,{'color':_0x1d8e1f(0x1e3),'children':['\x20',_0x1d8e1f(0x1e6),_0x1b7b49[_0x1d8e1f(0x1ee)],_0x1d8e1f(0x1d4)]})]}),a5_0x5337fc(Box,{'marginLeft':0x2,'children':[a5_0x5337fc(Text,{'color':'cyan','children':['•\x20',_0x1b7b49[_0x1d8e1f(0x1c5)]]}),a5_0x50ae97(Text,{'color':'dim','children':_0x1d8e1f(0x1e2)})]}),a5_0x50ae97(Box,{'marginTop':0x1,'children':a5_0x50ae97(Text,{'color':_0x1d8e1f(0x1d6),'children':_0x1d8e1f(0x1cf)})}),a5_0x50ae97(Box,{'marginLeft':0x2,'children':a5_0x5337fc(Text,{'color':'yellow','children':[_0x1d8e1f(0x1d7),_0x1d8e1f(0x1ef),'\x20from\x20\x27@/',_0x1b7b49['client'][_0x1d8e1f(0x1d2)](/^\.\//,'')['replace'](_0x1d8e1f(0x1e5),''),'\x27']})})]}),_0x2da05f&&a5_0x5337fc(Box,{'flexDirection':_0x1d8e1f(0x1e4),'children':[a5_0x50ae97(Box,{'children':a5_0x5337fc(Text,{'color':_0x1d8e1f(0x1e1),'children':['❌\x20',_0x2da05f]})}),_0x2da05f[_0x1d8e1f(0x1c0)]('登录')&&a5_0x5337fc(Box,{'marginTop':0x1,'children':[a5_0x50ae97(Text,{'color':'yellow','children':'💡\x20请使用\x20'}),a5_0x50ae97(Text,{'color':_0x1d8e1f(0x1d9),'children':_0x1d8e1f(0x1d1)}),a5_0x50ae97(Text,{'color':'yellow','children':_0x1d8e1f(0x1d8)})]})]})]});};
1
+ (function(_0x285ec1,_0x16916f){const _0x6f5c2a=a5_0x2886,_0x3def2d=_0x285ec1();while(!![]){try{const _0x26d128=-parseInt(_0x6f5c2a(0x215))/0x1+parseInt(_0x6f5c2a(0x202))/0x2*(parseInt(_0x6f5c2a(0x203))/0x3)+-parseInt(_0x6f5c2a(0x207))/0x4*(-parseInt(_0x6f5c2a(0x1e5))/0x5)+parseInt(_0x6f5c2a(0x1ed))/0x6+parseInt(_0x6f5c2a(0x1e4))/0x7+-parseInt(_0x6f5c2a(0x1f6))/0x8+-parseInt(_0x6f5c2a(0x1f1))/0x9;if(_0x26d128===_0x16916f)break;else _0x3def2d['push'](_0x3def2d['shift']());}catch(_0xba47c8){_0x3def2d['push'](_0x3def2d['shift']());}}}(a5_0x4c65,0xa1835));import{jsx as a5_0x9a267b,jsxs as a5_0x519fea}from'react/jsx-runtime';import{useEffect,useState}from'react';import{Box,Text,useApp}from'ink';function a5_0x4c65(){const _0x356b00=['5520508KUpDcW','905hZNzZB','./src/api/','api-pull','*\x20导入方式:','includes','\x20个模型)','api','-client','6839088GxlkrT','\x20个模型','length','-\x20模型配置文件\x20(','22041000IWIwYJ','env','💡\x20请使用\x20','√\x20成功拉取\x20','datasetCount','5187368GJOzsW','red','dim','!\x20原始数据集\x20','endsWith','使用指定的应用AppCode:\x20','cyan','\x20个数据集,生成','yellow','gray','column','lovrabet\x20auth','112612vyhjpz','66AUsauQ','online','replace','拉取\x20API\x20配置失败:\x20','17288EloiAD','message','\x20个,过滤重复','*\x20已生成文件:','setLogPath','client','🚀\x20正在从服务器拉取\x20API\x20配置...\x20(环境:\x20','\x20重新登录后再试','\x20from\x20\x27@/','\x20-\x20客户端实例文件','originalCount','join','.ts','modelCount','190528UCTBKV','white'];a5_0x4c65=function(){return _0x356b00;};return a5_0x4c65();}import{readConfig,getConfigAppCode}from'../utils/config.js';import{initEnv}from'../constant/env.js';import{generateApiFile}from'./generate-api-file.js';function a5_0x2886(_0x1f78cf,_0x19fa9a){_0x1f78cf=_0x1f78cf-0x1e3;const _0x4c6577=a5_0x4c65();let _0x2886da=_0x4c6577[_0x1f78cf];return _0x2886da;}import{logger}from'../utils/logger.js';import{fetchModelList}from'./fetch-model-list.js';export const ApiPullUI=({appCode:_0x1b36c4,env:_0x31c4b7,output:_0x4c234f})=>{const _0x321ef6=a5_0x2886,{exit:_0x55a27e}=useApp(),[_0x15df25,_0x1cddaa]=useState(![]),[_0x3d0b54,_0x5defac]=useState(![]),[_0x121c2e,_0x383155]=useState(null),[_0xed771f,_0x509c68]=useState(null),_0x288fa5=readConfig(),_0x16a6b8=getConfigAppCode(),_0x5e59f2=_0x1b36c4||_0x16a6b8,_0x2a1780=typeof _0x288fa5?.['env']==='string'?_0x288fa5[_0x321ef6(0x1f2)]:undefined,_0x34fd20=_0x31c4b7||_0x2a1780||_0x321ef6(0x204);initEnv(_0x34fd20);const _0x4462b0=_0x4c234f||_0x321ef6(0x1e6),_0x5f1703=_0x1b36c4&&_0x1b36c4[_0x321ef6(0x1e9)]('-')?_0x1b36c4['split']('-')['slice'](0x1)[_0x321ef6(0x212)]('-'):'',_0x694533=_0x1b36c4?_0x321ef6(0x1fb)+_0x5e59f2:'使用配置的应用AppCode:\x20'+_0x5e59f2,_0x3d4d7f=_0x5f1703?_0x5f1703+'-api':_0x321ef6(0x1eb),_0x13c16a=_0x5f1703?_0x5f1703+_0x321ef6(0x1ec):_0x321ef6(0x20c);useEffect(()=>{_0x1cddaa(!![]),_0x5a6f5f();},[]),useEffect(()=>{(_0x3d0b54||_0x121c2e)&&_0x55a27e();},[_0x3d0b54,_0x121c2e,_0x55a27e]);async function _0x5a6f5f(){const _0x54b13d=_0x321ef6;if(!_0x5e59f2){_0x383155('未提供应用AppCode,且配置中也没有默认值');return;}try{logger[_0x54b13d(0x20b)](process['cwd']());const {configArray:_0x11dc3b}=await fetchModelList(_0x5e59f2),_0x4ca3ad=_0x11dc3b[_0x54b13d(0x1ef)],_0x49812c=!_0x1b36c4,_0x13721a=await generateApiFile(_0x11dc3b,_0x5f1703,_0x5e59f2,_0x49812c,_0x34fd20,_0x4462b0),_0x48739a=_0x4462b0[_0x54b13d(0x1fa)]('/')?_0x4462b0:_0x4462b0+'/';_0x509c68({'api':''+_0x48739a+_0x3d4d7f+_0x54b13d(0x213),'client':''+_0x48739a+_0x13c16a+'.ts','modelCount':_0x13721a['modelCount'],'datasetCount':_0x4ca3ad,'originalCount':_0x4ca3ad,'duplicateCount':0x0}),_0x5defac(!![]);}catch(_0x5b2951){const _0x53b52a=_0x5b2951 instanceof Error?_0x5b2951[_0x54b13d(0x208)]:String(_0x5b2951);logger['error'](_0x54b13d(0x1e7),'拉取\x20API\x20配置失败:\x20'+_0x53b52a,{'appCode':_0x5e59f2,'error':_0x53b52a}),_0x383155(_0x54b13d(0x206)+_0x53b52a);}finally{_0x1cddaa(![]);}}return a5_0x519fea(Box,{'flexDirection':_0x321ef6(0x200),'children':[(_0x15df25||_0x3d0b54)&&a5_0x519fea(Box,{'children':[a5_0x9a267b(Text,{'color':_0x321ef6(0x1ff),'children':'*\x20'}),a5_0x9a267b(Text,{'color':_0x1b36c4?_0x321ef6(0x1e3):_0x321ef6(0x1f8),'children':_0x694533})]}),_0x15df25&&a5_0x9a267b(Box,{'children':a5_0x519fea(Text,{'children':[_0x321ef6(0x20d),_0x34fd20,')']})}),_0x3d0b54&&_0xed771f&&a5_0x519fea(Box,{'flexDirection':_0x321ef6(0x200),'children':[a5_0x9a267b(Box,{'children':a5_0x519fea(Text,{'color':'green','children':[_0x321ef6(0x1f4),_0xed771f[_0x321ef6(0x1f5)],_0x321ef6(0x1fd),'\x20',_0xed771f['modelCount'],_0x321ef6(0x1ee)]})}),_0xed771f['duplicateCount']>0x0&&a5_0x9a267b(Box,{'marginTop':0x1,'children':a5_0x519fea(Text,{'color':_0x321ef6(0x1fe),'children':[_0x321ef6(0x1f9),_0xed771f[_0x321ef6(0x211)],_0x321ef6(0x209),'\x20',_0xed771f['duplicateCount'],'\x20个']})}),a5_0x9a267b(Box,{'marginTop':0x1,'children':a5_0x9a267b(Text,{'color':_0x321ef6(0x1ff),'children':_0x321ef6(0x20a)})}),a5_0x519fea(Box,{'marginLeft':0x2,'children':[a5_0x519fea(Text,{'color':_0x321ef6(0x1fc),'children':['•\x20',_0xed771f[_0x321ef6(0x1eb)]]}),a5_0x519fea(Text,{'color':_0x321ef6(0x1f8),'children':['\x20',_0x321ef6(0x1f0),_0xed771f[_0x321ef6(0x214)],_0x321ef6(0x1ea)]})]}),a5_0x519fea(Box,{'marginLeft':0x2,'children':[a5_0x519fea(Text,{'color':_0x321ef6(0x1fc),'children':['•\x20',_0xed771f[_0x321ef6(0x20c)]]}),a5_0x9a267b(Text,{'color':_0x321ef6(0x1f8),'children':_0x321ef6(0x210)})]}),a5_0x9a267b(Box,{'marginTop':0x1,'children':a5_0x9a267b(Text,{'color':'gray','children':_0x321ef6(0x1e8)})}),a5_0x9a267b(Box,{'marginLeft':0x2,'children':a5_0x519fea(Text,{'color':_0x321ef6(0x1fe),'children':['import\x20','{\x20lovrabetClient\x20}',_0x321ef6(0x20f),_0xed771f[_0x321ef6(0x20c)][_0x321ef6(0x205)](/^\.\//,'')[_0x321ef6(0x205)]('.ts',''),'\x27']})})]}),_0x121c2e&&a5_0x519fea(Box,{'flexDirection':_0x321ef6(0x200),'children':[a5_0x9a267b(Box,{'children':a5_0x519fea(Text,{'color':_0x321ef6(0x1f7),'children':['❌\x20',_0x121c2e]})}),_0x121c2e[_0x321ef6(0x1e9)]('登录')&&a5_0x519fea(Box,{'marginTop':0x1,'children':[a5_0x9a267b(Text,{'color':_0x321ef6(0x1fe),'children':_0x321ef6(0x1f3)}),a5_0x9a267b(Text,{'color':_0x321ef6(0x1fc),'children':_0x321ef6(0x201)}),a5_0x9a267b(Text,{'color':'yellow','children':_0x321ef6(0x20e)})]})]})]});};
@@ -1 +1 @@
1
- function a6_0xe36b(_0x17efb9,_0x184b0c){_0x17efb9=_0x17efb9-0x1bc;const _0xfb390=a6_0xfb39();let _0xe36b4d=_0xfb390[_0x17efb9];return _0xe36b4d;}(function(_0xd6fe97,_0x423e06){const _0x1e25d8=a6_0xe36b,_0x2112f0=_0xd6fe97();while(!![]){try{const _0x1053c6=parseInt(_0x1e25d8(0x1cb))/0x1+-parseInt(_0x1e25d8(0x1c7))/0x2*(parseInt(_0x1e25d8(0x1c6))/0x3)+-parseInt(_0x1e25d8(0x1ca))/0x4*(parseInt(_0x1e25d8(0x1c8))/0x5)+parseInt(_0x1e25d8(0x1c0))/0x6+parseInt(_0x1e25d8(0x1cc))/0x7+-parseInt(_0x1e25d8(0x1cf))/0x8+parseInt(_0x1e25d8(0x1bc))/0x9*(parseInt(_0x1e25d8(0x1ce))/0xa);if(_0x1053c6===_0x423e06)break;else _0x2112f0['push'](_0x2112f0['shift']());}catch(_0x395ee9){_0x2112f0['push'](_0x2112f0['shift']());}}}(a6_0xfb39,0xd448f));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';function a6_0xfb39(){const _0x4cb7dd=['data','登录鉴权失败,登录已过期,请使用\x20lovrabet\x20auth\x20重新登录','info','3728166xUKDKL','2DjJJzt','971430iiaHsu','fetch-model-list','16ySNZqs','52284gYpPhk','11940936rfYuBt','&otype=array','100rXDluu','13611240tilfVa','status','2125539PSonJu','json','未知错误','configArray','2825688pefCYb','message','获取数据集失败,HTTP状态码:\x20'];a6_0xfb39=function(){return _0x4cb7dd;};return a6_0xfb39();}export async function fetchModelList(_0x361c35){const _0x466bfd=a6_0xe36b,_0x2f9c2b=getEnv(),_0x513d1b=getApiDomain()+'/api/node-toolbox/dataset/model-list?appcode='+_0x361c35+_0x466bfd(0x1cd);logger[_0x466bfd(0x1c5)](_0x466bfd(0x1c9),'正在从服务器拉取模型列表...\x20(环境:\x20'+_0x2f9c2b+')',{'apiUrl':_0x513d1b});const _0x18b739=await fetch(_0x513d1b,{'headers':{'Cookie':getCookie()}});if(!_0x18b739['ok']){if(_0x18b739[_0x466bfd(0x1d0)]===0x191)throw new Error(_0x466bfd(0x1c4));throw new Error(_0x466bfd(0x1c2)+_0x18b739['status']);}const _0x50d634=await _0x18b739[_0x466bfd(0x1bd)]();if(!_0x50d634['success'])throw new Error('获取数据集失败:\x20'+(_0x50d634[_0x466bfd(0x1c1)]||_0x466bfd(0x1be)));return{'configArray':_0x50d634[_0x466bfd(0x1c3)][_0x466bfd(0x1bf)],'count':_0x50d634[_0x466bfd(0x1c3)]['count']};}
1
+ (function(_0x46b89b,_0x618040){const _0x2d6127=a6_0x3266,_0x17878d=_0x46b89b();while(!![]){try{const _0x50db9a=parseInt(_0x2d6127(0x174))/0x1*(-parseInt(_0x2d6127(0x172))/0x2)+-parseInt(_0x2d6127(0x178))/0x3*(-parseInt(_0x2d6127(0x17e))/0x4)+parseInt(_0x2d6127(0x171))/0x5+-parseInt(_0x2d6127(0x17a))/0x6*(parseInt(_0x2d6127(0x17c))/0x7)+-parseInt(_0x2d6127(0x181))/0x8+parseInt(_0x2d6127(0x16d))/0x9+parseInt(_0x2d6127(0x179))/0xa;if(_0x50db9a===_0x618040)break;else _0x17878d['push'](_0x17878d['shift']());}catch(_0x7bd81e){_0x17878d['push'](_0x17878d['shift']());}}}(a6_0x45d5,0x7c6b5));import{getCookie}from'../auth/get-cookie.js';import{getApiDomain}from'../constant/domain.js';function a6_0x45d5(){const _0x246658=['32254esmucY','json','7UhpHIF','&otype=array','configArray','获取数据集失败,HTTP状态码:\x20','9szYole','8098720LyQAQO','6mhWneQ','success','752759ryzMlh','status','81404oELslQ','count','data','5775208MGwxTy','fetch-model-list','554778eZjLrR','获取数据集失败:\x20','message','/api/node-toolbox/dataset/model-list?appcode=','2596905fRdHUn'];a6_0x45d5=function(){return _0x246658;};return a6_0x45d5();}import{logger}from'../utils/logger.js';import{getEnv}from'../constant/env.js';function a6_0x3266(_0x20c650,_0x278bc9){_0x20c650=_0x20c650-0x16c;const _0x45d59d=a6_0x45d5();let _0x32660b=_0x45d59d[_0x20c650];return _0x32660b;}export async function fetchModelList(_0x4dc35e){const _0x494612=a6_0x3266,_0x247614=getEnv(),_0x4c0377=getApiDomain()+_0x494612(0x170)+_0x4dc35e+_0x494612(0x175);logger['info'](_0x494612(0x16c),'正在从服务器拉取模型列表...\x20(环境:\x20'+_0x247614+')',{'apiUrl':_0x4c0377});const _0x23e795=await fetch(_0x4c0377,{'headers':{'Cookie':getCookie()}});if(!_0x23e795['ok']){if(_0x23e795[_0x494612(0x17d)]===0x191)throw new Error('登录鉴权失败,登录已过期,请使用\x20lovrabet\x20auth\x20重新登录');throw new Error(_0x494612(0x177)+_0x23e795[_0x494612(0x17d)]);}const _0xaa3394=await _0x23e795[_0x494612(0x173)]();if(!_0xaa3394[_0x494612(0x17b)])throw new Error(_0x494612(0x16e)+(_0xaa3394[_0x494612(0x16f)]||'未知错误'));return{'configArray':_0xaa3394[_0x494612(0x180)][_0x494612(0x176)],'count':_0xaa3394[_0x494612(0x180)][_0x494612(0x17f)]};}
@@ -1 +1 @@
1
- const a7_0x458b82=a7_0x126b;(function(_0x3c8f59,_0x51daf5){const _0x17f8c7=a7_0x126b,_0x2c0def=_0x3c8f59();while(!![]){try{const _0x4ad07a=parseInt(_0x17f8c7(0x1d9))/0x1*(-parseInt(_0x17f8c7(0x1f3))/0x2)+-parseInt(_0x17f8c7(0x1e7))/0x3+-parseInt(_0x17f8c7(0x1f8))/0x4+-parseInt(_0x17f8c7(0x1e2))/0x5+-parseInt(_0x17f8c7(0x1ec))/0x6+-parseInt(_0x17f8c7(0x1f4))/0x7+parseInt(_0x17f8c7(0x1f0))/0x8*(parseInt(_0x17f8c7(0x1fe))/0x9);if(_0x4ad07a===_0x51daf5)break;else _0x2c0def['push'](_0x2c0def['shift']());}catch(_0x528370){_0x2c0def['push'](_0x2c0def['shift']());}}}(a7_0x4f7f,0x8391f));import a7_0x4880d3 from'prettier';import{mkdirSync,writeFileSync,readFileSync}from'node:fs';import a7_0x4ebfad from'node:path';import{fileURLToPath}from'node:url';import{readConfig}from'../utils/config.js';import{TemplateReplacer}from'../utils/template-replacer.js';import{logger}from'../utils/logger.js';export async function generateApiFile(_0xd60cda,_0x8bee5d='',_0x1613c9,_0x54871c=![],_0x4815b5,_0x355abd=a7_0x458b82(0x1d7)){const _0x58d1ec=a7_0x458b82,_0x43aaef=readConfig(),_0x48b415=_0x1613c9||_0x43aaef?.[_0x58d1ec(0x1de)];if(typeof _0x48b415!==_0x58d1ec(0x1d8)||!_0x48b415)throw new Error(_0x58d1ec(0x1e3));const _0x5c9a11=_0x54871c?_0x58d1ec(0x1f6):'\x22'+_0x48b415+'\x22',_0x19ac26=typeof _0x43aaef[_0x58d1ec(0x1eb)]===_0x58d1ec(0x1d8)?_0x43aaef[_0x58d1ec(0x1eb)]:undefined,_0x1c34cb=_0x4815b5||_0x19ac26||_0x58d1ec(0x1e5),_0x9940af=_0x1c34cb!=='online';let _0x42e794;if(_0x54871c)_0x9940af?_0x42e794=_0x58d1ec(0x1ea)+_0x5c9a11+_0x58d1ec(0x1fa)+_0x1c34cb+'\x22\x20}':_0x42e794='';else{const _0x5387f8=_0x9940af?_0x58d1ec(0x1fa)+_0x1c34cb+'\x22':'';_0x42e794=_0x58d1ec(0x1f2)+_0x48b415+'\x22'+_0x5387f8+'\x20}';}const _0x183ee4=_0x8bee5d?_0x8bee5d+_0x58d1ec(0x1e0):_0x58d1ec(0x1e1),_0x34d3d0=_0x8bee5d?_0x8bee5d+'-client':_0x58d1ec(0x1ee),_0x1d2972=[];_0xd60cda['forEach'](_0x182405=>{const _0x113f80=_0x58d1ec;_0x1d2972['push']({'datasetCode':_0x182405[_0x113f80(0x1da)],'tableName':_0x182405[_0x113f80(0x1fd)],'name':_0x182405[_0x113f80(0x1ed)]||'','alias':_0x182405[_0x113f80(0x1f7)]||_0x182405['key']});});const _0x4d6f6a=fileURLToPath(import.meta.url),_0x1cdc9f=a7_0x4ebfad[_0x58d1ec(0x1fc)](a7_0x4ebfad[_0x58d1ec(0x1e4)](_0x4d6f6a),_0x58d1ec(0x1e8)),_0x874c31=a7_0x4ebfad[_0x58d1ec(0x1df)](_0x1cdc9f,_0x58d1ec(0x1dd)),_0x377984=a7_0x4ebfad[_0x58d1ec(0x1df)](_0x874c31,'api.ts.tpl'),_0x3a0e97=a7_0x4ebfad[_0x58d1ec(0x1df)](_0x874c31,'client.ts.tpl'),_0x6e0e4e=_0x355abd[_0x58d1ec(0x1f9)]('/')?_0x355abd['slice'](0x0,-0x1):_0x355abd;mkdirSync(_0x6e0e4e,{'recursive':!![]});const _0x5602cf=_0x1d2972[0x0]?.[_0x58d1ec(0x1f7)],_0x566fa1=readFileSync(_0x377984,_0x58d1ec(0x1e9)),_0x103e57=TemplateReplacer[_0x58d1ec(0x1ef)](_0x566fa1,_0x48b415,_0x1d2972,_0x5602cf,_0x183ee4,_0x5c9a11),_0x4d9259=await a7_0x4880d3[_0x58d1ec(0x1e6)](_0x103e57,{'parser':'typescript'}),_0x96a49f=_0x6e0e4e+'/'+_0x183ee4+'.ts';writeFileSync(_0x96a49f,_0x4d9259,{'encoding':_0x58d1ec(0x1e9)});const _0x56e6f2=readFileSync(_0x3a0e97,'utf8'),_0x3bef4d=TemplateReplacer[_0x58d1ec(0x1ef)](_0x56e6f2,_0x48b415,_0x1d2972,_0x5602cf,_0x183ee4,_0x5c9a11,_0x42e794),_0x7331d3=await a7_0x4880d3['format'](_0x3bef4d,{'parser':'typescript'}),_0x2faef0=_0x6e0e4e+'/'+_0x34d3d0+_0x58d1ec(0x1dc);writeFileSync(_0x2faef0,_0x7331d3,{'encoding':_0x58d1ec(0x1e9)});const _0x141634=_0x1d2972[_0x58d1ec(0x1fb)];return logger[_0x58d1ec(0x1f5)](_0x58d1ec(0x1f1),_0x58d1ec(0x1db),undefined,{'apiFile':_0x96a49f,'clientFile':_0x2faef0,'modelCount':_0x141634,'configName':_0x5c9a11}),{'modelCount':_0x141634,'apiFilePath':_0x96a49f,'clientFilePath':_0x2faef0,'configName':_0x5c9a11};}function a7_0x126b(_0x5395fe,_0x3a7bc3){_0x5395fe=_0x5395fe-0x1d7;const _0x4f7f14=a7_0x4f7f();let _0x126bfd=_0x4f7f14[_0x5395fe];return _0x126bfd;}function a7_0x4f7f(){const _0x18592e=['datasetCode','API\x20文件生成成功!','.ts','templates/generate-api','app','join','-api','api','758165rAkaip','请先通过\x20`lovrabet\x20config\x20set\x20app\x20<value>`\x20配置应用\x20Code','dirname','online','format','197475mLQAJK','../..','utf8','{\x20apiConfigName:\x20','env','3400200YvnbWB','name','client','replaceApiContent','112fBBTQy','init-api','{\x20apiConfigName:\x20\x22','34214CjUIvG','1756587POVTil','success','CONFIG_NAMES.DEFAULT','alias','3556004TJLVrg','endsWith',',\x20env:\x20\x22','length','resolve','tableName','1946277ikpEAk','./src/api/','string','33hzkPVd'];a7_0x4f7f=function(){return _0x18592e;};return a7_0x4f7f();}
1
+ function a7_0xc9f5(_0x420b19,_0xc3f0b0){_0x420b19=_0x420b19-0xb2;const _0x5a86a5=a7_0x5a86();let _0xc9f5cc=_0x5a86a5[_0x420b19];return _0xc9f5cc;}const a7_0x50cfe8=a7_0xc9f5;(function(_0x4072f1,_0x31a015){const _0x2378fc=a7_0xc9f5,_0x42a5b3=_0x4072f1();while(!![]){try{const _0xd92b5=-parseInt(_0x2378fc(0xc2))/0x1+-parseInt(_0x2378fc(0xca))/0x2+parseInt(_0x2378fc(0xd1))/0x3+-parseInt(_0x2378fc(0xd3))/0x4*(-parseInt(_0x2378fc(0xcd))/0x5)+-parseInt(_0x2378fc(0xc9))/0x6*(-parseInt(_0x2378fc(0xd5))/0x7)+parseInt(_0x2378fc(0xc0))/0x8*(parseInt(_0x2378fc(0xd4))/0x9)+-parseInt(_0x2378fc(0xc3))/0xa;if(_0xd92b5===_0x31a015)break;else _0x42a5b3['push'](_0x42a5b3['shift']());}catch(_0x1e3e08){_0x42a5b3['push'](_0x42a5b3['shift']());}}}(a7_0x5a86,0xbfb85));import a7_0x10c932 from'prettier';import{mkdirSync,writeFileSync,readFileSync}from'node:fs';import a7_0x295cfe from'node:path';import{fileURLToPath}from'node:url';import{readConfig}from'../utils/config.js';function a7_0x5a86(){const _0x23902f=['replaceApiContent','client.ts.tpl','string','24fpaRut','success','893582nZyAMF','21139930ZHolhJ','env',',\x20env:\x20\x22','datasetCode','-api','forEach','72GSXUxs','2052746OkALGm','.ts','alias','3295mIXXix','format','utf8','CONFIG_NAMES.DEFAULT','3530514TKOaaw','client','4528GazLnO','4403169aGvYUV','833399kZSnyu','./src/api/','endsWith','typescript','api.ts.tpl','app','{\x20apiConfigName:\x20','api','resolve','-client','API\x20文件生成成功!','join','../..','online','init-api','tableName'];a7_0x5a86=function(){return _0x23902f;};return a7_0x5a86();}import{TemplateReplacer}from'../utils/template-replacer.js';import{logger}from'../utils/logger.js';export async function generateApiFile(_0x4271d7,_0x53bcb1='',_0x3bdb4b,_0x58ee5d=![],_0x6e4fbd,_0x1a578d=a7_0x50cfe8(0xd6)){const _0x1c3217=a7_0x50cfe8,_0x1c2b40=readConfig(),_0x2058ad=_0x3bdb4b||_0x1c2b40?.[_0x1c3217(0xb2)];if(typeof _0x2058ad!==_0x1c3217(0xbf)||!_0x2058ad)throw new Error('请先通过\x20`lovrabet\x20config\x20set\x20app\x20<value>`\x20配置应用\x20Code');const _0x490304=_0x58ee5d?_0x1c3217(0xd0):'\x22'+_0x2058ad+'\x22',_0xac0dee=typeof _0x1c2b40['env']===_0x1c3217(0xbf)?_0x1c2b40[_0x1c3217(0xc4)]:undefined,_0x221bf3=_0x6e4fbd||_0xac0dee||_0x1c3217(0xba),_0x4c404b=_0x221bf3!=='online';let _0x2a02f1;if(_0x58ee5d)_0x4c404b?_0x2a02f1=_0x1c3217(0xb3)+_0x490304+',\x20env:\x20\x22'+_0x221bf3+'\x22\x20}':_0x2a02f1='';else{const _0x26d7fc=_0x4c404b?_0x1c3217(0xc5)+_0x221bf3+'\x22':'';_0x2a02f1='{\x20apiConfigName:\x20\x22'+_0x2058ad+'\x22'+_0x26d7fc+'\x20}';}const _0x464f5b=_0x53bcb1?_0x53bcb1+_0x1c3217(0xc7):_0x1c3217(0xb4),_0x5b00e3=_0x53bcb1?_0x53bcb1+_0x1c3217(0xb6):_0x1c3217(0xd2),_0x1287e3=[];_0x4271d7[_0x1c3217(0xc8)](_0x31b1a3=>{const _0x25b3a4=_0x1c3217;_0x1287e3['push']({'datasetCode':_0x31b1a3[_0x25b3a4(0xc6)],'tableName':_0x31b1a3[_0x25b3a4(0xbc)],'name':_0x31b1a3['name']||'','alias':_0x31b1a3[_0x25b3a4(0xcc)]||_0x31b1a3['key']});});const _0x1ec834=fileURLToPath(import.meta.url),_0x1cfc3a=a7_0x295cfe[_0x1c3217(0xb5)](a7_0x295cfe['dirname'](_0x1ec834),_0x1c3217(0xb9)),_0x9d57aa=a7_0x295cfe[_0x1c3217(0xb8)](_0x1cfc3a,'templates/generate-api'),_0x8965b3=a7_0x295cfe[_0x1c3217(0xb8)](_0x9d57aa,_0x1c3217(0xd9)),_0x327bb4=a7_0x295cfe[_0x1c3217(0xb8)](_0x9d57aa,_0x1c3217(0xbe)),_0x2ee6bd=_0x1a578d[_0x1c3217(0xd7)]('/')?_0x1a578d['slice'](0x0,-0x1):_0x1a578d;mkdirSync(_0x2ee6bd,{'recursive':!![]});const _0x3944b3=_0x1287e3[0x0]?.['alias'],_0x466288=readFileSync(_0x8965b3,_0x1c3217(0xcf)),_0x20ef5a=TemplateReplacer[_0x1c3217(0xbd)](_0x466288,_0x2058ad,_0x1287e3,_0x3944b3,_0x464f5b,_0x490304),_0x2d843e=await a7_0x10c932[_0x1c3217(0xce)](_0x20ef5a,{'parser':'typescript'}),_0x1debf8=_0x2ee6bd+'/'+_0x464f5b+_0x1c3217(0xcb);writeFileSync(_0x1debf8,_0x2d843e,{'encoding':_0x1c3217(0xcf)});const _0xa0400=readFileSync(_0x327bb4,_0x1c3217(0xcf)),_0x190782=TemplateReplacer[_0x1c3217(0xbd)](_0xa0400,_0x2058ad,_0x1287e3,_0x3944b3,_0x464f5b,_0x490304,_0x2a02f1),_0x599b08=await a7_0x10c932[_0x1c3217(0xce)](_0x190782,{'parser':_0x1c3217(0xd8)}),_0x3486ed=_0x2ee6bd+'/'+_0x5b00e3+_0x1c3217(0xcb);writeFileSync(_0x3486ed,_0x599b08,{'encoding':'utf8'});const _0x4c2d8d=_0x1287e3['length'];return logger[_0x1c3217(0xc1)](_0x1c3217(0xbb),_0x1c3217(0xb7),undefined,{'apiFile':_0x1debf8,'clientFile':_0x3486ed,'modelCount':_0x4c2d8d,'configName':_0x490304}),{'modelCount':_0x4c2d8d,'apiFilePath':_0x1debf8,'clientFilePath':_0x3486ed,'configName':_0x490304};}
package/lib/api/main.js CHANGED
@@ -1 +1 @@
1
- (function(_0x35e390,_0x3f5f0d){const _0x2666c8=a8_0x4b76,_0x30f5ab=_0x35e390();while(!![]){try{const _0x4be38b=parseInt(_0x2666c8(0x188))/0x1*(-parseInt(_0x2666c8(0x193))/0x2)+-parseInt(_0x2666c8(0x171))/0x3+parseInt(_0x2666c8(0x17c))/0x4*(-parseInt(_0x2666c8(0x18c))/0x5)+parseInt(_0x2666c8(0x180))/0x6*(parseInt(_0x2666c8(0x1a4))/0x7)+parseInt(_0x2666c8(0x170))/0x8*(-parseInt(_0x2666c8(0x185))/0x9)+parseInt(_0x2666c8(0x1a1))/0xa*(parseInt(_0x2666c8(0x198))/0xb)+parseInt(_0x2666c8(0x199))/0xc*(parseInt(_0x2666c8(0x183))/0xd);if(_0x4be38b===_0x3f5f0d)break;else _0x30f5ab['push'](_0x30f5ab['shift']());}catch(_0x256682){_0x30f5ab['push'](_0x30f5ab['shift']());}}}(a8_0x5534,0xc4c02));import{jsx as a8_0x20d7cd}from'react/jsx-runtime';import{render}from'ink';function a8_0x5534(){const _0x230bba=['length','\x20\x20\x202.\x20使用参数:\x20lovrabet\x20api\x20doc\x20--appcode\x20<app-code>','\x1b[90m\x20\x20(注:\x20--appcode\x20参数与配置一致,将使用默认配置)\x1b[0m','flags','7540BsqWXR','\x20\x20lovrabet\x20api\x20doc\x20--output\x20<dir>\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定文档输出目录(默认:\x20./docs)','map','7bgQQNG','\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文档','\x20\x20lovrabet\x20api\x20pull\x20--appcode\x20<code>\x20\x20\x20\x20\x20\x20//\x20使用指定的\x20appcode','\x0alovrabet\x20api\x20-\x20API\x20相关操作\x0a\x0a用法:\x0a\x20\x20$\x20lovrabet\x20api\x20pull\x20[options]\x0a\x20\x20$\x20lovrabet\x20api\x20doc\x20[options]\x0a\x0a选项:\x0a\x20\x20--appcode\x20<code>\x20\x20\x20\x20\x20\x20指定应用代码\x0a\x20\x20--output\x20<dir>\x20\x20\x20\x20\x20\x20\x20\x20指定输出目录(pull:\x20./src/api/,doc:\x20./docs)\x0a\x20\x20--env\x20<env>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20指定环境(如:daily、online)\x0a\x20\x20--datasetcode\x20<codes>\x20指定要生成文档的数据集代码(多个用逗号分隔,仅\x20doc\x20命令)\x0a\x20\x20--help\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20显示此帮助信息\x0a\x0a示例:\x0a\x20\x20$\x20lovrabet\x20api\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20拉取并生成\x20API\x20配置文件\x0a\x20\x20$\x20lovrabet\x20api\x20pull\x20--appcode\x20myapp\x20\x20\x20\x20\x20\x20\x20//\x20使用指定的\x20appcode\x0a\x20\x20$\x20lovrabet\x20api\x20pull\x20--output\x20./api\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定输出目录\x0a\x20\x20$\x20lovrabet\x20api\x20pull\x20--env\x20daily\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定环境拉取\x20API\x0a\x0a\x20\x20$\x20lovrabet\x20api\x20doc\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20生成所有数据集的文档\x0a\x20\x20$\x20lovrabet\x20api\x20doc\x20--appcode\x20myapp\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20使用指定的\x20appcode\x0a\x20\x20$\x20lovrabet\x20api\x20doc\x20--output\x20./docs\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定文档输出目录\x0a\x20\x20$\x20lovrabet\x20api\x20doc\x20--env\x20daily\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定环境生成文档\x0a\x20\x20$\x20lovrabet\x20api\x20doc\x20--datasetcode\x20ds_001\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20只生成指定数据集的文档\x0a\x20\x20$\x20lovrabet\x20api\x20doc\x20--datasetcode\x20ds_001,ds_002\x20\x20\x20\x20\x20\x20//\x20生成多个数据集的文档\x0a','\x1b[90m*\x20仅生成指定数据集的文档:\x20','\x20\x20错误:\x20','91984YijSFj','2051151xvHskb','isArray','exit','log','×\x20未配置\x20AppCode','\x20\x20lovrabet\x20api\x20pull\x20--appcode\x20','\x1b[90m*\x20使用配置的应用AppCode:\x20','Unknown\x20api\x20command:\x20','env','\x20\x20lovrabet\x20api\x20doc\x20--appcode\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配置文件','152jeUAmv','datasetcode','output','message','8942754rqTDgw','\x20\x20lovrabet\x20api\x20doc\x20--env\x20<env>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定环境(如:\x20daily,\x20online)','Available\x20commands:','351ZInVHA','error','990efaDvO','string','\x20\x20lovrabet\x20api\x20doc\x20--appcode\x20<code>\x20\x20\x20\x20\x20\x20\x20//\x20使用指定的\x20appcode','213tmTxKG','help','❌\x20错误:不再支持位置参数方式','\x20\x20lovrabet\x20api\x20pull\x20--output\x20<dir>\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定输出目录(默认:\x20./src/api/)','106465uKgGCt','filter','join','请使用\x20--appcode\x20参数,例如:','×\x20--params\x20参数不是有效的\x20JSON\x20格式','split','\x20\x20\x202.\x20使用参数:\x20lovrabet\x20api\x20pull\x20--appcode\x20<app-code>','1514iGNmcj','input','×\x20--params\x20参数必须是一个有效的\x20JSON\x20对象','appcode','\x1b[0m','10252nKqWWW','680700airQgf','!\x20请使用以下方式之一:','object','\x20\x20\x201.\x20配置默认值:\x20lovrabet\x20config\x20set\x20appcode\x20<app-code>'];a8_0x5534=function(){return _0x230bba;};return a8_0x5534();}import{ApiPullUI}from'./api-pull-ui.js';import{ApiDocUI}from'./api-doc-ui.js';function a8_0x4b76(_0x3599b7,_0x5ebcd5){_0x3599b7=_0x3599b7-0x16d;const _0x553456=a8_0x5534();let _0x4b76ee=_0x553456[_0x3599b7];return _0x4b76ee;}import{getConfigAppCode}from'../utils/config.js';export async function apiCli(_0x2d4d13){const _0x21ed63=a8_0x4b76,_0x49b700=_0x2d4d13['input'][0x1];if(_0x2d4d13[_0x21ed63(0x1a0)][_0x21ed63(0x189)]){console[_0x21ed63(0x174)](_0x21ed63(0x16d));return;}if(_0x49b700==='pull'){_0x2d4d13[_0x21ed63(0x194)][0x2]&&(console[_0x21ed63(0x184)](_0x21ed63(0x18a)),console['log'](_0x21ed63(0x18f)),console[_0x21ed63(0x174)](_0x21ed63(0x176)+_0x2d4d13[_0x21ed63(0x194)][0x2]),process[_0x21ed63(0x173)](0x1));const _0x3096ea=getConfigAppCode();let _0x92286d=_0x2d4d13['flags']['appcode'];const _0x253908=typeof _0x2d4d13[_0x21ed63(0x1a0)][_0x21ed63(0x179)]===_0x21ed63(0x186)?_0x2d4d13[_0x21ed63(0x1a0)][_0x21ed63(0x179)]:undefined,_0x5cbaae=_0x2d4d13[_0x21ed63(0x1a0)]['output'];!_0x92286d&&!_0x3096ea&&(console[_0x21ed63(0x184)](_0x21ed63(0x175)),console[_0x21ed63(0x174)](_0x21ed63(0x19a)),console['log'](_0x21ed63(0x19c)),console[_0x21ed63(0x174)](_0x21ed63(0x192)),process['exit'](0x1)),_0x92286d&&_0x3096ea&&_0x92286d===_0x3096ea&&(console[_0x21ed63(0x174)](_0x21ed63(0x177)+_0x92286d+_0x21ed63(0x197)),console['log'](_0x21ed63(0x19f)),_0x92286d=undefined),render(a8_0x20d7cd(ApiPullUI,{'appCode':_0x92286d,'env':_0x253908,'output':_0x5cbaae}));}else{if(_0x49b700==='doc'){_0x2d4d13['input'][0x2]&&(console[_0x21ed63(0x184)](_0x21ed63(0x18a)),console[_0x21ed63(0x174)](_0x21ed63(0x18f)),console[_0x21ed63(0x174)](_0x21ed63(0x17a)+_0x2d4d13[_0x21ed63(0x194)][0x2]),process[_0x21ed63(0x173)](0x1));const _0x1a9bc7=getConfigAppCode();let _0x9f704e=_0x2d4d13[_0x21ed63(0x1a0)][_0x21ed63(0x196)];const _0x420ee9=typeof _0x2d4d13[_0x21ed63(0x1a0)][_0x21ed63(0x179)]===_0x21ed63(0x186)?_0x2d4d13[_0x21ed63(0x1a0)]['env']:undefined,_0x21906f=_0x2d4d13[_0x21ed63(0x1a0)][_0x21ed63(0x17e)],_0x5f87b3=_0x2d4d13['flags']['params'],_0x2a79d5=_0x2d4d13['flags'][_0x21ed63(0x17d)];!_0x9f704e&&!_0x1a9bc7&&(console['error'](_0x21ed63(0x175)),console[_0x21ed63(0x174)](_0x21ed63(0x19a)),console[_0x21ed63(0x174)](_0x21ed63(0x19c)),console[_0x21ed63(0x174)](_0x21ed63(0x19e)),process[_0x21ed63(0x173)](0x1));_0x9f704e&&_0x1a9bc7&&_0x9f704e===_0x1a9bc7&&(console[_0x21ed63(0x174)](_0x21ed63(0x177)+_0x9f704e+'\x1b[0m'),_0x9f704e=undefined);let _0x388cc3;if(_0x5f87b3)try{_0x388cc3=JSON['parse'](_0x5f87b3),(typeof _0x388cc3!==_0x21ed63(0x19b)||_0x388cc3===null||Array[_0x21ed63(0x172)](_0x388cc3))&&(console['error'](_0x21ed63(0x195)),process[_0x21ed63(0x173)](0x1));}catch(_0xf3183f){console[_0x21ed63(0x184)](_0x21ed63(0x190)),console[_0x21ed63(0x184)](_0x21ed63(0x16f)+(_0xf3183f instanceof Error?_0xf3183f[_0x21ed63(0x17f)]:String(_0xf3183f))),process[_0x21ed63(0x173)](0x1);}let _0x149ae0;_0x2a79d5&&(_0x149ae0=_0x2a79d5[_0x21ed63(0x191)](',')[_0x21ed63(0x1a3)](_0x3506b1=>_0x3506b1['trim']())[_0x21ed63(0x18d)](_0x4ea6a5=>_0x4ea6a5[_0x21ed63(0x19d)]>0x0),_0x149ae0[_0x21ed63(0x19d)]===0x0&&(console[_0x21ed63(0x184)]('×\x20--datasetcode\x20参数不能为空'),process[_0x21ed63(0x173)](0x1)),console[_0x21ed63(0x174)](_0x21ed63(0x16e)+_0x149ae0[_0x21ed63(0x18e)](',\x20')+_0x21ed63(0x197))),render(a8_0x20d7cd(ApiDocUI,{'appCode':_0x9f704e,'env':_0x420ee9,'output':_0x21906f,'extraParams':_0x388cc3,'datasetCodes':_0x149ae0}));}else console[_0x21ed63(0x184)](_0x21ed63(0x178)+_0x49b700),console[_0x21ed63(0x174)](_0x21ed63(0x182)),console[_0x21ed63(0x174)](_0x21ed63(0x17b)),console[_0x21ed63(0x174)](_0x21ed63(0x1a6)),console['log'](_0x21ed63(0x18b)),console['log']('\x20\x20lovrabet\x20api\x20pull\x20--env\x20<env>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定环境(如:\x20daily,\x20online)'),console[_0x21ed63(0x174)](''),console[_0x21ed63(0x174)](_0x21ed63(0x1a5)),console[_0x21ed63(0x174)](_0x21ed63(0x187)),console['log'](_0x21ed63(0x1a2)),console[_0x21ed63(0x174)](_0x21ed63(0x181)),process[_0x21ed63(0x173)](0x1);}}
1
+ (function(_0x352bd3,_0x14aadf){const _0x2b1b04=a8_0x54ca,_0x374676=_0x352bd3();while(!![]){try{const _0x7e65a9=-parseInt(_0x2b1b04(0x1af))/0x1+-parseInt(_0x2b1b04(0x19b))/0x2+-parseInt(_0x2b1b04(0x1ad))/0x3*(-parseInt(_0x2b1b04(0x199))/0x4)+parseInt(_0x2b1b04(0x1a8))/0x5*(-parseInt(_0x2b1b04(0x1b3))/0x6)+parseInt(_0x2b1b04(0x1a5))/0x7*(parseInt(_0x2b1b04(0x18a))/0x8)+-parseInt(_0x2b1b04(0x19c))/0x9+parseInt(_0x2b1b04(0x194))/0xa;if(_0x7e65a9===_0x14aadf)break;else _0x374676['push'](_0x374676['shift']());}catch(_0x3f8fc3){_0x374676['push'](_0x374676['shift']());}}}(a8_0x4114,0x5af66));import{jsx as a8_0x3574e5}from'react/jsx-runtime';function a8_0x4114(){const _0x3aead9=['\x20\x20错误:\x20','×\x20未配置\x20AppCode','657336UxripQ','input','message','\x20\x20\x202.\x20使用参数:\x20lovrabet\x20api\x20pull\x20--appcode\x20<app-code>','请使用\x20--appcode\x20参数,例如:','pull','\x20\x20lovrabet\x20api\x20pull\x20--appcode\x20','appcode','map','filter','11936090mcQFxJ','error','split','\x1b[90m*\x20使用配置的应用AppCode:\x20','object','114508ToOSrO','\x1b[0m','1324858CzaVPD','3519045xdavUh','\x20\x20\x202.\x20使用参数:\x20lovrabet\x20api\x20doc\x20--appcode\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)','string','\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配置文件','flags','\x20\x20lovrabet\x20api\x20doc\x20--output\x20<dir>\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定文档输出目录(默认:\x20./docs)','×\x20--params\x20参数不是有效的\x20JSON\x20格式','\x20\x20lovrabet\x20api\x20doc\x20--appcode\x20<code>\x20\x20\x20\x20\x20\x20\x20//\x20使用指定的\x20appcode','42NOfmYX','doc','trim','90890WzYDIT','\x1b[90m*\x20仅生成指定数据集的文档:\x20','\x20\x20lovrabet\x20api\x20pull\x20--output\x20<dir>\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定输出目录(默认:\x20./src/api/)','Unknown\x20api\x20command:\x20','\x20\x20\x201.\x20配置默认值:\x20lovrabet\x20config\x20set\x20appcode\x20<app-code>','27qLlrdy','isArray','500060GXouwL','log','\x20\x20lovrabet\x20api\x20doc\x20--appcode\x20','output','6UmUcbb','\x20\x20lovrabet\x20api\x20pull\x20--appcode\x20<code>\x20\x20\x20\x20\x20\x20//\x20使用指定的\x20appcode','❌\x20错误:不再支持位置参数方式','exit','\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','help','length','\x1b[90m\x20\x20(注:\x20--appcode\x20参数与配置一致,将使用默认配置)\x1b[0m','env'];a8_0x4114=function(){return _0x3aead9;};return a8_0x4114();}import{render}from'ink';import{ApiPullUI}from'./api-pull-ui.js';function a8_0x54ca(_0x351710,_0x202062){_0x351710=_0x351710-0x180;const _0x411458=a8_0x4114();let _0x54ca7a=_0x411458[_0x351710];return _0x54ca7a;}import{ApiDocUI}from'./api-doc-ui.js';import{getConfigAppCode}from'../utils/config.js';export async function apiCli(_0x4ea689){const _0x23f3d5=a8_0x54ca,_0x116fb0=_0x4ea689[_0x23f3d5(0x18b)][0x1];if(_0x4ea689[_0x23f3d5(0x1a1)][_0x23f3d5(0x184)]){console[_0x23f3d5(0x1b0)](_0x23f3d5(0x183));return;}if(_0x116fb0===_0x23f3d5(0x18f)){_0x4ea689[_0x23f3d5(0x18b)][0x2]&&(console['error'](_0x23f3d5(0x181)),console[_0x23f3d5(0x1b0)](_0x23f3d5(0x18e)),console['log'](_0x23f3d5(0x190)+_0x4ea689[_0x23f3d5(0x18b)][0x2]),process['exit'](0x1));const _0x5561ff=getConfigAppCode();let _0x2be7f1=_0x4ea689['flags']['appcode'];const _0x14150b=typeof _0x4ea689['flags'][_0x23f3d5(0x187)]===_0x23f3d5(0x19f)?_0x4ea689['flags'][_0x23f3d5(0x187)]:undefined,_0x18f5c2=_0x4ea689['flags']['output'];!_0x2be7f1&&!_0x5561ff&&(console[_0x23f3d5(0x195)](_0x23f3d5(0x189)),console[_0x23f3d5(0x1b0)]('!\x20请使用以下方式之一:'),console[_0x23f3d5(0x1b0)](_0x23f3d5(0x1ac)),console['log'](_0x23f3d5(0x18d)),process[_0x23f3d5(0x182)](0x1)),_0x2be7f1&&_0x5561ff&&_0x2be7f1===_0x5561ff&&(console[_0x23f3d5(0x1b0)]('\x1b[90m*\x20使用配置的应用AppCode:\x20'+_0x2be7f1+_0x23f3d5(0x19a)),console[_0x23f3d5(0x1b0)](_0x23f3d5(0x186)),_0x2be7f1=undefined),render(a8_0x3574e5(ApiPullUI,{'appCode':_0x2be7f1,'env':_0x14150b,'output':_0x18f5c2}));}else{if(_0x116fb0===_0x23f3d5(0x1a6)){_0x4ea689[_0x23f3d5(0x18b)][0x2]&&(console[_0x23f3d5(0x195)](_0x23f3d5(0x181)),console[_0x23f3d5(0x1b0)]('请使用\x20--appcode\x20参数,例如:'),console['log'](_0x23f3d5(0x1b1)+_0x4ea689[_0x23f3d5(0x18b)][0x2]),process['exit'](0x1));const _0x3832e0=getConfigAppCode();let _0x234dbc=_0x4ea689[_0x23f3d5(0x1a1)][_0x23f3d5(0x191)];const _0x43afba=typeof _0x4ea689[_0x23f3d5(0x1a1)][_0x23f3d5(0x187)]===_0x23f3d5(0x19f)?_0x4ea689[_0x23f3d5(0x1a1)][_0x23f3d5(0x187)]:undefined,_0x460703=_0x4ea689[_0x23f3d5(0x1a1)][_0x23f3d5(0x1b2)],_0x272ec5=_0x4ea689[_0x23f3d5(0x1a1)]['params'],_0x431391=_0x4ea689['flags']['datasetcode'];!_0x234dbc&&!_0x3832e0&&(console[_0x23f3d5(0x195)](_0x23f3d5(0x189)),console['log']('!\x20请使用以下方式之一:'),console[_0x23f3d5(0x1b0)]('\x20\x20\x201.\x20配置默认值:\x20lovrabet\x20config\x20set\x20appcode\x20<app-code>'),console[_0x23f3d5(0x1b0)](_0x23f3d5(0x19d)),process['exit'](0x1));_0x234dbc&&_0x3832e0&&_0x234dbc===_0x3832e0&&(console[_0x23f3d5(0x1b0)](_0x23f3d5(0x197)+_0x234dbc+_0x23f3d5(0x19a)),_0x234dbc=undefined);let _0x5bc04e;if(_0x272ec5)try{_0x5bc04e=JSON['parse'](_0x272ec5),(typeof _0x5bc04e!==_0x23f3d5(0x198)||_0x5bc04e===null||Array[_0x23f3d5(0x1ae)](_0x5bc04e))&&(console['error']('×\x20--params\x20参数必须是一个有效的\x20JSON\x20对象'),process[_0x23f3d5(0x182)](0x1));}catch(_0x53ec3d){console[_0x23f3d5(0x195)](_0x23f3d5(0x1a3)),console[_0x23f3d5(0x195)](_0x23f3d5(0x188)+(_0x53ec3d instanceof Error?_0x53ec3d[_0x23f3d5(0x18c)]:String(_0x53ec3d))),process[_0x23f3d5(0x182)](0x1);}let _0x5c1794;_0x431391&&(_0x5c1794=_0x431391[_0x23f3d5(0x196)](',')[_0x23f3d5(0x192)](_0x1fb61b=>_0x1fb61b[_0x23f3d5(0x1a7)]())[_0x23f3d5(0x193)](_0x4244a6=>_0x4244a6[_0x23f3d5(0x185)]>0x0),_0x5c1794[_0x23f3d5(0x185)]===0x0&&(console[_0x23f3d5(0x195)]('×\x20--datasetcode\x20参数不能为空'),process[_0x23f3d5(0x182)](0x1)),console[_0x23f3d5(0x1b0)](_0x23f3d5(0x1a9)+_0x5c1794['join'](',\x20')+_0x23f3d5(0x19a))),render(a8_0x3574e5(ApiDocUI,{'appCode':_0x234dbc,'env':_0x43afba,'output':_0x460703,'extraParams':_0x5bc04e,'datasetCodes':_0x5c1794}));}else console['error'](_0x23f3d5(0x1ab)+_0x116fb0),console[_0x23f3d5(0x1b0)]('Available\x20commands:'),console[_0x23f3d5(0x1b0)](_0x23f3d5(0x1a0)),console['log'](_0x23f3d5(0x180)),console[_0x23f3d5(0x1b0)](_0x23f3d5(0x1aa)),console[_0x23f3d5(0x1b0)](_0x23f3d5(0x19e)),console[_0x23f3d5(0x1b0)](''),console[_0x23f3d5(0x1b0)]('\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文档'),console['log'](_0x23f3d5(0x1a4)),console[_0x23f3d5(0x1b0)](_0x23f3d5(0x1a2)),console[_0x23f3d5(0x1b0)]('\x20\x20lovrabet\x20api\x20doc\x20--env\x20<env>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定环境(如:\x20daily,\x20online)'),process[_0x23f3d5(0x182)](0x1);}}
@@ -1 +1 @@
1
- function a9_0x1b7a(_0x312a63,_0x17da21){_0x312a63=_0x312a63-0x16f;const _0x56ce52=a9_0x56ce();let _0x1b7ac5=_0x56ce52[_0x312a63];return _0x1b7ac5;}(function(_0x8e4a6b,_0x2edb3e){const _0x54e25a=a9_0x1b7a,_0x47ccf6=_0x8e4a6b();while(!![]){try{const _0x1fb9fd=-parseInt(_0x54e25a(0x187))/0x1*(-parseInt(_0x54e25a(0x17f))/0x2)+parseInt(_0x54e25a(0x172))/0x3+parseInt(_0x54e25a(0x182))/0x4+-parseInt(_0x54e25a(0x180))/0x5+-parseInt(_0x54e25a(0x18e))/0x6+-parseInt(_0x54e25a(0x184))/0x7*(-parseInt(_0x54e25a(0x17a))/0x8)+parseInt(_0x54e25a(0x188))/0x9;if(_0x1fb9fd===_0x2edb3e)break;else _0x47ccf6['push'](_0x47ccf6['shift']());}catch(_0x4d7183){_0x47ccf6['push'](_0x47ccf6['shift']());}}}(a9_0x56ce,0x505ef));import{readConfig}from'../utils/config.js';function a9_0x56ce(){const _0x41ad1b=['length','API\x20配置拉取成功:\x20','-api','test','3752976bfrPjS','.ts\x20-\x20客户端实例文件','online','env','info','*\x20正在处理\x20','API\x20配置拉取异常:\x20','864138tlBBDq','client','√\x20成功拉取\x20','create-api-pull','trim','cwd','\x20个数据集...','\x20个模型','1254272QVyUtV','\x20\x20\x20•\x20','string','log','chdir','308WUxZPp','1854395VznBSm','message','1157192fcGAHz','×\x20文件前缀格式不正确。只能包含字母、数字、连字符和下划线,且必须以字母开头。','21HjYorK','modelCount','*\x20开始生成\x20API\x20配置文件:','491uphbVE','1820376PutbnP','error'];a9_0x56ce=function(){return _0x41ad1b;};return a9_0x56ce();}import{initEnv}from'../constant/env.js';import{generateApiFile}from'./generate-api-file.js';import{logger}from'../utils/logger.js';import{fetchModelList}from'./fetch-model-list.js';export async function pullApiSilent(_0x4c99be,_0x2ffa6e,_0x391cd8,_0x462b0b){const _0x310165=a9_0x1b7a;let _0x1fd8f4;try{const _0x558bd3=_0x2ffa6e?.[_0x310165(0x176)]()||'';if(_0x558bd3){const _0x4d7299=/^[a-zA-Z][a-zA-Z0-9_-]*$/;if(!_0x4d7299[_0x310165(0x18d)](_0x558bd3))return console['error'](_0x310165(0x183)),![];}_0x391cd8&&(_0x1fd8f4=process[_0x310165(0x177)](),process[_0x310165(0x17e)](_0x391cd8));const _0x2f5919=readConfig(),_0x30f55b=typeof _0x2f5919[_0x310165(0x191)]===_0x310165(0x17c)?_0x2f5919[_0x310165(0x191)]:undefined,_0x2ce264=_0x462b0b||_0x30f55b||_0x310165(0x190);initEnv(_0x2ce264),console[_0x310165(0x17d)]('*\x20正在从服务器拉取\x20API\x20配置...\x20(环境:\x20'+_0x2ce264+')');const {configArray:_0xb38fdd}=await fetchModelList(_0x4c99be),_0x28d1f0=_0x558bd3?_0x558bd3+_0x310165(0x18c):'api',_0x2ecf29=_0x558bd3?_0x558bd3+'-client':_0x310165(0x173);console[_0x310165(0x17d)](_0x310165(0x186)),console['log'](_0x310165(0x17b)+_0x28d1f0+'.ts\x20-\x20模型配置文件'),console[_0x310165(0x17d)](_0x310165(0x17b)+_0x2ecf29+_0x310165(0x18f)),console[_0x310165(0x17d)](_0x310165(0x170)+_0xb38fdd[_0x310165(0x18a)]+_0x310165(0x178));const _0x24ae39=await generateApiFile(_0xb38fdd,_0x558bd3,_0x4c99be,!![],_0x2ce264);return console['log'](_0x310165(0x174)+_0xb38fdd[_0x310165(0x18a)]+'\x20个数据集,生成\x20'+_0x24ae39[_0x310165(0x185)]+_0x310165(0x179)),_0x391cd8&&logger[_0x310165(0x16f)](_0x310165(0x175),_0x310165(0x18b)+_0x4c99be,{'projectPath':_0x391cd8,'appCode':_0x4c99be,'datasetCount':_0xb38fdd[_0x310165(0x18a)],'filePrefix':_0x558bd3}),!![];}catch(_0x525860){const _0x2811ee=_0x525860 instanceof Error?_0x525860[_0x310165(0x181)]:String(_0x525860);return console[_0x310165(0x189)]('×\x20API\x20配置拉取异常:',_0x2811ee),_0x391cd8&&logger[_0x310165(0x189)](_0x310165(0x175),_0x310165(0x171)+_0x2811ee,{'appCode':_0x4c99be,'projectPath':_0x391cd8}),![];}finally{_0x1fd8f4&&process[_0x310165(0x17e)](_0x1fd8f4);}}
1
+ (function(_0x42aec5,_0x249823){const _0x4d3690=a9_0x289f,_0x55906d=_0x42aec5();while(!![]){try{const _0x15bf83=-parseInt(_0x4d3690(0x114))/0x1+-parseInt(_0x4d3690(0x11b))/0x2+-parseInt(_0x4d3690(0x100))/0x3*(parseInt(_0x4d3690(0x116))/0x4)+parseInt(_0x4d3690(0x115))/0x5+parseInt(_0x4d3690(0xfe))/0x6*(parseInt(_0x4d3690(0x102))/0x7)+-parseInt(_0x4d3690(0x112))/0x8*(-parseInt(_0x4d3690(0x10d))/0x9)+-parseInt(_0x4d3690(0x120))/0xa;if(_0x15bf83===_0x249823)break;else _0x55906d['push'](_0x55906d['shift']());}catch(_0x318461){_0x55906d['push'](_0x55906d['shift']());}}}(a9_0x5db0,0xa27fb));import{readConfig}from'../utils/config.js';function a9_0x289f(_0x2affe0,_0x46d29b){_0x2affe0=_0x2affe0-0xfe;const _0x5db0f3=a9_0x5db0();let _0x289f9c=_0x5db0f3[_0x2affe0];return _0x289f9c;}import{initEnv}from'../constant/env.js';import{generateApiFile}from'./generate-api-file.js';function a9_0x5db0(){const _0x3b7d0e=['message','1030648DqLUQJ','\x20个模型','371487bHMtbr','4490105yszgaG','461212zInode','×\x20文件前缀格式不正确。只能包含字母、数字、连字符和下划线,且必须以字母开头。','API\x20配置拉取成功:\x20','client','.ts\x20-\x20模型配置文件','242756IxVQRJ','info','trim','error','*\x20开始生成\x20API\x20配置文件:','1903360iYhRrC','×\x20API\x20配置拉取异常:','103902HXlhNA','api','27CRuKQR','-api','133euTUmA','.ts\x20-\x20客户端实例文件','*\x20正在从服务器拉取\x20API\x20配置...\x20(环境:\x20','cwd','-client','chdir','length','√\x20成功拉取\x20','log','*\x20正在处理\x20','\x20个数据集,生成\x20','81PAnaCv','\x20\x20\x20•\x20','env','create-api-pull'];a9_0x5db0=function(){return _0x3b7d0e;};return a9_0x5db0();}import{logger}from'../utils/logger.js';import{fetchModelList}from'./fetch-model-list.js';export async function pullApiSilent(_0x559273,_0x27b9b3,_0x2b6479,_0x2672b4){const _0x3948ca=a9_0x289f;let _0x1723b6;try{const _0x74f8d7=_0x27b9b3?.[_0x3948ca(0x11d)]()||'';if(_0x74f8d7){const _0x2d15d4=/^[a-zA-Z][a-zA-Z0-9_-]*$/;if(!_0x2d15d4['test'](_0x74f8d7))return console[_0x3948ca(0x11e)](_0x3948ca(0x117)),![];}_0x2b6479&&(_0x1723b6=process[_0x3948ca(0x105)](),process[_0x3948ca(0x107)](_0x2b6479));const _0x34f917=readConfig(),_0x136f4e=typeof _0x34f917[_0x3948ca(0x10f)]==='string'?_0x34f917[_0x3948ca(0x10f)]:undefined,_0x2351cb=_0x2672b4||_0x136f4e||'online';initEnv(_0x2351cb),console['log'](_0x3948ca(0x104)+_0x2351cb+')');const {configArray:_0x4d03ec}=await fetchModelList(_0x559273),_0x467363=_0x74f8d7?_0x74f8d7+_0x3948ca(0x101):_0x3948ca(0xff),_0x45e7dc=_0x74f8d7?_0x74f8d7+_0x3948ca(0x106):_0x3948ca(0x119);console['log'](_0x3948ca(0x11f)),console[_0x3948ca(0x10a)]('\x20\x20\x20•\x20'+_0x467363+_0x3948ca(0x11a)),console[_0x3948ca(0x10a)](_0x3948ca(0x10e)+_0x45e7dc+_0x3948ca(0x103)),console['log'](_0x3948ca(0x10b)+_0x4d03ec['length']+'\x20个数据集...');const _0x2a8147=await generateApiFile(_0x4d03ec,_0x74f8d7,_0x559273,!![],_0x2351cb);return console[_0x3948ca(0x10a)](_0x3948ca(0x109)+_0x4d03ec['length']+_0x3948ca(0x10c)+_0x2a8147['modelCount']+_0x3948ca(0x113)),_0x2b6479&&logger[_0x3948ca(0x11c)]('create-api-pull',_0x3948ca(0x118)+_0x559273,{'projectPath':_0x2b6479,'appCode':_0x559273,'datasetCount':_0x4d03ec[_0x3948ca(0x108)],'filePrefix':_0x74f8d7}),!![];}catch(_0x54041d){const _0x3a0a34=_0x54041d instanceof Error?_0x54041d[_0x3948ca(0x111)]:String(_0x54041d);return console[_0x3948ca(0x11e)](_0x3948ca(0x121),_0x3a0a34),_0x2b6479&&logger[_0x3948ca(0x11e)](_0x3948ca(0x110),'API\x20配置拉取异常:\x20'+_0x3a0a34,{'appCode':_0x559273,'projectPath':_0x2b6479}),![];}finally{_0x1723b6&&process[_0x3948ca(0x107)](_0x1723b6);}}
@@ -1 +1 @@
1
- function a10_0xe239(){const _0x3e9497=['message','36qsqLsM','*\x20正在创建菜单...','delete','trim','[\x20]','JS\x20链接','*\x20请选择要同步的菜单:','done','fill','30kzqHvb','*\x20同步菜单到\x20Lovrabet\x20平台','CSS\x20链接','*\x20CSS\x20链接:\x20','2315336GubmbT','↑/↓:\x20移动光标\x20空格:\x20切换选中\x20a:\x20全选\x20i/r:\x20反选\x20Enter:\x20确认','gray','then','filter','path','提示:使用\x20','Lovrabet平台','JS\x20链接无法访问','12666vBciqn','[✓]','!\x20未找到本地页面,请先创建页面','\x20命令重新登录','请输入有效的\x20JS\x20https\x20链接','map','\x20正在获取线上菜单列表...','backspace','blue','yellow','slice','white','2992678EKDHPI','return','27913413qHwLSy','online','join','1279679inxpdN','已选择菜单','local','add','35IQdHrk','249565bmryFY','lovrabet\x20auth','size','includes','creating','red','input-js','11643678CgSEgz','column','max','√\x20菜单创建完成','844gEGQeU','input-css','CSS\x20链接无法访问','创建菜单失败','\x20←\x20','dots','catch','\x20输入项目的\x20CSS\x20资源链接(https://...)','green','菜单名称','repeat','has','downArrow','cyan','length','*\x20JS\x20链接:\x20','selecting','value','label'];a10_0xe239=function(){return _0x3e9497;};return a10_0xe239();}(function(_0x4a9c6d,_0x48d416){const _0x1e0c41=a10_0x529e,_0x4d90c3=_0x4a9c6d();while(!![]){try{const _0x2aed1b=-parseInt(_0x1e0c41(0x125))/0x1+-parseInt(_0x1e0c41(0x120))/0x2+parseInt(_0x1e0c41(0x114))/0x3*(-parseInt(_0x1e0c41(0xea))/0x4)+parseInt(_0x1e0c41(0x12a))/0x5*(-parseInt(_0x1e0c41(0xfe))/0x6)+parseInt(_0x1e0c41(0x129))/0x7*(-parseInt(_0x1e0c41(0x10b))/0x8)+-parseInt(_0x1e0c41(0xe6))/0x9+-parseInt(_0x1e0c41(0x107))/0xa*(-parseInt(_0x1e0c41(0x122))/0xb);if(_0x2aed1b===_0x48d416)break;else _0x4d90c3['push'](_0x4d90c3['shift']());}catch(_0x1e23d7){_0x4d90c3['push'](_0x4d90c3['shift']());}}}(a10_0xe239,0xdd170));function a10_0x529e(_0x4c8605,_0x16b06b){_0x4c8605=_0x4c8605-0xe2;const _0xe239f8=a10_0xe239();let _0x529ea1=_0xe239f8[_0x4c8605];return _0x529ea1;}import{jsx as a10_0x46b81e,jsxs as a10_0x16ef84,Fragment as a10_0x4db1d4}from'react/jsx-runtime';import{Text,Box,useInput,useApp,render}from'ink';import{useEffect,useState}from'react';import a10_0x22f389 from'ink-spinner';import{useGetOnlineMenuList}from'./use-get-online-menu-list.js';import{getLocalPages}from'./get-local-pages.js';import{createMenus}from'./create-menu.js';import{isUrlReachable,isValidCssHttpsUrl,isValidJsHttpsUrl}from'./valid-url.js';import.meta.main&&render(a10_0x46b81e(AppMenuSyncUI,{}));export function AppMenuSyncUI(){const _0x57789a=a10_0x529e,{exit:_0x32598e}=useApp(),{loading:_0x80ec1b,menuList:_0x3ee33b,error:_0x2fc116}=useGetOnlineMenuList(),_0x3d3b91=getLocalPages(),_0x2b8f22=_0x3ee33b[_0x57789a(0x119)](_0x1604f1=>_0x1604f1[_0x57789a(0x110)]),_0x345b73=['菜单名称',..._0x3d3b91[_0x57789a(0x119)](_0x517f98=>_0x517f98['label'])],_0x3cb708=getStringWidth(getMaxWidth(_0x345b73,0x4)),_0x164fe7=getStringWidth(getMaxWidth([_0x57789a(0xf3)])),[_0x420a4b,_0x44a935]=useState('selecting'),[_0x339b3a,_0x577d22]=useState(new Set()),[_0x170912,_0xeb205c]=useState(0x0),[_0x2bd400,_0x213db6]=useState(''),[_0x250555,_0x5d7f1e]=useState(''),[_0x10a5c7,_0x4f0e82]=useState(''),[_0x5d2334,_0x4599e1]=useState(''),[_0x5a5640,_0x1ec8e9]=useState([]),_0x52d11f=_0x3d3b91[_0x57789a(0x119)](_0x3695c5=>({'label':_0x3695c5['label'],'path':_0x3695c5[_0x57789a(0x110)],'local':!![],'online':_0x2b8f22['includes'](_0x3695c5[_0x57789a(0x110)])})),_0xea870e=_0x3d3b91[_0x57789a(0x10f)](_0x42c0d1=>{const _0x46f64f=_0x57789a;return!_0x2b8f22[_0x46f64f(0xe2)](_0x42c0d1[_0x46f64f(0x110)]);});useEffect(()=>{const _0xd6780f=_0x57789a;if(!_0x80ec1b&&_0x3d3b91[_0xd6780f(0xf8)]>0x0&&_0x339b3a[_0xd6780f(0x12c)]===0x0){const _0x43ba7b=new Set(_0x3d3b91[_0xd6780f(0x119)]((_0x1b1b8e,_0xccfb23)=>({'page':_0x1b1b8e,'index':_0xccfb23}))['filter'](({page:_0x525ebc})=>!_0x2b8f22[_0xd6780f(0xe2)](_0x525ebc['path']))[_0xd6780f(0x119)](({index:_0x542f5c})=>_0x542f5c));_0x577d22(_0x43ba7b);}},[_0x80ec1b,_0x3d3b91[_0x57789a(0xf8)],_0x2b8f22['length']]),useInput(async(_0x401e6f,_0x10acbc)=>{const _0x497e2b=_0x57789a;if(_0x420a4b==='selecting'){if(_0x10acbc['upArrow']){_0xeb205c(_0xe8cff8=>_0xe8cff8>0x0?_0xe8cff8-0x1:_0x3d3b91[_0x497e2b(0xf8)]-0x1);return;}if(_0x10acbc[_0x497e2b(0xf6)]){_0xeb205c(_0x52a1b0=>_0x52a1b0<_0x3d3b91['length']-0x1?_0x52a1b0+0x1:0x0);return;}if(_0x401e6f==='\x20'){_0x577d22(_0x52cc4a=>{const _0x3abf9a=_0x497e2b,_0x5f2892=new Set(_0x52cc4a);return _0x5f2892[_0x3abf9a(0xf5)](_0x170912)?_0x5f2892['delete'](_0x170912):_0x5f2892['add'](_0x170912),_0x5f2892;});return;}if(_0x401e6f==='a'||_0x401e6f==='A'){const _0x26fa24=new Set(_0x3d3b91[_0x497e2b(0x119)]((_0x336091,_0x4a9474)=>_0x4a9474));_0x577d22(_0x26fa24);return;}if(_0x401e6f==='i'||_0x401e6f==='I'||_0x401e6f==='r'||_0x401e6f==='R'){_0x577d22(_0x534b5d=>{const _0x375cf5=_0x497e2b,_0x2ea407=new Set();for(let _0x3e18a2=0x0;_0x3e18a2<_0x3d3b91[_0x375cf5(0xf8)];_0x3e18a2++){!_0x534b5d[_0x375cf5(0xf5)](_0x3e18a2)&&_0x2ea407[_0x375cf5(0x128)](_0x3e18a2);}return _0x2ea407;});return;}if(_0x401e6f==='q'||_0x401e6f==='Q'){_0x32598e();return;}if(_0x10acbc[_0x497e2b(0x121)]){if(_0x339b3a[_0x497e2b(0x12c)]===0x0){_0x4599e1('请至少选择一个菜单');return;}const _0x277f45=_0x3d3b91[_0x497e2b(0x10f)]((_0x315acb,_0x164ef1)=>_0x339b3a['has'](_0x164ef1)),_0x40e5f5=_0x277f45[_0x497e2b(0x119)](_0x2e4ec6=>_0x2e4ec6[_0x497e2b(0xfc)])[_0x497e2b(0x124)](',\x20');_0x1ec8e9([{'label':_0x497e2b(0x126),'value':_0x339b3a['size']+'\x20个'}]),_0x4599e1(''),_0x44a935('input-js');return;}return;}if(_0x420a4b===_0x497e2b(0xe5)){if(_0x10acbc[_0x497e2b(0x121)]){const _0x4df648=_0x10a5c7[_0x497e2b(0x101)]();if(_0x4df648==='')return;if(!isValidJsHttpsUrl(_0x4df648)){_0x4599e1(_0x497e2b(0x118));return;}if(!await isUrlReachable(_0x4df648)){_0x4599e1(_0x497e2b(0x113));return;}_0x213db6(_0x4df648),_0x1ec8e9(_0x385ab2=>[..._0x385ab2,{'label':_0x497e2b(0x103),'value':_0x4df648}]),_0x4f0e82(''),_0x4599e1(''),_0x44a935(_0x497e2b(0xeb));return;}if(_0x10acbc[_0x497e2b(0x11b)]||_0x10acbc[_0x497e2b(0x100)]){_0x4f0e82(_0x45f3a9=>_0x45f3a9[_0x497e2b(0x11e)](0x0,-0x1)),_0x4599e1('');return;}_0x4f0e82(_0x2c4c19=>_0x2c4c19+_0x401e6f);return;}if(_0x420a4b==='input-css'){if(_0x10acbc[_0x497e2b(0x121)]){const _0x5c7983=_0x10a5c7[_0x497e2b(0x101)]();if(_0x5c7983==='')return;if(!isValidCssHttpsUrl(_0x5c7983)){_0x4599e1('请输入有效的\x20CSS\x20https\x20链接');return;}if(!await isUrlReachable(_0x5c7983)){_0x4599e1(_0x497e2b(0xec));return;}_0x5d7f1e(_0x5c7983),_0x1ec8e9(_0x474c58=>[..._0x474c58,{'label':_0x497e2b(0x109),'value':_0x5c7983}]),_0x4f0e82(''),_0x4599e1(''),_0x44a935(_0x497e2b(0xe3));const _0x11807e=_0x3d3b91['filter']((_0x497f58,_0xdd358b)=>_0x339b3a[_0x497e2b(0xf5)](_0xdd358b));createMenus(_0x11807e,[_0x2bd400,_0x5c7983])[_0x497e2b(0x10e)](()=>{const _0x2eba37=_0x497e2b;_0x44a935(_0x2eba37(0x105)),setTimeout(()=>{_0x32598e();},0x3e8);})[_0x497e2b(0xf0)](_0x34cf83=>{const _0x4f73c9=_0x497e2b;_0x4599e1(_0x34cf83[_0x4f73c9(0xfd)]||_0x4f73c9(0xed)),_0x44a935('selecting');});return;}if(_0x10acbc[_0x497e2b(0x11b)]||_0x10acbc['delete']){_0x4f0e82(_0x4f7f69=>_0x4f7f69['slice'](0x0,-0x1)),_0x4599e1('');return;}_0x4f0e82(_0x16d577=>_0x16d577+_0x401e6f);return;}});if(_0x80ec1b)return a10_0x16ef84(Box,{'marginTop':0x1,'marginBottom':0x1,'children':[a10_0x46b81e(Text,{'children':'\x20\x20'}),a10_0x46b81e(a10_0x22f389,{'type':_0x57789a(0xef)}),a10_0x46b81e(Text,{'children':_0x57789a(0x11a)})]});if(_0x2fc116)return a10_0x16ef84(Box,{'flexDirection':'column','marginTop':0x1,'marginBottom':0x1,'children':[a10_0x16ef84(Text,{'color':_0x57789a(0xe4),'children':['✗\x20',_0x2fc116]}),a10_0x16ef84(Box,{'marginTop':0x1,'children':[a10_0x46b81e(Text,{'color':_0x57789a(0x10d),'children':_0x57789a(0x111)}),a10_0x46b81e(Text,{'color':'cyan','children':_0x57789a(0x12b)}),a10_0x46b81e(Text,{'color':_0x57789a(0x10d),'children':_0x57789a(0x117)})]})]});if(_0x3d3b91[_0x57789a(0xf8)]===0x0)return a10_0x46b81e(Box,{'marginTop':0x1,'marginBottom':0x1,'children':a10_0x46b81e(Text,{'color':_0x57789a(0x11d),'children':_0x57789a(0x116)})});return a10_0x16ef84(Box,{'flexDirection':_0x57789a(0xe7),'marginTop':0x1,'marginBottom':0x1,'children':[_0x420a4b===_0x57789a(0xfa)&&a10_0x16ef84(a10_0x4db1d4,{'children':[a10_0x16ef84(Box,{'children':[a10_0x16ef84(Text,{'bold':!![],'children':['\x20\x20',_0x57789a(0xf3),getRemainingSpaces(_0x3cb708,'菜单名称')]}),a10_0x16ef84(Text,{'bold':!![],'children':['本地',getRemainingSpaces(_0x164fe7,_0x57789a(0xf3))]}),a10_0x16ef84(Text,{'bold':!![],'children':[_0x57789a(0x112),getRemainingSpaces(_0x164fe7,_0x57789a(0xf3))]})]}),_0x52d11f[_0x57789a(0x119)](_0x2d43a1=>a10_0x16ef84(Box,{'children':[a10_0x16ef84(Text,{'children':['\x20\x20',_0x2d43a1['label'],getRemainingSpaces(_0x3cb708,_0x2d43a1[_0x57789a(0xfc)])]}),a10_0x16ef84(Text,{'color':_0x57789a(0xf2),'children':[_0x2d43a1[_0x57789a(0x127)]?'✓':'✗',getRemainingSpaces(_0x164fe7,'✓')]}),a10_0x16ef84(Text,{'color':_0x2d43a1[_0x57789a(0x123)]?_0x57789a(0xf2):_0x57789a(0xe4),'children':[_0x2d43a1[_0x57789a(0x123)]?'✓':'✗',getRemainingSpaces(_0x164fe7,'✓')]})]},_0x2d43a1[_0x57789a(0x110)]))]}),_0x420a4b==='selecting'&&_0x5a5640[_0x57789a(0xf8)]===0x0&&a10_0x46b81e(Box,{'marginTop':0x1,'children':a10_0x46b81e(Text,{'color':_0x57789a(0xf7),'children':_0x57789a(0x108)})}),_0x5a5640[_0x57789a(0x119)]((_0x201e07,_0x12c935)=>a10_0x16ef84(Box,{'children':[a10_0x16ef84(Text,{'color':'green','children':['√\x20',_0x201e07[_0x57789a(0xfc)],':\x20']}),a10_0x46b81e(Text,{'color':_0x57789a(0xf7),'children':_0x201e07[_0x57789a(0xfb)]})]},_0x12c935)),_0x5d2334&&_0x420a4b===_0x57789a(0xfa)&&a10_0x46b81e(Box,{'marginTop':0x1,'children':a10_0x16ef84(Text,{'color':_0x57789a(0xe4),'children':['✗\x20',_0x5d2334]})}),_0x420a4b===_0x57789a(0xfa)&&a10_0x46b81e(a10_0x4db1d4,{'children':a10_0x16ef84(Box,{'marginTop':_0x5a5640[_0x57789a(0xf8)]>0x0||_0x5d2334?0x1:0x0,'flexDirection':_0x57789a(0xe7),'children':[a10_0x46b81e(Text,{'bold':!![],'children':_0x57789a(0x104)}),_0x3d3b91[_0x57789a(0x119)]((_0x4104b2,_0x3ebaeb)=>{const _0x83dd8e=_0x57789a,_0x2d57fa=_0x170912===_0x3ebaeb,_0x111e33=_0x339b3a[_0x83dd8e(0xf5)](_0x3ebaeb),_0x48e9fa=_0x2b8f22[_0x83dd8e(0xe2)](_0x4104b2['path']),_0xbfefe3=_0x48e9fa?'更新':'新建';return a10_0x46b81e(Box,{'children':a10_0x16ef84(Text,{'backgroundColor':_0x2d57fa?_0x83dd8e(0x11c):undefined,'color':_0x2d57fa?_0x83dd8e(0x11f):undefined,'children':['\x20\x20',_0x111e33?_0x83dd8e(0x115):_0x83dd8e(0x102),'\x20',_0x4104b2[_0x83dd8e(0xfc)]]})},_0x4104b2[_0x83dd8e(0x110)]);}),a10_0x46b81e(Box,{'marginTop':0x1,'children':a10_0x16ef84(Text,{'color':_0x57789a(0x10d),'children':['\x20',_0x57789a(0x10c)]})})]})}),_0x420a4b===_0x57789a(0xe5)&&a10_0x16ef84(a10_0x4db1d4,{'children':[a10_0x16ef84(Box,{'children':[a10_0x46b81e(Text,{'children':_0x57789a(0xf9)}),a10_0x46b81e(Text,{'color':'green','children':_0x10a5c7}),_0x5d2334&&a10_0x16ef84(Text,{'color':_0x57789a(0xe4),'children':['\x20←\x20',_0x5d2334]})]}),!_0x5d2334&&a10_0x46b81e(Box,{'children':a10_0x46b81e(Text,{'color':_0x57789a(0x10d),'children':'\x20输入项目的\x20JS\x20资源链接(https://...)'})})]}),_0x420a4b===_0x57789a(0xeb)&&a10_0x16ef84(a10_0x4db1d4,{'children':[a10_0x16ef84(Box,{'children':[a10_0x46b81e(Text,{'children':_0x57789a(0x10a)}),a10_0x46b81e(Text,{'color':_0x57789a(0xf2),'children':_0x10a5c7}),_0x5d2334&&a10_0x16ef84(Text,{'color':_0x57789a(0xe4),'children':[_0x57789a(0xee),_0x5d2334]})]}),!_0x5d2334&&a10_0x46b81e(Box,{'children':a10_0x46b81e(Text,{'color':_0x57789a(0x10d),'children':_0x57789a(0xf1)})})]}),_0x420a4b==='creating'&&a10_0x46b81e(Box,{'children':a10_0x46b81e(Text,{'children':_0x57789a(0xff)})}),_0x420a4b==='done'&&a10_0x46b81e(Box,{'children':a10_0x46b81e(Text,{'color':_0x57789a(0xf2),'children':_0x57789a(0xe9)})})]});}function getStringWidth(_0x120bf3){let _0x505166=0x0;for(const _0x58a973 of _0x120bf3){/[\u4e00-\u9fa5]/['test'](_0x58a973)?_0x505166+=0x2:_0x505166+=0x1;}return _0x505166;}function getRemainingSpaces(_0x419ed0,_0x5dff6e){const _0x26374a=a10_0x529e,_0x5f5beb=getStringWidth(_0x5dff6e);return Array(Math[_0x26374a(0xe8)](0x0,_0x419ed0-_0x5f5beb))[_0x26374a(0x106)]('\x20')[_0x26374a(0x124)]('');}function getMaxWidth(_0x189170,_0x1a4ac7=0x2){const _0x10628c=a10_0x529e;let _0x5403ab='',_0x2aaa08=0x0;for(const _0x309098 of _0x189170){const _0x4851b9=getStringWidth(_0x309098);_0x4851b9>_0x2aaa08&&(_0x2aaa08=_0x4851b9,_0x5403ab=_0x309098);}return _0x5403ab+'\x20'[_0x10628c(0xf4)](_0x1a4ac7);}
1
+ (function(_0x457336,_0x210251){const _0x3fac03=a10_0x3f04,_0x2424d1=_0x457336();while(!![]){try{const _0x52fbf6=-parseInt(_0x3fac03(0x1cc))/0x1+-parseInt(_0x3fac03(0x1ba))/0x2+parseInt(_0x3fac03(0x1c3))/0x3+-parseInt(_0x3fac03(0x1bd))/0x4+-parseInt(_0x3fac03(0x1d3))/0x5+-parseInt(_0x3fac03(0x1d8))/0x6+parseInt(_0x3fac03(0x1b3))/0x7*(parseInt(_0x3fac03(0x1aa))/0x8);if(_0x52fbf6===_0x210251)break;else _0x2424d1['push'](_0x2424d1['shift']());}catch(_0x4b6607){_0x2424d1['push'](_0x2424d1['shift']());}}}(a10_0xfba7,0xafa4f));import{jsx as a10_0x8a122f,jsxs as a10_0x3898a0,Fragment as a10_0x51efae}from'react/jsx-runtime';import{Text,Box,useInput,useApp,render}from'ink';import{useEffect,useState}from'react';import a10_0x38db07 from'ink-spinner';import{useGetOnlineMenuList}from'./use-get-online-menu-list.js';import{getLocalPages}from'./get-local-pages.js';function a10_0x3f04(_0x48b78c,_0x1c9e47){_0x48b78c=_0x48b78c-0x1aa;const _0xfba794=a10_0xfba7();let _0x3f0464=_0xfba794[_0x48b78c];return _0x3f0464;}import{createMenus}from'./create-menu.js';import{isUrlReachable,isValidCssHttpsUrl,isValidJsHttpsUrl}from'./valid-url.js';import.meta.main&&render(a10_0x8a122f(AppMenuSyncUI,{}));function a10_0xfba7(){const _0x2a0a10=['blue','label','*\x20请选择要同步的菜单:','2363880VyasIf','请至少选择一个菜单','Lovrabet平台','\x20输入项目的\x20JS\x20资源链接(https://...)','JS\x20链接','size','gray','backspace','map','lovrabet\x20auth','trim','[✓]','yellow','cyan','\x20命令重新登录','add','JS\x20链接无法访问','8ITiCZL','filter','创建菜单失败','green','fill','CSS\x20链接','join','delete','return','28156009vxMKCo','max','local','length','has','input-js','online','2553804mmURKA','path','↑/↓:\x20移动光标\x20空格:\x20切换选中\x20a:\x20全选\x20i/r:\x20反选\x20Enter:\x20确认','975344dUuihq','downArrow','includes','*\x20CSS\x20链接:\x20','\x20←\x20','message','1428033FEUaTV','\x20输入项目的\x20CSS\x20资源链接(https://...)','column','input-css','slice','√\x20菜单创建完成','菜单名称','请输入有效的\x20CSS\x20https\x20链接','white','1091608RxRMea','*\x20JS\x20链接:\x20','repeat','done','red','selecting','*\x20正在创建菜单...','3862665dncrrH','\x20正在获取线上菜单列表...'];a10_0xfba7=function(){return _0x2a0a10;};return a10_0xfba7();}export function AppMenuSyncUI(){const _0x21c916=a10_0x3f04,{exit:_0xe2e11}=useApp(),{loading:_0x1c5004,menuList:_0x2e637e,error:_0x3b31f1}=useGetOnlineMenuList(),_0x4d7058=getLocalPages(),_0x6e90a=_0x2e637e[_0x21c916(0x1e0)](_0x28d61e=>_0x28d61e['path']),_0x442a34=[_0x21c916(0x1c9),..._0x4d7058['map'](_0x588ba9=>_0x588ba9[_0x21c916(0x1d6)])],_0x214203=getStringWidth(getMaxWidth(_0x442a34,0x4)),_0x54c4b5=getStringWidth(getMaxWidth([_0x21c916(0x1c9)])),[_0x221300,_0x435ce4]=useState(_0x21c916(0x1d1)),[_0x4a699b,_0x5e0f2b]=useState(new Set()),[_0x374877,_0x2ca832]=useState(0x0),[_0x4b7387,_0x2d0f0c]=useState(''),[_0x4381a2,_0x436ead]=useState(''),[_0x176d14,_0x3ca796]=useState(''),[_0x3c82d4,_0x422aa3]=useState(''),[_0x24ab2f,_0x33a4db]=useState([]),_0x1a3086=_0x4d7058[_0x21c916(0x1e0)](_0x28dd12=>({'label':_0x28dd12[_0x21c916(0x1d6)],'path':_0x28dd12[_0x21c916(0x1bb)],'local':!![],'online':_0x6e90a[_0x21c916(0x1bf)](_0x28dd12[_0x21c916(0x1bb)])})),_0x52653c=_0x4d7058[_0x21c916(0x1ab)](_0x3836ba=>{return!_0x6e90a['includes'](_0x3836ba['path']);});useEffect(()=>{const _0x4c29c8=_0x21c916;if(!_0x1c5004&&_0x4d7058[_0x4c29c8(0x1b6)]>0x0&&_0x4a699b[_0x4c29c8(0x1dd)]===0x0){const _0x458d54=new Set(_0x4d7058['map']((_0x1fb742,_0x44a2a4)=>({'page':_0x1fb742,'index':_0x44a2a4}))[_0x4c29c8(0x1ab)](({page:_0x39dcad})=>!_0x6e90a[_0x4c29c8(0x1bf)](_0x39dcad[_0x4c29c8(0x1bb)]))[_0x4c29c8(0x1e0)](({index:_0x37273b})=>_0x37273b));_0x5e0f2b(_0x458d54);}},[_0x1c5004,_0x4d7058[_0x21c916(0x1b6)],_0x6e90a[_0x21c916(0x1b6)]]),useInput(async(_0x350ea4,_0x845887)=>{const _0x41837a=_0x21c916;if(_0x221300===_0x41837a(0x1d1)){if(_0x845887['upArrow']){_0x2ca832(_0x558b58=>_0x558b58>0x0?_0x558b58-0x1:_0x4d7058[_0x41837a(0x1b6)]-0x1);return;}if(_0x845887[_0x41837a(0x1be)]){_0x2ca832(_0x117599=>_0x117599<_0x4d7058[_0x41837a(0x1b6)]-0x1?_0x117599+0x1:0x0);return;}if(_0x350ea4==='\x20'){_0x5e0f2b(_0x29ee96=>{const _0x46a19e=_0x41837a,_0x212691=new Set(_0x29ee96);return _0x212691['has'](_0x374877)?_0x212691[_0x46a19e(0x1b1)](_0x374877):_0x212691[_0x46a19e(0x1e7)](_0x374877),_0x212691;});return;}if(_0x350ea4==='a'||_0x350ea4==='A'){const _0x127839=new Set(_0x4d7058[_0x41837a(0x1e0)]((_0x2b4ff3,_0x1dea73)=>_0x1dea73));_0x5e0f2b(_0x127839);return;}if(_0x350ea4==='i'||_0x350ea4==='I'||_0x350ea4==='r'||_0x350ea4==='R'){_0x5e0f2b(_0x1aebfb=>{const _0x6efc79=_0x41837a,_0x2c93a9=new Set();for(let _0x1f92b4=0x0;_0x1f92b4<_0x4d7058[_0x6efc79(0x1b6)];_0x1f92b4++){!_0x1aebfb[_0x6efc79(0x1b7)](_0x1f92b4)&&_0x2c93a9['add'](_0x1f92b4);}return _0x2c93a9;});return;}if(_0x350ea4==='q'||_0x350ea4==='Q'){_0xe2e11();return;}if(_0x845887[_0x41837a(0x1b2)]){if(_0x4a699b[_0x41837a(0x1dd)]===0x0){_0x422aa3(_0x41837a(0x1d9));return;}const _0x3c96d9=_0x4d7058[_0x41837a(0x1ab)]((_0xddb56f,_0x3fa801)=>_0x4a699b[_0x41837a(0x1b7)](_0x3fa801)),_0x3a6b39=_0x3c96d9['map'](_0x4b744f=>_0x4b744f['label'])[_0x41837a(0x1b0)](',\x20');_0x33a4db([{'label':'已选择菜单','value':_0x4a699b[_0x41837a(0x1dd)]+'\x20个'}]),_0x422aa3(''),_0x435ce4(_0x41837a(0x1b8));return;}return;}if(_0x221300===_0x41837a(0x1b8)){if(_0x845887[_0x41837a(0x1b2)]){const _0x42f724=_0x176d14[_0x41837a(0x1e2)]();if(_0x42f724==='')return;if(!isValidJsHttpsUrl(_0x42f724)){_0x422aa3('请输入有效的\x20JS\x20https\x20链接');return;}if(!await isUrlReachable(_0x42f724)){_0x422aa3(_0x41837a(0x1e8));return;}_0x2d0f0c(_0x42f724),_0x33a4db(_0x3bed9d=>[..._0x3bed9d,{'label':_0x41837a(0x1dc),'value':_0x42f724}]),_0x3ca796(''),_0x422aa3(''),_0x435ce4(_0x41837a(0x1c6));return;}if(_0x845887['backspace']||_0x845887[_0x41837a(0x1b1)]){_0x3ca796(_0x1933dc=>_0x1933dc['slice'](0x0,-0x1)),_0x422aa3('');return;}_0x3ca796(_0x41ce6e=>_0x41ce6e+_0x350ea4);return;}if(_0x221300==='input-css'){if(_0x845887[_0x41837a(0x1b2)]){const _0x3f9093=_0x176d14['trim']();if(_0x3f9093==='')return;if(!isValidCssHttpsUrl(_0x3f9093)){_0x422aa3(_0x41837a(0x1ca));return;}if(!await isUrlReachable(_0x3f9093)){_0x422aa3('CSS\x20链接无法访问');return;}_0x436ead(_0x3f9093),_0x33a4db(_0x201b81=>[..._0x201b81,{'label':_0x41837a(0x1af),'value':_0x3f9093}]),_0x3ca796(''),_0x422aa3(''),_0x435ce4('creating');const _0x2d7780=_0x4d7058[_0x41837a(0x1ab)]((_0x171ad4,_0x17e294)=>_0x4a699b[_0x41837a(0x1b7)](_0x17e294));createMenus(_0x2d7780,[_0x4b7387,_0x3f9093])['then'](()=>{const _0x55a85e=_0x41837a;_0x435ce4(_0x55a85e(0x1cf)),setTimeout(()=>{_0xe2e11();},0x3e8);})['catch'](_0x5d35df=>{const _0x1b4cfa=_0x41837a;_0x422aa3(_0x5d35df[_0x1b4cfa(0x1c2)]||_0x1b4cfa(0x1ac)),_0x435ce4(_0x1b4cfa(0x1d1));});return;}if(_0x845887[_0x41837a(0x1df)]||_0x845887[_0x41837a(0x1b1)]){_0x3ca796(_0x3863f1=>_0x3863f1[_0x41837a(0x1c7)](0x0,-0x1)),_0x422aa3('');return;}_0x3ca796(_0x37385f=>_0x37385f+_0x350ea4);return;}});if(_0x1c5004)return a10_0x3898a0(Box,{'marginTop':0x1,'marginBottom':0x1,'children':[a10_0x8a122f(Text,{'children':'\x20\x20'}),a10_0x8a122f(a10_0x38db07,{'type':'dots'}),a10_0x8a122f(Text,{'children':_0x21c916(0x1d4)})]});if(_0x3b31f1)return a10_0x3898a0(Box,{'flexDirection':_0x21c916(0x1c5),'marginTop':0x1,'marginBottom':0x1,'children':[a10_0x3898a0(Text,{'color':'red','children':['✗\x20',_0x3b31f1]}),a10_0x3898a0(Box,{'marginTop':0x1,'children':[a10_0x8a122f(Text,{'color':_0x21c916(0x1de),'children':'提示:使用\x20'}),a10_0x8a122f(Text,{'color':_0x21c916(0x1e5),'children':_0x21c916(0x1e1)}),a10_0x8a122f(Text,{'color':_0x21c916(0x1de),'children':_0x21c916(0x1e6)})]})]});if(_0x4d7058[_0x21c916(0x1b6)]===0x0)return a10_0x8a122f(Box,{'marginTop':0x1,'marginBottom':0x1,'children':a10_0x8a122f(Text,{'color':_0x21c916(0x1e4),'children':'!\x20未找到本地页面,请先创建页面'})});return a10_0x3898a0(Box,{'flexDirection':'column','marginTop':0x1,'marginBottom':0x1,'children':[_0x221300===_0x21c916(0x1d1)&&a10_0x3898a0(a10_0x51efae,{'children':[a10_0x3898a0(Box,{'children':[a10_0x3898a0(Text,{'bold':!![],'children':['\x20\x20',_0x21c916(0x1c9),getRemainingSpaces(_0x214203,_0x21c916(0x1c9))]}),a10_0x3898a0(Text,{'bold':!![],'children':['本地',getRemainingSpaces(_0x54c4b5,_0x21c916(0x1c9))]}),a10_0x3898a0(Text,{'bold':!![],'children':[_0x21c916(0x1da),getRemainingSpaces(_0x54c4b5,_0x21c916(0x1c9))]})]}),_0x1a3086[_0x21c916(0x1e0)](_0x5655c1=>a10_0x3898a0(Box,{'children':[a10_0x3898a0(Text,{'children':['\x20\x20',_0x5655c1[_0x21c916(0x1d6)],getRemainingSpaces(_0x214203,_0x5655c1[_0x21c916(0x1d6)])]}),a10_0x3898a0(Text,{'color':_0x21c916(0x1ad),'children':[_0x5655c1[_0x21c916(0x1b5)]?'✓':'✗',getRemainingSpaces(_0x54c4b5,'✓')]}),a10_0x3898a0(Text,{'color':_0x5655c1[_0x21c916(0x1b9)]?_0x21c916(0x1ad):'red','children':[_0x5655c1['online']?'✓':'✗',getRemainingSpaces(_0x54c4b5,'✓')]})]},_0x5655c1[_0x21c916(0x1bb)]))]}),_0x221300==='selecting'&&_0x24ab2f[_0x21c916(0x1b6)]===0x0&&a10_0x8a122f(Box,{'marginTop':0x1,'children':a10_0x8a122f(Text,{'color':_0x21c916(0x1e5),'children':'*\x20同步菜单到\x20Lovrabet\x20平台'})}),_0x24ab2f[_0x21c916(0x1e0)]((_0x32b39d,_0x4ee74b)=>a10_0x3898a0(Box,{'children':[a10_0x3898a0(Text,{'color':'green','children':['√\x20',_0x32b39d[_0x21c916(0x1d6)],':\x20']}),a10_0x8a122f(Text,{'color':'cyan','children':_0x32b39d['value']})]},_0x4ee74b)),_0x3c82d4&&_0x221300===_0x21c916(0x1d1)&&a10_0x8a122f(Box,{'marginTop':0x1,'children':a10_0x3898a0(Text,{'color':_0x21c916(0x1d0),'children':['✗\x20',_0x3c82d4]})}),_0x221300===_0x21c916(0x1d1)&&a10_0x8a122f(a10_0x51efae,{'children':a10_0x3898a0(Box,{'marginTop':_0x24ab2f[_0x21c916(0x1b6)]>0x0||_0x3c82d4?0x1:0x0,'flexDirection':_0x21c916(0x1c5),'children':[a10_0x8a122f(Text,{'bold':!![],'children':_0x21c916(0x1d7)}),_0x4d7058['map']((_0x4633bf,_0x23fcab)=>{const _0x3ddc56=_0x21c916,_0x343776=_0x374877===_0x23fcab,_0x1b758c=_0x4a699b[_0x3ddc56(0x1b7)](_0x23fcab),_0x6e84e6=_0x6e90a['includes'](_0x4633bf[_0x3ddc56(0x1bb)]),_0x455518=_0x6e84e6?'更新':'新建';return a10_0x8a122f(Box,{'children':a10_0x3898a0(Text,{'backgroundColor':_0x343776?_0x3ddc56(0x1d5):undefined,'color':_0x343776?_0x3ddc56(0x1cb):undefined,'children':['\x20\x20',_0x1b758c?_0x3ddc56(0x1e3):'[\x20]','\x20',_0x4633bf[_0x3ddc56(0x1d6)]]})},_0x4633bf[_0x3ddc56(0x1bb)]);}),a10_0x8a122f(Box,{'marginTop':0x1,'children':a10_0x3898a0(Text,{'color':_0x21c916(0x1de),'children':['\x20',_0x21c916(0x1bc)]})})]})}),_0x221300===_0x21c916(0x1b8)&&a10_0x3898a0(a10_0x51efae,{'children':[a10_0x3898a0(Box,{'children':[a10_0x8a122f(Text,{'children':_0x21c916(0x1cd)}),a10_0x8a122f(Text,{'color':_0x21c916(0x1ad),'children':_0x176d14}),_0x3c82d4&&a10_0x3898a0(Text,{'color':'red','children':[_0x21c916(0x1c1),_0x3c82d4]})]}),!_0x3c82d4&&a10_0x8a122f(Box,{'children':a10_0x8a122f(Text,{'color':_0x21c916(0x1de),'children':_0x21c916(0x1db)})})]}),_0x221300===_0x21c916(0x1c6)&&a10_0x3898a0(a10_0x51efae,{'children':[a10_0x3898a0(Box,{'children':[a10_0x8a122f(Text,{'children':_0x21c916(0x1c0)}),a10_0x8a122f(Text,{'color':_0x21c916(0x1ad),'children':_0x176d14}),_0x3c82d4&&a10_0x3898a0(Text,{'color':'red','children':[_0x21c916(0x1c1),_0x3c82d4]})]}),!_0x3c82d4&&a10_0x8a122f(Box,{'children':a10_0x8a122f(Text,{'color':_0x21c916(0x1de),'children':_0x21c916(0x1c4)})})]}),_0x221300==='creating'&&a10_0x8a122f(Box,{'children':a10_0x8a122f(Text,{'children':_0x21c916(0x1d2)})}),_0x221300===_0x21c916(0x1cf)&&a10_0x8a122f(Box,{'children':a10_0x8a122f(Text,{'color':_0x21c916(0x1ad),'children':_0x21c916(0x1c8)})})]});}function getStringWidth(_0x504460){let _0x3bf67a=0x0;for(const _0x5259ae of _0x504460){/[\u4e00-\u9fa5]/['test'](_0x5259ae)?_0x3bf67a+=0x2:_0x3bf67a+=0x1;}return _0x3bf67a;}function getRemainingSpaces(_0x1a131b,_0x2062a9){const _0x12b9bf=a10_0x3f04,_0x1c5f9e=getStringWidth(_0x2062a9);return Array(Math[_0x12b9bf(0x1b4)](0x0,_0x1a131b-_0x1c5f9e))[_0x12b9bf(0x1ae)]('\x20')[_0x12b9bf(0x1b0)]('');}function getMaxWidth(_0x51c954,_0x2b9ba4=0x2){const _0x287939=a10_0x3f04;let _0x512058='',_0x1c3427=0x0;for(const _0x59f489 of _0x51c954){const _0x5a5c80=getStringWidth(_0x59f489);_0x5a5c80>_0x1c3427&&(_0x1c3427=_0x5a5c80,_0x512058=_0x59f489);}return _0x512058+'\x20'[_0x287939(0x1ce)](_0x2b9ba4);}