@lovrabet/cli 1.1.26-beta.1 → 1.1.26-beta.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. package/lib/add-page/input-page-router.js +1 -1
  2. package/lib/add-page/main.js +1 -1
  3. package/lib/add-page/select-page-template.js +1 -1
  4. package/lib/api/api-doc-ui.js +1 -1
  5. package/lib/api/api-doc.js +1 -1
  6. package/lib/api/api-pull-ui.js +1 -1
  7. package/lib/api/fetch-model-list.js +1 -1
  8. package/lib/api/generate-api-file.js +1 -1
  9. package/lib/api/main.js +1 -1
  10. package/lib/api/pull-silent.js +1 -1
  11. package/lib/app-menu/app-menu-sync-ui.js +1 -1
  12. package/lib/app-menu/create-menu.js +1 -1
  13. package/lib/app-menu/get-local-pages.js +1 -1
  14. package/lib/app-menu/get-online-menu-list.js +1 -1
  15. package/lib/app-menu/use-get-online-menu-list.js +1 -1
  16. package/lib/app-menu/utils.js +1 -1
  17. package/lib/app-menu/valid-url.js +1 -1
  18. package/lib/app-menu-cdn-version/app-menu-sync-cdn-version-ui.js +1 -1
  19. package/lib/app-menu-cdn-version/cdn-url-compare-table.js +1 -0
  20. package/lib/app-menu-cdn-version/update-menu-cdn-url.js +1 -1
  21. package/lib/auth/auth-server-ui.js +1 -1
  22. package/lib/auth/auth-server.js +1 -1
  23. package/lib/auth/constant.js +1 -1
  24. package/lib/auth/get-cookie.js +1 -1
  25. package/lib/auth/is-session-valid.js +1 -1
  26. package/lib/auth/logout.js +1 -1
  27. package/lib/cli.js +1 -1
  28. package/lib/cmd/build-watch.js +1 -1
  29. package/lib/cmd/build.js +1 -1
  30. package/lib/cmd/logs.js +1 -1
  31. package/lib/cmd/preview.js +1 -1
  32. package/lib/cmd/start.js +1 -1
  33. package/lib/config/config-help.js +1 -1
  34. package/lib/config/main.js +1 -1
  35. package/lib/constant/domain.js +1 -1
  36. package/lib/constant/env.js +1 -1
  37. package/lib/create-app/enhanced-guided-create.js +1 -1
  38. package/lib/create-app/format-elapsed.js +1 -1
  39. package/lib/create-app/main.js +1 -1
  40. package/lib/create-app/task-finished.js +1 -1
  41. package/lib/create-app/task-loading.js +1 -1
  42. package/lib/create-app/task-running.js +1 -1
  43. package/lib/create-app/task-time.js +1 -1
  44. package/lib/create-app/use-copy-project-template.js +1 -1
  45. package/lib/create-app/use-format-code.js +1 -1
  46. package/lib/create-app/use-install-dependencies.js +1 -1
  47. package/lib/help.js +1 -1
  48. package/lib/init/main.js +1 -1
  49. package/lib/mcp/cursor.js +1 -1
  50. package/lib/mcp/main.js +1 -1
  51. package/lib/utils/config.js +1 -1
  52. package/lib/utils/copy-directory.js +1 -1
  53. package/lib/utils/http-client.js +1 -1
  54. package/lib/utils/logger.js +1 -1
  55. package/lib/utils/router-updater.js +1 -1
  56. package/lib/utils/sleep.js +1 -1
  57. package/lib/utils/template-replacer.js +1 -1
  58. package/package.json +1 -1
@@ -1 +1 @@
1
- function a0_0x147c(_0x1f1084,_0x1dc1f7){const _0x3987c2=a0_0x3987();return a0_0x147c=function(_0x147cb9,_0x440a05){_0x147cb9=_0x147cb9-0x15a;let _0x4e56e4=_0x3987c2[_0x147cb9];return _0x4e56e4;},a0_0x147c(_0x1f1084,_0x1dc1f7);}(function(_0x43ea74,_0x239c5e){const _0x12becd=a0_0x147c,_0x1e376a=_0x43ea74();while(!![]){try{const _0x4241f8=-parseInt(_0x12becd(0x16f))/0x1+parseInt(_0x12becd(0x16b))/0x2*(parseInt(_0x12becd(0x15f))/0x3)+-parseInt(_0x12becd(0x178))/0x4*(parseInt(_0x12becd(0x171))/0x5)+-parseInt(_0x12becd(0x16a))/0x6*(parseInt(_0x12becd(0x165))/0x7)+parseInt(_0x12becd(0x15a))/0x8*(-parseInt(_0x12becd(0x174))/0x9)+-parseInt(_0x12becd(0x177))/0xa+parseInt(_0x12becd(0x15d))/0xb;if(_0x4241f8===_0x239c5e)break;else _0x1e376a['push'](_0x1e376a['shift']());}catch(_0x56e152){_0x1e376a['push'](_0x1e376a['shift']());}}}(a0_0x3987,0x25d98));import{jsx as a0_0x224080,jsxs as a0_0x3fa794}from'react/jsx-runtime';import{useState}from'react';import{Text,Box,useInput}from'ink';function a0_0x3987(){const _0x58961e=['green','61779AyYMaV','red','column','路径不能包含连续的\x20/','length','my-page','910EqKyyr','split','页面路径长度不能超过\x20100\x20个字符','existsSync','backspace','9438FBrAuV','2LydpHg','页面路径不合法','\x20已存在,请使用其他路径','endsWith','196284rwPEuK','test','768595bUaxZa','trim','startsWith','171DBdjmZ','路径不能以\x20/\x20开头或结尾','includes','2745740xdZxeI','8InoBSb','slice','105288BEpBWc','页面路径\x20','页面路由地址:\x20','15040124ZpJxKM'];a0_0x3987=function(){return _0x58961e;};return a0_0x3987();}import a0_0x12b472 from'node:fs';export function InputProjectCode(_0x28456f){const _0x4c1cbc=a0_0x147c,{onSubmit:_0x398089,pagePath:_0x2edf83}=_0x28456f,[_0x48fa57,_0x18707c]=useState(''),[_0x57cce4,_0x505df9]=useState(''),_0x1c4e08=_0x4c1cbc(0x164);function _0x25f0ed(_0x5020ff){const _0x1390b8=_0x4c1cbc;if(_0x5020ff[_0x1390b8(0x163)]>0x64)return{'valid':![],'message':_0x1390b8(0x167)};if(_0x5020ff[_0x1390b8(0x173)]('/')||_0x5020ff[_0x1390b8(0x16e)]('/'))return{'valid':![],'message':_0x1390b8(0x175)};if(_0x5020ff[_0x1390b8(0x176)]('//'))return{'valid':![],'message':_0x1390b8(0x162)};const _0x167070=_0x5020ff[_0x1390b8(0x166)]('/');for(const _0x3482f3 of _0x167070){if(!_0x3482f3)continue;const _0x541add=/^[A-Za-z0-9][A-Za-z0-9_-]*$/;if(!_0x541add[_0x1390b8(0x170)](_0x3482f3))return{'valid':![],'message':'路径中的每个段只能以字母或数字开头,且只包含字母、数字、-\x20和\x20_'};}return{'valid':!![]};}return useInput((_0x3e3d6c,_0x343fbc)=>{const _0x42b077=_0x4c1cbc;if(_0x343fbc['return']){const _0x151ed6=_0x48fa57[_0x42b077(0x172)]()||_0x1c4e08;if(_0x57cce4)return;const _0x11a58b=_0x2edf83+'/'+_0x151ed6;if(a0_0x12b472[_0x42b077(0x168)](_0x11a58b)){_0x505df9(_0x42b077(0x15b)+_0x151ed6+_0x42b077(0x16d));return;}_0x398089(_0x151ed6),_0x18707c(''),_0x505df9('');}else _0x343fbc[_0x42b077(0x169)]||_0x343fbc['delete']?_0x18707c(_0x3134a3=>{const _0x2b689d=_0x42b077,_0x289bc6=_0x3134a3[_0x2b689d(0x179)](0x0,-0x1),{valid:_0x10c248,message:_0xf0d07b}=_0x25f0ed(_0x289bc6);return _0x505df9(_0x10c248?'':_0xf0d07b||_0x2b689d(0x16c)),_0x289bc6;}):_0x18707c(_0x4cb268=>{const _0x1b40c4=_0x4cb268+_0x3e3d6c,{valid:_0x134191,message:_0x5845f9}=_0x25f0ed(_0x1b40c4);return _0x505df9(_0x134191?'':_0x5845f9||'页面路径不合法'),_0x1b40c4;});}),a0_0x3fa794(Box,{'flexDirection':_0x4c1cbc(0x161),'children':[a0_0x3fa794(Box,{'children':[a0_0x224080(Text,{'color':'gray','children':'\x20Step2:\x20'}),a0_0x224080(Text,{'children':_0x4c1cbc(0x15c)}),_0x48fa57?a0_0x224080(Text,{'color':_0x4c1cbc(0x15e),'children':_0x48fa57}):a0_0x224080(Text,{'color':'gray','children':_0x1c4e08}),_0x57cce4&&a0_0x3fa794(Text,{'color':_0x4c1cbc(0x160),'children':['\x20←\x20',_0x57cce4]})]}),!_0x57cce4&&!_0x48fa57&&a0_0x224080(Box,{'children':a0_0x224080(Text,{'color':'gray','children':'\x20直接回车确认,或输入自定义路由地址'})})]});}
1
+ (function(_0x18c47c,_0x516f49){const _0x3a01df=a0_0x3307,_0x3664a9=_0x18c47c();while(!![]){try{const _0x1e91e5=parseInt(_0x3a01df(0x129))/0x1*(parseInt(_0x3a01df(0x136))/0x2)+-parseInt(_0x3a01df(0x123))/0x3+-parseInt(_0x3a01df(0x12e))/0x4+parseInt(_0x3a01df(0x128))/0x5+-parseInt(_0x3a01df(0x137))/0x6*(parseInt(_0x3a01df(0x12c))/0x7)+-parseInt(_0x3a01df(0x13f))/0x8*(parseInt(_0x3a01df(0x13e))/0x9)+parseInt(_0x3a01df(0x139))/0xa;if(_0x1e91e5===_0x516f49)break;else _0x3664a9['push'](_0x3664a9['shift']());}catch(_0x4e2860){_0x3664a9['push'](_0x3664a9['shift']());}}}(a0_0xbcb7,0x83bc9));import{jsx as a0_0x48a777,jsxs as a0_0xe968a2}from'react/jsx-runtime';function a0_0x3307(_0x4d0a13,_0x5aa0ad){const _0xbcb72e=a0_0xbcb7();return a0_0x3307=function(_0x330732,_0x4b9e88){_0x330732=_0x330732-0x123;let _0x2f0b98=_0xbcb72e[_0x330732];return _0x2f0b98;},a0_0x3307(_0x4d0a13,_0x5aa0ad);}function a0_0xbcb7(){const _0x52f80f=['428256stXbvC','endsWith','页面路由地址:\x20','路径中的每个段只能以字母或数字开头,且只包含字母、数字、-\x20和\x20_','slice','247875HOkTFh','635zkAWfy','length','页面路径\x20','1659GDJlly','trim','826624PfpQJr','页面路径不合法','startsWith','路径不能以\x20/\x20开头或结尾','gray','\x20直接回车确认,或输入自定义路由地址','\x20←\x20','red','816InCesw','12588RntJIF','existsSync','19060320UPZIvi','green','backspace','路径不能包含连续的\x20/','\x20已存在,请使用其他路径','4140SMdTjG','14408rNBbMu'];a0_0xbcb7=function(){return _0x52f80f;};return a0_0xbcb7();}import{useState}from'react';import{Text,Box,useInput}from'ink';import a0_0x315c6b from'node:fs';export function InputProjectCode(_0x3be506){const _0x4662a0=a0_0x3307,{onSubmit:_0x555923,pagePath:_0x3939f9}=_0x3be506,[_0xa9391c,_0x3c9b0c]=useState(''),[_0x4fdd4b,_0x3448fa]=useState(''),_0x37ccff='my-page';function _0x4642c5(_0x1bcee3){const _0x28589b=a0_0x3307;if(_0x1bcee3[_0x28589b(0x12a)]>0x64)return{'valid':![],'message':'页面路径长度不能超过\x20100\x20个字符'};if(_0x1bcee3[_0x28589b(0x130)]('/')||_0x1bcee3[_0x28589b(0x124)]('/'))return{'valid':![],'message':_0x28589b(0x131)};if(_0x1bcee3['includes']('//'))return{'valid':![],'message':_0x28589b(0x13c)};const _0x385d81=_0x1bcee3['split']('/');for(const _0x219b1f of _0x385d81){if(!_0x219b1f)continue;const _0x1f5ba6=/^[A-Za-z0-9][A-Za-z0-9_-]*$/;if(!_0x1f5ba6['test'](_0x219b1f))return{'valid':![],'message':_0x28589b(0x126)};}return{'valid':!![]};}return useInput((_0x253af3,_0x2aefff)=>{const _0x9b0eb5=a0_0x3307;if(_0x2aefff['return']){const _0xd2df4b=_0xa9391c[_0x9b0eb5(0x12d)]()||_0x37ccff;if(_0x4fdd4b)return;const _0x52d8ee=_0x3939f9+'/'+_0xd2df4b;if(a0_0x315c6b[_0x9b0eb5(0x138)](_0x52d8ee)){_0x3448fa(_0x9b0eb5(0x12b)+_0xd2df4b+_0x9b0eb5(0x13d));return;}_0x555923(_0xd2df4b),_0x3c9b0c(''),_0x3448fa('');}else _0x2aefff[_0x9b0eb5(0x13b)]||_0x2aefff['delete']?_0x3c9b0c(_0x397cbd=>{const _0x6d0420=_0x9b0eb5,_0x5eb6c8=_0x397cbd[_0x6d0420(0x127)](0x0,-0x1),{valid:_0xdacd33,message:_0xcd67af}=_0x4642c5(_0x5eb6c8);return _0x3448fa(_0xdacd33?'':_0xcd67af||_0x6d0420(0x12f)),_0x5eb6c8;}):_0x3c9b0c(_0x20bdd6=>{const _0x37e956=_0x9b0eb5,_0x5b8753=_0x20bdd6+_0x253af3,{valid:_0x908636,message:_0x3f79f6}=_0x4642c5(_0x5b8753);return _0x3448fa(_0x908636?'':_0x3f79f6||_0x37e956(0x12f)),_0x5b8753;});}),a0_0xe968a2(Box,{'flexDirection':'column','children':[a0_0xe968a2(Box,{'children':[a0_0x48a777(Text,{'color':_0x4662a0(0x132),'children':'\x20Step2:\x20'}),a0_0x48a777(Text,{'children':_0x4662a0(0x125)}),_0xa9391c?a0_0x48a777(Text,{'color':_0x4662a0(0x13a),'children':_0xa9391c}):a0_0x48a777(Text,{'color':_0x4662a0(0x132),'children':_0x37ccff}),_0x4fdd4b&&a0_0xe968a2(Text,{'color':_0x4662a0(0x135),'children':[_0x4662a0(0x134),_0x4fdd4b]})]}),!_0x4fdd4b&&!_0xa9391c&&a0_0x48a777(Box,{'children':a0_0x48a777(Text,{'color':_0x4662a0(0x132),'children':_0x4662a0(0x133)})})]});}
@@ -1 +1 @@
1
- const a1_0x478b4f=a1_0x4d93;(function(_0x290b7c,_0x5c6f44){const _0x2b03fb=a1_0x4d93,_0x198e55=_0x290b7c();while(!![]){try{const _0x47b40d=-parseInt(_0x2b03fb(0x117))/0x1*(-parseInt(_0x2b03fb(0x119))/0x2)+-parseInt(_0x2b03fb(0x102))/0x3*(parseInt(_0x2b03fb(0xf8))/0x4)+parseInt(_0x2b03fb(0x11d))/0x5+parseInt(_0x2b03fb(0x107))/0x6+parseInt(_0x2b03fb(0x11c))/0x7*(parseInt(_0x2b03fb(0x10e))/0x8)+-parseInt(_0x2b03fb(0x104))/0x9*(-parseInt(_0x2b03fb(0xff))/0xa)+parseInt(_0x2b03fb(0xf7))/0xb*(-parseInt(_0x2b03fb(0x10a))/0xc);if(_0x47b40d===_0x5c6f44)break;else _0x198e55['push'](_0x198e55['shift']());}catch(_0x49f4dc){_0x198e55['push'](_0x198e55['shift']());}}}(a1_0x1d8f,0x27745));import{jsx as a1_0x3efa62,jsxs as a1_0x32103b,Fragment as a1_0x132058}from'react/jsx-runtime';function a1_0x1d8f(){const _0x154def=['1452462InRYDi','\x20Step2:\x20','processTemplate','4710372LIcBeO','pages','已输入的页面路由\x20','resolve','6856qCfOEr','green','\x20*\x20页面创建成功!','then','\x20*\x20页面路径:\x20','gray','info','setLogPath','\x20*\x20路由地址:\x20','559NrYEIp','catch','692mIzGkK','success','已选择页面模板\x20','1813HZgDbZ','664850QcxSZE','join','页面添加失败:\x20','11ktOEWH','12UFUqod','error','\x20Step1:\x20','url','开始添加页面:\x20','now','column','190kVtEuH','src','cyan','317931jICZKB','add-page','38673havDtd','dirname','页面添加成功:\x20'];a1_0x1d8f=function(){return _0x154def;};return a1_0x1d8f();}import{fileURLToPath}from'node:url';import a1_0x223c92 from'node:path';import{useEffect,useState}from'react';function a1_0x4d93(_0x58a0c8,_0x4f4d95){const _0x1d8fa3=a1_0x1d8f();return a1_0x4d93=function(_0x4d9384,_0x8fa268){_0x4d9384=_0x4d9384-0xf5;let _0x4a28d9=_0x1d8fa3[_0x4d9384];return _0x4a28d9;},a1_0x4d93(_0x58a0c8,_0x4f4d95);}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_0x223c92[a1_0x478b4f(0x105)](fileURLToPath(import.meta[a1_0x478b4f(0xfb)])),pageTemplateDir=a1_0x223c92['resolve'](__dirname,'../../templates/pages'),projectDir=process['cwd']();export const AddPage=()=>{const _0x58f9ba=a1_0x478b4f,{exit:_0x34305a}=useApp(),[_0x1e33aa,_0x1574b4]=useState(''),[_0x1fbbe1,_0x5e6b27]=useState(''),[_0x5ae4c8,_0x38f85f]=useState(![]),[_0x1f80f3,_0x29298b]=useState(![]),_0x3474b3=a1_0x223c92['join'](projectDir,_0x58f9ba(0x100),_0x58f9ba(0x10b)),_0x1eb648=a1_0x223c92[_0x58f9ba(0xf5)](_0x3474b3,_0x1fbbe1),_0xfae120=a1_0x223c92[_0x58f9ba(0xf5)](_0x58f9ba(0x100),_0x58f9ba(0x10b),_0x1fbbe1);useEffect(()=>{const _0x220a27=_0x58f9ba,_0x42b332=a1_0x223c92[_0x220a27(0x10d)](pageTemplateDir,_0x1e33aa);if(_0x1e33aa&&_0x1fbbe1){_0x38f85f(!![]),logger[_0x220a27(0x115)](process['cwd']());const _0x505347=Date[_0x220a27(0xfd)]();logger[_0x220a27(0x114)](_0x220a27(0x103),_0x220a27(0xfc)+_0x1fbbe1,{'template':_0x1e33aa,'targetPath':_0xfae120}),TemplateReplacer[_0x220a27(0x109)](_0x42b332,a1_0x223c92['join'](_0x3474b3,_0x1fbbe1),_0x1fbbe1,_0x1e33aa)[_0x220a27(0x111)](()=>{const _0x33557f=_0x220a27,_0x5543ba=Date[_0x33557f(0xfd)]()-_0x505347;logger[_0x33557f(0x11a)]('add-page',_0x33557f(0x106)+_0x1fbbe1,_0x5543ba,{'template':_0x1e33aa,'targetPath':_0xfae120,'routePath':_0x1fbbe1}),_0x29298b(!![]);})[_0x220a27(0x118)](_0x54d070=>{const _0x432bef=_0x220a27,_0xee3133=Date[_0x432bef(0xfd)]()-_0x505347;logger[_0x432bef(0xf9)](_0x432bef(0x103),_0x432bef(0xf6)+_0x1fbbe1,{'template':_0x1e33aa,'targetPath':_0xfae120,'error':_0x54d070 instanceof Error?_0x54d070['message']:String(_0x54d070),'duration':_0xee3133});})['finally'](()=>{_0x38f85f(![]);});}},[_0x1e33aa,_0x1fbbe1]),useEffect(()=>{_0x1f80f3&&setTimeout(()=>{_0x34305a();});},[_0x1f80f3]);if(_0x1e33aa)return a1_0x32103b(Box,{'flexDirection':_0x58f9ba(0xfe),'paddingY':0x1,'children':[a1_0x32103b(Box,{'children':[a1_0x3efa62(Text,{'color':_0x58f9ba(0x113),'children':_0x58f9ba(0xfa)}),a1_0x3efa62(Text,{'children':_0x58f9ba(0x11b)}),a1_0x3efa62(Text,{'color':'green','children':_0x1e33aa})]}),_0x1fbbe1?a1_0x32103b(Box,{'children':[a1_0x3efa62(Text,{'color':'gray','children':_0x58f9ba(0x108)}),a1_0x3efa62(Text,{'children':_0x58f9ba(0x10c)}),a1_0x3efa62(Text,{'color':_0x58f9ba(0x10f),'children':_0x1fbbe1})]}):a1_0x3efa62(InputProjectCode,{'pagePath':_0x1eb648,'onSubmit':_0x5e6b27}),_0x1fbbe1&&_0x5ae4c8?a1_0x32103b(Box,{'marginTop':0x1,'children':[a1_0x3efa62(Box,{'width':'4'}),a1_0x3efa62(Text,{'children':'正在创建页面,请稍候…'})]}):null,_0x1f80f3?a1_0x32103b(a1_0x132058,{'children':[a1_0x3efa62(Box,{'marginTop':0x1,'children':a1_0x3efa62(Text,{'color':'gray','children':_0x58f9ba(0x110)})}),a1_0x32103b(Box,{'children':[a1_0x3efa62(Text,{'color':_0x58f9ba(0x113),'children':_0x58f9ba(0x112)}),a1_0x3efa62(Text,{'color':_0x58f9ba(0x10f),'children':_0xfae120})]}),a1_0x32103b(Box,{'children':[a1_0x3efa62(Text,{'color':'gray','children':_0x58f9ba(0x116)}),a1_0x32103b(Text,{'color':_0x58f9ba(0x10f),'children':['/',_0x1fbbe1]})]}),a1_0x3efa62(Box,{'marginTop':0x1,'children':a1_0x3efa62(Text,{'color':_0x58f9ba(0x101),'children':'\x20*\x20页面文件已创建,可直接通过路由访问'})})]}):null]});return a1_0x3efa62(SelectPageTemplate,{'onSelect':_0x1574b4});};
1
+ const a1_0x4a795c=a1_0x40e1;(function(_0x2432c1,_0x467d22){const _0x531422=a1_0x40e1,_0x492dec=_0x2432c1();while(!![]){try{const _0x3e62f5=-parseInt(_0x531422(0xd2))/0x1*(-parseInt(_0x531422(0xdf))/0x2)+-parseInt(_0x531422(0xd8))/0x3*(parseInt(_0x531422(0xf1))/0x4)+-parseInt(_0x531422(0xe0))/0x5*(-parseInt(_0x531422(0xf8))/0x6)+-parseInt(_0x531422(0xf5))/0x7*(parseInt(_0x531422(0xd6))/0x8)+parseInt(_0x531422(0xfc))/0x9*(parseInt(_0x531422(0xed))/0xa)+parseInt(_0x531422(0xde))/0xb*(-parseInt(_0x531422(0xf3))/0xc)+parseInt(_0x531422(0xd3))/0xd;if(_0x3e62f5===_0x467d22)break;else _0x492dec['push'](_0x492dec['shift']());}catch(_0x38ac72){_0x492dec['push'](_0x492dec['shift']());}}}(a1_0xf602,0xb029d));import{jsx as a1_0x27d756,jsxs as a1_0x25649d,Fragment as a1_0x28902d}from'react/jsx-runtime';function a1_0xf602(){const _0x401da5=['column','error','resolve','\x20*\x20页面文件已创建,可直接通过路由访问','\x20Step2:\x20','开始添加页面:\x20','info','页面添加成功:\x20','1344300UeRVBI','catch','正在创建页面,请稍候…','setLogPath','3537548YKRZEQ','processTemplate','2388QSfGFa','已选择页面模板\x20','27559uNuLgw','\x20*\x20页面路径:\x20','页面添加失败:\x20','2172KKXgTB','pages','src','gray','45EkdPHj','cwd','success','4UNFsUf','2182843fUWMWI','cyan','finally','2664yeGYeA','url','3AkADYw','\x20*\x20页面创建成功!','../../templates/pages','dirname','green','\x20Step1:\x20','1826LdkEqj','421654JPwZIg','17495fDmtFm','\x20*\x20路由地址:\x20','join','message','add-page'];a1_0xf602=function(){return _0x401da5;};return a1_0xf602();}import{fileURLToPath}from'node:url';import a1_0x384fd3 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';function a1_0x40e1(_0x3be597,_0x20366c){const _0xf602e2=a1_0xf602();return a1_0x40e1=function(_0x40e19f,_0x517b7a){_0x40e19f=_0x40e19f-0xd1;let _0x4bf238=_0xf602e2[_0x40e19f];return _0x4bf238;},a1_0x40e1(_0x3be597,_0x20366c);}import{logger}from'../utils/logger.js';import{TemplateReplacer}from'../utils/template-replacer.js';const __dirname=a1_0x384fd3[a1_0x4a795c(0xdb)](fileURLToPath(import.meta[a1_0x4a795c(0xd7)])),pageTemplateDir=a1_0x384fd3[a1_0x4a795c(0xe7)](__dirname,a1_0x4a795c(0xda)),projectDir=process[a1_0x4a795c(0xfd)]();export const AddPage=()=>{const _0x10e7e7=a1_0x4a795c,{exit:_0x4736ce}=useApp(),[_0x3ae51e,_0x1657de]=useState(''),[_0x3a9b70,_0x1d6f51]=useState(''),[_0x471f40,_0x5009dd]=useState(![]),[_0xa4d14b,_0xe06862]=useState(![]),_0x56b98b=a1_0x384fd3['join'](projectDir,_0x10e7e7(0xfa),_0x10e7e7(0xf9)),_0x4dedc3=a1_0x384fd3[_0x10e7e7(0xe2)](_0x56b98b,_0x3a9b70),_0x4af360=a1_0x384fd3['join']('src',_0x10e7e7(0xf9),_0x3a9b70);useEffect(()=>{const _0x272b11=_0x10e7e7,_0x11e6d4=a1_0x384fd3[_0x272b11(0xe7)](pageTemplateDir,_0x3ae51e);if(_0x3ae51e&&_0x3a9b70){_0x5009dd(!![]),logger[_0x272b11(0xf0)](process[_0x272b11(0xfd)]());const _0x5a80d8=Date['now']();logger[_0x272b11(0xeb)](_0x272b11(0xe4),_0x272b11(0xea)+_0x3a9b70,{'template':_0x3ae51e,'targetPath':_0x4af360}),TemplateReplacer[_0x272b11(0xf2)](_0x11e6d4,a1_0x384fd3[_0x272b11(0xe2)](_0x56b98b,_0x3a9b70),_0x3a9b70,_0x3ae51e)['then'](()=>{const _0x2c23f1=_0x272b11,_0x5267fb=Date['now']()-_0x5a80d8;logger[_0x2c23f1(0xd1)](_0x2c23f1(0xe4),_0x2c23f1(0xec)+_0x3a9b70,_0x5267fb,{'template':_0x3ae51e,'targetPath':_0x4af360,'routePath':_0x3a9b70}),_0xe06862(!![]);})[_0x272b11(0xee)](_0x5e727a=>{const _0x38df22=_0x272b11,_0x58b451=Date['now']()-_0x5a80d8;logger[_0x38df22(0xe6)](_0x38df22(0xe4),_0x38df22(0xf7)+_0x3a9b70,{'template':_0x3ae51e,'targetPath':_0x4af360,'error':_0x5e727a instanceof Error?_0x5e727a[_0x38df22(0xe3)]:String(_0x5e727a),'duration':_0x58b451});})[_0x272b11(0xd5)](()=>{_0x5009dd(![]);});}},[_0x3ae51e,_0x3a9b70]),useEffect(()=>{_0xa4d14b&&setTimeout(()=>{_0x4736ce();});},[_0xa4d14b]);if(_0x3ae51e)return a1_0x25649d(Box,{'flexDirection':_0x10e7e7(0xe5),'paddingY':0x1,'children':[a1_0x25649d(Box,{'children':[a1_0x27d756(Text,{'color':_0x10e7e7(0xfb),'children':_0x10e7e7(0xdd)}),a1_0x27d756(Text,{'children':_0x10e7e7(0xf4)}),a1_0x27d756(Text,{'color':_0x10e7e7(0xdc),'children':_0x3ae51e})]}),_0x3a9b70?a1_0x25649d(Box,{'children':[a1_0x27d756(Text,{'color':_0x10e7e7(0xfb),'children':_0x10e7e7(0xe9)}),a1_0x27d756(Text,{'children':'已输入的页面路由\x20'}),a1_0x27d756(Text,{'color':_0x10e7e7(0xdc),'children':_0x3a9b70})]}):a1_0x27d756(InputProjectCode,{'pagePath':_0x4dedc3,'onSubmit':_0x1d6f51}),_0x3a9b70&&_0x471f40?a1_0x25649d(Box,{'marginTop':0x1,'children':[a1_0x27d756(Box,{'width':'4'}),a1_0x27d756(Text,{'children':_0x10e7e7(0xef)})]}):null,_0xa4d14b?a1_0x25649d(a1_0x28902d,{'children':[a1_0x27d756(Box,{'marginTop':0x1,'children':a1_0x27d756(Text,{'color':'gray','children':_0x10e7e7(0xd9)})}),a1_0x25649d(Box,{'children':[a1_0x27d756(Text,{'color':'gray','children':_0x10e7e7(0xf6)}),a1_0x27d756(Text,{'color':_0x10e7e7(0xdc),'children':_0x4af360})]}),a1_0x25649d(Box,{'children':[a1_0x27d756(Text,{'color':_0x10e7e7(0xfb),'children':_0x10e7e7(0xe1)}),a1_0x25649d(Text,{'color':'green','children':['/',_0x3a9b70]})]}),a1_0x27d756(Box,{'marginTop':0x1,'children':a1_0x27d756(Text,{'color':_0x10e7e7(0xd4),'children':_0x10e7e7(0xe8)})})]}):null]});return a1_0x27d756(SelectPageTemplate,{'onSelect':_0x1657de});};
@@ -1 +1 @@
1
- function a2_0x9213(){const _0x5569cc=['error','map','2311729dgJFgE','\x20Step1:\x20','152172OIzBZH','return','510LyNqFs','gray','请选择您要创建的页面模板','column','blank','24CWCeXI','\x20\x20\x20\x20\x20\x20>\x20','downArrow','url','268717nYiAmF','246096gmmBVq','label','green','join','获取模板列表失败:','6oNePNN','\x20\x20\x20\x20\x20\x20\x20\x20','length','filter','1080666jLGzHy','upArrow','1324600WhYYeU','255945drwvDH'];a2_0x9213=function(){return _0x5569cc;};return a2_0x9213();}(function(_0x1527ff,_0x57d67d){const _0x396e5b=a2_0x3aa9,_0x5dbc02=_0x1527ff();while(!![]){try{const _0x3a2b3f=parseInt(_0x396e5b(0x13b))/0x1+-parseInt(_0x396e5b(0x130))/0x2+parseInt(_0x396e5b(0x128))/0x3+parseInt(_0x396e5b(0x12a))/0x4+-parseInt(_0x396e5b(0x12b))/0x5*(-parseInt(_0x396e5b(0x141))/0x6)+parseInt(_0x396e5b(0x12e))/0x7*(parseInt(_0x396e5b(0x137))/0x8)+-parseInt(_0x396e5b(0x13c))/0x9*(parseInt(_0x396e5b(0x132))/0xa);if(_0x3a2b3f===_0x57d67d)break;else _0x5dbc02['push'](_0x5dbc02['shift']());}catch(_0xb70a9b){_0x5dbc02['push'](_0x5dbc02['shift']());}}}(a2_0x9213,0x81bbd));import{jsx as a2_0x22dce3,jsxs as a2_0x898918}from'react/jsx-runtime';import{useState,useEffect}from'react';import{Text,Box,useInput}from'ink';import{readdir}from'node:fs/promises';import a2_0x695f3a from'node:path';function a2_0x3aa9(_0x9c2a10,_0x430927){const _0x92139e=a2_0x9213();return a2_0x3aa9=function(_0x3aa9aa,_0x3e267f){_0x3aa9aa=_0x3aa9aa-0x127;let _0x29aee2=_0x92139e[_0x3aa9aa];return _0x29aee2;},a2_0x3aa9(_0x9c2a10,_0x430927);}import{fileURLToPath}from'node:url';async function getTemplateList(){const _0x5438ce=a2_0x3aa9;try{const _0x7f68b6=fileURLToPath(import.meta[_0x5438ce(0x13a)]),_0x24c2ea=a2_0x695f3a['resolve'](a2_0x695f3a['dirname'](_0x7f68b6),'../..'),_0x16df29=a2_0x695f3a[_0x5438ce(0x13f)](_0x24c2ea,'templates/pages'),_0xd1cd01=await readdir(_0x16df29,{'withFileTypes':!![]}),_0x14d1ec=_0xd1cd01[_0x5438ce(0x127)](_0x41e579=>_0x41e579['isDirectory']())[_0x5438ce(0x12d)](_0x176658=>({'label':_0x176658['name']}))['sort']((_0x33f42e,_0x308a73)=>_0x33f42e[_0x5438ce(0x13d)]['localeCompare'](_0x308a73['label']));return _0x14d1ec;}catch(_0x2c656){return console[_0x5438ce(0x12c)](_0x5438ce(0x140),_0x2c656),[{'label':_0x5438ce(0x136)},{'label':'sdk-fetch'}];}}export function SelectPageTemplate(_0x5eb93f){const _0x104a6e=a2_0x3aa9,[_0x5c6b4c,_0x2fb52b]=useState(0x0),[_0x4c8d19,_0x113f26]=useState([]),[_0x591720,_0x574b6a]=useState(!![]);useEffect(()=>{async function _0x105636(){const _0x19c0ac=await getTemplateList();_0x113f26(_0x19c0ac),_0x574b6a(![]);}_0x105636();},[]),useInput((_0x4fed3c,_0x343f55)=>{const _0x5aa3de=a2_0x3aa9;if(_0x591720)return;if(_0x343f55[_0x5aa3de(0x131)]){const _0x55ed60=_0x4c8d19[_0x5c6b4c];_0x55ed60&&_0x5eb93f['onSelect'](_0x55ed60[_0x5aa3de(0x13d)]);}_0x343f55[_0x5aa3de(0x129)]&&_0x2fb52b(_0x14b3c4=>_0x14b3c4===0x0?_0x4c8d19[_0x5aa3de(0x143)]-0x1:_0x14b3c4-0x1),_0x343f55[_0x5aa3de(0x139)]&&_0x2fb52b(_0xb688cd=>_0xb688cd===_0x4c8d19['length']-0x1?0x0:_0xb688cd+0x1);});if(_0x591720)return a2_0x22dce3(Box,{'flexDirection':_0x104a6e(0x135),'paddingY':0x1,'children':a2_0x898918(Box,{'children':[a2_0x22dce3(Text,{'color':_0x104a6e(0x133),'children':_0x104a6e(0x12f)}),a2_0x22dce3(Text,{'children':'正在加载页面模板...'})]})});return a2_0x898918(Box,{'flexDirection':_0x104a6e(0x135),'paddingY':0x1,'children':[a2_0x898918(Box,{'children':[a2_0x22dce3(Text,{'color':_0x104a6e(0x133),'children':'\x20Step1:\x20'}),a2_0x22dce3(Text,{'children':_0x104a6e(0x134)})]}),_0x4c8d19[_0x104a6e(0x12d)]((_0x9c23b7,_0x4d24ee)=>{const _0x1a47a6=_0x104a6e,_0xbdfca7=_0x4d24ee===_0x5c6b4c,_0x46bde1=_0xbdfca7?_0x1a47a6(0x138)+_0x9c23b7['label']:_0x1a47a6(0x142)+_0x9c23b7['label'];return a2_0x22dce3(Box,{'children':a2_0x22dce3(Text,{'color':_0xbdfca7?_0x1a47a6(0x13e):undefined,'children':_0x46bde1})},_0x46bde1);})]});}
1
+ (function(_0x244945,_0x28fbf5){const _0x22b133=a2_0x2b7a,_0x32c699=_0x244945();while(!![]){try{const _0x17f586=parseInt(_0x22b133(0x1b7))/0x1*(parseInt(_0x22b133(0x1a4))/0x2)+parseInt(_0x22b133(0x1b6))/0x3*(-parseInt(_0x22b133(0x1ac))/0x4)+parseInt(_0x22b133(0x1c6))/0x5+-parseInt(_0x22b133(0x1bf))/0x6+-parseInt(_0x22b133(0x1b9))/0x7+parseInt(_0x22b133(0x1ab))/0x8*(parseInt(_0x22b133(0x1ba))/0x9)+parseInt(_0x22b133(0x1bb))/0xa*(parseInt(_0x22b133(0x1c5))/0xb);if(_0x17f586===_0x28fbf5)break;else _0x32c699['push'](_0x32c699['shift']());}catch(_0x1cfe88){_0x32c699['push'](_0x32c699['shift']());}}}(a2_0x50d3,0xf0a4e));import{jsx as a2_0x16a2cf,jsxs as a2_0x462711}from'react/jsx-runtime';import{useState,useEffect}from'react';import{Text,Box,useInput}from'ink';import{readdir}from'node:fs/promises';import a2_0x538ba7 from'node:path';function a2_0x2b7a(_0x1cb6d9,_0x1332a7){const _0x50d382=a2_0x50d3();return a2_0x2b7a=function(_0x2b7a49,_0x999f94){_0x2b7a49=_0x2b7a49-0x1a4;let _0x90e651=_0x50d382[_0x2b7a49];return _0x90e651;},a2_0x2b7a(_0x1cb6d9,_0x1332a7);}import{fileURLToPath}from'node:url';function a2_0x50d3(){const _0x27c8cb=['url','resolve','localeCompare','gray','map','\x20Step1:\x20','filter','column','../..','81sAIpIm','1soFdfe','获取模板列表失败:','2358811YCbdBp','1431855vudRVy','9517030gOEbus','isDirectory','join','sort','11588280CHgrsU','正在加载页面模板...','green','sdk-fetch','downArrow','templates/pages','33ahSOXs','3762370oSWnHs','onSelect','return','1051276MDbLIO','error','label','请选择您要创建的页面模板','blank','length','\x20\x20\x20\x20\x20\x20>\x20','8DImVpY','153820dvPRjT'];a2_0x50d3=function(){return _0x27c8cb;};return a2_0x50d3();}async function getTemplateList(){const _0x280efe=a2_0x2b7a;try{const _0x5112fb=fileURLToPath(import.meta[_0x280efe(0x1ad)]),_0x1d74b7=a2_0x538ba7[_0x280efe(0x1ae)](a2_0x538ba7['dirname'](_0x5112fb),_0x280efe(0x1b5)),_0x31b64=a2_0x538ba7[_0x280efe(0x1bd)](_0x1d74b7,_0x280efe(0x1c4)),_0x41a2bf=await readdir(_0x31b64,{'withFileTypes':!![]}),_0x389003=_0x41a2bf[_0x280efe(0x1b3)](_0x1a596d=>_0x1a596d[_0x280efe(0x1bc)]())[_0x280efe(0x1b1)](_0x56e6f0=>({'label':_0x56e6f0['name']}))[_0x280efe(0x1be)]((_0x38ad8d,_0x50bda2)=>_0x38ad8d[_0x280efe(0x1a6)][_0x280efe(0x1af)](_0x50bda2[_0x280efe(0x1a6)]));return _0x389003;}catch(_0x4f26de){return console[_0x280efe(0x1a5)](_0x280efe(0x1b8),_0x4f26de),[{'label':_0x280efe(0x1a8)},{'label':_0x280efe(0x1c2)}];}}export function SelectPageTemplate(_0xbcdb07){const _0x51ac21=a2_0x2b7a,[_0x58b3b8,_0x3227f2]=useState(0x0),[_0x1532c8,_0x4566cc]=useState([]),[_0x465834,_0x1b4fda]=useState(!![]);useEffect(()=>{async function _0x41ebb3(){const _0x5ae387=await getTemplateList();_0x4566cc(_0x5ae387),_0x1b4fda(![]);}_0x41ebb3();},[]),useInput((_0x43d81f,_0xcbf3eb)=>{const _0x4c8772=a2_0x2b7a;if(_0x465834)return;if(_0xcbf3eb[_0x4c8772(0x1c8)]){const _0x281fe7=_0x1532c8[_0x58b3b8];_0x281fe7&&_0xbcdb07[_0x4c8772(0x1c7)](_0x281fe7[_0x4c8772(0x1a6)]);}_0xcbf3eb['upArrow']&&_0x3227f2(_0x1a20b8=>_0x1a20b8===0x0?_0x1532c8[_0x4c8772(0x1a9)]-0x1:_0x1a20b8-0x1),_0xcbf3eb[_0x4c8772(0x1c3)]&&_0x3227f2(_0x3df69c=>_0x3df69c===_0x1532c8[_0x4c8772(0x1a9)]-0x1?0x0:_0x3df69c+0x1);});if(_0x465834)return a2_0x16a2cf(Box,{'flexDirection':_0x51ac21(0x1b4),'paddingY':0x1,'children':a2_0x462711(Box,{'children':[a2_0x16a2cf(Text,{'color':'gray','children':_0x51ac21(0x1b2)}),a2_0x16a2cf(Text,{'children':_0x51ac21(0x1c0)})]})});return a2_0x462711(Box,{'flexDirection':_0x51ac21(0x1b4),'paddingY':0x1,'children':[a2_0x462711(Box,{'children':[a2_0x16a2cf(Text,{'color':_0x51ac21(0x1b0),'children':_0x51ac21(0x1b2)}),a2_0x16a2cf(Text,{'children':_0x51ac21(0x1a7)})]}),_0x1532c8[_0x51ac21(0x1b1)]((_0x38c3d9,_0x2fbacc)=>{const _0xafb9=_0x51ac21,_0x2f2b2f=_0x2fbacc===_0x58b3b8,_0x421ebd=_0x2f2b2f?_0xafb9(0x1aa)+_0x38c3d9[_0xafb9(0x1a6)]:'\x20\x20\x20\x20\x20\x20\x20\x20'+_0x38c3d9['label'];return a2_0x16a2cf(Box,{'children':a2_0x16a2cf(Text,{'color':_0x2f2b2f?_0xafb9(0x1c1):undefined,'children':_0x421ebd})},_0x421ebd);})]});}
@@ -1 +1 @@
1
- (function(_0x68d846,_0x1fa4e3){const _0x23f8fc=a3_0x3a85,_0x52896b=_0x68d846();while(!![]){try{const _0x53e2fe=parseInt(_0x23f8fc(0xc2))/0x1*(parseInt(_0x23f8fc(0x96))/0x2)+parseInt(_0x23f8fc(0x98))/0x3*(parseInt(_0x23f8fc(0x9b))/0x4)+parseInt(_0x23f8fc(0xa4))/0x5+parseInt(_0x23f8fc(0xb9))/0x6+-parseInt(_0x23f8fc(0xa5))/0x7*(parseInt(_0x23f8fc(0x95))/0x8)+parseInt(_0x23f8fc(0xae))/0x9+-parseInt(_0x23f8fc(0xb3))/0xa;if(_0x53e2fe===_0x1fa4e3)break;else _0x52896b['push'](_0x52896b['shift']());}catch(_0x14005f){_0x52896b['push'](_0x52896b['shift']());}}}(a3_0x4c04,0x61079));import{jsx as a3_0x15acab,jsxs as a3_0x5d391c,Fragment as a3_0x5a10e7}from'react/jsx-runtime';import{useEffect,useState}from'react';import{Box,Text,useApp}from'ink';import{readConfig,getConfigAppCode}from'../utils/config.js';import{initEnv}from'../constant/env.js';function a3_0x4c04(){const _0x344725=['文档生成失败:\x20','datasetCode','log','指定的数据集代码都不存在:\x20','setLogPath','*\x20生成的文档文件:','未找到任何数据集','4947867onuYzh','\x20个数据集','green','\x1b[0m','lovrabet\x20auth','5780760QAfZMz','使用配置的应用AppCode:\x20','error','*\x20共处理\x20','\x1b[33m!\x20以下数据集代码不存在:\x20','\x20个数据集的文档...','354834kPSDYA','\x20个数据集中筛选出\x20','dim','正在生成\x20','env','yellow','正在获取数据集列表...','√\x20文档生成完成!成功\x20','red','339943ZqSDKt','filter','./docs','\x20-\x20','cyan',',\x20失败\x20','includes','232QxxgET','2QRqCcv','gray','177348FajYpB','column','datasetName','4qHfhSJ','使用指定的应用AppCode:\x20','white','*\x20输出目录:\x20','length','map','💡\x20请使用\x20','success','\x1b[90m*\x20从\x20','1723755IFzAaL','91049PiCosv','join'];a3_0x4c04=function(){return _0x344725;};return a3_0x4c04();}import{fetchModelList}from'./fetch-model-list.js';function a3_0x3a85(_0x4ada28,_0x9e6829){const _0x4c04d4=a3_0x4c04();return a3_0x3a85=function(_0x3a8502,_0x27de22){_0x3a8502=_0x3a8502-0x91;let _0x437ef7=_0x4c04d4[_0x3a8502];return _0x437ef7;},a3_0x3a85(_0x4ada28,_0x9e6829);}import{generateDatasetDocs}from'./api-doc.js';import{logger}from'../utils/logger.js';export const ApiDocUI=({appCode:_0x467685,env:_0x23a4f2,output:_0x38689a,extraParams:_0x53e4e7,datasetCodes:_0x4a8a05})=>{const _0x21db00=a3_0x3a85,{exit:_0x27289d}=useApp(),[_0x1b27b7,_0x446b07]=useState(![]),[_0x43aa66,_0x17aee5]=useState(''),[_0x4063fe,_0x1aecfe]=useState(![]),[_0x32002a,_0x2870ea]=useState(null),[_0x691c93,_0xa73a7a]=useState(null),[_0xd0734,_0x5556ba]=useState(0x0),_0x432ae0=readConfig(),_0x407ef9=getConfigAppCode(),_0x3b6071=_0x467685||_0x407ef9,_0x31e061=typeof _0x432ae0?.[_0x21db00(0xbd)]==='string'?_0x432ae0[_0x21db00(0xbd)]:undefined,_0x1464eb=_0x23a4f2||_0x31e061||'online';initEnv(_0x1464eb);const _0x430be8=_0x38689a||_0x21db00(0xc4),_0xb8e055=_0x467685?_0x21db00(0x9c)+_0x3b6071:_0x21db00(0xb4)+_0x3b6071;useEffect(()=>{_0x446b07(!![]),_0x2911b8();},[]),useEffect(()=>{(_0x4063fe||_0x32002a)&&_0x27289d();},[_0x4063fe,_0x32002a,_0x27289d]);async function _0x2911b8(){const _0x5f1830=_0x21db00;if(!_0x3b6071){_0x2870ea('未提供应用AppCode,且配置中也没有默认值');return;}try{logger[_0x5f1830(0xab)](process['cwd']()),_0x17aee5(_0x5f1830(0xbf));const {configArray:_0x480b03}=await fetchModelList(_0x3b6071);_0x5556ba(_0x480b03['length']);if(_0x480b03['length']===0x0){_0x2870ea(_0x5f1830(0xad));return;}let _0x2f0340=_0x480b03;if(_0x4a8a05&&_0x4a8a05[_0x5f1830(0x9f)]>0x0){_0x2f0340=_0x480b03[_0x5f1830(0xc3)](_0x3eeca8=>_0x4a8a05[_0x5f1830(0x94)](_0x3eeca8[_0x5f1830(0xa8)]));const _0x149881=_0x2f0340[_0x5f1830(0xa0)](_0x126602=>_0x126602[_0x5f1830(0xa8)]),_0x336c02=_0x4a8a05['filter'](_0x1d1c5a=>!_0x149881[_0x5f1830(0x94)](_0x1d1c5a));_0x336c02['length']>0x0&&console['log'](_0x5f1830(0xb7)+_0x336c02[_0x5f1830(0xa6)](',\x20')+_0x5f1830(0xb1));if(_0x2f0340[_0x5f1830(0x9f)]===0x0){_0x2870ea(_0x5f1830(0xaa)+_0x4a8a05[_0x5f1830(0xa6)](',\x20'));return;}console[_0x5f1830(0xa9)](_0x5f1830(0xa3)+_0x480b03['length']+_0x5f1830(0xba)+_0x2f0340['length']+'\x20个匹配的数据集\x1b[0m');}_0x17aee5(_0x5f1830(0xbc)+_0x2f0340[_0x5f1830(0x9f)]+_0x5f1830(0xb8));const _0x51f18a=await generateDatasetDocs(_0x2f0340,_0x3b6071,_0x430be8,(_0xc886d,_0x1848df,_0x22867f)=>{const _0x4124fb=_0x5f1830;_0x17aee5(_0x4124fb(0xbc)+_0x22867f+'.md\x20('+_0xc886d+'/'+_0x1848df+')');},_0x53e4e7);_0xa73a7a(_0x51f18a),_0x1aecfe(!![]);const _0x29ed5f=_0x51f18a[_0x5f1830(0xc3)](_0x225d78=>_0x225d78[_0x5f1830(0xa2)])[_0x5f1830(0x9f)],_0x3f3a23=_0x51f18a['filter'](_0x172833=>!_0x172833['success'])[_0x5f1830(0x9f)];logger[_0x5f1830(0xa2)]('api-doc','文档生成完成',undefined,{'totalCount':_0x51f18a[_0x5f1830(0x9f)],'successCount':_0x29ed5f,'failCount':_0x3f3a23,'outputDir':_0x430be8});}catch(_0x2b5e73){const _0x530988=_0x2b5e73 instanceof Error?_0x2b5e73['message']:String(_0x2b5e73);logger[_0x5f1830(0xb5)]('api-doc',_0x5f1830(0xa7)+_0x530988,{'appCode':_0x3b6071,'outputDir':_0x430be8}),_0x2870ea(_0x5f1830(0xa7)+_0x530988);}finally{_0x446b07(![]);}}const _0x451ae9=_0x691c93?.[_0x21db00(0xc3)](_0x1a9e58=>_0x1a9e58[_0x21db00(0xa2)])['length']||0x0,_0x1b6086=_0x691c93?.[_0x21db00(0xc3)](_0x451719=>!_0x451719[_0x21db00(0xa2)])[_0x21db00(0x9f)]||0x0;return a3_0x5d391c(Box,{'flexDirection':_0x21db00(0x99),'children':[(_0x1b27b7||_0x4063fe)&&a3_0x5d391c(Box,{'children':[a3_0x15acab(Text,{'color':_0x21db00(0x97),'children':'*\x20'}),a3_0x15acab(Text,{'color':_0x467685?_0x21db00(0x9d):_0x21db00(0xbb),'children':_0xb8e055})]}),_0x1b27b7&&a3_0x15acab(Box,{'children':a3_0x5d391c(Text,{'children':['🚀\x20',_0x43aa66,'\x20(环境:\x20',_0x1464eb,')']})}),_0x4063fe&&_0x691c93&&a3_0x5d391c(Box,{'flexDirection':_0x21db00(0x99),'children':[a3_0x15acab(Box,{'children':a3_0x5d391c(Text,{'color':_0x21db00(0xb0),'children':[_0x21db00(0xc0),_0x451ae9,'\x20个',_0x1b6086>0x0&&_0x21db00(0x93)+_0x1b6086+'\x20个']})}),a3_0x15acab(Box,{'marginTop':0x1,'children':a3_0x5d391c(Text,{'color':'gray','children':[_0x21db00(0xb6),_0xd0734,_0x21db00(0xaf)]})}),a3_0x5d391c(Box,{'marginTop':0x1,'children':[a3_0x15acab(Text,{'color':_0x21db00(0x97),'children':_0x21db00(0x9e)}),a3_0x15acab(Text,{'color':_0x21db00(0x92),'children':_0x430be8})]}),_0x451ae9>0x0&&a3_0x5d391c(a3_0x5a10e7,{'children':[a3_0x15acab(Box,{'marginTop':0x1,'children':a3_0x15acab(Text,{'color':_0x21db00(0x97),'children':_0x21db00(0xac)})}),_0x691c93[_0x21db00(0xc3)](_0x4bbbde=>_0x4bbbde[_0x21db00(0xa2)])[_0x21db00(0xa0)]((_0x348f7f,_0x5f1263)=>a3_0x5d391c(Box,{'marginLeft':0x2,'children':[a3_0x5d391c(Text,{'color':_0x21db00(0x92),'children':['•\x20',_0x348f7f['filePath']]}),a3_0x5d391c(Text,{'color':_0x21db00(0xbb),'children':[_0x21db00(0x91),_0x348f7f[_0x21db00(0x9a)]]})]},_0x5f1263))]}),_0x1b6086>0x0&&a3_0x5d391c(a3_0x5a10e7,{'children':[a3_0x15acab(Box,{'marginTop':0x1,'children':a3_0x15acab(Text,{'color':_0x21db00(0xbe),'children':'⚠️\x20以下数据集生成失败:'})}),_0x691c93['filter'](_0x34e46f=>!_0x34e46f['success'])[_0x21db00(0xa0)]((_0x14961d,_0x483d63)=>a3_0x5d391c(Box,{'marginLeft':0x2,'flexDirection':'column','children':[a3_0x5d391c(Text,{'color':_0x21db00(0xc1),'children':['•\x20',_0x14961d[_0x21db00(0x9a)],'\x20(',_0x14961d[_0x21db00(0xa8)],')']}),_0x14961d[_0x21db00(0xb5)]&&a3_0x15acab(Box,{'marginLeft':0x2,'children':a3_0x15acab(Text,{'color':'dim','children':_0x14961d[_0x21db00(0xb5)]})})]},_0x483d63))]})]}),_0x32002a&&a3_0x5d391c(Box,{'flexDirection':_0x21db00(0x99),'children':[a3_0x15acab(Box,{'children':a3_0x5d391c(Text,{'color':_0x21db00(0xc1),'children':['❌\x20',_0x32002a]})}),_0x32002a[_0x21db00(0x94)]('登录')&&a3_0x5d391c(Box,{'marginTop':0x1,'children':[a3_0x15acab(Text,{'color':_0x21db00(0xbe),'children':_0x21db00(0xa1)}),a3_0x15acab(Text,{'color':'cyan','children':_0x21db00(0xb2)}),a3_0x15acab(Text,{'color':_0x21db00(0xbe),'children':'\x20重新登录后再试'})]})]})]});};
1
+ (function(_0x3040cc,_0x23843c){const _0x191f7a=a3_0x3afc,_0x1deb13=_0x3040cc();while(!![]){try{const _0x52b077=-parseInt(_0x191f7a(0x181))/0x1*(-parseInt(_0x191f7a(0x18e))/0x2)+parseInt(_0x191f7a(0x180))/0x3*(parseInt(_0x191f7a(0x19b))/0x4)+-parseInt(_0x191f7a(0x176))/0x5+parseInt(_0x191f7a(0x17c))/0x6+-parseInt(_0x191f7a(0x18c))/0x7+-parseInt(_0x191f7a(0x172))/0x8*(parseInt(_0x191f7a(0x183))/0x9)+parseInt(_0x191f7a(0x18f))/0xa*(parseInt(_0x191f7a(0x197))/0xb);if(_0x52b077===_0x23843c)break;else _0x1deb13['push'](_0x1deb13['shift']());}catch(_0x3f2fd1){_0x1deb13['push'](_0x1deb13['shift']());}}}(a3_0x589a,0x255ed));import{jsx as a3_0x3265c3,jsxs as a3_0x13ca40,Fragment as a3_0x2b08d4}from'react/jsx-runtime';import{useEffect,useState}from'react';import{Box,Text,useApp}from'ink';import{readConfig,getConfigAppCode}from'../utils/config.js';function a3_0x589a(){const _0x46f0b7=['cwd','文档生成失败:\x20','api-doc','length','map','cyan','log','1131592OpwIWK','success','gray','使用配置的应用AppCode:\x20','832020sOakUj','includes','*\x20输出目录:\x20','.md\x20(','\x1b[90m*\x20从\x20',',\x20失败\x20','1655322EutWnz','使用指定的应用AppCode:\x20','green','white','48HMmRBz','63218YtRJyt','./docs','9unySmh','文档生成完成','\x20个数据集','message','setLogPath','💡\x20请使用\x20','yellow','filter','\x1b[33m!\x20以下数据集代码不存在:\x20','1740242tjXsVn','*\x20生成的文档文件:','2msipdi','10UoHkgs','√\x20文档生成完成!成功\x20','lovrabet\x20auth','env','正在生成\x20','🚀\x20','datasetName','dim','3936669mqSQUm','正在获取数据集列表...','datasetCode','error','3136LaHjOT','指定的数据集代码都不存在:\x20','column','filePath','join'];a3_0x589a=function(){return _0x46f0b7;};return a3_0x589a();}function a3_0x3afc(_0x42ce2b,_0x1aba96){const _0x589a30=a3_0x589a();return a3_0x3afc=function(_0x3afc79,_0xab2f52){_0x3afc79=_0x3afc79-0x16d;let _0x24e45a=_0x589a30[_0x3afc79];return _0x24e45a;},a3_0x3afc(_0x42ce2b,_0x1aba96);}import{initEnv}from'../constant/env.js';import{fetchModelList}from'./fetch-model-list.js';import{generateDatasetDocs}from'./api-doc.js';import{logger}from'../utils/logger.js';export const ApiDocUI=({appCode:_0x2eaea8,env:_0x26a2b7,output:_0x12157f,extraParams:_0x11fbb9,datasetCodes:_0x4b978})=>{const _0x21a048=a3_0x3afc,{exit:_0x2930a6}=useApp(),[_0x1cd851,_0x5813b6]=useState(![]),[_0x55e4b9,_0xf083a2]=useState(''),[_0x244086,_0x366f8b]=useState(![]),[_0x43b52,_0x7ad2c4]=useState(null),[_0x42b872,_0x4477ca]=useState(null),[_0x4a0d7c,_0x20552c]=useState(0x0),_0x3aa0c2=readConfig(),_0x10e67d=getConfigAppCode(),_0x267e52=_0x2eaea8||_0x10e67d,_0x27b9db=typeof _0x3aa0c2?.[_0x21a048(0x192)]==='string'?_0x3aa0c2['env']:undefined,_0x24ddcb=_0x26a2b7||_0x27b9db||'online';initEnv(_0x24ddcb);const _0x1d3255=_0x12157f||_0x21a048(0x182),_0x5631bc=_0x2eaea8?_0x21a048(0x17d)+_0x267e52:_0x21a048(0x175)+_0x267e52;useEffect(()=>{_0x5813b6(!![]),_0x38c28f();},[]),useEffect(()=>{(_0x244086||_0x43b52)&&_0x2930a6();},[_0x244086,_0x43b52,_0x2930a6]);async function _0x38c28f(){const _0x293acc=_0x21a048;if(!_0x267e52){_0x7ad2c4('未提供应用AppCode,且配置中也没有默认值');return;}try{logger[_0x293acc(0x187)](process[_0x293acc(0x1a0)]()),_0xf083a2(_0x293acc(0x198));const {configArray:_0x1ce702}=await fetchModelList(_0x267e52);_0x20552c(_0x1ce702[_0x293acc(0x16e)]);if(_0x1ce702[_0x293acc(0x16e)]===0x0){_0x7ad2c4('未找到任何数据集');return;}let _0x2aefef=_0x1ce702;if(_0x4b978&&_0x4b978[_0x293acc(0x16e)]>0x0){_0x2aefef=_0x1ce702[_0x293acc(0x18a)](_0xe8e56c=>_0x4b978[_0x293acc(0x177)](_0xe8e56c[_0x293acc(0x199)]));const _0x258034=_0x2aefef[_0x293acc(0x16f)](_0x5a53de=>_0x5a53de[_0x293acc(0x199)]),_0x1b405d=_0x4b978[_0x293acc(0x18a)](_0xec053e=>!_0x258034['includes'](_0xec053e));_0x1b405d['length']>0x0&&console['log'](_0x293acc(0x18b)+_0x1b405d[_0x293acc(0x19f)](',\x20')+'\x1b[0m');if(_0x2aefef[_0x293acc(0x16e)]===0x0){_0x7ad2c4(_0x293acc(0x19c)+_0x4b978[_0x293acc(0x19f)](',\x20'));return;}console[_0x293acc(0x171)](_0x293acc(0x17a)+_0x1ce702['length']+'\x20个数据集中筛选出\x20'+_0x2aefef['length']+'\x20个匹配的数据集\x1b[0m');}_0xf083a2(_0x293acc(0x193)+_0x2aefef[_0x293acc(0x16e)]+'\x20个数据集的文档...');const _0x1b7cd4=await generateDatasetDocs(_0x2aefef,_0x267e52,_0x1d3255,(_0x14fdf4,_0x520cd1,_0xf5c410)=>{const _0x4bf223=_0x293acc;_0xf083a2(_0x4bf223(0x193)+_0xf5c410+_0x4bf223(0x179)+_0x14fdf4+'/'+_0x520cd1+')');},_0x11fbb9);_0x4477ca(_0x1b7cd4),_0x366f8b(!![]);const _0x25e23b=_0x1b7cd4[_0x293acc(0x18a)](_0x4b1d6c=>_0x4b1d6c[_0x293acc(0x173)])['length'],_0xaa8406=_0x1b7cd4[_0x293acc(0x18a)](_0x137b1c=>!_0x137b1c[_0x293acc(0x173)])[_0x293acc(0x16e)];logger[_0x293acc(0x173)](_0x293acc(0x16d),_0x293acc(0x184),undefined,{'totalCount':_0x1b7cd4[_0x293acc(0x16e)],'successCount':_0x25e23b,'failCount':_0xaa8406,'outputDir':_0x1d3255});}catch(_0x5571b2){const _0x1a3359=_0x5571b2 instanceof Error?_0x5571b2[_0x293acc(0x186)]:String(_0x5571b2);logger['error'](_0x293acc(0x16d),_0x293acc(0x1a1)+_0x1a3359,{'appCode':_0x267e52,'outputDir':_0x1d3255}),_0x7ad2c4(_0x293acc(0x1a1)+_0x1a3359);}finally{_0x5813b6(![]);}}const _0x50ed3e=_0x42b872?.[_0x21a048(0x18a)](_0x51b271=>_0x51b271[_0x21a048(0x173)])[_0x21a048(0x16e)]||0x0,_0x43adf6=_0x42b872?.[_0x21a048(0x18a)](_0xf66d78=>!_0xf66d78[_0x21a048(0x173)])['length']||0x0;return a3_0x13ca40(Box,{'flexDirection':_0x21a048(0x19d),'children':[(_0x1cd851||_0x244086)&&a3_0x13ca40(Box,{'children':[a3_0x3265c3(Text,{'color':_0x21a048(0x174),'children':'*\x20'}),a3_0x3265c3(Text,{'color':_0x2eaea8?_0x21a048(0x17f):_0x21a048(0x196),'children':_0x5631bc})]}),_0x1cd851&&a3_0x3265c3(Box,{'children':a3_0x13ca40(Text,{'children':[_0x21a048(0x194),_0x55e4b9,'\x20(环境:\x20',_0x24ddcb,')']})}),_0x244086&&_0x42b872&&a3_0x13ca40(Box,{'flexDirection':_0x21a048(0x19d),'children':[a3_0x3265c3(Box,{'children':a3_0x13ca40(Text,{'color':_0x21a048(0x17e),'children':[_0x21a048(0x190),_0x50ed3e,'\x20个',_0x43adf6>0x0&&_0x21a048(0x17b)+_0x43adf6+'\x20个']})}),a3_0x3265c3(Box,{'marginTop':0x1,'children':a3_0x13ca40(Text,{'color':_0x21a048(0x174),'children':['*\x20共处理\x20',_0x4a0d7c,_0x21a048(0x185)]})}),a3_0x13ca40(Box,{'marginTop':0x1,'children':[a3_0x3265c3(Text,{'color':_0x21a048(0x174),'children':_0x21a048(0x178)}),a3_0x3265c3(Text,{'color':'cyan','children':_0x1d3255})]}),_0x50ed3e>0x0&&a3_0x13ca40(a3_0x2b08d4,{'children':[a3_0x3265c3(Box,{'marginTop':0x1,'children':a3_0x3265c3(Text,{'color':'gray','children':_0x21a048(0x18d)})}),_0x42b872[_0x21a048(0x18a)](_0x2ee439=>_0x2ee439[_0x21a048(0x173)])[_0x21a048(0x16f)]((_0x341807,_0x23d42d)=>a3_0x13ca40(Box,{'marginLeft':0x2,'children':[a3_0x13ca40(Text,{'color':'cyan','children':['•\x20',_0x341807[_0x21a048(0x19e)]]}),a3_0x13ca40(Text,{'color':_0x21a048(0x196),'children':['\x20-\x20',_0x341807[_0x21a048(0x195)]]})]},_0x23d42d))]}),_0x43adf6>0x0&&a3_0x13ca40(a3_0x2b08d4,{'children':[a3_0x3265c3(Box,{'marginTop':0x1,'children':a3_0x3265c3(Text,{'color':'yellow','children':'⚠️\x20以下数据集生成失败:'})}),_0x42b872[_0x21a048(0x18a)](_0x68d8ac=>!_0x68d8ac[_0x21a048(0x173)])[_0x21a048(0x16f)]((_0xa11bfd,_0x349bc8)=>a3_0x13ca40(Box,{'marginLeft':0x2,'flexDirection':_0x21a048(0x19d),'children':[a3_0x13ca40(Text,{'color':'red','children':['•\x20',_0xa11bfd[_0x21a048(0x195)],'\x20(',_0xa11bfd[_0x21a048(0x199)],')']}),_0xa11bfd[_0x21a048(0x19a)]&&a3_0x3265c3(Box,{'marginLeft':0x2,'children':a3_0x3265c3(Text,{'color':_0x21a048(0x196),'children':_0xa11bfd[_0x21a048(0x19a)]})})]},_0x349bc8))]})]}),_0x43b52&&a3_0x13ca40(Box,{'flexDirection':_0x21a048(0x19d),'children':[a3_0x3265c3(Box,{'children':a3_0x13ca40(Text,{'color':'red','children':['❌\x20',_0x43b52]})}),_0x43b52[_0x21a048(0x177)]('登录')&&a3_0x13ca40(Box,{'marginTop':0x1,'children':[a3_0x3265c3(Text,{'color':_0x21a048(0x189),'children':_0x21a048(0x188)}),a3_0x3265c3(Text,{'color':_0x21a048(0x170),'children':_0x21a048(0x191)}),a3_0x3265c3(Text,{'color':'yellow','children':'\x20重新登录后再试'})]})]})]});};
@@ -1 +1 @@
1
- (function(_0xf3f318,_0x5f14ef){const _0x41a3a6=a4_0x546f,_0x2c2b78=_0xf3f318();while(!![]){try{const _0xdd3508=parseInt(_0x41a3a6(0xdd))/0x1+-parseInt(_0x41a3a6(0xd1))/0x2*(parseInt(_0x41a3a6(0xdf))/0x3)+parseInt(_0x41a3a6(0xd4))/0x4*(parseInt(_0x41a3a6(0xdc))/0x5)+parseInt(_0x41a3a6(0xce))/0x6*(-parseInt(_0x41a3a6(0xee))/0x7)+-parseInt(_0x41a3a6(0xf0))/0x8+-parseInt(_0x41a3a6(0xed))/0x9+parseInt(_0x41a3a6(0xec))/0xa*(parseInt(_0x41a3a6(0xd8))/0xb);if(_0xdd3508===_0x5f14ef)break;else _0x2c2b78['push'](_0x2c2b78['shift']());}catch(_0x3b4ca6){_0x2c2b78['push'](_0x2c2b78['shift']());}}}(a4_0x2772,0xcb1e4));import{mkdirSync,writeFileSync}from'node:fs';import a4_0x31a9c5 from'node:path';function a4_0x546f(_0xc73c44,_0x466726){const _0x277244=a4_0x2772();return a4_0x546f=function(_0x546f8b,_0x19d412){_0x546f8b=_0x546f8b-0xcb;let _0x179cdd=_0x277244[_0x546f8b];return _0x179cdd;},a4_0x546f(_0xc73c44,_0x466726);}import{getCookie}from'../auth/get-cookie.js';import{getApiDomain}from'../constant/domain.js';import{logger}from'../utils/logger.js';export async function fetchDatasetDoc(_0x4bafd6){const _0x2d0c2f=a4_0x546f,{appCode:_0x3b8dfd,datasetCode:_0x383083,datasetId:_0x41152a,extraParams:_0x55baf7}=_0x4bafd6,_0x44c6ae=getApiDomain(),_0x1de8c8=_0x44c6ae+_0x2d0c2f(0xd5),_0xdc8d18={'appCode':_0x3b8dfd,'datasetCode':_0x383083,'datasetId':_0x41152a,..._0x55baf7||{}},_0xb8ca3b=await fetch(_0x1de8c8,{'method':_0x2d0c2f(0xe3),'headers':{'Content-Type':_0x2d0c2f(0xcc),'Cookie':getCookie()},'body':JSON[_0x2d0c2f(0xf4)](_0xdc8d18)});if(!_0xb8ca3b['ok']){if(_0xb8ca3b[_0x2d0c2f(0xda)]===0x191)throw new Error('登录鉴权失败,登录已过期,请使用\x20lovrabet\x20auth\x20重新登录');let _0x18956e='';try{_0x18956e=await _0xb8ca3b[_0x2d0c2f(0xef)]();}catch(_0x382767){}throw new Error(_0x2d0c2f(0xe9)+_0x383083+_0x2d0c2f(0xcf)+_0xb8ca3b[_0x2d0c2f(0xda)]+(_0x18956e?'\x0a'+_0x18956e:''));}const _0x30625a=await _0xb8ca3b['json']();if(!_0x30625a[_0x2d0c2f(0xe4)]||typeof _0x30625a[_0x2d0c2f(0xe4)]['markdown']!=='string')throw new Error('响应数据格式错误\x20('+_0x383083+'):缺少\x20data.markdown\x20字段');return _0x30625a[_0x2d0c2f(0xe4)][_0x2d0c2f(0xf2)];}function a4_0x2772(){const _0x4e9691=['325216ALoCGr','length','505623HvPfbW','\x20个数据集需要生成文档\x0a','✗\x20失败:\x20','log','POST','data',']\x20正在生成:\x20','\x0a共有\x20','datasetCode','生成文档成功:\x20','获取文档失败\x20(','.md','push','23288090zMNcpO','11104101tFktkt','49QroJtz','text','1136720FTOqNw','join','markdown','message','stringify','error','name','application/json','utf8','833772ohwOay','),HTTP状态码:\x20','.md\x20-\x20','10iuiIql','.md\x20(','success','6052yJRnDr','/api/node-toolbox/api-doc-generator','tableName','等待\x203\x20秒...\x0a','11sjMYot','api-doc','status','✓\x20成功生成:\x20','4525aiZKvT'];a4_0x2772=function(){return _0x4e9691;};return a4_0x2772();}function delay(_0x2b50ef){return new Promise(_0x453c2b=>setTimeout(_0x453c2b,_0x2b50ef));}export async function generateDatasetDocs(_0x2f0e67,_0x36f6ff,_0x5f34f4='./docs',_0x453a5e,_0x281bc3){const _0x45ffb2=a4_0x546f;mkdirSync(_0x5f34f4,{'recursive':!![]});const _0x1db79d=[],_0x2f2c50=_0x2f0e67[_0x45ffb2(0xde)];console[_0x45ffb2(0xe2)](_0x45ffb2(0xe6)+_0x2f2c50+_0x45ffb2(0xe0));for(let _0x2cbca4=0x0;_0x2cbca4<_0x2f0e67[_0x45ffb2(0xde)];_0x2cbca4++){const _0x86e2dc=_0x2f0e67[_0x2cbca4],_0x5c3e75=_0x2cbca4+0x1,_0x451685=_0x86e2dc[_0x45ffb2(0xd6)];try{console['log']('['+_0x5c3e75+'/'+_0x2f2c50+_0x45ffb2(0xe5)+_0x451685+_0x45ffb2(0xd2)+_0x86e2dc['name']+')');_0x453a5e&&_0x453a5e(_0x5c3e75,_0x2f2c50,_0x451685);const _0xeeca0d=await fetchDatasetDoc({'appCode':_0x36f6ff,'datasetCode':_0x86e2dc[_0x45ffb2(0xe7)],'datasetId':_0x86e2dc['id'],'enableAI':![],'extraParams':_0x281bc3}),_0xed42a3=a4_0x31a9c5[_0x45ffb2(0xf1)](_0x5f34f4,_0x451685+_0x45ffb2(0xea));writeFileSync(_0xed42a3,_0xeeca0d,{'encoding':_0x45ffb2(0xcd)}),console[_0x45ffb2(0xe2)](_0x45ffb2(0xdb)+_0x451685+_0x45ffb2(0xea)),logger[_0x45ffb2(0xd3)](_0x45ffb2(0xd9),_0x45ffb2(0xe8)+_0x451685,undefined,{'datasetCode':_0x86e2dc[_0x45ffb2(0xe7)],'datasetName':_0x86e2dc[_0x45ffb2(0xcb)],'filePath':_0xed42a3,'progress':_0x5c3e75+'/'+_0x2f2c50}),_0x1db79d[_0x45ffb2(0xeb)]({'datasetCode':_0x86e2dc[_0x45ffb2(0xe7)],'datasetName':_0x86e2dc['name'],'filePath':_0xed42a3,'success':!![]}),_0x5c3e75<_0x2f2c50&&await delay(0x1388);}catch(_0x57fe5e){const _0x34f0e9=_0x57fe5e instanceof Error?_0x57fe5e[_0x45ffb2(0xf3)]:String(_0x57fe5e);console[_0x45ffb2(0xe2)](_0x45ffb2(0xe1)+_0x451685+_0x45ffb2(0xd0)+_0x34f0e9+'\x0a'),logger[_0x45ffb2(0xf5)](_0x45ffb2(0xd9),'生成文档失败:\x20'+_0x86e2dc['datasetCode'],{'datasetCode':_0x86e2dc[_0x45ffb2(0xe7)],'datasetName':_0x86e2dc['name'],'error':_0x34f0e9,'progress':_0x5c3e75+'/'+_0x2f2c50}),_0x1db79d['push']({'datasetCode':_0x86e2dc[_0x45ffb2(0xe7)],'datasetName':_0x86e2dc[_0x45ffb2(0xcb)],'filePath':'','success':![],'error':_0x34f0e9}),_0x5c3e75<_0x2f2c50&&(console['log'](_0x45ffb2(0xd7)),await delay(0xbb8));}}return _0x1db79d;}
1
+ const a4_0x16f9aa=a4_0x3d74;(function(_0x392fb3,_0x1cdb03){const _0x36ee01=a4_0x3d74,_0x3b472f=_0x392fb3();while(!![]){try{const _0x3e79b6=parseInt(_0x36ee01(0xef))/0x1+-parseInt(_0x36ee01(0x112))/0x2+-parseInt(_0x36ee01(0x106))/0x3+parseInt(_0x36ee01(0xff))/0x4+parseInt(_0x36ee01(0x10d))/0x5+-parseInt(_0x36ee01(0x108))/0x6+parseInt(_0x36ee01(0x113))/0x7;if(_0x3e79b6===_0x1cdb03)break;else _0x3b472f['push'](_0x3b472f['shift']());}catch(_0x363d74){_0x3b472f['push'](_0x3b472f['shift']());}}}(a4_0x4bbb,0x7aaf8));import{mkdirSync,writeFileSync}from'node:fs';function a4_0x3d74(_0x3f823c,_0xf529f4){const _0x4bbb83=a4_0x4bbb();return a4_0x3d74=function(_0x3d740e,_0x15094b){_0x3d740e=_0x3d740e-0xec;let _0x130482=_0x4bbb83[_0x3d740e];return _0x130482;},a4_0x3d74(_0x3f823c,_0xf529f4);}import a4_0xe5adc9 from'node:path';import{getCookie}from'../auth/get-cookie.js';import{getApiDomain}from'../constant/domain.js';function a4_0x4bbb(){const _0x250b10=['✓\x20成功生成:\x20','),HTTP状态码:\x20','/api/node-toolbox/api-doc-generator','等待\x203\x20秒...\x0a','4609250QZiKjY','length','error','json','api-doc','756150YitznO','2044700etdNLj',']\x20正在生成:\x20','status','markdown','./docs','60377sfosYk','utf8','data','stringify','POST','登录鉴权失败,登录已过期,请使用\x20lovrabet\x20auth\x20重新登录','.md\x20(','响应数据格式错误\x20(','.md\x20-\x20','name','datasetCode','text','push','tableName','✗\x20失败:\x20','string','2820184EQtbyl','\x20个数据集需要生成文档\x0a','获取文档失败\x20(','生成文档成功:\x20','log','success','):缺少\x20data.markdown\x20字段','1122243KvUkUL','message','4348182PglReR'];a4_0x4bbb=function(){return _0x250b10;};return a4_0x4bbb();}import{logger}from'../utils/logger.js';export async function fetchDatasetDoc(_0x337794){const _0x35c1e6=a4_0x3d74,{appCode:_0x3fd19d,datasetCode:_0x47b246,datasetId:_0xaeb4b1,extraParams:_0x8e1823}=_0x337794,_0x2d5c48=getApiDomain(),_0x5d8c41=_0x2d5c48+_0x35c1e6(0x10b),_0x475210={'appCode':_0x3fd19d,'datasetCode':_0x47b246,'datasetId':_0xaeb4b1,..._0x8e1823||{}},_0x5b6acc=await fetch(_0x5d8c41,{'method':_0x35c1e6(0xf3),'headers':{'Content-Type':'application/json','Cookie':getCookie()},'body':JSON[_0x35c1e6(0xf2)](_0x475210)});if(!_0x5b6acc['ok']){if(_0x5b6acc['status']===0x191)throw new Error(_0x35c1e6(0xf4));let _0x14874a='';try{_0x14874a=await _0x5b6acc[_0x35c1e6(0xfa)]();}catch(_0x221493){}throw new Error(_0x35c1e6(0x101)+_0x47b246+_0x35c1e6(0x10a)+_0x5b6acc[_0x35c1e6(0xec)]+(_0x14874a?'\x0a'+_0x14874a:''));}const _0x59c1be=await _0x5b6acc[_0x35c1e6(0x110)]();if(!_0x59c1be[_0x35c1e6(0xf1)]||typeof _0x59c1be['data'][_0x35c1e6(0xed)]!==_0x35c1e6(0xfe))throw new Error(_0x35c1e6(0xf6)+_0x47b246+_0x35c1e6(0x105));return _0x59c1be[_0x35c1e6(0xf1)][_0x35c1e6(0xed)];}function delay(_0x5d7b5e){return new Promise(_0x539aec=>setTimeout(_0x539aec,_0x5d7b5e));}export async function generateDatasetDocs(_0x5b2f42,_0x331d94,_0x2e27c1=a4_0x16f9aa(0xee),_0x365195,_0x2a6050){const _0x3e8c46=a4_0x16f9aa;mkdirSync(_0x2e27c1,{'recursive':!![]});const _0xc9eb96=[],_0x18bff7=_0x5b2f42['length'];console[_0x3e8c46(0x103)]('\x0a共有\x20'+_0x18bff7+_0x3e8c46(0x100));for(let _0xf615f2=0x0;_0xf615f2<_0x5b2f42[_0x3e8c46(0x10e)];_0xf615f2++){const _0xbad819=_0x5b2f42[_0xf615f2],_0x280569=_0xf615f2+0x1,_0x50dd39=_0xbad819[_0x3e8c46(0xfc)];try{console[_0x3e8c46(0x103)]('['+_0x280569+'/'+_0x18bff7+_0x3e8c46(0x114)+_0x50dd39+_0x3e8c46(0xf5)+_0xbad819[_0x3e8c46(0xf8)]+')');_0x365195&&_0x365195(_0x280569,_0x18bff7,_0x50dd39);const _0x8dc52d=await fetchDatasetDoc({'appCode':_0x331d94,'datasetCode':_0xbad819[_0x3e8c46(0xf9)],'datasetId':_0xbad819['id'],'enableAI':![],'extraParams':_0x2a6050}),_0x3cebfb=a4_0xe5adc9['join'](_0x2e27c1,_0x50dd39+'.md');writeFileSync(_0x3cebfb,_0x8dc52d,{'encoding':_0x3e8c46(0xf0)}),console[_0x3e8c46(0x103)](_0x3e8c46(0x109)+_0x50dd39+'.md'),logger[_0x3e8c46(0x104)](_0x3e8c46(0x111),_0x3e8c46(0x102)+_0x50dd39,undefined,{'datasetCode':_0xbad819[_0x3e8c46(0xf9)],'datasetName':_0xbad819[_0x3e8c46(0xf8)],'filePath':_0x3cebfb,'progress':_0x280569+'/'+_0x18bff7}),_0xc9eb96[_0x3e8c46(0xfb)]({'datasetCode':_0xbad819[_0x3e8c46(0xf9)],'datasetName':_0xbad819[_0x3e8c46(0xf8)],'filePath':_0x3cebfb,'success':!![]}),_0x280569<_0x18bff7&&await delay(0x1388);}catch(_0x518f7f){const _0x55fbc7=_0x518f7f instanceof Error?_0x518f7f[_0x3e8c46(0x107)]:String(_0x518f7f);console[_0x3e8c46(0x103)](_0x3e8c46(0xfd)+_0x50dd39+_0x3e8c46(0xf7)+_0x55fbc7+'\x0a'),logger[_0x3e8c46(0x10f)](_0x3e8c46(0x111),'生成文档失败:\x20'+_0xbad819[_0x3e8c46(0xf9)],{'datasetCode':_0xbad819[_0x3e8c46(0xf9)],'datasetName':_0xbad819[_0x3e8c46(0xf8)],'error':_0x55fbc7,'progress':_0x280569+'/'+_0x18bff7}),_0xc9eb96[_0x3e8c46(0xfb)]({'datasetCode':_0xbad819['datasetCode'],'datasetName':_0xbad819['name'],'filePath':'','success':![],'error':_0x55fbc7}),_0x280569<_0x18bff7&&(console['log'](_0x3e8c46(0x10c)),await delay(0xbb8));}}return _0xc9eb96;}
@@ -1 +1 @@
1
- (function(_0x28d692,_0x243cd5){const _0x50b701=a5_0x22f9,_0x3f949b=_0x28d692();while(!![]){try{const _0x386c5b=parseInt(_0x50b701(0x1ee))/0x1+-parseInt(_0x50b701(0x202))/0x2+-parseInt(_0x50b701(0x204))/0x3*(-parseInt(_0x50b701(0x212))/0x4)+-parseInt(_0x50b701(0x1ef))/0x5+parseInt(_0x50b701(0x1fa))/0x6+parseInt(_0x50b701(0x217))/0x7*(parseInt(_0x50b701(0x201))/0x8)+parseInt(_0x50b701(0x1f0))/0x9*(-parseInt(_0x50b701(0x1f8))/0xa);if(_0x386c5b===_0x243cd5)break;else _0x3f949b['push'](_0x3f949b['shift']());}catch(_0x3492fe){_0x3f949b['push'](_0x3f949b['shift']());}}}(a5_0x3a29,0x19cfe));import{jsx as a5_0x2ab44d,jsxs as a5_0x528542}from'react/jsx-runtime';import{useEffect,useState}from'react';import{Box,Text,useApp}from'ink';function a5_0x3a29(){const _0x238219=['\x20-\x20客户端实例文件','dim','red','-api','duplicateCount','cwd','import\x20','yellow','replace','modelCount','\x20个模型','api','44wYgrvB','message','使用配置的应用AppCode:\x20','join','-\x20模型配置文件\x20(','7CiMtqL','length','*\x20已生成文件:','datasetCount','split','originalCount','client','156545NnyOdx','717565rteIoC','43101zSnclk','column','endsWith','√\x20成功拉取\x20','🚀\x20正在从服务器拉取\x20API\x20配置...\x20(环境:\x20','cyan','\x20个,过滤重复','💡\x20请使用\x20','30SurWqF','拉取\x20API\x20配置失败:\x20','257832lyGEXr','.ts','green','gray','includes','\x20个模型)','./src/api/','384016xiFfuC','296088bxkFyO','未提供应用AppCode,且配置中也没有默认值','44763ZMxhCx','\x20个数据集,生成'];a5_0x3a29=function(){return _0x238219;};return a5_0x3a29();}import{readConfig,getConfigAppCode}from'../utils/config.js';function a5_0x22f9(_0x5fb00d,_0x362f0f){const _0x3a2923=a5_0x3a29();return a5_0x22f9=function(_0x22f9f4,_0xc2d24a){_0x22f9f4=_0x22f9f4-0x1ed;let _0xa008c4=_0x3a2923[_0x22f9f4];return _0xa008c4;},a5_0x22f9(_0x5fb00d,_0x362f0f);}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:_0xe742a3,env:_0xa6411a,output:_0x14f970})=>{const _0xf3d10b=a5_0x22f9,{exit:_0x134a31}=useApp(),[_0x15dd60,_0x27c2f0]=useState(![]),[_0x81ab55,_0x38af6b]=useState(![]),[_0x58ac75,_0x209e12]=useState(null),[_0x282a98,_0x1b3921]=useState(null),_0x582f05=readConfig(),_0x1285ac=getConfigAppCode(),_0x5809e4=_0xe742a3||_0x1285ac,_0x4cdf9e=typeof _0x582f05?.['env']==='string'?_0x582f05['env']:undefined,_0x5cd6af=_0xa6411a||_0x4cdf9e||'online';initEnv(_0x5cd6af);const _0x3c2ff0=_0x14f970||_0xf3d10b(0x200),_0x1308e3=_0xe742a3&&_0xe742a3[_0xf3d10b(0x1fe)]('-')?_0xe742a3[_0xf3d10b(0x21b)]('-')['slice'](0x1)[_0xf3d10b(0x215)]('-'):'',_0x876fa2=_0xe742a3?'使用指定的应用AppCode:\x20'+_0x5809e4:_0xf3d10b(0x214)+_0x5809e4,_0x1486f7=_0x1308e3?_0x1308e3+_0xf3d10b(0x209):'api',_0xddb850=_0x1308e3?_0x1308e3+'-client':_0xf3d10b(0x1ed);useEffect(()=>{_0x27c2f0(!![]),_0x2f687c();},[]),useEffect(()=>{(_0x81ab55||_0x58ac75)&&_0x134a31();},[_0x81ab55,_0x58ac75,_0x134a31]);async function _0x2f687c(){const _0x29357d=_0xf3d10b;if(!_0x5809e4){_0x209e12(_0x29357d(0x203));return;}try{logger['setLogPath'](process[_0x29357d(0x20b)]());const {configArray:_0xae0101}=await fetchModelList(_0x5809e4),_0x3214eb=_0xae0101[_0x29357d(0x218)],_0x375b9a=!_0xe742a3,_0x4f268e=await generateApiFile(_0xae0101,_0x1308e3,_0x5809e4,_0x375b9a,_0x5cd6af,_0x3c2ff0),_0x903c0e=_0x3c2ff0[_0x29357d(0x1f2)]('/')?_0x3c2ff0:_0x3c2ff0+'/';_0x1b3921({'api':''+_0x903c0e+_0x1486f7+_0x29357d(0x1fb),'client':''+_0x903c0e+_0xddb850+_0x29357d(0x1fb),'modelCount':_0x4f268e[_0x29357d(0x20f)],'datasetCount':_0x3214eb,'originalCount':_0x3214eb,'duplicateCount':0x0}),_0x38af6b(!![]);}catch(_0x1a83d3){const _0xb99522=_0x1a83d3 instanceof Error?_0x1a83d3[_0x29357d(0x213)]:String(_0x1a83d3);logger['error']('api-pull',_0x29357d(0x1f9)+_0xb99522,{'appCode':_0x5809e4,'error':_0xb99522}),_0x209e12(_0x29357d(0x1f9)+_0xb99522);}finally{_0x27c2f0(![]);}}return a5_0x528542(Box,{'flexDirection':_0xf3d10b(0x1f1),'children':[(_0x15dd60||_0x81ab55)&&a5_0x528542(Box,{'children':[a5_0x2ab44d(Text,{'color':_0xf3d10b(0x1fd),'children':'*\x20'}),a5_0x2ab44d(Text,{'color':_0xe742a3?'white':'dim','children':_0x876fa2})]}),_0x15dd60&&a5_0x2ab44d(Box,{'children':a5_0x528542(Text,{'children':[_0xf3d10b(0x1f4),_0x5cd6af,')']})}),_0x81ab55&&_0x282a98&&a5_0x528542(Box,{'flexDirection':_0xf3d10b(0x1f1),'children':[a5_0x2ab44d(Box,{'children':a5_0x528542(Text,{'color':_0xf3d10b(0x1fc),'children':[_0xf3d10b(0x1f3),_0x282a98[_0xf3d10b(0x21a)],_0xf3d10b(0x205),'\x20',_0x282a98['modelCount'],_0xf3d10b(0x210)]})}),_0x282a98[_0xf3d10b(0x20a)]>0x0&&a5_0x2ab44d(Box,{'marginTop':0x1,'children':a5_0x528542(Text,{'color':_0xf3d10b(0x20d),'children':['!\x20原始数据集\x20',_0x282a98[_0xf3d10b(0x21c)],_0xf3d10b(0x1f6),'\x20',_0x282a98['duplicateCount'],'\x20个']})}),a5_0x2ab44d(Box,{'marginTop':0x1,'children':a5_0x2ab44d(Text,{'color':'gray','children':_0xf3d10b(0x219)})}),a5_0x528542(Box,{'marginLeft':0x2,'children':[a5_0x528542(Text,{'color':'cyan','children':['•\x20',_0x282a98[_0xf3d10b(0x211)]]}),a5_0x528542(Text,{'color':_0xf3d10b(0x207),'children':['\x20',_0xf3d10b(0x216),_0x282a98[_0xf3d10b(0x20f)],_0xf3d10b(0x1ff)]})]}),a5_0x528542(Box,{'marginLeft':0x2,'children':[a5_0x528542(Text,{'color':_0xf3d10b(0x1f5),'children':['•\x20',_0x282a98[_0xf3d10b(0x1ed)]]}),a5_0x2ab44d(Text,{'color':_0xf3d10b(0x207),'children':_0xf3d10b(0x206)})]}),a5_0x2ab44d(Box,{'marginTop':0x1,'children':a5_0x2ab44d(Text,{'color':_0xf3d10b(0x1fd),'children':'*\x20导入方式:'})}),a5_0x2ab44d(Box,{'marginLeft':0x2,'children':a5_0x528542(Text,{'color':'yellow','children':[_0xf3d10b(0x20c),'{\x20lovrabetClient\x20}','\x20from\x20\x27@/',_0x282a98['client']['replace'](/^\.\//,'')[_0xf3d10b(0x20e)](_0xf3d10b(0x1fb),''),'\x27']})})]}),_0x58ac75&&a5_0x528542(Box,{'flexDirection':_0xf3d10b(0x1f1),'children':[a5_0x2ab44d(Box,{'children':a5_0x528542(Text,{'color':_0xf3d10b(0x208),'children':['❌\x20',_0x58ac75]})}),_0x58ac75[_0xf3d10b(0x1fe)]('登录')&&a5_0x528542(Box,{'marginTop':0x1,'children':[a5_0x2ab44d(Text,{'color':'yellow','children':_0xf3d10b(0x1f7)}),a5_0x2ab44d(Text,{'color':_0xf3d10b(0x1f5),'children':'lovrabet\x20auth'}),a5_0x2ab44d(Text,{'color':_0xf3d10b(0x20d),'children':'\x20重新登录后再试'})]})]})]});};
1
+ (function(_0x4dcfa7,_0x5207c2){const _0x3a7ee0=a5_0x3772,_0x1ca130=_0x4dcfa7();while(!![]){try{const _0x36690d=-parseInt(_0x3a7ee0(0x138))/0x1+-parseInt(_0x3a7ee0(0x12f))/0x2*(parseInt(_0x3a7ee0(0x121))/0x3)+-parseInt(_0x3a7ee0(0x126))/0x4+-parseInt(_0x3a7ee0(0x13a))/0x5+parseInt(_0x3a7ee0(0x150))/0x6*(parseInt(_0x3a7ee0(0x14a))/0x7)+parseInt(_0x3a7ee0(0x13d))/0x8*(-parseInt(_0x3a7ee0(0x134))/0x9)+parseInt(_0x3a7ee0(0x142))/0xa*(parseInt(_0x3a7ee0(0x13c))/0xb);if(_0x36690d===_0x5207c2)break;else _0x1ca130['push'](_0x1ca130['shift']());}catch(_0x2a2b44){_0x1ca130['push'](_0x1ca130['shift']());}}}(a5_0xb658,0x74a86));function a5_0xb658(){const _0xc07b5c=['gray','white','46773TEZiLa','\x20个模型)','red','dim','207681npmuOR','lovrabet\x20auth','834330jsviki','column','44KywfnU','776wyxZJC','.ts','使用指定的应用AppCode:\x20','拉取\x20API\x20配置失败:\x20','datasetCount','2856590fUxmJH','\x20个,过滤重复','includes','-api','\x20个数据集,生成','未提供应用AppCode,且配置中也没有默认值','yellow','replace','5618543XtVkVE','💡\x20请使用\x20','!\x20原始数据集\x20','\x20-\x20客户端实例文件','import\x20','modelCount','6UJtHWZ','√\x20成功拉取\x20','cyan','originalCount','split','length','*\x20已生成文件:','\x20重新登录后再试','72wBVuqB','endsWith','\x20个模型','string','green','1746844pGZLkc','{\x20lovrabetClient\x20}','-\x20模型配置文件\x20(','*\x20导入方式:','online','env','使用配置的应用AppCode:\x20','client','duplicateCount','12674gfWFQg','setLogPath','-client'];a5_0xb658=function(){return _0xc07b5c;};return a5_0xb658();}import{jsx as a5_0x111128,jsxs as a5_0x22f730}from'react/jsx-runtime';function a5_0x3772(_0x82f06d,_0x1e38b0){const _0xb658a5=a5_0xb658();return a5_0x3772=function(_0x3772ac,_0x4344af){_0x3772ac=_0x3772ac-0x120;let _0x1ce878=_0xb658a5[_0x3772ac];return _0x1ce878;},a5_0x3772(_0x82f06d,_0x1e38b0);}import{useEffect,useState}from'react';import{Box,Text,useApp}from'ink';import{readConfig,getConfigAppCode}from'../utils/config.js';import{initEnv}from'../constant/env.js';import{generateApiFile}from'./generate-api-file.js';import{logger}from'../utils/logger.js';import{fetchModelList}from'./fetch-model-list.js';export const ApiPullUI=({appCode:_0x49dc2d,env:_0x5b80d7,output:_0x290bf5})=>{const _0x2021a5=a5_0x3772,{exit:_0x918485}=useApp(),[_0x592084,_0x160729]=useState(![]),[_0x286b83,_0x54b97b]=useState(![]),[_0x933755,_0x33254e]=useState(null),[_0x1b123e,_0x21903d]=useState(null),_0x2bb04d=readConfig(),_0x320997=getConfigAppCode(),_0x203a29=_0x49dc2d||_0x320997,_0x3bc4f2=typeof _0x2bb04d?.[_0x2021a5(0x12b)]===_0x2021a5(0x124)?_0x2bb04d[_0x2021a5(0x12b)]:undefined,_0x1703bb=_0x5b80d7||_0x3bc4f2||_0x2021a5(0x12a);initEnv(_0x1703bb);const _0x2ea273=_0x290bf5||'./src/api/',_0x313990=_0x49dc2d&&_0x49dc2d[_0x2021a5(0x144)]('-')?_0x49dc2d[_0x2021a5(0x154)]('-')['slice'](0x1)['join']('-'):'',_0x42ac7e=_0x49dc2d?_0x2021a5(0x13f)+_0x203a29:_0x2021a5(0x12c)+_0x203a29,_0x4768c1=_0x313990?_0x313990+_0x2021a5(0x145):'api',_0xfb3577=_0x313990?_0x313990+_0x2021a5(0x131):'client';useEffect(()=>{_0x160729(!![]),_0x2cf687();},[]),useEffect(()=>{(_0x286b83||_0x933755)&&_0x918485();},[_0x286b83,_0x933755,_0x918485]);async function _0x2cf687(){const _0x197ae2=_0x2021a5;if(!_0x203a29){_0x33254e(_0x197ae2(0x147));return;}try{logger[_0x197ae2(0x130)](process['cwd']());const {configArray:_0x3c8958}=await fetchModelList(_0x203a29),_0x154179=_0x3c8958[_0x197ae2(0x155)],_0x2ec8ad=!_0x49dc2d,_0x239501=await generateApiFile(_0x3c8958,_0x313990,_0x203a29,_0x2ec8ad,_0x1703bb,_0x2ea273),_0xed9d2=_0x2ea273[_0x197ae2(0x122)]('/')?_0x2ea273:_0x2ea273+'/';_0x21903d({'api':''+_0xed9d2+_0x4768c1+'.ts','client':''+_0xed9d2+_0xfb3577+_0x197ae2(0x13e),'modelCount':_0x239501[_0x197ae2(0x14f)],'datasetCount':_0x154179,'originalCount':_0x154179,'duplicateCount':0x0}),_0x54b97b(!![]);}catch(_0xd1cacd){const _0x50702f=_0xd1cacd instanceof Error?_0xd1cacd['message']:String(_0xd1cacd);logger['error']('api-pull',_0x197ae2(0x140)+_0x50702f,{'appCode':_0x203a29,'error':_0x50702f}),_0x33254e(_0x197ae2(0x140)+_0x50702f);}finally{_0x160729(![]);}}return a5_0x22f730(Box,{'flexDirection':_0x2021a5(0x13b),'children':[(_0x592084||_0x286b83)&&a5_0x22f730(Box,{'children':[a5_0x111128(Text,{'color':'gray','children':'*\x20'}),a5_0x111128(Text,{'color':_0x49dc2d?_0x2021a5(0x133):_0x2021a5(0x137),'children':_0x42ac7e})]}),_0x592084&&a5_0x111128(Box,{'children':a5_0x22f730(Text,{'children':['🚀\x20正在从服务器拉取\x20API\x20配置...\x20(环境:\x20',_0x1703bb,')']})}),_0x286b83&&_0x1b123e&&a5_0x22f730(Box,{'flexDirection':'column','children':[a5_0x111128(Box,{'children':a5_0x22f730(Text,{'color':_0x2021a5(0x125),'children':[_0x2021a5(0x151),_0x1b123e[_0x2021a5(0x141)],_0x2021a5(0x146),'\x20',_0x1b123e[_0x2021a5(0x14f)],_0x2021a5(0x123)]})}),_0x1b123e[_0x2021a5(0x12e)]>0x0&&a5_0x111128(Box,{'marginTop':0x1,'children':a5_0x22f730(Text,{'color':_0x2021a5(0x148),'children':[_0x2021a5(0x14c),_0x1b123e[_0x2021a5(0x153)],_0x2021a5(0x143),'\x20',_0x1b123e[_0x2021a5(0x12e)],'\x20个']})}),a5_0x111128(Box,{'marginTop':0x1,'children':a5_0x111128(Text,{'color':_0x2021a5(0x132),'children':_0x2021a5(0x156)})}),a5_0x22f730(Box,{'marginLeft':0x2,'children':[a5_0x22f730(Text,{'color':_0x2021a5(0x152),'children':['•\x20',_0x1b123e['api']]}),a5_0x22f730(Text,{'color':_0x2021a5(0x137),'children':['\x20',_0x2021a5(0x128),_0x1b123e['modelCount'],_0x2021a5(0x135)]})]}),a5_0x22f730(Box,{'marginLeft':0x2,'children':[a5_0x22f730(Text,{'color':_0x2021a5(0x152),'children':['•\x20',_0x1b123e[_0x2021a5(0x12d)]]}),a5_0x111128(Text,{'color':_0x2021a5(0x137),'children':_0x2021a5(0x14d)})]}),a5_0x111128(Box,{'marginTop':0x1,'children':a5_0x111128(Text,{'color':_0x2021a5(0x132),'children':_0x2021a5(0x129)})}),a5_0x111128(Box,{'marginLeft':0x2,'children':a5_0x22f730(Text,{'color':_0x2021a5(0x148),'children':[_0x2021a5(0x14e),_0x2021a5(0x127),'\x20from\x20\x27@/',_0x1b123e[_0x2021a5(0x12d)][_0x2021a5(0x149)](/^\.\//,'')[_0x2021a5(0x149)](_0x2021a5(0x13e),''),'\x27']})})]}),_0x933755&&a5_0x22f730(Box,{'flexDirection':_0x2021a5(0x13b),'children':[a5_0x111128(Box,{'children':a5_0x22f730(Text,{'color':_0x2021a5(0x136),'children':['❌\x20',_0x933755]})}),_0x933755['includes']('登录')&&a5_0x22f730(Box,{'marginTop':0x1,'children':[a5_0x111128(Text,{'color':_0x2021a5(0x148),'children':_0x2021a5(0x14b)}),a5_0x111128(Text,{'color':_0x2021a5(0x152),'children':_0x2021a5(0x139)}),a5_0x111128(Text,{'color':_0x2021a5(0x148),'children':_0x2021a5(0x120)})]})]})]});};
@@ -1 +1 @@
1
- (function(_0x59d047,_0x26d347){const _0x5e4ca3=a6_0x3bbb,_0x543563=_0x59d047();while(!![]){try{const _0x3a91f5=-parseInt(_0x5e4ca3(0xaa))/0x1*(parseInt(_0x5e4ca3(0xab))/0x2)+parseInt(_0x5e4ca3(0xac))/0x3*(parseInt(_0x5e4ca3(0xb5))/0x4)+-parseInt(_0x5e4ca3(0xc0))/0x5*(-parseInt(_0x5e4ca3(0xb6))/0x6)+-parseInt(_0x5e4ca3(0xb4))/0x7+parseInt(_0x5e4ca3(0xba))/0x8+-parseInt(_0x5e4ca3(0xad))/0x9+parseInt(_0x5e4ca3(0xb0))/0xa;if(_0x3a91f5===_0x26d347)break;else _0x543563['push'](_0x543563['shift']());}catch(_0x458182){_0x543563['push'](_0x543563['shift']());}}}(a6_0xc6bd,0xe2d05));function a6_0x3bbb(_0x3d23fd,_0x57a249){const _0xc6bdc7=a6_0xc6bd();return a6_0x3bbb=function(_0x3bbb63,_0x587fca){_0x3bbb63=_0x3bbb63-0xaa;let _0x3976f9=_0xc6bdc7[_0x3bbb63];return _0x3976f9;},a6_0x3bbb(_0x3d23fd,_0x57a249);}import{getCookie}from'../auth/get-cookie.js';import{getApiDomain}from'../constant/domain.js';import{logger}from'../utils/logger.js';function a6_0xc6bd(){const _0x35fde7=['494332yaIYZW','24tWqdUQ','info','正在从服务器拉取模型列表...\x20(环境:\x20','data','5295832YrqFWJ','获取数据集失败,HTTP状态码:\x20','/api/node-toolbox/dataset/model-list?appcode=','count','登录鉴权失败,登录已过期,请使用\x20lovrabet\x20auth\x20重新登录','configArray','271815TCyPjq','16797pkwIcQ','80zmPGdB','3murZrm','2961999MxFgPb','status','&otype=array','18096510YzYBsV','success','fetch-model-list','未知错误','6178515zJxaAj'];a6_0xc6bd=function(){return _0x35fde7;};return a6_0xc6bd();}import{getEnv}from'../constant/env.js';export async function fetchModelList(_0x48ef85){const _0x85698=a6_0x3bbb,_0x1c57dc=getEnv(),_0x196ca4=getApiDomain()+_0x85698(0xbc)+_0x48ef85+_0x85698(0xaf);logger[_0x85698(0xb7)](_0x85698(0xb2),_0x85698(0xb8)+_0x1c57dc+')',{'apiUrl':_0x196ca4});const _0x47313a=await fetch(_0x196ca4,{'headers':{'Cookie':getCookie()}});if(!_0x47313a['ok']){if(_0x47313a['status']===0x191)throw new Error(_0x85698(0xbe));throw new Error(_0x85698(0xbb)+_0x47313a[_0x85698(0xae)]);}const _0x8acda5=await _0x47313a['json']();if(!_0x8acda5[_0x85698(0xb1)])throw new Error('获取数据集失败:\x20'+(_0x8acda5['message']||_0x85698(0xb3)));return{'configArray':_0x8acda5[_0x85698(0xb9)][_0x85698(0xbf)],'count':_0x8acda5[_0x85698(0xb9)][_0x85698(0xbd)]};}
1
+ (function(_0x4cef0c,_0x5b5fc9){const _0x1cf845=a6_0xe7d1,_0x5ecb59=_0x4cef0c();while(!![]){try{const _0x14807d=parseInt(_0x1cf845(0x1e9))/0x1*(parseInt(_0x1cf845(0x1e4))/0x2)+parseInt(_0x1cf845(0x1e6))/0x3*(parseInt(_0x1cf845(0x1f5))/0x4)+parseInt(_0x1cf845(0x1f6))/0x5+-parseInt(_0x1cf845(0x1f3))/0x6*(-parseInt(_0x1cf845(0x1f0))/0x7)+parseInt(_0x1cf845(0x1ea))/0x8+-parseInt(_0x1cf845(0x1f4))/0x9+-parseInt(_0x1cf845(0x1ed))/0xa;if(_0x14807d===_0x5b5fc9)break;else _0x5ecb59['push'](_0x5ecb59['shift']());}catch(_0x52ab1f){_0x5ecb59['push'](_0x5ecb59['shift']());}}}(a6_0x1ea1,0x21509));import{getCookie}from'../auth/get-cookie.js';import{getApiDomain}from'../constant/domain.js';function a6_0x1ea1(){const _0x3c2a49=['获取数据集失败,HTTP状态码:\x20','1rqMeuo','795928huISAu','status','data','4619950wBmGZf','正在从服务器拉取模型列表...\x20(环境:\x20','json','11641JYfxOp','success','message','882ZBOuCC','860661tANrsM','7380BXOPzg','1080600ARezcG','/api/node-toolbox/dataset/model-list?appcode=','未知错误','&otype=array','90898cLRhoW','获取数据集失败:\x20','144kQfjTu','count'];a6_0x1ea1=function(){return _0x3c2a49;};return a6_0x1ea1();}function a6_0xe7d1(_0x32500e,_0x55c3d5){const _0x1ea1ad=a6_0x1ea1();return a6_0xe7d1=function(_0xe7d145,_0x1618bb){_0xe7d145=_0xe7d145-0x1e4;let _0x409dec=_0x1ea1ad[_0xe7d145];return _0x409dec;},a6_0xe7d1(_0x32500e,_0x55c3d5);}import{logger}from'../utils/logger.js';import{getEnv}from'../constant/env.js';export async function fetchModelList(_0x1a8bdc){const _0x50478b=a6_0xe7d1,_0x321ca4=getEnv(),_0x6b7e95=getApiDomain()+_0x50478b(0x1f7)+_0x1a8bdc+_0x50478b(0x1f9);logger['info']('fetch-model-list',_0x50478b(0x1ee)+_0x321ca4+')',{'apiUrl':_0x6b7e95});const _0x5e7119=await fetch(_0x6b7e95,{'headers':{'Cookie':getCookie()}});if(!_0x5e7119['ok']){if(_0x5e7119[_0x50478b(0x1eb)]===0x191)throw new Error('登录鉴权失败,登录已过期,请使用\x20lovrabet\x20auth\x20重新登录');throw new Error(_0x50478b(0x1e8)+_0x5e7119[_0x50478b(0x1eb)]);}const _0x56e048=await _0x5e7119[_0x50478b(0x1ef)]();if(!_0x56e048[_0x50478b(0x1f1)])throw new Error(_0x50478b(0x1e5)+(_0x56e048[_0x50478b(0x1f2)]||_0x50478b(0x1f8)));return{'configArray':_0x56e048[_0x50478b(0x1ec)]['configArray'],'count':_0x56e048[_0x50478b(0x1ec)][_0x50478b(0x1e7)]};}
@@ -1 +1 @@
1
- function a7_0x48fb(_0x565137,_0x5ff37b){const _0x4dabc9=a7_0x4dab();return a7_0x48fb=function(_0x48fbaf,_0xed1118){_0x48fbaf=_0x48fbaf-0x17f;let _0xafd6d1=_0x4dabc9[_0x48fbaf];return _0xafd6d1;},a7_0x48fb(_0x565137,_0x5ff37b);}const a7_0x2ead1a=a7_0x48fb;(function(_0x152c86,_0x4c2d20){const _0x2dbcad=a7_0x48fb,_0x602ebb=_0x152c86();while(!![]){try{const _0x2e36c6=parseInt(_0x2dbcad(0x19e))/0x1+-parseInt(_0x2dbcad(0x1a1))/0x2*(-parseInt(_0x2dbcad(0x18b))/0x3)+parseInt(_0x2dbcad(0x19b))/0x4+parseInt(_0x2dbcad(0x195))/0x5*(parseInt(_0x2dbcad(0x1a6))/0x6)+-parseInt(_0x2dbcad(0x188))/0x7*(-parseInt(_0x2dbcad(0x199))/0x8)+-parseInt(_0x2dbcad(0x197))/0x9*(parseInt(_0x2dbcad(0x191))/0xa)+-parseInt(_0x2dbcad(0x19a))/0xb*(parseInt(_0x2dbcad(0x18d))/0xc);if(_0x2e36c6===_0x4c2d20)break;else _0x602ebb['push'](_0x602ebb['shift']());}catch(_0x311209){_0x602ebb['push'](_0x602ebb['shift']());}}}(a7_0x4dab,0x8f8e3));import a7_0x37ca7c from'prettier';import{mkdirSync,writeFileSync,readFileSync}from'node:fs';import a7_0x49df52 from'node:path';import{fileURLToPath}from'node:url';import{readConfig}from'../utils/config.js';function a7_0x4dab(){const _0x4f27d3=['{\x20apiConfigName:\x20','5lkUmqg','-api','9shJjIb','key','8bOSXaP','11fWCxQa','3428244gbzfpB','dirname','.ts','630901mUgxwu','endsWith','utf8','10NnsGLr','typescript',',\x20env:\x20\x22','datasetCode','app','4707930aQMRZg','client.ts.tpl','replaceApiContent','api','\x22\x20}','forEach','templates/generate-api','resolve','env','../..','online','./src/api/','7396669KrSosT','请先通过\x20`lovrabet\x20config\x20set\x20app\x20<value>`\x20配置应用\x20Code','keys','29811EOQgCD','string','24892908KGCKUh','CONFIG_NAMES.DEFAULT','join','API\x20文件生成成功!','7165570iHrkTv','client','tableName'];a7_0x4dab=function(){return _0x4f27d3;};return a7_0x4dab();}import{TemplateReplacer}from'../utils/template-replacer.js';import{logger}from'../utils/logger.js';export async function generateApiFile(_0x34c904,_0x493bd2='',_0x590331,_0x3f4df7=![],_0x4a5c6a,_0x1ec438=a7_0x2ead1a(0x187)){const _0x1732ab=a7_0x2ead1a,_0x16a7ec=readConfig(),_0x3a2531=_0x590331||_0x16a7ec?.[_0x1732ab(0x1a5)];if(typeof _0x3a2531!==_0x1732ab(0x18c)||!_0x3a2531)throw new Error(_0x1732ab(0x189));const _0x4b8b6a=_0x3f4df7?_0x1732ab(0x18e):'\x22'+_0x3a2531+'\x22',_0x5e5819=typeof _0x16a7ec[_0x1732ab(0x184)]==='string'?_0x16a7ec[_0x1732ab(0x184)]:undefined,_0x9e37dd=_0x4a5c6a||_0x5e5819||_0x1732ab(0x186),_0x4b64f2=_0x9e37dd!==_0x1732ab(0x186);let _0x5a1483;if(_0x3f4df7)_0x4b64f2?_0x5a1483=_0x1732ab(0x194)+_0x4b8b6a+',\x20env:\x20\x22'+_0x9e37dd+_0x1732ab(0x180):_0x5a1483='';else{const _0x129e69=_0x4b64f2?_0x1732ab(0x1a3)+_0x9e37dd+'\x22':'';_0x5a1483='{\x20apiConfigName:\x20\x22'+_0x3a2531+'\x22'+_0x129e69+'\x20}';}const _0x26c496=_0x493bd2?_0x493bd2+_0x1732ab(0x196):_0x1732ab(0x17f),_0x52f25a=_0x493bd2?_0x493bd2+'-client':_0x1732ab(0x192),_0x6a1a94={};_0x34c904[_0x1732ab(0x181)](_0x2145be=>{const _0x2943dd=_0x1732ab;_0x6a1a94[_0x2145be[_0x2943dd(0x198)]]={'tableName':_0x2145be[_0x2943dd(0x193)],'datasetCode':_0x2145be[_0x2943dd(0x1a4)],'name':_0x2145be['name']||''};});const _0x59511f=fileURLToPath(import.meta['url']),_0x418bcb=a7_0x49df52[_0x1732ab(0x183)](a7_0x49df52[_0x1732ab(0x19c)](_0x59511f),_0x1732ab(0x185)),_0x25272a=a7_0x49df52['join'](_0x418bcb,_0x1732ab(0x182)),_0x12e191=a7_0x49df52[_0x1732ab(0x18f)](_0x25272a,'api.ts.tpl'),_0x3d6d20=a7_0x49df52['join'](_0x25272a,_0x1732ab(0x1a7)),_0x3e33a3=_0x1ec438[_0x1732ab(0x19f)]('/')?_0x1ec438['slice'](0x0,-0x1):_0x1ec438;mkdirSync(_0x3e33a3,{'recursive':!![]});const _0x3e5d8b=readFileSync(_0x12e191,'utf8'),_0x5e0b4d=TemplateReplacer['replaceApiContent'](_0x3e5d8b,_0x3a2531,_0x6a1a94,Object[_0x1732ab(0x18a)](_0x6a1a94)[0x0],_0x26c496,_0x4b8b6a),_0x481ae4=await a7_0x37ca7c['format'](_0x5e0b4d,{'parser':_0x1732ab(0x1a2)}),_0x120186=_0x3e33a3+'/'+_0x26c496+_0x1732ab(0x19d);writeFileSync(_0x120186,_0x481ae4,{'encoding':_0x1732ab(0x1a0)});const _0x5b6d03=readFileSync(_0x3d6d20,_0x1732ab(0x1a0)),_0x532cf4=TemplateReplacer[_0x1732ab(0x1a8)](_0x5b6d03,_0x3a2531,_0x6a1a94,Object[_0x1732ab(0x18a)](_0x6a1a94)[0x0],_0x26c496,_0x4b8b6a,_0x5a1483),_0x28c7b1=await a7_0x37ca7c['format'](_0x532cf4,{'parser':_0x1732ab(0x1a2)}),_0x1256fa=_0x3e33a3+'/'+_0x52f25a+'.ts';writeFileSync(_0x1256fa,_0x28c7b1,{'encoding':_0x1732ab(0x1a0)});const _0x5f84be=Object['keys'](_0x6a1a94)['length'];return logger['success']('init-api',_0x1732ab(0x190),undefined,{'apiFile':_0x120186,'clientFile':_0x1256fa,'modelCount':_0x5f84be,'configName':_0x4b8b6a}),{'modelCount':_0x5f84be,'apiFilePath':_0x120186,'clientFilePath':_0x1256fa,'configName':_0x4b8b6a};}
1
+ const a7_0x34630e=a7_0xb681;function a7_0x2959(){const _0x379303=['API\x20文件生成成功!','online','10nlgQTC','endsWith','./src/api/','9079910NgMkcs','1612flTcLZ','../..','datasetCode','typescript','keys','-client','app','client','6Lnxmff','resolve','url','string','10678216WoFcFS','format','{\x20apiConfigName:\x20','867720gtQtiN','546792hLcDYA','forEach','533VpARPR','3449853nUviFe','name','请先通过\x20`lovrabet\x20config\x20set\x20app\x20<value>`\x20配置应用\x20Code','CONFIG_NAMES.DEFAULT','length','17140OpDeDZ','utf8','.ts','client.ts.tpl',',\x20env:\x20\x22','api','env','-api','api.ts.tpl','4074pPewYv','key','9arKtWH','join','replaceApiContent','1908tEUaLl','\x22\x20}'];a7_0x2959=function(){return _0x379303;};return a7_0x2959();}(function(_0x51e1f9,_0x47be0f){const _0x55776a=a7_0xb681,_0x4e358d=_0x51e1f9();while(!![]){try{const _0x336663=-parseInt(_0x55776a(0x1f6))/0x1+parseInt(_0x55776a(0x208))/0x2*(-parseInt(_0x55776a(0x20d))/0x3)+parseInt(_0x55776a(0x215))/0x4*(parseInt(_0x55776a(0x1ff))/0x5)+-parseInt(_0x55776a(0x1ef))/0x6*(-parseInt(_0x55776a(0x214))/0x7)+-parseInt(_0x55776a(0x1f3))/0x8*(parseInt(_0x55776a(0x20a))/0x9)+-parseInt(_0x55776a(0x211))/0xa*(parseInt(_0x55776a(0x1fa))/0xb)+-parseInt(_0x55776a(0x1f7))/0xc*(-parseInt(_0x55776a(0x1f9))/0xd);if(_0x336663===_0x47be0f)break;else _0x4e358d['push'](_0x4e358d['shift']());}catch(_0x1694e6){_0x4e358d['push'](_0x4e358d['shift']());}}}(a7_0x2959,0xb37c0));function a7_0xb681(_0x207bf5,_0xb311d){const _0x2959cb=a7_0x2959();return a7_0xb681=function(_0xb681d3,_0x122746){_0xb681d3=_0xb681d3-0x1ee;let _0x2a6565=_0x2959cb[_0xb681d3];return _0x2a6565;},a7_0xb681(_0x207bf5,_0xb311d);}import a7_0x4e2529 from'prettier';import{mkdirSync,writeFileSync,readFileSync}from'node:fs';import a7_0x229a16 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(_0xcaf89c,_0x28b4b4='',_0xe68669,_0x3df7a7=![],_0x528e05,_0x1a2196=a7_0x34630e(0x213)){const _0x2d9c36=a7_0x34630e,_0x432dd2=readConfig(),_0x5299aa=_0xe68669||_0x432dd2?.[_0x2d9c36(0x21b)];if(typeof _0x5299aa!==_0x2d9c36(0x1f2)||!_0x5299aa)throw new Error(_0x2d9c36(0x1fc));const _0x16dae3=_0x3df7a7?_0x2d9c36(0x1fd):'\x22'+_0x5299aa+'\x22',_0x50b48b=typeof _0x432dd2[_0x2d9c36(0x205)]==='string'?_0x432dd2[_0x2d9c36(0x205)]:undefined,_0x22ce32=_0x528e05||_0x50b48b||_0x2d9c36(0x210),_0x112215=_0x22ce32!==_0x2d9c36(0x210);let _0x39b912;if(_0x3df7a7)_0x112215?_0x39b912=_0x2d9c36(0x1f5)+_0x16dae3+_0x2d9c36(0x203)+_0x22ce32+_0x2d9c36(0x20e):_0x39b912='';else{const _0x1b8b77=_0x112215?_0x2d9c36(0x203)+_0x22ce32+'\x22':'';_0x39b912='{\x20apiConfigName:\x20\x22'+_0x5299aa+'\x22'+_0x1b8b77+'\x20}';}const _0x56ab69=_0x28b4b4?_0x28b4b4+_0x2d9c36(0x206):_0x2d9c36(0x204),_0x1e5e17=_0x28b4b4?_0x28b4b4+_0x2d9c36(0x21a):_0x2d9c36(0x1ee),_0x1c3317={};_0xcaf89c[_0x2d9c36(0x1f8)](_0x2d5db7=>{const _0x4da040=_0x2d9c36;_0x1c3317[_0x2d5db7[_0x4da040(0x209)]]={'tableName':_0x2d5db7['tableName'],'datasetCode':_0x2d5db7[_0x4da040(0x217)],'name':_0x2d5db7[_0x4da040(0x1fb)]||''};});const _0x141246=fileURLToPath(import.meta[_0x2d9c36(0x1f1)]),_0x291d4a=a7_0x229a16[_0x2d9c36(0x1f0)](a7_0x229a16['dirname'](_0x141246),_0x2d9c36(0x216)),_0x134eb7=a7_0x229a16['join'](_0x291d4a,'templates/generate-api'),_0x5c1d2a=a7_0x229a16[_0x2d9c36(0x20b)](_0x134eb7,_0x2d9c36(0x207)),_0xc3ddc=a7_0x229a16[_0x2d9c36(0x20b)](_0x134eb7,_0x2d9c36(0x202)),_0x56b1d4=_0x1a2196[_0x2d9c36(0x212)]('/')?_0x1a2196['slice'](0x0,-0x1):_0x1a2196;mkdirSync(_0x56b1d4,{'recursive':!![]});const _0x50cccc=readFileSync(_0x5c1d2a,_0x2d9c36(0x200)),_0x57b9e2=TemplateReplacer[_0x2d9c36(0x20c)](_0x50cccc,_0x5299aa,_0x1c3317,Object[_0x2d9c36(0x219)](_0x1c3317)[0x0],_0x56ab69,_0x16dae3),_0x96928f=await a7_0x4e2529[_0x2d9c36(0x1f4)](_0x57b9e2,{'parser':_0x2d9c36(0x218)}),_0x12367c=_0x56b1d4+'/'+_0x56ab69+_0x2d9c36(0x201);writeFileSync(_0x12367c,_0x96928f,{'encoding':_0x2d9c36(0x200)});const _0x1fcd95=readFileSync(_0xc3ddc,'utf8'),_0x47a821=TemplateReplacer[_0x2d9c36(0x20c)](_0x1fcd95,_0x5299aa,_0x1c3317,Object[_0x2d9c36(0x219)](_0x1c3317)[0x0],_0x56ab69,_0x16dae3,_0x39b912),_0x24dee4=await a7_0x4e2529[_0x2d9c36(0x1f4)](_0x47a821,{'parser':_0x2d9c36(0x218)}),_0x1f484d=_0x56b1d4+'/'+_0x1e5e17+_0x2d9c36(0x201);writeFileSync(_0x1f484d,_0x24dee4,{'encoding':_0x2d9c36(0x200)});const _0x901060=Object[_0x2d9c36(0x219)](_0x1c3317)[_0x2d9c36(0x1fe)];return logger['success']('init-api',_0x2d9c36(0x20f),undefined,{'apiFile':_0x12367c,'clientFile':_0x1f484d,'modelCount':_0x901060,'configName':_0x16dae3}),{'modelCount':_0x901060,'apiFilePath':_0x12367c,'clientFilePath':_0x1f484d,'configName':_0x16dae3};}
package/lib/api/main.js CHANGED
@@ -1 +1 @@
1
- function a8_0x1bc3(_0xc7fa1c,_0x5debe1){const _0x47613d=a8_0x4761();return a8_0x1bc3=function(_0x1bc340,_0x30bc9f){_0x1bc340=_0x1bc340-0x122;let _0x5f442b=_0x47613d[_0x1bc340];return _0x5f442b;},a8_0x1bc3(_0xc7fa1c,_0x5debe1);}(function(_0xb098fb,_0x13c9d1){const _0x3fb1d1=a8_0x1bc3,_0x566acd=_0xb098fb();while(!![]){try{const _0x235a03=-parseInt(_0x3fb1d1(0x140))/0x1*(-parseInt(_0x3fb1d1(0x127))/0x2)+-parseInt(_0x3fb1d1(0x14a))/0x3*(-parseInt(_0x3fb1d1(0x124))/0x4)+parseInt(_0x3fb1d1(0x12d))/0x5*(-parseInt(_0x3fb1d1(0x138))/0x6)+parseInt(_0x3fb1d1(0x139))/0x7+parseInt(_0x3fb1d1(0x128))/0x8*(parseInt(_0x3fb1d1(0x122))/0x9)+-parseInt(_0x3fb1d1(0x12c))/0xa+-parseInt(_0x3fb1d1(0x141))/0xb;if(_0x235a03===_0x13c9d1)break;else _0x566acd['push'](_0x566acd['shift']());}catch(_0x6b3d9d){_0x566acd['push'](_0x566acd['shift']());}}}(a8_0x4761,0x64bbc));import{jsx as a8_0x525608}from'react/jsx-runtime';import{render}from'ink';import{ApiPullUI}from'./api-pull-ui.js';import{ApiDocUI}from'./api-doc-ui.js';function a8_0x4761(){const _0x14e3c8=['\x20\x20错误:\x20','3146220WYnAqu','5RWSiOx','\x20\x20\x202.\x20使用参数:\x20lovrabet\x20api\x20pull\x20--appcode\x20<app-code>','exit','string','error','请使用\x20--appcode\x20参数,例如:','map','doc','\x20\x20lovrabet\x20api\x20doc\x20--appcode\x20<code>\x20\x20\x20\x20\x20\x20\x20//\x20使用指定的\x20appcode','\x1b[90m\x20\x20(注:\x20--appcode\x20参数与配置一致,将使用默认配置)\x1b[0m','×\x20未配置\x20AppCode','1573302xLvdUx','3614268wlPVXQ','split','help','\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','input','length','Available\x20commands:','2KgimuA','9434403PJsRbQ','×\x20--datasetcode\x20参数不能为空','output','\x20\x20lovrabet\x20api\x20pull\x20--output\x20<dir>\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定输出目录(默认:\x20./src/api/)','\x20\x20lovrabet\x20api\x20doc\x20--output\x20<dir>\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定文档输出目录(默认:\x20./docs)','\x20\x20lovrabet\x20api\x20pull\x20--appcode\x20','isArray','flags','log','3lcnpbC','\x20\x20lovrabet\x20api\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20拉取并生成\x20API\x20配置文件','❌\x20错误:不再支持位置参数方式','!\x20请使用以下方式之一:','pull','\x20\x20\x201.\x20配置默认值:\x20lovrabet\x20config\x20set\x20appcode\x20<app-code>','appcode','\x20\x20lovrabet\x20api\x20doc\x20--env\x20<env>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定环境(如:\x20daily,\x20online)','join','\x1b[0m','object','×\x20--params\x20参数不是有效的\x20JSON\x20格式','Unknown\x20api\x20command:\x20','×\x20--params\x20参数必须是一个有效的\x20JSON\x20对象','252wlpqVB','params','2327680AkfOhv','\x1b[90m*\x20使用配置的应用AppCode:\x20','\x20\x20lovrabet\x20api\x20pull\x20--appcode\x20<code>\x20\x20\x20\x20\x20\x20//\x20使用指定的\x20appcode','570092hyrpfO','51080aaRWCd','env','message'];a8_0x4761=function(){return _0x14e3c8;};return a8_0x4761();}import{getConfigAppCode}from'../utils/config.js';export async function apiCli(_0x167815){const _0x20bbd7=a8_0x1bc3,_0x2f2fc8=_0x167815[_0x20bbd7(0x13d)][0x1];if(_0x167815[_0x20bbd7(0x148)][_0x20bbd7(0x13b)]){console[_0x20bbd7(0x149)](_0x20bbd7(0x13c));return;}if(_0x2f2fc8===_0x20bbd7(0x14e)){_0x167815[_0x20bbd7(0x13d)][0x2]&&(console[_0x20bbd7(0x131)](_0x20bbd7(0x14c)),console[_0x20bbd7(0x149)](_0x20bbd7(0x132)),console[_0x20bbd7(0x149)](_0x20bbd7(0x146)+_0x167815[_0x20bbd7(0x13d)][0x2]),process[_0x20bbd7(0x12f)](0x1));const _0x58253c=getConfigAppCode();let _0x138bb8=_0x167815[_0x20bbd7(0x148)][_0x20bbd7(0x150)];const _0x52ccff=typeof _0x167815[_0x20bbd7(0x148)]['env']===_0x20bbd7(0x130)?_0x167815[_0x20bbd7(0x148)][_0x20bbd7(0x129)]:undefined,_0x143b9f=_0x167815[_0x20bbd7(0x148)][_0x20bbd7(0x143)];!_0x138bb8&&!_0x58253c&&(console[_0x20bbd7(0x131)](_0x20bbd7(0x137)),console[_0x20bbd7(0x149)](_0x20bbd7(0x14d)),console[_0x20bbd7(0x149)](_0x20bbd7(0x14f)),console[_0x20bbd7(0x149)](_0x20bbd7(0x12e)),process['exit'](0x1)),_0x138bb8&&_0x58253c&&_0x138bb8===_0x58253c&&(console[_0x20bbd7(0x149)](_0x20bbd7(0x125)+_0x138bb8+_0x20bbd7(0x153)),console[_0x20bbd7(0x149)](_0x20bbd7(0x136)),_0x138bb8=undefined),render(a8_0x525608(ApiPullUI,{'appCode':_0x138bb8,'env':_0x52ccff,'output':_0x143b9f}));}else{if(_0x2f2fc8===_0x20bbd7(0x134)){_0x167815[_0x20bbd7(0x13d)][0x2]&&(console[_0x20bbd7(0x131)](_0x20bbd7(0x14c)),console[_0x20bbd7(0x149)]('请使用\x20--appcode\x20参数,例如:'),console[_0x20bbd7(0x149)]('\x20\x20lovrabet\x20api\x20doc\x20--appcode\x20'+_0x167815[_0x20bbd7(0x13d)][0x2]),process[_0x20bbd7(0x12f)](0x1));const _0x8dd4f8=getConfigAppCode();let _0x3c15af=_0x167815[_0x20bbd7(0x148)]['appcode'];const _0x190570=typeof _0x167815[_0x20bbd7(0x148)]['env']===_0x20bbd7(0x130)?_0x167815[_0x20bbd7(0x148)]['env']:undefined,_0x528946=_0x167815[_0x20bbd7(0x148)][_0x20bbd7(0x143)],_0x5f3081=_0x167815[_0x20bbd7(0x148)][_0x20bbd7(0x123)],_0x49ec31=_0x167815[_0x20bbd7(0x148)]['datasetcode'];!_0x3c15af&&!_0x8dd4f8&&(console[_0x20bbd7(0x131)](_0x20bbd7(0x137)),console[_0x20bbd7(0x149)]('!\x20请使用以下方式之一:'),console[_0x20bbd7(0x149)](_0x20bbd7(0x14f)),console[_0x20bbd7(0x149)]('\x20\x20\x202.\x20使用参数:\x20lovrabet\x20api\x20doc\x20--appcode\x20<app-code>'),process[_0x20bbd7(0x12f)](0x1));_0x3c15af&&_0x8dd4f8&&_0x3c15af===_0x8dd4f8&&(console[_0x20bbd7(0x149)](_0x20bbd7(0x125)+_0x3c15af+_0x20bbd7(0x153)),_0x3c15af=undefined);let _0x2e4e9d;if(_0x5f3081)try{_0x2e4e9d=JSON['parse'](_0x5f3081),(typeof _0x2e4e9d!==_0x20bbd7(0x154)||_0x2e4e9d===null||Array[_0x20bbd7(0x147)](_0x2e4e9d))&&(console[_0x20bbd7(0x131)](_0x20bbd7(0x157)),process['exit'](0x1));}catch(_0x497752){console[_0x20bbd7(0x131)](_0x20bbd7(0x155)),console[_0x20bbd7(0x131)](_0x20bbd7(0x12b)+(_0x497752 instanceof Error?_0x497752[_0x20bbd7(0x12a)]:String(_0x497752))),process['exit'](0x1);}let _0x25ad18;_0x49ec31&&(_0x25ad18=_0x49ec31[_0x20bbd7(0x13a)](',')[_0x20bbd7(0x133)](_0x310c05=>_0x310c05['trim']())['filter'](_0x5ad8a1=>_0x5ad8a1[_0x20bbd7(0x13e)]>0x0),_0x25ad18['length']===0x0&&(console[_0x20bbd7(0x131)](_0x20bbd7(0x142)),process[_0x20bbd7(0x12f)](0x1)),console[_0x20bbd7(0x149)]('\x1b[90m*\x20仅生成指定数据集的文档:\x20'+_0x25ad18[_0x20bbd7(0x152)](',\x20')+_0x20bbd7(0x153))),render(a8_0x525608(ApiDocUI,{'appCode':_0x3c15af,'env':_0x190570,'output':_0x528946,'extraParams':_0x2e4e9d,'datasetCodes':_0x25ad18}));}else console['error'](_0x20bbd7(0x156)+_0x2f2fc8),console[_0x20bbd7(0x149)](_0x20bbd7(0x13f)),console[_0x20bbd7(0x149)](_0x20bbd7(0x14b)),console[_0x20bbd7(0x149)](_0x20bbd7(0x126)),console[_0x20bbd7(0x149)](_0x20bbd7(0x144)),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[_0x20bbd7(0x149)](''),console[_0x20bbd7(0x149)]('\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[_0x20bbd7(0x149)](_0x20bbd7(0x135)),console[_0x20bbd7(0x149)](_0x20bbd7(0x145)),console[_0x20bbd7(0x149)](_0x20bbd7(0x151)),process[_0x20bbd7(0x12f)](0x1);}}
1
+ (function(_0x34bf99,_0x22c2a0){const _0x3a3a42=a8_0x3001,_0x50dba8=_0x34bf99();while(!![]){try{const _0x1486ca=parseInt(_0x3a3a42(0x107))/0x1*(parseInt(_0x3a3a42(0xe5))/0x2)+parseInt(_0x3a3a42(0xf1))/0x3+-parseInt(_0x3a3a42(0xf5))/0x4*(-parseInt(_0x3a3a42(0xef))/0x5)+parseInt(_0x3a3a42(0x109))/0x6+parseInt(_0x3a3a42(0x101))/0x7*(parseInt(_0x3a3a42(0xf0))/0x8)+-parseInt(_0x3a3a42(0xe0))/0x9*(parseInt(_0x3a3a42(0xff))/0xa)+-parseInt(_0x3a3a42(0xe1))/0xb;if(_0x1486ca===_0x22c2a0)break;else _0x50dba8['push'](_0x50dba8['shift']());}catch(_0x1c9b96){_0x50dba8['push'](_0x50dba8['shift']());}}}(a8_0x34db,0x4c78e));function a8_0x3001(_0x184ec5,_0x1e9636){const _0x34db7a=a8_0x34db();return a8_0x3001=function(_0x3001c0,_0x2093ca){_0x3001c0=_0x3001c0-0xd4;let _0x26e6cb=_0x34db7a[_0x3001c0];return _0x26e6cb;},a8_0x3001(_0x184ec5,_0x1e9636);}import{jsx as a8_0x2ed1fd}from'react/jsx-runtime';import{render}from'ink';import{ApiPullUI}from'./api-pull-ui.js';import{ApiDocUI}from'./api-doc-ui.js';import{getConfigAppCode}from'../utils/config.js';function a8_0x34db(){const _0x498bf6=['Available\x20commands:','length','578781gxBbQf','7212920zCCuEE','\x20\x20错误:\x20','split','object','712864LnoUNk','请使用\x20--appcode\x20参数,例如:','output','\x20\x20lovrabet\x20api\x20doc\x20--output\x20<dir>\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定文档输出目录(默认:\x20./docs)','error','\x20\x20lovrabet\x20api\x20doc\x20--env\x20<env>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定环境(如:\x20daily,\x20online)','\x20\x20lovrabet\x20api\x20doc\x20--appcode\x20<code>\x20\x20\x20\x20\x20\x20\x20//\x20使用指定的\x20appcode','pull','❌\x20错误:不再支持位置参数方式','filter','90sWAfJN','248HeNYSG','867246QrLkYI','env','×\x20未配置\x20AppCode','input','41572CXvcya','\x20\x20lovrabet\x20api\x20pull\x20--appcode\x20','!\x20请使用以下方式之一:','\x1b[90m*\x20使用配置的应用AppCode:\x20','help','\x1b[90m\x20\x20(注:\x20--appcode\x20参数与配置一致,将使用默认配置)\x1b[0m','\x20\x20lovrabet\x20api\x20pull\x20--env\x20<env>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定环境(如:\x20daily,\x20online)','flags','Unknown\x20api\x20command:\x20','×\x20--params\x20参数不是有效的\x20JSON\x20格式','30vtdSwu','\x20\x20\x201.\x20配置默认值:\x20lovrabet\x20config\x20set\x20appcode\x20<app-code>','64407CkFmNi','\x20\x20lovrabet\x20api\x20pull\x20--output\x20<dir>\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定输出目录(默认:\x20./src/api/)','exit','\x20\x20\x202.\x20使用参数:\x20lovrabet\x20api\x20doc\x20--appcode\x20<app-code>','×\x20--params\x20参数必须是一个有效的\x20JSON\x20对象','\x1b[0m','1cgEZCp','\x1b[90m*\x20仅生成指定数据集的文档:\x20','264348jJHDwY','string','×\x20--datasetcode\x20参数不能为空','isArray','params','\x20\x20lovrabet\x20api\x20doc\x20--appcode\x20','map','datasetcode','\x20\x20lovrabet\x20api\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20拉取并生成\x20API\x20配置文件','\x0alovrabet\x20api\x20-\x20API\x20相关操作\x0a\x0a用法:\x0a\x20\x20$\x20lovrabet\x20api\x20pull\x20[options]\x0a\x20\x20$\x20lovrabet\x20api\x20doc\x20[options]\x0a\x0a选项:\x0a\x20\x20--appcode\x20<code>\x20\x20\x20\x20\x20\x20指定应用代码\x0a\x20\x20--output\x20<dir>\x20\x20\x20\x20\x20\x20\x20\x20指定输出目录(pull:\x20./src/api/,doc:\x20./docs)\x0a\x20\x20--env\x20<env>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20指定环境(如:daily、online)\x0a\x20\x20--datasetcode\x20<codes>\x20指定要生成文档的数据集代码(多个用逗号分隔,仅\x20doc\x20命令)\x0a\x20\x20--help\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20显示此帮助信息\x0a\x0a示例:\x0a\x20\x20$\x20lovrabet\x20api\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20拉取并生成\x20API\x20配置文件\x0a\x20\x20$\x20lovrabet\x20api\x20pull\x20--appcode\x20myapp\x20\x20\x20\x20\x20\x20\x20//\x20使用指定的\x20appcode\x0a\x20\x20$\x20lovrabet\x20api\x20pull\x20--output\x20./api\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定输出目录\x0a\x20\x20$\x20lovrabet\x20api\x20pull\x20--env\x20daily\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定环境拉取\x20API\x0a\x0a\x20\x20$\x20lovrabet\x20api\x20doc\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20生成所有数据集的文档\x0a\x20\x20$\x20lovrabet\x20api\x20doc\x20--appcode\x20myapp\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20使用指定的\x20appcode\x0a\x20\x20$\x20lovrabet\x20api\x20doc\x20--output\x20./docs\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定文档输出目录\x0a\x20\x20$\x20lovrabet\x20api\x20doc\x20--env\x20daily\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定环境生成文档\x0a\x20\x20$\x20lovrabet\x20api\x20doc\x20--datasetcode\x20ds_001\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20只生成指定数据集的文档\x0a\x20\x20$\x20lovrabet\x20api\x20doc\x20--datasetcode\x20ds_001,ds_002\x20\x20\x20\x20\x20\x20//\x20生成多个数据集的文档\x0a','\x20\x20\x202.\x20使用参数:\x20lovrabet\x20api\x20pull\x20--appcode\x20<app-code>','doc','log','parse','join'];a8_0x34db=function(){return _0x498bf6;};return a8_0x34db();}export async function apiCli(_0x13d4fc){const _0x552e04=a8_0x3001,_0x2c1a57=_0x13d4fc['input'][0x1];if(_0x13d4fc[_0x552e04(0xfc)][_0x552e04(0xf9)]){console[_0x552e04(0xdb)](_0x552e04(0xd8));return;}if(_0x2c1a57===_0x552e04(0xec)){_0x13d4fc[_0x552e04(0xf4)][0x2]&&(console['error']('❌\x20错误:不再支持位置参数方式'),console[_0x552e04(0xdb)]('请使用\x20--appcode\x20参数,例如:'),console[_0x552e04(0xdb)](_0x552e04(0xf6)+_0x13d4fc[_0x552e04(0xf4)][0x2]),process[_0x552e04(0x103)](0x1));const _0x3cd970=getConfigAppCode();let _0x4f8897=_0x13d4fc['flags']['appcode'];const _0x163643=typeof _0x13d4fc['flags'][_0x552e04(0xf2)]===_0x552e04(0x10a)?_0x13d4fc[_0x552e04(0xfc)][_0x552e04(0xf2)]:undefined,_0x16ed98=_0x13d4fc[_0x552e04(0xfc)][_0x552e04(0xe7)];!_0x4f8897&&!_0x3cd970&&(console[_0x552e04(0xe9)](_0x552e04(0xf3)),console[_0x552e04(0xdb)](_0x552e04(0xf7)),console[_0x552e04(0xdb)]('\x20\x20\x201.\x20配置默认值:\x20lovrabet\x20config\x20set\x20appcode\x20<app-code>'),console[_0x552e04(0xdb)](_0x552e04(0xd9)),process[_0x552e04(0x103)](0x1)),_0x4f8897&&_0x3cd970&&_0x4f8897===_0x3cd970&&(console[_0x552e04(0xdb)]('\x1b[90m*\x20使用配置的应用AppCode:\x20'+_0x4f8897+'\x1b[0m'),console['log'](_0x552e04(0xfa)),_0x4f8897=undefined),render(a8_0x2ed1fd(ApiPullUI,{'appCode':_0x4f8897,'env':_0x163643,'output':_0x16ed98}));}else{if(_0x2c1a57===_0x552e04(0xda)){_0x13d4fc[_0x552e04(0xf4)][0x2]&&(console[_0x552e04(0xe9)](_0x552e04(0xed)),console['log'](_0x552e04(0xe6)),console[_0x552e04(0xdb)](_0x552e04(0xd4)+_0x13d4fc[_0x552e04(0xf4)][0x2]),process[_0x552e04(0x103)](0x1));const _0x5a2d9e=getConfigAppCode();let _0x352242=_0x13d4fc[_0x552e04(0xfc)]['appcode'];const _0x308149=typeof _0x13d4fc['flags']['env']===_0x552e04(0x10a)?_0x13d4fc[_0x552e04(0xfc)]['env']:undefined,_0x1225d7=_0x13d4fc[_0x552e04(0xfc)]['output'],_0x23452e=_0x13d4fc[_0x552e04(0xfc)][_0x552e04(0x10d)],_0x5ce7be=_0x13d4fc[_0x552e04(0xfc)][_0x552e04(0xd6)];!_0x352242&&!_0x5a2d9e&&(console[_0x552e04(0xe9)]('×\x20未配置\x20AppCode'),console[_0x552e04(0xdb)](_0x552e04(0xf7)),console['log'](_0x552e04(0x100)),console[_0x552e04(0xdb)](_0x552e04(0x104)),process[_0x552e04(0x103)](0x1));_0x352242&&_0x5a2d9e&&_0x352242===_0x5a2d9e&&(console[_0x552e04(0xdb)](_0x552e04(0xf8)+_0x352242+_0x552e04(0x106)),_0x352242=undefined);let _0x357da1;if(_0x23452e)try{_0x357da1=JSON[_0x552e04(0xdc)](_0x23452e),(typeof _0x357da1!==_0x552e04(0xe4)||_0x357da1===null||Array[_0x552e04(0x10c)](_0x357da1))&&(console[_0x552e04(0xe9)](_0x552e04(0x105)),process[_0x552e04(0x103)](0x1));}catch(_0x1f9ab6){console[_0x552e04(0xe9)](_0x552e04(0xfe)),console[_0x552e04(0xe9)](_0x552e04(0xe2)+(_0x1f9ab6 instanceof Error?_0x1f9ab6['message']:String(_0x1f9ab6))),process[_0x552e04(0x103)](0x1);}let _0x3df68e;_0x5ce7be&&(_0x3df68e=_0x5ce7be[_0x552e04(0xe3)](',')[_0x552e04(0xd5)](_0x944dd=>_0x944dd['trim']())[_0x552e04(0xee)](_0x451bcd=>_0x451bcd[_0x552e04(0xdf)]>0x0),_0x3df68e['length']===0x0&&(console[_0x552e04(0xe9)](_0x552e04(0x10b)),process[_0x552e04(0x103)](0x1)),console['log'](_0x552e04(0x108)+_0x3df68e[_0x552e04(0xdd)](',\x20')+_0x552e04(0x106))),render(a8_0x2ed1fd(ApiDocUI,{'appCode':_0x352242,'env':_0x308149,'output':_0x1225d7,'extraParams':_0x357da1,'datasetCodes':_0x3df68e}));}else console[_0x552e04(0xe9)](_0x552e04(0xfd)+_0x2c1a57),console[_0x552e04(0xdb)](_0x552e04(0xde)),console[_0x552e04(0xdb)](_0x552e04(0xd7)),console['log']('\x20\x20lovrabet\x20api\x20pull\x20--appcode\x20<code>\x20\x20\x20\x20\x20\x20//\x20使用指定的\x20appcode'),console[_0x552e04(0xdb)](_0x552e04(0x102)),console[_0x552e04(0xdb)](_0x552e04(0xfb)),console[_0x552e04(0xdb)](''),console[_0x552e04(0xdb)]('\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'](_0x552e04(0xeb)),console[_0x552e04(0xdb)](_0x552e04(0xe8)),console['log'](_0x552e04(0xea)),process[_0x552e04(0x103)](0x1);}}
@@ -1 +1 @@
1
- (function(_0x574d6a,_0x5ee123){const _0x1af220=a9_0x3359,_0x4e6183=_0x574d6a();while(!![]){try{const _0x171cbf=-parseInt(_0x1af220(0x1d5))/0x1*(-parseInt(_0x1af220(0x1cb))/0x2)+-parseInt(_0x1af220(0x1d7))/0x3+parseInt(_0x1af220(0x1da))/0x4+-parseInt(_0x1af220(0x1d1))/0x5*(-parseInt(_0x1af220(0x1e1))/0x6)+-parseInt(_0x1af220(0x1ce))/0x7+parseInt(_0x1af220(0x1df))/0x8+parseInt(_0x1af220(0x1cf))/0x9;if(_0x171cbf===_0x5ee123)break;else _0x4e6183['push'](_0x4e6183['shift']());}catch(_0x595a46){_0x4e6183['push'](_0x4e6183['shift']());}}}(a9_0xafff,0x856fd));function a9_0x3359(_0x1bad62,_0x1fb4df){const _0xafff49=a9_0xafff();return a9_0x3359=function(_0x33597,_0x109f6a){_0x33597=_0x33597-0x1c8;let _0x311156=_0xafff49[_0x33597];return _0x311156;},a9_0x3359(_0x1bad62,_0x1fb4df);}import{readConfig}from'../utils/config.js';function a9_0xafff(){const _0x12350a=['log','3075882nJbAwI','×\x20API\x20配置拉取异常:','\x20个数据集...','2265016nRSDdK','trim','info','online','-api','1297304xKxase','string','1500318NIfkus','API\x20配置拉取成功:\x20','\x20\x20\x20•\x20','*\x20正在处理\x20','.ts\x20-\x20模型配置文件','length','client','-client','\x20个模型','create-api-pull','cwd','6TnfJei','chdir','modelCount','6561086emIgYH','8673813wIVYGK','error','5KpAPZG','env','×\x20文件前缀格式不正确。只能包含字母、数字、连字符和下划线,且必须以字母开头。','API\x20配置拉取异常:\x20','188974xIagdE'];a9_0xafff=function(){return _0x12350a;};return a9_0xafff();}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(_0x295f8d,_0x4ca407,_0x486f84,_0x20744b){const _0x5e0685=a9_0x3359;let _0x52e915;try{const _0x3ce553=_0x4ca407?.[_0x5e0685(0x1db)]()||'';if(_0x3ce553){const _0x29fc9c=/^[a-zA-Z][a-zA-Z0-9_-]*$/;if(!_0x29fc9c['test'](_0x3ce553))return console[_0x5e0685(0x1d0)](_0x5e0685(0x1d3)),![];}_0x486f84&&(_0x52e915=process[_0x5e0685(0x1ca)](),process[_0x5e0685(0x1cc)](_0x486f84));const _0x55296b=readConfig(),_0xe2a652=typeof _0x55296b['env']===_0x5e0685(0x1e0)?_0x55296b[_0x5e0685(0x1d2)]:undefined,_0x37b538=_0x20744b||_0xe2a652||_0x5e0685(0x1dd);initEnv(_0x37b538),console['log']('*\x20正在从服务器拉取\x20API\x20配置...\x20(环境:\x20'+_0x37b538+')');const {configArray:_0x1631f7}=await fetchModelList(_0x295f8d),_0x2b9a2d=_0x3ce553?_0x3ce553+_0x5e0685(0x1de):'api',_0x13d0cd=_0x3ce553?_0x3ce553+_0x5e0685(0x1e8):_0x5e0685(0x1e7);console[_0x5e0685(0x1d6)]('*\x20开始生成\x20API\x20配置文件:'),console['log']('\x20\x20\x20•\x20'+_0x2b9a2d+_0x5e0685(0x1e5)),console[_0x5e0685(0x1d6)](_0x5e0685(0x1e3)+_0x13d0cd+'.ts\x20-\x20客户端实例文件'),console[_0x5e0685(0x1d6)](_0x5e0685(0x1e4)+_0x1631f7['length']+_0x5e0685(0x1d9));const _0xd4eb40=await generateApiFile(_0x1631f7,_0x3ce553,_0x295f8d,!![],_0x37b538);return console['log']('√\x20成功拉取\x20'+_0x1631f7[_0x5e0685(0x1e6)]+'\x20个数据集,生成\x20'+_0xd4eb40[_0x5e0685(0x1cd)]+_0x5e0685(0x1c8)),_0x486f84&&logger[_0x5e0685(0x1dc)](_0x5e0685(0x1c9),_0x5e0685(0x1e2)+_0x295f8d,{'projectPath':_0x486f84,'appCode':_0x295f8d,'datasetCount':_0x1631f7[_0x5e0685(0x1e6)],'filePrefix':_0x3ce553}),!![];}catch(_0x3f0db8){const _0x2d4741=_0x3f0db8 instanceof Error?_0x3f0db8['message']:String(_0x3f0db8);return console['error'](_0x5e0685(0x1d8),_0x2d4741),_0x486f84&&logger['error'](_0x5e0685(0x1c9),_0x5e0685(0x1d4)+_0x2d4741,{'appCode':_0x295f8d,'projectPath':_0x486f84}),![];}finally{_0x52e915&&process[_0x5e0685(0x1cc)](_0x52e915);}}
1
+ (function(_0x3ed954,_0x16a515){const _0x428c75=a9_0x2610,_0x4fe25e=_0x3ed954();while(!![]){try{const _0x1517c9=-parseInt(_0x428c75(0x205))/0x1*(-parseInt(_0x428c75(0x1fc))/0x2)+-parseInt(_0x428c75(0x201))/0x3+-parseInt(_0x428c75(0x1f0))/0x4+parseInt(_0x428c75(0x1f1))/0x5+-parseInt(_0x428c75(0x20a))/0x6*(-parseInt(_0x428c75(0x203))/0x7)+-parseInt(_0x428c75(0x1f5))/0x8+parseInt(_0x428c75(0x1ec))/0x9;if(_0x1517c9===_0x16a515)break;else _0x4fe25e['push'](_0x4fe25e['shift']());}catch(_0xb2252b){_0x4fe25e['push'](_0x4fe25e['shift']());}}}(a9_0x4bbb,0xb2441));function a9_0x4bbb(){const _0xe1c0a6=['env','modelCount','×\x20API\x20配置拉取异常:','×\x20文件前缀格式不正确。只能包含字母、数字、连字符和下划线,且必须以字母开头。','2540748sRMfAW','\x20个数据集...','19481ztrVSQ','*\x20正在从服务器拉取\x20API\x20配置...\x20(环境:\x20','1xVNFEO','trim','chdir','log','.ts\x20-\x20模型配置文件','42yLsdaw','-api','API\x20配置拉取异常:\x20','\x20\x20\x20•\x20','17610435nGZRaV','api','info','test','5781364cBjfbW','1051670kBXRaC','string','\x20个数据集,生成\x20','cwd','2539848JjjFXk','error','online','create-api-pull','*\x20正在处理\x20','length','API\x20配置拉取成功:\x20','2306770ECftmy'];a9_0x4bbb=function(){return _0xe1c0a6;};return a9_0x4bbb();}function a9_0x2610(_0x55cfb2,_0x34b83e){const _0x4bbbbb=a9_0x4bbb();return a9_0x2610=function(_0x2610ed,_0x21a233){_0x2610ed=_0x2610ed-0x1eb;let _0x25187a=_0x4bbbbb[_0x2610ed];return _0x25187a;},a9_0x2610(_0x55cfb2,_0x34b83e);}import{readConfig}from'../utils/config.js';import{initEnv}from'../constant/env.js';import{generateApiFile}from'./generate-api-file.js';import{logger}from'../utils/logger.js';import{fetchModelList}from'./fetch-model-list.js';export async function pullApiSilent(_0x27f6f6,_0x141992,_0xb5773f,_0x2d5b6e){const _0x3d74af=a9_0x2610;let _0x47a951;try{const _0x5a4d26=_0x141992?.[_0x3d74af(0x206)]()||'';if(_0x5a4d26){const _0x3db6bf=/^[a-zA-Z][a-zA-Z0-9_-]*$/;if(!_0x3db6bf[_0x3d74af(0x1ef)](_0x5a4d26))return console[_0x3d74af(0x1f6)](_0x3d74af(0x200)),![];}_0xb5773f&&(_0x47a951=process[_0x3d74af(0x1f4)](),process['chdir'](_0xb5773f));const _0xcce89e=readConfig(),_0x241455=typeof _0xcce89e[_0x3d74af(0x1fd)]===_0x3d74af(0x1f2)?_0xcce89e[_0x3d74af(0x1fd)]:undefined,_0x12393c=_0x2d5b6e||_0x241455||_0x3d74af(0x1f7);initEnv(_0x12393c),console['log'](_0x3d74af(0x204)+_0x12393c+')');const {configArray:_0x415c72}=await fetchModelList(_0x27f6f6),_0x215b27=_0x5a4d26?_0x5a4d26+_0x3d74af(0x20b):_0x3d74af(0x1ed),_0x3bb077=_0x5a4d26?_0x5a4d26+'-client':'client';console['log']('*\x20开始生成\x20API\x20配置文件:'),console[_0x3d74af(0x208)]('\x20\x20\x20•\x20'+_0x215b27+_0x3d74af(0x209)),console[_0x3d74af(0x208)](_0x3d74af(0x1eb)+_0x3bb077+'.ts\x20-\x20客户端实例文件'),console[_0x3d74af(0x208)](_0x3d74af(0x1f9)+_0x415c72[_0x3d74af(0x1fa)]+_0x3d74af(0x202));const _0xe17cb1=await generateApiFile(_0x415c72,_0x5a4d26,_0x27f6f6,!![],_0x12393c);return console[_0x3d74af(0x208)]('√\x20成功拉取\x20'+_0x415c72[_0x3d74af(0x1fa)]+_0x3d74af(0x1f3)+_0xe17cb1[_0x3d74af(0x1fe)]+'\x20个模型'),_0xb5773f&&logger[_0x3d74af(0x1ee)](_0x3d74af(0x1f8),_0x3d74af(0x1fb)+_0x27f6f6,{'projectPath':_0xb5773f,'appCode':_0x27f6f6,'datasetCount':_0x415c72['length'],'filePrefix':_0x5a4d26}),!![];}catch(_0x2cfc6b){const _0x2e00f3=_0x2cfc6b instanceof Error?_0x2cfc6b['message']:String(_0x2cfc6b);return console['error'](_0x3d74af(0x1ff),_0x2e00f3),_0xb5773f&&logger[_0x3d74af(0x1f6)]('create-api-pull',_0x3d74af(0x20c)+_0x2e00f3,{'appCode':_0x27f6f6,'projectPath':_0xb5773f}),![];}finally{_0x47a951&&process[_0x3d74af(0x207)](_0x47a951);}}
@@ -1 +1 @@
1
- function a10_0x1c3d(){const _0x386cd2=['slice','delete','length','fill','6221952NTiGst','!\x20未找到本地页面,请先创建页面','CSS\x20链接无法访问','[✓]','gray','message','downArrow','提示:使用\x20','5EAoqHh','input-js','green','selecting','filter','label','red','5805068jkBYuV','JS\x20链接无法访问','online','max','↑/↓:\x20移动光标\x20空格:\x20切换选中\x20a:\x20全选\x20i/r:\x20反选\x20Enter:\x20确认','302772juajNp','catch','has','blue','请输入有效的\x20JS\x20https\x20链接','size','path','3970vZdWNK','\x20输入项目的\x20JS\x20资源链接(https://...)','value','white','cyan','*\x20CSS\x20链接:\x20','\x20←\x20','input-css','创建菜单失败','17858082fBjDGF','*\x20请选择要同步的菜单:','map','return','*\x20正在创建菜单...','[\x20]','菜单名称','join','local','then','21177kuxrpy','includes','upArrow','lovrabet\x20auth','dots','请输入有效的\x20CSS\x20https\x20链接','2309223PVzHQp','add','*\x20JS\x20链接:\x20','\x20命令重新登录','\x20输入项目的\x20CSS\x20资源链接(https://...)','*\x20同步菜单到\x20Lovrabet\x20平台','creating','column','1BHujXf','2809912kXzaqd','yellow','14BunPsV'];a10_0x1c3d=function(){return _0x386cd2;};return a10_0x1c3d();}(function(_0x3574a0,_0x47a5fa){const _0x1371b1=a10_0x11d3,_0x4918f2=_0x3574a0();while(!![]){try{const _0x374658=-parseInt(_0x1371b1(0x119))/0x1*(parseInt(_0x1371b1(0x11a))/0x2)+parseInt(_0x1371b1(0x111))/0x3+parseInt(_0x1371b1(0xec))/0x4*(parseInt(_0x1371b1(0xe5))/0x5)+-parseInt(_0x1371b1(0xf1))/0x6*(-parseInt(_0x1371b1(0x11c))/0x7)+-parseInt(_0x1371b1(0x121))/0x8+parseInt(_0x1371b1(0x10b))/0x9*(-parseInt(_0x1371b1(0xf8))/0xa)+parseInt(_0x1371b1(0x101))/0xb;if(_0x374658===_0x47a5fa)break;else _0x4918f2['push'](_0x4918f2['shift']());}catch(_0x1351de){_0x4918f2['push'](_0x4918f2['shift']());}}}(a10_0x1c3d,0xca489));import{jsx as a10_0x5c19b9,jsxs as a10_0x7bffe6,Fragment as a10_0x2823bc}from'react/jsx-runtime';import{Text,Box,useInput,useApp,render}from'ink';import{useEffect,useState}from'react';import a10_0x12a9c9 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_0x5c19b9(AppMenuSyncUI,{}));export function AppMenuSyncUI(){const _0x2598d9=a10_0x11d3,{exit:_0x1085d7}=useApp(),{loading:_0x44c94b,menuList:_0x5d6d9e,error:_0x381e4f}=useGetOnlineMenuList(),_0x39c73c=getLocalPages(),_0x51263b=_0x5d6d9e[_0x2598d9(0x103)](_0x18f074=>_0x18f074[_0x2598d9(0xf7)]),_0x3a4471=[_0x2598d9(0x107),..._0x39c73c[_0x2598d9(0x103)](_0x277772=>_0x277772[_0x2598d9(0xea)])],_0x1167de=getStringWidth(getMaxWidth(_0x3a4471,0x4)),_0x29e8ad=getStringWidth(getMaxWidth(['菜单名称'])),[_0x67d263,_0x909b53]=useState(_0x2598d9(0xe8)),[_0x42f884,_0x22c2f7]=useState(new Set()),[_0x56becb,_0x436523]=useState(0x0),[_0x514f15,_0x1ab9d4]=useState(''),[_0x3be1c8,_0x3eff15]=useState(''),[_0x4dec9a,_0x1d68ed]=useState(''),[_0x22599e,_0xf6ae72]=useState(''),[_0x1f5893,_0x2cfa6b]=useState([]),_0x5ee784=_0x39c73c['map'](_0xf8db52=>({'label':_0xf8db52[_0x2598d9(0xea)],'path':_0xf8db52[_0x2598d9(0xf7)],'local':!![],'online':_0x51263b[_0x2598d9(0x10c)](_0xf8db52[_0x2598d9(0xf7)])})),_0x3e3042=_0x39c73c['filter'](_0x1387d3=>{const _0x5c4630=_0x2598d9;return!_0x51263b['includes'](_0x1387d3[_0x5c4630(0xf7)]);});useEffect(()=>{const _0x4cd346=_0x2598d9;if(!_0x44c94b&&_0x39c73c[_0x4cd346(0x11f)]>0x0&&_0x42f884[_0x4cd346(0xf6)]===0x0){const _0xa978c4=new Set(_0x39c73c[_0x4cd346(0x103)]((_0x407cf8,_0x4a074b)=>({'page':_0x407cf8,'index':_0x4a074b}))[_0x4cd346(0xe9)](({page:_0x5ddf4e})=>!_0x51263b['includes'](_0x5ddf4e[_0x4cd346(0xf7)]))[_0x4cd346(0x103)](({index:_0x3f312e})=>_0x3f312e));_0x22c2f7(_0xa978c4);}},[_0x44c94b,_0x39c73c['length'],_0x51263b[_0x2598d9(0x11f)]]),useInput(async(_0x1508ee,_0x1b05c4)=>{const _0x5f1d98=_0x2598d9;if(_0x67d263===_0x5f1d98(0xe8)){if(_0x1b05c4[_0x5f1d98(0x10d)]){_0x436523(_0x42b890=>_0x42b890>0x0?_0x42b890-0x1:_0x39c73c['length']-0x1);return;}if(_0x1b05c4[_0x5f1d98(0x127)]){_0x436523(_0x4d751a=>_0x4d751a<_0x39c73c['length']-0x1?_0x4d751a+0x1:0x0);return;}if(_0x1508ee==='\x20'){_0x22c2f7(_0x11a210=>{const _0x4b1f51=_0x5f1d98,_0x40cb09=new Set(_0x11a210);return _0x40cb09[_0x4b1f51(0xf3)](_0x56becb)?_0x40cb09['delete'](_0x56becb):_0x40cb09['add'](_0x56becb),_0x40cb09;});return;}if(_0x1508ee==='a'||_0x1508ee==='A'){const _0x23e9a0=new Set(_0x39c73c[_0x5f1d98(0x103)]((_0x14fc5e,_0x170656)=>_0x170656));_0x22c2f7(_0x23e9a0);return;}if(_0x1508ee==='i'||_0x1508ee==='I'||_0x1508ee==='r'||_0x1508ee==='R'){_0x22c2f7(_0xb9a149=>{const _0x239391=_0x5f1d98,_0x52bd16=new Set();for(let _0x3d4731=0x0;_0x3d4731<_0x39c73c['length'];_0x3d4731++){!_0xb9a149[_0x239391(0xf3)](_0x3d4731)&&_0x52bd16[_0x239391(0x112)](_0x3d4731);}return _0x52bd16;});return;}if(_0x1508ee==='q'||_0x1508ee==='Q'){_0x1085d7();return;}if(_0x1b05c4[_0x5f1d98(0x104)]){if(_0x42f884[_0x5f1d98(0xf6)]===0x0){_0xf6ae72('请至少选择一个菜单');return;}const _0x40a63f=_0x39c73c[_0x5f1d98(0xe9)]((_0x43cf26,_0x15741e)=>_0x42f884[_0x5f1d98(0xf3)](_0x15741e)),_0x3d467c=_0x40a63f[_0x5f1d98(0x103)](_0x4f9879=>_0x4f9879[_0x5f1d98(0xea)])[_0x5f1d98(0x108)](',\x20');_0x2cfa6b([{'label':'已选择菜单','value':_0x42f884['size']+'\x20个'}]),_0xf6ae72(''),_0x909b53('input-js');return;}return;}if(_0x67d263===_0x5f1d98(0xe6)){if(_0x1b05c4[_0x5f1d98(0x104)]){const _0x395243=_0x4dec9a['trim']();if(_0x395243==='')return;if(!isValidJsHttpsUrl(_0x395243)){_0xf6ae72(_0x5f1d98(0xf5));return;}if(!await isUrlReachable(_0x395243)){_0xf6ae72(_0x5f1d98(0xed));return;}_0x1ab9d4(_0x395243),_0x2cfa6b(_0x24d430=>[..._0x24d430,{'label':'JS\x20链接','value':_0x395243}]),_0x1d68ed(''),_0xf6ae72(''),_0x909b53(_0x5f1d98(0xff));return;}if(_0x1b05c4['backspace']||_0x1b05c4[_0x5f1d98(0x11e)]){_0x1d68ed(_0x36a666=>_0x36a666[_0x5f1d98(0x11d)](0x0,-0x1)),_0xf6ae72('');return;}_0x1d68ed(_0x1dfe71=>_0x1dfe71+_0x1508ee);return;}if(_0x67d263===_0x5f1d98(0xff)){if(_0x1b05c4['return']){const _0x3aa1cf=_0x4dec9a['trim']();if(_0x3aa1cf==='')return;if(!isValidCssHttpsUrl(_0x3aa1cf)){_0xf6ae72(_0x5f1d98(0x110));return;}if(!await isUrlReachable(_0x3aa1cf)){_0xf6ae72(_0x5f1d98(0x123));return;}_0x3eff15(_0x3aa1cf),_0x2cfa6b(_0x2d85ae=>[..._0x2d85ae,{'label':'CSS\x20链接','value':_0x3aa1cf}]),_0x1d68ed(''),_0xf6ae72(''),_0x909b53(_0x5f1d98(0x117));const _0x1b0ad3=_0x39c73c[_0x5f1d98(0xe9)]((_0xf9344a,_0x35140f)=>_0x42f884[_0x5f1d98(0xf3)](_0x35140f));createMenus(_0x1b0ad3,[_0x514f15,_0x3aa1cf])[_0x5f1d98(0x10a)](()=>{_0x909b53('done'),setTimeout(()=>{_0x1085d7();},0x3e8);})[_0x5f1d98(0xf2)](_0x4cc83f=>{const _0x3a8c91=_0x5f1d98;_0xf6ae72(_0x4cc83f[_0x3a8c91(0x126)]||_0x3a8c91(0x100)),_0x909b53('selecting');});return;}if(_0x1b05c4['backspace']||_0x1b05c4['delete']){_0x1d68ed(_0x12d810=>_0x12d810[_0x5f1d98(0x11d)](0x0,-0x1)),_0xf6ae72('');return;}_0x1d68ed(_0x42a618=>_0x42a618+_0x1508ee);return;}});if(_0x44c94b)return a10_0x7bffe6(Box,{'marginTop':0x1,'marginBottom':0x1,'children':[a10_0x5c19b9(Text,{'children':'\x20\x20'}),a10_0x5c19b9(a10_0x12a9c9,{'type':_0x2598d9(0x10f)}),a10_0x5c19b9(Text,{'children':'\x20正在获取线上菜单列表...'})]});if(_0x381e4f)return a10_0x7bffe6(Box,{'flexDirection':_0x2598d9(0x118),'marginTop':0x1,'marginBottom':0x1,'children':[a10_0x7bffe6(Text,{'color':_0x2598d9(0xeb),'children':['✗\x20',_0x381e4f]}),a10_0x7bffe6(Box,{'marginTop':0x1,'children':[a10_0x5c19b9(Text,{'color':_0x2598d9(0x125),'children':_0x2598d9(0xe4)}),a10_0x5c19b9(Text,{'color':'cyan','children':_0x2598d9(0x10e)}),a10_0x5c19b9(Text,{'color':'gray','children':_0x2598d9(0x114)})]})]});if(_0x39c73c[_0x2598d9(0x11f)]===0x0)return a10_0x5c19b9(Box,{'marginTop':0x1,'marginBottom':0x1,'children':a10_0x5c19b9(Text,{'color':_0x2598d9(0x11b),'children':_0x2598d9(0x122)})});return a10_0x7bffe6(Box,{'flexDirection':_0x2598d9(0x118),'marginTop':0x1,'marginBottom':0x1,'children':[_0x67d263===_0x2598d9(0xe8)&&a10_0x7bffe6(a10_0x2823bc,{'children':[a10_0x7bffe6(Box,{'children':[a10_0x7bffe6(Text,{'bold':!![],'children':['\x20\x20',_0x2598d9(0x107),getRemainingSpaces(_0x1167de,_0x2598d9(0x107))]}),a10_0x7bffe6(Text,{'bold':!![],'children':['本地',getRemainingSpaces(_0x29e8ad,_0x2598d9(0x107))]}),a10_0x7bffe6(Text,{'bold':!![],'children':['Lovrabet平台',getRemainingSpaces(_0x29e8ad,'菜单名称')]})]}),_0x5ee784[_0x2598d9(0x103)](_0x22f866=>a10_0x7bffe6(Box,{'children':[a10_0x7bffe6(Text,{'children':['\x20\x20',_0x22f866[_0x2598d9(0xea)],getRemainingSpaces(_0x1167de,_0x22f866['label'])]}),a10_0x7bffe6(Text,{'color':_0x2598d9(0xe7),'children':[_0x22f866[_0x2598d9(0x109)]?'✓':'✗',getRemainingSpaces(_0x29e8ad,'✓')]}),a10_0x7bffe6(Text,{'color':_0x22f866['online']?_0x2598d9(0xe7):_0x2598d9(0xeb),'children':[_0x22f866[_0x2598d9(0xee)]?'✓':'✗',getRemainingSpaces(_0x29e8ad,'✓')]})]},_0x22f866[_0x2598d9(0xf7)]))]}),_0x67d263===_0x2598d9(0xe8)&&_0x1f5893['length']===0x0&&a10_0x5c19b9(Box,{'marginTop':0x1,'children':a10_0x5c19b9(Text,{'color':_0x2598d9(0xfc),'children':_0x2598d9(0x116)})}),_0x1f5893[_0x2598d9(0x103)]((_0x4a3f17,_0x51d6e4)=>a10_0x7bffe6(Box,{'children':[a10_0x7bffe6(Text,{'color':_0x2598d9(0xe7),'children':['√\x20',_0x4a3f17[_0x2598d9(0xea)],':\x20']}),a10_0x5c19b9(Text,{'color':_0x2598d9(0xfc),'children':_0x4a3f17[_0x2598d9(0xfa)]})]},_0x51d6e4)),_0x22599e&&_0x67d263==='selecting'&&a10_0x5c19b9(Box,{'marginTop':0x1,'children':a10_0x7bffe6(Text,{'color':_0x2598d9(0xeb),'children':['✗\x20',_0x22599e]})}),_0x67d263===_0x2598d9(0xe8)&&a10_0x5c19b9(a10_0x2823bc,{'children':a10_0x7bffe6(Box,{'marginTop':_0x1f5893[_0x2598d9(0x11f)]>0x0||_0x22599e?0x1:0x0,'flexDirection':_0x2598d9(0x118),'children':[a10_0x5c19b9(Text,{'bold':!![],'children':_0x2598d9(0x102)}),_0x39c73c[_0x2598d9(0x103)]((_0x45249a,_0x11b903)=>{const _0x347e57=_0x2598d9,_0x2d22c9=_0x56becb===_0x11b903,_0x1544fc=_0x42f884[_0x347e57(0xf3)](_0x11b903),_0x5ddf12=_0x51263b[_0x347e57(0x10c)](_0x45249a[_0x347e57(0xf7)]),_0x41c699=_0x5ddf12?'更新':'新建';return a10_0x5c19b9(Box,{'children':a10_0x7bffe6(Text,{'backgroundColor':_0x2d22c9?_0x347e57(0xf4):undefined,'color':_0x2d22c9?_0x347e57(0xfb):undefined,'children':['\x20\x20',_0x1544fc?_0x347e57(0x124):_0x347e57(0x106),'\x20',_0x45249a[_0x347e57(0xea)]]})},_0x45249a[_0x347e57(0xf7)]);}),a10_0x5c19b9(Box,{'marginTop':0x1,'children':a10_0x7bffe6(Text,{'color':_0x2598d9(0x125),'children':['\x20',_0x2598d9(0xf0)]})})]})}),_0x67d263===_0x2598d9(0xe6)&&a10_0x7bffe6(a10_0x2823bc,{'children':[a10_0x7bffe6(Box,{'children':[a10_0x5c19b9(Text,{'children':_0x2598d9(0x113)}),a10_0x5c19b9(Text,{'color':'green','children':_0x4dec9a}),_0x22599e&&a10_0x7bffe6(Text,{'color':'red','children':[_0x2598d9(0xfe),_0x22599e]})]}),!_0x22599e&&a10_0x5c19b9(Box,{'children':a10_0x5c19b9(Text,{'color':'gray','children':_0x2598d9(0xf9)})})]}),_0x67d263===_0x2598d9(0xff)&&a10_0x7bffe6(a10_0x2823bc,{'children':[a10_0x7bffe6(Box,{'children':[a10_0x5c19b9(Text,{'children':_0x2598d9(0xfd)}),a10_0x5c19b9(Text,{'color':_0x2598d9(0xe7),'children':_0x4dec9a}),_0x22599e&&a10_0x7bffe6(Text,{'color':_0x2598d9(0xeb),'children':['\x20←\x20',_0x22599e]})]}),!_0x22599e&&a10_0x5c19b9(Box,{'children':a10_0x5c19b9(Text,{'color':_0x2598d9(0x125),'children':_0x2598d9(0x115)})})]}),_0x67d263===_0x2598d9(0x117)&&a10_0x5c19b9(Box,{'children':a10_0x5c19b9(Text,{'children':_0x2598d9(0x105)})}),_0x67d263==='done'&&a10_0x5c19b9(Box,{'children':a10_0x5c19b9(Text,{'color':_0x2598d9(0xe7),'children':'√\x20菜单创建完成'})})]});}function getStringWidth(_0x42a163){let _0x4dd365=0x0;for(const _0x498b63 of _0x42a163){/[\u4e00-\u9fa5]/['test'](_0x498b63)?_0x4dd365+=0x2:_0x4dd365+=0x1;}return _0x4dd365;}function getRemainingSpaces(_0x25e948,_0x211c0d){const _0x384665=a10_0x11d3,_0x35be0a=getStringWidth(_0x211c0d);return Array(Math[_0x384665(0xef)](0x0,_0x25e948-_0x35be0a))[_0x384665(0x120)]('\x20')[_0x384665(0x108)]('');}function a10_0x11d3(_0x1e8673,_0x1326cf){const _0x1c3db0=a10_0x1c3d();return a10_0x11d3=function(_0x11d319,_0x9bdd85){_0x11d319=_0x11d319-0xe4;let _0x417b3d=_0x1c3db0[_0x11d319];return _0x417b3d;},a10_0x11d3(_0x1e8673,_0x1326cf);}function getMaxWidth(_0x5d4083,_0x47ff50=0x2){let _0x5419fc='',_0x26c26d=0x0;for(const _0x374e57 of _0x5d4083){const _0x3407fa=getStringWidth(_0x374e57);_0x3407fa>_0x26c26d&&(_0x26c26d=_0x3407fa,_0x5419fc=_0x374e57);}return _0x5419fc+'\x20'['repeat'](_0x47ff50);}
1
+ const a10_0x3f9db8=a10_0x2863;function a10_0x1313(){const _0x15c86b=['label','join','local','selecting','\x20正在获取线上菜单列表...','repeat','path','Lovrabet平台','red','test','length','JS\x20链接','catch','4926485XWvTeb','message','value','310173rHYbWm','JS\x20链接无法访问','map','size','*\x20正在创建菜单...','max','lovrabet\x20auth','blue','请输入有效的\x20CSS\x20https\x20链接','fill','then','slice','yellow','white','232246LbqZFS','online','trim','\x20输入项目的\x20CSS\x20资源链接(https://...)','请至少选择一个菜单','\x20输入项目的\x20JS\x20资源链接(https://...)','column','*\x20请选择要同步的菜单:','[\x20]','has','创建菜单失败','32IQNSMf','main','10DJzwLO','dots','菜单名称','return','1378056yKIdJG','[✓]','includes','\x20←\x20','3519198fwfXnP','gray','*\x20CSS\x20链接:\x20','*\x20同步菜单到\x20Lovrabet\x20平台','done','cyan','input-css','CSS\x20链接无法访问','219291aQmWnx','backspace','green','add','4663848mZwjln','creating','30KKCxlp','delete','filter','upArrow','input-js'];a10_0x1313=function(){return _0x15c86b;};return a10_0x1313();}(function(_0x1224e7,_0xffaab3){const _0x3af5da=a10_0x2863,_0xcf0a2e=_0x1224e7();while(!![]){try{const _0x2d3b61=parseInt(_0x3af5da(0x178))/0x1+-parseInt(_0x3af5da(0x16c))/0x2+parseInt(_0x3af5da(0x193))/0x3*(-parseInt(_0x3af5da(0x166))/0x4)+parseInt(_0x3af5da(0x190))/0x5+parseInt(_0x3af5da(0x17e))/0x6*(-parseInt(_0x3af5da(0x1a1))/0x7)+parseInt(_0x3af5da(0x17c))/0x8+parseInt(_0x3af5da(0x170))/0x9*(parseInt(_0x3af5da(0x168))/0xa);if(_0x2d3b61===_0xffaab3)break;else _0xcf0a2e['push'](_0xcf0a2e['shift']());}catch(_0x486d70){_0xcf0a2e['push'](_0xcf0a2e['shift']());}}}(a10_0x1313,0x793a1));import{jsx as a10_0x249ef8,jsxs as a10_0x3297a3,Fragment as a10_0x32c546}from'react/jsx-runtime';import{Text,Box,useInput,useApp,render}from'ink';import{useEffect,useState}from'react';import a10_0x4ecc62 from'ink-spinner';import{useGetOnlineMenuList}from'./use-get-online-menu-list.js';import{getLocalPages}from'./get-local-pages.js';import{createMenus}from'./create-menu.js';import{isUrlReachable,isValidCssHttpsUrl,isValidJsHttpsUrl}from'./valid-url.js';import.meta[a10_0x3f9db8(0x167)]&&render(a10_0x249ef8(AppMenuSyncUI,{}));export function AppMenuSyncUI(){const _0x1b7521=a10_0x3f9db8,{exit:_0x207903}=useApp(),{loading:_0x86243f,menuList:_0x457861,error:_0x9e4c5}=useGetOnlineMenuList(),_0x48ebc8=getLocalPages(),_0x140cd9=_0x457861[_0x1b7521(0x195)](_0x43648b=>_0x43648b[_0x1b7521(0x189)]),_0x5819d6=[_0x1b7521(0x16a),..._0x48ebc8[_0x1b7521(0x195)](_0x1e4014=>_0x1e4014[_0x1b7521(0x183)])],_0x23d384=getStringWidth(getMaxWidth(_0x5819d6,0x4)),_0x374a8b=getStringWidth(getMaxWidth(['菜单名称'])),[_0x35dc77,_0x4d6794]=useState(_0x1b7521(0x186)),[_0x176ff1,_0x2f9e31]=useState(new Set()),[_0x2d585b,_0x406b02]=useState(0x0),[_0x2d4a80,_0x4ffa69]=useState(''),[_0x1b33c4,_0x4144b5]=useState(''),[_0x5095df,_0x5bcdc7]=useState(''),[_0x4e5205,_0x71a7a5]=useState(''),[_0x41aaef,_0x1bf5e8]=useState([]),_0x21cc0a=_0x48ebc8[_0x1b7521(0x195)](_0x2ce6dd=>({'label':_0x2ce6dd[_0x1b7521(0x183)],'path':_0x2ce6dd[_0x1b7521(0x189)],'local':!![],'online':_0x140cd9[_0x1b7521(0x16e)](_0x2ce6dd[_0x1b7521(0x189)])})),_0x7d1a45=_0x48ebc8['filter'](_0x16f6aa=>{const _0x5db113=_0x1b7521;return!_0x140cd9[_0x5db113(0x16e)](_0x16f6aa[_0x5db113(0x189)]);});useEffect(()=>{const _0x35f00f=_0x1b7521;if(!_0x86243f&&_0x48ebc8[_0x35f00f(0x18d)]>0x0&&_0x176ff1[_0x35f00f(0x196)]===0x0){const _0xe77d02=new Set(_0x48ebc8['map']((_0x56b22e,_0x36167e)=>({'page':_0x56b22e,'index':_0x36167e}))[_0x35f00f(0x180)](({page:_0x1c4d21})=>!_0x140cd9[_0x35f00f(0x16e)](_0x1c4d21['path']))[_0x35f00f(0x195)](({index:_0x311ae6})=>_0x311ae6));_0x2f9e31(_0xe77d02);}},[_0x86243f,_0x48ebc8['length'],_0x140cd9[_0x1b7521(0x18d)]]),useInput(async(_0x2bfa1c,_0x4215cc)=>{const _0x35370a=_0x1b7521;if(_0x35dc77===_0x35370a(0x186)){if(_0x4215cc[_0x35370a(0x181)]){_0x406b02(_0x57b6b8=>_0x57b6b8>0x0?_0x57b6b8-0x1:_0x48ebc8['length']-0x1);return;}if(_0x4215cc['downArrow']){_0x406b02(_0x32e393=>_0x32e393<_0x48ebc8['length']-0x1?_0x32e393+0x1:0x0);return;}if(_0x2bfa1c==='\x20'){_0x2f9e31(_0x8924f5=>{const _0x196678=_0x35370a,_0x493776=new Set(_0x8924f5);return _0x493776[_0x196678(0x164)](_0x2d585b)?_0x493776[_0x196678(0x17f)](_0x2d585b):_0x493776[_0x196678(0x17b)](_0x2d585b),_0x493776;});return;}if(_0x2bfa1c==='a'||_0x2bfa1c==='A'){const _0xe60127=new Set(_0x48ebc8[_0x35370a(0x195)]((_0x36022f,_0x4a2926)=>_0x4a2926));_0x2f9e31(_0xe60127);return;}if(_0x2bfa1c==='i'||_0x2bfa1c==='I'||_0x2bfa1c==='r'||_0x2bfa1c==='R'){_0x2f9e31(_0x2dade1=>{const _0x25c1ba=_0x35370a,_0x348f3c=new Set();for(let _0x50cb84=0x0;_0x50cb84<_0x48ebc8['length'];_0x50cb84++){!_0x2dade1[_0x25c1ba(0x164)](_0x50cb84)&&_0x348f3c[_0x25c1ba(0x17b)](_0x50cb84);}return _0x348f3c;});return;}if(_0x2bfa1c==='q'||_0x2bfa1c==='Q'){_0x207903();return;}if(_0x4215cc[_0x35370a(0x16b)]){if(_0x176ff1['size']===0x0){_0x71a7a5(_0x35370a(0x1a5));return;}const _0xb9da8d=_0x48ebc8[_0x35370a(0x180)]((_0x136109,_0x31d796)=>_0x176ff1['has'](_0x31d796)),_0x84e8aa=_0xb9da8d[_0x35370a(0x195)](_0x124559=>_0x124559['label'])[_0x35370a(0x184)](',\x20');_0x1bf5e8([{'label':'已选择菜单','value':_0x176ff1[_0x35370a(0x196)]+'\x20个'}]),_0x71a7a5(''),_0x4d6794(_0x35370a(0x182));return;}return;}if(_0x35dc77===_0x35370a(0x182)){if(_0x4215cc[_0x35370a(0x16b)]){const _0x516bae=_0x5095df[_0x35370a(0x1a3)]();if(_0x516bae==='')return;if(!isValidJsHttpsUrl(_0x516bae)){_0x71a7a5('请输入有效的\x20JS\x20https\x20链接');return;}if(!await isUrlReachable(_0x516bae)){_0x71a7a5(_0x35370a(0x194));return;}_0x4ffa69(_0x516bae),_0x1bf5e8(_0x5fd94=>[..._0x5fd94,{'label':_0x35370a(0x18e),'value':_0x516bae}]),_0x5bcdc7(''),_0x71a7a5(''),_0x4d6794(_0x35370a(0x176));return;}if(_0x4215cc[_0x35370a(0x179)]||_0x4215cc['delete']){_0x5bcdc7(_0x441a60=>_0x441a60['slice'](0x0,-0x1)),_0x71a7a5('');return;}_0x5bcdc7(_0x173c18=>_0x173c18+_0x2bfa1c);return;}if(_0x35dc77===_0x35370a(0x176)){if(_0x4215cc[_0x35370a(0x16b)]){const _0x15bcfe=_0x5095df[_0x35370a(0x1a3)]();if(_0x15bcfe==='')return;if(!isValidCssHttpsUrl(_0x15bcfe)){_0x71a7a5(_0x35370a(0x19b));return;}if(!await isUrlReachable(_0x15bcfe)){_0x71a7a5(_0x35370a(0x177));return;}_0x4144b5(_0x15bcfe),_0x1bf5e8(_0x55a23e=>[..._0x55a23e,{'label':'CSS\x20链接','value':_0x15bcfe}]),_0x5bcdc7(''),_0x71a7a5(''),_0x4d6794(_0x35370a(0x17d));const _0x2c68d8=_0x48ebc8['filter']((_0x5cb7ac,_0x786186)=>_0x176ff1[_0x35370a(0x164)](_0x786186));createMenus(_0x2c68d8,[_0x2d4a80,_0x15bcfe])[_0x35370a(0x19d)](()=>{const _0x4059be=_0x35370a;_0x4d6794(_0x4059be(0x174)),setTimeout(()=>{_0x207903();},0x3e8);})[_0x35370a(0x18f)](_0x3788d1=>{const _0xf435cf=_0x35370a;_0x71a7a5(_0x3788d1[_0xf435cf(0x191)]||_0xf435cf(0x165)),_0x4d6794(_0xf435cf(0x186));});return;}if(_0x4215cc[_0x35370a(0x179)]||_0x4215cc[_0x35370a(0x17f)]){_0x5bcdc7(_0x67c7cc=>_0x67c7cc[_0x35370a(0x19e)](0x0,-0x1)),_0x71a7a5('');return;}_0x5bcdc7(_0x1105b1=>_0x1105b1+_0x2bfa1c);return;}});if(_0x86243f)return a10_0x3297a3(Box,{'marginTop':0x1,'marginBottom':0x1,'children':[a10_0x249ef8(Text,{'children':'\x20\x20'}),a10_0x249ef8(a10_0x4ecc62,{'type':_0x1b7521(0x169)}),a10_0x249ef8(Text,{'children':_0x1b7521(0x187)})]});if(_0x9e4c5)return a10_0x3297a3(Box,{'flexDirection':_0x1b7521(0x161),'marginTop':0x1,'marginBottom':0x1,'children':[a10_0x3297a3(Text,{'color':_0x1b7521(0x18b),'children':['✗\x20',_0x9e4c5]}),a10_0x3297a3(Box,{'marginTop':0x1,'children':[a10_0x249ef8(Text,{'color':_0x1b7521(0x171),'children':'提示:使用\x20'}),a10_0x249ef8(Text,{'color':_0x1b7521(0x175),'children':_0x1b7521(0x199)}),a10_0x249ef8(Text,{'color':_0x1b7521(0x171),'children':'\x20命令重新登录'})]})]});if(_0x48ebc8[_0x1b7521(0x18d)]===0x0)return a10_0x249ef8(Box,{'marginTop':0x1,'marginBottom':0x1,'children':a10_0x249ef8(Text,{'color':_0x1b7521(0x19f),'children':'!\x20未找到本地页面,请先创建页面'})});return a10_0x3297a3(Box,{'flexDirection':'column','marginTop':0x1,'marginBottom':0x1,'children':[_0x35dc77===_0x1b7521(0x186)&&a10_0x3297a3(a10_0x32c546,{'children':[a10_0x3297a3(Box,{'children':[a10_0x3297a3(Text,{'bold':!![],'children':['\x20\x20',_0x1b7521(0x16a),getRemainingSpaces(_0x23d384,_0x1b7521(0x16a))]}),a10_0x3297a3(Text,{'bold':!![],'children':['本地',getRemainingSpaces(_0x374a8b,'菜单名称')]}),a10_0x3297a3(Text,{'bold':!![],'children':[_0x1b7521(0x18a),getRemainingSpaces(_0x374a8b,_0x1b7521(0x16a))]})]}),_0x21cc0a[_0x1b7521(0x195)](_0x4ae650=>a10_0x3297a3(Box,{'children':[a10_0x3297a3(Text,{'children':['\x20\x20',_0x4ae650[_0x1b7521(0x183)],getRemainingSpaces(_0x23d384,_0x4ae650[_0x1b7521(0x183)])]}),a10_0x3297a3(Text,{'color':_0x1b7521(0x17a),'children':[_0x4ae650[_0x1b7521(0x185)]?'✓':'✗',getRemainingSpaces(_0x374a8b,'✓')]}),a10_0x3297a3(Text,{'color':_0x4ae650[_0x1b7521(0x1a2)]?'green':_0x1b7521(0x18b),'children':[_0x4ae650[_0x1b7521(0x1a2)]?'✓':'✗',getRemainingSpaces(_0x374a8b,'✓')]})]},_0x4ae650[_0x1b7521(0x189)]))]}),_0x35dc77===_0x1b7521(0x186)&&_0x41aaef[_0x1b7521(0x18d)]===0x0&&a10_0x249ef8(Box,{'marginTop':0x1,'children':a10_0x249ef8(Text,{'color':'cyan','children':_0x1b7521(0x173)})}),_0x41aaef[_0x1b7521(0x195)]((_0x522137,_0x3690aa)=>a10_0x3297a3(Box,{'children':[a10_0x3297a3(Text,{'color':_0x1b7521(0x17a),'children':['√\x20',_0x522137[_0x1b7521(0x183)],':\x20']}),a10_0x249ef8(Text,{'color':_0x1b7521(0x175),'children':_0x522137[_0x1b7521(0x192)]})]},_0x3690aa)),_0x4e5205&&_0x35dc77===_0x1b7521(0x186)&&a10_0x249ef8(Box,{'marginTop':0x1,'children':a10_0x3297a3(Text,{'color':_0x1b7521(0x18b),'children':['✗\x20',_0x4e5205]})}),_0x35dc77===_0x1b7521(0x186)&&a10_0x249ef8(a10_0x32c546,{'children':a10_0x3297a3(Box,{'marginTop':_0x41aaef[_0x1b7521(0x18d)]>0x0||_0x4e5205?0x1:0x0,'flexDirection':'column','children':[a10_0x249ef8(Text,{'bold':!![],'children':_0x1b7521(0x162)}),_0x48ebc8[_0x1b7521(0x195)]((_0x5ee328,_0x2d607b)=>{const _0x1c131b=_0x1b7521,_0x2501ae=_0x2d585b===_0x2d607b,_0x5b3131=_0x176ff1[_0x1c131b(0x164)](_0x2d607b),_0x735ce4=_0x140cd9[_0x1c131b(0x16e)](_0x5ee328[_0x1c131b(0x189)]),_0x29b338=_0x735ce4?'更新':'新建';return a10_0x249ef8(Box,{'children':a10_0x3297a3(Text,{'backgroundColor':_0x2501ae?_0x1c131b(0x19a):undefined,'color':_0x2501ae?_0x1c131b(0x1a0):undefined,'children':['\x20\x20',_0x5b3131?_0x1c131b(0x16d):_0x1c131b(0x163),'\x20',_0x5ee328['label']]})},_0x5ee328[_0x1c131b(0x189)]);}),a10_0x249ef8(Box,{'marginTop':0x1,'children':a10_0x3297a3(Text,{'color':'gray','children':['\x20','↑/↓:\x20移动光标\x20空格:\x20切换选中\x20a:\x20全选\x20i/r:\x20反选\x20Enter:\x20确认']})})]})}),_0x35dc77===_0x1b7521(0x182)&&a10_0x3297a3(a10_0x32c546,{'children':[a10_0x3297a3(Box,{'children':[a10_0x249ef8(Text,{'children':'*\x20JS\x20链接:\x20'}),a10_0x249ef8(Text,{'color':_0x1b7521(0x17a),'children':_0x5095df}),_0x4e5205&&a10_0x3297a3(Text,{'color':_0x1b7521(0x18b),'children':[_0x1b7521(0x16f),_0x4e5205]})]}),!_0x4e5205&&a10_0x249ef8(Box,{'children':a10_0x249ef8(Text,{'color':'gray','children':_0x1b7521(0x160)})})]}),_0x35dc77===_0x1b7521(0x176)&&a10_0x3297a3(a10_0x32c546,{'children':[a10_0x3297a3(Box,{'children':[a10_0x249ef8(Text,{'children':_0x1b7521(0x172)}),a10_0x249ef8(Text,{'color':_0x1b7521(0x17a),'children':_0x5095df}),_0x4e5205&&a10_0x3297a3(Text,{'color':'red','children':[_0x1b7521(0x16f),_0x4e5205]})]}),!_0x4e5205&&a10_0x249ef8(Box,{'children':a10_0x249ef8(Text,{'color':_0x1b7521(0x171),'children':_0x1b7521(0x1a4)})})]}),_0x35dc77===_0x1b7521(0x17d)&&a10_0x249ef8(Box,{'children':a10_0x249ef8(Text,{'children':_0x1b7521(0x197)})}),_0x35dc77===_0x1b7521(0x174)&&a10_0x249ef8(Box,{'children':a10_0x249ef8(Text,{'color':_0x1b7521(0x17a),'children':'√\x20菜单创建完成'})})]});}function a10_0x2863(_0x2dfd44,_0x4681ad){const _0x131365=a10_0x1313();return a10_0x2863=function(_0x286355,_0x130b75){_0x286355=_0x286355-0x160;let _0xd1e46f=_0x131365[_0x286355];return _0xd1e46f;},a10_0x2863(_0x2dfd44,_0x4681ad);}function getStringWidth(_0x5a6c4d){const _0x166e0c=a10_0x3f9db8;let _0x4592d6=0x0;for(const _0x2edbd4 of _0x5a6c4d){/[\u4e00-\u9fa5]/[_0x166e0c(0x18c)](_0x2edbd4)?_0x4592d6+=0x2:_0x4592d6+=0x1;}return _0x4592d6;}function getRemainingSpaces(_0x3cc6c9,_0x22d446){const _0x5100bf=a10_0x3f9db8,_0x1fe2a0=getStringWidth(_0x22d446);return Array(Math[_0x5100bf(0x198)](0x0,_0x3cc6c9-_0x1fe2a0))[_0x5100bf(0x19c)]('\x20')[_0x5100bf(0x184)]('');}function getMaxWidth(_0x179f29,_0x8ff162=0x2){const _0x1d4293=a10_0x3f9db8;let _0x206262='',_0x18552e=0x0;for(const _0x23e8aa of _0x179f29){const _0x480064=getStringWidth(_0x23e8aa);_0x480064>_0x18552e&&(_0x18552e=_0x480064,_0x206262=_0x23e8aa);}return _0x206262+'\x20'[_0x1d4293(0x188)](_0x8ff162);}