@lovrabet/cli 1.1.18 → 1.1.20

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 (54) hide show
  1. package/lib/add-page/input-page-router.js +1 -1
  2. package/lib/add-page/main.js +1 -1
  3. package/lib/add-page/select-page-template.js +1 -1
  4. package/lib/api/api-doc-ui.js +1 -1
  5. package/lib/api/api-doc.js +1 -1
  6. package/lib/api/api-pull-ui.js +1 -1
  7. package/lib/api/fetch-model-list.js +1 -1
  8. package/lib/api/generate-api-file.js +1 -1
  9. package/lib/api/main.js +1 -1
  10. package/lib/api/pull-silent.js +1 -1
  11. package/lib/app-menu/app-menu-sync-ui.js +1 -1
  12. package/lib/app-menu/create-menu.js +1 -1
  13. package/lib/app-menu/get-local-pages.js +1 -1
  14. package/lib/app-menu/get-online-menu-list.js +1 -1
  15. package/lib/app-menu/valid-url.js +1 -1
  16. package/lib/auth/auth-server-ui.js +1 -1
  17. package/lib/auth/auth-server.js +1 -1
  18. package/lib/auth/constant.js +1 -1
  19. package/lib/auth/get-cookie.js +1 -1
  20. package/lib/auth/is-session-valid.js +1 -1
  21. package/lib/auth/logout.js +1 -1
  22. package/lib/cli.js +1 -1
  23. package/lib/cmd/build-watch.js +1 -1
  24. package/lib/cmd/build.js +1 -1
  25. package/lib/cmd/logs.js +1 -1
  26. package/lib/cmd/preview.js +1 -1
  27. package/lib/cmd/start.js +1 -1
  28. package/lib/config/config-help.js +1 -1
  29. package/lib/config/main.js +1 -1
  30. package/lib/constant/domain.js +1 -1
  31. package/lib/constant/env.js +1 -1
  32. package/lib/create-app/enhanced-guided-create.js +1 -1
  33. package/lib/create-app/format-elapsed.js +1 -1
  34. package/lib/create-app/main.js +1 -1
  35. package/lib/create-app/task-finished.js +1 -1
  36. package/lib/create-app/task-loading.js +1 -1
  37. package/lib/create-app/task-running.js +1 -1
  38. package/lib/create-app/task-time.js +1 -1
  39. package/lib/create-app/use-copy-project-template.js +1 -1
  40. package/lib/create-app/use-format-code.js +1 -1
  41. package/lib/create-app/use-install-dependencies.js +1 -1
  42. package/lib/help.js +1 -1
  43. package/lib/init/main.js +1 -1
  44. package/lib/mcp/cursor.js +1 -0
  45. package/lib/mcp/main.js +1 -0
  46. package/lib/utils/config.js +1 -1
  47. package/lib/utils/copy-directory.js +1 -1
  48. package/lib/utils/http-client.js +1 -1
  49. package/lib/utils/logger.js +1 -1
  50. package/lib/utils/router-updater.js +1 -1
  51. package/lib/utils/sleep.js +1 -1
  52. package/lib/utils/template-replacer.js +1 -1
  53. package/package.json +1 -1
  54. package/templates/projects/sub-app-react-demo/package.json +1 -1
@@ -1 +1 @@
1
- (function(_0x49c2f5,_0x1a75e9){const _0x165d47=a0_0x53bf,_0x4d7383=_0x49c2f5();while(!![]){try{const _0xbb67ba=parseInt(_0x165d47(0x17e))/0x1+-parseInt(_0x165d47(0x180))/0x2+-parseInt(_0x165d47(0x172))/0x3*(-parseInt(_0x165d47(0x16b))/0x4)+-parseInt(_0x165d47(0x16f))/0x5+-parseInt(_0x165d47(0x17c))/0x6+-parseInt(_0x165d47(0x17d))/0x7+-parseInt(_0x165d47(0x173))/0x8*(-parseInt(_0x165d47(0x175))/0x9);if(_0xbb67ba===_0x1a75e9)break;else _0x4d7383['push'](_0x4d7383['shift']());}catch(_0x235c67){_0x4d7383['push'](_0x4d7383['shift']());}}}(a0_0x5956,0xf1177));import{jsx as a0_0x12ddb4,jsxs as a0_0x479bd3}from'react/jsx-runtime';import{useState}from'react';import{Text,Box,useInput}from'ink';import a0_0x4e2937 from'node:fs';export function InputProjectCode(_0x2051fb){const _0x297bc1=a0_0x53bf,{onSubmit:_0x476161,pagePath:_0x37b82c}=_0x2051fb,[_0x2d8ab9,_0x102465]=useState(''),[_0x3720c6,_0x40f8fa]=useState(''),_0x34bdb0=_0x297bc1(0x189);function _0x1211f6(_0x350c51){const _0x2e6cb5=_0x297bc1;if(_0x350c51[_0x2e6cb5(0x179)]>0x64)return{'valid':![],'message':_0x2e6cb5(0x178)};if(_0x350c51[_0x2e6cb5(0x186)]('/')||_0x350c51[_0x2e6cb5(0x181)]('/'))return{'valid':![],'message':_0x2e6cb5(0x17f)};if(_0x350c51[_0x2e6cb5(0x171)]('//'))return{'valid':![],'message':_0x2e6cb5(0x17a)};const _0x357141=_0x350c51[_0x2e6cb5(0x174)]('/');for(const _0x1a9ca5 of _0x357141){if(!_0x1a9ca5)continue;const _0x6f81ee=/^[A-Za-z0-9][A-Za-z0-9_-]*$/;if(!_0x6f81ee[_0x2e6cb5(0x18b)](_0x1a9ca5))return{'valid':![],'message':_0x2e6cb5(0x185)};}return{'valid':!![]};}return useInput((_0x58caa6,_0x19be5b)=>{const _0x3f2f28=_0x297bc1;if(_0x19be5b[_0x3f2f28(0x188)]){const _0x4094da=_0x2d8ab9['trim']()||_0x34bdb0;if(_0x3720c6)return;const _0x225f35=_0x37b82c+'/'+_0x4094da;if(a0_0x4e2937[_0x3f2f28(0x16d)](_0x225f35)){_0x40f8fa(_0x3f2f28(0x187)+_0x4094da+_0x3f2f28(0x182));return;}_0x476161(_0x4094da),_0x102465(''),_0x40f8fa('');}else _0x19be5b[_0x3f2f28(0x16c)]||_0x19be5b['delete']?_0x102465(_0x4fca9c=>{const _0x17fb95=_0x3f2f28,_0x473a6b=_0x4fca9c[_0x17fb95(0x183)](0x0,-0x1),{valid:_0x510d34,message:_0x2be3cd}=_0x1211f6(_0x473a6b);return _0x40f8fa(_0x510d34?'':_0x2be3cd||_0x17fb95(0x18a)),_0x473a6b;}):_0x102465(_0x2ea526=>{const _0x3ee61e=_0x3f2f28,_0xdf6046=_0x2ea526+_0x58caa6,{valid:_0x3f78ef,message:_0x181a19}=_0x1211f6(_0xdf6046);return _0x40f8fa(_0x3f78ef?'':_0x181a19||_0x3ee61e(0x18a)),_0xdf6046;});}),a0_0x479bd3(Box,{'flexDirection':_0x297bc1(0x177),'children':[a0_0x479bd3(Box,{'children':[a0_0x12ddb4(Text,{'color':_0x297bc1(0x184),'children':_0x297bc1(0x176)}),a0_0x12ddb4(Text,{'children':_0x297bc1(0x16e)}),_0x2d8ab9?a0_0x12ddb4(Text,{'color':'green','children':_0x2d8ab9}):a0_0x12ddb4(Text,{'color':_0x297bc1(0x184),'children':_0x34bdb0}),_0x3720c6&&a0_0x479bd3(Text,{'color':'red','children':[_0x297bc1(0x17b),_0x3720c6]})]}),!_0x3720c6&&!_0x2d8ab9&&a0_0x12ddb4(Box,{'children':a0_0x12ddb4(Text,{'color':_0x297bc1(0x184),'children':_0x297bc1(0x170)})})]});}function a0_0x53bf(_0x428446,_0x4c90b5){const _0x595602=a0_0x5956();return a0_0x53bf=function(_0x53bf4c,_0x2c0b30){_0x53bf4c=_0x53bf4c-0x16b;let _0xf1e959=_0x595602[_0x53bf4c];return _0xf1e959;},a0_0x53bf(_0x428446,_0x4c90b5);}function a0_0x5956(){const _0x5c7fa7=['\x20已存在,请使用其他路径','slice','gray','路径中的每个段只能以字母或数字开头,且只包含字母、数字、-\x20和\x20_','startsWith','页面路径\x20','return','my-page','页面路径不合法','test','12SREsbY','backspace','existsSync','页面路由地址:\x20','8621730DlYvmI','\x20直接回车确认,或输入自定义路由地址','includes','1693686BIzzvt','908464Tghahl','split','333jhfxIK','\x20Step2:\x20','column','页面路径长度不能超过\x20100\x20个字符','length','路径不能包含连续的\x20/','\x20←\x20','5160672WAEogO','7368417ZgdibX','676266IALBZy','路径不能以\x20/\x20开头或结尾','3893996QVhKJk','endsWith'];a0_0x5956=function(){return _0x5c7fa7;};return a0_0x5956();}
1
+ (function(_0x29ac50,_0x3967ac){const _0x61d1aa=a0_0x5b32,_0x391b26=_0x29ac50();while(!![]){try{const _0x3be3ea=parseInt(_0x61d1aa(0x1ee))/0x1*(-parseInt(_0x61d1aa(0x1f6))/0x2)+-parseInt(_0x61d1aa(0x1fd))/0x3+-parseInt(_0x61d1aa(0x1f7))/0x4+parseInt(_0x61d1aa(0x1f3))/0x5*(-parseInt(_0x61d1aa(0x203))/0x6)+parseInt(_0x61d1aa(0x205))/0x7*(-parseInt(_0x61d1aa(0x201))/0x8)+parseInt(_0x61d1aa(0x1f5))/0x9+-parseInt(_0x61d1aa(0x1fa))/0xa*(-parseInt(_0x61d1aa(0x209))/0xb);if(_0x3be3ea===_0x3967ac)break;else _0x391b26['push'](_0x391b26['shift']());}catch(_0x3ceb3c){_0x391b26['push'](_0x391b26['shift']());}}}(a0_0x195e,0x93d46));import{jsx as a0_0x1c9ad9,jsxs as a0_0x300169}from'react/jsx-runtime';import{useState}from'react';function a0_0x5b32(_0x3809f9,_0x140d11){const _0x195ee6=a0_0x195e();return a0_0x5b32=function(_0x5b3248,_0x5b3637){_0x5b3248=_0x5b3248-0x1ed;let _0x168eae=_0x195ee6[_0x5b3248];return _0x168eae;},a0_0x5b32(_0x3809f9,_0x140d11);}import{Text,Box,useInput}from'ink';function a0_0x195e(){const _0x3f199a=['green','11wQVGaf','页面路径\x20','test','startsWith','slice','column','\x20←\x20','343324gileUa','split','return','endsWith','trim','5eLSWVm','red','9536265nSnvYY','6SLtarY','9512xYDhNt','\x20Step2:\x20','页面路径不合法','22903130ehFMTY','delete','my-page','2029323aliFoS','路径不能包含连续的\x20/','length','includes','11296wXmqgB','existsSync','3511014QhcPUL','gray','2233lvUpxJ','\x20已存在,请使用其他路径','路径中的每个段只能以字母或数字开头,且只包含字母、数字、-\x20和\x20_'];a0_0x195e=function(){return _0x3f199a;};return a0_0x195e();}import a0_0x3828e6 from'node:fs';export function InputProjectCode(_0x222abf){const _0x3262f1=a0_0x5b32,{onSubmit:_0x3eff63,pagePath:_0xd755ed}=_0x222abf,[_0x5b83ea,_0x4d2114]=useState(''),[_0x6a201c,_0x47a40d]=useState(''),_0x5c89b9=_0x3262f1(0x1fc);function _0xf7575f(_0x4d813d){const _0x22a4f9=_0x3262f1;if(_0x4d813d[_0x22a4f9(0x1ff)]>0x64)return{'valid':![],'message':'页面路径长度不能超过\x20100\x20个字符'};if(_0x4d813d[_0x22a4f9(0x20c)]('/')||_0x4d813d[_0x22a4f9(0x1f1)]('/'))return{'valid':![],'message':'路径不能以\x20/\x20开头或结尾'};if(_0x4d813d[_0x22a4f9(0x200)]('//'))return{'valid':![],'message':_0x22a4f9(0x1fe)};const _0x4099fa=_0x4d813d[_0x22a4f9(0x1ef)]('/');for(const _0x622f5f of _0x4099fa){if(!_0x622f5f)continue;const _0x5e0729=/^[A-Za-z0-9][A-Za-z0-9_-]*$/;if(!_0x5e0729[_0x22a4f9(0x20b)](_0x622f5f))return{'valid':![],'message':_0x22a4f9(0x207)};}return{'valid':!![]};}return useInput((_0xa2f75f,_0x4a36d7)=>{const _0x5bcdce=_0x3262f1;if(_0x4a36d7[_0x5bcdce(0x1f0)]){const _0x2df556=_0x5b83ea[_0x5bcdce(0x1f2)]()||_0x5c89b9;if(_0x6a201c)return;const _0x4020e7=_0xd755ed+'/'+_0x2df556;if(a0_0x3828e6[_0x5bcdce(0x202)](_0x4020e7)){_0x47a40d(_0x5bcdce(0x20a)+_0x2df556+_0x5bcdce(0x206));return;}_0x3eff63(_0x2df556),_0x4d2114(''),_0x47a40d('');}else _0x4a36d7['backspace']||_0x4a36d7[_0x5bcdce(0x1fb)]?_0x4d2114(_0x2542e8=>{const _0x38329e=_0x5bcdce,_0x55fd1b=_0x2542e8[_0x38329e(0x20d)](0x0,-0x1),{valid:_0x3273f5,message:_0x5be2fb}=_0xf7575f(_0x55fd1b);return _0x47a40d(_0x3273f5?'':_0x5be2fb||_0x38329e(0x1f9)),_0x55fd1b;}):_0x4d2114(_0x22135d=>{const _0x238ef5=_0x5bcdce,_0x35b8d9=_0x22135d+_0xa2f75f,{valid:_0x382103,message:_0x450513}=_0xf7575f(_0x35b8d9);return _0x47a40d(_0x382103?'':_0x450513||_0x238ef5(0x1f9)),_0x35b8d9;});}),a0_0x300169(Box,{'flexDirection':_0x3262f1(0x20e),'children':[a0_0x300169(Box,{'children':[a0_0x1c9ad9(Text,{'color':_0x3262f1(0x204),'children':_0x3262f1(0x1f8)}),a0_0x1c9ad9(Text,{'children':'页面路由地址:\x20'}),_0x5b83ea?a0_0x1c9ad9(Text,{'color':_0x3262f1(0x208),'children':_0x5b83ea}):a0_0x1c9ad9(Text,{'color':_0x3262f1(0x204),'children':_0x5c89b9}),_0x6a201c&&a0_0x300169(Text,{'color':_0x3262f1(0x1f4),'children':[_0x3262f1(0x1ed),_0x6a201c]})]}),!_0x6a201c&&!_0x5b83ea&&a0_0x1c9ad9(Box,{'children':a0_0x1c9ad9(Text,{'color':_0x3262f1(0x204),'children':'\x20直接回车确认,或输入自定义路由地址'})})]});}
@@ -1 +1 @@
1
- const a1_0x5ec67f=a1_0x509c;function a1_0x509c(_0x51efa0,_0x14645e){const _0x5a1a9d=a1_0x5a1a();return a1_0x509c=function(_0x509ca1,_0x509322){_0x509ca1=_0x509ca1-0x79;let _0x2a5425=_0x5a1a9d[_0x509ca1];return _0x2a5425;},a1_0x509c(_0x51efa0,_0x14645e);}(function(_0x56f95c,_0x110945){const _0x1076db=a1_0x509c,_0x3570c4=_0x56f95c();while(!![]){try{const _0x23c56e=parseInt(_0x1076db(0x9c))/0x1*(-parseInt(_0x1076db(0x8a))/0x2)+parseInt(_0x1076db(0x97))/0x3+-parseInt(_0x1076db(0x7c))/0x4*(parseInt(_0x1076db(0x8e))/0x5)+parseInt(_0x1076db(0x9e))/0x6+-parseInt(_0x1076db(0x89))/0x7*(-parseInt(_0x1076db(0x99))/0x8)+-parseInt(_0x1076db(0x7f))/0x9*(-parseInt(_0x1076db(0x88))/0xa)+parseInt(_0x1076db(0x98))/0xb;if(_0x23c56e===_0x110945)break;else _0x3570c4['push'](_0x3570c4['shift']());}catch(_0x328885){_0x3570c4['push'](_0x3570c4['shift']());}}}(a1_0x5a1a,0x5650c));import{jsx as a1_0x22173a,jsxs as a1_0x29927a,Fragment as a1_0x4a3e95}from'react/jsx-runtime';import{fileURLToPath}from'node:url';import a1_0x476ee7 from'node:path';import{useEffect,useState}from'react';import{Box,Text,useApp}from'ink';function a1_0x5a1a(){const _0x415c3f=['processTemplate','gray','catch','finally','50gtOqNo','168266ojZaVV','2TKTVJu','info','setLogPath','已输入的页面路由\x20','5RRzsDU','now','join','success','then','column','正在创建页面,请稍候…','message','页面添加成功:\x20','554637DsLhkQ','6068491nkLtZT','16ELyEgT','src','\x20*\x20页面路径:\x20','149125lUPVGY','add-page','669138WVkIiA','已选择页面模板\x20','resolve','cwd','2533484jVnyij','pages','\x20*\x20页面创建成功!','431793SkLHWy','dirname','\x20*\x20路由地址:\x20','green','\x20*\x20页面文件已创建,可直接通过路由访问'];a1_0x5a1a=function(){return _0x415c3f;};return a1_0x5a1a();}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_0x476ee7[a1_0x5ec67f(0x80)](fileURLToPath(import.meta['url'])),pageTemplateDir=a1_0x476ee7[a1_0x5ec67f(0x7a)](__dirname,'../../templates/pages'),projectDir=process[a1_0x5ec67f(0x7b)]();export const AddPage=()=>{const _0x55c813=a1_0x5ec67f,{exit:_0x39f621}=useApp(),[_0x354b46,_0x2c92ed]=useState(''),[_0x1d0aa9,_0x52ebd1]=useState(''),[_0x55e3a4,_0x10d27a]=useState(![]),[_0x14ed3c,_0x5465ee]=useState(![]),_0x1e818b=a1_0x476ee7[_0x55c813(0x90)](projectDir,_0x55c813(0x9a),_0x55c813(0x7d)),_0x5e4296=a1_0x476ee7[_0x55c813(0x90)](_0x1e818b,_0x1d0aa9),_0x32ab86=a1_0x476ee7[_0x55c813(0x90)]('src',_0x55c813(0x7d),_0x1d0aa9);useEffect(()=>{const _0x35d4e8=_0x55c813,_0x4fcac4=a1_0x476ee7['resolve'](pageTemplateDir,_0x354b46);if(_0x354b46&&_0x1d0aa9){_0x10d27a(!![]),logger[_0x35d4e8(0x8c)](process[_0x35d4e8(0x7b)]());const _0x2e7a77=Date['now']();logger[_0x35d4e8(0x8b)](_0x35d4e8(0x9d),'开始添加页面:\x20'+_0x1d0aa9,{'template':_0x354b46,'targetPath':_0x32ab86}),TemplateReplacer[_0x35d4e8(0x84)](_0x4fcac4,a1_0x476ee7['join'](_0x1e818b,_0x1d0aa9),_0x1d0aa9,_0x354b46)[_0x35d4e8(0x92)](()=>{const _0x5bfafd=_0x35d4e8,_0x41a36e=Date[_0x5bfafd(0x8f)]()-_0x2e7a77;logger[_0x5bfafd(0x91)]('add-page',_0x5bfafd(0x96)+_0x1d0aa9,_0x41a36e,{'template':_0x354b46,'targetPath':_0x32ab86,'routePath':_0x1d0aa9}),_0x5465ee(!![]);})[_0x35d4e8(0x86)](_0x52764f=>{const _0x171c50=_0x35d4e8,_0x333ec7=Date[_0x171c50(0x8f)]()-_0x2e7a77;logger['error'](_0x171c50(0x9d),'页面添加失败:\x20'+_0x1d0aa9,{'template':_0x354b46,'targetPath':_0x32ab86,'error':_0x52764f instanceof Error?_0x52764f[_0x171c50(0x95)]:String(_0x52764f),'duration':_0x333ec7});})[_0x35d4e8(0x87)](()=>{_0x10d27a(![]);});}},[_0x354b46,_0x1d0aa9]),useEffect(()=>{_0x14ed3c&&setTimeout(()=>{_0x39f621();});},[_0x14ed3c]);if(_0x354b46)return a1_0x29927a(Box,{'flexDirection':_0x55c813(0x93),'paddingY':0x1,'children':[a1_0x29927a(Box,{'children':[a1_0x22173a(Text,{'color':'gray','children':'\x20Step1:\x20'}),a1_0x22173a(Text,{'children':_0x55c813(0x79)}),a1_0x22173a(Text,{'color':_0x55c813(0x82),'children':_0x354b46})]}),_0x1d0aa9?a1_0x29927a(Box,{'children':[a1_0x22173a(Text,{'color':_0x55c813(0x85),'children':'\x20Step2:\x20'}),a1_0x22173a(Text,{'children':_0x55c813(0x8d)}),a1_0x22173a(Text,{'color':_0x55c813(0x82),'children':_0x1d0aa9})]}):a1_0x22173a(InputProjectCode,{'pagePath':_0x5e4296,'onSubmit':_0x52ebd1}),_0x1d0aa9&&_0x55e3a4?a1_0x29927a(Box,{'marginTop':0x1,'children':[a1_0x22173a(Box,{'width':'4'}),a1_0x22173a(Text,{'children':_0x55c813(0x94)})]}):null,_0x14ed3c?a1_0x29927a(a1_0x4a3e95,{'children':[a1_0x22173a(Box,{'marginTop':0x1,'children':a1_0x22173a(Text,{'color':_0x55c813(0x85),'children':_0x55c813(0x7e)})}),a1_0x29927a(Box,{'children':[a1_0x22173a(Text,{'color':_0x55c813(0x85),'children':_0x55c813(0x9b)}),a1_0x22173a(Text,{'color':_0x55c813(0x82),'children':_0x32ab86})]}),a1_0x29927a(Box,{'children':[a1_0x22173a(Text,{'color':_0x55c813(0x85),'children':_0x55c813(0x81)}),a1_0x29927a(Text,{'color':_0x55c813(0x82),'children':['/',_0x1d0aa9]})]}),a1_0x22173a(Box,{'marginTop':0x1,'children':a1_0x22173a(Text,{'color':'cyan','children':_0x55c813(0x83)})})]}):null]});return a1_0x22173a(SelectPageTemplate,{'onSelect':_0x2c92ed});};
1
+ const a1_0x4c1838=a1_0x1b01;function a1_0x1b01(_0x25a258,_0x3d8487){const _0x1aa816=a1_0x1aa8();return a1_0x1b01=function(_0x1b0162,_0x2f0053){_0x1b0162=_0x1b0162-0x81;let _0x4b6a50=_0x1aa816[_0x1b0162];return _0x4b6a50;},a1_0x1b01(_0x25a258,_0x3d8487);}(function(_0xe42bb3,_0x37b65d){const _0x208ea5=a1_0x1b01,_0x21addf=_0xe42bb3();while(!![]){try{const _0x2041ab=-parseInt(_0x208ea5(0x94))/0x1*(-parseInt(_0x208ea5(0x9c))/0x2)+parseInt(_0x208ea5(0x81))/0x3*(parseInt(_0x208ea5(0x85))/0x4)+-parseInt(_0x208ea5(0x98))/0x5*(parseInt(_0x208ea5(0xa4))/0x6)+parseInt(_0x208ea5(0x84))/0x7+parseInt(_0x208ea5(0x95))/0x8+-parseInt(_0x208ea5(0x91))/0x9*(-parseInt(_0x208ea5(0x97))/0xa)+parseInt(_0x208ea5(0x8b))/0xb*(-parseInt(_0x208ea5(0x89))/0xc);if(_0x2041ab===_0x37b65d)break;else _0x21addf['push'](_0x21addf['shift']());}catch(_0x247536){_0x21addf['push'](_0x21addf['shift']());}}}(a1_0x1aa8,0xb93c8));import{jsx as a1_0x176331,jsxs as a1_0x22ccfc,Fragment as a1_0x47ab8c}from'react/jsx-runtime';import{fileURLToPath}from'node:url';import a1_0x53408c from'node:path';import{useEffect,useState}from'react';import{Box,Text,useApp}from'ink';import{SelectPageTemplate}from'./select-page-template.js';import{InputProjectCode}from'./input-page-router.js';import{logger}from'../utils/logger.js';import{TemplateReplacer}from'../utils/template-replacer.js';const __dirname=a1_0x53408c['dirname'](fileURLToPath(import.meta['url'])),pageTemplateDir=a1_0x53408c[a1_0x4c1838(0x92)](__dirname,a1_0x4c1838(0x82)),projectDir=process[a1_0x4c1838(0x88)]();function a1_0x1aa8(){const _0x3f2dbd=['已输入的页面路由\x20','then','cyan','255098aqVTbM','setLogPath','processTemplate','join','now','green','\x20Step1:\x20','\x20*\x20路由地址:\x20','12xTgYRm','add-page','column','info','508449KGbNhp','../../templates/pages','\x20Step2:\x20','2548182HFvRFI','20nVFiYW','页面添加失败:\x20','pages','cwd','132CyigIq','src','406263YLvpHj','catch','\x20*\x20页面创建成功!','message','已选择页面模板\x20','error','1467ZBGvQm','resolve','gray','2pawnzP','772456BzehhU','正在创建页面,请稍候…','56210sDnfqP','3285820Dbxuez'];a1_0x1aa8=function(){return _0x3f2dbd;};return a1_0x1aa8();}export const AddPage=()=>{const _0x49c678=a1_0x4c1838,{exit:_0x139004}=useApp(),[_0x1d351d,_0x16240a]=useState(''),[_0x12066d,_0x60f86a]=useState(''),[_0x5666f3,_0x119df3]=useState(![]),[_0x3e0462,_0x58376b]=useState(![]),_0x100612=a1_0x53408c[_0x49c678(0x9f)](projectDir,_0x49c678(0x8a),_0x49c678(0x87)),_0x5060b6=a1_0x53408c[_0x49c678(0x9f)](_0x100612,_0x12066d),_0x129438=a1_0x53408c['join'](_0x49c678(0x8a),_0x49c678(0x87),_0x12066d);useEffect(()=>{const _0x5e20ee=_0x49c678,_0x41fcce=a1_0x53408c[_0x5e20ee(0x92)](pageTemplateDir,_0x1d351d);if(_0x1d351d&&_0x12066d){_0x119df3(!![]),logger[_0x5e20ee(0x9d)](process['cwd']());const _0x24730c=Date['now']();logger[_0x5e20ee(0xa7)]('add-page','开始添加页面:\x20'+_0x12066d,{'template':_0x1d351d,'targetPath':_0x129438}),TemplateReplacer[_0x5e20ee(0x9e)](_0x41fcce,a1_0x53408c[_0x5e20ee(0x9f)](_0x100612,_0x12066d),_0x12066d,_0x1d351d)[_0x5e20ee(0x9a)](()=>{const _0x384ade=_0x5e20ee,_0x5dd4ae=Date['now']()-_0x24730c;logger['success'](_0x384ade(0xa5),'页面添加成功:\x20'+_0x12066d,_0x5dd4ae,{'template':_0x1d351d,'targetPath':_0x129438,'routePath':_0x12066d}),_0x58376b(!![]);})[_0x5e20ee(0x8c)](_0x46d747=>{const _0xa02fd=_0x5e20ee,_0x537451=Date[_0xa02fd(0xa0)]()-_0x24730c;logger[_0xa02fd(0x90)](_0xa02fd(0xa5),_0xa02fd(0x86)+_0x12066d,{'template':_0x1d351d,'targetPath':_0x129438,'error':_0x46d747 instanceof Error?_0x46d747[_0xa02fd(0x8e)]:String(_0x46d747),'duration':_0x537451});})['finally'](()=>{_0x119df3(![]);});}},[_0x1d351d,_0x12066d]),useEffect(()=>{_0x3e0462&&setTimeout(()=>{_0x139004();});},[_0x3e0462]);if(_0x1d351d)return a1_0x22ccfc(Box,{'flexDirection':_0x49c678(0xa6),'paddingY':0x1,'children':[a1_0x22ccfc(Box,{'children':[a1_0x176331(Text,{'color':'gray','children':_0x49c678(0xa2)}),a1_0x176331(Text,{'children':_0x49c678(0x8f)}),a1_0x176331(Text,{'color':_0x49c678(0xa1),'children':_0x1d351d})]}),_0x12066d?a1_0x22ccfc(Box,{'children':[a1_0x176331(Text,{'color':'gray','children':_0x49c678(0x83)}),a1_0x176331(Text,{'children':_0x49c678(0x99)}),a1_0x176331(Text,{'color':_0x49c678(0xa1),'children':_0x12066d})]}):a1_0x176331(InputProjectCode,{'pagePath':_0x5060b6,'onSubmit':_0x60f86a}),_0x12066d&&_0x5666f3?a1_0x22ccfc(Box,{'marginTop':0x1,'children':[a1_0x176331(Box,{'width':'4'}),a1_0x176331(Text,{'children':_0x49c678(0x96)})]}):null,_0x3e0462?a1_0x22ccfc(a1_0x47ab8c,{'children':[a1_0x176331(Box,{'marginTop':0x1,'children':a1_0x176331(Text,{'color':'gray','children':_0x49c678(0x8d)})}),a1_0x22ccfc(Box,{'children':[a1_0x176331(Text,{'color':_0x49c678(0x93),'children':'\x20*\x20页面路径:\x20'}),a1_0x176331(Text,{'color':'green','children':_0x129438})]}),a1_0x22ccfc(Box,{'children':[a1_0x176331(Text,{'color':'gray','children':_0x49c678(0xa3)}),a1_0x22ccfc(Text,{'color':_0x49c678(0xa1),'children':['/',_0x12066d]})]}),a1_0x176331(Box,{'marginTop':0x1,'children':a1_0x176331(Text,{'color':_0x49c678(0x9b),'children':'\x20*\x20页面文件已创建,可直接通过路由访问'})})]}):null]});return a1_0x176331(SelectPageTemplate,{'onSelect':_0x16240a});};
@@ -1 +1 @@
1
- (function(_0x3df60a,_0x1ad936){const _0x57720a=a2_0x507b,_0x1cf74a=_0x3df60a();while(!![]){try{const _0x4ba715=-parseInt(_0x57720a(0x210))/0x1*(-parseInt(_0x57720a(0x1fe))/0x2)+parseInt(_0x57720a(0x203))/0x3+parseInt(_0x57720a(0x205))/0x4+parseInt(_0x57720a(0x1fc))/0x5*(-parseInt(_0x57720a(0x1f4))/0x6)+parseInt(_0x57720a(0x209))/0x7*(parseInt(_0x57720a(0x211))/0x8)+parseInt(_0x57720a(0x20f))/0x9*(parseInt(_0x57720a(0x1ff))/0xa)+-parseInt(_0x57720a(0x200))/0xb;if(_0x4ba715===_0x1ad936)break;else _0x1cf74a['push'](_0x1cf74a['shift']());}catch(_0x1a203b){_0x1cf74a['push'](_0x1cf74a['shift']());}}}(a2_0x1043,0x55c9b));import{jsx as a2_0x51f47d,jsxs as a2_0x446985}from'react/jsx-runtime';function a2_0x507b(_0x57335a,_0x4a1313){const _0x10434e=a2_0x1043();return a2_0x507b=function(_0x507be4,_0x5839a9){_0x507be4=_0x507be4-0x1f4;let _0x4f5d74=_0x10434e[_0x507be4];return _0x4f5d74;},a2_0x507b(_0x57335a,_0x4a1313);}import{useState,useEffect}from'react';function a2_0x1043(){const _0xd5c76a=['green','onSelect','url','upArrow','请选择您要创建的页面模板','2826vBxpUK','3068IbXXat','1548808VmyCut','length','78NibXEd','\x20\x20\x20\x20\x20\x20\x20\x20','label','gray','name','column','正在加载页面模板...','error','26525fLpCVm','map','16NMNKnt','4530TwYvSt','10827938NEFavE','../..','\x20Step1:\x20','1139583pPCVQg','sdk-fetch','1109040yLiQVj','获取模板列表失败:','blank','dirname','21xXVids'];a2_0x1043=function(){return _0xd5c76a;};return a2_0x1043();}import{Text,Box,useInput}from'ink';import{readdir}from'node:fs/promises';import a2_0x8092af from'node:path';import{fileURLToPath}from'node:url';async function getTemplateList(){const _0x473ef4=a2_0x507b;try{const _0x4efa27=fileURLToPath(import.meta[_0x473ef4(0x20c)]),_0x1489fd=a2_0x8092af['resolve'](a2_0x8092af[_0x473ef4(0x208)](_0x4efa27),_0x473ef4(0x201)),_0xf35ab9=a2_0x8092af['join'](_0x1489fd,'templates/pages'),_0x494ecf=await readdir(_0xf35ab9,{'withFileTypes':!![]}),_0x7bb2c8=_0x494ecf['filter'](_0x10955b=>_0x10955b['isDirectory']())[_0x473ef4(0x1fd)](_0x2b2fb8=>({'label':_0x2b2fb8[_0x473ef4(0x1f8)]}))['sort']((_0x3c25b1,_0x5dcaa4)=>_0x3c25b1[_0x473ef4(0x1f6)]['localeCompare'](_0x5dcaa4[_0x473ef4(0x1f6)]));return _0x7bb2c8;}catch(_0x1af5e9){return console[_0x473ef4(0x1fb)](_0x473ef4(0x206),_0x1af5e9),[{'label':_0x473ef4(0x207)},{'label':_0x473ef4(0x204)}];}}export function SelectPageTemplate(_0x5cbe7f){const _0x5c9987=a2_0x507b,[_0x18940e,_0x199603]=useState(0x0),[_0x5589f2,_0x385884]=useState([]),[_0x5dc461,_0x34b23f]=useState(!![]);useEffect(()=>{async function _0x3dbef6(){const _0x3bca76=await getTemplateList();_0x385884(_0x3bca76),_0x34b23f(![]);}_0x3dbef6();},[]),useInput((_0x1a05e9,_0x5d2723)=>{const _0xcdaea4=a2_0x507b;if(_0x5dc461)return;if(_0x5d2723['return']){const _0x3bb5da=_0x5589f2[_0x18940e];_0x3bb5da&&_0x5cbe7f[_0xcdaea4(0x20b)](_0x3bb5da[_0xcdaea4(0x1f6)]);}_0x5d2723[_0xcdaea4(0x20d)]&&_0x199603(_0x1ae343=>_0x1ae343===0x0?_0x5589f2[_0xcdaea4(0x212)]-0x1:_0x1ae343-0x1),_0x5d2723['downArrow']&&_0x199603(_0x4c4bea=>_0x4c4bea===_0x5589f2[_0xcdaea4(0x212)]-0x1?0x0:_0x4c4bea+0x1);});if(_0x5dc461)return a2_0x51f47d(Box,{'flexDirection':_0x5c9987(0x1f9),'paddingY':0x1,'children':a2_0x446985(Box,{'children':[a2_0x51f47d(Text,{'color':_0x5c9987(0x1f7),'children':_0x5c9987(0x202)}),a2_0x51f47d(Text,{'children':_0x5c9987(0x1fa)})]})});return a2_0x446985(Box,{'flexDirection':_0x5c9987(0x1f9),'paddingY':0x1,'children':[a2_0x446985(Box,{'children':[a2_0x51f47d(Text,{'color':_0x5c9987(0x1f7),'children':_0x5c9987(0x202)}),a2_0x51f47d(Text,{'children':_0x5c9987(0x20e)})]}),_0x5589f2['map']((_0x3b4cde,_0x265d7a)=>{const _0x12f9c1=_0x5c9987,_0x2575ea=_0x265d7a===_0x18940e,_0x190980=_0x2575ea?'\x20\x20\x20\x20\x20\x20>\x20'+_0x3b4cde[_0x12f9c1(0x1f6)]:_0x12f9c1(0x1f5)+_0x3b4cde[_0x12f9c1(0x1f6)];return a2_0x51f47d(Box,{'children':a2_0x51f47d(Text,{'color':_0x2575ea?_0x12f9c1(0x20a):undefined,'children':_0x190980})},_0x190980);})]});}
1
+ (function(_0x58ee23,_0x4bc0c7){const _0x461484=a2_0x4b13,_0x15b592=_0x58ee23();while(!![]){try{const _0x26d155=-parseInt(_0x461484(0x1f5))/0x1*(parseInt(_0x461484(0x1f7))/0x2)+-parseInt(_0x461484(0x1fe))/0x3*(-parseInt(_0x461484(0x1e6))/0x4)+-parseInt(_0x461484(0x204))/0x5*(parseInt(_0x461484(0x1f9))/0x6)+parseInt(_0x461484(0x1e9))/0x7*(-parseInt(_0x461484(0x1e4))/0x8)+-parseInt(_0x461484(0x1f6))/0x9*(parseInt(_0x461484(0x1eb))/0xa)+-parseInt(_0x461484(0x1ec))/0xb*(-parseInt(_0x461484(0x1fd))/0xc)+parseInt(_0x461484(0x1df))/0xd;if(_0x26d155===_0x4bc0c7)break;else _0x15b592['push'](_0x15b592['shift']());}catch(_0x3f3e4b){_0x15b592['push'](_0x15b592['shift']());}}}(a2_0x58a4,0xd27ac));function a2_0x4b13(_0x18af67,_0x2d7640){const _0x58a4bb=a2_0x58a4();return a2_0x4b13=function(_0x4b132b,_0x3b578f){_0x4b132b=_0x4b132b-0x1df;let _0x2798fc=_0x58a4bb[_0x4b132b];return _0x2798fc;},a2_0x4b13(_0x18af67,_0x2d7640);}import{jsx as a2_0x1bcf61,jsxs as a2_0x5e0264}from'react/jsx-runtime';import{useState,useEffect}from'react';import{Text,Box,useInput}from'ink';import{readdir}from'node:fs/promises';import a2_0xaf6c58 from'node:path';function a2_0x58a4(){const _0x15cafc=['join','请选择您要创建的页面模板','sdk-fetch','8772600XkgUjk','url','143028GhuDjA','filter','return','7XFxEOc','正在加载页面模板...','10CErlaA','9740126ceHgJj','gray','获取模板列表失败:','length','upArrow','map','column','\x20Step1:\x20','isDirectory','1544848oSfXsd','10182132XPFndZ','2eUCFob','green','594PvUsuM','\x20\x20\x20\x20\x20\x20>\x20','../..','dirname','12XhPkLb','102WTXoLT','label','downArrow','name','localeCompare','onSelect','47030bUXNxd','45043505ucBiyH','error'];a2_0x58a4=function(){return _0x15cafc;};return a2_0x58a4();}import{fileURLToPath}from'node:url';async function getTemplateList(){const _0x3828df=a2_0x4b13;try{const _0xceaeee=fileURLToPath(import.meta[_0x3828df(0x1e5)]),_0x442149=a2_0xaf6c58['resolve'](a2_0xaf6c58[_0x3828df(0x1fc)](_0xceaeee),_0x3828df(0x1fb)),_0x3ea096=a2_0xaf6c58[_0x3828df(0x1e1)](_0x442149,'templates/pages'),_0x2b5396=await readdir(_0x3ea096,{'withFileTypes':!![]}),_0x5f4707=_0x2b5396[_0x3828df(0x1e7)](_0x14739e=>_0x14739e[_0x3828df(0x1f4)]())[_0x3828df(0x1f1)](_0x199c4c=>({'label':_0x199c4c[_0x3828df(0x201)]}))['sort']((_0x5e8566,_0x5239fa)=>_0x5e8566[_0x3828df(0x1ff)][_0x3828df(0x202)](_0x5239fa[_0x3828df(0x1ff)]));return _0x5f4707;}catch(_0x48b40c){return console[_0x3828df(0x1e0)](_0x3828df(0x1ee),_0x48b40c),[{'label':'blank'},{'label':_0x3828df(0x1e3)}];}}export function SelectPageTemplate(_0x5234e0){const _0x592dfc=a2_0x4b13,[_0x2097e3,_0x14ade2]=useState(0x0),[_0x9f858f,_0x7affba]=useState([]),[_0x290e54,_0x5a6fcd]=useState(!![]);useEffect(()=>{async function _0x4ce2a5(){const _0x1ba7eb=await getTemplateList();_0x7affba(_0x1ba7eb),_0x5a6fcd(![]);}_0x4ce2a5();},[]),useInput((_0x154460,_0x461c69)=>{const _0x42a2b7=a2_0x4b13;if(_0x290e54)return;if(_0x461c69[_0x42a2b7(0x1e8)]){const _0x46aa30=_0x9f858f[_0x2097e3];_0x46aa30&&_0x5234e0[_0x42a2b7(0x203)](_0x46aa30['label']);}_0x461c69[_0x42a2b7(0x1f0)]&&_0x14ade2(_0x3917bd=>_0x3917bd===0x0?_0x9f858f['length']-0x1:_0x3917bd-0x1),_0x461c69[_0x42a2b7(0x200)]&&_0x14ade2(_0x27e6e2=>_0x27e6e2===_0x9f858f[_0x42a2b7(0x1ef)]-0x1?0x0:_0x27e6e2+0x1);});if(_0x290e54)return a2_0x1bcf61(Box,{'flexDirection':_0x592dfc(0x1f2),'paddingY':0x1,'children':a2_0x5e0264(Box,{'children':[a2_0x1bcf61(Text,{'color':_0x592dfc(0x1ed),'children':_0x592dfc(0x1f3)}),a2_0x1bcf61(Text,{'children':_0x592dfc(0x1ea)})]})});return a2_0x5e0264(Box,{'flexDirection':'column','paddingY':0x1,'children':[a2_0x5e0264(Box,{'children':[a2_0x1bcf61(Text,{'color':_0x592dfc(0x1ed),'children':_0x592dfc(0x1f3)}),a2_0x1bcf61(Text,{'children':_0x592dfc(0x1e2)})]}),_0x9f858f[_0x592dfc(0x1f1)]((_0x17cbe6,_0x32eef4)=>{const _0x5d896d=_0x592dfc,_0x238901=_0x32eef4===_0x2097e3,_0x3b04f8=_0x238901?_0x5d896d(0x1fa)+_0x17cbe6[_0x5d896d(0x1ff)]:'\x20\x20\x20\x20\x20\x20\x20\x20'+_0x17cbe6[_0x5d896d(0x1ff)];return a2_0x1bcf61(Box,{'children':a2_0x1bcf61(Text,{'color':_0x238901?_0x5d896d(0x1f8):undefined,'children':_0x3b04f8})},_0x3b04f8);})]});}
@@ -1 +1 @@
1
- (function(_0x59102f,_0x31db37){const _0x18c009=a3_0x4bba,_0x100d13=_0x59102f();while(!![]){try{const _0xa1aa94=-parseInt(_0x18c009(0x1fc))/0x1+-parseInt(_0x18c009(0x1f6))/0x2*(-parseInt(_0x18c009(0x213))/0x3)+-parseInt(_0x18c009(0x221))/0x4*(parseInt(_0x18c009(0x21e))/0x5)+-parseInt(_0x18c009(0x201))/0x6*(parseInt(_0x18c009(0x226))/0x7)+parseInt(_0x18c009(0x20d))/0x8*(parseInt(_0x18c009(0x20e))/0x9)+-parseInt(_0x18c009(0x21f))/0xa+-parseInt(_0x18c009(0x203))/0xb*(-parseInt(_0x18c009(0x1f5))/0xc);if(_0xa1aa94===_0x31db37)break;else _0x100d13['push'](_0x100d13['shift']());}catch(_0x52992b){_0x100d13['push'](_0x100d13['shift']());}}}(a3_0x4244,0x6f9bb));import{jsx as a3_0x12dad6,jsxs as a3_0x359254,Fragment as a3_0x2832f9}from'react/jsx-runtime';function a3_0x4bba(_0x130e27,_0x1656e5){const _0x424422=a3_0x4244();return a3_0x4bba=function(_0x4bba06,_0x122127){_0x4bba06=_0x4bba06-0x1ed;let _0xd8ca8c=_0x424422[_0x4bba06];return _0xd8ca8c;},a3_0x4bba(_0x130e27,_0x1656e5);}import{useEffect,useState}from'react';import{Box,Text,useApp}from'ink';function a3_0x4244(){const _0x2cbc9b=['error','log','√\x20文档生成完成!成功\x20','指定的数据集代码都不存在:\x20','正在获取数据集列表...','未找到任何数据集','1528tFVMGo','38457wtFKvl','*\x20输出目录:\x20','dim','*\x20共处理\x20','💡\x20请使用\x20','574890qIJLtA','🚀\x20','cwd','未提供应用AppCode,且配置中也没有默认值','cyan','\x20个数据集','lovrabet\x20auth','\x20个匹配的数据集\x1b[0m','api-doc','string','length','216640FTruJQ','5324010dlqXQd','env','76nDGfuy','yellow','\x1b[33m!\x20以下数据集代码不存在:\x20','使用配置的应用AppCode:\x20','filter','798637VcPQRj','文档生成完成','includes','\x1b[0m','datasetCode','success','\x20个数据集中筛选出\x20','使用指定的应用AppCode:\x20','⚠️\x20以下数据集生成失败:','map','datasetName','15033048hKFoJw','2xFlFDN','column','filePath','\x1b[90m*\x20从\x20','gray','white','333656BSsrAc','online','.md\x20(','red',',\x20失败\x20','6fIwGvm','文档生成失败:\x20','11mEbDBq','message','正在生成\x20','./docs'];a3_0x4244=function(){return _0x2cbc9b;};return a3_0x4244();}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';export const ApiDocUI=({appCode:_0x17d4b1,env:_0x135e6c,output:_0x19a11b,extraParams:_0x58a504,datasetCodes:_0x27fb48})=>{const _0x328c35=a3_0x4bba,{exit:_0x3e2672}=useApp(),[_0x2a7906,_0x375fa7]=useState(![]),[_0x4ebe2e,_0x5a1b3b]=useState(''),[_0x1370b5,_0x3458d0]=useState(![]),[_0x24093a,_0x5a606c]=useState(null),[_0x1f30e7,_0x4fb770]=useState(null),[_0x2c1af0,_0x1d488a]=useState(0x0),_0x150705=readConfig(),_0x2e387b=getConfigAppCode(),_0x2a582b=_0x17d4b1||_0x2e387b,_0x3fe4aa=typeof _0x150705?.[_0x328c35(0x220)]===_0x328c35(0x21c)?_0x150705[_0x328c35(0x220)]:undefined,_0x5b0a23=_0x135e6c||_0x3fe4aa||_0x328c35(0x1fd);initEnv(_0x5b0a23);const _0x47cff6=_0x19a11b||_0x328c35(0x206),_0x7a361d=_0x17d4b1?_0x328c35(0x1f1)+_0x2a582b:_0x328c35(0x224)+_0x2a582b;useEffect(()=>{_0x375fa7(!![]),_0x1c186c();},[]),useEffect(()=>{(_0x1370b5||_0x24093a)&&_0x3e2672();},[_0x1370b5,_0x24093a,_0x3e2672]);async function _0x1c186c(){const _0x471993=_0x328c35;if(!_0x2a582b){_0x5a606c(_0x471993(0x216));return;}try{logger['setLogPath'](process[_0x471993(0x215)]()),_0x5a1b3b(_0x471993(0x20b));const {configArray:_0x4afc71}=await fetchModelList(_0x2a582b);_0x1d488a(_0x4afc71[_0x471993(0x21d)]);if(_0x4afc71[_0x471993(0x21d)]===0x0){_0x5a606c(_0x471993(0x20c));return;}let _0x278304=_0x4afc71;if(_0x27fb48&&_0x27fb48[_0x471993(0x21d)]>0x0){_0x278304=_0x4afc71[_0x471993(0x225)](_0x3bac6d=>_0x27fb48[_0x471993(0x228)](_0x3bac6d[_0x471993(0x1ee)]));const _0x5150f1=_0x278304[_0x471993(0x1f3)](_0x56bc6e=>_0x56bc6e[_0x471993(0x1ee)]),_0x3dff2e=_0x27fb48['filter'](_0x42bdfd=>!_0x5150f1[_0x471993(0x228)](_0x42bdfd));_0x3dff2e['length']>0x0&&console[_0x471993(0x208)](_0x471993(0x223)+_0x3dff2e['join'](',\x20')+_0x471993(0x1ed));if(_0x278304['length']===0x0){_0x5a606c(_0x471993(0x20a)+_0x27fb48['join'](',\x20'));return;}console[_0x471993(0x208)](_0x471993(0x1f9)+_0x4afc71['length']+_0x471993(0x1f0)+_0x278304['length']+_0x471993(0x21a));}_0x5a1b3b(_0x471993(0x205)+_0x278304['length']+'\x20个数据集的文档...');const _0xa57d69=await generateDatasetDocs(_0x278304,_0x2a582b,_0x47cff6,(_0x4ac7a0,_0x8064c3,_0x4cb3f8)=>{const _0x42887a=_0x471993;_0x5a1b3b(_0x42887a(0x205)+_0x4cb3f8+_0x42887a(0x1fe)+_0x4ac7a0+'/'+_0x8064c3+')');},_0x58a504);_0x4fb770(_0xa57d69),_0x3458d0(!![]);const _0x630b3=_0xa57d69[_0x471993(0x225)](_0x226e0c=>_0x226e0c[_0x471993(0x1ef)])[_0x471993(0x21d)],_0x2bc17f=_0xa57d69[_0x471993(0x225)](_0x554d71=>!_0x554d71[_0x471993(0x1ef)])['length'];logger[_0x471993(0x1ef)](_0x471993(0x21b),_0x471993(0x227),undefined,{'totalCount':_0xa57d69['length'],'successCount':_0x630b3,'failCount':_0x2bc17f,'outputDir':_0x47cff6});}catch(_0x591870){const _0x3e8787=_0x591870 instanceof Error?_0x591870[_0x471993(0x204)]:String(_0x591870);logger['error'](_0x471993(0x21b),'文档生成失败:\x20'+_0x3e8787,{'appCode':_0x2a582b,'outputDir':_0x47cff6}),_0x5a606c(_0x471993(0x202)+_0x3e8787);}finally{_0x375fa7(![]);}}const _0x502ae7=_0x1f30e7?.['filter'](_0x5522ef=>_0x5522ef[_0x328c35(0x1ef)])[_0x328c35(0x21d)]||0x0,_0x1e1fac=_0x1f30e7?.[_0x328c35(0x225)](_0x178817=>!_0x178817[_0x328c35(0x1ef)])[_0x328c35(0x21d)]||0x0;return a3_0x359254(Box,{'flexDirection':_0x328c35(0x1f7),'children':[(_0x2a7906||_0x1370b5)&&a3_0x359254(Box,{'children':[a3_0x12dad6(Text,{'color':_0x328c35(0x1fa),'children':'*\x20'}),a3_0x12dad6(Text,{'color':_0x17d4b1?_0x328c35(0x1fb):'dim','children':_0x7a361d})]}),_0x2a7906&&a3_0x12dad6(Box,{'children':a3_0x359254(Text,{'children':[_0x328c35(0x214),_0x4ebe2e,'\x20(环境:\x20',_0x5b0a23,')']})}),_0x1370b5&&_0x1f30e7&&a3_0x359254(Box,{'flexDirection':_0x328c35(0x1f7),'children':[a3_0x12dad6(Box,{'children':a3_0x359254(Text,{'color':'green','children':[_0x328c35(0x209),_0x502ae7,'\x20个',_0x1e1fac>0x0&&_0x328c35(0x200)+_0x1e1fac+'\x20个']})}),a3_0x12dad6(Box,{'marginTop':0x1,'children':a3_0x359254(Text,{'color':'gray','children':[_0x328c35(0x211),_0x2c1af0,_0x328c35(0x218)]})}),a3_0x359254(Box,{'marginTop':0x1,'children':[a3_0x12dad6(Text,{'color':_0x328c35(0x1fa),'children':_0x328c35(0x20f)}),a3_0x12dad6(Text,{'color':_0x328c35(0x217),'children':_0x47cff6})]}),_0x502ae7>0x0&&a3_0x359254(a3_0x2832f9,{'children':[a3_0x12dad6(Box,{'marginTop':0x1,'children':a3_0x12dad6(Text,{'color':_0x328c35(0x1fa),'children':'*\x20生成的文档文件:'})}),_0x1f30e7['filter'](_0x6eb10a=>_0x6eb10a[_0x328c35(0x1ef)])['map']((_0x4e92dd,_0x33e8cc)=>a3_0x359254(Box,{'marginLeft':0x2,'children':[a3_0x359254(Text,{'color':_0x328c35(0x217),'children':['•\x20',_0x4e92dd[_0x328c35(0x1f8)]]}),a3_0x359254(Text,{'color':'dim','children':['\x20-\x20',_0x4e92dd[_0x328c35(0x1f4)]]})]},_0x33e8cc))]}),_0x1e1fac>0x0&&a3_0x359254(a3_0x2832f9,{'children':[a3_0x12dad6(Box,{'marginTop':0x1,'children':a3_0x12dad6(Text,{'color':'yellow','children':_0x328c35(0x1f2)})}),_0x1f30e7[_0x328c35(0x225)](_0x511909=>!_0x511909[_0x328c35(0x1ef)])[_0x328c35(0x1f3)]((_0x586bb3,_0x2a9b8f)=>a3_0x359254(Box,{'marginLeft':0x2,'flexDirection':'column','children':[a3_0x359254(Text,{'color':'red','children':['•\x20',_0x586bb3['datasetName'],'\x20(',_0x586bb3[_0x328c35(0x1ee)],')']}),_0x586bb3[_0x328c35(0x207)]&&a3_0x12dad6(Box,{'marginLeft':0x2,'children':a3_0x12dad6(Text,{'color':_0x328c35(0x210),'children':_0x586bb3[_0x328c35(0x207)]})})]},_0x2a9b8f))]})]}),_0x24093a&&a3_0x359254(Box,{'flexDirection':_0x328c35(0x1f7),'children':[a3_0x12dad6(Box,{'children':a3_0x359254(Text,{'color':_0x328c35(0x1ff),'children':['❌\x20',_0x24093a]})}),_0x24093a[_0x328c35(0x228)]('登录')&&a3_0x359254(Box,{'marginTop':0x1,'children':[a3_0x12dad6(Text,{'color':_0x328c35(0x222),'children':_0x328c35(0x212)}),a3_0x12dad6(Text,{'color':_0x328c35(0x217),'children':_0x328c35(0x219)}),a3_0x12dad6(Text,{'color':_0x328c35(0x222),'children':'\x20重新登录后再试'})]})]})]});};
1
+ (function(_0x231e9a,_0x193ac8){const _0x147844=a3_0x1c7f,_0x4dcd8f=_0x231e9a();while(!![]){try{const _0x2b1fc4=parseInt(_0x147844(0x96))/0x1*(parseInt(_0x147844(0xb0))/0x2)+-parseInt(_0x147844(0x85))/0x3+parseInt(_0x147844(0x86))/0x4*(-parseInt(_0x147844(0x88))/0x5)+parseInt(_0x147844(0x9c))/0x6*(parseInt(_0x147844(0x93))/0x7)+parseInt(_0x147844(0xae))/0x8*(-parseInt(_0x147844(0x95))/0x9)+-parseInt(_0x147844(0x9f))/0xa+parseInt(_0x147844(0x98))/0xb*(parseInt(_0x147844(0xb7))/0xc);if(_0x2b1fc4===_0x193ac8)break;else _0x4dcd8f['push'](_0x4dcd8f['shift']());}catch(_0x1410a0){_0x4dcd8f['push'](_0x4dcd8f['shift']());}}}(a3_0x29e3,0x36677));import{jsx as a3_0x324ebd,jsxs as a3_0xc1fd1c,Fragment as a3_0x397c26}from'react/jsx-runtime';import{useEffect,useState}from'react';function a3_0x29e3(){const _0x2e5ac0=['6duuShg','文档生成完成','dim','4140170YJTSRw','\x20重新登录后再试','log','⚠️\x20以下数据集生成失败:',',\x20失败\x20','yellow','datasetCode','cwd','√\x20文档生成完成!成功\x20','\x20个数据集中筛选出\x20','error','使用配置的应用AppCode:\x20','lovrabet\x20auth','map','setLogPath','72ruKBgb','使用指定的应用AppCode:\x20','10ObCuXT','文档生成失败:\x20','\x20个匹配的数据集\x1b[0m','join','length','red','success','14027604rHWbFH','env','正在获取数据集列表...','online','*\x20输出目录:\x20','\x20个数据集的文档...','指定的数据集代码都不存在:\x20','927606jVJTdH','1101196wmxkBT','正在生成\x20','5FPExaT','gray','datasetName','\x20(环境:\x20','./docs','filePath','filter','cyan','\x1b[0m','api-doc','\x1b[90m*\x20从\x20','1258999KbbIEF','未找到任何数据集','183177hRWlIA','11142zzlVZp','column','11PcmeOj','includes','string','green'];a3_0x29e3=function(){return _0x2e5ac0;};return a3_0x29e3();}function a3_0x1c7f(_0xaf325f,_0x346c1e){const _0x29e3ae=a3_0x29e3();return a3_0x1c7f=function(_0x1c7f26,_0x1d7a3c){_0x1c7f26=_0x1c7f26-0x84;let _0x33dbf0=_0x29e3ae[_0x1c7f26];return _0x33dbf0;},a3_0x1c7f(_0xaf325f,_0x346c1e);}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';export const ApiDocUI=({appCode:_0x2f4721,env:_0x153818,output:_0x22a824,extraParams:_0x105758,datasetCodes:_0x552f0e})=>{const _0x10836f=a3_0x1c7f,{exit:_0x4e8154}=useApp(),[_0x689958,_0x264f74]=useState(![]),[_0x27d0b8,_0x310ba8]=useState(''),[_0xed2699,_0x33bcbd]=useState(![]),[_0x15bc1e,_0x132a35]=useState(null),[_0x3ace86,_0x21369d]=useState(null),[_0x4d667c,_0x1c94db]=useState(0x0),_0x413cb0=readConfig(),_0x199a2c=getConfigAppCode(),_0x5031c8=_0x2f4721||_0x199a2c,_0x3843e7=typeof _0x413cb0?.[_0x10836f(0xb8)]===_0x10836f(0x9a)?_0x413cb0[_0x10836f(0xb8)]:undefined,_0x491ed2=_0x153818||_0x3843e7||_0x10836f(0xba);initEnv(_0x491ed2);const _0x45519c=_0x22a824||_0x10836f(0x8c),_0x4c8be9=_0x2f4721?_0x10836f(0xaf)+_0x5031c8:_0x10836f(0xaa)+_0x5031c8;useEffect(()=>{_0x264f74(!![]),_0x3a8f1f();},[]),useEffect(()=>{(_0xed2699||_0x15bc1e)&&_0x4e8154();},[_0xed2699,_0x15bc1e,_0x4e8154]);async function _0x3a8f1f(){const _0x379e14=_0x10836f;if(!_0x5031c8){_0x132a35('未提供应用AppCode,且配置中也没有默认值');return;}try{logger[_0x379e14(0xad)](process[_0x379e14(0xa6)]()),_0x310ba8(_0x379e14(0xb9));const {configArray:_0x4023ae}=await fetchModelList(_0x5031c8);_0x1c94db(_0x4023ae[_0x379e14(0xb4)]);if(_0x4023ae[_0x379e14(0xb4)]===0x0){_0x132a35(_0x379e14(0x94));return;}let _0x27b2da=_0x4023ae;if(_0x552f0e&&_0x552f0e[_0x379e14(0xb4)]>0x0){_0x27b2da=_0x4023ae['filter'](_0x5e6af9=>_0x552f0e[_0x379e14(0x99)](_0x5e6af9[_0x379e14(0xa5)]));const _0x41800a=_0x27b2da[_0x379e14(0xac)](_0x41d92d=>_0x41d92d['datasetCode']),_0x12dec5=_0x552f0e[_0x379e14(0x8e)](_0x4ccd0c=>!_0x41800a['includes'](_0x4ccd0c));_0x12dec5['length']>0x0&&console[_0x379e14(0xa1)]('\x1b[33m!\x20以下数据集代码不存在:\x20'+_0x12dec5[_0x379e14(0xb3)](',\x20')+_0x379e14(0x90));if(_0x27b2da[_0x379e14(0xb4)]===0x0){_0x132a35(_0x379e14(0x84)+_0x552f0e[_0x379e14(0xb3)](',\x20'));return;}console[_0x379e14(0xa1)](_0x379e14(0x92)+_0x4023ae['length']+_0x379e14(0xa8)+_0x27b2da['length']+_0x379e14(0xb2));}_0x310ba8(_0x379e14(0x87)+_0x27b2da[_0x379e14(0xb4)]+_0x379e14(0xbc));const _0x5a624a=await generateDatasetDocs(_0x27b2da,_0x5031c8,_0x45519c,(_0x46365e,_0x463c8a,_0x368a89)=>{const _0x4ccaee=_0x379e14;_0x310ba8(_0x4ccaee(0x87)+_0x368a89+'.md\x20('+_0x46365e+'/'+_0x463c8a+')');},_0x105758);_0x21369d(_0x5a624a),_0x33bcbd(!![]);const _0x3765d2=_0x5a624a['filter'](_0x112214=>_0x112214[_0x379e14(0xb6)])[_0x379e14(0xb4)],_0x2e4463=_0x5a624a[_0x379e14(0x8e)](_0x27c14c=>!_0x27c14c[_0x379e14(0xb6)])[_0x379e14(0xb4)];logger[_0x379e14(0xb6)](_0x379e14(0x91),_0x379e14(0x9d),undefined,{'totalCount':_0x5a624a[_0x379e14(0xb4)],'successCount':_0x3765d2,'failCount':_0x2e4463,'outputDir':_0x45519c});}catch(_0x2d5c5a){const _0x87058f=_0x2d5c5a instanceof Error?_0x2d5c5a['message']:String(_0x2d5c5a);logger['error'](_0x379e14(0x91),_0x379e14(0xb1)+_0x87058f,{'appCode':_0x5031c8,'outputDir':_0x45519c}),_0x132a35(_0x379e14(0xb1)+_0x87058f);}finally{_0x264f74(![]);}}const _0xd7a859=_0x3ace86?.['filter'](_0x3afb3e=>_0x3afb3e[_0x10836f(0xb6)])[_0x10836f(0xb4)]||0x0,_0x4c1ee2=_0x3ace86?.[_0x10836f(0x8e)](_0x432e46=>!_0x432e46[_0x10836f(0xb6)])[_0x10836f(0xb4)]||0x0;return a3_0xc1fd1c(Box,{'flexDirection':_0x10836f(0x97),'children':[(_0x689958||_0xed2699)&&a3_0xc1fd1c(Box,{'children':[a3_0x324ebd(Text,{'color':_0x10836f(0x89),'children':'*\x20'}),a3_0x324ebd(Text,{'color':_0x2f4721?'white':_0x10836f(0x9e),'children':_0x4c8be9})]}),_0x689958&&a3_0x324ebd(Box,{'children':a3_0xc1fd1c(Text,{'children':['🚀\x20',_0x27d0b8,_0x10836f(0x8b),_0x491ed2,')']})}),_0xed2699&&_0x3ace86&&a3_0xc1fd1c(Box,{'flexDirection':_0x10836f(0x97),'children':[a3_0x324ebd(Box,{'children':a3_0xc1fd1c(Text,{'color':_0x10836f(0x9b),'children':[_0x10836f(0xa7),_0xd7a859,'\x20个',_0x4c1ee2>0x0&&_0x10836f(0xa3)+_0x4c1ee2+'\x20个']})}),a3_0x324ebd(Box,{'marginTop':0x1,'children':a3_0xc1fd1c(Text,{'color':_0x10836f(0x89),'children':['*\x20共处理\x20',_0x4d667c,'\x20个数据集']})}),a3_0xc1fd1c(Box,{'marginTop':0x1,'children':[a3_0x324ebd(Text,{'color':_0x10836f(0x89),'children':_0x10836f(0xbb)}),a3_0x324ebd(Text,{'color':_0x10836f(0x8f),'children':_0x45519c})]}),_0xd7a859>0x0&&a3_0xc1fd1c(a3_0x397c26,{'children':[a3_0x324ebd(Box,{'marginTop':0x1,'children':a3_0x324ebd(Text,{'color':_0x10836f(0x89),'children':'*\x20生成的文档文件:'})}),_0x3ace86[_0x10836f(0x8e)](_0x252df6=>_0x252df6[_0x10836f(0xb6)])[_0x10836f(0xac)]((_0x533fbb,_0x1ea0c0)=>a3_0xc1fd1c(Box,{'marginLeft':0x2,'children':[a3_0xc1fd1c(Text,{'color':_0x10836f(0x8f),'children':['•\x20',_0x533fbb[_0x10836f(0x8d)]]}),a3_0xc1fd1c(Text,{'color':_0x10836f(0x9e),'children':['\x20-\x20',_0x533fbb[_0x10836f(0x8a)]]})]},_0x1ea0c0))]}),_0x4c1ee2>0x0&&a3_0xc1fd1c(a3_0x397c26,{'children':[a3_0x324ebd(Box,{'marginTop':0x1,'children':a3_0x324ebd(Text,{'color':'yellow','children':_0x10836f(0xa2)})}),_0x3ace86['filter'](_0x2dd40e=>!_0x2dd40e[_0x10836f(0xb6)])[_0x10836f(0xac)]((_0x2be028,_0x3d5e89)=>a3_0xc1fd1c(Box,{'marginLeft':0x2,'flexDirection':'column','children':[a3_0xc1fd1c(Text,{'color':_0x10836f(0xb5),'children':['•\x20',_0x2be028['datasetName'],'\x20(',_0x2be028[_0x10836f(0xa5)],')']}),_0x2be028[_0x10836f(0xa9)]&&a3_0x324ebd(Box,{'marginLeft':0x2,'children':a3_0x324ebd(Text,{'color':_0x10836f(0x9e),'children':_0x2be028['error']})})]},_0x3d5e89))]})]}),_0x15bc1e&&a3_0xc1fd1c(Box,{'flexDirection':_0x10836f(0x97),'children':[a3_0x324ebd(Box,{'children':a3_0xc1fd1c(Text,{'color':_0x10836f(0xb5),'children':['❌\x20',_0x15bc1e]})}),_0x15bc1e['includes']('登录')&&a3_0xc1fd1c(Box,{'marginTop':0x1,'children':[a3_0x324ebd(Text,{'color':_0x10836f(0xa4),'children':'💡\x20请使用\x20'}),a3_0x324ebd(Text,{'color':'cyan','children':_0x10836f(0xab)}),a3_0x324ebd(Text,{'color':_0x10836f(0xa4),'children':_0x10836f(0xa0)})]})]})]});};
@@ -1 +1 @@
1
- function a4_0x597f(){const _0x391618=['POST','push','3612368ofVNuX','16bTOCMj','80djVqEn','status','登录鉴权失败,登录已过期,请使用\x20lovrabet\x20auth\x20重新登录','length','join','28047lEDyWR','utf8','./docs',']\x20正在生成:\x20','/api/node-toolbox/api-doc-generator','name','.md\x20(','application/json','datasetCode','api-doc','✗\x20失败:\x20','响应数据格式错误\x20(','stringify','markdown','等待\x203\x20秒...\x0a','生成文档成功:\x20','data','1133840MsIXjW','tableName','2238702jaGnbf','✓\x20成功生成:\x20','766613AgOWYz','.md\x20-\x20','1064448DPEXBS','.md','2502311bLJTYM','log'];a4_0x597f=function(){return _0x391618;};return a4_0x597f();}const a4_0x56d32d=a4_0x2fbe;(function(_0x188c6a,_0x3cb0e5){const _0x124dae=a4_0x2fbe,_0x2fa7b5=_0x188c6a();while(!![]){try{const _0x581a2e=-parseInt(_0x124dae(0xbf))/0x1+-parseInt(_0x124dae(0xc9))/0x2*(-parseInt(_0x124dae(0xce))/0x3)+parseInt(_0x124dae(0xc7))/0x4+parseInt(_0x124dae(0xbb))/0x5+parseInt(_0x124dae(0xbd))/0x6+parseInt(_0x124dae(0xc3))/0x7*(-parseInt(_0x124dae(0xc8))/0x8)+parseInt(_0x124dae(0xc1))/0x9;if(_0x581a2e===_0x3cb0e5)break;else _0x2fa7b5['push'](_0x2fa7b5['shift']());}catch(_0x12bef4){_0x2fa7b5['push'](_0x2fa7b5['shift']());}}}(a4_0x597f,0x7d672));function a4_0x2fbe(_0x20fdc5,_0x5bc9c0){const _0x597f0f=a4_0x597f();return a4_0x2fbe=function(_0x2fbed9,_0x2916aa){_0x2fbed9=_0x2fbed9-0xac;let _0x3dfd2a=_0x597f0f[_0x2fbed9];return _0x3dfd2a;},a4_0x2fbe(_0x20fdc5,_0x5bc9c0);}import{mkdirSync,writeFileSync}from'node:fs';import a4_0x267225 from'node:path';import{getCookie}from'../auth/get-cookie.js';import{getApiDomain}from'../constant/domain.js';import{logger}from'../utils/logger.js';export async function fetchDatasetDoc(_0xc38718){const _0x18cdec=a4_0x2fbe,{appCode:_0x17116f,datasetCode:_0x5402ea,datasetId:_0x205f6f,extraParams:_0x10e600}=_0xc38718,_0x73fdf3=getApiDomain(),_0x13aa5a=_0x73fdf3+_0x18cdec(0xae),_0xef8eb5={'appCode':_0x17116f,'datasetCode':_0x5402ea,'datasetId':_0x205f6f,..._0x10e600||{}},_0x13c738=await fetch(_0x13aa5a,{'method':_0x18cdec(0xc5),'headers':{'Content-Type':_0x18cdec(0xb1),'Cookie':getCookie()},'body':JSON[_0x18cdec(0xb6)](_0xef8eb5)});if(!_0x13c738['ok']){if(_0x13c738[_0x18cdec(0xca)]===0x191)throw new Error(_0x18cdec(0xcb));let _0x57cd4d='';try{_0x57cd4d=await _0x13c738['text']();}catch(_0x1d9708){}throw new Error('获取文档失败\x20('+_0x5402ea+'),HTTP状态码:\x20'+_0x13c738[_0x18cdec(0xca)]+(_0x57cd4d?'\x0a'+_0x57cd4d:''));}const _0xdb3c8b=await _0x13c738['json']();if(!_0xdb3c8b[_0x18cdec(0xba)]||typeof _0xdb3c8b[_0x18cdec(0xba)][_0x18cdec(0xb7)]!=='string')throw new Error(_0x18cdec(0xb5)+_0x5402ea+'):缺少\x20data.markdown\x20字段');return _0xdb3c8b[_0x18cdec(0xba)][_0x18cdec(0xb7)];}function delay(_0x3ed2c7){return new Promise(_0x30d922=>setTimeout(_0x30d922,_0x3ed2c7));}export async function generateDatasetDocs(_0x3793c5,_0x52a199,_0x5a52a7=a4_0x56d32d(0xac),_0x4fe798,_0x1e143f){const _0x7945c4=a4_0x56d32d;mkdirSync(_0x5a52a7,{'recursive':!![]});const _0x5f40f5=[],_0x2b33e5=_0x3793c5[_0x7945c4(0xcc)];console[_0x7945c4(0xc4)]('\x0a共有\x20'+_0x2b33e5+'\x20个数据集需要生成文档\x0a');for(let _0x201d39=0x0;_0x201d39<_0x3793c5[_0x7945c4(0xcc)];_0x201d39++){const _0x399a78=_0x3793c5[_0x201d39],_0x4dc119=_0x201d39+0x1,_0x43107b=_0x399a78[_0x7945c4(0xbc)];try{console[_0x7945c4(0xc4)]('['+_0x4dc119+'/'+_0x2b33e5+_0x7945c4(0xad)+_0x43107b+_0x7945c4(0xb0)+_0x399a78[_0x7945c4(0xaf)]+')');_0x4fe798&&_0x4fe798(_0x4dc119,_0x2b33e5,_0x43107b);const _0x58fc4a=await fetchDatasetDoc({'appCode':_0x52a199,'datasetCode':_0x399a78[_0x7945c4(0xb2)],'datasetId':_0x399a78['id'],'enableAI':![],'extraParams':_0x1e143f}),_0x11f88d=a4_0x267225[_0x7945c4(0xcd)](_0x5a52a7,_0x43107b+'.md');writeFileSync(_0x11f88d,_0x58fc4a,{'encoding':_0x7945c4(0xcf)}),console[_0x7945c4(0xc4)](_0x7945c4(0xbe)+_0x43107b+_0x7945c4(0xc2)),logger['success'](_0x7945c4(0xb3),_0x7945c4(0xb9)+_0x43107b,undefined,{'datasetCode':_0x399a78[_0x7945c4(0xb2)],'datasetName':_0x399a78[_0x7945c4(0xaf)],'filePath':_0x11f88d,'progress':_0x4dc119+'/'+_0x2b33e5}),_0x5f40f5[_0x7945c4(0xc6)]({'datasetCode':_0x399a78[_0x7945c4(0xb2)],'datasetName':_0x399a78[_0x7945c4(0xaf)],'filePath':_0x11f88d,'success':!![]}),_0x4dc119<_0x2b33e5&&await delay(0x1388);}catch(_0x17a6c4){const _0x3b970a=_0x17a6c4 instanceof Error?_0x17a6c4['message']:String(_0x17a6c4);console[_0x7945c4(0xc4)](_0x7945c4(0xb4)+_0x43107b+_0x7945c4(0xc0)+_0x3b970a+'\x0a'),logger['error'](_0x7945c4(0xb3),'生成文档失败:\x20'+_0x399a78[_0x7945c4(0xb2)],{'datasetCode':_0x399a78[_0x7945c4(0xb2)],'datasetName':_0x399a78[_0x7945c4(0xaf)],'error':_0x3b970a,'progress':_0x4dc119+'/'+_0x2b33e5}),_0x5f40f5[_0x7945c4(0xc6)]({'datasetCode':_0x399a78[_0x7945c4(0xb2)],'datasetName':_0x399a78[_0x7945c4(0xaf)],'filePath':'','success':![],'error':_0x3b970a}),_0x4dc119<_0x2b33e5&&(console[_0x7945c4(0xc4)](_0x7945c4(0xb8)),await delay(0xbb8));}}return _0x5f40f5;}
1
+ const a4_0x6df1ab=a4_0x2b63;(function(_0x9d74c3,_0xf923ad){const _0x314baa=a4_0x2b63,_0x65eb36=_0x9d74c3();while(!![]){try{const _0x52e718=parseInt(_0x314baa(0x72))/0x1*(parseInt(_0x314baa(0x93))/0x2)+parseInt(_0x314baa(0x6f))/0x3*(-parseInt(_0x314baa(0x87))/0x4)+-parseInt(_0x314baa(0x7e))/0x5+-parseInt(_0x314baa(0x8f))/0x6*(parseInt(_0x314baa(0x92))/0x7)+parseInt(_0x314baa(0x8b))/0x8*(-parseInt(_0x314baa(0x85))/0x9)+-parseInt(_0x314baa(0x76))/0xa+parseInt(_0x314baa(0x70))/0xb;if(_0x52e718===_0xf923ad)break;else _0x65eb36['push'](_0x65eb36['shift']());}catch(_0x24536d){_0x65eb36['push'](_0x65eb36['shift']());}}}(a4_0x413a,0x49191));import{mkdirSync,writeFileSync}from'node:fs';import a4_0x5d744b from'node:path';import{getCookie}from'../auth/get-cookie.js';import{getApiDomain}from'../constant/domain.js';function a4_0x2b63(_0x1f3ebf,_0x1de8f2){const _0x413ae5=a4_0x413a();return a4_0x2b63=function(_0x2b634e,_0x457a15){_0x2b634e=_0x2b634e-0x6d;let _0x36c174=_0x413ae5[_0x2b634e];return _0x36c174;},a4_0x2b63(_0x1f3ebf,_0x1de8f2);}function a4_0x413a(){const _0x455a56=['✗\x20失败:\x20','18kAVrhx','获取文档失败\x20(','4HvydQA','),HTTP状态码:\x20','name','join','18632DxGByZ',']\x20正在生成:\x20','./docs','push','3774RHQadi','application/json','status','5593VsiwcC','674132fsgMSP','api-doc','datasetCode','json','POST','✓\x20成功生成:\x20','markdown','1586187TDxZEe','20529476rujvHy','data','1oFmtHz','error','登录鉴权失败,登录已过期,请使用\x20lovrabet\x20auth\x20重新登录','log','5168000NErpOt','string','生成文档成功:\x20','等待\x203\x20秒...\x0a','响应数据格式错误\x20(','\x20个数据集需要生成文档\x0a','tableName','/api/node-toolbox/api-doc-generator','1756075xsADYs','.md','length','utf8','stringify','生成文档失败:\x20'];a4_0x413a=function(){return _0x455a56;};return a4_0x413a();}import{logger}from'../utils/logger.js';export async function fetchDatasetDoc(_0x4e432d){const _0x3c3820=a4_0x2b63,{appCode:_0x3aca3e,datasetCode:_0x4a1dc7,datasetId:_0x580a67,extraParams:_0x31603a}=_0x4e432d,_0x411388=getApiDomain(),_0x5c3b53=_0x411388+_0x3c3820(0x7d),_0x41bd63={'appCode':_0x3aca3e,'datasetCode':_0x4a1dc7,'datasetId':_0x580a67,..._0x31603a||{}},_0xe0afc2=await fetch(_0x5c3b53,{'method':_0x3c3820(0x97),'headers':{'Content-Type':_0x3c3820(0x90),'Cookie':getCookie()},'body':JSON[_0x3c3820(0x82)](_0x41bd63)});if(!_0xe0afc2['ok']){if(_0xe0afc2[_0x3c3820(0x91)]===0x191)throw new Error(_0x3c3820(0x74));let _0x3ebf21='';try{_0x3ebf21=await _0xe0afc2['text']();}catch(_0x5ee753){}throw new Error(_0x3c3820(0x86)+_0x4a1dc7+_0x3c3820(0x88)+_0xe0afc2['status']+(_0x3ebf21?'\x0a'+_0x3ebf21:''));}const _0x539eb2=await _0xe0afc2[_0x3c3820(0x96)]();if(!_0x539eb2[_0x3c3820(0x71)]||typeof _0x539eb2[_0x3c3820(0x71)][_0x3c3820(0x6e)]!==_0x3c3820(0x77))throw new Error(_0x3c3820(0x7a)+_0x4a1dc7+'):缺少\x20data.markdown\x20字段');return _0x539eb2[_0x3c3820(0x71)][_0x3c3820(0x6e)];}function delay(_0x803a5e){return new Promise(_0x572177=>setTimeout(_0x572177,_0x803a5e));}export async function generateDatasetDocs(_0x1922af,_0x79b1b7,_0x44528c=a4_0x6df1ab(0x8d),_0x177cd0,_0x1c0cc5){const _0x401625=a4_0x6df1ab;mkdirSync(_0x44528c,{'recursive':!![]});const _0x94f609=[],_0x37064b=_0x1922af[_0x401625(0x80)];console['log']('\x0a共有\x20'+_0x37064b+_0x401625(0x7b));for(let _0xbd717e=0x0;_0xbd717e<_0x1922af[_0x401625(0x80)];_0xbd717e++){const _0x11824c=_0x1922af[_0xbd717e],_0x302c69=_0xbd717e+0x1,_0x1b69a9=_0x11824c[_0x401625(0x7c)];try{console[_0x401625(0x75)]('['+_0x302c69+'/'+_0x37064b+_0x401625(0x8c)+_0x1b69a9+'.md\x20('+_0x11824c['name']+')');_0x177cd0&&_0x177cd0(_0x302c69,_0x37064b,_0x1b69a9);const _0x2a97cd=await fetchDatasetDoc({'appCode':_0x79b1b7,'datasetCode':_0x11824c['datasetCode'],'datasetId':_0x11824c['id'],'enableAI':![],'extraParams':_0x1c0cc5}),_0x3f13a6=a4_0x5d744b[_0x401625(0x8a)](_0x44528c,_0x1b69a9+'.md');writeFileSync(_0x3f13a6,_0x2a97cd,{'encoding':_0x401625(0x81)}),console[_0x401625(0x75)](_0x401625(0x6d)+_0x1b69a9+_0x401625(0x7f)),logger['success'](_0x401625(0x94),_0x401625(0x78)+_0x1b69a9,undefined,{'datasetCode':_0x11824c[_0x401625(0x95)],'datasetName':_0x11824c[_0x401625(0x89)],'filePath':_0x3f13a6,'progress':_0x302c69+'/'+_0x37064b}),_0x94f609[_0x401625(0x8e)]({'datasetCode':_0x11824c['datasetCode'],'datasetName':_0x11824c[_0x401625(0x89)],'filePath':_0x3f13a6,'success':!![]}),_0x302c69<_0x37064b&&await delay(0x1388);}catch(_0x436877){const _0x28a2f6=_0x436877 instanceof Error?_0x436877['message']:String(_0x436877);console[_0x401625(0x75)](_0x401625(0x84)+_0x1b69a9+'.md\x20-\x20'+_0x28a2f6+'\x0a'),logger[_0x401625(0x73)](_0x401625(0x94),_0x401625(0x83)+_0x11824c[_0x401625(0x95)],{'datasetCode':_0x11824c['datasetCode'],'datasetName':_0x11824c[_0x401625(0x89)],'error':_0x28a2f6,'progress':_0x302c69+'/'+_0x37064b}),_0x94f609['push']({'datasetCode':_0x11824c[_0x401625(0x95)],'datasetName':_0x11824c['name'],'filePath':'','success':![],'error':_0x28a2f6}),_0x302c69<_0x37064b&&(console[_0x401625(0x75)](_0x401625(0x79)),await delay(0xbb8));}}return _0x94f609;}
@@ -1 +1 @@
1
- (function(_0x328831,_0x54f9b0){const _0x12e4bb=a5_0x23f3,_0x588489=_0x328831();while(!![]){try{const _0x2457f7=parseInt(_0x12e4bb(0x190))/0x1*(-parseInt(_0x12e4bb(0x177))/0x2)+-parseInt(_0x12e4bb(0x17a))/0x3*(parseInt(_0x12e4bb(0x165))/0x4)+parseInt(_0x12e4bb(0x16e))/0x5*(parseInt(_0x12e4bb(0x182))/0x6)+-parseInt(_0x12e4bb(0x16c))/0x7+parseInt(_0x12e4bb(0x171))/0x8*(parseInt(_0x12e4bb(0x194))/0x9)+-parseInt(_0x12e4bb(0x199))/0xa+parseInt(_0x12e4bb(0x180))/0xb;if(_0x2457f7===_0x54f9b0)break;else _0x588489['push'](_0x588489['shift']());}catch(_0x466a4f){_0x588489['push'](_0x588489['shift']());}}}(a5_0x5dd9,0xbd4ac));import{jsx as a5_0x361f29,jsxs as a5_0x334076}from'react/jsx-runtime';import{useEffect,useState}from'react';import{Box,Text,useApp}from'ink';import{readConfig,getConfigAppCode}from'../utils/config.js';function a5_0x23f3(_0xed7e8c,_0x339f3e){const _0x5dd94e=a5_0x5dd9();return a5_0x23f3=function(_0x23f3ab,_0x4bf476){_0x23f3ab=_0x23f3ab-0x165;let _0x55b7f7=_0x5dd94e[_0x23f3ab];return _0x55b7f7;},a5_0x23f3(_0xed7e8c,_0x339f3e);}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:_0x31b62c,env:_0x4625b2,output:_0x5119d1})=>{const _0x47f522=a5_0x23f3,{exit:_0x3d56c7}=useApp(),[_0x4729ab,_0x2535cb]=useState(![]),[_0x4f939f,_0x1b6938]=useState(![]),[_0x364b1f,_0x34fe70]=useState(null),[_0x56deaf,_0x1cfc37]=useState(null),_0x2766b4=readConfig(),_0x313733=getConfigAppCode(),_0x47baf7=_0x31b62c||_0x313733,_0x57c753=typeof _0x2766b4?.[_0x47f522(0x176)]===_0x47f522(0x198)?_0x2766b4['env']:undefined,_0x10798d=_0x4625b2||_0x57c753||_0x47f522(0x178);initEnv(_0x10798d);const _0x4bda1a=_0x5119d1||_0x47f522(0x168),_0x1efba3=_0x31b62c&&_0x31b62c[_0x47f522(0x16b)]('-')?_0x31b62c[_0x47f522(0x193)]('-')[_0x47f522(0x17c)](0x1)[_0x47f522(0x195)]('-'):'',_0x341060=_0x31b62c?_0x47f522(0x187)+_0x47baf7:_0x47f522(0x174)+_0x47baf7,_0x29c0a=_0x1efba3?_0x1efba3+_0x47f522(0x18b):'api',_0x2feae1=_0x1efba3?_0x1efba3+'-client':'client';useEffect(()=>{_0x2535cb(!![]),_0x4351d7();},[]),useEffect(()=>{(_0x4f939f||_0x364b1f)&&_0x3d56c7();},[_0x4f939f,_0x364b1f,_0x3d56c7]);async function _0x4351d7(){const _0x13db78=_0x47f522;if(!_0x47baf7){_0x34fe70('未提供应用AppCode,且配置中也没有默认值');return;}try{logger[_0x13db78(0x170)](process['cwd']());const {configArray:_0x5c1b1d}=await fetchModelList(_0x47baf7),_0x37ea2f=_0x5c1b1d[_0x13db78(0x192)],_0x1546dc=!_0x31b62c,_0x5f8c1a=await generateApiFile(_0x5c1b1d,_0x1efba3,_0x47baf7,_0x1546dc,_0x10798d,_0x4bda1a),_0x10b2c4=_0x4bda1a[_0x13db78(0x169)]('/')?_0x4bda1a:_0x4bda1a+'/';_0x1cfc37({'api':''+_0x10b2c4+_0x29c0a+_0x13db78(0x18c),'client':''+_0x10b2c4+_0x2feae1+_0x13db78(0x18c),'modelCount':_0x5f8c1a['modelCount'],'datasetCount':_0x37ea2f,'originalCount':_0x37ea2f,'duplicateCount':0x0}),_0x1b6938(!![]);}catch(_0x8c7539){const _0x983abb=_0x8c7539 instanceof Error?_0x8c7539[_0x13db78(0x16a)]:String(_0x8c7539);logger[_0x13db78(0x18d)](_0x13db78(0x167),_0x13db78(0x184)+_0x983abb,{'appCode':_0x47baf7,'error':_0x983abb}),_0x34fe70(_0x13db78(0x184)+_0x983abb);}finally{_0x2535cb(![]);}}return a5_0x334076(Box,{'flexDirection':_0x47f522(0x18f),'children':[(_0x4729ab||_0x4f939f)&&a5_0x334076(Box,{'children':[a5_0x361f29(Text,{'color':_0x47f522(0x181),'children':'*\x20'}),a5_0x361f29(Text,{'color':_0x31b62c?_0x47f522(0x179):'dim','children':_0x341060})]}),_0x4729ab&&a5_0x361f29(Box,{'children':a5_0x334076(Text,{'children':[_0x47f522(0x19d),_0x10798d,')']})}),_0x4f939f&&_0x56deaf&&a5_0x334076(Box,{'flexDirection':'column','children':[a5_0x361f29(Box,{'children':a5_0x334076(Text,{'color':'green','children':[_0x47f522(0x189),_0x56deaf[_0x47f522(0x188)],_0x47f522(0x16f),'\x20',_0x56deaf['modelCount'],_0x47f522(0x196)]})}),_0x56deaf['duplicateCount']>0x0&&a5_0x361f29(Box,{'marginTop':0x1,'children':a5_0x334076(Text,{'color':_0x47f522(0x185),'children':['!\x20原始数据集\x20',_0x56deaf[_0x47f522(0x19a)],_0x47f522(0x19b),'\x20',_0x56deaf[_0x47f522(0x18e)],'\x20个']})}),a5_0x361f29(Box,{'marginTop':0x1,'children':a5_0x361f29(Text,{'color':_0x47f522(0x181),'children':_0x47f522(0x183)})}),a5_0x334076(Box,{'marginLeft':0x2,'children':[a5_0x334076(Text,{'color':'cyan','children':['•\x20',_0x56deaf[_0x47f522(0x19c)]]}),a5_0x334076(Text,{'color':_0x47f522(0x17b),'children':['\x20',_0x47f522(0x186),_0x56deaf[_0x47f522(0x166)],'\x20个模型)']})]}),a5_0x334076(Box,{'marginLeft':0x2,'children':[a5_0x334076(Text,{'color':_0x47f522(0x18a),'children':['•\x20',_0x56deaf[_0x47f522(0x17e)]]}),a5_0x361f29(Text,{'color':_0x47f522(0x17b),'children':_0x47f522(0x173)})]}),a5_0x361f29(Box,{'marginTop':0x1,'children':a5_0x361f29(Text,{'color':'gray','children':_0x47f522(0x17d)})}),a5_0x361f29(Box,{'marginLeft':0x2,'children':a5_0x334076(Text,{'color':_0x47f522(0x185),'children':[_0x47f522(0x16d),_0x47f522(0x175),'\x20from\x20\x27@/',_0x56deaf[_0x47f522(0x17e)][_0x47f522(0x197)](/^\.\//,'')[_0x47f522(0x197)](_0x47f522(0x18c),''),'\x27']})})]}),_0x364b1f&&a5_0x334076(Box,{'flexDirection':_0x47f522(0x18f),'children':[a5_0x361f29(Box,{'children':a5_0x334076(Text,{'color':_0x47f522(0x17f),'children':['❌\x20',_0x364b1f]})}),_0x364b1f['includes']('登录')&&a5_0x334076(Box,{'marginTop':0x1,'children':[a5_0x361f29(Text,{'color':'yellow','children':_0x47f522(0x191)}),a5_0x361f29(Text,{'color':_0x47f522(0x18a),'children':'lovrabet\x20auth'}),a5_0x361f29(Text,{'color':_0x47f522(0x185),'children':_0x47f522(0x172)})]})]})]});};function a5_0x5dd9(){const _0x5b45b2=['11128909uLZTZg','gray','78kYDJdk','*\x20已生成文件:','拉取\x20API\x20配置失败:\x20','yellow','-\x20模型配置文件\x20(','使用指定的应用AppCode:\x20','datasetCount','√\x20成功拉取\x20','cyan','-api','.ts','error','duplicateCount','column','1279ocxRYO','💡\x20请使用\x20','length','split','168039JvvHFv','join','\x20个模型','replace','string','8720760tUoWKs','originalCount','\x20个,过滤重复','api','🚀\x20正在从服务器拉取\x20API\x20配置...\x20(环境:\x20','991176RpnCuq','modelCount','api-pull','./src/api/','endsWith','message','includes','4211732LEMcgD','import\x20','502535rUjtRX','\x20个数据集,生成','setLogPath','416sTDYpv','\x20重新登录后再试','\x20-\x20客户端实例文件','使用配置的应用AppCode:\x20','{\x20lovrabetClient\x20}','env','464TdqwAR','online','white','9RGPbKT','dim','slice','*\x20导入方式:','client','red'];a5_0x5dd9=function(){return _0x5b45b2;};return a5_0x5dd9();}
1
+ function a5_0x2e0e(_0x364301,_0x30a4eb){const _0x521a97=a5_0x521a();return a5_0x2e0e=function(_0x2e0e75,_0x599c59){_0x2e0e75=_0x2e0e75-0x1aa;let _0x1a9481=_0x521a97[_0x2e0e75];return _0x1a9481;},a5_0x2e0e(_0x364301,_0x30a4eb);}(function(_0x5869ff,_0x345a28){const _0x430fb6=a5_0x2e0e,_0x3a776a=_0x5869ff();while(!![]){try{const _0x2bfd5a=-parseInt(_0x430fb6(0x1be))/0x1*(parseInt(_0x430fb6(0x1dc))/0x2)+parseInt(_0x430fb6(0x1aa))/0x3+parseInt(_0x430fb6(0x1c8))/0x4+-parseInt(_0x430fb6(0x1d2))/0x5+-parseInt(_0x430fb6(0x1c3))/0x6+-parseInt(_0x430fb6(0x1ca))/0x7*(parseInt(_0x430fb6(0x1de))/0x8)+parseInt(_0x430fb6(0x1bd))/0x9*(parseInt(_0x430fb6(0x1d3))/0xa);if(_0x2bfd5a===_0x345a28)break;else _0x3a776a['push'](_0x3a776a['shift']());}catch(_0x3215bb){_0x3a776a['push'](_0x3a776a['shift']());}}}(a5_0x521a,0xb137a));function a5_0x521a(){const _0xe962d2=['length','8rNnKiS','dim','\x20重新登录后再试','green','2744805fefYbh','string','\x20-\x20客户端实例文件','\x20个模型)','!\x20原始数据集\x20','\x20个数据集,生成','\x20个模型','./src/api/','yellow','column','api-pull','-\x20模型配置文件\x20(','未提供应用AppCode,且配置中也没有默认值','slice','env','使用配置的应用AppCode:\x20','api','cwd','{\x20lovrabetClient\x20}','18gJVfrk','6962iAxWTq','client','duplicateCount','error','💡\x20请使用\x20','8308134jsXjWI','setLogPath','*\x20已生成文件:','cyan','*\x20导入方式:','668392hEkUvG','join','7651182nEyQci','🚀\x20正在从服务器拉取\x20API\x20配置...\x20(环境:\x20','online','message','拉取\x20API\x20配置失败:\x20','import\x20','modelCount','white','5643150Kilbjv','20254120gdpESv','使用指定的应用AppCode:\x20','replace','gray','originalCount','.ts','\x20from\x20\x27@/','includes','\x20个,过滤重复','230ohManw'];a5_0x521a=function(){return _0xe962d2;};return a5_0x521a();}import{jsx as a5_0x2c5cf9,jsxs as a5_0x46538e}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';import{fetchModelList}from'./fetch-model-list.js';export const ApiPullUI=({appCode:_0x77e972,env:_0x4e6497,output:_0x2c95e7})=>{const _0x17bacb=a5_0x2e0e,{exit:_0x18676a}=useApp(),[_0x226911,_0x7c0c69]=useState(![]),[_0x1e3c8a,_0x2988a0]=useState(![]),[_0x207b7c,_0x1d5fd2]=useState(null),[_0x35818f,_0x1d0b7b]=useState(null),_0x5cb49a=readConfig(),_0x4688dd=getConfigAppCode(),_0xca4b9e=_0x77e972||_0x4688dd,_0x982448=typeof _0x5cb49a?.[_0x17bacb(0x1b8)]===_0x17bacb(0x1ab)?_0x5cb49a[_0x17bacb(0x1b8)]:undefined,_0x12eecc=_0x4e6497||_0x982448||_0x17bacb(0x1cc);initEnv(_0x12eecc);const _0x4862b1=_0x2c95e7||_0x17bacb(0x1b1),_0x4202b8=_0x77e972&&_0x77e972[_0x17bacb(0x1da)]('-')?_0x77e972['split']('-')[_0x17bacb(0x1b7)](0x1)[_0x17bacb(0x1c9)]('-'):'',_0xb9f867=_0x77e972?_0x17bacb(0x1d4)+_0xca4b9e:_0x17bacb(0x1b9)+_0xca4b9e,_0x21236c=_0x4202b8?_0x4202b8+'-api':_0x17bacb(0x1ba),_0x6dabed=_0x4202b8?_0x4202b8+'-client':_0x17bacb(0x1bf);useEffect(()=>{_0x7c0c69(!![]),_0xaf0420();},[]),useEffect(()=>{(_0x1e3c8a||_0x207b7c)&&_0x18676a();},[_0x1e3c8a,_0x207b7c,_0x18676a]);async function _0xaf0420(){const _0x2b03f5=_0x17bacb;if(!_0xca4b9e){_0x1d5fd2(_0x2b03f5(0x1b6));return;}try{logger[_0x2b03f5(0x1c4)](process[_0x2b03f5(0x1bb)]());const {configArray:_0x119579}=await fetchModelList(_0xca4b9e),_0x5161c6=_0x119579[_0x2b03f5(0x1dd)],_0xb0211d=!_0x77e972,_0x40e016=await generateApiFile(_0x119579,_0x4202b8,_0xca4b9e,_0xb0211d,_0x12eecc,_0x4862b1),_0x11a9ec=_0x4862b1['endsWith']('/')?_0x4862b1:_0x4862b1+'/';_0x1d0b7b({'api':''+_0x11a9ec+_0x21236c+_0x2b03f5(0x1d8),'client':''+_0x11a9ec+_0x6dabed+_0x2b03f5(0x1d8),'modelCount':_0x40e016[_0x2b03f5(0x1d0)],'datasetCount':_0x5161c6,'originalCount':_0x5161c6,'duplicateCount':0x0}),_0x2988a0(!![]);}catch(_0x5ad26b){const _0x35eeab=_0x5ad26b instanceof Error?_0x5ad26b[_0x2b03f5(0x1cd)]:String(_0x5ad26b);logger[_0x2b03f5(0x1c1)](_0x2b03f5(0x1b4),'拉取\x20API\x20配置失败:\x20'+_0x35eeab,{'appCode':_0xca4b9e,'error':_0x35eeab}),_0x1d5fd2(_0x2b03f5(0x1ce)+_0x35eeab);}finally{_0x7c0c69(![]);}}return a5_0x46538e(Box,{'flexDirection':_0x17bacb(0x1b3),'children':[(_0x226911||_0x1e3c8a)&&a5_0x46538e(Box,{'children':[a5_0x2c5cf9(Text,{'color':_0x17bacb(0x1d6),'children':'*\x20'}),a5_0x2c5cf9(Text,{'color':_0x77e972?_0x17bacb(0x1d1):_0x17bacb(0x1df),'children':_0xb9f867})]}),_0x226911&&a5_0x2c5cf9(Box,{'children':a5_0x46538e(Text,{'children':[_0x17bacb(0x1cb),_0x12eecc,')']})}),_0x1e3c8a&&_0x35818f&&a5_0x46538e(Box,{'flexDirection':_0x17bacb(0x1b3),'children':[a5_0x2c5cf9(Box,{'children':a5_0x46538e(Text,{'color':_0x17bacb(0x1e1),'children':['√\x20成功拉取\x20',_0x35818f['datasetCount'],_0x17bacb(0x1af),'\x20',_0x35818f['modelCount'],_0x17bacb(0x1b0)]})}),_0x35818f[_0x17bacb(0x1c0)]>0x0&&a5_0x2c5cf9(Box,{'marginTop':0x1,'children':a5_0x46538e(Text,{'color':_0x17bacb(0x1b2),'children':[_0x17bacb(0x1ae),_0x35818f[_0x17bacb(0x1d7)],_0x17bacb(0x1db),'\x20',_0x35818f[_0x17bacb(0x1c0)],'\x20个']})}),a5_0x2c5cf9(Box,{'marginTop':0x1,'children':a5_0x2c5cf9(Text,{'color':_0x17bacb(0x1d6),'children':_0x17bacb(0x1c5)})}),a5_0x46538e(Box,{'marginLeft':0x2,'children':[a5_0x46538e(Text,{'color':_0x17bacb(0x1c6),'children':['•\x20',_0x35818f['api']]}),a5_0x46538e(Text,{'color':_0x17bacb(0x1df),'children':['\x20',_0x17bacb(0x1b5),_0x35818f['modelCount'],_0x17bacb(0x1ad)]})]}),a5_0x46538e(Box,{'marginLeft':0x2,'children':[a5_0x46538e(Text,{'color':_0x17bacb(0x1c6),'children':['•\x20',_0x35818f[_0x17bacb(0x1bf)]]}),a5_0x2c5cf9(Text,{'color':_0x17bacb(0x1df),'children':_0x17bacb(0x1ac)})]}),a5_0x2c5cf9(Box,{'marginTop':0x1,'children':a5_0x2c5cf9(Text,{'color':_0x17bacb(0x1d6),'children':_0x17bacb(0x1c7)})}),a5_0x2c5cf9(Box,{'marginLeft':0x2,'children':a5_0x46538e(Text,{'color':_0x17bacb(0x1b2),'children':[_0x17bacb(0x1cf),_0x17bacb(0x1bc),_0x17bacb(0x1d9),_0x35818f['client'][_0x17bacb(0x1d5)](/^\.\//,'')[_0x17bacb(0x1d5)](_0x17bacb(0x1d8),''),'\x27']})})]}),_0x207b7c&&a5_0x46538e(Box,{'flexDirection':'column','children':[a5_0x2c5cf9(Box,{'children':a5_0x46538e(Text,{'color':'red','children':['❌\x20',_0x207b7c]})}),_0x207b7c[_0x17bacb(0x1da)]('登录')&&a5_0x46538e(Box,{'marginTop':0x1,'children':[a5_0x2c5cf9(Text,{'color':_0x17bacb(0x1b2),'children':_0x17bacb(0x1c2)}),a5_0x2c5cf9(Text,{'color':_0x17bacb(0x1c6),'children':'lovrabet\x20auth'}),a5_0x2c5cf9(Text,{'color':_0x17bacb(0x1b2),'children':_0x17bacb(0x1e0)})]})]})]});};
@@ -1 +1 @@
1
- (function(_0xcc47b8,_0x3d3052){const _0x1ffaca=a6_0x1839,_0x114b9b=_0xcc47b8();while(!![]){try{const _0x547a02=-parseInt(_0x1ffaca(0x104))/0x1+-parseInt(_0x1ffaca(0x10b))/0x2*(parseInt(_0x1ffaca(0xff))/0x3)+-parseInt(_0x1ffaca(0x10c))/0x4+parseInt(_0x1ffaca(0x10a))/0x5*(-parseInt(_0x1ffaca(0xfd))/0x6)+-parseInt(_0x1ffaca(0x102))/0x7*(-parseInt(_0x1ffaca(0xfa))/0x8)+-parseInt(_0x1ffaca(0x10d))/0x9*(-parseInt(_0x1ffaca(0x108))/0xa)+parseInt(_0x1ffaca(0x106))/0xb*(parseInt(_0x1ffaca(0xfc))/0xc);if(_0x547a02===_0x3d3052)break;else _0x114b9b['push'](_0x114b9b['shift']());}catch(_0x127620){_0x114b9b['push'](_0x114b9b['shift']());}}}(a6_0x414e,0x31435));function a6_0x414e(){const _0x4cc2b6=['877624ixCvaP','登录鉴权失败,登录已过期,请使用\x20lovrabet\x20auth\x20重新登录','180pxorxo','828558Jetfsz','未知错误','305193pEGlZd','&otype=array','configArray','14QwDaAm','获取数据集失败,HTTP状态码:\x20','133902PmxsIm','data','134728CDCOGX','info','3980QweDSP','count','5dJqjFU','2nLvPgk','330948gxEaFu','5769YARdHJ'];a6_0x414e=function(){return _0x4cc2b6;};return a6_0x414e();}import{getCookie}from'../auth/get-cookie.js';import{getApiDomain}from'../constant/domain.js';import{logger}from'../utils/logger.js';function a6_0x1839(_0x34586e,_0x4abd46){const _0x414ea0=a6_0x414e();return a6_0x1839=function(_0x18395b,_0xf3c609){_0x18395b=_0x18395b-0xfa;let _0x4550e5=_0x414ea0[_0x18395b];return _0x4550e5;},a6_0x1839(_0x34586e,_0x4abd46);}import{getEnv}from'../constant/env.js';export async function fetchModelList(_0x40cd1a){const _0x4257fa=a6_0x1839,_0x34a189=getEnv(),_0xf188c7=getApiDomain()+'/api/node-toolbox/dataset/model-list?appcode='+_0x40cd1a+_0x4257fa(0x100);logger[_0x4257fa(0x107)]('fetch-model-list','正在从服务器拉取模型列表...\x20(环境:\x20'+_0x34a189+')',{'apiUrl':_0xf188c7});const _0x589d27=await fetch(_0xf188c7,{'headers':{'Cookie':getCookie()}});if(!_0x589d27['ok']){if(_0x589d27['status']===0x191)throw new Error(_0x4257fa(0xfb));throw new Error(_0x4257fa(0x103)+_0x589d27['status']);}const _0x44edfe=await _0x589d27['json']();if(!_0x44edfe['success'])throw new Error('获取数据集失败:\x20'+(_0x44edfe['message']||_0x4257fa(0xfe)));return{'configArray':_0x44edfe[_0x4257fa(0x105)][_0x4257fa(0x101)],'count':_0x44edfe['data'][_0x4257fa(0x109)]};}
1
+ (function(_0x4dcd98,_0x243b64){const _0x517669=a6_0x2cf2,_0xcc83a6=_0x4dcd98();while(!![]){try{const _0x29fb7c=parseInt(_0x517669(0x1fa))/0x1*(-parseInt(_0x517669(0x1f7))/0x2)+-parseInt(_0x517669(0x1f6))/0x3*(parseInt(_0x517669(0x1f8))/0x4)+-parseInt(_0x517669(0x1f5))/0x5*(-parseInt(_0x517669(0x1ef))/0x6)+-parseInt(_0x517669(0x1fc))/0x7+-parseInt(_0x517669(0x1f4))/0x8+-parseInt(_0x517669(0x1ee))/0x9*(parseInt(_0x517669(0x1ed))/0xa)+parseInt(_0x517669(0x1f0))/0xb;if(_0x29fb7c===_0x243b64)break;else _0xcc83a6['push'](_0xcc83a6['shift']());}catch(_0x250216){_0xcc83a6['push'](_0xcc83a6['shift']());}}}(a6_0xf251,0xe0f0c));import{getCookie}from'../auth/get-cookie.js';import{getApiDomain}from'../constant/domain.js';function a6_0xf251(){const _0x55f4ae=['71891358zFXRPV','data','&otype=array','/api/node-toolbox/dataset/model-list?appcode=','10560072jCylLh','150ELpUdh','18Jsrhwr','2xxPosf','1063460LjXZfO','登录鉴权失败,登录已过期,请使用\x20lovrabet\x20auth\x20重新登录','1830128CalQRv','json','6522285MMVYqK','获取数据集失败:\x20','未知错误','message','3680rNYjPZ','37890iwfoJb','322428CCLzBB'];a6_0xf251=function(){return _0x55f4ae;};return a6_0xf251();}import{logger}from'../utils/logger.js';import{getEnv}from'../constant/env.js';function a6_0x2cf2(_0x1341a4,_0x52af5b){const _0xf251c9=a6_0xf251();return a6_0x2cf2=function(_0x2cf281,_0x4d18d1){_0x2cf281=_0x2cf281-0x1ea;let _0x7375bf=_0xf251c9[_0x2cf281];return _0x7375bf;},a6_0x2cf2(_0x1341a4,_0x52af5b);}export async function fetchModelList(_0x419f6e){const _0x384f0c=a6_0x2cf2,_0x29f3bd=getEnv(),_0x467ac5=getApiDomain()+_0x384f0c(0x1f3)+_0x419f6e+_0x384f0c(0x1f2);logger['info']('fetch-model-list','正在从服务器拉取模型列表...\x20(环境:\x20'+_0x29f3bd+')',{'apiUrl':_0x467ac5});const _0x5534e0=await fetch(_0x467ac5,{'headers':{'Cookie':getCookie()}});if(!_0x5534e0['ok']){if(_0x5534e0['status']===0x191)throw new Error(_0x384f0c(0x1f9));throw new Error('获取数据集失败,HTTP状态码:\x20'+_0x5534e0['status']);}const _0xfe213d=await _0x5534e0[_0x384f0c(0x1fb)]();if(!_0xfe213d['success'])throw new Error(_0x384f0c(0x1ea)+(_0xfe213d[_0x384f0c(0x1ec)]||_0x384f0c(0x1eb)));return{'configArray':_0xfe213d[_0x384f0c(0x1f1)]['configArray'],'count':_0xfe213d[_0x384f0c(0x1f1)]['count']};}
@@ -1 +1 @@
1
- const a7_0x2bc8cd=a7_0x2c8d;(function(_0x293c57,_0x486225){const _0x94e35=a7_0x2c8d,_0x16567a=_0x293c57();while(!![]){try{const _0x1086da=-parseInt(_0x94e35(0x1b3))/0x1*(parseInt(_0x94e35(0x1cb))/0x2)+-parseInt(_0x94e35(0x1a9))/0x3+parseInt(_0x94e35(0x1b2))/0x4*(parseInt(_0x94e35(0x1bd))/0x5)+parseInt(_0x94e35(0x1c6))/0x6*(-parseInt(_0x94e35(0x1bf))/0x7)+-parseInt(_0x94e35(0x1cc))/0x8+-parseInt(_0x94e35(0x1ca))/0x9*(parseInt(_0x94e35(0x1a8))/0xa)+parseInt(_0x94e35(0x1c4))/0xb*(parseInt(_0x94e35(0x1b9))/0xc);if(_0x1086da===_0x486225)break;else _0x16567a['push'](_0x16567a['shift']());}catch(_0x2cde57){_0x16567a['push'](_0x16567a['shift']());}}}(a7_0x421c,0x31987));import a7_0x260c11 from'prettier';import{mkdirSync,writeFileSync,readFileSync}from'node:fs';import a7_0x56f2fc from'node:path';function a7_0x2c8d(_0x4fe6b6,_0x205fe1){const _0x421cfa=a7_0x421c();return a7_0x2c8d=function(_0x2c8d2b,_0x4d2607){_0x2c8d2b=_0x2c8d2b-0x1a8;let _0x4ee8dd=_0x421cfa[_0x2c8d2b];return _0x4ee8dd;},a7_0x2c8d(_0x4fe6b6,_0x205fe1);}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_0x421c(){const _0x4ef838=['{\x20apiConfigName:\x20\x22','key','{\x20apiConfigName:\x20','client.ts.tpl','init-api','6613116GDQBVC','replaceApiContent','datasetCode','string','1048655MQTyLb','utf8','49301mYrgHl','client','online','slice','api.ts.tpl','22rebmSi','format','270UCYPqU','dirname',',\x20env:\x20\x22','-client','270SGCERe','2gAGcwT','2336040gptFXh','endsWith','API\x20文件生成成功!','env','join','templates/generate-api','.ts','forEach','61270KmlyWi','784884PwKByn','keys','./src/api/','\x22\x20}','app','url','api','length','typescript','4ZjhCBN','54396VpTJtw'];a7_0x421c=function(){return _0x4ef838;};return a7_0x421c();}export async function generateApiFile(_0x3110bb,_0x2864a4='',_0x5d71e1,_0x901021=![],_0x5d4c01,_0x1b068b=a7_0x2bc8cd(0x1ab)){const _0x3eabe7=a7_0x2bc8cd,_0x22c3c0=readConfig(),_0x46324c=_0x5d71e1||_0x22c3c0?.[_0x3eabe7(0x1ad)];if(typeof _0x46324c!==_0x3eabe7(0x1bc)||!_0x46324c)throw new Error('请先通过\x20`lovrabet\x20config\x20set\x20app\x20<value>`\x20配置应用\x20Code');const _0x5daf46=_0x901021?'CONFIG_NAMES.DEFAULT':'\x22'+_0x46324c+'\x22',_0x14e71e=typeof _0x22c3c0['env']===_0x3eabe7(0x1bc)?_0x22c3c0[_0x3eabe7(0x1cf)]:undefined,_0x1770ba=_0x5d4c01||_0x14e71e||_0x3eabe7(0x1c1),_0x2e060a=_0x1770ba!==_0x3eabe7(0x1c1);let _0x2235e0;if(_0x901021)_0x2e060a?_0x2235e0=_0x3eabe7(0x1b6)+_0x5daf46+_0x3eabe7(0x1c8)+_0x1770ba+_0x3eabe7(0x1ac):_0x2235e0='';else{const _0x47088c=_0x2e060a?',\x20env:\x20\x22'+_0x1770ba+'\x22':'';_0x2235e0=_0x3eabe7(0x1b4)+_0x46324c+'\x22'+_0x47088c+'\x20}';}const _0x2a8624=_0x2864a4?_0x2864a4+'-api':_0x3eabe7(0x1af),_0x578ee6=_0x2864a4?_0x2864a4+_0x3eabe7(0x1c9):_0x3eabe7(0x1c0),_0x1531ff={};_0x3110bb[_0x3eabe7(0x1d3)](_0x52b712=>{const _0x4008ef=_0x3eabe7;_0x1531ff[_0x52b712[_0x4008ef(0x1b5)]]={'tableName':_0x52b712['tableName'],'datasetCode':_0x52b712[_0x4008ef(0x1bb)],'name':_0x52b712['name']||''};});const _0x3c8fad=fileURLToPath(import.meta[_0x3eabe7(0x1ae)]),_0x890988=a7_0x56f2fc['resolve'](a7_0x56f2fc[_0x3eabe7(0x1c7)](_0x3c8fad),'../..'),_0xaf84e1=a7_0x56f2fc['join'](_0x890988,_0x3eabe7(0x1d1)),_0xbd8f1c=a7_0x56f2fc[_0x3eabe7(0x1d0)](_0xaf84e1,_0x3eabe7(0x1c3)),_0x5a85c1=a7_0x56f2fc[_0x3eabe7(0x1d0)](_0xaf84e1,_0x3eabe7(0x1b7)),_0x2e6d7d=_0x1b068b[_0x3eabe7(0x1cd)]('/')?_0x1b068b[_0x3eabe7(0x1c2)](0x0,-0x1):_0x1b068b;mkdirSync(_0x2e6d7d,{'recursive':!![]});const _0x4a0341=readFileSync(_0xbd8f1c,_0x3eabe7(0x1be)),_0x259092=TemplateReplacer[_0x3eabe7(0x1ba)](_0x4a0341,_0x46324c,_0x1531ff,Object[_0x3eabe7(0x1aa)](_0x1531ff)[0x0],_0x2a8624,_0x5daf46),_0x549c66=await a7_0x260c11['format'](_0x259092,{'parser':_0x3eabe7(0x1b1)}),_0x156898=_0x2e6d7d+'/'+_0x2a8624+'.ts';writeFileSync(_0x156898,_0x549c66,{'encoding':_0x3eabe7(0x1be)});const _0xfe333d=readFileSync(_0x5a85c1,_0x3eabe7(0x1be)),_0x1a8c07=TemplateReplacer['replaceApiContent'](_0xfe333d,_0x46324c,_0x1531ff,Object[_0x3eabe7(0x1aa)](_0x1531ff)[0x0],_0x2a8624,_0x5daf46,_0x2235e0),_0x417165=await a7_0x260c11[_0x3eabe7(0x1c5)](_0x1a8c07,{'parser':_0x3eabe7(0x1b1)}),_0x3c8e7c=_0x2e6d7d+'/'+_0x578ee6+_0x3eabe7(0x1d2);writeFileSync(_0x3c8e7c,_0x417165,{'encoding':_0x3eabe7(0x1be)});const _0x4caf99=Object[_0x3eabe7(0x1aa)](_0x1531ff)[_0x3eabe7(0x1b0)];return logger['success'](_0x3eabe7(0x1b8),_0x3eabe7(0x1ce),undefined,{'apiFile':_0x156898,'clientFile':_0x3c8e7c,'modelCount':_0x4caf99,'configName':_0x5daf46}),{'modelCount':_0x4caf99,'apiFilePath':_0x156898,'clientFilePath':_0x3c8e7c,'configName':_0x5daf46};}
1
+ const a7_0x355004=a7_0x1cc3;(function(_0x40af61,_0x2fbb91){const _0x18520=a7_0x1cc3,_0x4d2479=_0x40af61();while(!![]){try{const _0xd7920f=parseInt(_0x18520(0xc3))/0x1+-parseInt(_0x18520(0xbd))/0x2*(parseInt(_0x18520(0xc6))/0x3)+parseInt(_0x18520(0xba))/0x4*(-parseInt(_0x18520(0xb9))/0x5)+parseInt(_0x18520(0xc2))/0x6+-parseInt(_0x18520(0xb0))/0x7+-parseInt(_0x18520(0xa7))/0x8+-parseInt(_0x18520(0xc7))/0x9*(-parseInt(_0x18520(0xb8))/0xa);if(_0xd7920f===_0x2fbb91)break;else _0x4d2479['push'](_0x4d2479['shift']());}catch(_0x49bf60){_0x4d2479['push'](_0x4d2479['shift']());}}}(a7_0x4ef8,0x9903f));function a7_0x1cc3(_0x190d7d,_0x3a5518){const _0x4ef8c3=a7_0x4ef8();return a7_0x1cc3=function(_0x1cc300,_0x4164d4){_0x1cc300=_0x1cc300-0xa6;let _0x2ef4e4=_0x4ef8c3[_0x1cc300];return _0x2ef4e4;},a7_0x1cc3(_0x190d7d,_0x3a5518);}import a7_0x43f918 from'prettier';import{mkdirSync,writeFileSync,readFileSync}from'node:fs';import a7_0x18593a from'node:path';import{fileURLToPath}from'node:url';import{readConfig}from'../utils/config.js';function a7_0x4ef8(){const _0x262729=['dirname','2oKraie','keys','请先通过\x20`lovrabet\x20config\x20set\x20app\x20<value>`\x20配置应用\x20Code','format','.ts','5050182NRBctT','30715YoVTBA','API\x20文件生成成功!','./src/api/','2805375xpwkII','243342MXPwjA','tableName','typescript','success','app','join','resolve','online',',\x20env:\x20\x22','env','8241528XlZfUt','string','length','replaceApiContent','api.ts.tpl','CONFIG_NAMES.DEFAULT','name','datasetCode','-api','3772979ivAjmJ','forEach','templates/generate-api','utf8','endsWith','client','api','slice','1070JbDZYt','55FUsaWj','230696HvLuqW','url'];a7_0x4ef8=function(){return _0x262729;};return a7_0x4ef8();}import{TemplateReplacer}from'../utils/template-replacer.js';import{logger}from'../utils/logger.js';export async function generateApiFile(_0x4b1e7b,_0x4a3142='',_0x16b9f3,_0x238f81=![],_0x1dd830,_0x51e33d=a7_0x355004(0xc5)){const _0x172a64=a7_0x355004,_0x3326bd=readConfig(),_0x231e20=_0x16b9f3||_0x3326bd?.[_0x172a64(0xcb)];if(typeof _0x231e20!==_0x172a64(0xa8)||!_0x231e20)throw new Error(_0x172a64(0xbf));const _0x37b43c=_0x238f81?_0x172a64(0xac):'\x22'+_0x231e20+'\x22',_0x18bf64=typeof _0x3326bd[_0x172a64(0xa6)]==='string'?_0x3326bd[_0x172a64(0xa6)]:undefined,_0x4c476d=_0x1dd830||_0x18bf64||_0x172a64(0xce),_0x4905e4=_0x4c476d!==_0x172a64(0xce);let _0x31a464;if(_0x238f81)_0x4905e4?_0x31a464='{\x20apiConfigName:\x20'+_0x37b43c+_0x172a64(0xcf)+_0x4c476d+'\x22\x20}':_0x31a464='';else{const _0x204cac=_0x4905e4?_0x172a64(0xcf)+_0x4c476d+'\x22':'';_0x31a464='{\x20apiConfigName:\x20\x22'+_0x231e20+'\x22'+_0x204cac+'\x20}';}const _0x89b1f5=_0x4a3142?_0x4a3142+_0x172a64(0xaf):_0x172a64(0xb6),_0x4431a7=_0x4a3142?_0x4a3142+'-client':_0x172a64(0xb5),_0x5034ba={};_0x4b1e7b[_0x172a64(0xb1)](_0x59d3a1=>{const _0x550a1a=_0x172a64;_0x5034ba[_0x59d3a1['key']]={'tableName':_0x59d3a1[_0x550a1a(0xc8)],'datasetCode':_0x59d3a1[_0x550a1a(0xae)],'name':_0x59d3a1[_0x550a1a(0xad)]||''};});const _0x16d50f=fileURLToPath(import.meta[_0x172a64(0xbb)]),_0x1bce9f=a7_0x18593a[_0x172a64(0xcd)](a7_0x18593a[_0x172a64(0xbc)](_0x16d50f),'../..'),_0x8c18d5=a7_0x18593a[_0x172a64(0xcc)](_0x1bce9f,_0x172a64(0xb2)),_0x4588c6=a7_0x18593a[_0x172a64(0xcc)](_0x8c18d5,_0x172a64(0xab)),_0x35271a=a7_0x18593a[_0x172a64(0xcc)](_0x8c18d5,'client.ts.tpl'),_0x15bbf0=_0x51e33d[_0x172a64(0xb4)]('/')?_0x51e33d[_0x172a64(0xb7)](0x0,-0x1):_0x51e33d;mkdirSync(_0x15bbf0,{'recursive':!![]});const _0x541f36=readFileSync(_0x4588c6,_0x172a64(0xb3)),_0x14a729=TemplateReplacer[_0x172a64(0xaa)](_0x541f36,_0x231e20,_0x5034ba,Object[_0x172a64(0xbe)](_0x5034ba)[0x0],_0x89b1f5,_0x37b43c),_0x53ecb3=await a7_0x43f918[_0x172a64(0xc0)](_0x14a729,{'parser':_0x172a64(0xc9)}),_0x1f45d=_0x15bbf0+'/'+_0x89b1f5+_0x172a64(0xc1);writeFileSync(_0x1f45d,_0x53ecb3,{'encoding':'utf8'});const _0x33c669=readFileSync(_0x35271a,_0x172a64(0xb3)),_0x4cf1cd=TemplateReplacer['replaceApiContent'](_0x33c669,_0x231e20,_0x5034ba,Object[_0x172a64(0xbe)](_0x5034ba)[0x0],_0x89b1f5,_0x37b43c,_0x31a464),_0x123608=await a7_0x43f918[_0x172a64(0xc0)](_0x4cf1cd,{'parser':_0x172a64(0xc9)}),_0x2cb15e=_0x15bbf0+'/'+_0x4431a7+_0x172a64(0xc1);writeFileSync(_0x2cb15e,_0x123608,{'encoding':'utf8'});const _0x3cea16=Object['keys'](_0x5034ba)[_0x172a64(0xa9)];return logger[_0x172a64(0xca)]('init-api',_0x172a64(0xc4),undefined,{'apiFile':_0x1f45d,'clientFile':_0x2cb15e,'modelCount':_0x3cea16,'configName':_0x37b43c}),{'modelCount':_0x3cea16,'apiFilePath':_0x1f45d,'clientFilePath':_0x2cb15e,'configName':_0x37b43c};}
package/lib/api/main.js CHANGED
@@ -1 +1 @@
1
- (function(_0x1b6fdf,_0xed119a){const _0x2cba85=a8_0x124d,_0x23d403=_0x1b6fdf();while(!![]){try{const _0x2c575a=parseInt(_0x2cba85(0x1f1))/0x1+-parseInt(_0x2cba85(0x1d6))/0x2*(-parseInt(_0x2cba85(0x1c4))/0x3)+-parseInt(_0x2cba85(0x1e5))/0x4*(parseInt(_0x2cba85(0x1d0))/0x5)+-parseInt(_0x2cba85(0x1e0))/0x6+-parseInt(_0x2cba85(0x1e4))/0x7+parseInt(_0x2cba85(0x1ef))/0x8+parseInt(_0x2cba85(0x1e1))/0x9;if(_0x2c575a===_0xed119a)break;else _0x23d403['push'](_0x23d403['shift']());}catch(_0x5437cd){_0x23d403['push'](_0x23d403['shift']());}}}(a8_0x240c,0xa24e6));import{jsx as a8_0x19ffd8}from'react/jsx-runtime';function a8_0x240c(){const _0x1ca189=['datasetcode','appcode','\x20\x20\x202.\x20使用参数:\x20lovrabet\x20api\x20doc\x20--appcode\x20<app-code>','1907916ntigDE','1022697OjTLXx','\x1b[90m*\x20使用配置的应用AppCode:\x20','length','5822355zVoAcw','4poFWdU','\x20\x20\x202.\x20使用参数:\x20lovrabet\x20api\x20pull\x20--appcode\x20<app-code>','log','input','\x20\x20lovrabet\x20api\x20doc\x20--output\x20<dir>\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定文档输出目录(默认:\x20./docs)','\x1b[90m\x20\x20(注:\x20--appcode\x20参数与配置一致,将使用默认配置)\x1b[0m','filter','!\x20请使用以下方式之一:','请使用\x20--appcode\x20参数,例如:','\x20\x20lovrabet\x20api\x20doc\x20--appcode\x20<code>\x20\x20\x20\x20\x20\x20\x20//\x20使用指定的\x20appcode','2057064LOBvxg','Unknown\x20api\x20command:\x20','193293WqlmHY','exit','\x20\x20lovrabet\x20api\x20doc\x20--appcode\x20','env','\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','12987xVGHMO','flags','\x1b[90m*\x20仅生成指定数据集的文档:\x20','isArray','error','×\x20未配置\x20AppCode','output','×\x20--params\x20参数必须是一个有效的\x20JSON\x20对象','map','Available\x20commands:','\x1b[0m','parse','241010kkIHPO','×\x20--params\x20参数不是有效的\x20JSON\x20格式','❌\x20错误:不再支持位置参数方式','\x20\x20lovrabet\x20api\x20pull\x20--output\x20<dir>\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定输出目录(默认:\x20./src/api/)','\x20\x20lovrabet\x20api\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20拉取并生成\x20API\x20配置文件','\x20\x20lovrabet\x20api\x20pull\x20--env\x20<env>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定环境(如:\x20daily,\x20online)','600FhYcLO','\x20\x20lovrabet\x20api\x20doc\x20--env\x20<env>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定环境(如:\x20daily,\x20online)','object','\x20\x20错误:\x20','\x20\x20\x201.\x20配置默认值:\x20lovrabet\x20config\x20set\x20appcode\x20<app-code>','\x20\x20lovrabet\x20api\x20pull\x20--appcode\x20','join'];a8_0x240c=function(){return _0x1ca189;};return a8_0x240c();}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_0x124d(_0x40e9c4,_0x33ebab){const _0x240c62=a8_0x240c();return a8_0x124d=function(_0x124d48,_0x5293cd){_0x124d48=_0x124d48-0x1c0;let _0x23fcde=_0x240c62[_0x124d48];return _0x23fcde;},a8_0x124d(_0x40e9c4,_0x33ebab);}export async function apiCli(_0xb28e3c){const _0x4bc4f0=a8_0x124d,_0x590b0a=_0xb28e3c['input'][0x1];if(_0xb28e3c[_0x4bc4f0(0x1c5)]['help']){console[_0x4bc4f0(0x1e7)](_0x4bc4f0(0x1c3));return;}if(_0x590b0a==='pull'){_0xb28e3c[_0x4bc4f0(0x1e8)][0x2]&&(console[_0x4bc4f0(0x1c8)](_0x4bc4f0(0x1d2)),console[_0x4bc4f0(0x1e7)](_0x4bc4f0(0x1ed)),console[_0x4bc4f0(0x1e7)](_0x4bc4f0(0x1db)+_0xb28e3c['input'][0x2]),process[_0x4bc4f0(0x1c0)](0x1));const _0x2e97a1=getConfigAppCode();let _0xb7ef1e=_0xb28e3c[_0x4bc4f0(0x1c5)][_0x4bc4f0(0x1de)];const _0x97976=typeof _0xb28e3c[_0x4bc4f0(0x1c5)][_0x4bc4f0(0x1c2)]==='string'?_0xb28e3c[_0x4bc4f0(0x1c5)][_0x4bc4f0(0x1c2)]:undefined,_0x448427=_0xb28e3c[_0x4bc4f0(0x1c5)]['output'];!_0xb7ef1e&&!_0x2e97a1&&(console[_0x4bc4f0(0x1c8)]('×\x20未配置\x20AppCode'),console[_0x4bc4f0(0x1e7)](_0x4bc4f0(0x1ec)),console[_0x4bc4f0(0x1e7)](_0x4bc4f0(0x1da)),console[_0x4bc4f0(0x1e7)](_0x4bc4f0(0x1e6)),process[_0x4bc4f0(0x1c0)](0x1)),_0xb7ef1e&&_0x2e97a1&&_0xb7ef1e===_0x2e97a1&&(console['log'](_0x4bc4f0(0x1e2)+_0xb7ef1e+_0x4bc4f0(0x1ce)),console[_0x4bc4f0(0x1e7)](_0x4bc4f0(0x1ea)),_0xb7ef1e=undefined),render(a8_0x19ffd8(ApiPullUI,{'appCode':_0xb7ef1e,'env':_0x97976,'output':_0x448427}));}else{if(_0x590b0a==='doc'){_0xb28e3c[_0x4bc4f0(0x1e8)][0x2]&&(console[_0x4bc4f0(0x1c8)](_0x4bc4f0(0x1d2)),console[_0x4bc4f0(0x1e7)](_0x4bc4f0(0x1ed)),console['log'](_0x4bc4f0(0x1c1)+_0xb28e3c[_0x4bc4f0(0x1e8)][0x2]),process[_0x4bc4f0(0x1c0)](0x1));const _0x493936=getConfigAppCode();let _0x48cd4e=_0xb28e3c[_0x4bc4f0(0x1c5)][_0x4bc4f0(0x1de)];const _0x502be0=typeof _0xb28e3c[_0x4bc4f0(0x1c5)]['env']==='string'?_0xb28e3c[_0x4bc4f0(0x1c5)][_0x4bc4f0(0x1c2)]:undefined,_0x2a77dc=_0xb28e3c[_0x4bc4f0(0x1c5)][_0x4bc4f0(0x1ca)],_0x1a1e94=_0xb28e3c[_0x4bc4f0(0x1c5)]['params'],_0x382eae=_0xb28e3c[_0x4bc4f0(0x1c5)][_0x4bc4f0(0x1dd)];!_0x48cd4e&&!_0x493936&&(console[_0x4bc4f0(0x1c8)](_0x4bc4f0(0x1c9)),console[_0x4bc4f0(0x1e7)](_0x4bc4f0(0x1ec)),console[_0x4bc4f0(0x1e7)](_0x4bc4f0(0x1da)),console[_0x4bc4f0(0x1e7)](_0x4bc4f0(0x1df)),process[_0x4bc4f0(0x1c0)](0x1));_0x48cd4e&&_0x493936&&_0x48cd4e===_0x493936&&(console[_0x4bc4f0(0x1e7)]('\x1b[90m*\x20使用配置的应用AppCode:\x20'+_0x48cd4e+'\x1b[0m'),_0x48cd4e=undefined);let _0x58fdb2;if(_0x1a1e94)try{_0x58fdb2=JSON[_0x4bc4f0(0x1cf)](_0x1a1e94),(typeof _0x58fdb2!==_0x4bc4f0(0x1d8)||_0x58fdb2===null||Array[_0x4bc4f0(0x1c7)](_0x58fdb2))&&(console['error'](_0x4bc4f0(0x1cb)),process['exit'](0x1));}catch(_0xde22d0){console[_0x4bc4f0(0x1c8)](_0x4bc4f0(0x1d1)),console['error'](_0x4bc4f0(0x1d9)+(_0xde22d0 instanceof Error?_0xde22d0['message']:String(_0xde22d0))),process[_0x4bc4f0(0x1c0)](0x1);}let _0x139782;_0x382eae&&(_0x139782=_0x382eae['split'](',')[_0x4bc4f0(0x1cc)](_0x263ca3=>_0x263ca3['trim']())[_0x4bc4f0(0x1eb)](_0xa03b1c=>_0xa03b1c[_0x4bc4f0(0x1e3)]>0x0),_0x139782[_0x4bc4f0(0x1e3)]===0x0&&(console[_0x4bc4f0(0x1c8)]('×\x20--datasetcode\x20参数不能为空'),process['exit'](0x1)),console[_0x4bc4f0(0x1e7)](_0x4bc4f0(0x1c6)+_0x139782[_0x4bc4f0(0x1dc)](',\x20')+_0x4bc4f0(0x1ce))),render(a8_0x19ffd8(ApiDocUI,{'appCode':_0x48cd4e,'env':_0x502be0,'output':_0x2a77dc,'extraParams':_0x58fdb2,'datasetCodes':_0x139782}));}else console['error'](_0x4bc4f0(0x1f0)+_0x590b0a),console[_0x4bc4f0(0x1e7)](_0x4bc4f0(0x1cd)),console[_0x4bc4f0(0x1e7)](_0x4bc4f0(0x1d4)),console[_0x4bc4f0(0x1e7)]('\x20\x20lovrabet\x20api\x20pull\x20--appcode\x20<code>\x20\x20\x20\x20\x20\x20//\x20使用指定的\x20appcode'),console[_0x4bc4f0(0x1e7)](_0x4bc4f0(0x1d3)),console[_0x4bc4f0(0x1e7)](_0x4bc4f0(0x1d5)),console[_0x4bc4f0(0x1e7)](''),console[_0x4bc4f0(0x1e7)]('\x20\x20lovrabet\x20api\x20doc\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20生成\x20API\x20文档'),console[_0x4bc4f0(0x1e7)](_0x4bc4f0(0x1ee)),console[_0x4bc4f0(0x1e7)](_0x4bc4f0(0x1e9)),console['log'](_0x4bc4f0(0x1d7)),process[_0x4bc4f0(0x1c0)](0x1);}}
1
+ (function(_0x8f4c99,_0x31b0c7){const _0x2ea20e=a8_0x2091,_0x332e61=_0x8f4c99();while(!![]){try{const _0x241337=-parseInt(_0x2ea20e(0x196))/0x1*(-parseInt(_0x2ea20e(0x1b9))/0x2)+parseInt(_0x2ea20e(0x1c6))/0x3+-parseInt(_0x2ea20e(0x1c0))/0x4*(-parseInt(_0x2ea20e(0x1c7))/0x5)+-parseInt(_0x2ea20e(0x1b1))/0x6*(parseInt(_0x2ea20e(0x1c1))/0x7)+-parseInt(_0x2ea20e(0x1a4))/0x8*(parseInt(_0x2ea20e(0x1b0))/0x9)+-parseInt(_0x2ea20e(0x1c2))/0xa+-parseInt(_0x2ea20e(0x1bb))/0xb;if(_0x241337===_0x31b0c7)break;else _0x332e61['push'](_0x332e61['shift']());}catch(_0x460e7e){_0x332e61['push'](_0x332e61['shift']());}}}(a8_0x4352,0xd9c82));import{jsx as a8_0x5edc5b}from'react/jsx-runtime';function a8_0x2091(_0x384c26,_0x43882b){const _0x435227=a8_0x4352();return a8_0x2091=function(_0x209187,_0x11ca4d){_0x209187=_0x209187-0x195;let _0x86b41c=_0x435227[_0x209187];return _0x86b41c;},a8_0x2091(_0x384c26,_0x43882b);}import{render}from'ink';import{ApiPullUI}from'./api-pull-ui.js';import{ApiDocUI}from'./api-doc-ui.js';import{getConfigAppCode}from'../utils/config.js';export async function apiCli(_0x727de4){const _0x454fe1=a8_0x2091,_0xef0897=_0x727de4[_0x454fe1(0x1b5)][0x1];if(_0x727de4[_0x454fe1(0x1b4)]['help']){console[_0x454fe1(0x1b3)]('\x0alovrabet\x20api\x20-\x20API\x20相关操作\x0a\x0a用法:\x0a\x20\x20$\x20lovrabet\x20api\x20pull\x20[options]\x0a\x20\x20$\x20lovrabet\x20api\x20doc\x20[options]\x0a\x0a选项:\x0a\x20\x20--appcode\x20<code>\x20\x20\x20\x20\x20\x20指定应用代码\x0a\x20\x20--output\x20<dir>\x20\x20\x20\x20\x20\x20\x20\x20指定输出目录(pull:\x20./src/api/,doc:\x20./docs)\x0a\x20\x20--env\x20<env>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20指定环境(如:daily、online)\x0a\x20\x20--datasetcode\x20<codes>\x20指定要生成文档的数据集代码(多个用逗号分隔,仅\x20doc\x20命令)\x0a\x20\x20--help\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20显示此帮助信息\x0a\x0a示例:\x0a\x20\x20$\x20lovrabet\x20api\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20拉取并生成\x20API\x20配置文件\x0a\x20\x20$\x20lovrabet\x20api\x20pull\x20--appcode\x20myapp\x20\x20\x20\x20\x20\x20\x20//\x20使用指定的\x20appcode\x0a\x20\x20$\x20lovrabet\x20api\x20pull\x20--output\x20./api\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定输出目录\x0a\x20\x20$\x20lovrabet\x20api\x20pull\x20--env\x20daily\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定环境拉取\x20API\x0a\x0a\x20\x20$\x20lovrabet\x20api\x20doc\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20生成所有数据集的文档\x0a\x20\x20$\x20lovrabet\x20api\x20doc\x20--appcode\x20myapp\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20使用指定的\x20appcode\x0a\x20\x20$\x20lovrabet\x20api\x20doc\x20--output\x20./docs\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定文档输出目录\x0a\x20\x20$\x20lovrabet\x20api\x20doc\x20--env\x20daily\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定环境生成文档\x0a\x20\x20$\x20lovrabet\x20api\x20doc\x20--datasetcode\x20ds_001\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20只生成指定数据集的文档\x0a\x20\x20$\x20lovrabet\x20api\x20doc\x20--datasetcode\x20ds_001,ds_002\x20\x20\x20\x20\x20\x20//\x20生成多个数据集的文档\x0a');return;}if(_0xef0897===_0x454fe1(0x1a9)){_0x727de4[_0x454fe1(0x1b5)][0x2]&&(console[_0x454fe1(0x1af)](_0x454fe1(0x1ba)),console[_0x454fe1(0x1b3)](_0x454fe1(0x1ae)),console[_0x454fe1(0x1b3)](_0x454fe1(0x1ac)+_0x727de4[_0x454fe1(0x1b5)][0x2]),process[_0x454fe1(0x1b2)](0x1));const _0x4775e9=getConfigAppCode();let _0x5b0697=_0x727de4[_0x454fe1(0x1b4)][_0x454fe1(0x19d)];const _0x35d5d0=typeof _0x727de4['flags'][_0x454fe1(0x1bd)]===_0x454fe1(0x1a6)?_0x727de4['flags']['env']:undefined,_0x338131=_0x727de4['flags'][_0x454fe1(0x1a8)];!_0x5b0697&&!_0x4775e9&&(console[_0x454fe1(0x1af)](_0x454fe1(0x1bc)),console[_0x454fe1(0x1b3)]('!\x20请使用以下方式之一:'),console[_0x454fe1(0x1b3)]('\x20\x20\x201.\x20配置默认值:\x20lovrabet\x20config\x20set\x20appcode\x20<app-code>'),console['log'](_0x454fe1(0x1ab)),process[_0x454fe1(0x1b2)](0x1)),_0x5b0697&&_0x4775e9&&_0x5b0697===_0x4775e9&&(console[_0x454fe1(0x1b3)](_0x454fe1(0x1b6)+_0x5b0697+_0x454fe1(0x1b7)),console[_0x454fe1(0x1b3)]('\x1b[90m\x20\x20(注:\x20--appcode\x20参数与配置一致,将使用默认配置)\x1b[0m'),_0x5b0697=undefined),render(a8_0x5edc5b(ApiPullUI,{'appCode':_0x5b0697,'env':_0x35d5d0,'output':_0x338131}));}else{if(_0xef0897===_0x454fe1(0x19c)){_0x727de4[_0x454fe1(0x1b5)][0x2]&&(console[_0x454fe1(0x1af)](_0x454fe1(0x1ba)),console[_0x454fe1(0x1b3)]('请使用\x20--appcode\x20参数,例如:'),console[_0x454fe1(0x1b3)](_0x454fe1(0x1aa)+_0x727de4[_0x454fe1(0x1b5)][0x2]),process[_0x454fe1(0x1b2)](0x1));const _0x50a9c8=getConfigAppCode();let _0x9169a0=_0x727de4[_0x454fe1(0x1b4)][_0x454fe1(0x19d)];const _0x4f2bd6=typeof _0x727de4[_0x454fe1(0x1b4)][_0x454fe1(0x1bd)]===_0x454fe1(0x1a6)?_0x727de4[_0x454fe1(0x1b4)]['env']:undefined,_0x15e229=_0x727de4['flags'][_0x454fe1(0x1a8)],_0x4e7705=_0x727de4[_0x454fe1(0x1b4)][_0x454fe1(0x1a1)],_0x4dcb43=_0x727de4[_0x454fe1(0x1b4)][_0x454fe1(0x19a)];!_0x9169a0&&!_0x50a9c8&&(console[_0x454fe1(0x1af)](_0x454fe1(0x1bc)),console[_0x454fe1(0x1b3)]('!\x20请使用以下方式之一:'),console[_0x454fe1(0x1b3)](_0x454fe1(0x1a0)),console[_0x454fe1(0x1b3)]('\x20\x20\x202.\x20使用参数:\x20lovrabet\x20api\x20doc\x20--appcode\x20<app-code>'),process[_0x454fe1(0x1b2)](0x1));_0x9169a0&&_0x50a9c8&&_0x9169a0===_0x50a9c8&&(console[_0x454fe1(0x1b3)](_0x454fe1(0x1b6)+_0x9169a0+_0x454fe1(0x1b7)),_0x9169a0=undefined);let _0x309155;if(_0x4e7705)try{_0x309155=JSON[_0x454fe1(0x1be)](_0x4e7705),(typeof _0x309155!==_0x454fe1(0x1c4)||_0x309155===null||Array['isArray'](_0x309155))&&(console[_0x454fe1(0x1af)]('×\x20--params\x20参数必须是一个有效的\x20JSON\x20对象'),process[_0x454fe1(0x1b2)](0x1));}catch(_0x15e7d9){console[_0x454fe1(0x1af)](_0x454fe1(0x197)),console[_0x454fe1(0x1af)]('\x20\x20错误:\x20'+(_0x15e7d9 instanceof Error?_0x15e7d9[_0x454fe1(0x199)]:String(_0x15e7d9))),process[_0x454fe1(0x1b2)](0x1);}let _0x2b1897;_0x4dcb43&&(_0x2b1897=_0x4dcb43[_0x454fe1(0x1a3)](',')[_0x454fe1(0x198)](_0x31f6bb=>_0x31f6bb['trim']())['filter'](_0x323171=>_0x323171[_0x454fe1(0x19f)]>0x0),_0x2b1897[_0x454fe1(0x19f)]===0x0&&(console[_0x454fe1(0x1af)](_0x454fe1(0x1a5)),process[_0x454fe1(0x1b2)](0x1)),console[_0x454fe1(0x1b3)](_0x454fe1(0x19e)+_0x2b1897[_0x454fe1(0x1ad)](',\x20')+_0x454fe1(0x1b7))),render(a8_0x5edc5b(ApiDocUI,{'appCode':_0x9169a0,'env':_0x4f2bd6,'output':_0x15e229,'extraParams':_0x309155,'datasetCodes':_0x2b1897}));}else console[_0x454fe1(0x1af)](_0x454fe1(0x1c3)+_0xef0897),console[_0x454fe1(0x1b3)](_0x454fe1(0x1b8)),console['log'](_0x454fe1(0x19b)),console[_0x454fe1(0x1b3)](_0x454fe1(0x195)),console[_0x454fe1(0x1b3)]('\x20\x20lovrabet\x20api\x20pull\x20--output\x20<dir>\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定输出目录(默认:\x20./src/api/)'),console[_0x454fe1(0x1b3)](_0x454fe1(0x1bf)),console[_0x454fe1(0x1b3)](''),console[_0x454fe1(0x1b3)]('\x20\x20lovrabet\x20api\x20doc\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20生成\x20API\x20文档'),console['log'](_0x454fe1(0x1c5)),console['log'](_0x454fe1(0x1a7)),console[_0x454fe1(0x1b3)](_0x454fe1(0x1a2)),process[_0x454fe1(0x1b2)](0x1);}}function a8_0x4352(){const _0x46cebc=['pull','\x20\x20lovrabet\x20api\x20doc\x20--appcode\x20','\x20\x20\x202.\x20使用参数:\x20lovrabet\x20api\x20pull\x20--appcode\x20<app-code>','\x20\x20lovrabet\x20api\x20pull\x20--appcode\x20','join','请使用\x20--appcode\x20参数,例如:','error','1154124VDSDnb','12sikqiX','exit','log','flags','input','\x1b[90m*\x20使用配置的应用AppCode:\x20','\x1b[0m','Available\x20commands:','4kNXoGm','❌\x20错误:不再支持位置参数方式','17654274iTKhud','×\x20未配置\x20AppCode','env','parse','\x20\x20lovrabet\x20api\x20pull\x20--env\x20<env>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定环境(如:\x20daily,\x20online)','8opDqDr','2681ynLqsG','9222580nWtchi','Unknown\x20api\x20command:\x20','object','\x20\x20lovrabet\x20api\x20doc\x20--appcode\x20<code>\x20\x20\x20\x20\x20\x20\x20//\x20使用指定的\x20appcode','5075760CzKJxp','2511935gZloRD','\x20\x20lovrabet\x20api\x20pull\x20--appcode\x20<code>\x20\x20\x20\x20\x20\x20//\x20使用指定的\x20appcode','554003nfRlfS','×\x20--params\x20参数不是有效的\x20JSON\x20格式','map','message','datasetcode','\x20\x20lovrabet\x20api\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20拉取并生成\x20API\x20配置文件','doc','appcode','\x1b[90m*\x20仅生成指定数据集的文档:\x20','length','\x20\x20\x201.\x20配置默认值:\x20lovrabet\x20config\x20set\x20appcode\x20<app-code>','params','\x20\x20lovrabet\x20api\x20doc\x20--env\x20<env>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定环境(如:\x20daily,\x20online)','split','24Zazzyx','×\x20--datasetcode\x20参数不能为空','string','\x20\x20lovrabet\x20api\x20doc\x20--output\x20<dir>\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定文档输出目录(默认:\x20./docs)','output'];a8_0x4352=function(){return _0x46cebc;};return a8_0x4352();}
@@ -1 +1 @@
1
- function a9_0x32cd(){const _0x40f0f2=['client','API\x20配置拉取成功:\x20','online','×\x20API\x20配置拉取异常:','38717AWYnCy','*\x20正在处理\x20','4692WDdWhP','24AkVydK','\x20个数据集,生成\x20','55190ltoLms','*\x20开始生成\x20API\x20配置文件:','api','modelCount','env','create-api-pull','\x20\x20\x20•\x20','2UJHJat','1209240sDYWBX','185536msJmQf','1421640Lzprfl','11IPcXpE','-api','\x20个数据集...','API\x20配置拉取异常:\x20','296897AVnrQe','info','603LgEeuA','\x20个模型','test','3490GDndQy','log','*\x20正在从服务器拉取\x20API\x20配置...\x20(环境:\x20','chdir','length','error','×\x20文件前缀格式不正确。只能包含字母、数字、连字符和下划线,且必须以字母开头。'];a9_0x32cd=function(){return _0x40f0f2;};return a9_0x32cd();}function a9_0x490b(_0x490890,_0x15d8c0){const _0x32cd30=a9_0x32cd();return a9_0x490b=function(_0x490b52,_0x3c9e8a){_0x490b52=_0x490b52-0x72;let _0x18b0aa=_0x32cd30[_0x490b52];return _0x18b0aa;},a9_0x490b(_0x490890,_0x15d8c0);}(function(_0x47b21b,_0x50f079){const _0x19749e=a9_0x490b,_0x28a650=_0x47b21b();while(!![]){try{const _0xd9a136=-parseInt(_0x19749e(0x8c))/0x1*(parseInt(_0x19749e(0x84))/0x2)+parseInt(_0x19749e(0x87))/0x3+parseInt(_0x19749e(0x86))/0x4+parseInt(_0x19749e(0x91))/0x5*(parseInt(_0x19749e(0x7a))/0x6)+-parseInt(_0x19749e(0x78))/0x7*(-parseInt(_0x19749e(0x7b))/0x8)+parseInt(_0x19749e(0x8e))/0x9*(-parseInt(_0x19749e(0x7d))/0xa)+parseInt(_0x19749e(0x88))/0xb*(-parseInt(_0x19749e(0x85))/0xc);if(_0xd9a136===_0x50f079)break;else _0x28a650['push'](_0x28a650['shift']());}catch(_0x2814e5){_0x28a650['push'](_0x28a650['shift']());}}}(a9_0x32cd,0x4cf75));import{readConfig}from'../utils/config.js';import{initEnv}from'../constant/env.js';import{generateApiFile}from'./generate-api-file.js';import{logger}from'../utils/logger.js';import{fetchModelList}from'./fetch-model-list.js';export async function pullApiSilent(_0x5a744c,_0x474462,_0x3728bd,_0xddbf41){const _0x10482e=a9_0x490b;let _0x63bcca;try{const _0x36c17c=_0x474462?.['trim']()||'';if(_0x36c17c){const _0x5bf26b=/^[a-zA-Z][a-zA-Z0-9_-]*$/;if(!_0x5bf26b[_0x10482e(0x90)](_0x36c17c))return console[_0x10482e(0x72)](_0x10482e(0x73)),![];}_0x3728bd&&(_0x63bcca=process['cwd'](),process[_0x10482e(0x94)](_0x3728bd));const _0x1704eb=readConfig(),_0x14187c=typeof _0x1704eb[_0x10482e(0x81)]==='string'?_0x1704eb['env']:undefined,_0x18a114=_0xddbf41||_0x14187c||_0x10482e(0x76);initEnv(_0x18a114),console[_0x10482e(0x92)](_0x10482e(0x93)+_0x18a114+')');const {configArray:_0x4a92d8}=await fetchModelList(_0x5a744c),_0x1cba13=_0x36c17c?_0x36c17c+_0x10482e(0x89):_0x10482e(0x7f),_0xbb43fe=_0x36c17c?_0x36c17c+'-client':_0x10482e(0x74);console[_0x10482e(0x92)](_0x10482e(0x7e)),console[_0x10482e(0x92)](_0x10482e(0x83)+_0x1cba13+'.ts\x20-\x20模型配置文件'),console[_0x10482e(0x92)](_0x10482e(0x83)+_0xbb43fe+'.ts\x20-\x20客户端实例文件'),console[_0x10482e(0x92)](_0x10482e(0x79)+_0x4a92d8[_0x10482e(0x95)]+_0x10482e(0x8a));const _0xbfe9de=await generateApiFile(_0x4a92d8,_0x36c17c,_0x5a744c,!![],_0x18a114);return console[_0x10482e(0x92)]('√\x20成功拉取\x20'+_0x4a92d8[_0x10482e(0x95)]+_0x10482e(0x7c)+_0xbfe9de[_0x10482e(0x80)]+_0x10482e(0x8f)),_0x3728bd&&logger[_0x10482e(0x8d)](_0x10482e(0x82),_0x10482e(0x75)+_0x5a744c,{'projectPath':_0x3728bd,'appCode':_0x5a744c,'datasetCount':_0x4a92d8[_0x10482e(0x95)],'filePrefix':_0x36c17c}),!![];}catch(_0x5536ec){const _0x168af0=_0x5536ec instanceof Error?_0x5536ec['message']:String(_0x5536ec);return console[_0x10482e(0x72)](_0x10482e(0x77),_0x168af0),_0x3728bd&&logger['error'](_0x10482e(0x82),_0x10482e(0x8b)+_0x168af0,{'appCode':_0x5a744c,'projectPath':_0x3728bd}),![];}finally{_0x63bcca&&process[_0x10482e(0x94)](_0x63bcca);}}
1
+ (function(_0x3135e1,_0x5637cc){const _0x2fa643=a9_0x6979,_0xf41723=_0x3135e1();while(!![]){try{const _0xc495b8=parseInt(_0x2fa643(0x162))/0x1+parseInt(_0x2fa643(0x16e))/0x2+-parseInt(_0x2fa643(0x16b))/0x3*(parseInt(_0x2fa643(0x159))/0x4)+-parseInt(_0x2fa643(0x15d))/0x5+parseInt(_0x2fa643(0x178))/0x6*(parseInt(_0x2fa643(0x166))/0x7)+-parseInt(_0x2fa643(0x170))/0x8+parseInt(_0x2fa643(0x168))/0x9;if(_0xc495b8===_0x5637cc)break;else _0xf41723['push'](_0xf41723['shift']());}catch(_0xb434cf){_0xf41723['push'](_0xf41723['shift']());}}}(a9_0x3e7d,0xabfcc));import{readConfig}from'../utils/config.js';import{initEnv}from'../constant/env.js';function a9_0x6979(_0x33b130,_0x7e00f0){const _0x3e7dc8=a9_0x3e7d();return a9_0x6979=function(_0x6979ec,_0x514539){_0x6979ec=_0x6979ec-0x158;let _0x39e7fd=_0x3e7dc8[_0x6979ec];return _0x39e7fd;},a9_0x6979(_0x33b130,_0x7e00f0);}function a9_0x3e7d(){const _0x4a6f65=['API\x20配置拉取成功:\x20','chdir','log','API\x20配置拉取异常:\x20','\x20个数据集,生成\x20','163020mmMNLk','error','9964eTDQlt','√\x20成功拉取\x20','info','-api','1845175MmlecS','client','.ts\x20-\x20客户端实例文件','\x20个数据集...','create-api-pull','896687rFZLeI','cwd','*\x20正在处理\x20','\x20个模型','105COCJkF','length','7676523wfkCvb','*\x20正在从服务器拉取\x20API\x20配置...\x20(环境:\x20','message','1329Zbvbyc','env','-client','1979704PqnLUS','*\x20开始生成\x20API\x20配置文件:','7760224qbVKbS','.ts\x20-\x20模型配置文件','\x20\x20\x20•\x20'];a9_0x3e7d=function(){return _0x4a6f65;};return a9_0x3e7d();}import{generateApiFile}from'./generate-api-file.js';import{logger}from'../utils/logger.js';import{fetchModelList}from'./fetch-model-list.js';export async function pullApiSilent(_0x3b0b8d,_0x497a2e,_0x149afa,_0x220c2d){const _0x260b73=a9_0x6979;let _0x1b0fbf;try{const _0x53c09a=_0x497a2e?.['trim']()||'';if(_0x53c09a){const _0x30df2a=/^[a-zA-Z][a-zA-Z0-9_-]*$/;if(!_0x30df2a['test'](_0x53c09a))return console[_0x260b73(0x158)]('×\x20文件前缀格式不正确。只能包含字母、数字、连字符和下划线,且必须以字母开头。'),![];}_0x149afa&&(_0x1b0fbf=process[_0x260b73(0x163)](),process[_0x260b73(0x174)](_0x149afa));const _0x2adc7d=readConfig(),_0x95dfae=typeof _0x2adc7d[_0x260b73(0x16c)]==='string'?_0x2adc7d[_0x260b73(0x16c)]:undefined,_0x2b072c=_0x220c2d||_0x95dfae||'online';initEnv(_0x2b072c),console[_0x260b73(0x175)](_0x260b73(0x169)+_0x2b072c+')');const {configArray:_0x173b89}=await fetchModelList(_0x3b0b8d),_0x546c21=_0x53c09a?_0x53c09a+_0x260b73(0x15c):'api',_0x188773=_0x53c09a?_0x53c09a+_0x260b73(0x16d):_0x260b73(0x15e);console[_0x260b73(0x175)](_0x260b73(0x16f)),console[_0x260b73(0x175)](_0x260b73(0x172)+_0x546c21+_0x260b73(0x171)),console[_0x260b73(0x175)](_0x260b73(0x172)+_0x188773+_0x260b73(0x15f)),console[_0x260b73(0x175)](_0x260b73(0x164)+_0x173b89[_0x260b73(0x167)]+_0x260b73(0x160));const _0x5a6889=await generateApiFile(_0x173b89,_0x53c09a,_0x3b0b8d,!![],_0x2b072c);return console[_0x260b73(0x175)](_0x260b73(0x15a)+_0x173b89[_0x260b73(0x167)]+_0x260b73(0x177)+_0x5a6889['modelCount']+_0x260b73(0x165)),_0x149afa&&logger[_0x260b73(0x15b)](_0x260b73(0x161),_0x260b73(0x173)+_0x3b0b8d,{'projectPath':_0x149afa,'appCode':_0x3b0b8d,'datasetCount':_0x173b89['length'],'filePrefix':_0x53c09a}),!![];}catch(_0x51314e){const _0x531327=_0x51314e instanceof Error?_0x51314e[_0x260b73(0x16a)]:String(_0x51314e);return console[_0x260b73(0x158)]('×\x20API\x20配置拉取异常:',_0x531327),_0x149afa&&logger['error']('create-api-pull',_0x260b73(0x176)+_0x531327,{'appCode':_0x3b0b8d,'projectPath':_0x149afa}),![];}finally{_0x1b0fbf&&process['chdir'](_0x1b0fbf);}}
@@ -1 +1 @@
1
- const a10_0x4d9d0d=a10_0x26ac;(function(_0x2d8eea,_0x545660){const _0x460d37=a10_0x26ac,_0x4b9386=_0x2d8eea();while(!![]){try{const _0x693795=-parseInt(_0x460d37(0x1a0))/0x1+parseInt(_0x460d37(0x1c0))/0x2+-parseInt(_0x460d37(0x1c4))/0x3+-parseInt(_0x460d37(0x1c3))/0x4+parseInt(_0x460d37(0x1a9))/0x5+-parseInt(_0x460d37(0x19f))/0x6*(parseInt(_0x460d37(0x1cd))/0x7)+-parseInt(_0x460d37(0x1a7))/0x8*(-parseInt(_0x460d37(0x1bf))/0x9);if(_0x693795===_0x545660)break;else _0x4b9386['push'](_0x4b9386['shift']());}catch(_0x7221d6){_0x4b9386['push'](_0x4b9386['shift']());}}}(a10_0x5c53,0x4b572));function a10_0x26ac(_0x4a2b27,_0x1ff3f6){const _0x5c534f=a10_0x5c53();return a10_0x26ac=function(_0x26ac20,_0x469a61){_0x26ac20=_0x26ac20-0x196;let _0x229e8d=_0x5c534f[_0x26ac20];return _0x229e8d;},a10_0x26ac(_0x4a2b27,_0x1ff3f6);}import{jsx as a10_0x2f814a,jsxs as a10_0x1c1c75,Fragment as a10_0x103f0b}from'react/jsx-runtime';import{Text,Box,useInput,useApp,render}from'ink';import{useEffect,useState}from'react';import a10_0x3f3e34 from'ink-spinner';import{useGetOnlineMenuList}from'./get-online-menu-list.js';function a10_0x5c53(){const _0x15e1c7=['[\x20]','trim','downArrow','*\x20请选择要同步的菜单:','has','54ogTzZS','187218Rlxwaq','*\x20正在创建菜单...','input-css','value','yellow','*\x20JS\x20链接:\x20','selecting','6328BVrpSJ','map','1394695wnIrIE','dots','creating','repeat','path','[✓]','join','online','菜单名称','test','upArrow','fill','↑/↓:\x20移动光标\x20空格:\x20切换选中\x20a:\x20全选\x20i/r:\x20反选\x20Enter:\x20确认','\x20输入项目的\x20JS\x20资源链接(https://...)','column','slice','label','filter','length','main','add','gray','15786AXYrcV','366oSqVKL','*\x20CSS\x20链接:\x20','blue','1318392gcRNbY','1434117wpQtZH','已选择菜单','√\x20菜单创建完成','local','then','red','cyan','delete','done','282401vZiMzy','Lovrabet平台','\x20正在获取线上菜单列表...','\x20←\x20','请输入有效的\x20CSS\x20https\x20链接','CSS\x20链接','size','JS\x20链接无法访问','return','!\x20未找到本地页面,请先创建页面','green','includes','input-js'];a10_0x5c53=function(){return _0x15e1c7;};return a10_0x5c53();}import{getLocalPages}from'./get-local-pages.js';import{createMenus}from'./create-menu.js';import{isUrlReachable,isValidCssHttpsUrl,isValidJsHttpsUrl}from'./valid-url.js';import.meta[a10_0x4d9d0d(0x1bc)]&&render(a10_0x2f814a(AppMenuSyncUI,{}));export function AppMenuSyncUI(){const _0x5d8a4b=a10_0x4d9d0d,{exit:_0x80d53d}=useApp(),{loading:_0x4c5f10,menuList:_0xe162af}=useGetOnlineMenuList(),_0xe9df5d=getLocalPages(),_0x13502c=_0xe162af[_0x5d8a4b(0x1a8)](_0x4e7d98=>_0x4e7d98[_0x5d8a4b(0x1ad)]),_0x12752c=[_0x5d8a4b(0x1b1),..._0xe9df5d[_0x5d8a4b(0x1a8)](_0x47d1c7=>_0x47d1c7[_0x5d8a4b(0x1b9)])],_0x3b681e=getStringWidth(getMaxWidth(_0x12752c,0x4)),_0x16905e=getStringWidth(getMaxWidth(['菜单名称'])),[_0x2d0e16,_0x216592]=useState(_0x5d8a4b(0x1a6)),[_0x4684e5,_0x6d4b2e]=useState(new Set()),[_0x1c6234,_0x3aabe5]=useState(0x0),[_0x15bb3e,_0x2dfd42]=useState(''),[_0x10c994,_0x25e6e4]=useState(''),[_0x503312,_0x15f173]=useState(''),[_0x1e569f,_0x230005]=useState(''),[_0x1940ed,_0x33d3a3]=useState([]),_0x493643=_0xe9df5d[_0x5d8a4b(0x1a8)](_0x3a4554=>({'label':_0x3a4554[_0x5d8a4b(0x1b9)],'path':_0x3a4554[_0x5d8a4b(0x1ad)],'local':!![],'online':_0x13502c[_0x5d8a4b(0x198)](_0x3a4554[_0x5d8a4b(0x1ad)])})),_0x16c4a0=_0xe9df5d[_0x5d8a4b(0x1ba)](_0x517595=>{const _0x366e1f=_0x5d8a4b;return!_0x13502c['includes'](_0x517595[_0x366e1f(0x1ad)]);});useEffect(()=>{const _0x2ee23d=_0x5d8a4b;if(!_0x4c5f10&&_0xe9df5d[_0x2ee23d(0x1bb)]>0x0&&_0x4684e5[_0x2ee23d(0x1d3)]===0x0){const _0x2f381e=new Set(_0xe9df5d[_0x2ee23d(0x1a8)]((_0x229d1d,_0x410c59)=>({'page':_0x229d1d,'index':_0x410c59}))[_0x2ee23d(0x1ba)](({page:_0xbae4aa})=>!_0x13502c[_0x2ee23d(0x198)](_0xbae4aa['path']))[_0x2ee23d(0x1a8)](({index:_0x5a601e})=>_0x5a601e));_0x6d4b2e(_0x2f381e);}},[_0x4c5f10,_0xe9df5d[_0x5d8a4b(0x1bb)],_0x13502c[_0x5d8a4b(0x1bb)]]),useInput(async(_0x4a7030,_0x2500ba)=>{const _0x15bc93=_0x5d8a4b;if(_0x2d0e16==='selecting'){if(_0x2500ba[_0x15bc93(0x1b3)]){_0x3aabe5(_0x16fe1f=>_0x16fe1f>0x0?_0x16fe1f-0x1:_0xe9df5d[_0x15bc93(0x1bb)]-0x1);return;}if(_0x2500ba[_0x15bc93(0x19c)]){_0x3aabe5(_0x5a814e=>_0x5a814e<_0xe9df5d[_0x15bc93(0x1bb)]-0x1?_0x5a814e+0x1:0x0);return;}if(_0x4a7030==='\x20'){_0x6d4b2e(_0x34d0d3=>{const _0x55aed7=_0x15bc93,_0x21ec42=new Set(_0x34d0d3);return _0x21ec42[_0x55aed7(0x19e)](_0x1c6234)?_0x21ec42['delete'](_0x1c6234):_0x21ec42['add'](_0x1c6234),_0x21ec42;});return;}if(_0x4a7030==='a'||_0x4a7030==='A'){const _0x1dbdbd=new Set(_0xe9df5d['map']((_0xe91244,_0x475b06)=>_0x475b06));_0x6d4b2e(_0x1dbdbd);return;}if(_0x4a7030==='i'||_0x4a7030==='I'||_0x4a7030==='r'||_0x4a7030==='R'){_0x6d4b2e(_0x2a0258=>{const _0x68f4e1=_0x15bc93,_0xb82490=new Set();for(let _0x16e219=0x0;_0x16e219<_0xe9df5d[_0x68f4e1(0x1bb)];_0x16e219++){!_0x2a0258['has'](_0x16e219)&&_0xb82490[_0x68f4e1(0x1bd)](_0x16e219);}return _0xb82490;});return;}if(_0x4a7030==='q'||_0x4a7030==='Q'){_0x80d53d();return;}if(_0x2500ba[_0x15bc93(0x1d5)]){if(_0x4684e5['size']===0x0){_0x230005('请至少选择一个菜单');return;}const _0x354117=_0xe9df5d[_0x15bc93(0x1ba)]((_0x15688f,_0xbe0823)=>_0x4684e5['has'](_0xbe0823)),_0x10c12e=_0x354117[_0x15bc93(0x1a8)](_0xe7b77b=>_0xe7b77b[_0x15bc93(0x1b9)])['join'](',\x20');_0x33d3a3([{'label':_0x15bc93(0x1c5),'value':_0x4684e5[_0x15bc93(0x1d3)]+'\x20个'}]),_0x230005(''),_0x216592('input-js');return;}return;}if(_0x2d0e16==='input-js'){if(_0x2500ba[_0x15bc93(0x1d5)]){const _0x43201d=_0x503312[_0x15bc93(0x19b)]();if(_0x43201d==='')return;if(!isValidJsHttpsUrl(_0x43201d)){_0x230005('请输入有效的\x20JS\x20https\x20链接');return;}if(!await isUrlReachable(_0x43201d)){_0x230005(_0x15bc93(0x1d4));return;}_0x2dfd42(_0x43201d),_0x33d3a3(_0x4efeaa=>[..._0x4efeaa,{'label':'JS\x20链接','value':_0x43201d}]),_0x15f173(''),_0x230005(''),_0x216592('input-css');return;}if(_0x2500ba['backspace']||_0x2500ba['delete']){_0x15f173(_0x4aadd9=>_0x4aadd9[_0x15bc93(0x1b8)](0x0,-0x1)),_0x230005('');return;}_0x15f173(_0x504ada=>_0x504ada+_0x4a7030);return;}if(_0x2d0e16===_0x15bc93(0x1a2)){if(_0x2500ba[_0x15bc93(0x1d5)]){const _0x3b0bfe=_0x503312['trim']();if(_0x3b0bfe==='')return;if(!isValidCssHttpsUrl(_0x3b0bfe)){_0x230005(_0x15bc93(0x1d1));return;}if(!await isUrlReachable(_0x3b0bfe)){_0x230005('CSS\x20链接无法访问');return;}_0x25e6e4(_0x3b0bfe),_0x33d3a3(_0x27a8a2=>[..._0x27a8a2,{'label':_0x15bc93(0x1d2),'value':_0x3b0bfe}]),_0x15f173(''),_0x230005(''),_0x216592(_0x15bc93(0x1ab));const _0x1f6915=_0xe9df5d[_0x15bc93(0x1ba)]((_0x590738,_0x41af4b)=>_0x4684e5[_0x15bc93(0x19e)](_0x41af4b));createMenus(_0x1f6915,[_0x15bb3e,_0x3b0bfe])[_0x15bc93(0x1c8)](()=>{_0x216592('done'),setTimeout(()=>{_0x80d53d();},0x3e8);});return;}if(_0x2500ba['backspace']||_0x2500ba[_0x15bc93(0x1cb)]){_0x15f173(_0x37e22e=>_0x37e22e[_0x15bc93(0x1b8)](0x0,-0x1)),_0x230005('');return;}_0x15f173(_0x126a6c=>_0x126a6c+_0x4a7030);return;}});if(_0x4c5f10)return a10_0x1c1c75(Box,{'marginTop':0x1,'marginBottom':0x1,'children':[a10_0x2f814a(Text,{'children':'\x20\x20'}),a10_0x2f814a(a10_0x3f3e34,{'type':_0x5d8a4b(0x1aa)}),a10_0x2f814a(Text,{'children':_0x5d8a4b(0x1cf)})]});if(_0xe9df5d[_0x5d8a4b(0x1bb)]===0x0)return a10_0x2f814a(Box,{'marginTop':0x1,'marginBottom':0x1,'children':a10_0x2f814a(Text,{'color':_0x5d8a4b(0x1a4),'children':_0x5d8a4b(0x196)})});return a10_0x1c1c75(Box,{'flexDirection':_0x5d8a4b(0x1b7),'marginTop':0x1,'marginBottom':0x1,'children':[_0x2d0e16===_0x5d8a4b(0x1a6)&&a10_0x1c1c75(a10_0x103f0b,{'children':[a10_0x1c1c75(Box,{'children':[a10_0x1c1c75(Text,{'bold':!![],'children':['\x20\x20',_0x5d8a4b(0x1b1),getRemainingSpaces(_0x3b681e,_0x5d8a4b(0x1b1))]}),a10_0x1c1c75(Text,{'bold':!![],'children':['本地',getRemainingSpaces(_0x16905e,'菜单名称')]}),a10_0x1c1c75(Text,{'bold':!![],'children':[_0x5d8a4b(0x1ce),getRemainingSpaces(_0x16905e,_0x5d8a4b(0x1b1))]})]}),_0x493643[_0x5d8a4b(0x1a8)](_0x1eba30=>a10_0x1c1c75(Box,{'children':[a10_0x1c1c75(Text,{'children':['\x20\x20',_0x1eba30[_0x5d8a4b(0x1b9)],getRemainingSpaces(_0x3b681e,_0x1eba30[_0x5d8a4b(0x1b9)])]}),a10_0x1c1c75(Text,{'color':'green','children':[_0x1eba30[_0x5d8a4b(0x1c7)]?'✓':'✗',getRemainingSpaces(_0x16905e,'✓')]}),a10_0x1c1c75(Text,{'color':_0x1eba30[_0x5d8a4b(0x1b0)]?_0x5d8a4b(0x197):_0x5d8a4b(0x1c9),'children':[_0x1eba30[_0x5d8a4b(0x1b0)]?'✓':'✗',getRemainingSpaces(_0x16905e,'✓')]})]},_0x1eba30[_0x5d8a4b(0x1ad)]))]}),_0x2d0e16===_0x5d8a4b(0x1a6)&&_0x1940ed['length']===0x0&&a10_0x2f814a(Box,{'marginTop':0x1,'children':a10_0x2f814a(Text,{'color':_0x5d8a4b(0x1ca),'children':'*\x20同步菜单到\x20Lovrabet\x20平台'})}),_0x1940ed['map']((_0x3d8dd2,_0x58f646)=>a10_0x1c1c75(Box,{'children':[a10_0x1c1c75(Text,{'color':'green','children':['√\x20',_0x3d8dd2[_0x5d8a4b(0x1b9)],':\x20']}),a10_0x2f814a(Text,{'color':_0x5d8a4b(0x1ca),'children':_0x3d8dd2[_0x5d8a4b(0x1a3)]})]},_0x58f646)),_0x2d0e16==='selecting'&&a10_0x1c1c75(a10_0x103f0b,{'children':[a10_0x1c1c75(Box,{'marginTop':_0x1940ed[_0x5d8a4b(0x1bb)]>0x0?0x1:0x0,'flexDirection':_0x5d8a4b(0x1b7),'children':[a10_0x2f814a(Text,{'bold':!![],'children':_0x5d8a4b(0x19d)}),_0xe9df5d[_0x5d8a4b(0x1a8)]((_0xb2d153,_0x1b252c)=>{const _0x5a61cc=_0x5d8a4b,_0x4a9558=_0x1c6234===_0x1b252c,_0x2025c2=_0x4684e5[_0x5a61cc(0x19e)](_0x1b252c),_0x276cff=_0x13502c['includes'](_0xb2d153[_0x5a61cc(0x1ad)]),_0x22e0e6=_0x276cff?'更新':'新建';return a10_0x2f814a(Box,{'children':a10_0x1c1c75(Text,{'backgroundColor':_0x4a9558?_0x5a61cc(0x1c2):undefined,'color':_0x4a9558?'white':undefined,'children':['\x20\x20',_0x2025c2?_0x5a61cc(0x1ae):_0x5a61cc(0x19a),'\x20',_0xb2d153[_0x5a61cc(0x1b9)]]})},_0xb2d153[_0x5a61cc(0x1ad)]);}),a10_0x2f814a(Box,{'marginTop':0x1,'children':a10_0x1c1c75(Text,{'color':'gray','children':['\x20',_0x5d8a4b(0x1b5)]})})]}),_0x1e569f&&a10_0x2f814a(Box,{'children':a10_0x1c1c75(Text,{'color':'red','children':['\x20←\x20',_0x1e569f]})})]}),_0x2d0e16===_0x5d8a4b(0x199)&&a10_0x1c1c75(a10_0x103f0b,{'children':[a10_0x1c1c75(Box,{'children':[a10_0x2f814a(Text,{'children':_0x5d8a4b(0x1a5)}),a10_0x2f814a(Text,{'color':_0x5d8a4b(0x197),'children':_0x503312}),_0x1e569f&&a10_0x1c1c75(Text,{'color':_0x5d8a4b(0x1c9),'children':[_0x5d8a4b(0x1d0),_0x1e569f]})]}),!_0x1e569f&&a10_0x2f814a(Box,{'children':a10_0x2f814a(Text,{'color':_0x5d8a4b(0x1be),'children':_0x5d8a4b(0x1b6)})})]}),_0x2d0e16===_0x5d8a4b(0x1a2)&&a10_0x1c1c75(a10_0x103f0b,{'children':[a10_0x1c1c75(Box,{'children':[a10_0x2f814a(Text,{'children':_0x5d8a4b(0x1c1)}),a10_0x2f814a(Text,{'color':_0x5d8a4b(0x197),'children':_0x503312}),_0x1e569f&&a10_0x1c1c75(Text,{'color':_0x5d8a4b(0x1c9),'children':[_0x5d8a4b(0x1d0),_0x1e569f]})]}),!_0x1e569f&&a10_0x2f814a(Box,{'children':a10_0x2f814a(Text,{'color':_0x5d8a4b(0x1be),'children':'\x20输入项目的\x20CSS\x20资源链接(https://...)'})})]}),_0x2d0e16===_0x5d8a4b(0x1ab)&&a10_0x2f814a(Box,{'children':a10_0x2f814a(Text,{'children':_0x5d8a4b(0x1a1)})}),_0x2d0e16===_0x5d8a4b(0x1cc)&&a10_0x2f814a(Box,{'children':a10_0x2f814a(Text,{'color':'green','children':_0x5d8a4b(0x1c6)})})]});}function getStringWidth(_0x501c20){const _0x319795=a10_0x4d9d0d;let _0x1fe43b=0x0;for(const _0x268e24 of _0x501c20){/[\u4e00-\u9fa5]/[_0x319795(0x1b2)](_0x268e24)?_0x1fe43b+=0x2:_0x1fe43b+=0x1;}return _0x1fe43b;}function getRemainingSpaces(_0x1be6b8,_0x209574){const _0x13da85=a10_0x4d9d0d,_0x161616=getStringWidth(_0x209574);return Array(Math['max'](0x0,_0x1be6b8-_0x161616))[_0x13da85(0x1b4)]('\x20')[_0x13da85(0x1af)]('');}function getMaxWidth(_0x2267c5,_0x93e0cf=0x2){const _0x20df06=a10_0x4d9d0d;let _0x48f73e='',_0x1ce46e=0x0;for(const _0x481216 of _0x2267c5){const _0x21a00d=getStringWidth(_0x481216);_0x21a00d>_0x1ce46e&&(_0x1ce46e=_0x21a00d,_0x48f73e=_0x481216);}return _0x48f73e+'\x20'[_0x20df06(0x1ac)](_0x93e0cf);}
1
+ function a10_0xcc48(_0x51fbbf,_0xe025a0){const _0x455836=a10_0x4558();return a10_0xcc48=function(_0xcc48f4,_0x5d7d43){_0xcc48f4=_0xcc48f4-0x186;let _0xb7d811=_0x455836[_0xcc48f4];return _0xb7d811;},a10_0xcc48(_0x51fbbf,_0xe025a0);}(function(_0x31e04d,_0x3499c0){const _0x13f9c1=a10_0xcc48,_0x453d0b=_0x31e04d();while(!![]){try{const _0x4e40fd=-parseInt(_0x13f9c1(0x1be))/0x1*(-parseInt(_0x13f9c1(0x1c7))/0x2)+parseInt(_0x13f9c1(0x1ca))/0x3*(parseInt(_0x13f9c1(0x1b7))/0x4)+parseInt(_0x13f9c1(0x1c1))/0x5+-parseInt(_0x13f9c1(0x1a2))/0x6*(-parseInt(_0x13f9c1(0x191))/0x7)+parseInt(_0x13f9c1(0x1c9))/0x8+parseInt(_0x13f9c1(0x1c5))/0x9+-parseInt(_0x13f9c1(0x190))/0xa*(parseInt(_0x13f9c1(0x1b3))/0xb);if(_0x4e40fd===_0x3499c0)break;else _0x453d0b['push'](_0x453d0b['shift']());}catch(_0x379a97){_0x453d0b['push'](_0x453d0b['shift']());}}}(a10_0x4558,0xc50df));import{jsx as a10_0x512322,jsxs as a10_0x5966d1,Fragment as a10_0x243571}from'react/jsx-runtime';import{Text,Box,useInput,useApp,render}from'ink';import{useEffect,useState}from'react';import a10_0x45eab2 from'ink-spinner';import{useGetOnlineMenuList}from'./get-online-menu-list.js';import{getLocalPages}from'./get-local-pages.js';import{createMenus}from'./create-menu.js';import{isUrlReachable,isValidCssHttpsUrl,isValidJsHttpsUrl}from'./valid-url.js';import.meta['main']&&render(a10_0x512322(AppMenuSyncUI,{}));export function AppMenuSyncUI(){const _0x3595fc=a10_0xcc48,{exit:_0x2f4251}=useApp(),{loading:_0x5a5794,menuList:_0x4d4a60,error:_0x111d55}=useGetOnlineMenuList(),_0x1f24ab=getLocalPages(),_0x11ee13=_0x4d4a60[_0x3595fc(0x1a7)](_0x41efc0=>_0x41efc0[_0x3595fc(0x1a1)]),_0xacba20=['菜单名称',..._0x1f24ab[_0x3595fc(0x1a7)](_0x12b83d=>_0x12b83d[_0x3595fc(0x18e)])],_0x3176e4=getStringWidth(getMaxWidth(_0xacba20,0x4)),_0x204d4d=getStringWidth(getMaxWidth([_0x3595fc(0x19c)])),[_0x4beb6d,_0x226a9d]=useState(_0x3595fc(0x1a3)),[_0x2e8954,_0x1f5e5b]=useState(new Set()),[_0x50dc5c,_0x5d0002]=useState(0x0),[_0xa1e224,_0x53aa77]=useState(''),[_0x190afd,_0xe37871]=useState(''),[_0x322791,_0x2569ca]=useState(''),[_0x5de83b,_0x3c5069]=useState(''),[_0x36bedb,_0x40c5fe]=useState([]),_0x559b78=_0x1f24ab['map'](_0x56617e=>({'label':_0x56617e[_0x3595fc(0x18e)],'path':_0x56617e[_0x3595fc(0x1a1)],'local':!![],'online':_0x11ee13[_0x3595fc(0x1b9)](_0x56617e['path'])})),_0x4b52ce=_0x1f24ab[_0x3595fc(0x1c6)](_0x1fed42=>{const _0x3d6ad4=_0x3595fc;return!_0x11ee13[_0x3d6ad4(0x1b9)](_0x1fed42[_0x3d6ad4(0x1a1)]);});useEffect(()=>{const _0x6def2c=_0x3595fc;if(!_0x5a5794&&_0x1f24ab[_0x6def2c(0x1ae)]>0x0&&_0x2e8954[_0x6def2c(0x1a9)]===0x0){const _0x42b0a2=new Set(_0x1f24ab[_0x6def2c(0x1a7)]((_0x164a00,_0x5d2167)=>({'page':_0x164a00,'index':_0x5d2167}))['filter'](({page:_0x2b75d9})=>!_0x11ee13[_0x6def2c(0x1b9)](_0x2b75d9[_0x6def2c(0x1a1)]))[_0x6def2c(0x1a7)](({index:_0x3a04ab})=>_0x3a04ab));_0x1f5e5b(_0x42b0a2);}},[_0x5a5794,_0x1f24ab[_0x3595fc(0x1ae)],_0x11ee13['length']]),useInput(async(_0x43dad6,_0x1f65b8)=>{const _0x406fe0=_0x3595fc;if(_0x4beb6d===_0x406fe0(0x1a3)){if(_0x1f65b8[_0x406fe0(0x1a8)]){_0x5d0002(_0x2e396c=>_0x2e396c>0x0?_0x2e396c-0x1:_0x1f24ab['length']-0x1);return;}if(_0x1f65b8[_0x406fe0(0x192)]){_0x5d0002(_0x1f876d=>_0x1f876d<_0x1f24ab[_0x406fe0(0x1ae)]-0x1?_0x1f876d+0x1:0x0);return;}if(_0x43dad6==='\x20'){_0x1f5e5b(_0x42aecf=>{const _0x219ba4=_0x406fe0,_0xfd6377=new Set(_0x42aecf);return _0xfd6377[_0x219ba4(0x187)](_0x50dc5c)?_0xfd6377[_0x219ba4(0x1b0)](_0x50dc5c):_0xfd6377[_0x219ba4(0x19e)](_0x50dc5c),_0xfd6377;});return;}if(_0x43dad6==='a'||_0x43dad6==='A'){const _0x3e9eb9=new Set(_0x1f24ab[_0x406fe0(0x1a7)]((_0x509388,_0x51cc49)=>_0x51cc49));_0x1f5e5b(_0x3e9eb9);return;}if(_0x43dad6==='i'||_0x43dad6==='I'||_0x43dad6==='r'||_0x43dad6==='R'){_0x1f5e5b(_0x23ecf6=>{const _0x44f624=_0x406fe0,_0x4c952d=new Set();for(let _0x47cef5=0x0;_0x47cef5<_0x1f24ab[_0x44f624(0x1ae)];_0x47cef5++){!_0x23ecf6['has'](_0x47cef5)&&_0x4c952d[_0x44f624(0x19e)](_0x47cef5);}return _0x4c952d;});return;}if(_0x43dad6==='q'||_0x43dad6==='Q'){_0x2f4251();return;}if(_0x1f65b8[_0x406fe0(0x1b2)]){if(_0x2e8954[_0x406fe0(0x1a9)]===0x0){_0x3c5069(_0x406fe0(0x1cc));return;}const _0x1e0db8=_0x1f24ab[_0x406fe0(0x1c6)]((_0x2f5858,_0x106ee0)=>_0x2e8954[_0x406fe0(0x187)](_0x106ee0)),_0x664794=_0x1e0db8[_0x406fe0(0x1a7)](_0x19648c=>_0x19648c['label'])['join'](',\x20');_0x40c5fe([{'label':_0x406fe0(0x1bc),'value':_0x2e8954['size']+'\x20个'}]),_0x3c5069(''),_0x226a9d(_0x406fe0(0x1c2));return;}return;}if(_0x4beb6d==='input-js'){if(_0x1f65b8[_0x406fe0(0x1b2)]){const _0x2896b7=_0x322791[_0x406fe0(0x1c8)]();if(_0x2896b7==='')return;if(!isValidJsHttpsUrl(_0x2896b7)){_0x3c5069(_0x406fe0(0x1af));return;}if(!await isUrlReachable(_0x2896b7)){_0x3c5069(_0x406fe0(0x194));return;}_0x53aa77(_0x2896b7),_0x40c5fe(_0x576b6c=>[..._0x576b6c,{'label':_0x406fe0(0x193),'value':_0x2896b7}]),_0x2569ca(''),_0x3c5069(''),_0x226a9d(_0x406fe0(0x1b4));return;}if(_0x1f65b8[_0x406fe0(0x196)]||_0x1f65b8[_0x406fe0(0x1b0)]){_0x2569ca(_0x39e3ba=>_0x39e3ba[_0x406fe0(0x1ac)](0x0,-0x1)),_0x3c5069('');return;}_0x2569ca(_0x6e91b4=>_0x6e91b4+_0x43dad6);return;}if(_0x4beb6d==='input-css'){if(_0x1f65b8[_0x406fe0(0x1b2)]){const _0x219863=_0x322791[_0x406fe0(0x1c8)]();if(_0x219863==='')return;if(!isValidCssHttpsUrl(_0x219863)){_0x3c5069(_0x406fe0(0x1cb));return;}if(!await isUrlReachable(_0x219863)){_0x3c5069('CSS\x20链接无法访问');return;}_0xe37871(_0x219863),_0x40c5fe(_0xcaa1d2=>[..._0xcaa1d2,{'label':_0x406fe0(0x1b6),'value':_0x219863}]),_0x2569ca(''),_0x3c5069(''),_0x226a9d(_0x406fe0(0x1ba));const _0x13ec66=_0x1f24ab[_0x406fe0(0x1c6)]((_0x53320f,_0x1c9017)=>_0x2e8954['has'](_0x1c9017));createMenus(_0x13ec66,[_0xa1e224,_0x219863])[_0x406fe0(0x1a6)](()=>{const _0x41f431=_0x406fe0;_0x226a9d(_0x41f431(0x19a)),setTimeout(()=>{_0x2f4251();},0x3e8);})[_0x406fe0(0x1a5)](_0x4617db=>{const _0x437552=_0x406fe0;_0x3c5069(_0x4617db[_0x437552(0x1a0)]||_0x437552(0x1a4)),_0x226a9d(_0x437552(0x1a3));});return;}if(_0x1f65b8['backspace']||_0x1f65b8[_0x406fe0(0x1b0)]){_0x2569ca(_0x33c082=>_0x33c082[_0x406fe0(0x1ac)](0x0,-0x1)),_0x3c5069('');return;}_0x2569ca(_0x5dace2=>_0x5dace2+_0x43dad6);return;}});if(_0x5a5794)return a10_0x5966d1(Box,{'marginTop':0x1,'marginBottom':0x1,'children':[a10_0x512322(Text,{'children':'\x20\x20'}),a10_0x512322(a10_0x45eab2,{'type':_0x3595fc(0x18d)}),a10_0x512322(Text,{'children':'\x20正在获取线上菜单列表...'})]});if(_0x111d55)return a10_0x5966d1(Box,{'flexDirection':_0x3595fc(0x18b),'marginTop':0x1,'marginBottom':0x1,'children':[a10_0x5966d1(Text,{'color':'red','children':['✗\x20',_0x111d55]}),a10_0x5966d1(Box,{'marginTop':0x1,'children':[a10_0x512322(Text,{'color':_0x3595fc(0x186),'children':'提示:使用\x20'}),a10_0x512322(Text,{'color':'cyan','children':'lovrabet\x20auth'}),a10_0x512322(Text,{'color':_0x3595fc(0x186),'children':_0x3595fc(0x1b5)})]})]});if(_0x1f24ab[_0x3595fc(0x1ae)]===0x0)return a10_0x512322(Box,{'marginTop':0x1,'marginBottom':0x1,'children':a10_0x512322(Text,{'color':_0x3595fc(0x199),'children':_0x3595fc(0x1aa)})});return a10_0x5966d1(Box,{'flexDirection':_0x3595fc(0x18b),'marginTop':0x1,'marginBottom':0x1,'children':[_0x4beb6d==='selecting'&&a10_0x5966d1(a10_0x243571,{'children':[a10_0x5966d1(Box,{'children':[a10_0x5966d1(Text,{'bold':!![],'children':['\x20\x20',_0x3595fc(0x19c),getRemainingSpaces(_0x3176e4,'菜单名称')]}),a10_0x5966d1(Text,{'bold':!![],'children':['本地',getRemainingSpaces(_0x204d4d,'菜单名称')]}),a10_0x5966d1(Text,{'bold':!![],'children':[_0x3595fc(0x19d),getRemainingSpaces(_0x204d4d,'菜单名称')]})]}),_0x559b78[_0x3595fc(0x1a7)](_0x38debe=>a10_0x5966d1(Box,{'children':[a10_0x5966d1(Text,{'children':['\x20\x20',_0x38debe[_0x3595fc(0x18e)],getRemainingSpaces(_0x3176e4,_0x38debe[_0x3595fc(0x18e)])]}),a10_0x5966d1(Text,{'color':_0x3595fc(0x188),'children':[_0x38debe[_0x3595fc(0x1bb)]?'✓':'✗',getRemainingSpaces(_0x204d4d,'✓')]}),a10_0x5966d1(Text,{'color':_0x38debe[_0x3595fc(0x18a)]?'green':_0x3595fc(0x1c3),'children':[_0x38debe[_0x3595fc(0x18a)]?'✓':'✗',getRemainingSpaces(_0x204d4d,'✓')]})]},_0x38debe[_0x3595fc(0x1a1)]))]}),_0x4beb6d===_0x3595fc(0x1a3)&&_0x36bedb[_0x3595fc(0x1ae)]===0x0&&a10_0x512322(Box,{'marginTop':0x1,'children':a10_0x512322(Text,{'color':_0x3595fc(0x1b1),'children':_0x3595fc(0x18f)})}),_0x36bedb[_0x3595fc(0x1a7)]((_0x40dff4,_0x3ec1ca)=>a10_0x5966d1(Box,{'children':[a10_0x5966d1(Text,{'color':_0x3595fc(0x188),'children':['√\x20',_0x40dff4['label'],':\x20']}),a10_0x512322(Text,{'color':_0x3595fc(0x1b1),'children':_0x40dff4[_0x3595fc(0x19f)]})]},_0x3ec1ca)),_0x5de83b&&_0x4beb6d===_0x3595fc(0x1a3)&&a10_0x512322(Box,{'marginTop':0x1,'children':a10_0x5966d1(Text,{'color':_0x3595fc(0x1c3),'children':['✗\x20',_0x5de83b]})}),_0x4beb6d===_0x3595fc(0x1a3)&&a10_0x512322(a10_0x243571,{'children':a10_0x5966d1(Box,{'marginTop':_0x36bedb[_0x3595fc(0x1ae)]>0x0||_0x5de83b?0x1:0x0,'flexDirection':_0x3595fc(0x18b),'children':[a10_0x512322(Text,{'bold':!![],'children':_0x3595fc(0x198)}),_0x1f24ab[_0x3595fc(0x1a7)]((_0x3d5d70,_0x16c424)=>{const _0x3d5514=_0x3595fc,_0x12b46a=_0x50dc5c===_0x16c424,_0x14cacf=_0x2e8954[_0x3d5514(0x187)](_0x16c424),_0x3dbc74=_0x11ee13[_0x3d5514(0x1b9)](_0x3d5d70[_0x3d5514(0x1a1)]),_0x33db76=_0x3dbc74?'更新':'新建';return a10_0x512322(Box,{'children':a10_0x5966d1(Text,{'backgroundColor':_0x12b46a?_0x3d5514(0x18c):undefined,'color':_0x12b46a?_0x3d5514(0x1ad):undefined,'children':['\x20\x20',_0x14cacf?_0x3d5514(0x195):_0x3d5514(0x1ab),'\x20',_0x3d5d70['label']]})},_0x3d5d70[_0x3d5514(0x1a1)]);}),a10_0x512322(Box,{'marginTop':0x1,'children':a10_0x5966d1(Text,{'color':_0x3595fc(0x186),'children':['\x20',_0x3595fc(0x19b)]})})]})}),_0x4beb6d===_0x3595fc(0x1c2)&&a10_0x5966d1(a10_0x243571,{'children':[a10_0x5966d1(Box,{'children':[a10_0x512322(Text,{'children':'*\x20JS\x20链接:\x20'}),a10_0x512322(Text,{'color':_0x3595fc(0x188),'children':_0x322791}),_0x5de83b&&a10_0x5966d1(Text,{'color':_0x3595fc(0x1c3),'children':[_0x3595fc(0x1c0),_0x5de83b]})]}),!_0x5de83b&&a10_0x512322(Box,{'children':a10_0x512322(Text,{'color':_0x3595fc(0x186),'children':'\x20输入项目的\x20JS\x20资源链接(https://...)'})})]}),_0x4beb6d===_0x3595fc(0x1b4)&&a10_0x5966d1(a10_0x243571,{'children':[a10_0x5966d1(Box,{'children':[a10_0x512322(Text,{'children':_0x3595fc(0x1b8)}),a10_0x512322(Text,{'color':'green','children':_0x322791}),_0x5de83b&&a10_0x5966d1(Text,{'color':_0x3595fc(0x1c3),'children':[_0x3595fc(0x1c0),_0x5de83b]})]}),!_0x5de83b&&a10_0x512322(Box,{'children':a10_0x512322(Text,{'color':_0x3595fc(0x186),'children':_0x3595fc(0x189)})})]}),_0x4beb6d===_0x3595fc(0x1ba)&&a10_0x512322(Box,{'children':a10_0x512322(Text,{'children':_0x3595fc(0x197)})}),_0x4beb6d===_0x3595fc(0x19a)&&a10_0x512322(Box,{'children':a10_0x512322(Text,{'color':_0x3595fc(0x188),'children':_0x3595fc(0x1bd)})})]});}function getStringWidth(_0x58e85a){let _0x5782a0=0x0;for(const _0x53aba1 of _0x58e85a){/[\u4e00-\u9fa5]/['test'](_0x53aba1)?_0x5782a0+=0x2:_0x5782a0+=0x1;}return _0x5782a0;}function getRemainingSpaces(_0x38cee9,_0x585d4c){const _0x337b27=a10_0xcc48,_0x393897=getStringWidth(_0x585d4c);return Array(Math['max'](0x0,_0x38cee9-_0x393897))[_0x337b27(0x1bf)]('\x20')[_0x337b27(0x1c4)]('');}function getMaxWidth(_0x3ce67a,_0x4dba67=0x2){let _0x57b6e4='',_0x34d133=0x0;for(const _0x100f65 of _0x3ce67a){const _0x48b272=getStringWidth(_0x100f65);_0x48b272>_0x34d133&&(_0x34d133=_0x48b272,_0x57b6e4=_0x100f65);}return _0x57b6e4+'\x20'['repeat'](_0x4dba67);}function a10_0x4558(){const _0x369591=['请输入有效的\x20JS\x20https\x20链接','delete','cyan','return','11lSRXop','input-css','\x20命令重新登录','CSS\x20链接','17580vvbICS','*\x20CSS\x20链接:\x20','includes','creating','local','已选择菜单','√\x20菜单创建完成','1075967ygHIVM','fill','\x20←\x20','1686395ZDpwSR','input-js','red','join','14492916miwfYe','filter','2KuCSYU','trim','11647784LbNNTN','366KpytVw','请输入有效的\x20CSS\x20https\x20链接','请至少选择一个菜单','gray','has','green','\x20输入项目的\x20CSS\x20资源链接(https://...)','online','column','blue','dots','label','*\x20同步菜单到\x20Lovrabet\x20平台','51905010JLnMxt','1547aPmLjq','downArrow','JS\x20链接','JS\x20链接无法访问','[✓]','backspace','*\x20正在创建菜单...','*\x20请选择要同步的菜单:','yellow','done','↑/↓:\x20移动光标\x20空格:\x20切换选中\x20a:\x20全选\x20i/r:\x20反选\x20Enter:\x20确认','菜单名称','Lovrabet平台','add','value','message','path','26658LJBPSN','selecting','创建菜单失败','catch','then','map','upArrow','size','!\x20未找到本地页面,请先创建页面','[\x20]','slice','white','length'];a10_0x4558=function(){return _0x369591;};return a10_0x4558();}
@@ -1 +1 @@
1
- (function(_0x13856c,_0x3b402c){const _0x5a50a1=a11_0x1d26,_0x124626=_0x13856c();while(!![]){try{const _0x428386=parseInt(_0x5a50a1(0xce))/0x1*(-parseInt(_0x5a50a1(0xd7))/0x2)+parseInt(_0x5a50a1(0xd1))/0x3+-parseInt(_0x5a50a1(0xc8))/0x4*(-parseInt(_0x5a50a1(0xc1))/0x5)+-parseInt(_0x5a50a1(0xcd))/0x6+parseInt(_0x5a50a1(0xd3))/0x7+parseInt(_0x5a50a1(0xc6))/0x8*(-parseInt(_0x5a50a1(0xc0))/0x9)+-parseInt(_0x5a50a1(0xbf))/0xa;if(_0x428386===_0x3b402c)break;else _0x124626['push'](_0x124626['shift']());}catch(_0x3dfa2c){_0x124626['push'](_0x124626['shift']());}}}(a11_0x3fca,0xe2fee));function a11_0x1d26(_0x38acd8,_0x2f46a8){const _0x3fca43=a11_0x3fca();return a11_0x1d26=function(_0x1d268d,_0x2d56e7){_0x1d268d=_0x1d268d-0xbd;let _0x3c9b16=_0x3fca43[_0x1d268d];return _0x3c9b16;},a11_0x1d26(_0x38acd8,_0x2f46a8);}import{getCookie}from'../auth/get-cookie.js';import{getApiDomain}from'../constant/domain.js';import{readConfig}from'../utils/config.js';const config=readConfig();export async function createMenu(_0x3faa88){const _0x271ed4=a11_0x1d26,_0x5b5b71=config?.[_0x271ed4(0xd6)];if(!_0x5b5b71){console[_0x271ed4(0xd2)](_0x271ed4(0xd4)),console[_0x271ed4(0xc3)](_0x271ed4(0xbe)),console['log'](_0x271ed4(0xcc)),console['log'](_0x271ed4(0xc4));return;}const _0x14ed37={'appCode':_0x5b5b71,'type':'procode','sort':0x0,'extend':{'loadScriptMode':_0x271ed4(0xcf),'resources':_0x3faa88['resources']?JSON[_0x271ed4(0xd0)](_0x3faa88['resources']):undefined},..._0x3faa88},_0x5ad176=await fetch(getApiDomain()+_0x271ed4(0xcb),{'method':_0x271ed4(0xc5),'body':JSON[_0x271ed4(0xd0)](_0x14ed37),'headers':{'Content-Type':'application/json','Cookie':getCookie()}});_0x5ad176['ok']&&console['log'](_0x271ed4(0xca),await _0x5ad176['json']());}async function _createMenu(_0x3d6767,_0x34d1be){const _0x47fa7b=a11_0x1d26,_0x3af777=config?.[_0x47fa7b(0xd6)];if(!_0x3af777){console['error']('×\x20未提供应用AppCode,且配置中也没有默认值'),console[_0x47fa7b(0xc3)](_0x47fa7b(0xbe)),console[_0x47fa7b(0xc3)]('\x20\x20\x201.\x20直接指定:\x20lovrabet\x20api\x20pull\x20<app-code>'),console[_0x47fa7b(0xc3)](_0x47fa7b(0xc4));return;}const _0x4b2304={'appCode':_0x3af777,'type':'procode','sort':0x0,'extend':{'loadScriptMode':_0x47fa7b(0xcf),'resources':_0x34d1be?JSON[_0x47fa7b(0xd0)](_0x34d1be):undefined},'label':_0x3d6767[_0x47fa7b(0xc2)],'path':_0x3d6767[_0x47fa7b(0xbd)]},_0xd1db0a=await fetch(getApiDomain()+_0x47fa7b(0xcb),{'method':_0x47fa7b(0xc5),'body':JSON[_0x47fa7b(0xd0)](_0x4b2304),'headers':{'Content-Type':_0x47fa7b(0xc7),'Cookie':getCookie()}});}function a11_0x3fca(){const _0x4f1864=['9vZiaEN','702070aeflDm','label','log','\x20\x20\x202.\x20配置默认值:\x20lovrabet\x20config\x20set\x20app\x20<app-code>','POST','1103048uxDoND','application/json','44wHbgVf','all','创建菜单结果:','/smartapi/menu/create','\x20\x20\x201.\x20直接指定:\x20lovrabet\x20api\x20pull\x20<app-code>','4774614kHvYAg','24240SYBsft','import','stringify','4285782rymSpw','error','11257281MhRMmA','×\x20未提供应用AppCode,且配置中也没有默认值','map','appcode','118YreQgc','path','!\x20请使用以下方式之一:','12877470ZriPXO'];a11_0x3fca=function(){return _0x4f1864;};return a11_0x3fca();}export async function createMenus(_0x2e8401,_0xf9a4ba){const _0x8ef9d7=a11_0x1d26;await Promise[_0x8ef9d7(0xc9)](_0x2e8401[_0x8ef9d7(0xd5)](async _0x47f6c4=>{await _createMenu(_0x47f6c4,_0xf9a4ba);}));}
1
+ (function(_0x2118d2,_0x32af37){const _0x433f46=a11_0x5215,_0x5a95ae=_0x2118d2();while(!![]){try{const _0x271a3f=-parseInt(_0x433f46(0xc6))/0x1*(-parseInt(_0x433f46(0xe2))/0x2)+-parseInt(_0x433f46(0xc4))/0x3*(-parseInt(_0x433f46(0xdc))/0x4)+parseInt(_0x433f46(0xe6))/0x5*(parseInt(_0x433f46(0xec))/0x6)+parseInt(_0x433f46(0xd4))/0x7*(-parseInt(_0x433f46(0xd3))/0x8)+parseInt(_0x433f46(0xe7))/0x9*(-parseInt(_0x433f46(0xc8))/0xa)+-parseInt(_0x433f46(0xef))/0xb+-parseInt(_0x433f46(0xdf))/0xc*(-parseInt(_0x433f46(0xde))/0xd);if(_0x271a3f===_0x32af37)break;else _0x5a95ae['push'](_0x5a95ae['shift']());}catch(_0x59bf4c){_0x5a95ae['push'](_0x5a95ae['shift']());}}}(a11_0x3bf0,0xd43e8));import{getCookie}from'../auth/get-cookie.js';import{getApiDomain}from'../constant/domain.js';import{readConfig}from'../utils/config.js';import{logger}from'../utils/logger.js';const config=readConfig();function a11_0x5215(_0x44865e,_0x5386f0){const _0x3bf0a3=a11_0x3bf0();return a11_0x5215=function(_0x52154a,_0xfca501){_0x52154a=_0x52154a-0xc3;let _0x36607a=_0x3bf0a3[_0x52154a];return _0x36607a;},a11_0x5215(_0x44865e,_0x5386f0);}export async function createMenu(_0x471910){const _0x92278=a11_0x5215,_0x278c8=config?.['appcode'];if(!_0x278c8){const _0x37268c=_0x92278(0xd9);logger[_0x92278(0xd8)](_0x92278(0xf3),_0x37268c),console[_0x92278(0xd8)]('×\x20'+_0x37268c),console['log'](_0x92278(0xd7)),console[_0x92278(0xdd)](_0x92278(0xd5)),console[_0x92278(0xdd)](_0x92278(0xcc));return;}logger[_0x92278(0xc3)](_0x92278(0xf3),_0x92278(0xe9)+_0x471910[_0x92278(0xd2)]+'\x20('+_0x471910[_0x92278(0xe5)]+')');const _0x1c45f2={'appCode':_0x278c8,'type':'procode','sort':0x0,'extend':{'loadScriptMode':'import','resources':_0x471910['resources']?JSON[_0x92278(0xcb)](_0x471910[_0x92278(0xce)]):undefined},..._0x471910},_0x270530=await fetch(getApiDomain()+'/smartapi/menu/create',{'method':'POST','body':JSON[_0x92278(0xcb)](_0x1c45f2),'headers':{'Content-Type':_0x92278(0xda),'Cookie':getCookie()}});if(!_0x270530['ok']){if(_0x270530[_0x92278(0xd0)]===0x191){const _0x4a5861=_0x92278(0xeb);logger[_0x92278(0xd8)](_0x92278(0xf3),_0x4a5861,{'status':_0x270530[_0x92278(0xd0)],'menu':_0x471910[_0x92278(0xd2)]});throw new Error(_0x4a5861);}const _0x524167='创建菜单失败,HTTP状态码:\x20'+_0x270530[_0x92278(0xd0)];logger[_0x92278(0xd8)](_0x92278(0xf3),_0x524167,{'menu':_0x471910[_0x92278(0xd2)]});throw new Error(_0x524167);}const _0x161753=await _0x270530[_0x92278(0xd1)]();if(!_0x161753['success']){const _0x532ab1=_0x92278(0xf1)+(_0x161753[_0x92278(0xe4)]||_0x92278(0xca));logger['error'](_0x92278(0xf3),_0x532ab1,{'errorCode':_0x161753['errorCode'],'errorMsg':_0x161753[_0x92278(0xe4)],'menu':_0x471910[_0x92278(0xd2)]});throw new Error(_0x532ab1);}logger[_0x92278(0xc3)]('create-menu',_0x92278(0xc5)+_0x471910[_0x92278(0xd2)],_0x161753[_0x92278(0xe3)]),console[_0x92278(0xdd)](_0x92278(0xea),_0x161753[_0x92278(0xe3)]);}async function _createMenu(_0x1ab825,_0x463128){const _0x190d77=a11_0x5215,_0x5428ff=config?.[_0x190d77(0xd6)];if(!_0x5428ff){const _0xe85db1=_0x190d77(0xd9);logger['error'](_0x190d77(0xf3),_0xe85db1),console[_0x190d77(0xd8)]('×\x20'+_0xe85db1),console[_0x190d77(0xdd)]('!\x20请使用以下方式之一:'),console['log'](_0x190d77(0xd5)),console['log'](_0x190d77(0xcc));return;}const _0xf434fe={'appCode':_0x5428ff,'type':'procode','sort':0x0,'extend':{'loadScriptMode':_0x190d77(0xf2),'resources':_0x463128?JSON[_0x190d77(0xcb)](_0x463128):undefined},'label':_0x1ab825['label'],'path':_0x1ab825[_0x190d77(0xe5)]},_0x1a8e24=await fetch(getApiDomain()+_0x190d77(0xe8),{'method':_0x190d77(0xdb),'body':JSON[_0x190d77(0xcb)](_0xf434fe),'headers':{'Content-Type':_0x190d77(0xda),'Cookie':getCookie()}});if(!_0x1a8e24['ok']){if(_0x1a8e24['status']===0x191){const _0x175d2d=_0x190d77(0xeb);logger['error']('create-menu',_0x175d2d,{'status':_0x1a8e24[_0x190d77(0xd0)],'menu':_0x1ab825[_0x190d77(0xd2)]});throw new Error(_0x175d2d);}const _0x5c32e6='创建菜单失败,HTTP状态码:\x20'+_0x1a8e24['status'];logger[_0x190d77(0xd8)](_0x190d77(0xf3),_0x5c32e6,{'menu':_0x1ab825[_0x190d77(0xd2)]});throw new Error(_0x5c32e6);}const _0x28b20f=await _0x1a8e24['json']();if(!_0x28b20f[_0x190d77(0xed)]){if(_0x28b20f[_0x190d77(0xcd)]===_0x190d77(0xe0)||_0x28b20f[_0x190d77(0xe4)]?.[_0x190d77(0xc9)]('登录')){const _0xe7ef8d=_0x190d77(0xe1);logger['error']('create-menu',_0xe7ef8d,{'errorCode':_0x28b20f[_0x190d77(0xcd)],'errorMsg':_0x28b20f[_0x190d77(0xe4)],'menu':_0x1ab825[_0x190d77(0xd2)]});throw new Error(_0xe7ef8d);}const _0x336b97=_0x190d77(0xf1)+(_0x28b20f['errorMsg']||_0x190d77(0xca));logger[_0x190d77(0xd8)](_0x190d77(0xf3),_0x336b97,{'errorCode':_0x28b20f[_0x190d77(0xcd)],'errorMsg':_0x28b20f[_0x190d77(0xe4)],'menu':_0x1ab825[_0x190d77(0xd2)]});throw new Error(_0x336b97);}logger[_0x190d77(0xc3)](_0x190d77(0xf3),_0x190d77(0xc5)+_0x1ab825[_0x190d77(0xd2)]);}function a11_0x3bf0(){const _0x4c656a=['json','label','22024JuKmRA','182kkEvFC','\x20\x20\x201.\x20直接指定:\x20lovrabet\x20api\x20pull\x20<app-code>','appcode','!\x20请使用以下方式之一:','error','未提供应用AppCode,且配置中也没有默认值','application/json','POST','219284raFmDE','log','22488401tsWADO','12zRNwNh','0011','登录态校验失败,请使用\x20lovrabet\x20auth\x20重新登录','206jRXoET','data','errorMsg','path','3270035NFPRiR','144xXdmFZ','/smartapi/menu/create','正在创建菜单:\x20','创建菜单成功:','登录鉴权失败,登录已过期,请使用\x20lovrabet\x20auth\x20重新登录','6VYRHAK','success','length','6755958VdjfMB','all','创建菜单失败:\x20','import','create-menu','info','15VXfDJf','菜单创建成功:\x20','41daFKEA','开始批量创建菜单,共\x20','691940QjZPTW','includes','未知错误','stringify','\x20\x20\x202.\x20配置默认值:\x20lovrabet\x20config\x20set\x20app\x20<app-code>','errorCode','resources','create-menus','status'];a11_0x3bf0=function(){return _0x4c656a;};return a11_0x3bf0();}export async function createMenus(_0x276e1b,_0x6276ae){const _0x4ed62a=a11_0x5215;logger[_0x4ed62a(0xc3)]('create-menus',_0x4ed62a(0xc7)+_0x276e1b[_0x4ed62a(0xee)]+'\x20个'),await Promise[_0x4ed62a(0xf0)](_0x276e1b['map'](async _0x4cff34=>{await _createMenu(_0x4cff34,_0x6276ae);})),logger[_0x4ed62a(0xc3)](_0x4ed62a(0xcf),'批量创建菜单完成,共\x20'+_0x276e1b[_0x4ed62a(0xee)]+'\x20个');}