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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. package/lib/add-page/input-page-router.js +1 -1
  2. package/lib/add-page/main.js +1 -1
  3. package/lib/add-page/select-page-template.js +1 -1
  4. package/lib/api/api-doc-ui.js +1 -1
  5. package/lib/api/api-doc.js +1 -1
  6. package/lib/api/api-pull-ui.js +1 -1
  7. package/lib/api/fetch-model-list.js +1 -1
  8. package/lib/api/generate-api-file.js +1 -1
  9. package/lib/api/main.js +1 -1
  10. package/lib/api/pull-silent.js +1 -1
  11. package/lib/app-menu/app-menu-sync-ui.js +1 -1
  12. package/lib/app-menu/create-menu.js +1 -1
  13. package/lib/app-menu/get-local-pages.js +1 -1
  14. package/lib/app-menu/get-online-menu-list.js +1 -1
  15. package/lib/app-menu/use-get-online-menu-list.js +1 -1
  16. package/lib/app-menu/utils.js +1 -1
  17. package/lib/app-menu/valid-url.js +1 -1
  18. package/lib/app-menu-cdn-version/app-menu-sync-cdn-version-ui.js +1 -1
  19. package/lib/app-menu-cdn-version/cdn-url-compare-table.js +1 -1
  20. package/lib/app-menu-cdn-version/update-menu-cdn-url.js +1 -1
  21. package/lib/auth/auth-server-ui.js +1 -1
  22. package/lib/auth/auth-server.js +1 -1
  23. package/lib/auth/constant.js +1 -1
  24. package/lib/auth/get-cookie.js +1 -1
  25. package/lib/auth/is-session-valid.js +1 -1
  26. package/lib/auth/logout.js +1 -1
  27. package/lib/cli.js +1 -1
  28. package/lib/cmd/build-watch.js +1 -1
  29. package/lib/cmd/build.js +1 -1
  30. package/lib/cmd/logs.js +1 -1
  31. package/lib/cmd/preview.js +1 -1
  32. package/lib/cmd/start.js +1 -1
  33. package/lib/config/config-help.js +1 -1
  34. package/lib/config/main.js +1 -1
  35. package/lib/constant/domain.js +1 -1
  36. package/lib/constant/env.js +1 -1
  37. package/lib/create-app/enhanced-guided-create.js +1 -1
  38. package/lib/create-app/format-elapsed.js +1 -1
  39. package/lib/create-app/main.js +1 -1
  40. package/lib/create-app/task-finished.js +1 -1
  41. package/lib/create-app/task-loading.js +1 -1
  42. package/lib/create-app/task-running.js +1 -1
  43. package/lib/create-app/task-time.js +1 -1
  44. package/lib/create-app/use-copy-project-template.js +1 -1
  45. package/lib/create-app/use-format-code.js +1 -1
  46. package/lib/create-app/use-install-dependencies.js +1 -1
  47. package/lib/help.js +1 -1
  48. package/lib/init/main.js +1 -1
  49. package/lib/mcp/cursor.js +1 -1
  50. package/lib/mcp/main.js +1 -1
  51. package/lib/utils/config.js +1 -1
  52. package/lib/utils/copy-directory.js +1 -1
  53. package/lib/utils/http-client.js +1 -1
  54. package/lib/utils/logger.js +1 -1
  55. package/lib/utils/router-updater.js +1 -1
  56. package/lib/utils/sleep.js +1 -1
  57. package/lib/utils/template-replacer.js +1 -1
  58. package/package.json +1 -1
@@ -1 +1 @@
1
- (function(_0x29dad8,_0x28bd8c){const _0x329a99=a0_0x2186,_0x50eb25=_0x29dad8();while(!![]){try{const _0x3b3469=-parseInt(_0x329a99(0x146))/0x1+parseInt(_0x329a99(0x155))/0x2*(parseInt(_0x329a99(0x149))/0x3)+-parseInt(_0x329a99(0x143))/0x4+-parseInt(_0x329a99(0x140))/0x5*(parseInt(_0x329a99(0x13e))/0x6)+parseInt(_0x329a99(0x14b))/0x7+-parseInt(_0x329a99(0x14a))/0x8+parseInt(_0x329a99(0x145))/0x9*(parseInt(_0x329a99(0x14c))/0xa);if(_0x3b3469===_0x28bd8c)break;else _0x50eb25['push'](_0x50eb25['shift']());}catch(_0x50ca18){_0x50eb25['push'](_0x50eb25['shift']());}}}(a0_0x49f2,0xb133b));import{jsx as a0_0x259e05,jsxs as a0_0x314e0d}from'react/jsx-runtime';function a0_0x49f2(){const _0x1e53f2=['路径中的每个段只能以字母或数字开头,且只包含字母、数字、-\x20和\x20_','5BRjPKS','length','includes','5900KzQASf','green','18969696pSHenL','767051NwfZIv','\x20已存在,请使用其他路径','delete','3jGxkUs','6041536FARhDH','1758890uaSmAu','10NCnEDI','\x20Step2:\x20','existsSync','页面路径\x20','路径不能以\x20/\x20开头或结尾','return','red','页面路径长度不能超过\x20100\x20个字符','slice','717314uGrDVH','endsWith','test','\x20←\x20','gray','路径不能包含连续的\x20/','页面路径不合法','2808804rUAttW'];a0_0x49f2=function(){return _0x1e53f2;};return a0_0x49f2();}function a0_0x2186(_0x4fed83,_0x3914fc){const _0x49f2ef=a0_0x49f2();return a0_0x2186=function(_0x218612,_0x506019){_0x218612=_0x218612-0x139;let _0x159a84=_0x49f2ef[_0x218612];return _0x159a84;},a0_0x2186(_0x4fed83,_0x3914fc);}import{useState}from'react';import{Text,Box,useInput}from'ink';import a0_0x3fe4c5 from'node:fs';export function InputProjectCode(_0x55243d){const _0x455948=a0_0x2186,{onSubmit:_0x497450,pagePath:_0x1c2fc6}=_0x55243d,[_0x2a3a52,_0x3152b5]=useState(''),[_0x31eca7,_0x1af594]=useState(''),_0x3df605='my-page';function _0x2390d6(_0x8243a){const _0x1bc5ed=a0_0x2186;if(_0x8243a[_0x1bc5ed(0x141)]>0x64)return{'valid':![],'message':_0x1bc5ed(0x153)};if(_0x8243a['startsWith']('/')||_0x8243a[_0x1bc5ed(0x156)]('/'))return{'valid':![],'message':_0x1bc5ed(0x150)};if(_0x8243a[_0x1bc5ed(0x142)]('//'))return{'valid':![],'message':_0x1bc5ed(0x13c)};const _0x22728c=_0x8243a['split']('/');for(const _0xc39c3 of _0x22728c){if(!_0xc39c3)continue;const _0x305deb=/^[A-Za-z0-9][A-Za-z0-9_-]*$/;if(!_0x305deb[_0x1bc5ed(0x139)](_0xc39c3))return{'valid':![],'message':_0x1bc5ed(0x13f)};}return{'valid':!![]};}return useInput((_0x5095e7,_0x1d8542)=>{const _0x4d77ba=a0_0x2186;if(_0x1d8542[_0x4d77ba(0x151)]){const _0x3cb88e=_0x2a3a52['trim']()||_0x3df605;if(_0x31eca7)return;const _0x3b82ca=_0x1c2fc6+'/'+_0x3cb88e;if(a0_0x3fe4c5[_0x4d77ba(0x14e)](_0x3b82ca)){_0x1af594(_0x4d77ba(0x14f)+_0x3cb88e+_0x4d77ba(0x147));return;}_0x497450(_0x3cb88e),_0x3152b5(''),_0x1af594('');}else _0x1d8542['backspace']||_0x1d8542[_0x4d77ba(0x148)]?_0x3152b5(_0x1049c8=>{const _0x130479=_0x4d77ba,_0x4e7551=_0x1049c8[_0x130479(0x154)](0x0,-0x1),{valid:_0x1737ec,message:_0x733ecb}=_0x2390d6(_0x4e7551);return _0x1af594(_0x1737ec?'':_0x733ecb||'页面路径不合法'),_0x4e7551;}):_0x3152b5(_0x3a8fe5=>{const _0x1cd506=_0x4d77ba,_0x234adb=_0x3a8fe5+_0x5095e7,{valid:_0x1ca177,message:_0x58b07b}=_0x2390d6(_0x234adb);return _0x1af594(_0x1ca177?'':_0x58b07b||_0x1cd506(0x13d)),_0x234adb;});}),a0_0x314e0d(Box,{'flexDirection':'column','children':[a0_0x314e0d(Box,{'children':[a0_0x259e05(Text,{'color':_0x455948(0x13b),'children':_0x455948(0x14d)}),a0_0x259e05(Text,{'children':'页面路由地址:\x20'}),_0x2a3a52?a0_0x259e05(Text,{'color':_0x455948(0x144),'children':_0x2a3a52}):a0_0x259e05(Text,{'color':_0x455948(0x13b),'children':_0x3df605}),_0x31eca7&&a0_0x314e0d(Text,{'color':_0x455948(0x152),'children':[_0x455948(0x13a),_0x31eca7]})]}),!_0x31eca7&&!_0x2a3a52&&a0_0x259e05(Box,{'children':a0_0x259e05(Text,{'color':_0x455948(0x13b),'children':'\x20直接回车确认,或输入自定义路由地址'})})]});}
1
+ (function(_0x4ca21c,_0xf5d083){const _0x313747=a0_0x5bc9,_0x308d70=_0x4ca21c();while(!![]){try{const _0x5753c9=parseInt(_0x313747(0x105))/0x1+parseInt(_0x313747(0x109))/0x2+parseInt(_0x313747(0x10a))/0x3*(-parseInt(_0x313747(0x106))/0x4)+-parseInt(_0x313747(0x10e))/0x5+-parseInt(_0x313747(0x103))/0x6*(parseInt(_0x313747(0xf6))/0x7)+-parseInt(_0x313747(0xff))/0x8*(parseInt(_0x313747(0xf5))/0x9)+parseInt(_0x313747(0xfe))/0xa*(parseInt(_0x313747(0x10d))/0xb);if(_0x5753c9===_0xf5d083)break;else _0x308d70['push'](_0x308d70['shift']());}catch(_0x23523d){_0x308d70['push'](_0x308d70['shift']());}}}(a0_0x5e99,0xc2c4f));import{jsx as a0_0x4895b0,jsxs as a0_0x554e8e}from'react/jsx-runtime';import{useState}from'react';function a0_0x5bc9(_0x229740,_0x546f11){const _0x5e9909=a0_0x5e99();return a0_0x5bc9=function(_0x5bc91a,_0x1ce9bb){_0x5bc91a=_0x5bc91a-0xf1;let _0x4464f5=_0x5e9909[_0x5bc91a];return _0x4464f5;},a0_0x5bc9(_0x229740,_0x546f11);}import{Text,Box,useInput}from'ink';import a0_0x2d2f67 from'node:fs';export function InputProjectCode(_0x3f3fe6){const _0x16b2eb=a0_0x5bc9,{onSubmit:_0x53c065,pagePath:_0x56bda5}=_0x3f3fe6,[_0x39ae9b,_0x52217f]=useState(''),[_0x2f5c8e,_0x5658d4]=useState(''),_0x4f4b84='my-page';function _0x4c6d84(_0x35e9f7){const _0x1d8255=a0_0x5bc9;if(_0x35e9f7[_0x1d8255(0x10c)]>0x64)return{'valid':![],'message':_0x1d8255(0xf7)};if(_0x35e9f7[_0x1d8255(0x10b)]('/')||_0x35e9f7['endsWith']('/'))return{'valid':![],'message':_0x1d8255(0xf4)};if(_0x35e9f7[_0x1d8255(0xf1)]('//'))return{'valid':![],'message':_0x1d8255(0xfa)};const _0x264a36=_0x35e9f7['split']('/');for(const _0x20220a of _0x264a36){if(!_0x20220a)continue;const _0x49cae3=/^[A-Za-z0-9][A-Za-z0-9_-]*$/;if(!_0x49cae3['test'](_0x20220a))return{'valid':![],'message':'路径中的每个段只能以字母或数字开头,且只包含字母、数字、-\x20和\x20_'};}return{'valid':!![]};}return useInput((_0x4a6806,_0x1071fd)=>{const _0x2b3de9=a0_0x5bc9;if(_0x1071fd[_0x2b3de9(0x102)]){const _0x4ffbd3=_0x39ae9b['trim']()||_0x4f4b84;if(_0x2f5c8e)return;const _0x22d94e=_0x56bda5+'/'+_0x4ffbd3;if(a0_0x2d2f67[_0x2b3de9(0x10f)](_0x22d94e)){_0x5658d4(_0x2b3de9(0xf9)+_0x4ffbd3+'\x20已存在,请使用其他路径');return;}_0x53c065(_0x4ffbd3),_0x52217f(''),_0x5658d4('');}else _0x1071fd[_0x2b3de9(0x100)]||_0x1071fd['delete']?_0x52217f(_0x1e9f81=>{const _0x2915c1=_0x2b3de9,_0x47bc93=_0x1e9f81[_0x2915c1(0xfd)](0x0,-0x1),{valid:_0x1b1cd1,message:_0x41c472}=_0x4c6d84(_0x47bc93);return _0x5658d4(_0x1b1cd1?'':_0x41c472||_0x2915c1(0xfc)),_0x47bc93;}):_0x52217f(_0x353a3f=>{const _0x127d4e=_0x2b3de9,_0x3f7d31=_0x353a3f+_0x4a6806,{valid:_0x32ac1d,message:_0x52c50a}=_0x4c6d84(_0x3f7d31);return _0x5658d4(_0x32ac1d?'':_0x52c50a||_0x127d4e(0xfc)),_0x3f7d31;});}),a0_0x554e8e(Box,{'flexDirection':_0x16b2eb(0x107),'children':[a0_0x554e8e(Box,{'children':[a0_0x4895b0(Text,{'color':'gray','children':_0x16b2eb(0x104)}),a0_0x4895b0(Text,{'children':_0x16b2eb(0xfb)}),_0x39ae9b?a0_0x4895b0(Text,{'color':_0x16b2eb(0x101),'children':_0x39ae9b}):a0_0x4895b0(Text,{'color':_0x16b2eb(0x108),'children':_0x4f4b84}),_0x2f5c8e&&a0_0x554e8e(Text,{'color':_0x16b2eb(0xf3),'children':[_0x16b2eb(0xf8),_0x2f5c8e]})]}),!_0x2f5c8e&&!_0x39ae9b&&a0_0x4895b0(Box,{'children':a0_0x4895b0(Text,{'color':_0x16b2eb(0x108),'children':_0x16b2eb(0xf2)})})]});}function a0_0x5e99(){const _0x2fefeb=['页面路由地址:\x20','页面路径不合法','slice','10XwGslr','8MUgPGE','backspace','green','return','129282qBrDtQ','\x20Step2:\x20','1282941zQgftO','6357080CSlmXC','column','gray','1273542xxZjBD','3jFLbEy','startsWith','length','33339515PErBLl','5363180SEXImj','existsSync','includes','\x20直接回车确认,或输入自定义路由地址','red','路径不能以\x20/\x20开头或结尾','10897065VtRnNs','91KmwYdD','页面路径长度不能超过\x20100\x20个字符','\x20←\x20','页面路径\x20','路径不能包含连续的\x20/'];a0_0x5e99=function(){return _0x2fefeb;};return a0_0x5e99();}
@@ -1 +1 @@
1
- const a1_0x2b87ea=a1_0x2a59;(function(_0x5b45af,_0x267da1){const _0x389fb4=a1_0x2a59,_0x41e7af=_0x5b45af();while(!![]){try{const _0x123203=-parseInt(_0x389fb4(0x108))/0x1*(-parseInt(_0x389fb4(0x121))/0x2)+parseInt(_0x389fb4(0x127))/0x3+parseInt(_0x389fb4(0x109))/0x4*(parseInt(_0x389fb4(0x129))/0x5)+-parseInt(_0x389fb4(0x11f))/0x6*(parseInt(_0x389fb4(0x116))/0x7)+-parseInt(_0x389fb4(0x125))/0x8+parseInt(_0x389fb4(0x12b))/0x9+-parseInt(_0x389fb4(0x112))/0xa;if(_0x123203===_0x267da1)break;else _0x41e7af['push'](_0x41e7af['shift']());}catch(_0x3837b2){_0x41e7af['push'](_0x41e7af['shift']());}}}(a1_0x3fd9,0x64a27));import{jsx as a1_0x3a40c9,jsxs as a1_0x44ab9d,Fragment as a1_0x2ae853}from'react/jsx-runtime';import{fileURLToPath}from'node:url';import a1_0x3f9b4b from'node:path';function a1_0x3fd9(){const _0x3abd47=['column','dirname','\x20*\x20页面文件已创建,可直接通过路由访问','1608190RsiOyp','processTemplate','cwd','src','50911iJPhvR','cyan','resolve','join','add-page','已输入的页面路由\x20','\x20Step2:\x20','now','pages','474HDZfZz','catch','868630UKypmh','url','页面添加成功:\x20','页面添加失败:\x20','1398880oKJjzR','green','1859700EDjsHV','\x20*\x20页面创建成功!','10zTgOzW','error','425538LrhUKr','正在创建页面,请稍候…','success','finally','\x20*\x20页面路径:\x20','1eEYjKc','441896EUrtMT','已选择页面模板\x20','message','\x20Step1:\x20','../../templates/pages','gray'];a1_0x3fd9=function(){return _0x3abd47;};return a1_0x3fd9();}import{useEffect,useState}from'react';import{Box,Text,useApp}from'ink';import{SelectPageTemplate}from'./select-page-template.js';import{InputProjectCode}from'./input-page-router.js';import{logger}from'../utils/logger.js';function a1_0x2a59(_0x1d915c,_0x2c3d40){const _0x3fd914=a1_0x3fd9();return a1_0x2a59=function(_0x2a5934,_0x22c57a){_0x2a5934=_0x2a5934-0x105;let _0x299274=_0x3fd914[_0x2a5934];return _0x299274;},a1_0x2a59(_0x1d915c,_0x2c3d40);}import{TemplateReplacer}from'../utils/template-replacer.js';const __dirname=a1_0x3f9b4b[a1_0x2b87ea(0x110)](fileURLToPath(import.meta[a1_0x2b87ea(0x122)])),pageTemplateDir=a1_0x3f9b4b['resolve'](__dirname,a1_0x2b87ea(0x10d)),projectDir=process['cwd']();export const AddPage=()=>{const _0x1c559e=a1_0x2b87ea,{exit:_0x1482e7}=useApp(),[_0x4e5f4f,_0x175625]=useState(''),[_0x4b248c,_0x28ec55]=useState(''),[_0x43ca23,_0x5b5472]=useState(![]),[_0x1c4080,_0x4f98b3]=useState(![]),_0x3e73f7=a1_0x3f9b4b[_0x1c559e(0x119)](projectDir,_0x1c559e(0x115),_0x1c559e(0x11e)),_0x4f409b=a1_0x3f9b4b['join'](_0x3e73f7,_0x4b248c),_0x32da58=a1_0x3f9b4b['join'](_0x1c559e(0x115),_0x1c559e(0x11e),_0x4b248c);useEffect(()=>{const _0x4233a1=_0x1c559e,_0x59cbc7=a1_0x3f9b4b[_0x4233a1(0x118)](pageTemplateDir,_0x4e5f4f);if(_0x4e5f4f&&_0x4b248c){_0x5b5472(!![]),logger['setLogPath'](process[_0x4233a1(0x114)]());const _0x102cd6=Date['now']();logger['info'](_0x4233a1(0x11a),'开始添加页面:\x20'+_0x4b248c,{'template':_0x4e5f4f,'targetPath':_0x32da58}),TemplateReplacer[_0x4233a1(0x113)](_0x59cbc7,a1_0x3f9b4b[_0x4233a1(0x119)](_0x3e73f7,_0x4b248c),_0x4b248c,_0x4e5f4f)['then'](()=>{const _0x48178a=_0x4233a1,_0x411aed=Date[_0x48178a(0x11d)]()-_0x102cd6;logger[_0x48178a(0x105)](_0x48178a(0x11a),_0x48178a(0x123)+_0x4b248c,_0x411aed,{'template':_0x4e5f4f,'targetPath':_0x32da58,'routePath':_0x4b248c}),_0x4f98b3(!![]);})[_0x4233a1(0x120)](_0x1c0a48=>{const _0x2fff81=_0x4233a1,_0x254a9f=Date['now']()-_0x102cd6;logger[_0x2fff81(0x12a)](_0x2fff81(0x11a),_0x2fff81(0x124)+_0x4b248c,{'template':_0x4e5f4f,'targetPath':_0x32da58,'error':_0x1c0a48 instanceof Error?_0x1c0a48[_0x2fff81(0x10b)]:String(_0x1c0a48),'duration':_0x254a9f});})[_0x4233a1(0x106)](()=>{_0x5b5472(![]);});}},[_0x4e5f4f,_0x4b248c]),useEffect(()=>{_0x1c4080&&setTimeout(()=>{_0x1482e7();});},[_0x1c4080]);if(_0x4e5f4f)return a1_0x44ab9d(Box,{'flexDirection':_0x1c559e(0x10f),'paddingY':0x1,'children':[a1_0x44ab9d(Box,{'children':[a1_0x3a40c9(Text,{'color':'gray','children':_0x1c559e(0x10c)}),a1_0x3a40c9(Text,{'children':_0x1c559e(0x10a)}),a1_0x3a40c9(Text,{'color':_0x1c559e(0x126),'children':_0x4e5f4f})]}),_0x4b248c?a1_0x44ab9d(Box,{'children':[a1_0x3a40c9(Text,{'color':'gray','children':_0x1c559e(0x11c)}),a1_0x3a40c9(Text,{'children':_0x1c559e(0x11b)}),a1_0x3a40c9(Text,{'color':_0x1c559e(0x126),'children':_0x4b248c})]}):a1_0x3a40c9(InputProjectCode,{'pagePath':_0x4f409b,'onSubmit':_0x28ec55}),_0x4b248c&&_0x43ca23?a1_0x44ab9d(Box,{'marginTop':0x1,'children':[a1_0x3a40c9(Box,{'width':'4'}),a1_0x3a40c9(Text,{'children':_0x1c559e(0x12c)})]}):null,_0x1c4080?a1_0x44ab9d(a1_0x2ae853,{'children':[a1_0x3a40c9(Box,{'marginTop':0x1,'children':a1_0x3a40c9(Text,{'color':_0x1c559e(0x10e),'children':_0x1c559e(0x128)})}),a1_0x44ab9d(Box,{'children':[a1_0x3a40c9(Text,{'color':_0x1c559e(0x10e),'children':_0x1c559e(0x107)}),a1_0x3a40c9(Text,{'color':_0x1c559e(0x126),'children':_0x32da58})]}),a1_0x44ab9d(Box,{'children':[a1_0x3a40c9(Text,{'color':_0x1c559e(0x10e),'children':'\x20*\x20路由地址:\x20'}),a1_0x44ab9d(Text,{'color':'green','children':['/',_0x4b248c]})]}),a1_0x3a40c9(Box,{'marginTop':0x1,'children':a1_0x3a40c9(Text,{'color':_0x1c559e(0x117),'children':_0x1c559e(0x111)})})]}):null]});return a1_0x3a40c9(SelectPageTemplate,{'onSelect':_0x175625});};
1
+ const a1_0x136c09=a1_0x124f;(function(_0x1e6f18,_0xf5289a){const _0x2020fa=a1_0x124f,_0x52bdad=_0x1e6f18();while(!![]){try{const _0x1b6be1=-parseInt(_0x2020fa(0x7d))/0x1+-parseInt(_0x2020fa(0x8b))/0x2+parseInt(_0x2020fa(0x70))/0x3+parseInt(_0x2020fa(0x72))/0x4*(-parseInt(_0x2020fa(0x86))/0x5)+parseInt(_0x2020fa(0x78))/0x6*(-parseInt(_0x2020fa(0x8a))/0x7)+parseInt(_0x2020fa(0x7f))/0x8+parseInt(_0x2020fa(0x74))/0x9*(parseInt(_0x2020fa(0x76))/0xa);if(_0x1b6be1===_0xf5289a)break;else _0x52bdad['push'](_0x52bdad['shift']());}catch(_0x25f6eb){_0x52bdad['push'](_0x52bdad['shift']());}}}(a1_0xde80,0x2a9cb));import{jsx as a1_0x378527,jsxs as a1_0x3688d9,Fragment as a1_0x32d6f8}from'react/jsx-runtime';import{fileURLToPath}from'node:url';import a1_0x356f03 from'node:path';import{useEffect,useState}from'react';function a1_0xde80(){const _0x147b22=['635524ebxviB','页面添加失败:\x20','gray','url','src','join','\x20Step1:\x20','页面添加成功:\x20','已输入的页面路由\x20','开始添加页面:\x20','setLogPath','../../templates/pages','408354oeemBm','已选择页面模板\x20','92BAErgs','catch','592362TPALrK','green','130XVVZxS','now','8682aIiriy','message','pages','cyan','processTemplate','183299GTQAPB','error','1276392HZpXRr','正在创建页面,请稍候…','finally','add-page','\x20*\x20路由地址:\x20','success','cwd','65980eJldIz','resolve','\x20Step2:\x20','\x20*\x20页面路径:\x20','833FQhWoY'];a1_0xde80=function(){return _0x147b22;};return a1_0xde80();}function a1_0x124f(_0x16fa33,_0x44d3e8){const _0xde8007=a1_0xde80();return a1_0x124f=function(_0x124f03,_0x1d3497){_0x124f03=_0x124f03-0x65;let _0x5ba2b7=_0xde8007[_0x124f03];return _0x5ba2b7;},a1_0x124f(_0x16fa33,_0x44d3e8);}import{Box,Text,useApp}from'ink';import{SelectPageTemplate}from'./select-page-template.js';import{InputProjectCode}from'./input-page-router.js';import{logger}from'../utils/logger.js';import{TemplateReplacer}from'../utils/template-replacer.js';const __dirname=a1_0x356f03['dirname'](fileURLToPath(import.meta[a1_0x136c09(0x67)])),pageTemplateDir=a1_0x356f03['resolve'](__dirname,a1_0x136c09(0x6f)),projectDir=process[a1_0x136c09(0x85)]();export const AddPage=()=>{const _0x114e88=a1_0x136c09,{exit:_0x46dd81}=useApp(),[_0x8cbb8c,_0x448876]=useState(''),[_0x54c2be,_0x42bdb4]=useState(''),[_0x538fbd,_0x116eb2]=useState(![]),[_0x1e3b6a,_0x1c89e4]=useState(![]),_0x4b09ad=a1_0x356f03['join'](projectDir,'src',_0x114e88(0x7a)),_0x26e13e=a1_0x356f03[_0x114e88(0x69)](_0x4b09ad,_0x54c2be),_0xd8d7c=a1_0x356f03[_0x114e88(0x69)](_0x114e88(0x68),_0x114e88(0x7a),_0x54c2be);useEffect(()=>{const _0x205aab=_0x114e88,_0x21178d=a1_0x356f03[_0x205aab(0x87)](pageTemplateDir,_0x8cbb8c);if(_0x8cbb8c&&_0x54c2be){_0x116eb2(!![]),logger[_0x205aab(0x6e)](process[_0x205aab(0x85)]());const _0x334358=Date[_0x205aab(0x77)]();logger['info']('add-page',_0x205aab(0x6d)+_0x54c2be,{'template':_0x8cbb8c,'targetPath':_0xd8d7c}),TemplateReplacer[_0x205aab(0x7c)](_0x21178d,a1_0x356f03[_0x205aab(0x69)](_0x4b09ad,_0x54c2be),_0x54c2be,_0x8cbb8c)['then'](()=>{const _0x4b3137=_0x205aab,_0x220eb1=Date[_0x4b3137(0x77)]()-_0x334358;logger[_0x4b3137(0x84)](_0x4b3137(0x82),_0x4b3137(0x6b)+_0x54c2be,_0x220eb1,{'template':_0x8cbb8c,'targetPath':_0xd8d7c,'routePath':_0x54c2be}),_0x1c89e4(!![]);})[_0x205aab(0x73)](_0xa7c594=>{const _0x351b6e=_0x205aab,_0x2cd4e6=Date[_0x351b6e(0x77)]()-_0x334358;logger[_0x351b6e(0x7e)](_0x351b6e(0x82),_0x351b6e(0x65)+_0x54c2be,{'template':_0x8cbb8c,'targetPath':_0xd8d7c,'error':_0xa7c594 instanceof Error?_0xa7c594[_0x351b6e(0x79)]:String(_0xa7c594),'duration':_0x2cd4e6});})[_0x205aab(0x81)](()=>{_0x116eb2(![]);});}},[_0x8cbb8c,_0x54c2be]),useEffect(()=>{_0x1e3b6a&&setTimeout(()=>{_0x46dd81();});},[_0x1e3b6a]);if(_0x8cbb8c)return a1_0x3688d9(Box,{'flexDirection':'column','paddingY':0x1,'children':[a1_0x3688d9(Box,{'children':[a1_0x378527(Text,{'color':_0x114e88(0x66),'children':_0x114e88(0x6a)}),a1_0x378527(Text,{'children':_0x114e88(0x71)}),a1_0x378527(Text,{'color':'green','children':_0x8cbb8c})]}),_0x54c2be?a1_0x3688d9(Box,{'children':[a1_0x378527(Text,{'color':_0x114e88(0x66),'children':_0x114e88(0x88)}),a1_0x378527(Text,{'children':_0x114e88(0x6c)}),a1_0x378527(Text,{'color':_0x114e88(0x75),'children':_0x54c2be})]}):a1_0x378527(InputProjectCode,{'pagePath':_0x26e13e,'onSubmit':_0x42bdb4}),_0x54c2be&&_0x538fbd?a1_0x3688d9(Box,{'marginTop':0x1,'children':[a1_0x378527(Box,{'width':'4'}),a1_0x378527(Text,{'children':_0x114e88(0x80)})]}):null,_0x1e3b6a?a1_0x3688d9(a1_0x32d6f8,{'children':[a1_0x378527(Box,{'marginTop':0x1,'children':a1_0x378527(Text,{'color':_0x114e88(0x66),'children':'\x20*\x20页面创建成功!'})}),a1_0x3688d9(Box,{'children':[a1_0x378527(Text,{'color':_0x114e88(0x66),'children':_0x114e88(0x89)}),a1_0x378527(Text,{'color':_0x114e88(0x75),'children':_0xd8d7c})]}),a1_0x3688d9(Box,{'children':[a1_0x378527(Text,{'color':_0x114e88(0x66),'children':_0x114e88(0x83)}),a1_0x3688d9(Text,{'color':_0x114e88(0x75),'children':['/',_0x54c2be]})]}),a1_0x378527(Box,{'marginTop':0x1,'children':a1_0x378527(Text,{'color':_0x114e88(0x7b),'children':'\x20*\x20页面文件已创建,可直接通过路由访问'})})]}):null]});return a1_0x378527(SelectPageTemplate,{'onSelect':_0x448876});};
@@ -1 +1 @@
1
- function a2_0x4f7e(){const _0x176508=['isDirectory','resolve','length','420xtfnLT','758768UvqIoF','2jZGFdG','../..','gray','downArrow','localeCompare','234pJFaUz','join','\x20\x20\x20\x20\x20\x20\x20\x20','10376jpaeuw','1302873OGQDUD','green','50816JCCths','sdk-fetch','12229250BuSDWy','获取模板列表失败:','name','blank','4222284qGvuRt','map','\x20Step1:\x20','1009890OfbwiT','label','return','column','\x20\x20\x20\x20\x20\x20>\x20','dirname','templates/pages','sort'];a2_0x4f7e=function(){return _0x176508;};return a2_0x4f7e();}(function(_0x4f771b,_0x5f0a73){const _0x5e19cd=a2_0xf22e,_0x1416f0=_0x4f771b();while(!![]){try{const _0x4c5d2d=parseInt(_0x5e19cd(0x135))/0x1*(parseInt(_0x5e19cd(0x136))/0x2)+parseInt(_0x5e19cd(0x13f))/0x3+parseInt(_0x5e19cd(0x13e))/0x4*(-parseInt(_0x5e19cd(0x134))/0x5)+parseInt(_0x5e19cd(0x147))/0x6+-parseInt(_0x5e19cd(0x14a))/0x7+parseInt(_0x5e19cd(0x141))/0x8*(parseInt(_0x5e19cd(0x13b))/0x9)+-parseInt(_0x5e19cd(0x143))/0xa;if(_0x4c5d2d===_0x5f0a73)break;else _0x1416f0['push'](_0x1416f0['shift']());}catch(_0xad5ff4){_0x1416f0['push'](_0x1416f0['shift']());}}}(a2_0x4f7e,0x746a2));import{jsx as a2_0x534526,jsxs as a2_0xfd3a1d}from'react/jsx-runtime';import{useState,useEffect}from'react';import{Text,Box,useInput}from'ink';import{readdir}from'node:fs/promises';import a2_0x1865f1 from'node:path';import{fileURLToPath}from'node:url';async function getTemplateList(){const _0x3575dd=a2_0xf22e;try{const _0x2d3518=fileURLToPath(import.meta['url']),_0x240d42=a2_0x1865f1[_0x3575dd(0x153)](a2_0x1865f1[_0x3575dd(0x14f)](_0x2d3518),_0x3575dd(0x137)),_0x5a4a47=a2_0x1865f1[_0x3575dd(0x13c)](_0x240d42,_0x3575dd(0x150)),_0x3b2ed4=await readdir(_0x5a4a47,{'withFileTypes':!![]}),_0x2355cd=_0x3b2ed4['filter'](_0x283ce2=>_0x283ce2[_0x3575dd(0x152)]())[_0x3575dd(0x148)](_0x4cb68c=>({'label':_0x4cb68c[_0x3575dd(0x145)]}))[_0x3575dd(0x151)]((_0x2943ab,_0x5d9b46)=>_0x2943ab['label'][_0x3575dd(0x13a)](_0x5d9b46['label']));return _0x2355cd;}catch(_0xf18d3b){return console['error'](_0x3575dd(0x144),_0xf18d3b),[{'label':_0x3575dd(0x146)},{'label':_0x3575dd(0x142)}];}}function a2_0xf22e(_0x241063,_0x17e5ea){const _0x4f7e85=a2_0x4f7e();return a2_0xf22e=function(_0xf22ef5,_0x48119c){_0xf22ef5=_0xf22ef5-0x134;let _0x2b14b5=_0x4f7e85[_0xf22ef5];return _0x2b14b5;},a2_0xf22e(_0x241063,_0x17e5ea);}export function SelectPageTemplate(_0x2cd761){const _0x94175=a2_0xf22e,[_0x4feca8,_0xa322d5]=useState(0x0),[_0x275191,_0x17e7fd]=useState([]),[_0x59f8cf,_0x16e8b1]=useState(!![]);useEffect(()=>{async function _0x27b551(){const _0x310cda=await getTemplateList();_0x17e7fd(_0x310cda),_0x16e8b1(![]);}_0x27b551();},[]),useInput((_0xf0e814,_0x4d9705)=>{const _0x59060e=a2_0xf22e;if(_0x59f8cf)return;if(_0x4d9705[_0x59060e(0x14c)]){const _0x32f6e5=_0x275191[_0x4feca8];_0x32f6e5&&_0x2cd761['onSelect'](_0x32f6e5[_0x59060e(0x14b)]);}_0x4d9705['upArrow']&&_0xa322d5(_0x19afce=>_0x19afce===0x0?_0x275191[_0x59060e(0x154)]-0x1:_0x19afce-0x1),_0x4d9705[_0x59060e(0x139)]&&_0xa322d5(_0x242d46=>_0x242d46===_0x275191[_0x59060e(0x154)]-0x1?0x0:_0x242d46+0x1);});if(_0x59f8cf)return a2_0x534526(Box,{'flexDirection':_0x94175(0x14d),'paddingY':0x1,'children':a2_0xfd3a1d(Box,{'children':[a2_0x534526(Text,{'color':_0x94175(0x138),'children':_0x94175(0x149)}),a2_0x534526(Text,{'children':'正在加载页面模板...'})]})});return a2_0xfd3a1d(Box,{'flexDirection':'column','paddingY':0x1,'children':[a2_0xfd3a1d(Box,{'children':[a2_0x534526(Text,{'color':_0x94175(0x138),'children':_0x94175(0x149)}),a2_0x534526(Text,{'children':'请选择您要创建的页面模板'})]}),_0x275191[_0x94175(0x148)]((_0x521610,_0x3c4e29)=>{const _0x1ac7fa=_0x94175,_0x257875=_0x3c4e29===_0x4feca8,_0x5a952c=_0x257875?_0x1ac7fa(0x14e)+_0x521610['label']:_0x1ac7fa(0x13d)+_0x521610[_0x1ac7fa(0x14b)];return a2_0x534526(Box,{'children':a2_0x534526(Text,{'color':_0x257875?_0x1ac7fa(0x140):undefined,'children':_0x5a952c})},_0x5a952c);})]});}
1
+ (function(_0x1f2fb6,_0x437d72){const _0x307b80=a2_0x5af8,_0x103bf6=_0x1f2fb6();while(!![]){try{const _0x1ef944=parseInt(_0x307b80(0x1d4))/0x1+-parseInt(_0x307b80(0x1d7))/0x2+-parseInt(_0x307b80(0x1db))/0x3*(-parseInt(_0x307b80(0x1d6))/0x4)+parseInt(_0x307b80(0x1d0))/0x5*(parseInt(_0x307b80(0x1ca))/0x6)+-parseInt(_0x307b80(0x1be))/0x7+parseInt(_0x307b80(0x1c0))/0x8*(parseInt(_0x307b80(0x1c6))/0x9)+parseInt(_0x307b80(0x1c2))/0xa*(-parseInt(_0x307b80(0x1c5))/0xb);if(_0x1ef944===_0x437d72)break;else _0x103bf6['push'](_0x103bf6['shift']());}catch(_0x3c4c4d){_0x103bf6['push'](_0x103bf6['shift']());}}}(a2_0x49e1,0xa75cd));import{jsx as a2_0x189819,jsxs as a2_0x295cb7}from'react/jsx-runtime';function a2_0x5af8(_0x49c943,_0x19fd4f){const _0x49e111=a2_0x49e1();return a2_0x5af8=function(_0x5af884,_0x183f43){_0x5af884=_0x5af884-0x1b8;let _0x1c6f7c=_0x49e111[_0x5af884];return _0x1c6f7c;},a2_0x5af8(_0x49c943,_0x19fd4f);}function a2_0x49e1(){const _0x56c2a4=['resolve','sort','localeCompare','2662125PRWSZQ','join','获取模板列表失败:','url','913330pCzOqg','onSelect','595124erwKrR','1134278hHLKEj','请选择您要创建的页面模板','downArrow','\x20\x20\x20\x20\x20\x20>\x20','3ztpATI','\x20\x20\x20\x20\x20\x20\x20\x20','column','length','green','isDirectory','\x20Step1:\x20','2050524paECiT','return','16dfXijd','正在加载页面模板...','12092260UKqPvN','gray','label','11SwJrwt','5221251AAliWz','error','../..','templates/pages','6nevfYQ','blank','filter'];a2_0x49e1=function(){return _0x56c2a4;};return a2_0x49e1();}import{useState,useEffect}from'react';import{Text,Box,useInput}from'ink';import{readdir}from'node:fs/promises';import a2_0x56c14e from'node:path';import{fileURLToPath}from'node:url';async function getTemplateList(){const _0x12e614=a2_0x5af8;try{const _0x3f6d98=fileURLToPath(import.meta[_0x12e614(0x1d3)]),_0x2a352b=a2_0x56c14e[_0x12e614(0x1cd)](a2_0x56c14e['dirname'](_0x3f6d98),_0x12e614(0x1c8)),_0x3092ff=a2_0x56c14e[_0x12e614(0x1d1)](_0x2a352b,_0x12e614(0x1c9)),_0x2bad97=await readdir(_0x3092ff,{'withFileTypes':!![]}),_0x404056=_0x2bad97[_0x12e614(0x1cc)](_0x3917ad=>_0x3917ad[_0x12e614(0x1bc)]())['map'](_0x27d562=>({'label':_0x27d562['name']}))[_0x12e614(0x1ce)]((_0x1c89ed,_0x21d2cc)=>_0x1c89ed[_0x12e614(0x1c4)][_0x12e614(0x1cf)](_0x21d2cc['label']));return _0x404056;}catch(_0x4ec7c7){return console[_0x12e614(0x1c7)](_0x12e614(0x1d2),_0x4ec7c7),[{'label':_0x12e614(0x1cb)},{'label':'sdk-fetch'}];}}export function SelectPageTemplate(_0x3830d8){const _0x26aace=a2_0x5af8,[_0x525559,_0x4a55a4]=useState(0x0),[_0x2fcfb0,_0x480c1c]=useState([]),[_0x3382fa,_0x36d45b]=useState(!![]);useEffect(()=>{async function _0x2c28ed(){const _0x34ef56=await getTemplateList();_0x480c1c(_0x34ef56),_0x36d45b(![]);}_0x2c28ed();},[]),useInput((_0x4b13d4,_0x53fab8)=>{const _0x35e209=a2_0x5af8;if(_0x3382fa)return;if(_0x53fab8[_0x35e209(0x1bf)]){const _0x599a68=_0x2fcfb0[_0x525559];_0x599a68&&_0x3830d8[_0x35e209(0x1d5)](_0x599a68[_0x35e209(0x1c4)]);}_0x53fab8['upArrow']&&_0x4a55a4(_0x12b5fc=>_0x12b5fc===0x0?_0x2fcfb0[_0x35e209(0x1ba)]-0x1:_0x12b5fc-0x1),_0x53fab8[_0x35e209(0x1d9)]&&_0x4a55a4(_0x4062d7=>_0x4062d7===_0x2fcfb0[_0x35e209(0x1ba)]-0x1?0x0:_0x4062d7+0x1);});if(_0x3382fa)return a2_0x189819(Box,{'flexDirection':'column','paddingY':0x1,'children':a2_0x295cb7(Box,{'children':[a2_0x189819(Text,{'color':'gray','children':_0x26aace(0x1bd)}),a2_0x189819(Text,{'children':_0x26aace(0x1c1)})]})});return a2_0x295cb7(Box,{'flexDirection':_0x26aace(0x1b9),'paddingY':0x1,'children':[a2_0x295cb7(Box,{'children':[a2_0x189819(Text,{'color':_0x26aace(0x1c3),'children':_0x26aace(0x1bd)}),a2_0x189819(Text,{'children':_0x26aace(0x1d8)})]}),_0x2fcfb0['map']((_0x4e94f4,_0x96096)=>{const _0x5851db=_0x26aace,_0x28b41f=_0x96096===_0x525559,_0x2b5046=_0x28b41f?_0x5851db(0x1da)+_0x4e94f4[_0x5851db(0x1c4)]:_0x5851db(0x1b8)+_0x4e94f4[_0x5851db(0x1c4)];return a2_0x189819(Box,{'children':a2_0x189819(Text,{'color':_0x28b41f?_0x5851db(0x1bb):undefined,'children':_0x2b5046})},_0x2b5046);})]});}
@@ -1 +1 @@
1
- (function(_0xb6f3f9,_0x57b6b0){const _0x3d5d54=a3_0x1975,_0x528e3c=_0xb6f3f9();while(!![]){try{const _0x1ef4a1=-parseInt(_0x3d5d54(0xe7))/0x1+-parseInt(_0x3d5d54(0xef))/0x2+parseInt(_0x3d5d54(0xec))/0x3+-parseInt(_0x3d5d54(0xdb))/0x4*(-parseInt(_0x3d5d54(0xcf))/0x5)+-parseInt(_0x3d5d54(0xd4))/0x6+-parseInt(_0x3d5d54(0xe0))/0x7+-parseInt(_0x3d5d54(0xbc))/0x8*(-parseInt(_0x3d5d54(0xd3))/0x9);if(_0x1ef4a1===_0x57b6b0)break;else _0x528e3c['push'](_0x528e3c['shift']());}catch(_0x27a727){_0x528e3c['push'](_0x528e3c['shift']());}}}(a3_0x145e,0xf04c3));import{jsx as a3_0x40cbff,jsxs as a3_0x67b9d0,Fragment as a3_0x47a975}from'react/jsx-runtime';function a3_0x145e(){const _0x4c903a=['🚀\x20','filter','yellow','error','6572130TwTbMC','\x20-\x20','dim','api-doc','36ZxgQEU','1939212CZKnTu','⚠️\x20以下数据集生成失败:','join','\x1b[0m','success','\x20重新登录后再试','\x20个数据集中筛选出\x20','4sveHqF','正在获取数据集列表...','map','includes','white','13103356DIqJOs','正在生成\x20','length','filePath','column','\x1b[90m*\x20从\x20','*\x20共处理\x20','852280AECect','💡\x20请使用\x20','cyan','datasetCode','.md\x20(','2497473eccpjv','setLogPath','指定的数据集代码都不存在:\x20','2059032iQNVre','string','\x1b[33m!\x20以下数据集代码不存在:\x20','message','5828496mQpEYl','*\x20生成的文档文件:','\x20个数据集','datasetName','文档生成失败:\x20','env','使用指定的应用AppCode:\x20','log','./docs','\x20个数据集的文档...','√\x20文档生成完成!成功\x20','gray',',\x20失败\x20','文档生成完成','red'];a3_0x145e=function(){return _0x4c903a;};return a3_0x145e();}import{useEffect,useState}from'react';import{Box,Text,useApp}from'ink';import{readConfig,getConfigAppCode}from'../utils/config.js';import{initEnv}from'../constant/env.js';import{fetchModelList}from'./fetch-model-list.js';import{generateDatasetDocs}from'./api-doc.js';import{logger}from'../utils/logger.js';function a3_0x1975(_0x57d3d9,_0x6438a9){const _0x145e48=a3_0x145e();return a3_0x1975=function(_0x1975bb,_0x473e92){_0x1975bb=_0x1975bb-0xb9;let _0x168401=_0x145e48[_0x1975bb];return _0x168401;},a3_0x1975(_0x57d3d9,_0x6438a9);}export const ApiDocUI=({appCode:_0x5e688c,env:_0x500cea,output:_0x272752,extraParams:_0x2b9df7,datasetCodes:_0x5a2478})=>{const _0x2e8313=a3_0x1975,{exit:_0x109da6}=useApp(),[_0x31a320,_0x5b9218]=useState(![]),[_0x1cd5f2,_0x39c4c5]=useState(''),[_0xfe49db,_0x16ab1e]=useState(![]),[_0x434620,_0x5a83ae]=useState(null),[_0x48aa6c,_0x305456]=useState(null),[_0x4474c3,_0x2d477c]=useState(0x0),_0x53757b=readConfig(),_0x2d09bf=getConfigAppCode(),_0x3b2cfb=_0x5e688c||_0x2d09bf,_0x833fb3=typeof _0x53757b?.[_0x2e8313(0xc1)]===_0x2e8313(0xb9)?_0x53757b[_0x2e8313(0xc1)]:undefined,_0x2f3d95=_0x500cea||_0x833fb3||'online';initEnv(_0x2f3d95);const _0x5cac6c=_0x272752||_0x2e8313(0xc4),_0x49f532=_0x5e688c?_0x2e8313(0xc2)+_0x3b2cfb:'使用配置的应用AppCode:\x20'+_0x3b2cfb;useEffect(()=>{_0x5b9218(!![]),_0x9bbc9e();},[]),useEffect(()=>{(_0xfe49db||_0x434620)&&_0x109da6();},[_0xfe49db,_0x434620,_0x109da6]);async function _0x9bbc9e(){const _0x5a9249=_0x2e8313;if(!_0x3b2cfb){_0x5a83ae('未提供应用AppCode,且配置中也没有默认值');return;}try{logger[_0x5a9249(0xed)](process['cwd']()),_0x39c4c5(_0x5a9249(0xdc));const {configArray:_0x345533}=await fetchModelList(_0x3b2cfb);_0x2d477c(_0x345533['length']);if(_0x345533[_0x5a9249(0xe2)]===0x0){_0x5a83ae('未找到任何数据集');return;}let _0xf8dda2=_0x345533;if(_0x5a2478&&_0x5a2478[_0x5a9249(0xe2)]>0x0){_0xf8dda2=_0x345533[_0x5a9249(0xcc)](_0x9835a4=>_0x5a2478[_0x5a9249(0xde)](_0x9835a4[_0x5a9249(0xea)]));const _0x594be8=_0xf8dda2[_0x5a9249(0xdd)](_0x4f9d65=>_0x4f9d65[_0x5a9249(0xea)]),_0x580149=_0x5a2478[_0x5a9249(0xcc)](_0x518dfd=>!_0x594be8[_0x5a9249(0xde)](_0x518dfd));_0x580149[_0x5a9249(0xe2)]>0x0&&console[_0x5a9249(0xc3)](_0x5a9249(0xba)+_0x580149[_0x5a9249(0xd6)](',\x20')+_0x5a9249(0xd7));if(_0xf8dda2[_0x5a9249(0xe2)]===0x0){_0x5a83ae(_0x5a9249(0xee)+_0x5a2478[_0x5a9249(0xd6)](',\x20'));return;}console['log'](_0x5a9249(0xe5)+_0x345533[_0x5a9249(0xe2)]+_0x5a9249(0xda)+_0xf8dda2[_0x5a9249(0xe2)]+'\x20个匹配的数据集\x1b[0m');}_0x39c4c5(_0x5a9249(0xe1)+_0xf8dda2[_0x5a9249(0xe2)]+_0x5a9249(0xc5));const _0x114a73=await generateDatasetDocs(_0xf8dda2,_0x3b2cfb,_0x5cac6c,(_0x411d0c,_0x2b2e1b,_0x29c31e)=>{const _0x4d292b=_0x5a9249;_0x39c4c5('正在生成\x20'+_0x29c31e+_0x4d292b(0xeb)+_0x411d0c+'/'+_0x2b2e1b+')');},_0x2b9df7);_0x305456(_0x114a73),_0x16ab1e(!![]);const _0x58ec85=_0x114a73[_0x5a9249(0xcc)](_0x2df08b=>_0x2df08b['success'])[_0x5a9249(0xe2)],_0x4f0f9b=_0x114a73[_0x5a9249(0xcc)](_0x5ee3e7=>!_0x5ee3e7[_0x5a9249(0xd8)])[_0x5a9249(0xe2)];logger[_0x5a9249(0xd8)](_0x5a9249(0xd2),_0x5a9249(0xc9),undefined,{'totalCount':_0x114a73[_0x5a9249(0xe2)],'successCount':_0x58ec85,'failCount':_0x4f0f9b,'outputDir':_0x5cac6c});}catch(_0xfe433a){const _0x1b5888=_0xfe433a instanceof Error?_0xfe433a[_0x5a9249(0xbb)]:String(_0xfe433a);logger[_0x5a9249(0xce)]('api-doc',_0x5a9249(0xc0)+_0x1b5888,{'appCode':_0x3b2cfb,'outputDir':_0x5cac6c}),_0x5a83ae('文档生成失败:\x20'+_0x1b5888);}finally{_0x5b9218(![]);}}const _0x5b9d32=_0x48aa6c?.[_0x2e8313(0xcc)](_0x367c9a=>_0x367c9a['success'])[_0x2e8313(0xe2)]||0x0,_0x2be05b=_0x48aa6c?.['filter'](_0x11b52c=>!_0x11b52c[_0x2e8313(0xd8)])['length']||0x0;return a3_0x67b9d0(Box,{'flexDirection':_0x2e8313(0xe4),'children':[(_0x31a320||_0xfe49db)&&a3_0x67b9d0(Box,{'children':[a3_0x40cbff(Text,{'color':_0x2e8313(0xc7),'children':'*\x20'}),a3_0x40cbff(Text,{'color':_0x5e688c?_0x2e8313(0xdf):_0x2e8313(0xd1),'children':_0x49f532})]}),_0x31a320&&a3_0x40cbff(Box,{'children':a3_0x67b9d0(Text,{'children':[_0x2e8313(0xcb),_0x1cd5f2,'\x20(环境:\x20',_0x2f3d95,')']})}),_0xfe49db&&_0x48aa6c&&a3_0x67b9d0(Box,{'flexDirection':'column','children':[a3_0x40cbff(Box,{'children':a3_0x67b9d0(Text,{'color':'green','children':[_0x2e8313(0xc6),_0x5b9d32,'\x20个',_0x2be05b>0x0&&_0x2e8313(0xc8)+_0x2be05b+'\x20个']})}),a3_0x40cbff(Box,{'marginTop':0x1,'children':a3_0x67b9d0(Text,{'color':_0x2e8313(0xc7),'children':[_0x2e8313(0xe6),_0x4474c3,_0x2e8313(0xbe)]})}),a3_0x67b9d0(Box,{'marginTop':0x1,'children':[a3_0x40cbff(Text,{'color':_0x2e8313(0xc7),'children':'*\x20输出目录:\x20'}),a3_0x40cbff(Text,{'color':_0x2e8313(0xe9),'children':_0x5cac6c})]}),_0x5b9d32>0x0&&a3_0x67b9d0(a3_0x47a975,{'children':[a3_0x40cbff(Box,{'marginTop':0x1,'children':a3_0x40cbff(Text,{'color':'gray','children':_0x2e8313(0xbd)})}),_0x48aa6c[_0x2e8313(0xcc)](_0xee1c12=>_0xee1c12[_0x2e8313(0xd8)])[_0x2e8313(0xdd)]((_0x57a6e4,_0x5b4f16)=>a3_0x67b9d0(Box,{'marginLeft':0x2,'children':[a3_0x67b9d0(Text,{'color':_0x2e8313(0xe9),'children':['•\x20',_0x57a6e4[_0x2e8313(0xe3)]]}),a3_0x67b9d0(Text,{'color':_0x2e8313(0xd1),'children':[_0x2e8313(0xd0),_0x57a6e4[_0x2e8313(0xbf)]]})]},_0x5b4f16))]}),_0x2be05b>0x0&&a3_0x67b9d0(a3_0x47a975,{'children':[a3_0x40cbff(Box,{'marginTop':0x1,'children':a3_0x40cbff(Text,{'color':_0x2e8313(0xcd),'children':_0x2e8313(0xd5)})}),_0x48aa6c[_0x2e8313(0xcc)](_0x477913=>!_0x477913['success'])['map']((_0x4e4bbd,_0x509e16)=>a3_0x67b9d0(Box,{'marginLeft':0x2,'flexDirection':_0x2e8313(0xe4),'children':[a3_0x67b9d0(Text,{'color':'red','children':['•\x20',_0x4e4bbd[_0x2e8313(0xbf)],'\x20(',_0x4e4bbd[_0x2e8313(0xea)],')']}),_0x4e4bbd['error']&&a3_0x40cbff(Box,{'marginLeft':0x2,'children':a3_0x40cbff(Text,{'color':_0x2e8313(0xd1),'children':_0x4e4bbd[_0x2e8313(0xce)]})})]},_0x509e16))]})]}),_0x434620&&a3_0x67b9d0(Box,{'flexDirection':'column','children':[a3_0x40cbff(Box,{'children':a3_0x67b9d0(Text,{'color':_0x2e8313(0xca),'children':['❌\x20',_0x434620]})}),_0x434620[_0x2e8313(0xde)]('登录')&&a3_0x67b9d0(Box,{'marginTop':0x1,'children':[a3_0x40cbff(Text,{'color':_0x2e8313(0xcd),'children':_0x2e8313(0xe8)}),a3_0x40cbff(Text,{'color':'cyan','children':'lovrabet\x20auth'}),a3_0x40cbff(Text,{'color':'yellow','children':_0x2e8313(0xd9)})]})]})]});};
1
+ (function(_0x1bef4a,_0x31b9e1){const _0x3bc69c=a3_0x54b0,_0x165e09=_0x1bef4a();while(!![]){try{const _0x313756=parseInt(_0x3bc69c(0x124))/0x1+-parseInt(_0x3bc69c(0x15b))/0x2*(-parseInt(_0x3bc69c(0x120))/0x3)+parseInt(_0x3bc69c(0x158))/0x4+-parseInt(_0x3bc69c(0x150))/0x5+-parseInt(_0x3bc69c(0x131))/0x6*(parseInt(_0x3bc69c(0x149))/0x7)+parseInt(_0x3bc69c(0x13d))/0x8*(parseInt(_0x3bc69c(0x151))/0x9)+parseInt(_0x3bc69c(0x136))/0xa*(-parseInt(_0x3bc69c(0x13a))/0xb);if(_0x313756===_0x31b9e1)break;else _0x165e09['push'](_0x165e09['shift']());}catch(_0x4f9e7f){_0x165e09['push'](_0x165e09['shift']());}}}(a3_0x1075,0x974b4));import{jsx as a3_0x23b80f,jsxs as a3_0xb76d19,Fragment as a3_0x7b863}from'react/jsx-runtime';import{useEffect,useState}from'react';import{Box,Text,useApp}from'ink';import{readConfig,getConfigAppCode}from'../utils/config.js';function a3_0x54b0(_0xf89cba,_0x5daa01){const _0x1075ad=a3_0x1075();return a3_0x54b0=function(_0x54b097,_0x19dc4e){_0x54b097=_0x54b097-0x120;let _0x281a85=_0x1075ad[_0x54b097];return _0x281a85;},a3_0x54b0(_0xf89cba,_0x5daa01);}import{initEnv}from'../constant/env.js';function a3_0x1075(){const _0x4a1e90=['datasetCode','🚀\x20','1183651Msuqti','dim','\x20-\x20','success','文档生成失败:\x20','使用配置的应用AppCode:\x20','💡\x20请使用\x20','3544345GSdOiu','6390EIGBtz','log','gray','length','error','white','online','3274896sNfGuK','\x1b[0m','\x1b[33m!\x20以下数据集代码不存在:\x20','8Qpxxxq','300732AkiaNu','未提供应用AppCode,且配置中也没有默认值','red','setLogPath','1040930QqpNkc','\x20个数据集中筛选出\x20','column','正在生成\x20','string','*\x20生成的文档文件:','指定的数据集代码都不存在:\x20','map','文档生成完成','green','join','\x20个匹配的数据集\x1b[0m','./docs','12bkawsw','yellow',',\x20失败\x20','未找到任何数据集','\x20重新登录后再试','42650KDxOeP','api-doc','\x20个数据集','.md\x20(','2255HnbZAV','lovrabet\x20auth','filePath','3160gsgjuv','filter','includes','√\x20文档生成完成!成功\x20','cyan','\x20个数据集的文档...','\x20(环境:\x20','*\x20输出目录:\x20','env','cwd'];a3_0x1075=function(){return _0x4a1e90;};return a3_0x1075();}import{fetchModelList}from'./fetch-model-list.js';import{generateDatasetDocs}from'./api-doc.js';import{logger}from'../utils/logger.js';export const ApiDocUI=({appCode:_0x52739c,env:_0x37a566,output:_0x1a57e0,extraParams:_0x3e65fc,datasetCodes:_0x3edc3a})=>{const _0x354654=a3_0x54b0,{exit:_0x22e44c}=useApp(),[_0x40204e,_0x12528b]=useState(![]),[_0x543b29,_0x27f5c1]=useState(''),[_0x220a22,_0x16808c]=useState(![]),[_0x4105f6,_0x2cdbac]=useState(null),[_0x445ed2,_0x2f7d1b]=useState(null),[_0x3e003e,_0x4c7c0e]=useState(0x0),_0x249e0b=readConfig(),_0x2485e1=getConfigAppCode(),_0x1108bd=_0x52739c||_0x2485e1,_0x5e6ca6=typeof _0x249e0b?.[_0x354654(0x145)]===_0x354654(0x128)?_0x249e0b[_0x354654(0x145)]:undefined,_0x13c052=_0x37a566||_0x5e6ca6||_0x354654(0x157);initEnv(_0x13c052);const _0x9e722a=_0x1a57e0||_0x354654(0x130),_0x4e4d90=_0x52739c?'使用指定的应用AppCode:\x20'+_0x1108bd:_0x354654(0x14e)+_0x1108bd;useEffect(()=>{_0x12528b(!![]),_0x2059c6();},[]),useEffect(()=>{(_0x220a22||_0x4105f6)&&_0x22e44c();},[_0x220a22,_0x4105f6,_0x22e44c]);async function _0x2059c6(){const _0x155283=_0x354654;if(!_0x1108bd){_0x2cdbac(_0x155283(0x121));return;}try{logger[_0x155283(0x123)](process[_0x155283(0x146)]()),_0x27f5c1('正在获取数据集列表...');const {configArray:_0x3f1b36}=await fetchModelList(_0x1108bd);_0x4c7c0e(_0x3f1b36['length']);if(_0x3f1b36[_0x155283(0x154)]===0x0){_0x2cdbac(_0x155283(0x134));return;}let _0x41aa3b=_0x3f1b36;if(_0x3edc3a&&_0x3edc3a[_0x155283(0x154)]>0x0){_0x41aa3b=_0x3f1b36[_0x155283(0x13e)](_0x34f11d=>_0x3edc3a[_0x155283(0x13f)](_0x34f11d[_0x155283(0x147)]));const _0x13faa7=_0x41aa3b[_0x155283(0x12b)](_0x351340=>_0x351340[_0x155283(0x147)]),_0x5beb36=_0x3edc3a[_0x155283(0x13e)](_0x4e2796=>!_0x13faa7[_0x155283(0x13f)](_0x4e2796));_0x5beb36[_0x155283(0x154)]>0x0&&console[_0x155283(0x152)](_0x155283(0x15a)+_0x5beb36[_0x155283(0x12e)](',\x20')+_0x155283(0x159));if(_0x41aa3b[_0x155283(0x154)]===0x0){_0x2cdbac(_0x155283(0x12a)+_0x3edc3a[_0x155283(0x12e)](',\x20'));return;}console[_0x155283(0x152)]('\x1b[90m*\x20从\x20'+_0x3f1b36[_0x155283(0x154)]+_0x155283(0x125)+_0x41aa3b['length']+_0x155283(0x12f));}_0x27f5c1(_0x155283(0x127)+_0x41aa3b[_0x155283(0x154)]+_0x155283(0x142));const _0x1e01cb=await generateDatasetDocs(_0x41aa3b,_0x1108bd,_0x9e722a,(_0x307f93,_0x3f3114,_0x50b302)=>{const _0x28b1b6=_0x155283;_0x27f5c1(_0x28b1b6(0x127)+_0x50b302+_0x28b1b6(0x139)+_0x307f93+'/'+_0x3f3114+')');},_0x3e65fc);_0x2f7d1b(_0x1e01cb),_0x16808c(!![]);const _0x2d4040=_0x1e01cb[_0x155283(0x13e)](_0x61bd4d=>_0x61bd4d[_0x155283(0x14c)])[_0x155283(0x154)],_0x2c2ed3=_0x1e01cb[_0x155283(0x13e)](_0x46afcf=>!_0x46afcf[_0x155283(0x14c)])[_0x155283(0x154)];logger['success']('api-doc',_0x155283(0x12c),undefined,{'totalCount':_0x1e01cb[_0x155283(0x154)],'successCount':_0x2d4040,'failCount':_0x2c2ed3,'outputDir':_0x9e722a});}catch(_0x40ab5c){const _0x23653b=_0x40ab5c instanceof Error?_0x40ab5c['message']:String(_0x40ab5c);logger[_0x155283(0x155)](_0x155283(0x137),_0x155283(0x14d)+_0x23653b,{'appCode':_0x1108bd,'outputDir':_0x9e722a}),_0x2cdbac(_0x155283(0x14d)+_0x23653b);}finally{_0x12528b(![]);}}const _0x3f9add=_0x445ed2?.['filter'](_0x2ae926=>_0x2ae926[_0x354654(0x14c)])[_0x354654(0x154)]||0x0,_0x257200=_0x445ed2?.[_0x354654(0x13e)](_0xb702cf=>!_0xb702cf[_0x354654(0x14c)])[_0x354654(0x154)]||0x0;return a3_0xb76d19(Box,{'flexDirection':_0x354654(0x126),'children':[(_0x40204e||_0x220a22)&&a3_0xb76d19(Box,{'children':[a3_0x23b80f(Text,{'color':_0x354654(0x153),'children':'*\x20'}),a3_0x23b80f(Text,{'color':_0x52739c?_0x354654(0x156):_0x354654(0x14a),'children':_0x4e4d90})]}),_0x40204e&&a3_0x23b80f(Box,{'children':a3_0xb76d19(Text,{'children':[_0x354654(0x148),_0x543b29,_0x354654(0x143),_0x13c052,')']})}),_0x220a22&&_0x445ed2&&a3_0xb76d19(Box,{'flexDirection':_0x354654(0x126),'children':[a3_0x23b80f(Box,{'children':a3_0xb76d19(Text,{'color':_0x354654(0x12d),'children':[_0x354654(0x140),_0x3f9add,'\x20个',_0x257200>0x0&&_0x354654(0x133)+_0x257200+'\x20个']})}),a3_0x23b80f(Box,{'marginTop':0x1,'children':a3_0xb76d19(Text,{'color':_0x354654(0x153),'children':['*\x20共处理\x20',_0x3e003e,_0x354654(0x138)]})}),a3_0xb76d19(Box,{'marginTop':0x1,'children':[a3_0x23b80f(Text,{'color':'gray','children':_0x354654(0x144)}),a3_0x23b80f(Text,{'color':_0x354654(0x141),'children':_0x9e722a})]}),_0x3f9add>0x0&&a3_0xb76d19(a3_0x7b863,{'children':[a3_0x23b80f(Box,{'marginTop':0x1,'children':a3_0x23b80f(Text,{'color':_0x354654(0x153),'children':_0x354654(0x129)})}),_0x445ed2[_0x354654(0x13e)](_0x456b80=>_0x456b80['success'])[_0x354654(0x12b)]((_0x49e5b8,_0x577d91)=>a3_0xb76d19(Box,{'marginLeft':0x2,'children':[a3_0xb76d19(Text,{'color':'cyan','children':['•\x20',_0x49e5b8[_0x354654(0x13c)]]}),a3_0xb76d19(Text,{'color':'dim','children':[_0x354654(0x14b),_0x49e5b8['datasetName']]})]},_0x577d91))]}),_0x257200>0x0&&a3_0xb76d19(a3_0x7b863,{'children':[a3_0x23b80f(Box,{'marginTop':0x1,'children':a3_0x23b80f(Text,{'color':_0x354654(0x132),'children':'⚠️\x20以下数据集生成失败:'})}),_0x445ed2[_0x354654(0x13e)](_0x52e0a3=>!_0x52e0a3[_0x354654(0x14c)])['map']((_0x56c6b4,_0x43c09f)=>a3_0xb76d19(Box,{'marginLeft':0x2,'flexDirection':_0x354654(0x126),'children':[a3_0xb76d19(Text,{'color':'red','children':['•\x20',_0x56c6b4['datasetName'],'\x20(',_0x56c6b4[_0x354654(0x147)],')']}),_0x56c6b4['error']&&a3_0x23b80f(Box,{'marginLeft':0x2,'children':a3_0x23b80f(Text,{'color':_0x354654(0x14a),'children':_0x56c6b4['error']})})]},_0x43c09f))]})]}),_0x4105f6&&a3_0xb76d19(Box,{'flexDirection':_0x354654(0x126),'children':[a3_0x23b80f(Box,{'children':a3_0xb76d19(Text,{'color':_0x354654(0x122),'children':['❌\x20',_0x4105f6]})}),_0x4105f6[_0x354654(0x13f)]('登录')&&a3_0xb76d19(Box,{'marginTop':0x1,'children':[a3_0x23b80f(Text,{'color':'yellow','children':_0x354654(0x14f)}),a3_0x23b80f(Text,{'color':_0x354654(0x141),'children':_0x354654(0x13b)}),a3_0x23b80f(Text,{'color':_0x354654(0x132),'children':_0x354654(0x135)})]})]})]});};
@@ -1 +1 @@
1
- (function(_0x516f5f,_0x4406d0){const _0xea53fe=a4_0x2b3b,_0x31bafb=_0x516f5f();while(!![]){try{const _0x42fa96=parseInt(_0xea53fe(0xa5))/0x1+-parseInt(_0xea53fe(0x8f))/0x2+-parseInt(_0xea53fe(0x89))/0x3+-parseInt(_0xea53fe(0x9b))/0x4*(-parseInt(_0xea53fe(0xa2))/0x5)+-parseInt(_0xea53fe(0x88))/0x6*(-parseInt(_0xea53fe(0x96))/0x7)+parseInt(_0xea53fe(0x8d))/0x8+-parseInt(_0xea53fe(0x9e))/0x9;if(_0x42fa96===_0x4406d0)break;else _0x31bafb['push'](_0x31bafb['shift']());}catch(_0x40bc44){_0x31bafb['push'](_0x31bafb['shift']());}}}(a4_0x5a97,0x8e452));import{mkdirSync,writeFileSync}from'node:fs';import a4_0xbdd9ea from'node:path';import{getCookie}from'../auth/get-cookie.js';import{getApiDomain}from'../constant/domain.js';import{logger}from'../utils/logger.js';function a4_0x2b3b(_0x1e48dc,_0x368613){const _0x5a9756=a4_0x5a97();return a4_0x2b3b=function(_0x2b3b4b,_0x62d994){_0x2b3b4b=_0x2b3b4b-0x87;let _0x37de8e=_0x5a9756[_0x2b3b4b];return _0x37de8e;},a4_0x2b3b(_0x1e48dc,_0x368613);}export async function fetchDatasetDoc(_0x5e8431){const _0x597a55=a4_0x2b3b,{appCode:_0x19156e,datasetCode:_0x314170,datasetId:_0x3567d1,extraParams:_0x26faf6}=_0x5e8431,_0x5a32db=getApiDomain(),_0x595e42=_0x5a32db+'/api/node-toolbox/api-doc-generator',_0x389466={'appCode':_0x19156e,'datasetCode':_0x314170,'datasetId':_0x3567d1,..._0x26faf6||{}},_0x315f07=await fetch(_0x595e42,{'method':_0x597a55(0xad),'headers':{'Content-Type':_0x597a55(0xa9),'Cookie':getCookie()},'body':JSON[_0x597a55(0x99)](_0x389466)});if(!_0x315f07['ok']){if(_0x315f07[_0x597a55(0xa8)]===0x191)throw new Error('登录鉴权失败,登录已过期,请使用\x20lovrabet\x20auth\x20重新登录');let _0x4049be='';try{_0x4049be=await _0x315f07[_0x597a55(0x9f)]();}catch(_0x4cd72c){}throw new Error('获取文档失败\x20('+_0x314170+_0x597a55(0x98)+_0x315f07[_0x597a55(0xa8)]+(_0x4049be?'\x0a'+_0x4049be:''));}const _0x26a8ed=await _0x315f07[_0x597a55(0xac)]();if(!_0x26a8ed[_0x597a55(0xae)]||typeof _0x26a8ed['data'][_0x597a55(0x87)]!==_0x597a55(0x8b))throw new Error(_0x597a55(0x92)+_0x314170+_0x597a55(0x97));return _0x26a8ed[_0x597a55(0xae)][_0x597a55(0x87)];}function delay(_0x31338c){return new Promise(_0xbd6216=>setTimeout(_0xbd6216,_0x31338c));}function a4_0x5a97(){const _0x2ec874=['.md\x20-\x20','json','POST','data','markdown','1434kbEjnV','1136730YvUXaw','success','string','.md\x20(','4689360VaAJym','.md','606738AcyzFL','生成文档成功:\x20','length','响应数据格式错误\x20(','join','tableName','push','20419OpihdH','):缺少\x20data.markdown\x20字段','),HTTP状态码:\x20','stringify','error','4HADDfE','\x0a共有\x20','✓\x20成功生成:\x20','7423830yFOLDT','text','datasetCode','utf8','3902165OWqJwt','log','api-doc','26121UGoWwQ','name','message','status','application/json','✗\x20失败:\x20'];a4_0x5a97=function(){return _0x2ec874;};return a4_0x5a97();}export async function generateDatasetDocs(_0x426c01,_0x53c045,_0x2cb401='./docs',_0x2d1249,_0x40d83d){const _0xb24d23=a4_0x2b3b;mkdirSync(_0x2cb401,{'recursive':!![]});const _0x731bcc=[],_0x2b7ef9=_0x426c01[_0xb24d23(0x91)];console['log'](_0xb24d23(0x9c)+_0x2b7ef9+'\x20个数据集需要生成文档\x0a');for(let _0x52b976=0x0;_0x52b976<_0x426c01[_0xb24d23(0x91)];_0x52b976++){const _0x5c0fa2=_0x426c01[_0x52b976],_0x3f8b8f=_0x52b976+0x1,_0x270184=_0x5c0fa2[_0xb24d23(0x94)];try{console['log']('['+_0x3f8b8f+'/'+_0x2b7ef9+']\x20正在生成:\x20'+_0x270184+_0xb24d23(0x8c)+_0x5c0fa2[_0xb24d23(0xa6)]+')');_0x2d1249&&_0x2d1249(_0x3f8b8f,_0x2b7ef9,_0x270184);const _0x4892f4=await fetchDatasetDoc({'appCode':_0x53c045,'datasetCode':_0x5c0fa2[_0xb24d23(0xa0)],'datasetId':_0x5c0fa2['id'],'enableAI':![],'extraParams':_0x40d83d}),_0x4fa8c7=a4_0xbdd9ea[_0xb24d23(0x93)](_0x2cb401,_0x270184+_0xb24d23(0x8e));writeFileSync(_0x4fa8c7,_0x4892f4,{'encoding':_0xb24d23(0xa1)}),console['log'](_0xb24d23(0x9d)+_0x270184+_0xb24d23(0x8e)),logger[_0xb24d23(0x8a)]('api-doc',_0xb24d23(0x90)+_0x270184,undefined,{'datasetCode':_0x5c0fa2[_0xb24d23(0xa0)],'datasetName':_0x5c0fa2[_0xb24d23(0xa6)],'filePath':_0x4fa8c7,'progress':_0x3f8b8f+'/'+_0x2b7ef9}),_0x731bcc[_0xb24d23(0x95)]({'datasetCode':_0x5c0fa2['datasetCode'],'datasetName':_0x5c0fa2[_0xb24d23(0xa6)],'filePath':_0x4fa8c7,'success':!![]}),_0x3f8b8f<_0x2b7ef9&&await delay(0x1388);}catch(_0x1d39fd){const _0x3817a1=_0x1d39fd instanceof Error?_0x1d39fd[_0xb24d23(0xa7)]:String(_0x1d39fd);console[_0xb24d23(0xa3)](_0xb24d23(0xaa)+_0x270184+_0xb24d23(0xab)+_0x3817a1+'\x0a'),logger[_0xb24d23(0x9a)](_0xb24d23(0xa4),'生成文档失败:\x20'+_0x5c0fa2[_0xb24d23(0xa0)],{'datasetCode':_0x5c0fa2['datasetCode'],'datasetName':_0x5c0fa2[_0xb24d23(0xa6)],'error':_0x3817a1,'progress':_0x3f8b8f+'/'+_0x2b7ef9}),_0x731bcc[_0xb24d23(0x95)]({'datasetCode':_0x5c0fa2['datasetCode'],'datasetName':_0x5c0fa2[_0xb24d23(0xa6)],'filePath':'','success':![],'error':_0x3817a1}),_0x3f8b8f<_0x2b7ef9&&(console[_0xb24d23(0xa3)]('等待\x203\x20秒...\x0a'),await delay(0xbb8));}}return _0x731bcc;}
1
+ const a4_0x13dda7=a4_0x2be0;(function(_0x461ab0,_0x338b2c){const _0x53d4bd=a4_0x2be0,_0x378e4c=_0x461ab0();while(!![]){try{const _0x409875=parseInt(_0x53d4bd(0x1ed))/0x1*(-parseInt(_0x53d4bd(0x1e6))/0x2)+-parseInt(_0x53d4bd(0x1f3))/0x3+-parseInt(_0x53d4bd(0x1f0))/0x4+-parseInt(_0x53d4bd(0x1eb))/0x5+-parseInt(_0x53d4bd(0x1fa))/0x6+parseInt(_0x53d4bd(0x1e5))/0x7+-parseInt(_0x53d4bd(0x1ef))/0x8*(-parseInt(_0x53d4bd(0x1e3))/0x9);if(_0x409875===_0x338b2c)break;else _0x378e4c['push'](_0x378e4c['shift']());}catch(_0x19a915){_0x378e4c['push'](_0x378e4c['shift']());}}}(a4_0x273d,0x77760));import{mkdirSync,writeFileSync}from'node:fs';import a4_0x472112 from'node:path';function a4_0x2be0(_0x2f7b6a,_0x418dd9){const _0x273de4=a4_0x273d();return a4_0x2be0=function(_0x2be095,_0x4cec8c){_0x2be095=_0x2be095-0x1df;let _0x433a61=_0x273de4[_0x2be095];return _0x433a61;},a4_0x2be0(_0x2f7b6a,_0x418dd9);}function a4_0x273d(){const _0x48732f=['join','application/json','获取文档失败\x20(','),HTTP状态码:\x20','error','text','✗\x20失败:\x20','响应数据格式错误\x20(','3739509NGKpjr','登录鉴权失败,登录已过期,请使用\x20lovrabet\x20auth\x20重新登录','2086630kuWDvO','2qkKorA','生成文档失败:\x20','.md\x20-\x20','\x20个数据集需要生成文档\x0a','data','645980Vwuaxq','log','105548AnkqcX','datasetCode','40OgAwuj','2159492dYYNyx','string','name','801297qxSmAv','等待\x203\x20秒...\x0a','json','✓\x20成功生成:\x20','POST','length','success','5067402nkGxGf','.md\x20(','markdown','./docs','message','push','utf8','\x0a共有\x20',']\x20正在生成:\x20','.md'];a4_0x273d=function(){return _0x48732f;};return a4_0x273d();}import{getCookie}from'../auth/get-cookie.js';import{getApiDomain}from'../constant/domain.js';import{logger}from'../utils/logger.js';export async function fetchDatasetDoc(_0x81ee6c){const _0x13ecaf=a4_0x2be0,{appCode:_0x51a02d,datasetCode:_0x5c5b5f,datasetId:_0x177179,extraParams:_0x1fdbe5}=_0x81ee6c,_0x4a51dc=getApiDomain(),_0x42eca4=_0x4a51dc+'/api/node-toolbox/api-doc-generator',_0x3c6f4e={'appCode':_0x51a02d,'datasetCode':_0x5c5b5f,'datasetId':_0x177179,..._0x1fdbe5||{}},_0x11010b=await fetch(_0x42eca4,{'method':_0x13ecaf(0x1f7),'headers':{'Content-Type':_0x13ecaf(0x205),'Cookie':getCookie()},'body':JSON['stringify'](_0x3c6f4e)});if(!_0x11010b['ok']){if(_0x11010b['status']===0x191)throw new Error(_0x13ecaf(0x1e4));let _0x38d5c3='';try{_0x38d5c3=await _0x11010b[_0x13ecaf(0x1e0)]();}catch(_0x21a7e3){}throw new Error(_0x13ecaf(0x206)+_0x5c5b5f+_0x13ecaf(0x207)+_0x11010b['status']+(_0x38d5c3?'\x0a'+_0x38d5c3:''));}const _0x4a9b9a=await _0x11010b[_0x13ecaf(0x1f5)]();if(!_0x4a9b9a[_0x13ecaf(0x1ea)]||typeof _0x4a9b9a[_0x13ecaf(0x1ea)][_0x13ecaf(0x1fc)]!==_0x13ecaf(0x1f1))throw new Error(_0x13ecaf(0x1e2)+_0x5c5b5f+'):缺少\x20data.markdown\x20字段');return _0x4a9b9a[_0x13ecaf(0x1ea)][_0x13ecaf(0x1fc)];}function delay(_0x18e218){return new Promise(_0x235af5=>setTimeout(_0x235af5,_0x18e218));}export async function generateDatasetDocs(_0x13924a,_0x230d48,_0x17ca29=a4_0x13dda7(0x1fd),_0x11892c,_0x51a40b){const _0xfeb2ae=a4_0x13dda7;mkdirSync(_0x17ca29,{'recursive':!![]});const _0x3cd12d=[],_0x26e902=_0x13924a[_0xfeb2ae(0x1f8)];console[_0xfeb2ae(0x1ec)](_0xfeb2ae(0x201)+_0x26e902+_0xfeb2ae(0x1e9));for(let _0x722004=0x0;_0x722004<_0x13924a['length'];_0x722004++){const _0x12b2af=_0x13924a[_0x722004],_0x5a9b44=_0x722004+0x1,_0x5808ac=_0x12b2af['tableName'];try{console[_0xfeb2ae(0x1ec)]('['+_0x5a9b44+'/'+_0x26e902+_0xfeb2ae(0x202)+_0x5808ac+_0xfeb2ae(0x1fb)+_0x12b2af[_0xfeb2ae(0x1f2)]+')');_0x11892c&&_0x11892c(_0x5a9b44,_0x26e902,_0x5808ac);const _0x5e3022=await fetchDatasetDoc({'appCode':_0x230d48,'datasetCode':_0x12b2af[_0xfeb2ae(0x1ee)],'datasetId':_0x12b2af['id'],'enableAI':![],'extraParams':_0x51a40b}),_0x3f0907=a4_0x472112[_0xfeb2ae(0x204)](_0x17ca29,_0x5808ac+'.md');writeFileSync(_0x3f0907,_0x5e3022,{'encoding':_0xfeb2ae(0x200)}),console['log'](_0xfeb2ae(0x1f6)+_0x5808ac+_0xfeb2ae(0x203)),logger[_0xfeb2ae(0x1f9)]('api-doc','生成文档成功:\x20'+_0x5808ac,undefined,{'datasetCode':_0x12b2af['datasetCode'],'datasetName':_0x12b2af['name'],'filePath':_0x3f0907,'progress':_0x5a9b44+'/'+_0x26e902}),_0x3cd12d[_0xfeb2ae(0x1ff)]({'datasetCode':_0x12b2af['datasetCode'],'datasetName':_0x12b2af[_0xfeb2ae(0x1f2)],'filePath':_0x3f0907,'success':!![]}),_0x5a9b44<_0x26e902&&await delay(0x1388);}catch(_0x956e29){const _0x67228d=_0x956e29 instanceof Error?_0x956e29[_0xfeb2ae(0x1fe)]:String(_0x956e29);console[_0xfeb2ae(0x1ec)](_0xfeb2ae(0x1e1)+_0x5808ac+_0xfeb2ae(0x1e8)+_0x67228d+'\x0a'),logger[_0xfeb2ae(0x1df)]('api-doc',_0xfeb2ae(0x1e7)+_0x12b2af['datasetCode'],{'datasetCode':_0x12b2af[_0xfeb2ae(0x1ee)],'datasetName':_0x12b2af['name'],'error':_0x67228d,'progress':_0x5a9b44+'/'+_0x26e902}),_0x3cd12d['push']({'datasetCode':_0x12b2af[_0xfeb2ae(0x1ee)],'datasetName':_0x12b2af[_0xfeb2ae(0x1f2)],'filePath':'','success':![],'error':_0x67228d}),_0x5a9b44<_0x26e902&&(console[_0xfeb2ae(0x1ec)](_0xfeb2ae(0x1f4)),await delay(0xbb8));}}return _0x3cd12d;}
@@ -1 +1 @@
1
- (function(_0x1547d9,_0x6f0b7c){const _0x253c05=a5_0x4e5f,_0x2bbe90=_0x1547d9();while(!![]){try{const _0x5f5527=-parseInt(_0x253c05(0x19d))/0x1+-parseInt(_0x253c05(0x1ad))/0x2*(parseInt(_0x253c05(0x1a4))/0x3)+-parseInt(_0x253c05(0x1ab))/0x4*(parseInt(_0x253c05(0x1c9))/0x5)+parseInt(_0x253c05(0x1a1))/0x6*(parseInt(_0x253c05(0x1b0))/0x7)+parseInt(_0x253c05(0x1c0))/0x8+parseInt(_0x253c05(0x1a8))/0x9+-parseInt(_0x253c05(0x19e))/0xa*(-parseInt(_0x253c05(0x1a6))/0xb);if(_0x5f5527===_0x6f0b7c)break;else _0x2bbe90['push'](_0x2bbe90['shift']());}catch(_0x5c7eed){_0x2bbe90['push'](_0x2bbe90['shift']());}}}(a5_0x11ef,0x3eea1));import{jsx as a5_0x107747,jsxs as a5_0xa33714}from'react/jsx-runtime';function a5_0x11ef(){const _0x450450=['√\x20成功拉取\x20','12rzxysx','column','26jCkJAE','error','-\x20模型配置文件\x20(','40817sEEftX','\x20个,过滤重复','\x20-\x20客户端实例文件','gray','online','cwd','dim','lovrabet\x20auth','未提供应用AppCode,且配置中也没有默认值','client','-client','endsWith','import\x20','duplicateCount','yellow','message','1407312AUchGd','*\x20已生成文件:','setLogPath','\x20个模型','replace','\x20个模型)','\x20个数据集,生成','red','使用配置的应用AppCode:\x20','571870QjgbQc','./src/api/','.ts','\x20重新登录后再试','join','modelCount','28180PzcyZo','190eHlPKZ','datasetCount','拉取\x20API\x20配置失败:\x20','168oqJonu','cyan','💡\x20请使用\x20','73389JbypTI','string','155639keZwbL','api-pull','3051045ruZDJA','includes'];a5_0x11ef=function(){return _0x450450;};return a5_0x11ef();}import{useEffect,useState}from'react';import{Box,Text,useApp}from'ink';import{readConfig,getConfigAppCode}from'../utils/config.js';function a5_0x4e5f(_0x4ad81c,_0x282be5){const _0x11eff7=a5_0x11ef();return a5_0x4e5f=function(_0x4e5f20,_0x3dae86){_0x4e5f20=_0x4e5f20-0x19d;let _0x502032=_0x11eff7[_0x4e5f20];return _0x502032;},a5_0x4e5f(_0x4ad81c,_0x282be5);}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:_0x377ab8,env:_0xaf61bf,output:_0x4ee27b})=>{const _0x212910=a5_0x4e5f,{exit:_0x149305}=useApp(),[_0x7f46c3,_0x340c6e]=useState(![]),[_0x41dad0,_0x1f039d]=useState(![]),[_0x365f69,_0x89464a]=useState(null),[_0x4792af,_0x20a108]=useState(null),_0x11c411=readConfig(),_0x165b22=getConfigAppCode(),_0x115b07=_0x377ab8||_0x165b22,_0x3d05ca=typeof _0x11c411?.['env']===_0x212910(0x1a5)?_0x11c411['env']:undefined,_0x53355e=_0xaf61bf||_0x3d05ca||_0x212910(0x1b4);initEnv(_0x53355e);const _0x16d0fe=_0x4ee27b||_0x212910(0x1ca),_0x37c1cb=_0x377ab8&&_0x377ab8[_0x212910(0x1a9)]('-')?_0x377ab8['split']('-')['slice'](0x1)[_0x212910(0x1cd)]('-'):'',_0x307de5=_0x377ab8?'使用指定的应用AppCode:\x20'+_0x115b07:_0x212910(0x1c8)+_0x115b07,_0x410c4b=_0x37c1cb?_0x37c1cb+'-api':'api',_0x5827e6=_0x37c1cb?_0x37c1cb+_0x212910(0x1ba):_0x212910(0x1b9);useEffect(()=>{_0x340c6e(!![]),_0x8ca12f();},[]),useEffect(()=>{(_0x41dad0||_0x365f69)&&_0x149305();},[_0x41dad0,_0x365f69,_0x149305]);async function _0x8ca12f(){const _0x5f3958=_0x212910;if(!_0x115b07){_0x89464a(_0x5f3958(0x1b8));return;}try{logger[_0x5f3958(0x1c2)](process[_0x5f3958(0x1b5)]());const {configArray:_0x57f6d8}=await fetchModelList(_0x115b07),_0x350604=_0x57f6d8['length'],_0x228291=!_0x377ab8,_0x410bcd=await generateApiFile(_0x57f6d8,_0x37c1cb,_0x115b07,_0x228291,_0x53355e,_0x16d0fe),_0x13bcc8=_0x16d0fe[_0x5f3958(0x1bb)]('/')?_0x16d0fe:_0x16d0fe+'/';_0x20a108({'api':''+_0x13bcc8+_0x410c4b+_0x5f3958(0x1cb),'client':''+_0x13bcc8+_0x5827e6+'.ts','modelCount':_0x410bcd[_0x5f3958(0x1ce)],'datasetCount':_0x350604,'originalCount':_0x350604,'duplicateCount':0x0}),_0x1f039d(!![]);}catch(_0x88193d){const _0x35306c=_0x88193d instanceof Error?_0x88193d[_0x5f3958(0x1bf)]:String(_0x88193d);logger[_0x5f3958(0x1ae)](_0x5f3958(0x1a7),_0x5f3958(0x1a0)+_0x35306c,{'appCode':_0x115b07,'error':_0x35306c}),_0x89464a(_0x5f3958(0x1a0)+_0x35306c);}finally{_0x340c6e(![]);}}return a5_0xa33714(Box,{'flexDirection':_0x212910(0x1ac),'children':[(_0x7f46c3||_0x41dad0)&&a5_0xa33714(Box,{'children':[a5_0x107747(Text,{'color':_0x212910(0x1b3),'children':'*\x20'}),a5_0x107747(Text,{'color':_0x377ab8?'white':'dim','children':_0x307de5})]}),_0x7f46c3&&a5_0x107747(Box,{'children':a5_0xa33714(Text,{'children':['🚀\x20正在从服务器拉取\x20API\x20配置...\x20(环境:\x20',_0x53355e,')']})}),_0x41dad0&&_0x4792af&&a5_0xa33714(Box,{'flexDirection':_0x212910(0x1ac),'children':[a5_0x107747(Box,{'children':a5_0xa33714(Text,{'color':'green','children':[_0x212910(0x1aa),_0x4792af[_0x212910(0x19f)],_0x212910(0x1c6),'\x20',_0x4792af['modelCount'],_0x212910(0x1c3)]})}),_0x4792af[_0x212910(0x1bd)]>0x0&&a5_0x107747(Box,{'marginTop':0x1,'children':a5_0xa33714(Text,{'color':_0x212910(0x1be),'children':['!\x20原始数据集\x20',_0x4792af['originalCount'],_0x212910(0x1b1),'\x20',_0x4792af[_0x212910(0x1bd)],'\x20个']})}),a5_0x107747(Box,{'marginTop':0x1,'children':a5_0x107747(Text,{'color':_0x212910(0x1b3),'children':_0x212910(0x1c1)})}),a5_0xa33714(Box,{'marginLeft':0x2,'children':[a5_0xa33714(Text,{'color':_0x212910(0x1a2),'children':['•\x20',_0x4792af['api']]}),a5_0xa33714(Text,{'color':_0x212910(0x1b6),'children':['\x20',_0x212910(0x1af),_0x4792af[_0x212910(0x1ce)],_0x212910(0x1c5)]})]}),a5_0xa33714(Box,{'marginLeft':0x2,'children':[a5_0xa33714(Text,{'color':_0x212910(0x1a2),'children':['•\x20',_0x4792af[_0x212910(0x1b9)]]}),a5_0x107747(Text,{'color':_0x212910(0x1b6),'children':_0x212910(0x1b2)})]}),a5_0x107747(Box,{'marginTop':0x1,'children':a5_0x107747(Text,{'color':_0x212910(0x1b3),'children':'*\x20导入方式:'})}),a5_0x107747(Box,{'marginLeft':0x2,'children':a5_0xa33714(Text,{'color':_0x212910(0x1be),'children':[_0x212910(0x1bc),'{\x20lovrabetClient\x20}','\x20from\x20\x27@/',_0x4792af[_0x212910(0x1b9)][_0x212910(0x1c4)](/^\.\//,'')[_0x212910(0x1c4)](_0x212910(0x1cb),''),'\x27']})})]}),_0x365f69&&a5_0xa33714(Box,{'flexDirection':'column','children':[a5_0x107747(Box,{'children':a5_0xa33714(Text,{'color':_0x212910(0x1c7),'children':['❌\x20',_0x365f69]})}),_0x365f69[_0x212910(0x1a9)]('登录')&&a5_0xa33714(Box,{'marginTop':0x1,'children':[a5_0x107747(Text,{'color':_0x212910(0x1be),'children':_0x212910(0x1a3)}),a5_0x107747(Text,{'color':_0x212910(0x1a2),'children':_0x212910(0x1b7)}),a5_0x107747(Text,{'color':'yellow','children':_0x212910(0x1cc)})]})]})]});};
1
+ (function(_0x28c1a1,_0x345f71){const _0x3b8fc5=a5_0x5430,_0x206476=_0x28c1a1();while(!![]){try{const _0x2cf85f=parseInt(_0x3b8fc5(0x123))/0x1+-parseInt(_0x3b8fc5(0x131))/0x2+parseInt(_0x3b8fc5(0x129))/0x3*(-parseInt(_0x3b8fc5(0x105))/0x4)+-parseInt(_0x3b8fc5(0x112))/0x5+parseInt(_0x3b8fc5(0xff))/0x6*(-parseInt(_0x3b8fc5(0x124))/0x7)+parseInt(_0x3b8fc5(0xfc))/0x8*(-parseInt(_0x3b8fc5(0xfe))/0x9)+parseInt(_0x3b8fc5(0x104))/0xa;if(_0x2cf85f===_0x345f71)break;else _0x206476['push'](_0x206476['shift']());}catch(_0x57fdb7){_0x206476['push'](_0x206476['shift']());}}}(a5_0x442e,0x6b65a));function a5_0x5430(_0x4d8849,_0x1f1efc){const _0x442eae=a5_0x442e();return a5_0x5430=function(_0x5430fc,_0xd7769c){_0x5430fc=_0x5430fc-0xfb;let _0x186083=_0x442eae[_0x5430fc];return _0x186083;},a5_0x5430(_0x4d8849,_0x1f1efc);}import{jsx as a5_0x59cac3,jsxs as a5_0x307464}from'react/jsx-runtime';import{useEffect,useState}from'react';import{Box,Text,useApp}from'ink';import{readConfig,getConfigAppCode}from'../utils/config.js';import{initEnv}from'../constant/env.js';import{generateApiFile}from'./generate-api-file.js';import{logger}from'../utils/logger.js';function a5_0x442e(){const _0x2038a7=['√\x20成功拉取\x20','originalCount','yellow','white','gray','\x20个数据集,生成','.ts','split','red','\x20from\x20\x27@/','length','拉取\x20API\x20配置失败:\x20','cwd','\x20个模型','cyan','column','725204HeiJAg','14oZWYSJ','env','setLogPath','import\x20','client','2634591XXcoAC','api','*\x20导入方式:','error','使用指定的应用AppCode:\x20','-client','{\x20lovrabetClient\x20}','api-pull','1740692NDjMOL','string','使用配置的应用AppCode:\x20','144WbuWbP','*\x20已生成文件:','383877CoPOgQ','1647402dXZPAE','./src/api/','modelCount','slice','\x20个,过滤重复','33004270AHOUIA','4aLAiad','💡\x20请使用\x20','green','endsWith','!\x20原始数据集\x20','duplicateCount','replace','🚀\x20正在从服务器拉取\x20API\x20配置...\x20(环境:\x20','message','dim','includes','-api','\x20个模型)','2601510MULjKF'];a5_0x442e=function(){return _0x2038a7;};return a5_0x442e();}import{fetchModelList}from'./fetch-model-list.js';export const ApiPullUI=({appCode:_0x208f66,env:_0x1e51e5,output:_0x4a4eb9})=>{const _0x553019=a5_0x5430,{exit:_0x531dd3}=useApp(),[_0x48be15,_0x5e72e5]=useState(![]),[_0x53809e,_0x57c05a]=useState(![]),[_0x4b802e,_0x875d53]=useState(null),[_0x2cd1d7,_0x49ee72]=useState(null),_0x5d64df=readConfig(),_0x11f9cd=getConfigAppCode(),_0x1e5724=_0x208f66||_0x11f9cd,_0x3578b8=typeof _0x5d64df?.[_0x553019(0x125)]===_0x553019(0x132)?_0x5d64df['env']:undefined,_0x49fd42=_0x1e51e5||_0x3578b8||'online';initEnv(_0x49fd42);const _0x47250d=_0x4a4eb9||_0x553019(0x100),_0x8300de=_0x208f66&&_0x208f66[_0x553019(0x10f)]('-')?_0x208f66[_0x553019(0x11a)]('-')[_0x553019(0x102)](0x1)['join']('-'):'',_0x55c9bb=_0x208f66?_0x553019(0x12d)+_0x1e5724:_0x553019(0xfb)+_0x1e5724,_0xce2d84=_0x8300de?_0x8300de+_0x553019(0x110):_0x553019(0x12a),_0x2a2ba5=_0x8300de?_0x8300de+_0x553019(0x12e):_0x553019(0x128);useEffect(()=>{_0x5e72e5(!![]),_0x8bcb6f();},[]),useEffect(()=>{(_0x53809e||_0x4b802e)&&_0x531dd3();},[_0x53809e,_0x4b802e,_0x531dd3]);async function _0x8bcb6f(){const _0x54302d=_0x553019;if(!_0x1e5724){_0x875d53('未提供应用AppCode,且配置中也没有默认值');return;}try{logger[_0x54302d(0x126)](process[_0x54302d(0x11f)]());const {configArray:_0x2be7c3}=await fetchModelList(_0x1e5724),_0x3bcb4e=_0x2be7c3[_0x54302d(0x11d)],_0x5cd535=!_0x208f66,_0x3b4cd9=await generateApiFile(_0x2be7c3,_0x8300de,_0x1e5724,_0x5cd535,_0x49fd42,_0x47250d),_0x548f2a=_0x47250d[_0x54302d(0x108)]('/')?_0x47250d:_0x47250d+'/';_0x49ee72({'api':''+_0x548f2a+_0xce2d84+_0x54302d(0x119),'client':''+_0x548f2a+_0x2a2ba5+'.ts','modelCount':_0x3b4cd9[_0x54302d(0x101)],'datasetCount':_0x3bcb4e,'originalCount':_0x3bcb4e,'duplicateCount':0x0}),_0x57c05a(!![]);}catch(_0x5ecf40){const _0x37b558=_0x5ecf40 instanceof Error?_0x5ecf40[_0x54302d(0x10d)]:String(_0x5ecf40);logger[_0x54302d(0x12c)](_0x54302d(0x130),_0x54302d(0x11e)+_0x37b558,{'appCode':_0x1e5724,'error':_0x37b558}),_0x875d53(_0x54302d(0x11e)+_0x37b558);}finally{_0x5e72e5(![]);}}return a5_0x307464(Box,{'flexDirection':_0x553019(0x122),'children':[(_0x48be15||_0x53809e)&&a5_0x307464(Box,{'children':[a5_0x59cac3(Text,{'color':_0x553019(0x117),'children':'*\x20'}),a5_0x59cac3(Text,{'color':_0x208f66?_0x553019(0x116):_0x553019(0x10e),'children':_0x55c9bb})]}),_0x48be15&&a5_0x59cac3(Box,{'children':a5_0x307464(Text,{'children':[_0x553019(0x10c),_0x49fd42,')']})}),_0x53809e&&_0x2cd1d7&&a5_0x307464(Box,{'flexDirection':_0x553019(0x122),'children':[a5_0x59cac3(Box,{'children':a5_0x307464(Text,{'color':_0x553019(0x107),'children':[_0x553019(0x113),_0x2cd1d7['datasetCount'],_0x553019(0x118),'\x20',_0x2cd1d7[_0x553019(0x101)],_0x553019(0x120)]})}),_0x2cd1d7[_0x553019(0x10a)]>0x0&&a5_0x59cac3(Box,{'marginTop':0x1,'children':a5_0x307464(Text,{'color':'yellow','children':[_0x553019(0x109),_0x2cd1d7[_0x553019(0x114)],_0x553019(0x103),'\x20',_0x2cd1d7[_0x553019(0x10a)],'\x20个']})}),a5_0x59cac3(Box,{'marginTop':0x1,'children':a5_0x59cac3(Text,{'color':'gray','children':_0x553019(0xfd)})}),a5_0x307464(Box,{'marginLeft':0x2,'children':[a5_0x307464(Text,{'color':_0x553019(0x121),'children':['•\x20',_0x2cd1d7[_0x553019(0x12a)]]}),a5_0x307464(Text,{'color':_0x553019(0x10e),'children':['\x20','-\x20模型配置文件\x20(',_0x2cd1d7[_0x553019(0x101)],_0x553019(0x111)]})]}),a5_0x307464(Box,{'marginLeft':0x2,'children':[a5_0x307464(Text,{'color':'cyan','children':['•\x20',_0x2cd1d7[_0x553019(0x128)]]}),a5_0x59cac3(Text,{'color':_0x553019(0x10e),'children':'\x20-\x20客户端实例文件'})]}),a5_0x59cac3(Box,{'marginTop':0x1,'children':a5_0x59cac3(Text,{'color':_0x553019(0x117),'children':_0x553019(0x12b)})}),a5_0x59cac3(Box,{'marginLeft':0x2,'children':a5_0x307464(Text,{'color':_0x553019(0x115),'children':[_0x553019(0x127),_0x553019(0x12f),_0x553019(0x11c),_0x2cd1d7[_0x553019(0x128)][_0x553019(0x10b)](/^\.\//,'')[_0x553019(0x10b)](_0x553019(0x119),''),'\x27']})})]}),_0x4b802e&&a5_0x307464(Box,{'flexDirection':'column','children':[a5_0x59cac3(Box,{'children':a5_0x307464(Text,{'color':_0x553019(0x11b),'children':['❌\x20',_0x4b802e]})}),_0x4b802e[_0x553019(0x10f)]('登录')&&a5_0x307464(Box,{'marginTop':0x1,'children':[a5_0x59cac3(Text,{'color':_0x553019(0x115),'children':_0x553019(0x106)}),a5_0x59cac3(Text,{'color':'cyan','children':'lovrabet\x20auth'}),a5_0x59cac3(Text,{'color':'yellow','children':'\x20重新登录后再试'})]})]})]});};
@@ -1 +1 @@
1
- (function(_0x2f125c,_0x8a7146){const _0x52ad54=a6_0xb44c,_0x23e575=_0x2f125c();while(!![]){try{const _0x587212=-parseInt(_0x52ad54(0xe2))/0x1+parseInt(_0x52ad54(0xea))/0x2*(-parseInt(_0x52ad54(0xe7))/0x3)+-parseInt(_0x52ad54(0xdc))/0x4+-parseInt(_0x52ad54(0xe6))/0x5+parseInt(_0x52ad54(0xe5))/0x6+-parseInt(_0x52ad54(0xe1))/0x7+-parseInt(_0x52ad54(0xd9))/0x8*(-parseInt(_0x52ad54(0xd8))/0x9);if(_0x587212===_0x8a7146)break;else _0x23e575['push'](_0x23e575['shift']());}catch(_0x189d6f){_0x23e575['push'](_0x23e575['shift']());}}}(a6_0x4023,0x68aaf));import{getCookie}from'../auth/get-cookie.js';import{getApiDomain}from'../constant/domain.js';import{logger}from'../utils/logger.js';function a6_0xb44c(_0x4e8e80,_0x38ee0b){const _0x402396=a6_0x4023();return a6_0xb44c=function(_0xb44cb5,_0x1d4a2a){_0xb44cb5=_0xb44cb5-0xd5;let _0x5e3e9d=_0x402396[_0xb44cb5];return _0x5e3e9d;},a6_0xb44c(_0x4e8e80,_0x38ee0b);}function a6_0x4023(){const _0x56e632=['&otype=array','4823550FwVoQB','1421275aQPrBH','386013gXQjTy','info','status','2tFrTeF','configArray','登录鉴权失败,登录已过期,请使用\x20lovrabet\x20auth\x20重新登录','fetch-model-list','正在从服务器拉取模型列表...\x20(环境:\x20','2722338snxYmt','24iYqPAf','json','message','144552XpcDuP','data','获取数据集失败:\x20','count','获取数据集失败,HTTP状态码:\x20','4127403bZQRnM','243959ZvNbCb','/api/node-toolbox/dataset/model-list?appcode='];a6_0x4023=function(){return _0x56e632;};return a6_0x4023();}import{getEnv}from'../constant/env.js';export async function fetchModelList(_0x42c2c0){const _0x518bb3=a6_0xb44c,_0x8e8cb=getEnv(),_0x13864d=getApiDomain()+_0x518bb3(0xe3)+_0x42c2c0+_0x518bb3(0xe4);logger[_0x518bb3(0xe8)](_0x518bb3(0xd6),_0x518bb3(0xd7)+_0x8e8cb+')',{'apiUrl':_0x13864d});const _0x33dc5c=await fetch(_0x13864d,{'headers':{'Cookie':getCookie()}});if(!_0x33dc5c['ok']){if(_0x33dc5c[_0x518bb3(0xe9)]===0x191)throw new Error(_0x518bb3(0xd5));throw new Error(_0x518bb3(0xe0)+_0x33dc5c[_0x518bb3(0xe9)]);}const _0x4242ed=await _0x33dc5c[_0x518bb3(0xda)]();if(!_0x4242ed['success'])throw new Error(_0x518bb3(0xde)+(_0x4242ed[_0x518bb3(0xdb)]||'未知错误'));return{'configArray':_0x4242ed['data'][_0x518bb3(0xeb)],'count':_0x4242ed[_0x518bb3(0xdd)][_0x518bb3(0xdf)]};}
1
+ (function(_0x455d9a,_0xb5370f){const _0x5e5bdd=a6_0x2d1a,_0x57b596=_0x455d9a();while(!![]){try{const _0x199ef7=parseInt(_0x5e5bdd(0x7c))/0x1*(-parseInt(_0x5e5bdd(0x89))/0x2)+-parseInt(_0x5e5bdd(0x80))/0x3+-parseInt(_0x5e5bdd(0x8b))/0x4+-parseInt(_0x5e5bdd(0x8c))/0x5+-parseInt(_0x5e5bdd(0x86))/0x6+-parseInt(_0x5e5bdd(0x85))/0x7+parseInt(_0x5e5bdd(0x7f))/0x8*(parseInt(_0x5e5bdd(0x7d))/0x9);if(_0x199ef7===_0xb5370f)break;else _0x57b596['push'](_0x57b596['shift']());}catch(_0x395e61){_0x57b596['push'](_0x57b596['shift']());}}}(a6_0x5799,0xda787));function a6_0x5799(){const _0x9d4e36=['status','count','44hJKUAh','765GcVaJO','message','753568dttXcP','3713697xskuDd','登录鉴权失败,登录已过期,请使用\x20lovrabet\x20auth\x20重新登录','/api/node-toolbox/dataset/model-list?appcode=','未知错误','data','8525286nAEsYX','3624606MaPIlh','json','正在从服务器拉取模型列表...\x20(环境:\x20','79522XAKONg','success','3476488TpuzzF','7166505TQYUQr','获取数据集失败:\x20','&otype=array'];a6_0x5799=function(){return _0x9d4e36;};return a6_0x5799();}function a6_0x2d1a(_0x4a4775,_0x225645){const _0x5799a4=a6_0x5799();return a6_0x2d1a=function(_0x2d1ab5,_0x4bc033){_0x2d1ab5=_0x2d1ab5-0x7a;let _0x20e457=_0x5799a4[_0x2d1ab5];return _0x20e457;},a6_0x2d1a(_0x4a4775,_0x225645);}import{getCookie}from'../auth/get-cookie.js';import{getApiDomain}from'../constant/domain.js';import{logger}from'../utils/logger.js';import{getEnv}from'../constant/env.js';export async function fetchModelList(_0xa3e22e){const _0xdb3d40=a6_0x2d1a,_0x12baa8=getEnv(),_0x436f3d=getApiDomain()+_0xdb3d40(0x82)+_0xa3e22e+_0xdb3d40(0x8e);logger['info']('fetch-model-list',_0xdb3d40(0x88)+_0x12baa8+')',{'apiUrl':_0x436f3d});const _0x2c2633=await fetch(_0x436f3d,{'headers':{'Cookie':getCookie()}});if(!_0x2c2633['ok']){if(_0x2c2633[_0xdb3d40(0x7a)]===0x191)throw new Error(_0xdb3d40(0x81));throw new Error('获取数据集失败,HTTP状态码:\x20'+_0x2c2633[_0xdb3d40(0x7a)]);}const _0x26e70a=await _0x2c2633[_0xdb3d40(0x87)]();if(!_0x26e70a[_0xdb3d40(0x8a)])throw new Error(_0xdb3d40(0x8d)+(_0x26e70a[_0xdb3d40(0x7e)]||_0xdb3d40(0x83)));return{'configArray':_0x26e70a[_0xdb3d40(0x84)]['configArray'],'count':_0x26e70a[_0xdb3d40(0x84)][_0xdb3d40(0x7b)]};}
@@ -1 +1 @@
1
- const a7_0x46f415=a7_0x4d77;(function(_0x1bfc47,_0x1bc5b0){const _0x29b013=a7_0x4d77,_0x3fe46f=_0x1bfc47();while(!![]){try{const _0x1a32e7=parseInt(_0x29b013(0x7d))/0x1+parseInt(_0x29b013(0x7f))/0x2*(parseInt(_0x29b013(0x88))/0x3)+-parseInt(_0x29b013(0x87))/0x4*(-parseInt(_0x29b013(0x8d))/0x5)+parseInt(_0x29b013(0x79))/0x6*(parseInt(_0x29b013(0x8a))/0x7)+parseInt(_0x29b013(0x86))/0x8+parseInt(_0x29b013(0x97))/0x9+parseInt(_0x29b013(0x96))/0xa*(-parseInt(_0x29b013(0x80))/0xb);if(_0x1a32e7===_0x1bc5b0)break;else _0x3fe46f['push'](_0x3fe46f['shift']());}catch(_0x27195a){_0x3fe46f['push'](_0x3fe46f['shift']());}}}(a7_0x2518,0x9ea55));import a7_0x3f2b33 from'prettier';import{mkdirSync,writeFileSync,readFileSync}from'node:fs';function a7_0x2518(){const _0x1cb136=['./src/api/','client','success','4202080zZckND','69304FZDwNp','14106jILhol','{\x20apiConfigName:\x20','77PNJOoE','datasetCode','replaceApiContent','5oFebMQ','online','tableName','resolve','length','key','endsWith','-client','keys','40yfbBAO','6280578ZHnqdN','CONFIG_NAMES.DEFAULT','client.ts.tpl','string','请先通过\x20`lovrabet\x20config\x20set\x20app\x20<value>`\x20配置应用\x20Code','dirname','API\x20文件生成成功!','join',',\x20env:\x20\x22','utf8','typescript','app','86766tznCYG','.ts','name','../..','444804QfdzET','api','530MwTySP','6711430BzLgcm','url','slice'];a7_0x2518=function(){return _0x1cb136;};return a7_0x2518();}import a7_0x5d0510 from'node:path';import{fileURLToPath}from'node:url';import{readConfig}from'../utils/config.js';import{TemplateReplacer}from'../utils/template-replacer.js';import{logger}from'../utils/logger.js';function a7_0x4d77(_0x274918,_0x24ca4e){const _0x2518ef=a7_0x2518();return a7_0x4d77=function(_0x4d778c,_0x10ae28){_0x4d778c=_0x4d778c-0x71;let _0xc2dc10=_0x2518ef[_0x4d778c];return _0xc2dc10;},a7_0x4d77(_0x274918,_0x24ca4e);}export async function generateApiFile(_0x43247f,_0x2d4631='',_0xa849ec,_0x365c3f=![],_0x3e543a,_0x4d13c9=a7_0x46f415(0x83)){const _0x3732f3=a7_0x46f415,_0x4615e4=readConfig(),_0xee89d9=_0xa849ec||_0x4615e4?.[_0x3732f3(0x78)];if(typeof _0xee89d9!==_0x3732f3(0x9a)||!_0xee89d9)throw new Error(_0x3732f3(0x71));const _0x3d2eba=_0x365c3f?_0x3732f3(0x98):'\x22'+_0xee89d9+'\x22',_0x3be089=typeof _0x4615e4['env']===_0x3732f3(0x9a)?_0x4615e4['env']:undefined,_0x20c3c7=_0x3e543a||_0x3be089||_0x3732f3(0x8e),_0xb870b0=_0x20c3c7!==_0x3732f3(0x8e);let _0x411a40;if(_0x365c3f)_0xb870b0?_0x411a40=_0x3732f3(0x89)+_0x3d2eba+',\x20env:\x20\x22'+_0x20c3c7+'\x22\x20}':_0x411a40='';else{const _0x2c2585=_0xb870b0?_0x3732f3(0x75)+_0x20c3c7+'\x22':'';_0x411a40='{\x20apiConfigName:\x20\x22'+_0xee89d9+'\x22'+_0x2c2585+'\x20}';}const _0x272941=_0x2d4631?_0x2d4631+'-api':_0x3732f3(0x7e),_0x5df4d8=_0x2d4631?_0x2d4631+_0x3732f3(0x94):_0x3732f3(0x84),_0x2e4bb8={};_0x43247f['forEach'](_0x1d3ef6=>{const _0x443cf2=_0x3732f3;_0x2e4bb8[_0x1d3ef6[_0x443cf2(0x92)]]={'tableName':_0x1d3ef6[_0x443cf2(0x8f)],'datasetCode':_0x1d3ef6[_0x443cf2(0x8b)],'name':_0x1d3ef6[_0x443cf2(0x7b)]||''};});const _0x394136=fileURLToPath(import.meta[_0x3732f3(0x81)]),_0x2e97bf=a7_0x5d0510[_0x3732f3(0x90)](a7_0x5d0510[_0x3732f3(0x72)](_0x394136),_0x3732f3(0x7c)),_0x29d6c6=a7_0x5d0510[_0x3732f3(0x74)](_0x2e97bf,'templates/generate-api'),_0x3a9ab8=a7_0x5d0510[_0x3732f3(0x74)](_0x29d6c6,'api.ts.tpl'),_0x4db923=a7_0x5d0510[_0x3732f3(0x74)](_0x29d6c6,_0x3732f3(0x99)),_0x56f31b=_0x4d13c9[_0x3732f3(0x93)]('/')?_0x4d13c9[_0x3732f3(0x82)](0x0,-0x1):_0x4d13c9;mkdirSync(_0x56f31b,{'recursive':!![]});const _0x568515=readFileSync(_0x3a9ab8,_0x3732f3(0x76)),_0x3f7d91=TemplateReplacer[_0x3732f3(0x8c)](_0x568515,_0xee89d9,_0x2e4bb8,Object['keys'](_0x2e4bb8)[0x0],_0x272941,_0x3d2eba),_0x4a6d58=await a7_0x3f2b33['format'](_0x3f7d91,{'parser':'typescript'}),_0x2fa304=_0x56f31b+'/'+_0x272941+'.ts';writeFileSync(_0x2fa304,_0x4a6d58,{'encoding':_0x3732f3(0x76)});const _0x412388=readFileSync(_0x4db923,_0x3732f3(0x76)),_0x599567=TemplateReplacer['replaceApiContent'](_0x412388,_0xee89d9,_0x2e4bb8,Object['keys'](_0x2e4bb8)[0x0],_0x272941,_0x3d2eba,_0x411a40),_0x49cff8=await a7_0x3f2b33['format'](_0x599567,{'parser':_0x3732f3(0x77)}),_0x2678b4=_0x56f31b+'/'+_0x5df4d8+_0x3732f3(0x7a);writeFileSync(_0x2678b4,_0x49cff8,{'encoding':_0x3732f3(0x76)});const _0x383299=Object[_0x3732f3(0x95)](_0x2e4bb8)[_0x3732f3(0x91)];return logger[_0x3732f3(0x85)]('init-api',_0x3732f3(0x73),undefined,{'apiFile':_0x2fa304,'clientFile':_0x2678b4,'modelCount':_0x383299,'configName':_0x3d2eba}),{'modelCount':_0x383299,'apiFilePath':_0x2fa304,'clientFilePath':_0x2678b4,'configName':_0x3d2eba};}
1
+ const a7_0x5b7bcd=a7_0x5979;(function(_0x3bb9bc,_0x4da5c0){const _0x32e293=a7_0x5979,_0x32b8b8=_0x3bb9bc();while(!![]){try{const _0x47f58f=parseInt(_0x32e293(0xe4))/0x1*(parseInt(_0x32e293(0xc4))/0x2)+-parseInt(_0x32e293(0xc6))/0x3*(-parseInt(_0x32e293(0xbf))/0x4)+-parseInt(_0x32e293(0xd8))/0x5*(-parseInt(_0x32e293(0xc0))/0x6)+-parseInt(_0x32e293(0xc3))/0x7+parseInt(_0x32e293(0xe5))/0x8+parseInt(_0x32e293(0xc8))/0x9+-parseInt(_0x32e293(0xca))/0xa*(parseInt(_0x32e293(0xcf))/0xb);if(_0x47f58f===_0x4da5c0)break;else _0x32b8b8['push'](_0x32b8b8['shift']());}catch(_0x1ba9a6){_0x32b8b8['push'](_0x32b8b8['shift']());}}}(a7_0x2d8b,0x3049f));import a7_0x23ece7 from'prettier';import{mkdirSync,writeFileSync,readFileSync}from'node:fs';import a7_0x5f580c from'node:path';import{fileURLToPath}from'node:url';function a7_0x5979(_0x544401,_0x34809f){const _0x2d8b44=a7_0x2d8b();return a7_0x5979=function(_0x597944,_0x58c54d){_0x597944=_0x597944-0xbe;let _0x222d01=_0x2d8b44[_0x597944];return _0x222d01;},a7_0x5979(_0x544401,_0x34809f);}import{readConfig}from'../utils/config.js';import{TemplateReplacer}from'../utils/template-replacer.js';import{logger}from'../utils/logger.js';export async function generateApiFile(_0x703eda,_0x4e2747='',_0x4a61c4,_0x3c93ce=![],_0xf2e630,_0x4d03ec=a7_0x5b7bcd(0xcb)){const _0x5b2ddd=a7_0x5b7bcd,_0x51de21=readConfig(),_0x7fab66=_0x4a61c4||_0x51de21?.[_0x5b2ddd(0xc5)];if(typeof _0x7fab66!==_0x5b2ddd(0xe2)||!_0x7fab66)throw new Error(_0x5b2ddd(0xd4));const _0x5b7d5a=_0x3c93ce?_0x5b2ddd(0xdf):'\x22'+_0x7fab66+'\x22',_0x48bc99=typeof _0x51de21[_0x5b2ddd(0xe3)]===_0x5b2ddd(0xe2)?_0x51de21[_0x5b2ddd(0xe3)]:undefined,_0x45cd18=_0xf2e630||_0x48bc99||'online',_0x4da489=_0x45cd18!==_0x5b2ddd(0xd1);let _0x1cbf61;if(_0x3c93ce)_0x4da489?_0x1cbf61='{\x20apiConfigName:\x20'+_0x5b7d5a+',\x20env:\x20\x22'+_0x45cd18+_0x5b2ddd(0xd0):_0x1cbf61='';else{const _0x32397a=_0x4da489?_0x5b2ddd(0xd5)+_0x45cd18+'\x22':'';_0x1cbf61=_0x5b2ddd(0xcc)+_0x7fab66+'\x22'+_0x32397a+'\x20}';}const _0x1f183a=_0x4e2747?_0x4e2747+_0x5b2ddd(0xe6):_0x5b2ddd(0xdb),_0x222718=_0x4e2747?_0x4e2747+_0x5b2ddd(0xc2):'client',_0x4a9c54={};_0x703eda[_0x5b2ddd(0xd3)](_0x1e13c1=>{const _0x3e63ba=_0x5b2ddd;_0x4a9c54[_0x1e13c1['key']]={'tableName':_0x1e13c1[_0x3e63ba(0xd7)],'datasetCode':_0x1e13c1[_0x3e63ba(0xc1)],'name':_0x1e13c1['name']||''};});const _0x5ac97e=fileURLToPath(import.meta[_0x5b2ddd(0xe0)]),_0x5b0a22=a7_0x5f580c[_0x5b2ddd(0xe1)](a7_0x5f580c[_0x5b2ddd(0xda)](_0x5ac97e),'../..'),_0x4fa497=a7_0x5f580c[_0x5b2ddd(0xde)](_0x5b0a22,'templates/generate-api'),_0x436e19=a7_0x5f580c[_0x5b2ddd(0xde)](_0x4fa497,'api.ts.tpl'),_0x1e7e04=a7_0x5f580c[_0x5b2ddd(0xde)](_0x4fa497,'client.ts.tpl'),_0x1f3282=_0x4d03ec[_0x5b2ddd(0xdc)]('/')?_0x4d03ec['slice'](0x0,-0x1):_0x4d03ec;mkdirSync(_0x1f3282,{'recursive':!![]});const _0x1332a1=readFileSync(_0x436e19,'utf8'),_0xb73621=TemplateReplacer[_0x5b2ddd(0xdd)](_0x1332a1,_0x7fab66,_0x4a9c54,Object['keys'](_0x4a9c54)[0x0],_0x1f183a,_0x5b7d5a),_0x254c84=await a7_0x23ece7['format'](_0xb73621,{'parser':_0x5b2ddd(0xd9)}),_0x474849=_0x1f3282+'/'+_0x1f183a+_0x5b2ddd(0xbe);writeFileSync(_0x474849,_0x254c84,{'encoding':_0x5b2ddd(0xcd)});const _0x16aa6f=readFileSync(_0x1e7e04,_0x5b2ddd(0xcd)),_0x361de1=TemplateReplacer[_0x5b2ddd(0xdd)](_0x16aa6f,_0x7fab66,_0x4a9c54,Object[_0x5b2ddd(0xc7)](_0x4a9c54)[0x0],_0x1f183a,_0x5b7d5a,_0x1cbf61),_0x3bdfb2=await a7_0x23ece7[_0x5b2ddd(0xce)](_0x361de1,{'parser':_0x5b2ddd(0xd9)}),_0x496dde=_0x1f3282+'/'+_0x222718+_0x5b2ddd(0xbe);writeFileSync(_0x496dde,_0x3bdfb2,{'encoding':'utf8'});const _0x4e7363=Object[_0x5b2ddd(0xc7)](_0x4a9c54)['length'];return logger[_0x5b2ddd(0xd2)](_0x5b2ddd(0xc9),_0x5b2ddd(0xd6),undefined,{'apiFile':_0x474849,'clientFile':_0x496dde,'modelCount':_0x4e7363,'configName':_0x5b7d5a}),{'modelCount':_0x4e7363,'apiFilePath':_0x474849,'clientFilePath':_0x496dde,'configName':_0x5b7d5a};}function a7_0x2d8b(){const _0x5c3c11=['{\x20apiConfigName:\x20\x22','utf8','format','4334khlzdv','\x22\x20}','online','success','forEach','请先通过\x20`lovrabet\x20config\x20set\x20app\x20<value>`\x20配置应用\x20Code',',\x20env:\x20\x22','API\x20文件生成成功!','tableName','15CrnNam','typescript','dirname','api','endsWith','replaceApiContent','join','CONFIG_NAMES.DEFAULT','url','resolve','string','env','43kKAJiy','2432576LtBQjq','-api','.ts','88CaeiyE','450858QicJpf','datasetCode','-client','1836058BouMDJ','17830Hjswgd','app','5904UtKrzu','keys','1811907nzLFXU','init-api','17700KAfsBL','./src/api/'];a7_0x2d8b=function(){return _0x5c3c11;};return a7_0x2d8b();}
package/lib/api/main.js CHANGED
@@ -1 +1 @@
1
- (function(_0x478cc4,_0x19f52e){const _0x564df8=a8_0x462c,_0x45f15b=_0x478cc4();while(!![]){try{const _0x83e91a=parseInt(_0x564df8(0x85))/0x1*(-parseInt(_0x564df8(0x8a))/0x2)+parseInt(_0x564df8(0x89))/0x3*(parseInt(_0x564df8(0x82))/0x4)+parseInt(_0x564df8(0x76))/0x5+-parseInt(_0x564df8(0x90))/0x6*(parseInt(_0x564df8(0x88))/0x7)+parseInt(_0x564df8(0x70))/0x8*(parseInt(_0x564df8(0x99))/0x9)+-parseInt(_0x564df8(0x83))/0xa+parseInt(_0x564df8(0x78))/0xb;if(_0x83e91a===_0x19f52e)break;else _0x45f15b['push'](_0x45f15b['shift']());}catch(_0x421245){_0x45f15b['push'](_0x45f15b['shift']());}}}(a8_0x5274,0x867cc));function a8_0x5274(){const _0x19f954=['\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配置文件','1137828sKmvMY','log','string','\x20\x20错误:\x20','\x20\x20lovrabet\x20api\x20doc\x20--appcode\x20','请使用\x20--appcode\x20参数,例如:','output','trim','×\x20--datasetcode\x20参数不能为空','1318104JbKJvh','input','\x20\x20\x202.\x20使用参数:\x20lovrabet\x20api\x20doc\x20--appcode\x20<app-code>','\x0alovrabet\x20api\x20-\x20API\x20相关操作\x0a\x0a用法:\x0a\x20\x20$\x20lovrabet\x20api\x20pull\x20[options]\x0a\x20\x20$\x20lovrabet\x20api\x20doc\x20[options]\x0a\x0a选项:\x0a\x20\x20--appcode\x20<code>\x20\x20\x20\x20\x20\x20指定应用代码\x0a\x20\x20--output\x20<dir>\x20\x20\x20\x20\x20\x20\x20\x20指定输出目录(pull:\x20./src/api/,doc:\x20./docs)\x0a\x20\x20--env\x20<env>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20指定环境(如:daily、online)\x0a\x20\x20--datasetcode\x20<codes>\x20指定要生成文档的数据集代码(多个用逗号分隔,仅\x20doc\x20命令)\x0a\x20\x20--help\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20显示此帮助信息\x0a\x0a示例:\x0a\x20\x20$\x20lovrabet\x20api\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20拉取并生成\x20API\x20配置文件\x0a\x20\x20$\x20lovrabet\x20api\x20pull\x20--appcode\x20myapp\x20\x20\x20\x20\x20\x20\x20//\x20使用指定的\x20appcode\x0a\x20\x20$\x20lovrabet\x20api\x20pull\x20--output\x20./api\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定输出目录\x0a\x20\x20$\x20lovrabet\x20api\x20pull\x20--env\x20daily\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定环境拉取\x20API\x0a\x0a\x20\x20$\x20lovrabet\x20api\x20doc\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20生成所有数据集的文档\x0a\x20\x20$\x20lovrabet\x20api\x20doc\x20--appcode\x20myapp\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20使用指定的\x20appcode\x0a\x20\x20$\x20lovrabet\x20api\x20doc\x20--output\x20./docs\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定文档输出目录\x0a\x20\x20$\x20lovrabet\x20api\x20doc\x20--env\x20daily\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定环境生成文档\x0a\x20\x20$\x20lovrabet\x20api\x20doc\x20--datasetcode\x20ds_001\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20只生成指定数据集的文档\x0a\x20\x20$\x20lovrabet\x20api\x20doc\x20--datasetcode\x20ds_001,ds_002\x20\x20\x20\x20\x20\x20//\x20生成多个数据集的文档\x0a','\x20\x20lovrabet\x20api\x20doc\x20--appcode\x20<code>\x20\x20\x20\x20\x20\x20\x20//\x20使用指定的\x20appcode','isArray','\x1b[0m','env','\x20\x20\x201.\x20配置默认值:\x20lovrabet\x20config\x20set\x20appcode\x20<app-code>','exit','\x1b[90m*\x20使用配置的应用AppCode:\x20','32oLXgme','\x20\x20lovrabet\x20api\x20doc\x20--env\x20<env>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定环境(如:\x20daily,\x20online)','error','appcode','pull','parse','271415qiEXrj','❌\x20错误:不再支持位置参数方式','11542960SaANwJ','Available\x20commands:','Unknown\x20api\x20command:\x20','×\x20未配置\x20AppCode','\x20\x20lovrabet\x20api\x20doc\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20生成\x20API\x20文档','length','datasetcode','object','\x20\x20lovrabet\x20api\x20pull\x20--output\x20<dir>\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定输出目录(默认:\x20./src/api/)','filter','411628COxAZe','6638790JSfMAS','join','49PnjgXG','\x20\x20lovrabet\x20api\x20pull\x20--appcode\x20<code>\x20\x20\x20\x20\x20\x20//\x20使用指定的\x20appcode','×\x20--params\x20参数不是有效的\x20JSON\x20格式','14OBDKjs','21zuPbQR','33298Egwrur','×\x20--params\x20参数必须是一个有效的\x20JSON\x20对象','flags','\x20\x20lovrabet\x20api\x20doc\x20--output\x20<dir>\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定文档输出目录(默认:\x20./docs)','split'];a8_0x5274=function(){return _0x19f954;};return a8_0x5274();}import{jsx as a8_0x5ecee9}from'react/jsx-runtime';import{render}from'ink';function a8_0x462c(_0x3df1b4,_0xe7d656){const _0x5274ba=a8_0x5274();return a8_0x462c=function(_0x462c40,_0xead651){_0x462c40=_0x462c40-0x6e;let _0x25a23a=_0x5274ba[_0x462c40];return _0x25a23a;},a8_0x462c(_0x3df1b4,_0xe7d656);}import{ApiPullUI}from'./api-pull-ui.js';import{ApiDocUI}from'./api-doc-ui.js';import{getConfigAppCode}from'../utils/config.js';export async function apiCli(_0x28b03a){const _0xf2845f=a8_0x462c,_0x1d2ae7=_0x28b03a[_0xf2845f(0x9a)][0x1];if(_0x28b03a[_0xf2845f(0x8c)]['help']){console[_0xf2845f(0x91)](_0xf2845f(0x9c));return;}if(_0x1d2ae7===_0xf2845f(0x74)){_0x28b03a[_0xf2845f(0x9a)][0x2]&&(console[_0xf2845f(0x72)](_0xf2845f(0x77)),console[_0xf2845f(0x91)](_0xf2845f(0x95)),console[_0xf2845f(0x91)]('\x20\x20lovrabet\x20api\x20pull\x20--appcode\x20'+_0x28b03a[_0xf2845f(0x9a)][0x2]),process[_0xf2845f(0x6e)](0x1));const _0x30f25e=getConfigAppCode();let _0x44935c=_0x28b03a[_0xf2845f(0x8c)][_0xf2845f(0x73)];const _0x392fa8=typeof _0x28b03a[_0xf2845f(0x8c)]['env']===_0xf2845f(0x92)?_0x28b03a[_0xf2845f(0x8c)][_0xf2845f(0xa0)]:undefined,_0x15f281=_0x28b03a['flags'][_0xf2845f(0x96)];!_0x44935c&&!_0x30f25e&&(console[_0xf2845f(0x72)](_0xf2845f(0x7b)),console['log']('!\x20请使用以下方式之一:'),console[_0xf2845f(0x91)](_0xf2845f(0xa1)),console['log']('\x20\x20\x202.\x20使用参数:\x20lovrabet\x20api\x20pull\x20--appcode\x20<app-code>'),process[_0xf2845f(0x6e)](0x1)),_0x44935c&&_0x30f25e&&_0x44935c===_0x30f25e&&(console[_0xf2845f(0x91)](_0xf2845f(0x6f)+_0x44935c+_0xf2845f(0x9f)),console[_0xf2845f(0x91)]('\x1b[90m\x20\x20(注:\x20--appcode\x20参数与配置一致,将使用默认配置)\x1b[0m'),_0x44935c=undefined),render(a8_0x5ecee9(ApiPullUI,{'appCode':_0x44935c,'env':_0x392fa8,'output':_0x15f281}));}else{if(_0x1d2ae7==='doc'){_0x28b03a[_0xf2845f(0x9a)][0x2]&&(console[_0xf2845f(0x72)]('❌\x20错误:不再支持位置参数方式'),console[_0xf2845f(0x91)]('请使用\x20--appcode\x20参数,例如:'),console['log'](_0xf2845f(0x94)+_0x28b03a[_0xf2845f(0x9a)][0x2]),process[_0xf2845f(0x6e)](0x1));const _0x463103=getConfigAppCode();let _0x2e6cb7=_0x28b03a['flags'][_0xf2845f(0x73)];const _0x537180=typeof _0x28b03a[_0xf2845f(0x8c)][_0xf2845f(0xa0)]==='string'?_0x28b03a[_0xf2845f(0x8c)][_0xf2845f(0xa0)]:undefined,_0x104fc0=_0x28b03a[_0xf2845f(0x8c)]['output'],_0x333249=_0x28b03a[_0xf2845f(0x8c)]['params'],_0x261be6=_0x28b03a[_0xf2845f(0x8c)][_0xf2845f(0x7e)];!_0x2e6cb7&&!_0x463103&&(console['error'](_0xf2845f(0x7b)),console['log']('!\x20请使用以下方式之一:'),console[_0xf2845f(0x91)](_0xf2845f(0xa1)),console[_0xf2845f(0x91)](_0xf2845f(0x9b)),process['exit'](0x1));_0x2e6cb7&&_0x463103&&_0x2e6cb7===_0x463103&&(console['log'](_0xf2845f(0x6f)+_0x2e6cb7+_0xf2845f(0x9f)),_0x2e6cb7=undefined);let _0x2db5f1;if(_0x333249)try{_0x2db5f1=JSON[_0xf2845f(0x75)](_0x333249),(typeof _0x2db5f1!==_0xf2845f(0x7f)||_0x2db5f1===null||Array[_0xf2845f(0x9e)](_0x2db5f1))&&(console['error'](_0xf2845f(0x8b)),process[_0xf2845f(0x6e)](0x1));}catch(_0x4a6496){console['error'](_0xf2845f(0x87)),console[_0xf2845f(0x72)](_0xf2845f(0x93)+(_0x4a6496 instanceof Error?_0x4a6496['message']:String(_0x4a6496))),process['exit'](0x1);}let _0x52738c;_0x261be6&&(_0x52738c=_0x261be6[_0xf2845f(0x8e)](',')['map'](_0x35ba37=>_0x35ba37[_0xf2845f(0x97)]())[_0xf2845f(0x81)](_0x3c6e62=>_0x3c6e62[_0xf2845f(0x7d)]>0x0),_0x52738c[_0xf2845f(0x7d)]===0x0&&(console['error'](_0xf2845f(0x98)),process['exit'](0x1)),console[_0xf2845f(0x91)]('\x1b[90m*\x20仅生成指定数据集的文档:\x20'+_0x52738c[_0xf2845f(0x84)](',\x20')+_0xf2845f(0x9f))),render(a8_0x5ecee9(ApiDocUI,{'appCode':_0x2e6cb7,'env':_0x537180,'output':_0x104fc0,'extraParams':_0x2db5f1,'datasetCodes':_0x52738c}));}else console[_0xf2845f(0x72)](_0xf2845f(0x7a)+_0x1d2ae7),console[_0xf2845f(0x91)](_0xf2845f(0x79)),console[_0xf2845f(0x91)](_0xf2845f(0x8f)),console['log'](_0xf2845f(0x86)),console[_0xf2845f(0x91)](_0xf2845f(0x80)),console[_0xf2845f(0x91)]('\x20\x20lovrabet\x20api\x20pull\x20--env\x20<env>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定环境(如:\x20daily,\x20online)'),console[_0xf2845f(0x91)](''),console['log'](_0xf2845f(0x7c)),console[_0xf2845f(0x91)](_0xf2845f(0x9d)),console['log'](_0xf2845f(0x8d)),console[_0xf2845f(0x91)](_0xf2845f(0x71)),process[_0xf2845f(0x6e)](0x1);}}
1
+ (function(_0x1761e1,_0x61665a){const _0x31c63e=a8_0x11fa,_0x4101d2=_0x1761e1();while(!![]){try{const _0x43009b=parseInt(_0x31c63e(0x1a3))/0x1+-parseInt(_0x31c63e(0x1b9))/0x2*(parseInt(_0x31c63e(0x1a8))/0x3)+-parseInt(_0x31c63e(0x1a4))/0x4+-parseInt(_0x31c63e(0x19a))/0x5+-parseInt(_0x31c63e(0x1a2))/0x6+-parseInt(_0x31c63e(0x1bf))/0x7*(parseInt(_0x31c63e(0x1a9))/0x8)+parseInt(_0x31c63e(0x1b6))/0x9;if(_0x43009b===_0x61665a)break;else _0x4101d2['push'](_0x4101d2['shift']());}catch(_0x3a2078){_0x4101d2['push'](_0x4101d2['shift']());}}}(a8_0x383b,0xd4b9a));function a8_0x383b(){const _0x2e4a91=['\x20\x20lovrabet\x20api\x20doc\x20--appcode\x20','\x20\x20lovrabet\x20api\x20pull\x20--appcode\x20<code>\x20\x20\x20\x20\x20\x20//\x20使用指定的\x20appcode','×\x20--datasetcode\x20参数不能为空','env','×\x20--params\x20参数不是有效的\x20JSON\x20格式','请使用\x20--appcode\x20参数,例如:','split','\x20\x20lovrabet\x20api\x20pull\x20--output\x20<dir>\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定输出目录(默认:\x20./src/api/)','Available\x20commands:','help','\x20\x20lovrabet\x20api\x20pull\x20--appcode\x20','message','\x1b[90m*\x20仅生成指定数据集的文档:\x20','1122270gZqEha','pull','filter','params','log','\x1b[90m*\x20使用配置的应用AppCode:\x20','exit','×\x20未配置\x20AppCode','6565650uhXMeW','1532499hHcIBd','3606292GLqZJS','Unknown\x20api\x20command:\x20','\x20\x20lovrabet\x20api\x20pull\x20--env\x20<env>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定环境(如:\x20daily,\x20online)','object','159edQEei','32lmavug','\x20\x20lovrabet\x20api\x20doc\x20--appcode\x20<code>\x20\x20\x20\x20\x20\x20\x20//\x20使用指定的\x20appcode','length','\x1b[90m\x20\x20(注:\x20--appcode\x20参数与配置一致,将使用默认配置)\x1b[0m','doc','\x20\x20lovrabet\x20api\x20doc\x20--env\x20<env>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定环境(如:\x20daily,\x20online)','error','isArray','output','join','\x20\x20\x202.\x20使用参数:\x20lovrabet\x20api\x20pull\x20--appcode\x20<app-code>','❌\x20错误:不再支持位置参数方式','map','30367728tDEgiT','\x20\x20\x202.\x20使用参数:\x20lovrabet\x20api\x20doc\x20--appcode\x20<app-code>','\x20\x20\x201.\x20配置默认值:\x20lovrabet\x20config\x20set\x20appcode\x20<app-code>','64814DkzJVE','\x0alovrabet\x20api\x20-\x20API\x20相关操作\x0a\x0a用法:\x0a\x20\x20$\x20lovrabet\x20api\x20pull\x20[options]\x0a\x20\x20$\x20lovrabet\x20api\x20doc\x20[options]\x0a\x0a选项:\x0a\x20\x20--appcode\x20<code>\x20\x20\x20\x20\x20\x20指定应用代码\x0a\x20\x20--output\x20<dir>\x20\x20\x20\x20\x20\x20\x20\x20指定输出目录(pull:\x20./src/api/,doc:\x20./docs)\x0a\x20\x20--env\x20<env>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20指定环境(如:daily、online)\x0a\x20\x20--datasetcode\x20<codes>\x20指定要生成文档的数据集代码(多个用逗号分隔,仅\x20doc\x20命令)\x0a\x20\x20--help\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20显示此帮助信息\x0a\x0a示例:\x0a\x20\x20$\x20lovrabet\x20api\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20拉取并生成\x20API\x20配置文件\x0a\x20\x20$\x20lovrabet\x20api\x20pull\x20--appcode\x20myapp\x20\x20\x20\x20\x20\x20\x20//\x20使用指定的\x20appcode\x0a\x20\x20$\x20lovrabet\x20api\x20pull\x20--output\x20./api\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定输出目录\x0a\x20\x20$\x20lovrabet\x20api\x20pull\x20--env\x20daily\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定环境拉取\x20API\x0a\x0a\x20\x20$\x20lovrabet\x20api\x20doc\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20生成所有数据集的文档\x0a\x20\x20$\x20lovrabet\x20api\x20doc\x20--appcode\x20myapp\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20使用指定的\x20appcode\x0a\x20\x20$\x20lovrabet\x20api\x20doc\x20--output\x20./docs\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定文档输出目录\x0a\x20\x20$\x20lovrabet\x20api\x20doc\x20--env\x20daily\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定环境生成文档\x0a\x20\x20$\x20lovrabet\x20api\x20doc\x20--datasetcode\x20ds_001\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20只生成指定数据集的文档\x0a\x20\x20$\x20lovrabet\x20api\x20doc\x20--datasetcode\x20ds_001,ds_002\x20\x20\x20\x20\x20\x20//\x20生成多个数据集的文档\x0a','\x20\x20lovrabet\x20api\x20doc\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20生成\x20API\x20文档','parse','flags','×\x20--params\x20参数必须是一个有效的\x20JSON\x20对象','170618IvyEDR','\x20\x20lovrabet\x20api\x20doc\x20--output\x20<dir>\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定文档输出目录(默认:\x20./docs)','input','appcode','trim','string','\x1b[0m'];a8_0x383b=function(){return _0x2e4a91;};return a8_0x383b();}import{jsx as a8_0x3af4af}from'react/jsx-runtime';import{render}from'ink';import{ApiPullUI}from'./api-pull-ui.js';import{ApiDocUI}from'./api-doc-ui.js';import{getConfigAppCode}from'../utils/config.js';function a8_0x11fa(_0x551937,_0x96580c){const _0x383bb4=a8_0x383b();return a8_0x11fa=function(_0x11faa5,_0x10a648){_0x11faa5=_0x11faa5-0x189;let _0x440e7d=_0x383bb4[_0x11faa5];return _0x440e7d;},a8_0x11fa(_0x551937,_0x96580c);}export async function apiCli(_0x114be6){const _0x3510c7=a8_0x11fa,_0x406272=_0x114be6[_0x3510c7(0x1c1)][0x1];if(_0x114be6['flags'][_0x3510c7(0x196)]){console[_0x3510c7(0x19e)](_0x3510c7(0x1ba));return;}if(_0x406272===_0x3510c7(0x19b)){_0x114be6[_0x3510c7(0x1c1)][0x2]&&(console[_0x3510c7(0x1af)](_0x3510c7(0x1b4)),console['log'](_0x3510c7(0x192)),console[_0x3510c7(0x19e)](_0x3510c7(0x197)+_0x114be6[_0x3510c7(0x1c1)][0x2]),process['exit'](0x1));const _0x59d477=getConfigAppCode();let _0x1be610=_0x114be6[_0x3510c7(0x1bd)][_0x3510c7(0x189)];const _0x20fd4b=typeof _0x114be6[_0x3510c7(0x1bd)]['env']===_0x3510c7(0x18b)?_0x114be6[_0x3510c7(0x1bd)][_0x3510c7(0x190)]:undefined,_0x49a465=_0x114be6[_0x3510c7(0x1bd)][_0x3510c7(0x1b1)];!_0x1be610&&!_0x59d477&&(console[_0x3510c7(0x1af)](_0x3510c7(0x1a1)),console['log']('!\x20请使用以下方式之一:'),console[_0x3510c7(0x19e)]('\x20\x20\x201.\x20配置默认值:\x20lovrabet\x20config\x20set\x20appcode\x20<app-code>'),console[_0x3510c7(0x19e)](_0x3510c7(0x1b3)),process[_0x3510c7(0x1a0)](0x1)),_0x1be610&&_0x59d477&&_0x1be610===_0x59d477&&(console[_0x3510c7(0x19e)](_0x3510c7(0x19f)+_0x1be610+_0x3510c7(0x18c)),console[_0x3510c7(0x19e)](_0x3510c7(0x1ac)),_0x1be610=undefined),render(a8_0x3af4af(ApiPullUI,{'appCode':_0x1be610,'env':_0x20fd4b,'output':_0x49a465}));}else{if(_0x406272===_0x3510c7(0x1ad)){_0x114be6[_0x3510c7(0x1c1)][0x2]&&(console[_0x3510c7(0x1af)](_0x3510c7(0x1b4)),console[_0x3510c7(0x19e)](_0x3510c7(0x192)),console[_0x3510c7(0x19e)](_0x3510c7(0x18d)+_0x114be6[_0x3510c7(0x1c1)][0x2]),process[_0x3510c7(0x1a0)](0x1));const _0x32bc26=getConfigAppCode();let _0x32da8b=_0x114be6[_0x3510c7(0x1bd)][_0x3510c7(0x189)];const _0x1a6c4f=typeof _0x114be6['flags'][_0x3510c7(0x190)]===_0x3510c7(0x18b)?_0x114be6[_0x3510c7(0x1bd)][_0x3510c7(0x190)]:undefined,_0x3a68e3=_0x114be6[_0x3510c7(0x1bd)][_0x3510c7(0x1b1)],_0xc0a64e=_0x114be6[_0x3510c7(0x1bd)][_0x3510c7(0x19d)],_0x328218=_0x114be6['flags']['datasetcode'];!_0x32da8b&&!_0x32bc26&&(console[_0x3510c7(0x1af)](_0x3510c7(0x1a1)),console[_0x3510c7(0x19e)]('!\x20请使用以下方式之一:'),console[_0x3510c7(0x19e)](_0x3510c7(0x1b8)),console['log'](_0x3510c7(0x1b7)),process[_0x3510c7(0x1a0)](0x1));_0x32da8b&&_0x32bc26&&_0x32da8b===_0x32bc26&&(console[_0x3510c7(0x19e)](_0x3510c7(0x19f)+_0x32da8b+'\x1b[0m'),_0x32da8b=undefined);let _0x4a2556;if(_0xc0a64e)try{_0x4a2556=JSON[_0x3510c7(0x1bc)](_0xc0a64e),(typeof _0x4a2556!==_0x3510c7(0x1a7)||_0x4a2556===null||Array[_0x3510c7(0x1b0)](_0x4a2556))&&(console[_0x3510c7(0x1af)](_0x3510c7(0x1be)),process[_0x3510c7(0x1a0)](0x1));}catch(_0x19f7ec){console['error'](_0x3510c7(0x191)),console[_0x3510c7(0x1af)]('\x20\x20错误:\x20'+(_0x19f7ec instanceof Error?_0x19f7ec[_0x3510c7(0x198)]:String(_0x19f7ec))),process[_0x3510c7(0x1a0)](0x1);}let _0x5ca3d9;_0x328218&&(_0x5ca3d9=_0x328218[_0x3510c7(0x193)](',')[_0x3510c7(0x1b5)](_0x289220=>_0x289220[_0x3510c7(0x18a)]())[_0x3510c7(0x19c)](_0x5eb8b3=>_0x5eb8b3[_0x3510c7(0x1ab)]>0x0),_0x5ca3d9[_0x3510c7(0x1ab)]===0x0&&(console[_0x3510c7(0x1af)](_0x3510c7(0x18f)),process[_0x3510c7(0x1a0)](0x1)),console[_0x3510c7(0x19e)](_0x3510c7(0x199)+_0x5ca3d9[_0x3510c7(0x1b2)](',\x20')+_0x3510c7(0x18c))),render(a8_0x3af4af(ApiDocUI,{'appCode':_0x32da8b,'env':_0x1a6c4f,'output':_0x3a68e3,'extraParams':_0x4a2556,'datasetCodes':_0x5ca3d9}));}else console[_0x3510c7(0x1af)](_0x3510c7(0x1a5)+_0x406272),console['log'](_0x3510c7(0x195)),console[_0x3510c7(0x19e)]('\x20\x20lovrabet\x20api\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20拉取并生成\x20API\x20配置文件'),console[_0x3510c7(0x19e)](_0x3510c7(0x18e)),console[_0x3510c7(0x19e)](_0x3510c7(0x194)),console[_0x3510c7(0x19e)](_0x3510c7(0x1a6)),console[_0x3510c7(0x19e)](''),console[_0x3510c7(0x19e)](_0x3510c7(0x1bb)),console[_0x3510c7(0x19e)](_0x3510c7(0x1aa)),console[_0x3510c7(0x19e)](_0x3510c7(0x1c0)),console[_0x3510c7(0x19e)](_0x3510c7(0x1ae)),process[_0x3510c7(0x1a0)](0x1);}}
@@ -1 +1 @@
1
- (function(_0x8c778b,_0x19de71){const _0x29aafc=a9_0x856e,_0x7e31ba=_0x8c778b();while(!![]){try{const _0x5b97e5=-parseInt(_0x29aafc(0x1f4))/0x1+-parseInt(_0x29aafc(0x20e))/0x2+parseInt(_0x29aafc(0x210))/0x3*(-parseInt(_0x29aafc(0x1ff))/0x4)+-parseInt(_0x29aafc(0x20a))/0x5+-parseInt(_0x29aafc(0x20b))/0x6+parseInt(_0x29aafc(0x201))/0x7+parseInt(_0x29aafc(0x211))/0x8*(parseInt(_0x29aafc(0x209))/0x9);if(_0x5b97e5===_0x19de71)break;else _0x7e31ba['push'](_0x7e31ba['shift']());}catch(_0x2eb723){_0x7e31ba['push'](_0x7e31ba['shift']());}}}(a9_0x3176,0x4175d));import{readConfig}from'../utils/config.js';import{initEnv}from'../constant/env.js';function a9_0x856e(_0x4266de,_0x318b7c){const _0x317634=a9_0x3176();return a9_0x856e=function(_0x856e04,_0x3f35c4){_0x856e04=_0x856e04-0x1f1;let _0x33e1e6=_0x317634[_0x856e04];return _0x33e1e6;},a9_0x856e(_0x4266de,_0x318b7c);}import{generateApiFile}from'./generate-api-file.js';import{logger}from'../utils/logger.js';import{fetchModelList}from'./fetch-model-list.js';export async function pullApiSilent(_0x28fce3,_0x45ae4a,_0x368c07,_0x58abe9){const _0x47ce1c=a9_0x856e;let _0x34e4d6;try{const _0xf17241=_0x45ae4a?.['trim']()||'';if(_0xf17241){const _0xdd89eb=/^[a-zA-Z][a-zA-Z0-9_-]*$/;if(!_0xdd89eb[_0x47ce1c(0x205)](_0xf17241))return console[_0x47ce1c(0x1f1)](_0x47ce1c(0x213)),![];}_0x368c07&&(_0x34e4d6=process[_0x47ce1c(0x1fc)](),process[_0x47ce1c(0x212)](_0x368c07));const _0xedd305=readConfig(),_0x2ff5e7=typeof _0xedd305[_0x47ce1c(0x202)]===_0x47ce1c(0x203)?_0xedd305[_0x47ce1c(0x202)]:undefined,_0x24f1fa=_0x58abe9||_0x2ff5e7||_0x47ce1c(0x1fd);initEnv(_0x24f1fa),console[_0x47ce1c(0x20d)](_0x47ce1c(0x1fb)+_0x24f1fa+')');const {configArray:_0x34976b}=await fetchModelList(_0x28fce3),_0x2b9b82=_0xf17241?_0xf17241+_0x47ce1c(0x200):_0x47ce1c(0x214),_0x39abe9=_0xf17241?_0xf17241+_0x47ce1c(0x1fe):'client';console[_0x47ce1c(0x20d)](_0x47ce1c(0x208)),console[_0x47ce1c(0x20d)](_0x47ce1c(0x1f7)+_0x2b9b82+'.ts\x20-\x20模型配置文件'),console[_0x47ce1c(0x20d)](_0x47ce1c(0x1f7)+_0x39abe9+_0x47ce1c(0x20f)),console['log'](_0x47ce1c(0x1f6)+_0x34976b[_0x47ce1c(0x20c)]+_0x47ce1c(0x206));const _0xa270f8=await generateApiFile(_0x34976b,_0xf17241,_0x28fce3,!![],_0x24f1fa);return console['log'](_0x47ce1c(0x207)+_0x34976b[_0x47ce1c(0x20c)]+'\x20个数据集,生成\x20'+_0xa270f8[_0x47ce1c(0x1fa)]+_0x47ce1c(0x1f2)),_0x368c07&&logger[_0x47ce1c(0x204)](_0x47ce1c(0x1f5),_0x47ce1c(0x1f3)+_0x28fce3,{'projectPath':_0x368c07,'appCode':_0x28fce3,'datasetCount':_0x34976b[_0x47ce1c(0x20c)],'filePrefix':_0xf17241}),!![];}catch(_0xfa171e){const _0x3e985b=_0xfa171e instanceof Error?_0xfa171e['message']:String(_0xfa171e);return console[_0x47ce1c(0x1f1)](_0x47ce1c(0x1f8),_0x3e985b),_0x368c07&&logger[_0x47ce1c(0x1f1)]('create-api-pull',_0x47ce1c(0x1f9)+_0x3e985b,{'appCode':_0x28fce3,'projectPath':_0x368c07}),![];}finally{_0x34e4d6&&process[_0x47ce1c(0x212)](_0x34e4d6);}}function a9_0x3176(){const _0x5c5d01=['online','-client','216PygqmW','-api','2161747qeZZom','env','string','info','test','\x20个数据集...','√\x20成功拉取\x20','*\x20开始生成\x20API\x20配置文件:','976230zaKyAg','208895DaGDwo','1386534YDKUGi','length','log','483544bKOfNe','.ts\x20-\x20客户端实例文件','1278accNcZ','56FiBeQN','chdir','×\x20文件前缀格式不正确。只能包含字母、数字、连字符和下划线,且必须以字母开头。','api','error','\x20个模型','API\x20配置拉取成功:\x20','262342KNRqQV','create-api-pull','*\x20正在处理\x20','\x20\x20\x20•\x20','×\x20API\x20配置拉取异常:','API\x20配置拉取异常:\x20','modelCount','*\x20正在从服务器拉取\x20API\x20配置...\x20(环境:\x20','cwd'];a9_0x3176=function(){return _0x5c5d01;};return a9_0x3176();}
1
+ (function(_0x3c8d72,_0x7becde){const _0x5a87b4=a9_0x4209,_0x22b984=_0x3c8d72();while(!![]){try{const _0x3c13e9=-parseInt(_0x5a87b4(0x1b9))/0x1*(-parseInt(_0x5a87b4(0x1ae))/0x2)+-parseInt(_0x5a87b4(0x197))/0x3*(parseInt(_0x5a87b4(0x1a3))/0x4)+parseInt(_0x5a87b4(0x1a9))/0x5*(parseInt(_0x5a87b4(0x1a5))/0x6)+parseInt(_0x5a87b4(0x1b1))/0x7+-parseInt(_0x5a87b4(0x1a1))/0x8*(-parseInt(_0x5a87b4(0x199))/0x9)+parseInt(_0x5a87b4(0x1b7))/0xa*(-parseInt(_0x5a87b4(0x1aa))/0xb)+-parseInt(_0x5a87b4(0x1a7))/0xc*(parseInt(_0x5a87b4(0x1af))/0xd);if(_0x3c13e9===_0x7becde)break;else _0x22b984['push'](_0x22b984['shift']());}catch(_0x5020f2){_0x22b984['push'](_0x22b984['shift']());}}}(a9_0x1377,0x9a774));import{readConfig}from'../utils/config.js';import{initEnv}from'../constant/env.js';import{generateApiFile}from'./generate-api-file.js';function a9_0x4209(_0x9e3475,_0x4c1548){const _0x1377ac=a9_0x1377();return a9_0x4209=function(_0x4209b6,_0x409e82){_0x4209b6=_0x4209b6-0x197;let _0x214634=_0x1377ac[_0x4209b6];return _0x214634;},a9_0x4209(_0x9e3475,_0x4c1548);}import{logger}from'../utils/logger.js';function a9_0x1377(){const _0x221986=['51939MYMAli','API\x20配置拉取异常:\x20','create-api-pull','length','.ts\x20-\x20模型配置文件','test','×\x20文件前缀格式不正确。只能包含字母、数字、连字符和下划线,且必须以字母开头。','*\x20正在处理\x20','424HnKyRo','log','16348lSEEuh','-client','3054EsEblu','*\x20正在从服务器拉取\x20API\x20配置...\x20(环境:\x20','12iVxJCc','chdir','9665LIqjYc','935xSWBCE','trim','online','cwd','22094VRmwca','7005479xzkHgr','env','7848813DfdoGA','\x20个数据集,生成\x20','×\x20API\x20配置拉取异常:','client','API\x20配置拉取成功:\x20','\x20\x20\x20•\x20','20660OcvlVX','error','1oqvMBj','789GGADad','string'];a9_0x1377=function(){return _0x221986;};return a9_0x1377();}import{fetchModelList}from'./fetch-model-list.js';export async function pullApiSilent(_0xcb3a24,_0xec3ea,_0x76d6c,_0x3bdeae){const _0x579926=a9_0x4209;let _0xdf2bdc;try{const _0x389316=_0xec3ea?.[_0x579926(0x1ab)]()||'';if(_0x389316){const _0x470c05=/^[a-zA-Z][a-zA-Z0-9_-]*$/;if(!_0x470c05[_0x579926(0x19e)](_0x389316))return console[_0x579926(0x1b8)](_0x579926(0x19f)),![];}_0x76d6c&&(_0xdf2bdc=process[_0x579926(0x1ad)](),process[_0x579926(0x1a8)](_0x76d6c));const _0x3c4080=readConfig(),_0x296af2=typeof _0x3c4080[_0x579926(0x1b0)]===_0x579926(0x198)?_0x3c4080[_0x579926(0x1b0)]:undefined,_0xaf435=_0x3bdeae||_0x296af2||_0x579926(0x1ac);initEnv(_0xaf435),console['log'](_0x579926(0x1a6)+_0xaf435+')');const {configArray:_0x591194}=await fetchModelList(_0xcb3a24),_0x2f41a0=_0x389316?_0x389316+'-api':'api',_0x32f5df=_0x389316?_0x389316+_0x579926(0x1a4):_0x579926(0x1b4);console[_0x579926(0x1a2)]('*\x20开始生成\x20API\x20配置文件:'),console[_0x579926(0x1a2)](_0x579926(0x1b6)+_0x2f41a0+_0x579926(0x19d)),console[_0x579926(0x1a2)](_0x579926(0x1b6)+_0x32f5df+'.ts\x20-\x20客户端实例文件'),console['log'](_0x579926(0x1a0)+_0x591194['length']+'\x20个数据集...');const _0xe79236=await generateApiFile(_0x591194,_0x389316,_0xcb3a24,!![],_0xaf435);return console[_0x579926(0x1a2)]('√\x20成功拉取\x20'+_0x591194['length']+_0x579926(0x1b2)+_0xe79236['modelCount']+'\x20个模型'),_0x76d6c&&logger['info'](_0x579926(0x19b),_0x579926(0x1b5)+_0xcb3a24,{'projectPath':_0x76d6c,'appCode':_0xcb3a24,'datasetCount':_0x591194[_0x579926(0x19c)],'filePrefix':_0x389316}),!![];}catch(_0x385dd8){const _0x4b7276=_0x385dd8 instanceof Error?_0x385dd8['message']:String(_0x385dd8);return console[_0x579926(0x1b8)](_0x579926(0x1b3),_0x4b7276),_0x76d6c&&logger[_0x579926(0x1b8)](_0x579926(0x19b),_0x579926(0x19a)+_0x4b7276,{'appCode':_0xcb3a24,'projectPath':_0x76d6c}),![];}finally{_0xdf2bdc&&process[_0x579926(0x1a8)](_0xdf2bdc);}}
@@ -1 +1 @@
1
- (function(_0x42f841,_0x3624fc){const _0xf8165b=a10_0x1ccb,_0x384bcd=_0x42f841();while(!![]){try{const _0x24f56c=parseInt(_0xf8165b(0x1a7))/0x1*(-parseInt(_0xf8165b(0x1b8))/0x2)+parseInt(_0xf8165b(0x1a8))/0x3+-parseInt(_0xf8165b(0x1b4))/0x4*(-parseInt(_0xf8165b(0x1c5))/0x5)+parseInt(_0xf8165b(0x199))/0x6+parseInt(_0xf8165b(0x1a2))/0x7*(-parseInt(_0xf8165b(0x193))/0x8)+-parseInt(_0xf8165b(0x1ba))/0x9+-parseInt(_0xf8165b(0x19c))/0xa*(parseInt(_0xf8165b(0x1a5))/0xb);if(_0x24f56c===_0x3624fc)break;else _0x384bcd['push'](_0x384bcd['shift']());}catch(_0x55bbc4){_0x384bcd['push'](_0x384bcd['shift']());}}}(a10_0x26c9,0x990ec));import{jsx as a10_0x26da09,jsxs as a10_0xcecaec,Fragment as a10_0x310964}from'react/jsx-runtime';function a10_0x1ccb(_0x262743,_0x54cbae){const _0x26c910=a10_0x26c9();return a10_0x1ccb=function(_0x1ccb3b,_0x1fd504){_0x1ccb3b=_0x1ccb3b-0x18e;let _0x4cce3c=_0x26c910[_0x1ccb3b];return _0x4cce3c;},a10_0x1ccb(_0x262743,_0x54cbae);}import{Text,Box,useInput,useApp,render}from'ink';import{useEffect,useState}from'react';import a10_0x589473 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_0x26c9(){const _0x34d518=['[✓]','label','↑/↓:\x20移动光标\x20空格:\x20切换选中\x20a:\x20全选\x20i/r:\x20反选\x20Enter:\x20确认','*\x20同步菜单到\x20Lovrabet\x20平台','red','\x20输入项目的\x20CSS\x20资源链接(https://...)','yellow','116nVjMUx','size','max','JS\x20链接无法访问','996cfLEXm','\x20正在获取线上菜单列表...','1989135aonfry','return','filter','slice','repeat','green','dots','*\x20正在创建菜单...','cyan','delete','\x20←\x20','169630PiSTcP','菜单名称','请输入有效的\x20CSS\x20https\x20链接','message','backspace','blue','done','input-js','upArrow','CSS\x20链接无法访问','*\x20请选择要同步的菜单:','请输入有效的\x20JS\x20https\x20链接','add','test','JS\x20链接','creating','has','map','567224mWOypn','white','selecting','path','input-css','join','5476440bQPQIA','trim','*\x20JS\x20链接:\x20','5020CDIdmH','includes','catch','[\x20]','downArrow','CSS\x20链接','63XuRBnS','!\x20未找到本地页面,请先创建页面','column','23078BWcmFF','提示:使用\x20','65ixOjuO','2025114vWLvLD','gray','online','fill','length'];a10_0x26c9=function(){return _0x34d518;};return a10_0x26c9();}import.meta['main']&&render(a10_0x26da09(AppMenuSyncUI,{}));export function AppMenuSyncUI(){const _0x3f2bcd=a10_0x1ccb,{exit:_0xc618e1}=useApp(),{loading:_0x582456,menuList:_0x4e1d5f,error:_0x2e6843}=useGetOnlineMenuList(),_0x293eb1=getLocalPages(),_0x1aac22=_0x4e1d5f[_0x3f2bcd(0x192)](_0x2d2c29=>_0x2d2c29[_0x3f2bcd(0x196)]),_0x2a7cd4=['菜单名称',..._0x293eb1['map'](_0x5368c4=>_0x5368c4[_0x3f2bcd(0x1ae)])],_0x2047ba=getStringWidth(getMaxWidth(_0x2a7cd4,0x4)),_0x3f0583=getStringWidth(getMaxWidth(['菜单名称'])),[_0x194968,_0x48068b]=useState(_0x3f2bcd(0x195)),[_0x32499b,_0x15c725]=useState(new Set()),[_0x1763b0,_0x46cc1a]=useState(0x0),[_0x481d34,_0x3cac5a]=useState(''),[_0x4ae81a,_0x4c4355]=useState(''),[_0xe7e6c8,_0x2d7d9c]=useState(''),[_0x4a724c,_0x41716b]=useState(''),[_0x4f9c82,_0x5a35d8]=useState([]),_0x128d5d=_0x293eb1[_0x3f2bcd(0x192)](_0x51f338=>({'label':_0x51f338[_0x3f2bcd(0x1ae)],'path':_0x51f338['path'],'local':!![],'online':_0x1aac22['includes'](_0x51f338[_0x3f2bcd(0x196)])})),_0x5d7746=_0x293eb1[_0x3f2bcd(0x1bc)](_0x2d1fe7=>{const _0x5ed960=_0x3f2bcd;return!_0x1aac22[_0x5ed960(0x19d)](_0x2d1fe7[_0x5ed960(0x196)]);});useEffect(()=>{const _0x2ff1a3=_0x3f2bcd;if(!_0x582456&&_0x293eb1['length']>0x0&&_0x32499b[_0x2ff1a3(0x1b5)]===0x0){const _0x49262d=new Set(_0x293eb1[_0x2ff1a3(0x192)]((_0x1edcba,_0x14084c)=>({'page':_0x1edcba,'index':_0x14084c}))[_0x2ff1a3(0x1bc)](({page:_0x139e16})=>!_0x1aac22[_0x2ff1a3(0x19d)](_0x139e16['path']))[_0x2ff1a3(0x192)](({index:_0xfdcd1d})=>_0xfdcd1d));_0x15c725(_0x49262d);}},[_0x582456,_0x293eb1[_0x3f2bcd(0x1ac)],_0x1aac22[_0x3f2bcd(0x1ac)]]),useInput(async(_0x437b7c,_0x14d261)=>{const _0x357a59=_0x3f2bcd;if(_0x194968==='selecting'){if(_0x14d261[_0x357a59(0x1cd)]){_0x46cc1a(_0x3ef855=>_0x3ef855>0x0?_0x3ef855-0x1:_0x293eb1[_0x357a59(0x1ac)]-0x1);return;}if(_0x14d261[_0x357a59(0x1a0)]){_0x46cc1a(_0x90ffc2=>_0x90ffc2<_0x293eb1[_0x357a59(0x1ac)]-0x1?_0x90ffc2+0x1:0x0);return;}if(_0x437b7c==='\x20'){_0x15c725(_0x468a6c=>{const _0x350af1=_0x357a59,_0x242ac1=new Set(_0x468a6c);return _0x242ac1[_0x350af1(0x191)](_0x1763b0)?_0x242ac1[_0x350af1(0x1c3)](_0x1763b0):_0x242ac1[_0x350af1(0x1d1)](_0x1763b0),_0x242ac1;});return;}if(_0x437b7c==='a'||_0x437b7c==='A'){const _0x5cd67f=new Set(_0x293eb1[_0x357a59(0x192)]((_0x53e92f,_0x189918)=>_0x189918));_0x15c725(_0x5cd67f);return;}if(_0x437b7c==='i'||_0x437b7c==='I'||_0x437b7c==='r'||_0x437b7c==='R'){_0x15c725(_0x74569e=>{const _0x30235c=_0x357a59,_0x425396=new Set();for(let _0x28b340=0x0;_0x28b340<_0x293eb1['length'];_0x28b340++){!_0x74569e[_0x30235c(0x191)](_0x28b340)&&_0x425396[_0x30235c(0x1d1)](_0x28b340);}return _0x425396;});return;}if(_0x437b7c==='q'||_0x437b7c==='Q'){_0xc618e1();return;}if(_0x14d261[_0x357a59(0x1bb)]){if(_0x32499b[_0x357a59(0x1b5)]===0x0){_0x41716b('请至少选择一个菜单');return;}const _0x38a310=_0x293eb1[_0x357a59(0x1bc)]((_0x561185,_0x2e3d4f)=>_0x32499b[_0x357a59(0x191)](_0x2e3d4f)),_0x208e69=_0x38a310[_0x357a59(0x192)](_0x22c1b8=>_0x22c1b8[_0x357a59(0x1ae)])[_0x357a59(0x198)](',\x20');_0x5a35d8([{'label':'已选择菜单','value':_0x32499b[_0x357a59(0x1b5)]+'\x20个'}]),_0x41716b(''),_0x48068b('input-js');return;}return;}if(_0x194968==='input-js'){if(_0x14d261[_0x357a59(0x1bb)]){const _0x4ced48=_0xe7e6c8[_0x357a59(0x19a)]();if(_0x4ced48==='')return;if(!isValidJsHttpsUrl(_0x4ced48)){_0x41716b(_0x357a59(0x1d0));return;}if(!await isUrlReachable(_0x4ced48)){_0x41716b(_0x357a59(0x1b7));return;}_0x3cac5a(_0x4ced48),_0x5a35d8(_0x7d86e4=>[..._0x7d86e4,{'label':_0x357a59(0x18f),'value':_0x4ced48}]),_0x2d7d9c(''),_0x41716b(''),_0x48068b(_0x357a59(0x197));return;}if(_0x14d261[_0x357a59(0x1c9)]||_0x14d261['delete']){_0x2d7d9c(_0x54d32b=>_0x54d32b[_0x357a59(0x1bd)](0x0,-0x1)),_0x41716b('');return;}_0x2d7d9c(_0x41e544=>_0x41e544+_0x437b7c);return;}if(_0x194968===_0x357a59(0x197)){if(_0x14d261['return']){const _0x45214c=_0xe7e6c8['trim']();if(_0x45214c==='')return;if(!isValidCssHttpsUrl(_0x45214c)){_0x41716b(_0x357a59(0x1c7));return;}if(!await isUrlReachable(_0x45214c)){_0x41716b(_0x357a59(0x1ce));return;}_0x4c4355(_0x45214c),_0x5a35d8(_0x55760a=>[..._0x55760a,{'label':_0x357a59(0x1a1),'value':_0x45214c}]),_0x2d7d9c(''),_0x41716b(''),_0x48068b(_0x357a59(0x190));const _0x3e0d34=_0x293eb1[_0x357a59(0x1bc)]((_0x2f21c5,_0xca0485)=>_0x32499b[_0x357a59(0x191)](_0xca0485));createMenus(_0x3e0d34,[_0x481d34,_0x45214c])['then'](()=>{const _0x43e410=_0x357a59;_0x48068b(_0x43e410(0x1cb)),setTimeout(()=>{_0xc618e1();},0x3e8);})[_0x357a59(0x19e)](_0x19fd0f=>{const _0x471a2b=_0x357a59;_0x41716b(_0x19fd0f[_0x471a2b(0x1c8)]||'创建菜单失败'),_0x48068b(_0x471a2b(0x195));});return;}if(_0x14d261[_0x357a59(0x1c9)]||_0x14d261[_0x357a59(0x1c3)]){_0x2d7d9c(_0xf99a8c=>_0xf99a8c[_0x357a59(0x1bd)](0x0,-0x1)),_0x41716b('');return;}_0x2d7d9c(_0x42e5d8=>_0x42e5d8+_0x437b7c);return;}});if(_0x582456)return a10_0xcecaec(Box,{'marginTop':0x1,'marginBottom':0x1,'children':[a10_0x26da09(Text,{'children':'\x20\x20'}),a10_0x26da09(a10_0x589473,{'type':_0x3f2bcd(0x1c0)}),a10_0x26da09(Text,{'children':_0x3f2bcd(0x1b9)})]});if(_0x2e6843)return a10_0xcecaec(Box,{'flexDirection':'column','marginTop':0x1,'marginBottom':0x1,'children':[a10_0xcecaec(Text,{'color':_0x3f2bcd(0x1b1),'children':['✗\x20',_0x2e6843]}),a10_0xcecaec(Box,{'marginTop':0x1,'children':[a10_0x26da09(Text,{'color':_0x3f2bcd(0x1a9),'children':_0x3f2bcd(0x1a6)}),a10_0x26da09(Text,{'color':_0x3f2bcd(0x1c2),'children':'lovrabet\x20auth'}),a10_0x26da09(Text,{'color':'gray','children':'\x20命令重新登录'})]})]});if(_0x293eb1['length']===0x0)return a10_0x26da09(Box,{'marginTop':0x1,'marginBottom':0x1,'children':a10_0x26da09(Text,{'color':_0x3f2bcd(0x1b3),'children':_0x3f2bcd(0x1a3)})});return a10_0xcecaec(Box,{'flexDirection':_0x3f2bcd(0x1a4),'marginTop':0x1,'marginBottom':0x1,'children':[_0x194968===_0x3f2bcd(0x195)&&a10_0xcecaec(a10_0x310964,{'children':[a10_0xcecaec(Box,{'children':[a10_0xcecaec(Text,{'bold':!![],'children':['\x20\x20',_0x3f2bcd(0x1c6),getRemainingSpaces(_0x2047ba,'菜单名称')]}),a10_0xcecaec(Text,{'bold':!![],'children':['本地',getRemainingSpaces(_0x3f0583,_0x3f2bcd(0x1c6))]}),a10_0xcecaec(Text,{'bold':!![],'children':['Lovrabet平台',getRemainingSpaces(_0x3f0583,_0x3f2bcd(0x1c6))]})]}),_0x128d5d[_0x3f2bcd(0x192)](_0x547a51=>a10_0xcecaec(Box,{'children':[a10_0xcecaec(Text,{'children':['\x20\x20',_0x547a51[_0x3f2bcd(0x1ae)],getRemainingSpaces(_0x2047ba,_0x547a51[_0x3f2bcd(0x1ae)])]}),a10_0xcecaec(Text,{'color':'green','children':[_0x547a51['local']?'✓':'✗',getRemainingSpaces(_0x3f0583,'✓')]}),a10_0xcecaec(Text,{'color':_0x547a51[_0x3f2bcd(0x1aa)]?_0x3f2bcd(0x1bf):'red','children':[_0x547a51[_0x3f2bcd(0x1aa)]?'✓':'✗',getRemainingSpaces(_0x3f0583,'✓')]})]},_0x547a51[_0x3f2bcd(0x196)]))]}),_0x194968===_0x3f2bcd(0x195)&&_0x4f9c82[_0x3f2bcd(0x1ac)]===0x0&&a10_0x26da09(Box,{'marginTop':0x1,'children':a10_0x26da09(Text,{'color':'cyan','children':_0x3f2bcd(0x1b0)})}),_0x4f9c82['map']((_0x4ce61e,_0x113ee8)=>a10_0xcecaec(Box,{'children':[a10_0xcecaec(Text,{'color':'green','children':['√\x20',_0x4ce61e['label'],':\x20']}),a10_0x26da09(Text,{'color':_0x3f2bcd(0x1c2),'children':_0x4ce61e['value']})]},_0x113ee8)),_0x4a724c&&_0x194968===_0x3f2bcd(0x195)&&a10_0x26da09(Box,{'marginTop':0x1,'children':a10_0xcecaec(Text,{'color':'red','children':['✗\x20',_0x4a724c]})}),_0x194968==='selecting'&&a10_0x26da09(a10_0x310964,{'children':a10_0xcecaec(Box,{'marginTop':_0x4f9c82['length']>0x0||_0x4a724c?0x1:0x0,'flexDirection':'column','children':[a10_0x26da09(Text,{'bold':!![],'children':_0x3f2bcd(0x1cf)}),_0x293eb1[_0x3f2bcd(0x192)]((_0x7d5545,_0x4c51bb)=>{const _0xbe520e=_0x3f2bcd,_0x2b61a0=_0x1763b0===_0x4c51bb,_0x13b277=_0x32499b[_0xbe520e(0x191)](_0x4c51bb),_0x1cb6ae=_0x1aac22[_0xbe520e(0x19d)](_0x7d5545[_0xbe520e(0x196)]),_0x1326a4=_0x1cb6ae?'更新':'新建';return a10_0x26da09(Box,{'children':a10_0xcecaec(Text,{'backgroundColor':_0x2b61a0?_0xbe520e(0x1ca):undefined,'color':_0x2b61a0?_0xbe520e(0x194):undefined,'children':['\x20\x20',_0x13b277?_0xbe520e(0x1ad):_0xbe520e(0x19f),'\x20',_0x7d5545[_0xbe520e(0x1ae)]]})},_0x7d5545[_0xbe520e(0x196)]);}),a10_0x26da09(Box,{'marginTop':0x1,'children':a10_0xcecaec(Text,{'color':_0x3f2bcd(0x1a9),'children':['\x20',_0x3f2bcd(0x1af)]})})]})}),_0x194968===_0x3f2bcd(0x1cc)&&a10_0xcecaec(a10_0x310964,{'children':[a10_0xcecaec(Box,{'children':[a10_0x26da09(Text,{'children':_0x3f2bcd(0x19b)}),a10_0x26da09(Text,{'color':'green','children':_0xe7e6c8}),_0x4a724c&&a10_0xcecaec(Text,{'color':_0x3f2bcd(0x1b1),'children':[_0x3f2bcd(0x1c4),_0x4a724c]})]}),!_0x4a724c&&a10_0x26da09(Box,{'children':a10_0x26da09(Text,{'color':'gray','children':'\x20输入项目的\x20JS\x20资源链接(https://...)'})})]}),_0x194968==='input-css'&&a10_0xcecaec(a10_0x310964,{'children':[a10_0xcecaec(Box,{'children':[a10_0x26da09(Text,{'children':'*\x20CSS\x20链接:\x20'}),a10_0x26da09(Text,{'color':_0x3f2bcd(0x1bf),'children':_0xe7e6c8}),_0x4a724c&&a10_0xcecaec(Text,{'color':_0x3f2bcd(0x1b1),'children':[_0x3f2bcd(0x1c4),_0x4a724c]})]}),!_0x4a724c&&a10_0x26da09(Box,{'children':a10_0x26da09(Text,{'color':_0x3f2bcd(0x1a9),'children':_0x3f2bcd(0x1b2)})})]}),_0x194968===_0x3f2bcd(0x190)&&a10_0x26da09(Box,{'children':a10_0x26da09(Text,{'children':_0x3f2bcd(0x1c1)})}),_0x194968===_0x3f2bcd(0x1cb)&&a10_0x26da09(Box,{'children':a10_0x26da09(Text,{'color':_0x3f2bcd(0x1bf),'children':'√\x20菜单创建完成'})})]});}function getStringWidth(_0x30e45d){const _0xd03fa4=a10_0x1ccb;let _0x55c36b=0x0;for(const _0x54785a of _0x30e45d){/[\u4e00-\u9fa5]/[_0xd03fa4(0x18e)](_0x54785a)?_0x55c36b+=0x2:_0x55c36b+=0x1;}return _0x55c36b;}function getRemainingSpaces(_0x2eb1f3,_0x3ad29a){const _0x55eec4=a10_0x1ccb,_0x3cd3bc=getStringWidth(_0x3ad29a);return Array(Math[_0x55eec4(0x1b6)](0x0,_0x2eb1f3-_0x3cd3bc))[_0x55eec4(0x1ab)]('\x20')[_0x55eec4(0x198)]('');}function getMaxWidth(_0x2d2722,_0x185aaa=0x2){const _0x51b46d=a10_0x1ccb;let _0x1eacfe='',_0x42d786=0x0;for(const _0x59f2a2 of _0x2d2722){const _0x3d760a=getStringWidth(_0x59f2a2);_0x3d760a>_0x42d786&&(_0x42d786=_0x3d760a,_0x1eacfe=_0x59f2a2);}return _0x1eacfe+'\x20'[_0x51b46d(0x1be)](_0x185aaa);}
1
+ function a10_0xb7b3(){const _0x1eda80=['*\x20同步菜单到\x20Lovrabet\x20平台','*\x20CSS\x20链接:\x20','已选择菜单','red','*\x20正在创建菜单...','\x20输入项目的\x20JS\x20资源链接(https://...)','*\x20JS\x20链接:\x20','done','downArrow','path','length','请至少选择一个菜单','281541zrovww','102840hiqvLU','CSS\x20链接','blue','dots','\x20输入项目的\x20CSS\x20资源链接(https://...)','菜单名称','创建菜单失败','15132060PNWari','\x20←\x20','5QivCfK','[✓]','gray','includes','CSS\x20链接无法访问','1897dmSFGV','2967056wgVDGR','[\x20]','yellow','return','4973706spWbRf','filter','lovrabet\x20auth','31192iDxMCe','JS\x20链接无法访问','column','input-js','!\x20未找到本地页面,请先创建页面','↑/↓:\x20移动光标\x20空格:\x20切换选中\x20a:\x20全选\x20i/r:\x20反选\x20Enter:\x20确认','cyan','delete','slice','299472mbfUCx','online','√\x20菜单创建完成','test','\x20正在获取线上菜单列表...','input-css','then','map','*\x20请选择要同步的菜单:','Lovrabet平台','size','trim','fill','creating','add','green','提示:使用\x20','local','backspace','main','max','selecting','has','label'];a10_0xb7b3=function(){return _0x1eda80;};return a10_0xb7b3();}const a10_0x2682f6=a10_0x4a0e;function a10_0x4a0e(_0x24042f,_0x22a1e2){const _0xb7b32d=a10_0xb7b3();return a10_0x4a0e=function(_0x4a0e29,_0x2052c7){_0x4a0e29=_0x4a0e29-0x1e3;let _0x583068=_0xb7b32d[_0x4a0e29];return _0x583068;},a10_0x4a0e(_0x24042f,_0x22a1e2);}(function(_0x3ed6fc,_0x9655d8){const _0x233238=a10_0x4a0e,_0x526134=_0x3ed6fc();while(!![]){try{const _0x47958c=-parseInt(_0x233238(0x1f8))/0x1+-parseInt(_0x233238(0x217))/0x2+-parseInt(_0x233238(0x1f7))/0x3+parseInt(_0x233238(0x207))/0x4*(parseInt(_0x233238(0x201))/0x5)+parseInt(_0x233238(0x20b))/0x6+-parseInt(_0x233238(0x206))/0x7*(-parseInt(_0x233238(0x20e))/0x8)+-parseInt(_0x233238(0x1ff))/0x9;if(_0x47958c===_0x9655d8)break;else _0x526134['push'](_0x526134['shift']());}catch(_0x2c1c16){_0x526134['push'](_0x526134['shift']());}}}(a10_0xb7b3,0x9261d));import{jsx as a10_0x5b784b,jsxs as a10_0x1dadf3,Fragment as a10_0x590dab}from'react/jsx-runtime';import{Text,Box,useInput,useApp,render}from'ink';import{useEffect,useState}from'react';import a10_0x54c496 from'ink-spinner';import{useGetOnlineMenuList}from'./use-get-online-menu-list.js';import{getLocalPages}from'./get-local-pages.js';import{createMenus}from'./create-menu.js';import{isUrlReachable,isValidCssHttpsUrl,isValidJsHttpsUrl}from'./valid-url.js';import.meta[a10_0x2682f6(0x1e6)]&&render(a10_0x5b784b(AppMenuSyncUI,{}));export function AppMenuSyncUI(){const _0x3be81c=a10_0x2682f6,{exit:_0x3b805d}=useApp(),{loading:_0xdc5b0f,menuList:_0xe11514,error:_0x4d66c2}=useGetOnlineMenuList(),_0x529108=getLocalPages(),_0x8d4da0=_0xe11514[_0x3be81c(0x21e)](_0x254c17=>_0x254c17[_0x3be81c(0x1f4)]),_0x1056dc=[_0x3be81c(0x1fd),..._0x529108['map'](_0x524ca2=>_0x524ca2[_0x3be81c(0x1ea)])],_0x4c0878=getStringWidth(getMaxWidth(_0x1056dc,0x4)),_0x493bf7=getStringWidth(getMaxWidth(['菜单名称'])),[_0x27343,_0x2ff6fd]=useState(_0x3be81c(0x1e8)),[_0x350e80,_0x4ba449]=useState(new Set()),[_0xf5fe48,_0x49ccde]=useState(0x0),[_0x430b50,_0x461cad]=useState(''),[_0x534313,_0x3007bc]=useState(''),[_0x12c740,_0x375d01]=useState(''),[_0x9fc392,_0xa84d09]=useState(''),[_0xd230b5,_0x2a78ab]=useState([]),_0x3564c3=_0x529108[_0x3be81c(0x21e)](_0x154f9d=>({'label':_0x154f9d[_0x3be81c(0x1ea)],'path':_0x154f9d[_0x3be81c(0x1f4)],'local':!![],'online':_0x8d4da0['includes'](_0x154f9d[_0x3be81c(0x1f4)])})),_0x1fa3c6=_0x529108[_0x3be81c(0x20c)](_0x23c3b3=>{const _0x1878f2=_0x3be81c;return!_0x8d4da0[_0x1878f2(0x204)](_0x23c3b3[_0x1878f2(0x1f4)]);});useEffect(()=>{const _0x487144=_0x3be81c;if(!_0xdc5b0f&&_0x529108[_0x487144(0x1f5)]>0x0&&_0x350e80[_0x487144(0x221)]===0x0){const _0x4a7509=new Set(_0x529108[_0x487144(0x21e)]((_0x5766c6,_0x4a6077)=>({'page':_0x5766c6,'index':_0x4a6077}))['filter'](({page:_0x2383b6})=>!_0x8d4da0[_0x487144(0x204)](_0x2383b6['path']))[_0x487144(0x21e)](({index:_0x23a1f6})=>_0x23a1f6));_0x4ba449(_0x4a7509);}},[_0xdc5b0f,_0x529108[_0x3be81c(0x1f5)],_0x8d4da0[_0x3be81c(0x1f5)]]),useInput(async(_0x573ef3,_0x3db37d)=>{const _0x19f8f8=_0x3be81c;if(_0x27343==='selecting'){if(_0x3db37d['upArrow']){_0x49ccde(_0x2f669b=>_0x2f669b>0x0?_0x2f669b-0x1:_0x529108['length']-0x1);return;}if(_0x3db37d[_0x19f8f8(0x1f3)]){_0x49ccde(_0x139b32=>_0x139b32<_0x529108[_0x19f8f8(0x1f5)]-0x1?_0x139b32+0x1:0x0);return;}if(_0x573ef3==='\x20'){_0x4ba449(_0x3c7d66=>{const _0x5c4cd6=_0x19f8f8,_0x2a1e12=new Set(_0x3c7d66);return _0x2a1e12[_0x5c4cd6(0x1e9)](_0xf5fe48)?_0x2a1e12[_0x5c4cd6(0x215)](_0xf5fe48):_0x2a1e12[_0x5c4cd6(0x225)](_0xf5fe48),_0x2a1e12;});return;}if(_0x573ef3==='a'||_0x573ef3==='A'){const _0x5d80ac=new Set(_0x529108[_0x19f8f8(0x21e)]((_0x50a435,_0x5f50d1)=>_0x5f50d1));_0x4ba449(_0x5d80ac);return;}if(_0x573ef3==='i'||_0x573ef3==='I'||_0x573ef3==='r'||_0x573ef3==='R'){_0x4ba449(_0x284b87=>{const _0x42c665=_0x19f8f8,_0x1bc45f=new Set();for(let _0x27b3da=0x0;_0x27b3da<_0x529108[_0x42c665(0x1f5)];_0x27b3da++){!_0x284b87[_0x42c665(0x1e9)](_0x27b3da)&&_0x1bc45f['add'](_0x27b3da);}return _0x1bc45f;});return;}if(_0x573ef3==='q'||_0x573ef3==='Q'){_0x3b805d();return;}if(_0x3db37d[_0x19f8f8(0x20a)]){if(_0x350e80['size']===0x0){_0xa84d09(_0x19f8f8(0x1f6));return;}const _0x1d3e0e=_0x529108[_0x19f8f8(0x20c)]((_0x934d51,_0x31ae48)=>_0x350e80['has'](_0x31ae48)),_0x5bad14=_0x1d3e0e[_0x19f8f8(0x21e)](_0x31bb11=>_0x31bb11[_0x19f8f8(0x1ea)])['join'](',\x20');_0x2a78ab([{'label':_0x19f8f8(0x1ed),'value':_0x350e80[_0x19f8f8(0x221)]+'\x20个'}]),_0xa84d09(''),_0x2ff6fd(_0x19f8f8(0x211));return;}return;}if(_0x27343==='input-js'){if(_0x3db37d[_0x19f8f8(0x20a)]){const _0x536621=_0x12c740['trim']();if(_0x536621==='')return;if(!isValidJsHttpsUrl(_0x536621)){_0xa84d09('请输入有效的\x20JS\x20https\x20链接');return;}if(!await isUrlReachable(_0x536621)){_0xa84d09(_0x19f8f8(0x20f));return;}_0x461cad(_0x536621),_0x2a78ab(_0x3e7fe9=>[..._0x3e7fe9,{'label':'JS\x20链接','value':_0x536621}]),_0x375d01(''),_0xa84d09(''),_0x2ff6fd(_0x19f8f8(0x21c));return;}if(_0x3db37d[_0x19f8f8(0x1e5)]||_0x3db37d[_0x19f8f8(0x215)]){_0x375d01(_0x52a4fe=>_0x52a4fe[_0x19f8f8(0x216)](0x0,-0x1)),_0xa84d09('');return;}_0x375d01(_0x3b0424=>_0x3b0424+_0x573ef3);return;}if(_0x27343===_0x19f8f8(0x21c)){if(_0x3db37d['return']){const _0x36b490=_0x12c740[_0x19f8f8(0x222)]();if(_0x36b490==='')return;if(!isValidCssHttpsUrl(_0x36b490)){_0xa84d09('请输入有效的\x20CSS\x20https\x20链接');return;}if(!await isUrlReachable(_0x36b490)){_0xa84d09(_0x19f8f8(0x205));return;}_0x3007bc(_0x36b490),_0x2a78ab(_0x5e0a19=>[..._0x5e0a19,{'label':_0x19f8f8(0x1f9),'value':_0x36b490}]),_0x375d01(''),_0xa84d09(''),_0x2ff6fd(_0x19f8f8(0x224));const _0x25f994=_0x529108[_0x19f8f8(0x20c)]((_0x3a3617,_0x5f592e)=>_0x350e80[_0x19f8f8(0x1e9)](_0x5f592e));createMenus(_0x25f994,[_0x430b50,_0x36b490])[_0x19f8f8(0x21d)](()=>{const _0x5a1fa4=_0x19f8f8;_0x2ff6fd(_0x5a1fa4(0x1f2)),setTimeout(()=>{_0x3b805d();},0x3e8);})['catch'](_0x13e49f=>{const _0x270747=_0x19f8f8;_0xa84d09(_0x13e49f['message']||_0x270747(0x1fe)),_0x2ff6fd(_0x270747(0x1e8));});return;}if(_0x3db37d[_0x19f8f8(0x1e5)]||_0x3db37d['delete']){_0x375d01(_0x493aac=>_0x493aac[_0x19f8f8(0x216)](0x0,-0x1)),_0xa84d09('');return;}_0x375d01(_0x432561=>_0x432561+_0x573ef3);return;}});if(_0xdc5b0f)return a10_0x1dadf3(Box,{'marginTop':0x1,'marginBottom':0x1,'children':[a10_0x5b784b(Text,{'children':'\x20\x20'}),a10_0x5b784b(a10_0x54c496,{'type':_0x3be81c(0x1fb)}),a10_0x5b784b(Text,{'children':_0x3be81c(0x21b)})]});if(_0x4d66c2)return a10_0x1dadf3(Box,{'flexDirection':_0x3be81c(0x210),'marginTop':0x1,'marginBottom':0x1,'children':[a10_0x1dadf3(Text,{'color':_0x3be81c(0x1ee),'children':['✗\x20',_0x4d66c2]}),a10_0x1dadf3(Box,{'marginTop':0x1,'children':[a10_0x5b784b(Text,{'color':_0x3be81c(0x203),'children':_0x3be81c(0x1e3)}),a10_0x5b784b(Text,{'color':'cyan','children':_0x3be81c(0x20d)}),a10_0x5b784b(Text,{'color':'gray','children':'\x20命令重新登录'})]})]});if(_0x529108[_0x3be81c(0x1f5)]===0x0)return a10_0x5b784b(Box,{'marginTop':0x1,'marginBottom':0x1,'children':a10_0x5b784b(Text,{'color':_0x3be81c(0x209),'children':_0x3be81c(0x212)})});return a10_0x1dadf3(Box,{'flexDirection':_0x3be81c(0x210),'marginTop':0x1,'marginBottom':0x1,'children':[_0x27343===_0x3be81c(0x1e8)&&a10_0x1dadf3(a10_0x590dab,{'children':[a10_0x1dadf3(Box,{'children':[a10_0x1dadf3(Text,{'bold':!![],'children':['\x20\x20',_0x3be81c(0x1fd),getRemainingSpaces(_0x4c0878,_0x3be81c(0x1fd))]}),a10_0x1dadf3(Text,{'bold':!![],'children':['本地',getRemainingSpaces(_0x493bf7,_0x3be81c(0x1fd))]}),a10_0x1dadf3(Text,{'bold':!![],'children':[_0x3be81c(0x220),getRemainingSpaces(_0x493bf7,_0x3be81c(0x1fd))]})]}),_0x3564c3[_0x3be81c(0x21e)](_0x21ab65=>a10_0x1dadf3(Box,{'children':[a10_0x1dadf3(Text,{'children':['\x20\x20',_0x21ab65[_0x3be81c(0x1ea)],getRemainingSpaces(_0x4c0878,_0x21ab65[_0x3be81c(0x1ea)])]}),a10_0x1dadf3(Text,{'color':_0x3be81c(0x226),'children':[_0x21ab65[_0x3be81c(0x1e4)]?'✓':'✗',getRemainingSpaces(_0x493bf7,'✓')]}),a10_0x1dadf3(Text,{'color':_0x21ab65[_0x3be81c(0x218)]?_0x3be81c(0x226):_0x3be81c(0x1ee),'children':[_0x21ab65[_0x3be81c(0x218)]?'✓':'✗',getRemainingSpaces(_0x493bf7,'✓')]})]},_0x21ab65['path']))]}),_0x27343==='selecting'&&_0xd230b5[_0x3be81c(0x1f5)]===0x0&&a10_0x5b784b(Box,{'marginTop':0x1,'children':a10_0x5b784b(Text,{'color':_0x3be81c(0x214),'children':_0x3be81c(0x1eb)})}),_0xd230b5[_0x3be81c(0x21e)]((_0x217b5a,_0xf5035b)=>a10_0x1dadf3(Box,{'children':[a10_0x1dadf3(Text,{'color':_0x3be81c(0x226),'children':['√\x20',_0x217b5a['label'],':\x20']}),a10_0x5b784b(Text,{'color':_0x3be81c(0x214),'children':_0x217b5a['value']})]},_0xf5035b)),_0x9fc392&&_0x27343===_0x3be81c(0x1e8)&&a10_0x5b784b(Box,{'marginTop':0x1,'children':a10_0x1dadf3(Text,{'color':'red','children':['✗\x20',_0x9fc392]})}),_0x27343==='selecting'&&a10_0x5b784b(a10_0x590dab,{'children':a10_0x1dadf3(Box,{'marginTop':_0xd230b5[_0x3be81c(0x1f5)]>0x0||_0x9fc392?0x1:0x0,'flexDirection':_0x3be81c(0x210),'children':[a10_0x5b784b(Text,{'bold':!![],'children':_0x3be81c(0x21f)}),_0x529108[_0x3be81c(0x21e)]((_0xc9a14c,_0x11ed3a)=>{const _0x26fe8c=_0x3be81c,_0x16746a=_0xf5fe48===_0x11ed3a,_0x294cf5=_0x350e80[_0x26fe8c(0x1e9)](_0x11ed3a),_0x4c8b8e=_0x8d4da0['includes'](_0xc9a14c['path']),_0x1e52b1=_0x4c8b8e?'更新':'新建';return a10_0x5b784b(Box,{'children':a10_0x1dadf3(Text,{'backgroundColor':_0x16746a?_0x26fe8c(0x1fa):undefined,'color':_0x16746a?'white':undefined,'children':['\x20\x20',_0x294cf5?_0x26fe8c(0x202):_0x26fe8c(0x208),'\x20',_0xc9a14c[_0x26fe8c(0x1ea)]]})},_0xc9a14c[_0x26fe8c(0x1f4)]);}),a10_0x5b784b(Box,{'marginTop':0x1,'children':a10_0x1dadf3(Text,{'color':_0x3be81c(0x203),'children':['\x20',_0x3be81c(0x213)]})})]})}),_0x27343===_0x3be81c(0x211)&&a10_0x1dadf3(a10_0x590dab,{'children':[a10_0x1dadf3(Box,{'children':[a10_0x5b784b(Text,{'children':_0x3be81c(0x1f1)}),a10_0x5b784b(Text,{'color':_0x3be81c(0x226),'children':_0x12c740}),_0x9fc392&&a10_0x1dadf3(Text,{'color':'red','children':[_0x3be81c(0x200),_0x9fc392]})]}),!_0x9fc392&&a10_0x5b784b(Box,{'children':a10_0x5b784b(Text,{'color':_0x3be81c(0x203),'children':_0x3be81c(0x1f0)})})]}),_0x27343==='input-css'&&a10_0x1dadf3(a10_0x590dab,{'children':[a10_0x1dadf3(Box,{'children':[a10_0x5b784b(Text,{'children':_0x3be81c(0x1ec)}),a10_0x5b784b(Text,{'color':'green','children':_0x12c740}),_0x9fc392&&a10_0x1dadf3(Text,{'color':_0x3be81c(0x1ee),'children':[_0x3be81c(0x200),_0x9fc392]})]}),!_0x9fc392&&a10_0x5b784b(Box,{'children':a10_0x5b784b(Text,{'color':'gray','children':_0x3be81c(0x1fc)})})]}),_0x27343===_0x3be81c(0x224)&&a10_0x5b784b(Box,{'children':a10_0x5b784b(Text,{'children':_0x3be81c(0x1ef)})}),_0x27343==='done'&&a10_0x5b784b(Box,{'children':a10_0x5b784b(Text,{'color':_0x3be81c(0x226),'children':_0x3be81c(0x219)})})]});}function getStringWidth(_0x4eac54){const _0xbe8590=a10_0x2682f6;let _0x4440c0=0x0;for(const _0x1429b3 of _0x4eac54){/[\u4e00-\u9fa5]/[_0xbe8590(0x21a)](_0x1429b3)?_0x4440c0+=0x2:_0x4440c0+=0x1;}return _0x4440c0;}function getRemainingSpaces(_0x1b480e,_0x118154){const _0x13440b=a10_0x2682f6,_0x56d868=getStringWidth(_0x118154);return Array(Math[_0x13440b(0x1e7)](0x0,_0x1b480e-_0x56d868))[_0x13440b(0x223)]('\x20')['join']('');}function getMaxWidth(_0x2ca47c,_0xa4f6b4=0x2){let _0x4ab61e='',_0x4d0175=0x0;for(const _0x258c02 of _0x2ca47c){const _0x1480b9=getStringWidth(_0x258c02);_0x1480b9>_0x4d0175&&(_0x4d0175=_0x1480b9,_0x4ab61e=_0x258c02);}return _0x4ab61e+'\x20'['repeat'](_0xa4f6b4);}