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

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 (61) 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/app-menu-update-cdn/current-content.js +1 -0
  22. package/lib/app-menu-update-cdn/input-cdn-asset.js +1 -0
  23. package/lib/app-menu-update-cdn/main.js +1 -0
  24. package/lib/auth/auth-server-ui.js +1 -1
  25. package/lib/auth/auth-server.js +1 -1
  26. package/lib/auth/constant.js +1 -1
  27. package/lib/auth/get-cookie.js +1 -1
  28. package/lib/auth/is-session-valid.js +1 -1
  29. package/lib/auth/logout.js +1 -1
  30. package/lib/cli.js +1 -1
  31. package/lib/cmd/build-watch.js +1 -1
  32. package/lib/cmd/build.js +1 -1
  33. package/lib/cmd/logs.js +1 -1
  34. package/lib/cmd/preview.js +1 -1
  35. package/lib/cmd/start.js +1 -1
  36. package/lib/config/config-help.js +1 -1
  37. package/lib/config/main.js +1 -1
  38. package/lib/constant/domain.js +1 -1
  39. package/lib/constant/env.js +1 -1
  40. package/lib/create-app/enhanced-guided-create.js +1 -1
  41. package/lib/create-app/format-elapsed.js +1 -1
  42. package/lib/create-app/main.js +1 -1
  43. package/lib/create-app/task-finished.js +1 -1
  44. package/lib/create-app/task-loading.js +1 -1
  45. package/lib/create-app/task-running.js +1 -1
  46. package/lib/create-app/task-time.js +1 -1
  47. package/lib/create-app/use-copy-project-template.js +1 -1
  48. package/lib/create-app/use-format-code.js +1 -1
  49. package/lib/create-app/use-install-dependencies.js +1 -1
  50. package/lib/help.js +1 -1
  51. package/lib/init/main.js +1 -1
  52. package/lib/mcp/cursor.js +1 -1
  53. package/lib/mcp/main.js +1 -1
  54. package/lib/utils/config.js +1 -1
  55. package/lib/utils/copy-directory.js +1 -1
  56. package/lib/utils/http-client.js +1 -1
  57. package/lib/utils/logger.js +1 -1
  58. package/lib/utils/router-updater.js +1 -1
  59. package/lib/utils/sleep.js +1 -1
  60. package/lib/utils/template-replacer.js +1 -1
  61. package/package.json +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(_0x52715c,_0x3d808c){const _0xe85a6b=a0_0x5c6c,_0x4eb4c0=_0x52715c();while(!![]){try{const _0x581d2f=parseInt(_0xe85a6b(0x7c))/0x1*(parseInt(_0xe85a6b(0x7b))/0x2)+parseInt(_0xe85a6b(0x85))/0x3*(parseInt(_0xe85a6b(0x8d))/0x4)+-parseInt(_0xe85a6b(0x86))/0x5*(parseInt(_0xe85a6b(0x91))/0x6)+parseInt(_0xe85a6b(0x88))/0x7+parseInt(_0xe85a6b(0x83))/0x8+parseInt(_0xe85a6b(0x89))/0x9*(-parseInt(_0xe85a6b(0x82))/0xa)+-parseInt(_0xe85a6b(0x7d))/0xb;if(_0x581d2f===_0x3d808c)break;else _0x4eb4c0['push'](_0x4eb4c0['shift']());}catch(_0x1e41d4){_0x4eb4c0['push'](_0x4eb4c0['shift']());}}}(a0_0x1635,0x9bc3e));import{jsx as a0_0x4aaba2,jsxs as a0_0x5b9520}from'react/jsx-runtime';import{useState}from'react';function a0_0x5c6c(_0x2dbdf0,_0x28a70f){_0x2dbdf0=_0x2dbdf0-0x75;const _0x1635c8=a0_0x1635();let _0x5c6ce3=_0x1635c8[_0x2dbdf0];return _0x5c6ce3;}import{Text,Box,useInput}from'ink';import a0_0x306978 from'node:fs';export function InputProjectCode(_0x4ff7a1){const _0x2e2559=a0_0x5c6c,{onSubmit:_0x3e75ee,pagePath:_0xd20bce}=_0x4ff7a1,[_0x556019,_0x438a57]=useState(''),[_0xc78b3d,_0x56c854]=useState(''),_0x21e9af=_0x2e2559(0x78);function _0x2ab2e3(_0x5351aa){const _0x36e351=_0x2e2559;if(_0x5351aa['length']>0x64)return{'valid':![],'message':_0x36e351(0x97)};if(_0x5351aa[_0x36e351(0x79)]('/')||_0x5351aa[_0x36e351(0x8b)]('/'))return{'valid':![],'message':'路径不能以\x20/\x20开头或结尾'};if(_0x5351aa[_0x36e351(0x90)]('//'))return{'valid':![],'message':_0x36e351(0x8a)};const _0xe5e132=_0x5351aa[_0x36e351(0x77)]('/');for(const _0x29e602 of _0xe5e132){if(!_0x29e602)continue;const _0x276ce7=/^[A-Za-z0-9][A-Za-z0-9_-]*$/;if(!_0x276ce7[_0x36e351(0x76)](_0x29e602))return{'valid':![],'message':_0x36e351(0x80)};}return{'valid':!![]};}return useInput((_0x3a7e92,_0xdc35e2)=>{const _0x49588a=_0x2e2559;if(_0xdc35e2[_0x49588a(0x95)]){const _0x1950dc=_0x556019[_0x49588a(0x96)]()||_0x21e9af;if(_0xc78b3d)return;const _0x1f2201=_0xd20bce+'/'+_0x1950dc;if(a0_0x306978[_0x49588a(0x7e)](_0x1f2201)){_0x56c854('页面路径\x20'+_0x1950dc+_0x49588a(0x7f));return;}_0x3e75ee(_0x1950dc),_0x438a57(''),_0x56c854('');}else _0xdc35e2[_0x49588a(0x84)]||_0xdc35e2['delete']?_0x438a57(_0x359f78=>{const _0x3f02e4=_0x49588a,_0x395e41=_0x359f78[_0x3f02e4(0x8f)](0x0,-0x1),{valid:_0x278c74,message:_0x26bf33}=_0x2ab2e3(_0x395e41);return _0x56c854(_0x278c74?'':_0x26bf33||_0x3f02e4(0x87)),_0x395e41;}):_0x438a57(_0x45a441=>{const _0x573cc0=_0x45a441+_0x3a7e92,{valid:_0x11a87d,message:_0x3b0fb2}=_0x2ab2e3(_0x573cc0);return _0x56c854(_0x11a87d?'':_0x3b0fb2||'页面路径不合法'),_0x573cc0;});}),a0_0x5b9520(Box,{'flexDirection':_0x2e2559(0x81),'children':[a0_0x5b9520(Box,{'children':[a0_0x4aaba2(Text,{'color':_0x2e2559(0x8c),'children':_0x2e2559(0x75)}),a0_0x4aaba2(Text,{'children':_0x2e2559(0x94)}),_0x556019?a0_0x4aaba2(Text,{'color':_0x2e2559(0x8e),'children':_0x556019}):a0_0x4aaba2(Text,{'color':'gray','children':_0x21e9af}),_0xc78b3d&&a0_0x5b9520(Text,{'color':_0x2e2559(0x92),'children':[_0x2e2559(0x7a),_0xc78b3d]})]}),!_0xc78b3d&&!_0x556019&&a0_0x4aaba2(Box,{'children':a0_0x4aaba2(Text,{'color':_0x2e2559(0x8c),'children':_0x2e2559(0x93)})})]});}function a0_0x1635(){const _0x384c13=['startsWith','\x20←\x20','308180VWAzuA','7MkfSLu','30236877yDNoUg','existsSync','\x20已存在,请使用其他路径','路径中的每个段只能以字母或数字开头,且只包含字母、数字、-\x20和\x20_','column','3284180HcPPVC','8826160qguvHe','backspace','33ZzhYll','1130hrhfFd','页面路径不合法','6835738JOPExm','9OrdeSD','路径不能包含连续的\x20/','endsWith','gray','222116HgLxxI','green','slice','includes','1434gQgAlT','red','\x20直接回车确认,或输入自定义路由地址','页面路由地址:\x20','return','trim','页面路径长度不能超过\x20100\x20个字符','\x20Step2:\x20','test','split','my-page'];a0_0x1635=function(){return _0x384c13;};return a0_0x1635();}
@@ -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_0x5a81bc=a1_0x2e10;(function(_0x258341,_0x3e04f6){const _0x2ef565=a1_0x2e10,_0x4324f4=_0x258341();while(!![]){try{const _0x28f7aa=-parseInt(_0x2ef565(0x1fd))/0x1+parseInt(_0x2ef565(0x1f4))/0x2+parseInt(_0x2ef565(0x1ed))/0x3*(-parseInt(_0x2ef565(0x1fc))/0x4)+-parseInt(_0x2ef565(0x201))/0x5+-parseInt(_0x2ef565(0x1f5))/0x6+parseInt(_0x2ef565(0x211))/0x7+parseInt(_0x2ef565(0x1fa))/0x8*(parseInt(_0x2ef565(0x1ee))/0x9);if(_0x28f7aa===_0x3e04f6)break;else _0x4324f4['push'](_0x4324f4['shift']());}catch(_0x28a2e1){_0x4324f4['push'](_0x4324f4['shift']());}}}(a1_0x1c66,0x418bc));import{jsx as a1_0x3d797a,jsxs as a1_0x39b813,Fragment as a1_0x25980d}from'react/jsx-runtime';import{fileURLToPath}from'node:url';import a1_0x39b911 from'node:path';import{useEffect,useState}from'react';import{Box,Text,useApp}from'ink';import{SelectPageTemplate}from'./select-page-template.js';function a1_0x1c66(){const _0x185411=['cwd','cyan','已输入的页面路由\x20','3433927XssvUH','\x20Step1:\x20','message','171qtlAAA','945702VXkHIu','green','页面添加成功:\x20','join','error','\x20*\x20路由地址:\x20','788744LmSrFw','2237658BxhLcO','../../templates/pages','页面添加失败:\x20','catch','开始添加页面:\x20','40BXFzsl','processTemplate','21984kyWbwe','262395yKIfHV','gray','pages','\x20*\x20页面文件已创建,可直接通过路由访问','966185iwgaHg','finally','now','add-page','src','已选择页面模板\x20','正在创建页面,请稍候…','dirname','success','column','setLogPath','\x20Step2:\x20','resolve'];a1_0x1c66=function(){return _0x185411;};return a1_0x1c66();}import{InputProjectCode}from'./input-page-router.js';import{logger}from'../utils/logger.js';import{TemplateReplacer}from'../utils/template-replacer.js';const __dirname=a1_0x39b911[a1_0x5a81bc(0x208)](fileURLToPath(import.meta.url)),pageTemplateDir=a1_0x39b911['resolve'](__dirname,a1_0x5a81bc(0x1f6)),projectDir=process[a1_0x5a81bc(0x20e)]();function a1_0x2e10(_0x93c4d9,_0x9c7be3){_0x93c4d9=_0x93c4d9-0x1eb;const _0x1c661b=a1_0x1c66();let _0x2e10e8=_0x1c661b[_0x93c4d9];return _0x2e10e8;}export const AddPage=()=>{const _0x3a0fd8=a1_0x5a81bc,{exit:_0x14732c}=useApp(),[_0x3399c4,_0x1a53f9]=useState(''),[_0x1c8b00,_0x300c36]=useState(''),[_0xed3d8e,_0x58d66f]=useState(![]),[_0x1c7122,_0x236952]=useState(![]),_0x5c6279=a1_0x39b911[_0x3a0fd8(0x1f1)](projectDir,_0x3a0fd8(0x205),_0x3a0fd8(0x1ff)),_0x2e7ae4=a1_0x39b911['join'](_0x5c6279,_0x1c8b00),_0x1c1396=a1_0x39b911[_0x3a0fd8(0x1f1)]('src',_0x3a0fd8(0x1ff),_0x1c8b00);useEffect(()=>{const _0x115ac2=_0x3a0fd8,_0x5e9ba7=a1_0x39b911[_0x115ac2(0x20d)](pageTemplateDir,_0x3399c4);if(_0x3399c4&&_0x1c8b00){_0x58d66f(!![]),logger[_0x115ac2(0x20b)](process[_0x115ac2(0x20e)]());const _0x1f01f9=Date[_0x115ac2(0x203)]();logger['info'](_0x115ac2(0x204),_0x115ac2(0x1f9)+_0x1c8b00,{'template':_0x3399c4,'targetPath':_0x1c1396}),TemplateReplacer[_0x115ac2(0x1fb)](_0x5e9ba7,a1_0x39b911[_0x115ac2(0x1f1)](_0x5c6279,_0x1c8b00),_0x1c8b00,_0x3399c4)['then'](()=>{const _0x4329d9=_0x115ac2,_0x2b227a=Date[_0x4329d9(0x203)]()-_0x1f01f9;logger[_0x4329d9(0x209)](_0x4329d9(0x204),_0x4329d9(0x1f0)+_0x1c8b00,_0x2b227a,{'template':_0x3399c4,'targetPath':_0x1c1396,'routePath':_0x1c8b00}),_0x236952(!![]);})[_0x115ac2(0x1f8)](_0x124fa6=>{const _0xb98c78=_0x115ac2,_0xd3bc49=Date[_0xb98c78(0x203)]()-_0x1f01f9;logger[_0xb98c78(0x1f2)]('add-page',_0xb98c78(0x1f7)+_0x1c8b00,{'template':_0x3399c4,'targetPath':_0x1c1396,'error':_0x124fa6 instanceof Error?_0x124fa6[_0xb98c78(0x1ec)]:String(_0x124fa6),'duration':_0xd3bc49});})[_0x115ac2(0x202)](()=>{_0x58d66f(![]);});}},[_0x3399c4,_0x1c8b00]),useEffect(()=>{_0x1c7122&&setTimeout(()=>{_0x14732c();});},[_0x1c7122]);if(_0x3399c4)return a1_0x39b813(Box,{'flexDirection':_0x3a0fd8(0x20a),'paddingY':0x1,'children':[a1_0x39b813(Box,{'children':[a1_0x3d797a(Text,{'color':'gray','children':_0x3a0fd8(0x1eb)}),a1_0x3d797a(Text,{'children':_0x3a0fd8(0x206)}),a1_0x3d797a(Text,{'color':_0x3a0fd8(0x1ef),'children':_0x3399c4})]}),_0x1c8b00?a1_0x39b813(Box,{'children':[a1_0x3d797a(Text,{'color':_0x3a0fd8(0x1fe),'children':_0x3a0fd8(0x20c)}),a1_0x3d797a(Text,{'children':_0x3a0fd8(0x210)}),a1_0x3d797a(Text,{'color':_0x3a0fd8(0x1ef),'children':_0x1c8b00})]}):a1_0x3d797a(InputProjectCode,{'pagePath':_0x2e7ae4,'onSubmit':_0x300c36}),_0x1c8b00&&_0xed3d8e?a1_0x39b813(Box,{'marginTop':0x1,'children':[a1_0x3d797a(Box,{'width':'4'}),a1_0x3d797a(Text,{'children':_0x3a0fd8(0x207)})]}):null,_0x1c7122?a1_0x39b813(a1_0x25980d,{'children':[a1_0x3d797a(Box,{'marginTop':0x1,'children':a1_0x3d797a(Text,{'color':_0x3a0fd8(0x1fe),'children':'\x20*\x20页面创建成功!'})}),a1_0x39b813(Box,{'children':[a1_0x3d797a(Text,{'color':_0x3a0fd8(0x1fe),'children':'\x20*\x20页面路径:\x20'}),a1_0x3d797a(Text,{'color':_0x3a0fd8(0x1ef),'children':_0x1c1396})]}),a1_0x39b813(Box,{'children':[a1_0x3d797a(Text,{'color':'gray','children':_0x3a0fd8(0x1f3)}),a1_0x39b813(Text,{'color':_0x3a0fd8(0x1ef),'children':['/',_0x1c8b00]})]}),a1_0x3d797a(Box,{'marginTop':0x1,'children':a1_0x3d797a(Text,{'color':_0x3a0fd8(0x20f),'children':_0x3a0fd8(0x200)})})]}):null]});return a1_0x3d797a(SelectPageTemplate,{'onSelect':_0x1a53f9});};
@@ -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(_0x577820,_0x565367){const _0x552de5=a2_0x3615,_0x15a6cb=_0x577820();while(!![]){try{const _0x26d987=parseInt(_0x552de5(0x107))/0x1*(parseInt(_0x552de5(0x114))/0x2)+parseInt(_0x552de5(0x113))/0x3+parseInt(_0x552de5(0x116))/0x4+parseInt(_0x552de5(0x101))/0x5+-parseInt(_0x552de5(0x10b))/0x6*(parseInt(_0x552de5(0x11c))/0x7)+-parseInt(_0x552de5(0x108))/0x8+-parseInt(_0x552de5(0x104))/0x9*(parseInt(_0x552de5(0x123))/0xa);if(_0x26d987===_0x565367)break;else _0x15a6cb['push'](_0x15a6cb['shift']());}catch(_0x1775f7){_0x15a6cb['push'](_0x15a6cb['shift']());}}}(a2_0x2e5a,0xd91b3));import{jsx as a2_0x5157df,jsxs as a2_0x4c9aaf}from'react/jsx-runtime';import{useState,useEffect}from'react';import{Text,Box,useInput}from'ink';import{readdir}from'node:fs/promises';function a2_0x2e5a(){const _0x48f17a=['297egwEVt','../..','localeCompare','15rAIoqL','4383256iropwW','sort','name','122604RJwgbe','\x20\x20\x20\x20\x20\x20>\x20','\x20Step1:\x20','isDirectory','label','error','downArrow','请选择您要创建的页面模板','3123045NPCAAD','115788wAmRop','join','5538076NwRAGN','return','\x20\x20\x20\x20\x20\x20\x20\x20','upArrow','blank','gray','273YpKHCw','正在加载页面模板...','length','templates/pages','map','column','green','363470QAghhw','698035zhNuWe','dirname','filter'];a2_0x2e5a=function(){return _0x48f17a;};return a2_0x2e5a();}import a2_0x24ac1e from'node:path';import{fileURLToPath}from'node:url';async function getTemplateList(){const _0x1934d9=a2_0x3615;try{const _0x35f153=fileURLToPath(import.meta.url),_0x3abca1=a2_0x24ac1e['resolve'](a2_0x24ac1e[_0x1934d9(0x102)](_0x35f153),_0x1934d9(0x105)),_0x53fbbb=a2_0x24ac1e[_0x1934d9(0x115)](_0x3abca1,_0x1934d9(0x11f)),_0x186ac3=await readdir(_0x53fbbb,{'withFileTypes':!![]}),_0x113394=_0x186ac3[_0x1934d9(0x103)](_0x34fdee=>_0x34fdee[_0x1934d9(0x10e)]())[_0x1934d9(0x120)](_0x2fc161=>({'label':_0x2fc161[_0x1934d9(0x10a)]}))[_0x1934d9(0x109)]((_0x4538e7,_0x29373a)=>_0x4538e7[_0x1934d9(0x10f)][_0x1934d9(0x106)](_0x29373a['label']));return _0x113394;}catch(_0x53f773){return console[_0x1934d9(0x110)]('获取模板列表失败:',_0x53f773),[{'label':_0x1934d9(0x11a)},{'label':'sdk-fetch'}];}}function a2_0x3615(_0x310c6d,_0x3a0734){_0x310c6d=_0x310c6d-0x101;const _0x2e5a8b=a2_0x2e5a();let _0x3615a9=_0x2e5a8b[_0x310c6d];return _0x3615a9;}export function SelectPageTemplate(_0x1fbdc2){const _0x4915ee=a2_0x3615,[_0x2dc533,_0x42bcca]=useState(0x0),[_0x1b2502,_0x304aea]=useState([]),[_0x5adaf6,_0x172727]=useState(!![]);useEffect(()=>{async function _0x1b1e55(){const _0x40594d=await getTemplateList();_0x304aea(_0x40594d),_0x172727(![]);}_0x1b1e55();},[]),useInput((_0x33ab58,_0x3baa8e)=>{const _0x417750=a2_0x3615;if(_0x5adaf6)return;if(_0x3baa8e[_0x417750(0x117)]){const _0x463b3e=_0x1b2502[_0x2dc533];_0x463b3e&&_0x1fbdc2['onSelect'](_0x463b3e[_0x417750(0x10f)]);}_0x3baa8e[_0x417750(0x119)]&&_0x42bcca(_0x4b614e=>_0x4b614e===0x0?_0x1b2502[_0x417750(0x11e)]-0x1:_0x4b614e-0x1),_0x3baa8e[_0x417750(0x111)]&&_0x42bcca(_0x2852ee=>_0x2852ee===_0x1b2502[_0x417750(0x11e)]-0x1?0x0:_0x2852ee+0x1);});if(_0x5adaf6)return a2_0x5157df(Box,{'flexDirection':'column','paddingY':0x1,'children':a2_0x4c9aaf(Box,{'children':[a2_0x5157df(Text,{'color':_0x4915ee(0x11b),'children':_0x4915ee(0x10d)}),a2_0x5157df(Text,{'children':_0x4915ee(0x11d)})]})});return a2_0x4c9aaf(Box,{'flexDirection':_0x4915ee(0x121),'paddingY':0x1,'children':[a2_0x4c9aaf(Box,{'children':[a2_0x5157df(Text,{'color':'gray','children':_0x4915ee(0x10d)}),a2_0x5157df(Text,{'children':_0x4915ee(0x112)})]}),_0x1b2502[_0x4915ee(0x120)]((_0x5ebbf9,_0x366af1)=>{const _0x3584fa=_0x4915ee,_0x35c4a6=_0x366af1===_0x2dc533,_0x93a876=_0x35c4a6?_0x3584fa(0x10c)+_0x5ebbf9[_0x3584fa(0x10f)]:_0x3584fa(0x118)+_0x5ebbf9[_0x3584fa(0x10f)];return a2_0x5157df(Box,{'children':a2_0x5157df(Text,{'color':_0x35c4a6?_0x3584fa(0x122):undefined,'children':_0x93a876})},_0x93a876);})]});}
@@ -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(_0x42b801,_0x40cdaf){const _0x952380=a3_0x7d35,_0x1c7e7b=_0x42b801();while(!![]){try{const _0x458b3a=parseInt(_0x952380(0x1ba))/0x1*(parseInt(_0x952380(0x1c5))/0x2)+parseInt(_0x952380(0x1be))/0x3+-parseInt(_0x952380(0x1bc))/0x4+parseInt(_0x952380(0x1ca))/0x5*(-parseInt(_0x952380(0x1db))/0x6)+parseInt(_0x952380(0x1e0))/0x7*(-parseInt(_0x952380(0x1af))/0x8)+-parseInt(_0x952380(0x1b3))/0x9+parseInt(_0x952380(0x1b1))/0xa;if(_0x458b3a===_0x40cdaf)break;else _0x1c7e7b['push'](_0x1c7e7b['shift']());}catch(_0x5d17c5){_0x1c7e7b['push'](_0x1c7e7b['shift']());}}}(a3_0x7711,0x8a55e));import{jsx as a3_0x4ed38c,jsxs as a3_0x2db64b,Fragment as a3_0xc07d34}from'react/jsx-runtime';function a3_0x7711(){const _0x1f8764=['\x1b[90m*\x20从\x20','17848050VUNkzD','map','2556864ousQmw','log','yellow','\x20-\x20','green','未找到任何数据集','setLogPath','90hhrxpD','\x20个数据集中筛选出\x20','3245456bXRGFK','join','2207709rhmnHa','\x20个数据集','指定的数据集代码都不存在:\x20','正在生成\x20','online','*\x20生成的文档文件:','\x20(环境:\x20','7548TPgrYO','success','cwd','未提供应用AppCode,且配置中也没有默认值','env','3535PvkDfo','includes','⚠️\x20以下数据集生成失败:','dim','message','文档生成完成','gray','*\x20共处理\x20','white','datasetCode','文档生成失败:\x20','🚀\x20','\x20个匹配的数据集\x1b[0m','filePath','error','red','cyan','630msKDPa','string','lovrabet\x20auth','\x20个数据集的文档...','正在获取数据集列表...','7EyszGP','使用配置的应用AppCode:\x20','filter','./docs','√\x20文档生成完成!成功\x20','column','\x1b[33m!\x20以下数据集代码不存在:\x20','length','api-doc','8992408rQaWXr'];a3_0x7711=function(){return _0x1f8764;};return a3_0x7711();}import{useEffect,useState}from'react';import{Box,Text,useApp}from'ink';import{readConfig,getConfigAppCode}from'../utils/config.js';import{initEnv}from'../constant/env.js';import{fetchModelList}from'./fetch-model-list.js';function a3_0x7d35(_0x50ebef,_0x5916c6){_0x50ebef=_0x50ebef-0x1af;const _0x77112a=a3_0x7711();let _0x7d35c1=_0x77112a[_0x50ebef];return _0x7d35c1;}import{generateDatasetDocs}from'./api-doc.js';import{logger}from'../utils/logger.js';export const ApiDocUI=({appCode:_0x21b84b,env:_0x1502cb,output:_0x50d50,extraParams:_0x32cba5,datasetCodes:_0x1ae0d1})=>{const _0x1b4da7=a3_0x7d35,{exit:_0x39bc89}=useApp(),[_0x45c2a8,_0x12be7c]=useState(![]),[_0x162290,_0x2f629c]=useState(''),[_0x11b5b2,_0x581ffc]=useState(![]),[_0x45f04e,_0x1846b4]=useState(null),[_0x26c872,_0xa8b5d5]=useState(null),[_0x434500,_0xc9c41d]=useState(0x0),_0x1daa89=readConfig(),_0x133812=getConfigAppCode(),_0x443c68=_0x21b84b||_0x133812,_0x567197=typeof _0x1daa89?.[_0x1b4da7(0x1c9)]===_0x1b4da7(0x1dc)?_0x1daa89['env']:undefined,_0x4c87de=_0x1502cb||_0x567197||_0x1b4da7(0x1c2);initEnv(_0x4c87de);const _0x1e0baf=_0x50d50||_0x1b4da7(0x1e3),_0x414e2f=_0x21b84b?'使用指定的应用AppCode:\x20'+_0x443c68:_0x1b4da7(0x1e1)+_0x443c68;useEffect(()=>{_0x12be7c(!![]),_0x3d6a9f();},[]),useEffect(()=>{(_0x11b5b2||_0x45f04e)&&_0x39bc89();},[_0x11b5b2,_0x45f04e,_0x39bc89]);async function _0x3d6a9f(){const _0x17d905=_0x1b4da7;if(!_0x443c68){_0x1846b4(_0x17d905(0x1c8));return;}try{logger[_0x17d905(0x1b9)](process[_0x17d905(0x1c7)]()),_0x2f629c(_0x17d905(0x1df));const {configArray:_0x43b121}=await fetchModelList(_0x443c68);_0xc9c41d(_0x43b121['length']);if(_0x43b121[_0x17d905(0x1e7)]===0x0){_0x1846b4(_0x17d905(0x1b8));return;}let _0x45f1bf=_0x43b121;if(_0x1ae0d1&&_0x1ae0d1[_0x17d905(0x1e7)]>0x0){_0x45f1bf=_0x43b121['filter'](_0x2d48b8=>_0x1ae0d1[_0x17d905(0x1cb)](_0x2d48b8[_0x17d905(0x1d3)]));const _0x196df3=_0x45f1bf['map'](_0x5e21d0=>_0x5e21d0[_0x17d905(0x1d3)]),_0x17b9fb=_0x1ae0d1[_0x17d905(0x1e2)](_0x201ff1=>!_0x196df3[_0x17d905(0x1cb)](_0x201ff1));_0x17b9fb[_0x17d905(0x1e7)]>0x0&&console[_0x17d905(0x1b4)](_0x17d905(0x1e6)+_0x17b9fb[_0x17d905(0x1bd)](',\x20')+'\x1b[0m');if(_0x45f1bf['length']===0x0){_0x1846b4(_0x17d905(0x1c0)+_0x1ae0d1[_0x17d905(0x1bd)](',\x20'));return;}console[_0x17d905(0x1b4)](_0x17d905(0x1b0)+_0x43b121[_0x17d905(0x1e7)]+_0x17d905(0x1bb)+_0x45f1bf[_0x17d905(0x1e7)]+_0x17d905(0x1d6));}_0x2f629c(_0x17d905(0x1c1)+_0x45f1bf['length']+_0x17d905(0x1de));const _0x24b5df=await generateDatasetDocs(_0x45f1bf,_0x443c68,_0x1e0baf,(_0x28932c,_0x86f1f3,_0x2d7998)=>{_0x2f629c('正在生成\x20'+_0x2d7998+'.md\x20('+_0x28932c+'/'+_0x86f1f3+')');},_0x32cba5);_0xa8b5d5(_0x24b5df),_0x581ffc(!![]);const _0x22f868=_0x24b5df[_0x17d905(0x1e2)](_0x490030=>_0x490030[_0x17d905(0x1c6)])[_0x17d905(0x1e7)],_0x7d5d90=_0x24b5df[_0x17d905(0x1e2)](_0x4a48b8=>!_0x4a48b8[_0x17d905(0x1c6)])['length'];logger[_0x17d905(0x1c6)](_0x17d905(0x1e8),_0x17d905(0x1cf),undefined,{'totalCount':_0x24b5df[_0x17d905(0x1e7)],'successCount':_0x22f868,'failCount':_0x7d5d90,'outputDir':_0x1e0baf});}catch(_0x581220){const _0x4332ce=_0x581220 instanceof Error?_0x581220[_0x17d905(0x1ce)]:String(_0x581220);logger[_0x17d905(0x1d8)](_0x17d905(0x1e8),_0x17d905(0x1d4)+_0x4332ce,{'appCode':_0x443c68,'outputDir':_0x1e0baf}),_0x1846b4(_0x17d905(0x1d4)+_0x4332ce);}finally{_0x12be7c(![]);}}const _0x22a29e=_0x26c872?.[_0x1b4da7(0x1e2)](_0x3b981b=>_0x3b981b[_0x1b4da7(0x1c6)])[_0x1b4da7(0x1e7)]||0x0,_0x18df91=_0x26c872?.['filter'](_0x6ce418=>!_0x6ce418['success'])['length']||0x0;return a3_0x2db64b(Box,{'flexDirection':'column','children':[(_0x45c2a8||_0x11b5b2)&&a3_0x2db64b(Box,{'children':[a3_0x4ed38c(Text,{'color':'gray','children':'*\x20'}),a3_0x4ed38c(Text,{'color':_0x21b84b?_0x1b4da7(0x1d2):_0x1b4da7(0x1cd),'children':_0x414e2f})]}),_0x45c2a8&&a3_0x4ed38c(Box,{'children':a3_0x2db64b(Text,{'children':[_0x1b4da7(0x1d5),_0x162290,_0x1b4da7(0x1c4),_0x4c87de,')']})}),_0x11b5b2&&_0x26c872&&a3_0x2db64b(Box,{'flexDirection':_0x1b4da7(0x1e5),'children':[a3_0x4ed38c(Box,{'children':a3_0x2db64b(Text,{'color':_0x1b4da7(0x1b7),'children':[_0x1b4da7(0x1e4),_0x22a29e,'\x20个',_0x18df91>0x0&&',\x20失败\x20'+_0x18df91+'\x20个']})}),a3_0x4ed38c(Box,{'marginTop':0x1,'children':a3_0x2db64b(Text,{'color':_0x1b4da7(0x1d0),'children':[_0x1b4da7(0x1d1),_0x434500,_0x1b4da7(0x1bf)]})}),a3_0x2db64b(Box,{'marginTop':0x1,'children':[a3_0x4ed38c(Text,{'color':_0x1b4da7(0x1d0),'children':'*\x20输出目录:\x20'}),a3_0x4ed38c(Text,{'color':_0x1b4da7(0x1da),'children':_0x1e0baf})]}),_0x22a29e>0x0&&a3_0x2db64b(a3_0xc07d34,{'children':[a3_0x4ed38c(Box,{'marginTop':0x1,'children':a3_0x4ed38c(Text,{'color':_0x1b4da7(0x1d0),'children':_0x1b4da7(0x1c3)})}),_0x26c872[_0x1b4da7(0x1e2)](_0x5e6773=>_0x5e6773[_0x1b4da7(0x1c6)])['map']((_0x2a8737,_0x57671c)=>a3_0x2db64b(Box,{'marginLeft':0x2,'children':[a3_0x2db64b(Text,{'color':_0x1b4da7(0x1da),'children':['•\x20',_0x2a8737[_0x1b4da7(0x1d7)]]}),a3_0x2db64b(Text,{'color':'dim','children':[_0x1b4da7(0x1b6),_0x2a8737['datasetName']]})]},_0x57671c))]}),_0x18df91>0x0&&a3_0x2db64b(a3_0xc07d34,{'children':[a3_0x4ed38c(Box,{'marginTop':0x1,'children':a3_0x4ed38c(Text,{'color':'yellow','children':_0x1b4da7(0x1cc)})}),_0x26c872[_0x1b4da7(0x1e2)](_0x46957e=>!_0x46957e[_0x1b4da7(0x1c6)])[_0x1b4da7(0x1b2)]((_0x425dda,_0x2e94ad)=>a3_0x2db64b(Box,{'marginLeft':0x2,'flexDirection':_0x1b4da7(0x1e5),'children':[a3_0x2db64b(Text,{'color':_0x1b4da7(0x1d9),'children':['•\x20',_0x425dda['datasetName'],'\x20(',_0x425dda[_0x1b4da7(0x1d3)],')']}),_0x425dda[_0x1b4da7(0x1d8)]&&a3_0x4ed38c(Box,{'marginLeft':0x2,'children':a3_0x4ed38c(Text,{'color':_0x1b4da7(0x1cd),'children':_0x425dda[_0x1b4da7(0x1d8)]})})]},_0x2e94ad))]})]}),_0x45f04e&&a3_0x2db64b(Box,{'flexDirection':'column','children':[a3_0x4ed38c(Box,{'children':a3_0x2db64b(Text,{'color':_0x1b4da7(0x1d9),'children':['❌\x20',_0x45f04e]})}),_0x45f04e[_0x1b4da7(0x1cb)]('登录')&&a3_0x2db64b(Box,{'marginTop':0x1,'children':[a3_0x4ed38c(Text,{'color':_0x1b4da7(0x1b5),'children':'💡\x20请使用\x20'}),a3_0x4ed38c(Text,{'color':_0x1b4da7(0x1da),'children':_0x1b4da7(0x1dd)}),a3_0x4ed38c(Text,{'color':_0x1b4da7(0x1b5),'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_0x15c465=a4_0x5767;function a4_0x5767(_0x1ae36e,_0x4c87e6){_0x1ae36e=_0x1ae36e-0x82;const _0x3b4dba=a4_0x3b4d();let _0x576781=_0x3b4dba[_0x1ae36e];return _0x576781;}(function(_0x1ce184,_0x398117){const _0x1d2e1b=a4_0x5767,_0x5a549c=_0x1ce184();while(!![]){try{const _0x5b9518=-parseInt(_0x1d2e1b(0x99))/0x1+parseInt(_0x1d2e1b(0x94))/0x2*(-parseInt(_0x1d2e1b(0x95))/0x3)+-parseInt(_0x1d2e1b(0xa3))/0x4*(-parseInt(_0x1d2e1b(0x91))/0x5)+-parseInt(_0x1d2e1b(0x83))/0x6*(parseInt(_0x1d2e1b(0x87))/0x7)+parseInt(_0x1d2e1b(0xa1))/0x8*(parseInt(_0x1d2e1b(0x8f))/0x9)+parseInt(_0x1d2e1b(0xa9))/0xa+-parseInt(_0x1d2e1b(0x89))/0xb*(-parseInt(_0x1d2e1b(0x9a))/0xc);if(_0x5b9518===_0x398117)break;else _0x5a549c['push'](_0x5a549c['shift']());}catch(_0x472954){_0x5a549c['push'](_0x5a549c['shift']());}}}(a4_0x3b4d,0xa9414));import{mkdirSync,writeFileSync}from'node:fs';import a4_0x1d351f from'node:path';import{getCookie}from'../auth/get-cookie.js';import{getApiDomain}from'../constant/domain.js';import{logger}from'../utils/logger.js';function a4_0x3b4d(){const _0x148e54=['获取文档失败\x20(','api-doc','application/json','✓\x20成功生成:\x20','./docs','783UsOHLx','length','1245380YDgblL','log','生成文档失败:\x20','204rmZSGi','21636sXipzZ','),HTTP状态码:\x20','等待\x203\x20秒...\x0a','\x20个数据集需要生成文档\x0a','1342816lKinGU','27252UPmiVk',']\x20正在生成:\x20','/api/node-toolbox/api-doc-generator','markdown','utf8','name','datasetCode','74176rmguDF','✗\x20失败:\x20','16XdBmal','登录鉴权失败,登录已过期,请使用\x20lovrabet\x20auth\x20重新登录','json','响应数据格式错误\x20(','success','data','2099420hQbezh','string','3636438YzjxuM','join','.md','.md\x20(','7XCRMLD','):缺少\x20data.markdown\x20字段','6611RdTSST'];a4_0x3b4d=function(){return _0x148e54;};return a4_0x3b4d();}export async function fetchDatasetDoc(_0x128dba){const _0x1eda92=a4_0x5767,{appCode:_0x3073e9,datasetCode:_0xfef84c,datasetId:_0x1801d4,extraParams:_0x2c66d5}=_0x128dba,_0x1dd306=getApiDomain(),_0x50399c=_0x1dd306+_0x1eda92(0x9c),_0x1d4129={'appCode':_0x3073e9,'datasetCode':_0xfef84c,'datasetId':_0x1801d4,..._0x2c66d5||{}},_0x5e0c55=await fetch(_0x50399c,{'method':'POST','headers':{'Content-Type':_0x1eda92(0x8c),'Cookie':getCookie()},'body':JSON['stringify'](_0x1d4129)});if(!_0x5e0c55['ok']){if(_0x5e0c55['status']===0x191)throw new Error(_0x1eda92(0xa4));let _0x108c06='';try{_0x108c06=await _0x5e0c55['text']();}catch(_0x370709){}throw new Error(_0x1eda92(0x8a)+_0xfef84c+_0x1eda92(0x96)+_0x5e0c55['status']+(_0x108c06?'\x0a'+_0x108c06:''));}const _0x4ec8a7=await _0x5e0c55[_0x1eda92(0xa5)]();if(!_0x4ec8a7[_0x1eda92(0xa8)]||typeof _0x4ec8a7[_0x1eda92(0xa8)][_0x1eda92(0x9d)]!==_0x1eda92(0x82))throw new Error(_0x1eda92(0xa6)+_0xfef84c+_0x1eda92(0x88));return _0x4ec8a7['data'][_0x1eda92(0x9d)];}function delay(_0x4d6295){return new Promise(_0x3d2d0b=>setTimeout(_0x3d2d0b,_0x4d6295));}export async function generateDatasetDocs(_0x213759,_0x325f38,_0x480375=a4_0x15c465(0x8e),_0xf7803d,_0x2caf91){const _0x7bafc2=a4_0x15c465;mkdirSync(_0x480375,{'recursive':!![]});const _0x3ccdf4=[],_0x4b08b5=_0x213759['length'];console['log']('\x0a共有\x20'+_0x4b08b5+_0x7bafc2(0x98));for(let _0x167bdf=0x0;_0x167bdf<_0x213759[_0x7bafc2(0x90)];_0x167bdf++){const _0x5b13db=_0x213759[_0x167bdf],_0x369674=_0x167bdf+0x1,_0x23e184=_0x5b13db['tableName'];try{console[_0x7bafc2(0x92)]('['+_0x369674+'/'+_0x4b08b5+_0x7bafc2(0x9b)+_0x23e184+_0x7bafc2(0x86)+_0x5b13db[_0x7bafc2(0x9f)]+')');_0xf7803d&&_0xf7803d(_0x369674,_0x4b08b5,_0x23e184);const _0x5a3f4a=await fetchDatasetDoc({'appCode':_0x325f38,'datasetCode':_0x5b13db[_0x7bafc2(0xa0)],'datasetId':_0x5b13db['id'],'enableAI':![],'extraParams':_0x2caf91}),_0x1e27b3=a4_0x1d351f[_0x7bafc2(0x84)](_0x480375,_0x23e184+_0x7bafc2(0x85));writeFileSync(_0x1e27b3,_0x5a3f4a,{'encoding':_0x7bafc2(0x9e)}),console['log'](_0x7bafc2(0x8d)+_0x23e184+_0x7bafc2(0x85)),logger[_0x7bafc2(0xa7)](_0x7bafc2(0x8b),'生成文档成功:\x20'+_0x23e184,undefined,{'datasetCode':_0x5b13db[_0x7bafc2(0xa0)],'datasetName':_0x5b13db[_0x7bafc2(0x9f)],'filePath':_0x1e27b3,'progress':_0x369674+'/'+_0x4b08b5}),_0x3ccdf4['push']({'datasetCode':_0x5b13db[_0x7bafc2(0xa0)],'datasetName':_0x5b13db[_0x7bafc2(0x9f)],'filePath':_0x1e27b3,'success':!![]}),_0x369674<_0x4b08b5&&await delay(0x1388);}catch(_0x4b5f72){const _0x3e80b0=_0x4b5f72 instanceof Error?_0x4b5f72['message']:String(_0x4b5f72);console[_0x7bafc2(0x92)](_0x7bafc2(0xa2)+_0x23e184+'.md\x20-\x20'+_0x3e80b0+'\x0a'),logger['error'](_0x7bafc2(0x8b),_0x7bafc2(0x93)+_0x5b13db[_0x7bafc2(0xa0)],{'datasetCode':_0x5b13db[_0x7bafc2(0xa0)],'datasetName':_0x5b13db['name'],'error':_0x3e80b0,'progress':_0x369674+'/'+_0x4b08b5}),_0x3ccdf4['push']({'datasetCode':_0x5b13db[_0x7bafc2(0xa0)],'datasetName':_0x5b13db[_0x7bafc2(0x9f)],'filePath':'','success':![],'error':_0x3e80b0}),_0x369674<_0x4b08b5&&(console[_0x7bafc2(0x92)](_0x7bafc2(0x97)),await delay(0xbb8));}}return _0x3ccdf4;}
@@ -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(_0x1b7d7e,_0x4674d6){const _0x3862b9=a5_0x142e,_0x211822=_0x1b7d7e();while(!![]){try{const _0x258693=-parseInt(_0x3862b9(0xbe))/0x1+-parseInt(_0x3862b9(0xc5))/0x2*(parseInt(_0x3862b9(0xcd))/0x3)+parseInt(_0x3862b9(0xd4))/0x4+-parseInt(_0x3862b9(0xca))/0x5+parseInt(_0x3862b9(0xc9))/0x6*(parseInt(_0x3862b9(0xe5))/0x7)+parseInt(_0x3862b9(0xcf))/0x8*(parseInt(_0x3862b9(0xb8))/0x9)+-parseInt(_0x3862b9(0xbc))/0xa*(-parseInt(_0x3862b9(0xdf))/0xb);if(_0x258693===_0x4674d6)break;else _0x211822['push'](_0x211822['shift']());}catch(_0xbde454){_0x211822['push'](_0x211822['shift']());}}}(a5_0xb077,0x2ee06));import{jsx as a5_0x58f473,jsxs as a5_0x419431}from'react/jsx-runtime';import{useEffect,useState}from'react';import{Box,Text,useApp}from'ink';import{readConfig,getConfigAppCode}from'../utils/config.js';import{initEnv}from'../constant/env.js';import{generateApiFile}from'./generate-api-file.js';function a5_0x142e(_0x5a4a49,_0x56a674){_0x5a4a49=_0x5a4a49-0xb5;const _0xb07786=a5_0xb077();let _0x142efe=_0xb07786[_0x5a4a49];return _0x142efe;}function a5_0xb077(){const _0x4b2caf=['red','includes','1590hyXHQB','\x20重新登录后再试','28463icHazU','online','replace','env','api','-\x20模型配置文件\x20(','🚀\x20正在从服务器拉取\x20API\x20配置...\x20(环境:\x20','150162WfsqOD','gray','.ts','duplicateCount','18mFMyLX','1428595tYORxm','未提供应用AppCode,且配置中也没有默认值','*\x20导入方式:','15OSThJk','dim','35368tLmdQw','client','拉取\x20API\x20配置失败:\x20','split','💡\x20请使用\x20','1109972KXYlMe','!\x20原始数据集\x20','\x20个模型)','message','cyan','join','lovrabet\x20auth','import\x20','length','\x20from\x20\x27@/','modelCount','29535gtgPgi','api-pull','-client','./src/api/','white','-api','403116afYyPf','string','column','√\x20成功拉取\x20','error','yellow','{\x20lovrabetClient\x20}','\x20个模型','originalCount','slice','setLogPath','9tfcJOK','\x20-\x20客户端实例文件'];a5_0xb077=function(){return _0x4b2caf;};return a5_0xb077();}import{logger}from'../utils/logger.js';import{fetchModelList}from'./fetch-model-list.js';export const ApiPullUI=({appCode:_0x596a2b,env:_0x1ba2a8,output:_0x1e5c84})=>{const _0x4f3ba5=a5_0x142e,{exit:_0x433605}=useApp(),[_0xf08c84,_0x14a052]=useState(![]),[_0xdf5aae,_0x5d8491]=useState(![]),[_0x33d5,_0x4189df]=useState(null),[_0x40bfc4,_0x4ec05e]=useState(null),_0x5ce478=readConfig(),_0x23d71b=getConfigAppCode(),_0xac74b3=_0x596a2b||_0x23d71b,_0x553c99=typeof _0x5ce478?.[_0x4f3ba5(0xc1)]===_0x4f3ba5(0xe6)?_0x5ce478[_0x4f3ba5(0xc1)]:undefined,_0xc20ceb=_0x1ba2a8||_0x553c99||_0x4f3ba5(0xbf);initEnv(_0xc20ceb);const _0x1f8c61=_0x1e5c84||_0x4f3ba5(0xe2),_0x515008=_0x596a2b&&_0x596a2b[_0x4f3ba5(0xbb)]('-')?_0x596a2b[_0x4f3ba5(0xd2)]('-')[_0x4f3ba5(0xb6)](0x1)[_0x4f3ba5(0xd9)]('-'):'',_0x3f8985=_0x596a2b?'使用指定的应用AppCode:\x20'+_0xac74b3:'使用配置的应用AppCode:\x20'+_0xac74b3,_0x41a839=_0x515008?_0x515008+_0x4f3ba5(0xe4):_0x4f3ba5(0xc2),_0x35d406=_0x515008?_0x515008+_0x4f3ba5(0xe1):_0x4f3ba5(0xd0);useEffect(()=>{_0x14a052(!![]),_0x3aa594();},[]),useEffect(()=>{(_0xdf5aae||_0x33d5)&&_0x433605();},[_0xdf5aae,_0x33d5,_0x433605]);async function _0x3aa594(){const _0x4b1433=_0x4f3ba5;if(!_0xac74b3){_0x4189df(_0x4b1433(0xcb));return;}try{logger[_0x4b1433(0xb7)](process['cwd']());const {configArray:_0x464732}=await fetchModelList(_0xac74b3),_0x86de39=_0x464732[_0x4b1433(0xdc)],_0x4a7992=!_0x596a2b,_0x5ce5b3=await generateApiFile(_0x464732,_0x515008,_0xac74b3,_0x4a7992,_0xc20ceb,_0x1f8c61),_0x5f4532=_0x1f8c61['endsWith']('/')?_0x1f8c61:_0x1f8c61+'/';_0x4ec05e({'api':''+_0x5f4532+_0x41a839+_0x4b1433(0xc7),'client':''+_0x5f4532+_0x35d406+_0x4b1433(0xc7),'modelCount':_0x5ce5b3[_0x4b1433(0xde)],'datasetCount':_0x86de39,'originalCount':_0x86de39,'duplicateCount':0x0}),_0x5d8491(!![]);}catch(_0x105fdd){const _0x190f30=_0x105fdd instanceof Error?_0x105fdd[_0x4b1433(0xd7)]:String(_0x105fdd);logger[_0x4b1433(0xe9)](_0x4b1433(0xe0),'拉取\x20API\x20配置失败:\x20'+_0x190f30,{'appCode':_0xac74b3,'error':_0x190f30}),_0x4189df(_0x4b1433(0xd1)+_0x190f30);}finally{_0x14a052(![]);}}return a5_0x419431(Box,{'flexDirection':_0x4f3ba5(0xe7),'children':[(_0xf08c84||_0xdf5aae)&&a5_0x419431(Box,{'children':[a5_0x58f473(Text,{'color':'gray','children':'*\x20'}),a5_0x58f473(Text,{'color':_0x596a2b?_0x4f3ba5(0xe3):_0x4f3ba5(0xce),'children':_0x3f8985})]}),_0xf08c84&&a5_0x58f473(Box,{'children':a5_0x419431(Text,{'children':[_0x4f3ba5(0xc4),_0xc20ceb,')']})}),_0xdf5aae&&_0x40bfc4&&a5_0x419431(Box,{'flexDirection':'column','children':[a5_0x58f473(Box,{'children':a5_0x419431(Text,{'color':'green','children':[_0x4f3ba5(0xe8),_0x40bfc4['datasetCount'],'\x20个数据集,生成','\x20',_0x40bfc4[_0x4f3ba5(0xde)],_0x4f3ba5(0xec)]})}),_0x40bfc4[_0x4f3ba5(0xc8)]>0x0&&a5_0x58f473(Box,{'marginTop':0x1,'children':a5_0x419431(Text,{'color':_0x4f3ba5(0xea),'children':[_0x4f3ba5(0xd5),_0x40bfc4[_0x4f3ba5(0xb5)],'\x20个,过滤重复','\x20',_0x40bfc4[_0x4f3ba5(0xc8)],'\x20个']})}),a5_0x58f473(Box,{'marginTop':0x1,'children':a5_0x58f473(Text,{'color':_0x4f3ba5(0xc6),'children':'*\x20已生成文件:'})}),a5_0x419431(Box,{'marginLeft':0x2,'children':[a5_0x419431(Text,{'color':_0x4f3ba5(0xd8),'children':['•\x20',_0x40bfc4[_0x4f3ba5(0xc2)]]}),a5_0x419431(Text,{'color':_0x4f3ba5(0xce),'children':['\x20',_0x4f3ba5(0xc3),_0x40bfc4[_0x4f3ba5(0xde)],_0x4f3ba5(0xd6)]})]}),a5_0x419431(Box,{'marginLeft':0x2,'children':[a5_0x419431(Text,{'color':'cyan','children':['•\x20',_0x40bfc4['client']]}),a5_0x58f473(Text,{'color':_0x4f3ba5(0xce),'children':_0x4f3ba5(0xb9)})]}),a5_0x58f473(Box,{'marginTop':0x1,'children':a5_0x58f473(Text,{'color':'gray','children':_0x4f3ba5(0xcc)})}),a5_0x58f473(Box,{'marginLeft':0x2,'children':a5_0x419431(Text,{'color':_0x4f3ba5(0xea),'children':[_0x4f3ba5(0xdb),_0x4f3ba5(0xeb),_0x4f3ba5(0xdd),_0x40bfc4['client'][_0x4f3ba5(0xc0)](/^\.\//,'')[_0x4f3ba5(0xc0)](_0x4f3ba5(0xc7),''),'\x27']})})]}),_0x33d5&&a5_0x419431(Box,{'flexDirection':'column','children':[a5_0x58f473(Box,{'children':a5_0x419431(Text,{'color':_0x4f3ba5(0xba),'children':['❌\x20',_0x33d5]})}),_0x33d5[_0x4f3ba5(0xbb)]('登录')&&a5_0x419431(Box,{'marginTop':0x1,'children':[a5_0x58f473(Text,{'color':'yellow','children':_0x4f3ba5(0xd3)}),a5_0x58f473(Text,{'color':'cyan','children':_0x4f3ba5(0xda)}),a5_0x58f473(Text,{'color':_0x4f3ba5(0xea),'children':_0x4f3ba5(0xbd)})]})]})]});};
@@ -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 a6_0x1b30(_0x1c146c,_0x257ac9){_0x1c146c=_0x1c146c-0x1e7;const _0x4ba9bc=a6_0x4ba9();let _0x1b3030=_0x4ba9bc[_0x1c146c];return _0x1b3030;}function a6_0x4ba9(){const _0xa3feb9=['获取数据集失败:\x20','count','configArray','/api/node-toolbox/dataset/model-list?appcode=','获取数据集失败,HTTP状态码:\x20','message','data','登录鉴权失败,登录已过期,请使用\x20lovrabet\x20auth\x20重新登录','89314sraaXg','736232OCGdCI','&otype=array','status','6RTtEWf','json','正在从服务器拉取模型列表...\x20(环境:\x20','32858kzEzOh','2772570SPyJJR','7MSAIrr','1254516PwgxtP','2728413zUGgKY','success','9907770HnVMNM','48gOSQWG'];a6_0x4ba9=function(){return _0xa3feb9;};return a6_0x4ba9();}(function(_0x2d54e8,_0x3553d5){const _0x15d530=a6_0x1b30,_0x572ee2=_0x2d54e8();while(!![]){try{const _0x248bc0=parseInt(_0x15d530(0x1f0))/0x1*(parseInt(_0x15d530(0x1e7))/0x2)+-parseInt(_0x15d530(0x1eb))/0x3*(-parseInt(_0x15d530(0x1e8))/0x4)+parseInt(_0x15d530(0x1ef))/0x5+-parseInt(_0x15d530(0x1f1))/0x6+-parseInt(_0x15d530(0x1ee))/0x7*(parseInt(_0x15d530(0x1f5))/0x8)+parseInt(_0x15d530(0x1f2))/0x9+-parseInt(_0x15d530(0x1f4))/0xa;if(_0x248bc0===_0x3553d5)break;else _0x572ee2['push'](_0x572ee2['shift']());}catch(_0x3a73bb){_0x572ee2['push'](_0x572ee2['shift']());}}}(a6_0x4ba9,0x4bc57));import{getCookie}from'../auth/get-cookie.js';import{getApiDomain}from'../constant/domain.js';import{logger}from'../utils/logger.js';import{getEnv}from'../constant/env.js';export async function fetchModelList(_0x37f005){const _0x312348=a6_0x1b30,_0xf9b3ec=getEnv(),_0x57812f=getApiDomain()+_0x312348(0x1f9)+_0x37f005+_0x312348(0x1e9);logger['info']('fetch-model-list',_0x312348(0x1ed)+_0xf9b3ec+')',{'apiUrl':_0x57812f});const _0xe7c057=await fetch(_0x57812f,{'headers':{'Cookie':getCookie()}});if(!_0xe7c057['ok']){if(_0xe7c057[_0x312348(0x1ea)]===0x191)throw new Error(_0x312348(0x1fd));throw new Error(_0x312348(0x1fa)+_0xe7c057['status']);}const _0x189ac7=await _0xe7c057[_0x312348(0x1ec)]();if(!_0x189ac7[_0x312348(0x1f3)])throw new Error(_0x312348(0x1f6)+(_0x189ac7[_0x312348(0x1fb)]||'未知错误'));return{'configArray':_0x189ac7['data'][_0x312348(0x1f8)],'count':_0x189ac7[_0x312348(0x1fc)][_0x312348(0x1f7)]};}
@@ -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
+ function a7_0x30cb(_0x259aa5,_0x5922ee){_0x259aa5=_0x259aa5-0x190;const _0x4b5372=a7_0x4b53();let _0x30cb50=_0x4b5372[_0x259aa5];return _0x30cb50;}const a7_0x2a63e1=a7_0x30cb;(function(_0x4fb53d,_0x1484be){const _0x4253ac=a7_0x30cb,_0x4063c4=_0x4fb53d();while(!![]){try{const _0x21193d=-parseInt(_0x4253ac(0x1a2))/0x1*(parseInt(_0x4253ac(0x194))/0x2)+-parseInt(_0x4253ac(0x1b5))/0x3*(parseInt(_0x4253ac(0x196))/0x4)+-parseInt(_0x4253ac(0x1ad))/0x5+parseInt(_0x4253ac(0x193))/0x6+parseInt(_0x4253ac(0x1a4))/0x7*(-parseInt(_0x4253ac(0x19d))/0x8)+parseInt(_0x4253ac(0x19c))/0x9*(-parseInt(_0x4253ac(0x199))/0xa)+-parseInt(_0x4253ac(0x1af))/0xb*(-parseInt(_0x4253ac(0x1ab))/0xc);if(_0x21193d===_0x1484be)break;else _0x4063c4['push'](_0x4063c4['shift']());}catch(_0x462b0c){_0x4063c4['push'](_0x4063c4['shift']());}}}(a7_0x4b53,0x62e8c));import a7_0x42cd34 from'prettier';import{mkdirSync,writeFileSync,readFileSync}from'node:fs';import a7_0x4e08ad from'node:path';import{fileURLToPath}from'node:url';import{readConfig}from'../utils/config.js';function a7_0x4b53(){const _0x55eb3a=['请先通过\x20`lovrabet\x20config\x20set\x20app\x20<value>`\x20配置应用\x20Code','typescript','31825632UxvUom','init-api','2887660JJvNsw','endsWith','11RJhZTh','.ts','replaceApiContent','format','join','-client','21Mtxbav','api.ts.tpl','online','keys','length','./src/api/','utf8','tableName','1581312RPQIJX','9610jeEiHd','name','349688UWHcjE','../..','env','30fLDkSx',',\x20env:\x20\x22','API\x20文件生成成功!','1190817ikPTho','879808hLTvwu','templates/generate-api','dirname','{\x20apiConfigName:\x20','success','55SdExOe','{\x20apiConfigName:\x20\x22','42KqvEpu','client.ts.tpl','slice','key','string'];a7_0x4b53=function(){return _0x55eb3a;};return a7_0x4b53();}import{TemplateReplacer}from'../utils/template-replacer.js';import{logger}from'../utils/logger.js';export async function generateApiFile(_0x35c65e,_0x1f30cc='',_0x5ec396,_0x2db426=![],_0x5cfe2e,_0x10143b=a7_0x2a63e1(0x190)){const _0x226a05=a7_0x2a63e1,_0x2e97d6=readConfig(),_0x49dd01=_0x5ec396||_0x2e97d6?.['app'];if(typeof _0x49dd01!==_0x226a05(0x1a8)||!_0x49dd01)throw new Error(_0x226a05(0x1a9));const _0x2b3153=_0x2db426?'CONFIG_NAMES.DEFAULT':'\x22'+_0x49dd01+'\x22',_0x5c7e73=typeof _0x2e97d6[_0x226a05(0x198)]===_0x226a05(0x1a8)?_0x2e97d6['env']:undefined,_0x2b0020=_0x5cfe2e||_0x5c7e73||_0x226a05(0x1b7),_0x148381=_0x2b0020!=='online';let _0x16672e;if(_0x2db426)_0x148381?_0x16672e=_0x226a05(0x1a0)+_0x2b3153+_0x226a05(0x19a)+_0x2b0020+'\x22\x20}':_0x16672e='';else{const _0x1a53dc=_0x148381?',\x20env:\x20\x22'+_0x2b0020+'\x22':'';_0x16672e=_0x226a05(0x1a3)+_0x49dd01+'\x22'+_0x1a53dc+'\x20}';}const _0x150f55=_0x1f30cc?_0x1f30cc+'-api':'api',_0x294634=_0x1f30cc?_0x1f30cc+_0x226a05(0x1b4):'client',_0x5bcfed={};_0x35c65e['forEach'](_0x376a0a=>{const _0x18699c=_0x226a05;_0x5bcfed[_0x376a0a[_0x18699c(0x1a7)]]={'tableName':_0x376a0a[_0x18699c(0x192)],'datasetCode':_0x376a0a['datasetCode'],'name':_0x376a0a[_0x18699c(0x195)]||''};});const _0x5d3342=fileURLToPath(import.meta.url),_0xcebdd=a7_0x4e08ad['resolve'](a7_0x4e08ad[_0x226a05(0x19f)](_0x5d3342),_0x226a05(0x197)),_0xc58b30=a7_0x4e08ad[_0x226a05(0x1b3)](_0xcebdd,_0x226a05(0x19e)),_0x19da95=a7_0x4e08ad['join'](_0xc58b30,_0x226a05(0x1b6)),_0x131929=a7_0x4e08ad[_0x226a05(0x1b3)](_0xc58b30,_0x226a05(0x1a5)),_0x2922c2=_0x10143b[_0x226a05(0x1ae)]('/')?_0x10143b[_0x226a05(0x1a6)](0x0,-0x1):_0x10143b;mkdirSync(_0x2922c2,{'recursive':!![]});const _0x4d1502=readFileSync(_0x19da95,_0x226a05(0x191)),_0x4dbf90=TemplateReplacer[_0x226a05(0x1b1)](_0x4d1502,_0x49dd01,_0x5bcfed,Object['keys'](_0x5bcfed)[0x0],_0x150f55,_0x2b3153),_0x526f25=await a7_0x42cd34['format'](_0x4dbf90,{'parser':'typescript'}),_0x25eefa=_0x2922c2+'/'+_0x150f55+_0x226a05(0x1b0);writeFileSync(_0x25eefa,_0x526f25,{'encoding':_0x226a05(0x191)});const _0x496de6=readFileSync(_0x131929,'utf8'),_0x523e39=TemplateReplacer[_0x226a05(0x1b1)](_0x496de6,_0x49dd01,_0x5bcfed,Object[_0x226a05(0x1b8)](_0x5bcfed)[0x0],_0x150f55,_0x2b3153,_0x16672e),_0x1eb0ec=await a7_0x42cd34[_0x226a05(0x1b2)](_0x523e39,{'parser':_0x226a05(0x1aa)}),_0x45968c=_0x2922c2+'/'+_0x294634+_0x226a05(0x1b0);writeFileSync(_0x45968c,_0x1eb0ec,{'encoding':_0x226a05(0x191)});const _0x21c869=Object[_0x226a05(0x1b8)](_0x5bcfed)[_0x226a05(0x1b9)];return logger[_0x226a05(0x1a1)](_0x226a05(0x1ac),_0x226a05(0x19b),undefined,{'apiFile':_0x25eefa,'clientFile':_0x45968c,'modelCount':_0x21c869,'configName':_0x2b3153}),{'modelCount':_0x21c869,'apiFilePath':_0x25eefa,'clientFilePath':_0x45968c,'configName':_0x2b3153};}
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 a8_0x3556(){const _0x2ce818=['parse','❌\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配置文件','\x20\x20lovrabet\x20api\x20pull\x20--output\x20<dir>\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定输出目录(默认:\x20./src/api/)','trim','204zfgjTD','exit','×\x20--datasetcode\x20参数不能为空','filter','\x20\x20\x201.\x20配置默认值:\x20lovrabet\x20config\x20set\x20appcode\x20<app-code>','4757084tqwSMk','input','split','28397ILhCTD','\x20\x20lovrabet\x20api\x20pull\x20--env\x20<env>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定环境(如:\x20daily,\x20online)','log','\x20\x20错误:\x20','\x1b[90m*\x20使用配置的应用AppCode:\x20','error','50LjKPEx','length','\x1b[90m*\x20仅生成指定数据集的文档:\x20','pull','×\x20未配置\x20AppCode','Available\x20commands:','map','message','appcode','681570jmIxSy','\x1b[0m','88475TMVmXc','\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请使用以下方式之一:','string','\x20\x20lovrabet\x20api\x20doc\x20--output\x20<dir>\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定文档输出目录(默认:\x20./docs)','请使用\x20--appcode\x20参数,例如:','env','isArray','\x20\x20lovrabet\x20api\x20doc\x20--appcode\x20<code>\x20\x20\x20\x20\x20\x20\x20//\x20使用指定的\x20appcode','10352768ULXwFo','5741141jVRtcK','×\x20--params\x20参数必须是一个有效的\x20JSON\x20对象','9363510zTxtCB','help','datasetcode','params','\x20\x20lovrabet\x20api\x20pull\x20--appcode\x20','\x20\x20lovrabet\x20api\x20doc\x20--appcode\x20','\x1b[90m\x20\x20(注:\x20--appcode\x20参数与配置一致,将使用默认配置)\x1b[0m','join','flags'];a8_0x3556=function(){return _0x2ce818;};return a8_0x3556();}(function(_0x47c2d3,_0x4a78b3){const _0xefbb88=a8_0x57ae,_0x18bf37=_0x47c2d3();while(!![]){try{const _0x5b6430=-parseInt(_0xefbb88(0xb4))/0x1*(parseInt(_0xefbb88(0x87))/0x2)+-parseInt(_0xefbb88(0x90))/0x3+parseInt(_0xefbb88(0xb1))/0x4+-parseInt(_0xefbb88(0x92))/0x5*(parseInt(_0xefbb88(0xac))/0x6)+parseInt(_0xefbb88(0x9c))/0x7+parseInt(_0xefbb88(0x9b))/0x8+-parseInt(_0xefbb88(0x9e))/0x9;if(_0x5b6430===_0x4a78b3)break;else _0x18bf37['push'](_0x18bf37['shift']());}catch(_0x54f109){_0x18bf37['push'](_0x18bf37['shift']());}}}(a8_0x3556,0xb0dab));import{jsx as a8_0x3e7f9c}from'react/jsx-runtime';import{render}from'ink';import{ApiPullUI}from'./api-pull-ui.js';import{ApiDocUI}from'./api-doc-ui.js';function a8_0x57ae(_0x282b3b,_0x398c1f){_0x282b3b=_0x282b3b-0x87;const _0x3556cf=a8_0x3556();let _0x57ae74=_0x3556cf[_0x282b3b];return _0x57ae74;}import{getConfigAppCode}from'../utils/config.js';export async function apiCli(_0x1f4819){const _0x41b9f3=a8_0x57ae,_0x5076eb=_0x1f4819[_0x41b9f3(0xb2)][0x1];if(_0x1f4819[_0x41b9f3(0xa6)][_0x41b9f3(0x9f)]){console[_0x41b9f3(0xb6)](_0x41b9f3(0x93));return;}if(_0x5076eb===_0x41b9f3(0x8a)){_0x1f4819['input'][0x2]&&(console[_0x41b9f3(0xb9)](_0x41b9f3(0xa8)),console['log'](_0x41b9f3(0x97)),console[_0x41b9f3(0xb6)](_0x41b9f3(0xa2)+_0x1f4819[_0x41b9f3(0xb2)][0x2]),process[_0x41b9f3(0xad)](0x1));const _0x40a9ac=getConfigAppCode();let _0x3d4bd1=_0x1f4819['flags'][_0x41b9f3(0x8f)];const _0x19014a=typeof _0x1f4819[_0x41b9f3(0xa6)][_0x41b9f3(0x98)]===_0x41b9f3(0x95)?_0x1f4819[_0x41b9f3(0xa6)]['env']:undefined,_0x36b44a=_0x1f4819['flags']['output'];!_0x3d4bd1&&!_0x40a9ac&&(console[_0x41b9f3(0xb9)](_0x41b9f3(0x8b)),console[_0x41b9f3(0xb6)](_0x41b9f3(0x94)),console['log'](_0x41b9f3(0xb0)),console[_0x41b9f3(0xb6)]('\x20\x20\x202.\x20使用参数:\x20lovrabet\x20api\x20pull\x20--appcode\x20<app-code>'),process['exit'](0x1)),_0x3d4bd1&&_0x40a9ac&&_0x3d4bd1===_0x40a9ac&&(console[_0x41b9f3(0xb6)](_0x41b9f3(0xb8)+_0x3d4bd1+_0x41b9f3(0x91)),console[_0x41b9f3(0xb6)](_0x41b9f3(0xa4)),_0x3d4bd1=undefined),render(a8_0x3e7f9c(ApiPullUI,{'appCode':_0x3d4bd1,'env':_0x19014a,'output':_0x36b44a}));}else{if(_0x5076eb==='doc'){_0x1f4819[_0x41b9f3(0xb2)][0x2]&&(console[_0x41b9f3(0xb9)](_0x41b9f3(0xa8)),console['log'](_0x41b9f3(0x97)),console['log'](_0x41b9f3(0xa3)+_0x1f4819[_0x41b9f3(0xb2)][0x2]),process['exit'](0x1));const _0x2f8445=getConfigAppCode();let _0x5bb971=_0x1f4819['flags'][_0x41b9f3(0x8f)];const _0x5acfe9=typeof _0x1f4819['flags'][_0x41b9f3(0x98)]===_0x41b9f3(0x95)?_0x1f4819[_0x41b9f3(0xa6)][_0x41b9f3(0x98)]:undefined,_0x47fef3=_0x1f4819[_0x41b9f3(0xa6)]['output'],_0x39d0a8=_0x1f4819[_0x41b9f3(0xa6)][_0x41b9f3(0xa1)],_0x3bdb8b=_0x1f4819[_0x41b9f3(0xa6)][_0x41b9f3(0xa0)];!_0x5bb971&&!_0x2f8445&&(console['error'](_0x41b9f3(0x8b)),console[_0x41b9f3(0xb6)](_0x41b9f3(0x94)),console[_0x41b9f3(0xb6)]('\x20\x20\x201.\x20配置默认值:\x20lovrabet\x20config\x20set\x20appcode\x20<app-code>'),console[_0x41b9f3(0xb6)]('\x20\x20\x202.\x20使用参数:\x20lovrabet\x20api\x20doc\x20--appcode\x20<app-code>'),process['exit'](0x1));_0x5bb971&&_0x2f8445&&_0x5bb971===_0x2f8445&&(console[_0x41b9f3(0xb6)](_0x41b9f3(0xb8)+_0x5bb971+_0x41b9f3(0x91)),_0x5bb971=undefined);let _0x4cfaf2;if(_0x39d0a8)try{_0x4cfaf2=JSON[_0x41b9f3(0xa7)](_0x39d0a8),(typeof _0x4cfaf2!=='object'||_0x4cfaf2===null||Array[_0x41b9f3(0x99)](_0x4cfaf2))&&(console[_0x41b9f3(0xb9)](_0x41b9f3(0x9d)),process[_0x41b9f3(0xad)](0x1));}catch(_0x3c4455){console[_0x41b9f3(0xb9)]('×\x20--params\x20参数不是有效的\x20JSON\x20格式'),console[_0x41b9f3(0xb9)](_0x41b9f3(0xb7)+(_0x3c4455 instanceof Error?_0x3c4455[_0x41b9f3(0x8e)]:String(_0x3c4455))),process[_0x41b9f3(0xad)](0x1);}let _0x2bf24d;_0x3bdb8b&&(_0x2bf24d=_0x3bdb8b[_0x41b9f3(0xb3)](',')[_0x41b9f3(0x8d)](_0x5cbf7d=>_0x5cbf7d[_0x41b9f3(0xab)]())[_0x41b9f3(0xaf)](_0x523d30=>_0x523d30[_0x41b9f3(0x88)]>0x0),_0x2bf24d[_0x41b9f3(0x88)]===0x0&&(console[_0x41b9f3(0xb9)](_0x41b9f3(0xae)),process['exit'](0x1)),console[_0x41b9f3(0xb6)](_0x41b9f3(0x89)+_0x2bf24d[_0x41b9f3(0xa5)](',\x20')+'\x1b[0m')),render(a8_0x3e7f9c(ApiDocUI,{'appCode':_0x5bb971,'env':_0x5acfe9,'output':_0x47fef3,'extraParams':_0x4cfaf2,'datasetCodes':_0x2bf24d}));}else console['error']('Unknown\x20api\x20command:\x20'+_0x5076eb),console[_0x41b9f3(0xb6)](_0x41b9f3(0x8c)),console[_0x41b9f3(0xb6)](_0x41b9f3(0xa9)),console[_0x41b9f3(0xb6)]('\x20\x20lovrabet\x20api\x20pull\x20--appcode\x20<code>\x20\x20\x20\x20\x20\x20//\x20使用指定的\x20appcode'),console['log'](_0x41b9f3(0xaa)),console[_0x41b9f3(0xb6)](_0x41b9f3(0xb5)),console[_0x41b9f3(0xb6)](''),console['log']('\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[_0x41b9f3(0xb6)](_0x41b9f3(0x9a)),console[_0x41b9f3(0xb6)](_0x41b9f3(0x96)),console[_0x41b9f3(0xb6)]('\x20\x20lovrabet\x20api\x20doc\x20--env\x20<env>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定环境(如:\x20daily,\x20online)'),process[_0x41b9f3(0xad)](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(_0x50a799,_0x1d1fb1){const _0x39ae89=a9_0x3381,_0x5cb1b8=_0x50a799();while(!![]){try{const _0x4114e1=parseInt(_0x39ae89(0xa1))/0x1*(parseInt(_0x39ae89(0xb4))/0x2)+parseInt(_0x39ae89(0xbd))/0x3*(-parseInt(_0x39ae89(0xb3))/0x4)+parseInt(_0x39ae89(0xa7))/0x5*(-parseInt(_0x39ae89(0x9f))/0x6)+parseInt(_0x39ae89(0xa9))/0x7+-parseInt(_0x39ae89(0xc1))/0x8*(parseInt(_0x39ae89(0xb1))/0x9)+parseInt(_0x39ae89(0xaf))/0xa+parseInt(_0x39ae89(0xbf))/0xb*(parseInt(_0x39ae89(0xa5))/0xc);if(_0x4114e1===_0x1d1fb1)break;else _0x5cb1b8['push'](_0x5cb1b8['shift']());}catch(_0xfdea77){_0x5cb1b8['push'](_0x5cb1b8['shift']());}}}(a9_0x47e9,0xb25b9));function a9_0x3381(_0x12ffb2,_0x226792){_0x12ffb2=_0x12ffb2-0x99;const _0x47e96d=a9_0x47e9();let _0x3381f1=_0x47e96d[_0x12ffb2];return _0x3381f1;}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';function a9_0x47e9(){const _0x2458d9=['client','15696UbbQGq','\x20\x20\x20•\x20','5972eZztuV','142VScFxh','√\x20成功拉取\x20','\x20个模型','.ts\x20-\x20客户端实例文件','×\x20文件前缀格式不正确。只能包含字母、数字、连字符和下划线,且必须以字母开头。','create-api-pull','.ts\x20-\x20模型配置文件','error','chdir','2460FXbeHp','info','22qwUzvh','*\x20正在从服务器拉取\x20API\x20配置...\x20(环境:\x20','432gjHcMG','-client','string','modelCount','cwd','api','API\x20配置拉取异常:\x20','log','9408rlycxZ','API\x20配置拉取成功:\x20','5722rtTLCT','env','\x20个数据集,生成\x20','message','4229688epoyDI','test','1390dYnEXX','*\x20开始生成\x20API\x20配置文件:','8943921wWhwPp','online','\x20个数据集...','*\x20正在处理\x20','trim','length','959800AxUzvU'];a9_0x47e9=function(){return _0x2458d9;};return a9_0x47e9();}export async function pullApiSilent(_0x4d4e43,_0x74e5db,_0x2885ee,_0xe9e828){const _0x1a23c9=a9_0x3381;let _0x3f5ab3;try{const _0x213b53=_0x74e5db?.[_0x1a23c9(0xad)]()||'';if(_0x213b53){const _0x3e4272=/^[a-zA-Z][a-zA-Z0-9_-]*$/;if(!_0x3e4272[_0x1a23c9(0xa6)](_0x213b53))return console[_0x1a23c9(0xbb)](_0x1a23c9(0xb8)),![];}_0x2885ee&&(_0x3f5ab3=process[_0x1a23c9(0x9b)](),process['chdir'](_0x2885ee));const _0x35dd1a=readConfig(),_0x337cad=typeof _0x35dd1a[_0x1a23c9(0xa2)]===_0x1a23c9(0x99)?_0x35dd1a[_0x1a23c9(0xa2)]:undefined,_0x4bdc5d=_0xe9e828||_0x337cad||_0x1a23c9(0xaa);initEnv(_0x4bdc5d),console['log'](_0x1a23c9(0xc0)+_0x4bdc5d+')');const {configArray:_0x227e72}=await fetchModelList(_0x4d4e43),_0xed1b5b=_0x213b53?_0x213b53+'-api':_0x1a23c9(0x9c),_0x22a9cd=_0x213b53?_0x213b53+_0x1a23c9(0xc2):_0x1a23c9(0xb0);console[_0x1a23c9(0x9e)](_0x1a23c9(0xa8)),console[_0x1a23c9(0x9e)](_0x1a23c9(0xb2)+_0xed1b5b+_0x1a23c9(0xba)),console[_0x1a23c9(0x9e)](_0x1a23c9(0xb2)+_0x22a9cd+_0x1a23c9(0xb7)),console[_0x1a23c9(0x9e)](_0x1a23c9(0xac)+_0x227e72[_0x1a23c9(0xae)]+_0x1a23c9(0xab));const _0x14812a=await generateApiFile(_0x227e72,_0x213b53,_0x4d4e43,!![],_0x4bdc5d);return console[_0x1a23c9(0x9e)](_0x1a23c9(0xb5)+_0x227e72[_0x1a23c9(0xae)]+_0x1a23c9(0xa3)+_0x14812a[_0x1a23c9(0x9a)]+_0x1a23c9(0xb6)),_0x2885ee&&logger[_0x1a23c9(0xbe)](_0x1a23c9(0xb9),_0x1a23c9(0xa0)+_0x4d4e43,{'projectPath':_0x2885ee,'appCode':_0x4d4e43,'datasetCount':_0x227e72[_0x1a23c9(0xae)],'filePrefix':_0x213b53}),!![];}catch(_0x5a6da7){const _0x32a74f=_0x5a6da7 instanceof Error?_0x5a6da7[_0x1a23c9(0xa4)]:String(_0x5a6da7);return console['error']('×\x20API\x20配置拉取异常:',_0x32a74f),_0x2885ee&&logger['error'](_0x1a23c9(0xb9),_0x1a23c9(0x9d)+_0x32a74f,{'appCode':_0x4d4e43,'projectPath':_0x2885ee}),![];}finally{_0x3f5ab3&&process[_0x1a23c9(0xbc)](_0x3f5ab3);}}
@@ -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
+ (function(_0x256ad8,_0x422855){const _0x461ae1=a10_0x2f18,_0x39c0e5=_0x256ad8();while(!![]){try{const _0x494cca=parseInt(_0x461ae1(0x122))/0x1+parseInt(_0x461ae1(0x13e))/0x2*(parseInt(_0x461ae1(0x139))/0x3)+parseInt(_0x461ae1(0x147))/0x4*(parseInt(_0x461ae1(0x10c))/0x5)+parseInt(_0x461ae1(0x107))/0x6+-parseInt(_0x461ae1(0x106))/0x7+-parseInt(_0x461ae1(0x10b))/0x8+parseInt(_0x461ae1(0x111))/0x9*(parseInt(_0x461ae1(0x12d))/0xa);if(_0x494cca===_0x422855)break;else _0x39c0e5['push'](_0x39c0e5['shift']());}catch(_0x167bf3){_0x39c0e5['push'](_0x39c0e5['shift']());}}}(a10_0x4cc7,0x9f518));import{jsx as a10_0x185bf1,jsxs as a10_0x16ebf0,Fragment as a10_0x14fa26}from'react/jsx-runtime';import{Text,Box,useInput,useApp,render}from'ink';function a10_0x4cc7(){const _0x372cbc=['↑/↓:\x20移动光标\x20空格:\x20切换选中\x20a:\x20全选\x20i/r:\x20反选\x20Enter:\x20确认','cyan','请输入有效的\x20JS\x20https\x20链接','lovrabet\x20auth','length','max','return','441124DZdqbT','delete','\x20←\x20','5269208MwPKDF','4311432Hwertj','*\x20正在创建菜单...','已选择菜单','green','3295680nrfpGR','15FtAbQT','online','message','has','*\x20CSS\x20链接:\x20','9hcYdHO','includes','done','path','creating','CSS\x20链接无法访问','test','dots','*\x20请选择要同步的菜单:','\x20正在获取线上菜单列表...','JS\x20链接无法访问','Lovrabet平台','yellow','创建菜单失败','gray','red','slice','684588doGqxf','filter','map','fill','add','input-css','trim','\x20输入项目的\x20JS\x20资源链接(https://...)','size','backspace','local','91190LjeneQ','downArrow','JS\x20链接','column','then','√\x20菜单创建完成','提示:使用\x20','菜单名称','white','value','[✓]','!\x20未找到本地页面,请先创建页面','22245JXzsSp','*\x20JS\x20链接:\x20','input-js','label','join','20cwlGGE','selecting'];a10_0x4cc7=function(){return _0x372cbc;};return a10_0x4cc7();}import{useEffect,useState}from'react';import a10_0x33f11e 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';function a10_0x2f18(_0x3135ab,_0xeda0f8){_0x3135ab=_0x3135ab-0x106;const _0x4cc7e2=a10_0x4cc7();let _0x2f18c6=_0x4cc7e2[_0x3135ab];return _0x2f18c6;}import.meta.main&&render(a10_0x185bf1(AppMenuSyncUI,{}));export function AppMenuSyncUI(){const _0x246484=a10_0x2f18,{exit:_0x33b01d}=useApp(),{loading:_0x238458,menuList:_0x62bbfb,error:_0x33bae4}=useGetOnlineMenuList(),_0x4049bd=getLocalPages(),_0x1b175e=_0x62bbfb[_0x246484(0x124)](_0x567bfa=>_0x567bfa[_0x246484(0x114)]),_0x53f6f6=[_0x246484(0x134),..._0x4049bd['map'](_0x2d4bc9=>_0x2d4bc9['label'])],_0x214302=getStringWidth(getMaxWidth(_0x53f6f6,0x4)),_0x4623a2=getStringWidth(getMaxWidth([_0x246484(0x134)])),[_0xa9c231,_0x571736]=useState(_0x246484(0x13f)),[_0x476427,_0xe90cfd]=useState(new Set()),[_0x18baea,_0x3bbbdb]=useState(0x0),[_0x58d1e5,_0xee5f1a]=useState(''),[_0x12f2a4,_0x4687c5]=useState(''),[_0x1d41d9,_0x44ccb9]=useState(''),[_0x3b1757,_0x1d05ce]=useState(''),[_0x4032e5,_0xecbcbe]=useState([]),_0x543e3b=_0x4049bd[_0x246484(0x124)](_0x585c08=>({'label':_0x585c08['label'],'path':_0x585c08[_0x246484(0x114)],'local':!![],'online':_0x1b175e[_0x246484(0x112)](_0x585c08[_0x246484(0x114)])})),_0x59f467=_0x4049bd['filter'](_0x360c49=>{const _0x127226=_0x246484;return!_0x1b175e[_0x127226(0x112)](_0x360c49[_0x127226(0x114)]);});useEffect(()=>{const _0x44577b=_0x246484;if(!_0x238458&&_0x4049bd[_0x44577b(0x144)]>0x0&&_0x476427['size']===0x0){const _0x4b44f5=new Set(_0x4049bd['map']((_0x4b3734,_0x54a6db)=>({'page':_0x4b3734,'index':_0x54a6db}))[_0x44577b(0x123)](({page:_0x333db2})=>!_0x1b175e[_0x44577b(0x112)](_0x333db2[_0x44577b(0x114)]))[_0x44577b(0x124)](({index:_0x55ae5a})=>_0x55ae5a));_0xe90cfd(_0x4b44f5);}},[_0x238458,_0x4049bd['length'],_0x1b175e[_0x246484(0x144)]]),useInput(async(_0x36861b,_0x1c4d1d)=>{const _0x3ae3ee=_0x246484;if(_0xa9c231==='selecting'){if(_0x1c4d1d['upArrow']){_0x3bbbdb(_0x1be7ce=>_0x1be7ce>0x0?_0x1be7ce-0x1:_0x4049bd[_0x3ae3ee(0x144)]-0x1);return;}if(_0x1c4d1d[_0x3ae3ee(0x12e)]){_0x3bbbdb(_0x41aa5a=>_0x41aa5a<_0x4049bd[_0x3ae3ee(0x144)]-0x1?_0x41aa5a+0x1:0x0);return;}if(_0x36861b==='\x20'){_0xe90cfd(_0x56ddf3=>{const _0x15a279=_0x3ae3ee,_0x11f94a=new Set(_0x56ddf3);return _0x11f94a[_0x15a279(0x10f)](_0x18baea)?_0x11f94a['delete'](_0x18baea):_0x11f94a[_0x15a279(0x126)](_0x18baea),_0x11f94a;});return;}if(_0x36861b==='a'||_0x36861b==='A'){const _0x20822e=new Set(_0x4049bd['map']((_0x5bbcee,_0x478ccb)=>_0x478ccb));_0xe90cfd(_0x20822e);return;}if(_0x36861b==='i'||_0x36861b==='I'||_0x36861b==='r'||_0x36861b==='R'){_0xe90cfd(_0x35275f=>{const _0x5f4808=_0x3ae3ee,_0x249a7b=new Set();for(let _0x5e7311=0x0;_0x5e7311<_0x4049bd['length'];_0x5e7311++){!_0x35275f[_0x5f4808(0x10f)](_0x5e7311)&&_0x249a7b[_0x5f4808(0x126)](_0x5e7311);}return _0x249a7b;});return;}if(_0x36861b==='q'||_0x36861b==='Q'){_0x33b01d();return;}if(_0x1c4d1d['return']){if(_0x476427[_0x3ae3ee(0x12a)]===0x0){_0x1d05ce('请至少选择一个菜单');return;}const _0x5c9276=_0x4049bd['filter']((_0xa555d4,_0x5a2c56)=>_0x476427[_0x3ae3ee(0x10f)](_0x5a2c56)),_0xf6b21e=_0x5c9276[_0x3ae3ee(0x124)](_0x527842=>_0x527842[_0x3ae3ee(0x13c)])['join'](',\x20');_0xecbcbe([{'label':_0x3ae3ee(0x109),'value':_0x476427[_0x3ae3ee(0x12a)]+'\x20个'}]),_0x1d05ce(''),_0x571736(_0x3ae3ee(0x13b));return;}return;}if(_0xa9c231==='input-js'){if(_0x1c4d1d[_0x3ae3ee(0x146)]){const _0x24dab8=_0x1d41d9[_0x3ae3ee(0x128)]();if(_0x24dab8==='')return;if(!isValidJsHttpsUrl(_0x24dab8)){_0x1d05ce(_0x3ae3ee(0x142));return;}if(!await isUrlReachable(_0x24dab8)){_0x1d05ce(_0x3ae3ee(0x11b));return;}_0xee5f1a(_0x24dab8),_0xecbcbe(_0x301d45=>[..._0x301d45,{'label':_0x3ae3ee(0x12f),'value':_0x24dab8}]),_0x44ccb9(''),_0x1d05ce(''),_0x571736(_0x3ae3ee(0x127));return;}if(_0x1c4d1d['backspace']||_0x1c4d1d[_0x3ae3ee(0x148)]){_0x44ccb9(_0x2bf9db=>_0x2bf9db[_0x3ae3ee(0x121)](0x0,-0x1)),_0x1d05ce('');return;}_0x44ccb9(_0x17bf19=>_0x17bf19+_0x36861b);return;}if(_0xa9c231===_0x3ae3ee(0x127)){if(_0x1c4d1d[_0x3ae3ee(0x146)]){const _0xc88b82=_0x1d41d9[_0x3ae3ee(0x128)]();if(_0xc88b82==='')return;if(!isValidCssHttpsUrl(_0xc88b82)){_0x1d05ce('请输入有效的\x20CSS\x20https\x20链接');return;}if(!await isUrlReachable(_0xc88b82)){_0x1d05ce(_0x3ae3ee(0x116));return;}_0x4687c5(_0xc88b82),_0xecbcbe(_0x448844=>[..._0x448844,{'label':'CSS\x20链接','value':_0xc88b82}]),_0x44ccb9(''),_0x1d05ce(''),_0x571736(_0x3ae3ee(0x115));const _0x32ab84=_0x4049bd[_0x3ae3ee(0x123)]((_0x1328b3,_0x5c33c8)=>_0x476427['has'](_0x5c33c8));createMenus(_0x32ab84,[_0x58d1e5,_0xc88b82])[_0x3ae3ee(0x131)](()=>{_0x571736('done'),setTimeout(()=>{_0x33b01d();},0x3e8);})['catch'](_0x2d4b73=>{const _0x569bc3=_0x3ae3ee;_0x1d05ce(_0x2d4b73[_0x569bc3(0x10e)]||_0x569bc3(0x11e)),_0x571736(_0x569bc3(0x13f));});return;}if(_0x1c4d1d[_0x3ae3ee(0x12b)]||_0x1c4d1d[_0x3ae3ee(0x148)]){_0x44ccb9(_0xd4a20c=>_0xd4a20c[_0x3ae3ee(0x121)](0x0,-0x1)),_0x1d05ce('');return;}_0x44ccb9(_0x4e1eae=>_0x4e1eae+_0x36861b);return;}});if(_0x238458)return a10_0x16ebf0(Box,{'marginTop':0x1,'marginBottom':0x1,'children':[a10_0x185bf1(Text,{'children':'\x20\x20'}),a10_0x185bf1(a10_0x33f11e,{'type':_0x246484(0x118)}),a10_0x185bf1(Text,{'children':_0x246484(0x11a)})]});if(_0x33bae4)return a10_0x16ebf0(Box,{'flexDirection':'column','marginTop':0x1,'marginBottom':0x1,'children':[a10_0x16ebf0(Text,{'color':'red','children':['✗\x20',_0x33bae4]}),a10_0x16ebf0(Box,{'marginTop':0x1,'children':[a10_0x185bf1(Text,{'color':'gray','children':_0x246484(0x133)}),a10_0x185bf1(Text,{'color':_0x246484(0x141),'children':_0x246484(0x143)}),a10_0x185bf1(Text,{'color':'gray','children':'\x20命令重新登录'})]})]});if(_0x4049bd[_0x246484(0x144)]===0x0)return a10_0x185bf1(Box,{'marginTop':0x1,'marginBottom':0x1,'children':a10_0x185bf1(Text,{'color':_0x246484(0x11d),'children':_0x246484(0x138)})});return a10_0x16ebf0(Box,{'flexDirection':_0x246484(0x130),'marginTop':0x1,'marginBottom':0x1,'children':[_0xa9c231==='selecting'&&a10_0x16ebf0(a10_0x14fa26,{'children':[a10_0x16ebf0(Box,{'children':[a10_0x16ebf0(Text,{'bold':!![],'children':['\x20\x20',_0x246484(0x134),getRemainingSpaces(_0x214302,_0x246484(0x134))]}),a10_0x16ebf0(Text,{'bold':!![],'children':['本地',getRemainingSpaces(_0x4623a2,_0x246484(0x134))]}),a10_0x16ebf0(Text,{'bold':!![],'children':[_0x246484(0x11c),getRemainingSpaces(_0x4623a2,'菜单名称')]})]}),_0x543e3b[_0x246484(0x124)](_0x256daf=>a10_0x16ebf0(Box,{'children':[a10_0x16ebf0(Text,{'children':['\x20\x20',_0x256daf[_0x246484(0x13c)],getRemainingSpaces(_0x214302,_0x256daf[_0x246484(0x13c)])]}),a10_0x16ebf0(Text,{'color':_0x246484(0x10a),'children':[_0x256daf[_0x246484(0x12c)]?'✓':'✗',getRemainingSpaces(_0x4623a2,'✓')]}),a10_0x16ebf0(Text,{'color':_0x256daf[_0x246484(0x10d)]?'green':'red','children':[_0x256daf[_0x246484(0x10d)]?'✓':'✗',getRemainingSpaces(_0x4623a2,'✓')]})]},_0x256daf[_0x246484(0x114)]))]}),_0xa9c231===_0x246484(0x13f)&&_0x4032e5['length']===0x0&&a10_0x185bf1(Box,{'marginTop':0x1,'children':a10_0x185bf1(Text,{'color':_0x246484(0x141),'children':'*\x20同步菜单到\x20Lovrabet\x20平台'})}),_0x4032e5[_0x246484(0x124)]((_0x16b71e,_0x2e268c)=>a10_0x16ebf0(Box,{'children':[a10_0x16ebf0(Text,{'color':_0x246484(0x10a),'children':['√\x20',_0x16b71e[_0x246484(0x13c)],':\x20']}),a10_0x185bf1(Text,{'color':'cyan','children':_0x16b71e[_0x246484(0x136)]})]},_0x2e268c)),_0x3b1757&&_0xa9c231===_0x246484(0x13f)&&a10_0x185bf1(Box,{'marginTop':0x1,'children':a10_0x16ebf0(Text,{'color':_0x246484(0x120),'children':['✗\x20',_0x3b1757]})}),_0xa9c231===_0x246484(0x13f)&&a10_0x185bf1(a10_0x14fa26,{'children':a10_0x16ebf0(Box,{'marginTop':_0x4032e5[_0x246484(0x144)]>0x0||_0x3b1757?0x1:0x0,'flexDirection':_0x246484(0x130),'children':[a10_0x185bf1(Text,{'bold':!![],'children':_0x246484(0x119)}),_0x4049bd[_0x246484(0x124)]((_0x1b485c,_0x2bff7b)=>{const _0x49a71a=_0x246484,_0x18fa1a=_0x18baea===_0x2bff7b,_0x1ee33e=_0x476427[_0x49a71a(0x10f)](_0x2bff7b),_0x3f0704=_0x1b175e['includes'](_0x1b485c[_0x49a71a(0x114)]),_0x3a5f63=_0x3f0704?'更新':'新建';return a10_0x185bf1(Box,{'children':a10_0x16ebf0(Text,{'backgroundColor':_0x18fa1a?'blue':undefined,'color':_0x18fa1a?_0x49a71a(0x135):undefined,'children':['\x20\x20',_0x1ee33e?_0x49a71a(0x137):'[\x20]','\x20',_0x1b485c[_0x49a71a(0x13c)]]})},_0x1b485c['path']);}),a10_0x185bf1(Box,{'marginTop':0x1,'children':a10_0x16ebf0(Text,{'color':'gray','children':['\x20',_0x246484(0x140)]})})]})}),_0xa9c231==='input-js'&&a10_0x16ebf0(a10_0x14fa26,{'children':[a10_0x16ebf0(Box,{'children':[a10_0x185bf1(Text,{'children':_0x246484(0x13a)}),a10_0x185bf1(Text,{'color':_0x246484(0x10a),'children':_0x1d41d9}),_0x3b1757&&a10_0x16ebf0(Text,{'color':_0x246484(0x120),'children':['\x20←\x20',_0x3b1757]})]}),!_0x3b1757&&a10_0x185bf1(Box,{'children':a10_0x185bf1(Text,{'color':'gray','children':_0x246484(0x129)})})]}),_0xa9c231===_0x246484(0x127)&&a10_0x16ebf0(a10_0x14fa26,{'children':[a10_0x16ebf0(Box,{'children':[a10_0x185bf1(Text,{'children':_0x246484(0x110)}),a10_0x185bf1(Text,{'color':'green','children':_0x1d41d9}),_0x3b1757&&a10_0x16ebf0(Text,{'color':'red','children':[_0x246484(0x149),_0x3b1757]})]}),!_0x3b1757&&a10_0x185bf1(Box,{'children':a10_0x185bf1(Text,{'color':_0x246484(0x11f),'children':'\x20输入项目的\x20CSS\x20资源链接(https://...)'})})]}),_0xa9c231===_0x246484(0x115)&&a10_0x185bf1(Box,{'children':a10_0x185bf1(Text,{'children':_0x246484(0x108)})}),_0xa9c231===_0x246484(0x113)&&a10_0x185bf1(Box,{'children':a10_0x185bf1(Text,{'color':_0x246484(0x10a),'children':_0x246484(0x132)})})]});}function getStringWidth(_0x48f28b){const _0x4a9e7b=a10_0x2f18;let _0x459e11=0x0;for(const _0x299bdb of _0x48f28b){/[\u4e00-\u9fa5]/[_0x4a9e7b(0x117)](_0x299bdb)?_0x459e11+=0x2:_0x459e11+=0x1;}return _0x459e11;}function getRemainingSpaces(_0x8280cc,_0x3ac2bc){const _0x15c772=a10_0x2f18,_0x332e00=getStringWidth(_0x3ac2bc);return Array(Math[_0x15c772(0x145)](0x0,_0x8280cc-_0x332e00))[_0x15c772(0x125)]('\x20')[_0x15c772(0x13d)]('');}function getMaxWidth(_0x56eacb,_0x28fc38=0x2){let _0x34f5f8='',_0x15c079=0x0;for(const _0x3b2fff of _0x56eacb){const _0xe25bea=getStringWidth(_0x3b2fff);_0xe25bea>_0x15c079&&(_0x15c079=_0xe25bea,_0x34f5f8=_0x3b2fff);}return _0x34f5f8+'\x20'['repeat'](_0x28fc38);}