@lovrabet/cli 1.1.16 → 1.1.18

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 (55) 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 -0
  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/utils/config.js +1 -1
  45. package/lib/utils/copy-directory.js +1 -1
  46. package/lib/utils/http-client.js +1 -1
  47. package/lib/utils/logger.js +1 -1
  48. package/lib/utils/router-updater.js +1 -1
  49. package/lib/utils/sleep.js +1 -1
  50. package/lib/utils/template-replacer.js +1 -1
  51. package/package.json +1 -1
  52. package/lib/api/fetch-datasets.js +0 -1
  53. package/lib/api/format-dataset.js +0 -1
  54. package/lib/api/pull.js +0 -1
  55. package/lib/api/types.js +0 -1
@@ -1 +1 @@
1
- (function(_0x40ec6a,_0x21660d){const _0x304e2d=a0_0x59c8,_0x562a31=_0x40ec6a();while(!![]){try{const _0x16e6b8=-parseInt(_0x304e2d(0x12e))/0x1+parseInt(_0x304e2d(0x136))/0x2*(-parseInt(_0x304e2d(0x122))/0x3)+parseInt(_0x304e2d(0x12c))/0x4+parseInt(_0x304e2d(0x127))/0x5*(parseInt(_0x304e2d(0x13a))/0x6)+parseInt(_0x304e2d(0x139))/0x7+-parseInt(_0x304e2d(0x131))/0x8*(parseInt(_0x304e2d(0x12a))/0x9)+parseInt(_0x304e2d(0x137))/0xa;if(_0x16e6b8===_0x21660d)break;else _0x562a31['push'](_0x562a31['shift']());}catch(_0x1270ea){_0x562a31['push'](_0x562a31['shift']());}}}(a0_0x3204,0xc9dee));import{jsx as a0_0x5d7857,jsxs as a0_0x3a6988}from'react/jsx-runtime';function a0_0x3204(){const _0x148432=['my-page','existsSync','green','路径不能以\x20/\x20开头或结尾','5ZcgTIn','includes','页面路径长度不能超过\x20100\x20个字符','9EJPIDR','trim','461096tFWrAY','路径中的每个段只能以字母或数字开头,且只包含字母、数字、-\x20和\x20_','640825PDGXjF','test','return','4834344xfojGs','length','gray','split','slice','129468UdWoSK','15056320bjYXfU','\x20←\x20','3959179OupoCt','6304134FVCnEy','delete','\x20已存在,请使用其他路径','页面路径不合法','\x20Step2:\x20','路径不能包含连续的\x20/','页面路由地址:\x20','startsWith','endsWith','backspace','54aldvbm'];a0_0x3204=function(){return _0x148432;};return a0_0x3204();}function a0_0x59c8(_0x6ef2da,_0xfce13){const _0x32049e=a0_0x3204();return a0_0x59c8=function(_0x59c82a,_0x2537b2){_0x59c82a=_0x59c82a-0x11a;let _0x2f7a07=_0x32049e[_0x59c82a];return _0x2f7a07;},a0_0x59c8(_0x6ef2da,_0xfce13);}import{useState}from'react';import{Text,Box,useInput}from'ink';import a0_0x5574c9 from'node:fs';export function InputProjectCode(_0x2632ec){const _0x27fe48=a0_0x59c8,{onSubmit:_0x39a85e,pagePath:_0x2ee15e}=_0x2632ec,[_0x4c9a1c,_0x2380c8]=useState(''),[_0x18c6cf,_0x1f2a39]=useState(''),_0xd81c48=_0x27fe48(0x123);function _0x1e6d47(_0x9ac2cf){const _0x527206=_0x27fe48;if(_0x9ac2cf[_0x527206(0x132)]>0x64)return{'valid':![],'message':_0x527206(0x129)};if(_0x9ac2cf[_0x527206(0x11f)]('/')||_0x9ac2cf[_0x527206(0x120)]('/'))return{'valid':![],'message':_0x527206(0x126)};if(_0x9ac2cf[_0x527206(0x128)]('//'))return{'valid':![],'message':_0x527206(0x11d)};const _0x409b8d=_0x9ac2cf[_0x527206(0x134)]('/');for(const _0x121fc6 of _0x409b8d){if(!_0x121fc6)continue;const _0x1dbfbf=/^[A-Za-z0-9][A-Za-z0-9_-]*$/;if(!_0x1dbfbf[_0x527206(0x12f)](_0x121fc6))return{'valid':![],'message':_0x527206(0x12d)};}return{'valid':!![]};}return useInput((_0x122922,_0x1ad5c2)=>{const _0x3ebc1e=_0x27fe48;if(_0x1ad5c2[_0x3ebc1e(0x130)]){const _0x30ff66=_0x4c9a1c[_0x3ebc1e(0x12b)]()||_0xd81c48;if(_0x18c6cf)return;const _0x144bee=_0x2ee15e+'/'+_0x30ff66;if(a0_0x5574c9[_0x3ebc1e(0x124)](_0x144bee)){_0x1f2a39('页面路径\x20'+_0x30ff66+_0x3ebc1e(0x11a));return;}_0x39a85e(_0x30ff66),_0x2380c8(''),_0x1f2a39('');}else _0x1ad5c2[_0x3ebc1e(0x121)]||_0x1ad5c2[_0x3ebc1e(0x13b)]?_0x2380c8(_0x5984e2=>{const _0x4e6cd3=_0x3ebc1e,_0x179a8c=_0x5984e2[_0x4e6cd3(0x135)](0x0,-0x1),{valid:_0x196233,message:_0x137ba2}=_0x1e6d47(_0x179a8c);return _0x1f2a39(_0x196233?'':_0x137ba2||_0x4e6cd3(0x11b)),_0x179a8c;}):_0x2380c8(_0xf72d22=>{const _0x4894eb=_0x3ebc1e,_0x14aecb=_0xf72d22+_0x122922,{valid:_0x118688,message:_0x3a210d}=_0x1e6d47(_0x14aecb);return _0x1f2a39(_0x118688?'':_0x3a210d||_0x4894eb(0x11b)),_0x14aecb;});}),a0_0x3a6988(Box,{'flexDirection':'column','children':[a0_0x3a6988(Box,{'children':[a0_0x5d7857(Text,{'color':_0x27fe48(0x133),'children':_0x27fe48(0x11c)}),a0_0x5d7857(Text,{'children':_0x27fe48(0x11e)}),_0x4c9a1c?a0_0x5d7857(Text,{'color':_0x27fe48(0x125),'children':_0x4c9a1c}):a0_0x5d7857(Text,{'color':'gray','children':_0xd81c48}),_0x18c6cf&&a0_0x3a6988(Text,{'color':'red','children':[_0x27fe48(0x138),_0x18c6cf]})]}),!_0x18c6cf&&!_0x4c9a1c&&a0_0x5d7857(Box,{'children':a0_0x5d7857(Text,{'color':_0x27fe48(0x133),'children':'\x20直接回车确认,或输入自定义路由地址'})})]});}
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 +1 @@
1
- const a1_0x4b5cdb=a1_0x10db;(function(_0x530d79,_0xd356a7){const _0x1c86b9=a1_0x10db,_0x291f6a=_0x530d79();while(!![]){try{const _0x31c8f0=parseInt(_0x1c86b9(0x20e))/0x1+-parseInt(_0x1c86b9(0x1ea))/0x2*(-parseInt(_0x1c86b9(0x207))/0x3)+-parseInt(_0x1c86b9(0x20c))/0x4*(parseInt(_0x1c86b9(0x20b))/0x5)+parseInt(_0x1c86b9(0x1f6))/0x6+-parseInt(_0x1c86b9(0x1fb))/0x7+-parseInt(_0x1c86b9(0x209))/0x8*(-parseInt(_0x1c86b9(0x1f8))/0x9)+-parseInt(_0x1c86b9(0x1ee))/0xa*(parseInt(_0x1c86b9(0x1f0))/0xb);if(_0x31c8f0===_0xd356a7)break;else _0x291f6a['push'](_0x291f6a['shift']());}catch(_0x41872f){_0x291f6a['push'](_0x291f6a['shift']());}}}(a1_0x4909,0x3df85));import{jsx as a1_0x35604c,jsxs as a1_0x4d4df3,Fragment as a1_0x5565d2}from'react/jsx-runtime';import{fileURLToPath}from'node:url';import a1_0x24f5b6 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';function a1_0x10db(_0x459902,_0x2e13aa){const _0x490982=a1_0x4909();return a1_0x10db=function(_0x10dbd8,_0x3ec95e){_0x10dbd8=_0x10dbd8-0x1e7;let _0x2611fe=_0x490982[_0x10dbd8];return _0x2611fe;},a1_0x10db(_0x459902,_0x2e13aa);}function a1_0x4909(){const _0x418b47=['now','add-page','column','resolve','\x20*\x20页面创建成功!','success','dirname','已选择页面模板\x20','cyan','green','83151jdOgtn','cwd','140824kshhpi','\x20*\x20页面文件已创建,可直接通过路由访问','5jbEcKy','184432WlqSUl','error','121321tddInW','catch','message','gray','2hdZnuk','finally','pages','info','2380830aZUtfK','processTemplate','11xoBgtn','已输入的页面路由\x20','页面添加成功:\x20','\x20*\x20路由地址:\x20','\x20*\x20页面路径:\x20','join','1246782HizILL','开始添加页面:\x20','171eMkaPa','url','then','1072904GDYiFO','src'];a1_0x4909=function(){return _0x418b47;};return a1_0x4909();}const __dirname=a1_0x24f5b6[a1_0x4b5cdb(0x203)](fileURLToPath(import.meta[a1_0x4b5cdb(0x1f9)])),pageTemplateDir=a1_0x24f5b6['resolve'](__dirname,'../../templates/pages'),projectDir=process[a1_0x4b5cdb(0x208)]();export const AddPage=()=>{const _0x412040=a1_0x4b5cdb,{exit:_0x476bdf}=useApp(),[_0x54fc71,_0x36f33b]=useState(''),[_0x510529,_0x45ce6f]=useState(''),[_0x4d10e5,_0x19d478]=useState(![]),[_0x5027d2,_0x5d2512]=useState(![]),_0x47a5b6=a1_0x24f5b6[_0x412040(0x1f5)](projectDir,_0x412040(0x1fc),_0x412040(0x1ec)),_0x2591e7=a1_0x24f5b6[_0x412040(0x1f5)](_0x47a5b6,_0x510529),_0x6f2adf=a1_0x24f5b6[_0x412040(0x1f5)]('src',_0x412040(0x1ec),_0x510529);useEffect(()=>{const _0x55781a=_0x412040,_0x4c76d0=a1_0x24f5b6[_0x55781a(0x200)](pageTemplateDir,_0x54fc71);if(_0x54fc71&&_0x510529){_0x19d478(!![]),logger['setLogPath'](process[_0x55781a(0x208)]());const _0x14b046=Date['now']();logger[_0x55781a(0x1ed)](_0x55781a(0x1fe),_0x55781a(0x1f7)+_0x510529,{'template':_0x54fc71,'targetPath':_0x6f2adf}),TemplateReplacer[_0x55781a(0x1ef)](_0x4c76d0,a1_0x24f5b6[_0x55781a(0x1f5)](_0x47a5b6,_0x510529),_0x510529,_0x54fc71)[_0x55781a(0x1fa)](()=>{const _0x3ae264=_0x55781a,_0x5c49d6=Date[_0x3ae264(0x1fd)]()-_0x14b046;logger[_0x3ae264(0x202)]('add-page',_0x3ae264(0x1f2)+_0x510529,_0x5c49d6,{'template':_0x54fc71,'targetPath':_0x6f2adf,'routePath':_0x510529}),_0x5d2512(!![]);})[_0x55781a(0x1e7)](_0x4aab7d=>{const _0x4a537e=_0x55781a,_0x370816=Date['now']()-_0x14b046;logger[_0x4a537e(0x20d)](_0x4a537e(0x1fe),'页面添加失败:\x20'+_0x510529,{'template':_0x54fc71,'targetPath':_0x6f2adf,'error':_0x4aab7d instanceof Error?_0x4aab7d[_0x4a537e(0x1e8)]:String(_0x4aab7d),'duration':_0x370816});})[_0x55781a(0x1eb)](()=>{_0x19d478(![]);});}},[_0x54fc71,_0x510529]),useEffect(()=>{_0x5027d2&&setTimeout(()=>{_0x476bdf();});},[_0x5027d2]);if(_0x54fc71)return a1_0x4d4df3(Box,{'flexDirection':_0x412040(0x1ff),'paddingY':0x1,'children':[a1_0x4d4df3(Box,{'children':[a1_0x35604c(Text,{'color':_0x412040(0x1e9),'children':'\x20Step1:\x20'}),a1_0x35604c(Text,{'children':_0x412040(0x204)}),a1_0x35604c(Text,{'color':_0x412040(0x206),'children':_0x54fc71})]}),_0x510529?a1_0x4d4df3(Box,{'children':[a1_0x35604c(Text,{'color':_0x412040(0x1e9),'children':'\x20Step2:\x20'}),a1_0x35604c(Text,{'children':_0x412040(0x1f1)}),a1_0x35604c(Text,{'color':'green','children':_0x510529})]}):a1_0x35604c(InputProjectCode,{'pagePath':_0x2591e7,'onSubmit':_0x45ce6f}),_0x510529&&_0x4d10e5?a1_0x4d4df3(Box,{'marginTop':0x1,'children':[a1_0x35604c(Box,{'width':'4'}),a1_0x35604c(Text,{'children':'正在创建页面,请稍候…'})]}):null,_0x5027d2?a1_0x4d4df3(a1_0x5565d2,{'children':[a1_0x35604c(Box,{'marginTop':0x1,'children':a1_0x35604c(Text,{'color':_0x412040(0x1e9),'children':_0x412040(0x201)})}),a1_0x4d4df3(Box,{'children':[a1_0x35604c(Text,{'color':'gray','children':_0x412040(0x1f4)}),a1_0x35604c(Text,{'color':'green','children':_0x6f2adf})]}),a1_0x4d4df3(Box,{'children':[a1_0x35604c(Text,{'color':_0x412040(0x1e9),'children':_0x412040(0x1f3)}),a1_0x4d4df3(Text,{'color':'green','children':['/',_0x510529]})]}),a1_0x35604c(Box,{'marginTop':0x1,'children':a1_0x35604c(Text,{'color':_0x412040(0x205),'children':_0x412040(0x20a)})})]}):null]});return a1_0x35604c(SelectPageTemplate,{'onSelect':_0x36f33b});};
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 +1 @@
1
- (function(_0x1ca7d3,_0x20ec2c){const _0x18ac74=a2_0x5478,_0x293963=_0x1ca7d3();while(!![]){try{const _0xe351f1=parseInt(_0x18ac74(0x169))/0x1*(-parseInt(_0x18ac74(0x159))/0x2)+-parseInt(_0x18ac74(0x15e))/0x3*(-parseInt(_0x18ac74(0x175))/0x4)+parseInt(_0x18ac74(0x15c))/0x5*(-parseInt(_0x18ac74(0x166))/0x6)+parseInt(_0x18ac74(0x17b))/0x7+parseInt(_0x18ac74(0x176))/0x8*(parseInt(_0x18ac74(0x168))/0x9)+-parseInt(_0x18ac74(0x164))/0xa*(-parseInt(_0x18ac74(0x163))/0xb)+-parseInt(_0x18ac74(0x16e))/0xc;if(_0xe351f1===_0x20ec2c)break;else _0x293963['push'](_0x293963['shift']());}catch(_0xad8e28){_0x293963['push'](_0x293963['shift']());}}}(a2_0x72b1,0xc590d));import{jsx as a2_0x757fe5,jsxs as a2_0x3bec06}from'react/jsx-runtime';import{useState,useEffect}from'react';import{Text,Box,useInput}from'ink';function a2_0x72b1(){const _0x165d05=['return','6HmxYMO','length','map','正在加载页面模板...','../..','6539489SssbkY','10omMpdC','\x20\x20\x20\x20\x20\x20>\x20','725262mFHCnR','name','11272077TIduNt','11488JwsNgE','url','请选择您要创建的页面模板','column','templates/pages','4973568TJKRVo','blank','filter','localeCompare','获取模板列表失败:','sdk-fetch','green','920428vBuFuU','8eCVoMK','downArrow','sort','upArrow','isDirectory','8107435YnwPOg','resolve','error','264xiqhlf','\x20Step1:\x20','dirname','30qPWIjR'];a2_0x72b1=function(){return _0x165d05;};return a2_0x72b1();}import{readdir}from'node:fs/promises';import a2_0x40375d from'node:path';import{fileURLToPath}from'node:url';async function getTemplateList(){const _0x4c7317=a2_0x5478;try{const _0x3b582d=fileURLToPath(import.meta[_0x4c7317(0x16a)]),_0x17c986=a2_0x40375d[_0x4c7317(0x157)](a2_0x40375d[_0x4c7317(0x15b)](_0x3b582d),_0x4c7317(0x162)),_0x1d5ee3=a2_0x40375d['join'](_0x17c986,_0x4c7317(0x16d)),_0x2f7a27=await readdir(_0x1d5ee3,{'withFileTypes':!![]}),_0x1838eb=_0x2f7a27[_0x4c7317(0x170)](_0x398241=>_0x398241[_0x4c7317(0x17a)]())[_0x4c7317(0x160)](_0x40fa73=>({'label':_0x40fa73[_0x4c7317(0x167)]}))[_0x4c7317(0x178)]((_0xaca169,_0x1fb462)=>_0xaca169['label'][_0x4c7317(0x171)](_0x1fb462['label']));return _0x1838eb;}catch(_0x545bdf){return console[_0x4c7317(0x158)](_0x4c7317(0x172),_0x545bdf),[{'label':_0x4c7317(0x16f)},{'label':_0x4c7317(0x173)}];}}function a2_0x5478(_0x557db1,_0x42b30c){const _0x72b150=a2_0x72b1();return a2_0x5478=function(_0x54787e,_0x8697da){_0x54787e=_0x54787e-0x157;let _0xd13e80=_0x72b150[_0x54787e];return _0xd13e80;},a2_0x5478(_0x557db1,_0x42b30c);}export function SelectPageTemplate(_0x487b73){const _0x1a4a36=a2_0x5478,[_0x4d4b10,_0x2e0786]=useState(0x0),[_0xe7b32f,_0xe6a8e6]=useState([]),[_0x5b32bb,_0x11f7dc]=useState(!![]);useEffect(()=>{async function _0x58a0bc(){const _0x204235=await getTemplateList();_0xe6a8e6(_0x204235),_0x11f7dc(![]);}_0x58a0bc();},[]),useInput((_0x26d9ca,_0x3cf4ef)=>{const _0x3a27db=a2_0x5478;if(_0x5b32bb)return;if(_0x3cf4ef[_0x3a27db(0x15d)]){const _0x4d33df=_0xe7b32f[_0x4d4b10];_0x4d33df&&_0x487b73['onSelect'](_0x4d33df['label']);}_0x3cf4ef[_0x3a27db(0x179)]&&_0x2e0786(_0x478029=>_0x478029===0x0?_0xe7b32f['length']-0x1:_0x478029-0x1),_0x3cf4ef[_0x3a27db(0x177)]&&_0x2e0786(_0x464e8d=>_0x464e8d===_0xe7b32f[_0x3a27db(0x15f)]-0x1?0x0:_0x464e8d+0x1);});if(_0x5b32bb)return a2_0x757fe5(Box,{'flexDirection':_0x1a4a36(0x16c),'paddingY':0x1,'children':a2_0x3bec06(Box,{'children':[a2_0x757fe5(Text,{'color':'gray','children':_0x1a4a36(0x15a)}),a2_0x757fe5(Text,{'children':_0x1a4a36(0x161)})]})});return a2_0x3bec06(Box,{'flexDirection':'column','paddingY':0x1,'children':[a2_0x3bec06(Box,{'children':[a2_0x757fe5(Text,{'color':'gray','children':_0x1a4a36(0x15a)}),a2_0x757fe5(Text,{'children':_0x1a4a36(0x16b)})]}),_0xe7b32f[_0x1a4a36(0x160)]((_0x41b228,_0x470063)=>{const _0xe7268=_0x1a4a36,_0x1a9bd2=_0x470063===_0x4d4b10,_0x5d67a5=_0x1a9bd2?_0xe7268(0x165)+_0x41b228['label']:'\x20\x20\x20\x20\x20\x20\x20\x20'+_0x41b228['label'];return a2_0x757fe5(Box,{'children':a2_0x757fe5(Text,{'color':_0x1a9bd2?_0xe7268(0x174):undefined,'children':_0x5d67a5})},_0x5d67a5);})]});}
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 +1 @@
1
- function a3_0x2bbc(){const _0x239029=['message','\x1b[33m!\x20以下数据集代码不存在:\x20','2572772fikmlr','90NIPfFU','指定的数据集代码都不存在:\x20','gray','文档生成失败:\x20','*\x20输出目录:\x20','7xQxnRl',',\x20失败\x20','api-doc','√\x20文档生成完成!成功\x20','未提供应用AppCode,且配置中也没有默认值','yellow','\x1b[0m','22209LichIm','\x20-\x20','!\x20原始数据集\x20','error','*\x20生成的文档文件:','dim','716IhdxNt','column','success','log','code','white','3944133KPaKYv','length','\x20(环境:\x20','\x20个数据集的文档...','.md\x20(','💡\x20请使用\x20','filter','duplicateCount','使用配置的应用AppCode:\x20','4550248yWegNN','./docs','\x20重新登录后再试','正在生成\x20','green','文档生成完成','\x20个数据集中筛选出\x20','12010eyUkMJ','join','env','cwd','\x20个,过滤重复','red','string','1nmHZzn','3862122xNFHTV','includes','1954794NZnJUU','online','\x20个匹配的数据集\x1b[0m','cyan','datasetName'];a3_0x2bbc=function(){return _0x239029;};return a3_0x2bbc();}(function(_0x31f780,_0x1d956f){const _0x4201f8=a3_0x35dd,_0x2dd3a0=_0x31f780();while(!![]){try{const _0x211904=-parseInt(_0x4201f8(0x172))/0x1*(-parseInt(_0x4201f8(0x17c))/0x2)+parseInt(_0x4201f8(0x175))/0x3+parseInt(_0x4201f8(0x18f))/0x4*(parseInt(_0x4201f8(0x16b))/0x5)+-parseInt(_0x4201f8(0x173))/0x6+parseInt(_0x4201f8(0x182))/0x7*(-parseInt(_0x4201f8(0x19e))/0x8)+-parseInt(_0x4201f8(0x195))/0x9+parseInt(_0x4201f8(0x17d))/0xa*(parseInt(_0x4201f8(0x189))/0xb);if(_0x211904===_0x1d956f)break;else _0x2dd3a0['push'](_0x2dd3a0['shift']());}catch(_0x1adf26){_0x2dd3a0['push'](_0x2dd3a0['shift']());}}}(a3_0x2bbc,0xb38b0));import{jsx as a3_0x1dcada,jsxs as a3_0x1bd80b,Fragment as a3_0x3e2fef}from'react/jsx-runtime';import{useEffect,useState}from'react';function a3_0x35dd(_0x5d8dd1,_0x575ff5){const _0x2bbc08=a3_0x2bbc();return a3_0x35dd=function(_0x35dde6,_0x1ea3f1){_0x35dde6=_0x35dde6-0x16a;let _0x107347=_0x2bbc08[_0x35dde6];return _0x107347;},a3_0x35dd(_0x5d8dd1,_0x575ff5);}import{Box,Text,useApp}from'ink';import{readConfig,getConfigAppCode}from'../utils/config.js';import{initEnv}from'../constant/env.js';import{fetchDatasets}from'./fetch-datasets.js';import{generateDatasetDocs}from'./api-doc.js';import{logger}from'../utils/logger.js';export const ApiDocUI=({appCode:_0x21d45e,env:_0x55aee9,output:_0x5b5a48,extraParams:_0x10e500,datasetCodes:_0x45d2a5})=>{const _0x3f6381=a3_0x35dd,{exit:_0x497967}=useApp(),[_0x2c9e91,_0x9ab273]=useState(![]),[_0x4c5e36,_0x2e5282]=useState(''),[_0x3adc4a,_0x12561c]=useState(![]),[_0x3349c3,_0x3f0d28]=useState(null),[_0x5935f0,_0x53b182]=useState(null),[_0x5f5dc6,_0x1ec420]=useState(null),_0x295c08=readConfig(),_0x3b65f0=getConfigAppCode(),_0x2ea937=_0x21d45e||_0x3b65f0,_0x1c54d8=typeof _0x295c08?.[_0x3f6381(0x16d)]===_0x3f6381(0x171)?_0x295c08[_0x3f6381(0x16d)]:undefined,_0x303e01=_0x55aee9||_0x1c54d8||_0x3f6381(0x176);initEnv(_0x303e01);const _0x468a9b=_0x5b5a48||_0x3f6381(0x19f),_0x2bd3a6=_0x21d45e?'使用指定的应用AppCode:\x20'+_0x2ea937:_0x3f6381(0x19d)+_0x2ea937;useEffect(()=>{_0x9ab273(!![]),_0x596893();},[]),useEffect(()=>{(_0x3adc4a||_0x3349c3)&&_0x497967();},[_0x3adc4a,_0x3349c3,_0x497967]);async function _0x596893(){const _0x22431c=_0x3f6381;if(!_0x2ea937){_0x3f0d28(_0x22431c(0x186));return;}try{logger['setLogPath'](process[_0x22431c(0x16e)]()),_0x2e5282('正在获取数据集列表...');const {rawData:_0xfb567,originalCount:_0x2dbb2c,filteredCount:_0x2cd7cf,duplicateCount:_0x1c1c6b}=await fetchDatasets(_0x2ea937);_0x1ec420({'originalCount':_0x2dbb2c,'filteredCount':_0x2cd7cf,'duplicateCount':_0x1c1c6b});if(_0xfb567[_0x22431c(0x196)]===0x0){_0x3f0d28('未找到任何数据集');return;}let _0x42fab8=_0xfb567;if(_0x45d2a5&&_0x45d2a5['length']>0x0){_0x42fab8=_0xfb567['filter'](_0x3c77ba=>_0x45d2a5[_0x22431c(0x174)](_0x3c77ba[_0x22431c(0x193)]));const _0x3f1e09=_0x42fab8['map'](_0x3ca557=>_0x3ca557[_0x22431c(0x193)]),_0x2a1622=_0x45d2a5[_0x22431c(0x19b)](_0x47a65d=>!_0x3f1e09[_0x22431c(0x174)](_0x47a65d));_0x2a1622[_0x22431c(0x196)]>0x0&&console[_0x22431c(0x192)](_0x22431c(0x17b)+_0x2a1622[_0x22431c(0x16c)](',\x20')+_0x22431c(0x188));if(_0x42fab8[_0x22431c(0x196)]===0x0){_0x3f0d28(_0x22431c(0x17e)+_0x45d2a5[_0x22431c(0x16c)](',\x20'));return;}console[_0x22431c(0x192)]('\x1b[90m*\x20从\x20'+_0xfb567[_0x22431c(0x196)]+_0x22431c(0x16a)+_0x42fab8[_0x22431c(0x196)]+_0x22431c(0x177));}_0x2e5282(_0x22431c(0x1a1)+_0x42fab8['length']+_0x22431c(0x198));const _0x548256=await generateDatasetDocs(_0x42fab8,_0x2ea937,_0x468a9b,(_0x36b6cf,_0x2425f6,_0x579fec)=>{const _0x5a5cd6=_0x22431c;_0x2e5282(_0x5a5cd6(0x1a1)+_0x579fec+_0x5a5cd6(0x199)+_0x36b6cf+'/'+_0x2425f6+')');},_0x10e500);_0x53b182(_0x548256),_0x12561c(!![]);const _0x18d35e=_0x548256[_0x22431c(0x19b)](_0x284eaf=>_0x284eaf[_0x22431c(0x191)])['length'],_0x8c2c95=_0x548256[_0x22431c(0x19b)](_0xc02df2=>!_0xc02df2[_0x22431c(0x191)])[_0x22431c(0x196)];logger['success']('api-doc',_0x22431c(0x1a3),undefined,{'totalCount':_0x548256[_0x22431c(0x196)],'successCount':_0x18d35e,'failCount':_0x8c2c95,'outputDir':_0x468a9b});}catch(_0x583e50){const _0x12a5fc=_0x583e50 instanceof Error?_0x583e50[_0x22431c(0x17a)]:String(_0x583e50);logger[_0x22431c(0x18c)](_0x22431c(0x184),_0x22431c(0x180)+_0x12a5fc,{'appCode':_0x2ea937,'outputDir':_0x468a9b}),_0x3f0d28(_0x22431c(0x180)+_0x12a5fc);}finally{_0x9ab273(![]);}}const _0x37ccc7=_0x5935f0?.['filter'](_0x35c887=>_0x35c887[_0x3f6381(0x191)])[_0x3f6381(0x196)]||0x0,_0x3f6884=_0x5935f0?.[_0x3f6381(0x19b)](_0x36291e=>!_0x36291e[_0x3f6381(0x191)])[_0x3f6381(0x196)]||0x0;return a3_0x1bd80b(Box,{'flexDirection':_0x3f6381(0x190),'children':[(_0x2c9e91||_0x3adc4a)&&a3_0x1bd80b(Box,{'children':[a3_0x1dcada(Text,{'color':_0x3f6381(0x17f),'children':'*\x20'}),a3_0x1dcada(Text,{'color':_0x21d45e?_0x3f6381(0x194):_0x3f6381(0x18e),'children':_0x2bd3a6})]}),_0x2c9e91&&a3_0x1dcada(Box,{'children':a3_0x1bd80b(Text,{'children':['🚀\x20',_0x4c5e36,_0x3f6381(0x197),_0x303e01,')']})}),_0x3adc4a&&_0x5935f0&&_0x5f5dc6&&a3_0x1bd80b(Box,{'flexDirection':_0x3f6381(0x190),'children':[a3_0x1dcada(Box,{'children':a3_0x1bd80b(Text,{'color':_0x3f6381(0x1a2),'children':[_0x3f6381(0x185),_0x37ccc7,'\x20个',_0x3f6884>0x0&&_0x3f6381(0x183)+_0x3f6884+'\x20个']})}),_0x5f5dc6[_0x3f6381(0x19c)]>0x0&&a3_0x1dcada(Box,{'marginTop':0x1,'children':a3_0x1bd80b(Text,{'color':_0x3f6381(0x187),'children':[_0x3f6381(0x18b),_0x5f5dc6['originalCount'],_0x3f6381(0x16f),'\x20',_0x5f5dc6[_0x3f6381(0x19c)],'\x20个']})}),a3_0x1bd80b(Box,{'marginTop':0x1,'children':[a3_0x1dcada(Text,{'color':'gray','children':_0x3f6381(0x181)}),a3_0x1dcada(Text,{'color':_0x3f6381(0x178),'children':_0x468a9b})]}),_0x37ccc7>0x0&&a3_0x1bd80b(a3_0x3e2fef,{'children':[a3_0x1dcada(Box,{'marginTop':0x1,'children':a3_0x1dcada(Text,{'color':'gray','children':_0x3f6381(0x18d)})}),_0x5935f0[_0x3f6381(0x19b)](_0x570f9e=>_0x570f9e[_0x3f6381(0x191)])['map']((_0x1b7e42,_0xda74e1)=>a3_0x1bd80b(Box,{'marginLeft':0x2,'children':[a3_0x1bd80b(Text,{'color':_0x3f6381(0x178),'children':['•\x20',_0x1b7e42['filePath']]}),a3_0x1bd80b(Text,{'color':'dim','children':[_0x3f6381(0x18a),_0x1b7e42[_0x3f6381(0x179)]]})]},_0xda74e1))]}),_0x3f6884>0x0&&a3_0x1bd80b(a3_0x3e2fef,{'children':[a3_0x1dcada(Box,{'marginTop':0x1,'children':a3_0x1dcada(Text,{'color':_0x3f6381(0x187),'children':'⚠️\x20以下数据集生成失败:'})}),_0x5935f0[_0x3f6381(0x19b)](_0x5b1aa0=>!_0x5b1aa0[_0x3f6381(0x191)])['map']((_0x232b18,_0x41eac9)=>a3_0x1bd80b(Box,{'marginLeft':0x2,'flexDirection':_0x3f6381(0x190),'children':[a3_0x1bd80b(Text,{'color':_0x3f6381(0x170),'children':['•\x20',_0x232b18[_0x3f6381(0x179)],'\x20(',_0x232b18['datasetCode'],')']}),_0x232b18[_0x3f6381(0x18c)]&&a3_0x1dcada(Box,{'marginLeft':0x2,'children':a3_0x1dcada(Text,{'color':_0x3f6381(0x18e),'children':_0x232b18[_0x3f6381(0x18c)]})})]},_0x41eac9))]})]}),_0x3349c3&&a3_0x1bd80b(Box,{'flexDirection':'column','children':[a3_0x1dcada(Box,{'children':a3_0x1bd80b(Text,{'color':'red','children':['❌\x20',_0x3349c3]})}),_0x3349c3[_0x3f6381(0x174)]('登录')&&a3_0x1bd80b(Box,{'marginTop':0x1,'children':[a3_0x1dcada(Text,{'color':_0x3f6381(0x187),'children':_0x3f6381(0x19a)}),a3_0x1dcada(Text,{'color':_0x3f6381(0x178),'children':'lovrabet\x20auth'}),a3_0x1dcada(Text,{'color':'yellow','children':_0x3f6381(0x1a0)})]})]})]});};
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 +1 @@
1
- const a4_0x49c084=a4_0x5efa;(function(_0x26d5b0,_0xeffee0){const _0x22e1b0=a4_0x5efa,_0x4edd2a=_0x26d5b0();while(!![]){try{const _0xac5c5f=-parseInt(_0x22e1b0(0x122))/0x1*(-parseInt(_0x22e1b0(0x111))/0x2)+-parseInt(_0x22e1b0(0x11f))/0x3+parseInt(_0x22e1b0(0x114))/0x4*(-parseInt(_0x22e1b0(0x12f))/0x5)+parseInt(_0x22e1b0(0x116))/0x6+parseInt(_0x22e1b0(0x119))/0x7*(parseInt(_0x22e1b0(0x135))/0x8)+parseInt(_0x22e1b0(0x11e))/0x9*(-parseInt(_0x22e1b0(0x11b))/0xa)+-parseInt(_0x22e1b0(0x125))/0xb;if(_0xac5c5f===_0xeffee0)break;else _0x4edd2a['push'](_0x4edd2a['shift']());}catch(_0x4d6fe2){_0x4edd2a['push'](_0x4edd2a['shift']());}}}(a4_0x495e,0x8694c));function a4_0x5efa(_0x5d10e5,_0x4441b2){const _0x495eb5=a4_0x495e();return a4_0x5efa=function(_0x5efa79,_0x480739){_0x5efa79=_0x5efa79-0x10f;let _0x1beef0=_0x495eb5[_0x5efa79];return _0x1beef0;},a4_0x5efa(_0x5d10e5,_0x4441b2);}import{mkdirSync,writeFileSync}from'node:fs';import a4_0x38782e from'node:path';function a4_0x495e(){const _0x5f179d=['.md','text','205081gFVZul','生成文档失败:\x20','等待\x203\x20秒...\x0a','639870camtSo','生成文档成功:\x20','获取文档失败\x20(','log','✓\x20成功生成:\x20','dbtableConfig',']\x20正在生成:\x20','登录鉴权失败,登录已过期,请使用\x20lovrabet\x20auth\x20重新登录','/api/node-toolbox/api-doc-generator','stringify','1865LaJgbK','slice','api-doc','data','error','.md\x20-\x20','8UnIvwM','length','),HTTP状态码:\x20','padStart','dataset_','success','POST','push','./docs','\x20个数据集需要生成文档\x0a','message','\x0a共有\x20','.md\x20(','utf8','status','2JAPhCz','code','markdown','3400uSkSsu','name','859812MZROfC','join','✗\x20失败:\x20','6976053hbPBYI','tableName','8480jzLzAm','响应数据格式错误\x20(','application/json','4194sqUmsA','69990kpYfAu'];a4_0x495e=function(){return _0x5f179d;};return a4_0x495e();}import{getCookie}from'../auth/get-cookie.js';import{getApiDomain}from'../constant/domain.js';import{logger}from'../utils/logger.js';export async function fetchDatasetDoc(_0xcc58fe){const _0x4dcc28=a4_0x5efa,{appCode:_0xb15f25,datasetCode:_0x5e2092,datasetId:_0x528e08,extraParams:_0x2f627f}=_0xcc58fe,_0x156572=getApiDomain(),_0x159a55=_0x156572+_0x4dcc28(0x12d),_0x3b65b8={'appCode':_0xb15f25,'datasetCode':_0x5e2092,'datasetId':_0x528e08,..._0x2f627f||{}},_0x11d47a=await fetch(_0x159a55,{'method':_0x4dcc28(0x13b),'headers':{'Content-Type':_0x4dcc28(0x11d),'Cookie':getCookie()},'body':JSON[_0x4dcc28(0x12e)](_0x3b65b8)});if(!_0x11d47a['ok']){if(_0x11d47a[_0x4dcc28(0x110)]===0x191)throw new Error(_0x4dcc28(0x12c));let _0x1fa4d8='';try{_0x1fa4d8=await _0x11d47a[_0x4dcc28(0x121)]();}catch(_0x250bb6){}throw new Error(_0x4dcc28(0x127)+_0x5e2092+_0x4dcc28(0x137)+_0x11d47a[_0x4dcc28(0x110)]+(_0x1fa4d8?'\x0a'+_0x1fa4d8:''));}const _0x179f42=await _0x11d47a['json']();if(!_0x179f42[_0x4dcc28(0x132)]||typeof _0x179f42[_0x4dcc28(0x132)][_0x4dcc28(0x113)]!=='string')throw new Error(_0x4dcc28(0x11c)+_0x5e2092+'):缺少\x20data.markdown\x20字段');return _0x179f42[_0x4dcc28(0x132)][_0x4dcc28(0x113)];}function delay(_0x3c5ae0){return new Promise(_0x142964=>setTimeout(_0x142964,_0x3c5ae0));}export async function generateDatasetDocs(_0x3e910d,_0x2592d8,_0x520623=a4_0x49c084(0x13d),_0x4ce8a4,_0x5a12b9){const _0x506654=a4_0x49c084;mkdirSync(_0x520623,{'recursive':!![]});const _0x51a307=[],_0x33c66a=_0x3e910d[_0x506654(0x136)];console[_0x506654(0x128)](_0x506654(0x140)+_0x33c66a+_0x506654(0x13e));for(let _0x58a2ad=0x0;_0x58a2ad<_0x3e910d[_0x506654(0x136)];_0x58a2ad++){const _0xd3c78d=_0x3e910d[_0x58a2ad],_0xa8c64a=_0x58a2ad+0x1;let _0x1875b9;if(_0xd3c78d[_0x506654(0x12a)]?.[_0x506654(0x11a)])_0x1875b9=_0xd3c78d['dbtableConfig'][_0x506654(0x11a)];else{const _0x821593=_0xd3c78d['code'][_0x506654(0x130)](-0x6)[_0x506654(0x138)](0x6,'0');_0x1875b9=_0x506654(0x139)+_0x821593;}try{console['log']('['+_0xa8c64a+'/'+_0x33c66a+_0x506654(0x12b)+_0x1875b9+_0x506654(0x141)+_0xd3c78d['name']+')');_0x4ce8a4&&_0x4ce8a4(_0xa8c64a,_0x33c66a,_0x1875b9);const _0x3812e8=await fetchDatasetDoc({'appCode':_0x2592d8,'datasetCode':_0xd3c78d[_0x506654(0x112)],'datasetId':_0xd3c78d['id'],'enableAI':![],'extraParams':_0x5a12b9}),_0x3a721=a4_0x38782e[_0x506654(0x117)](_0x520623,_0x1875b9+'.md');writeFileSync(_0x3a721,_0x3812e8,{'encoding':_0x506654(0x10f)}),console[_0x506654(0x128)](_0x506654(0x129)+_0x1875b9+_0x506654(0x120)),logger[_0x506654(0x13a)](_0x506654(0x131),_0x506654(0x126)+_0x1875b9,undefined,{'datasetCode':_0xd3c78d[_0x506654(0x112)],'datasetName':_0xd3c78d[_0x506654(0x115)],'filePath':_0x3a721,'progress':_0xa8c64a+'/'+_0x33c66a}),_0x51a307[_0x506654(0x13c)]({'datasetCode':_0xd3c78d[_0x506654(0x112)],'datasetName':_0xd3c78d[_0x506654(0x115)],'filePath':_0x3a721,'success':!![]});}catch(_0x1d8080){const _0x298e97=_0x1d8080 instanceof Error?_0x1d8080[_0x506654(0x13f)]:String(_0x1d8080);console['log'](_0x506654(0x118)+_0x1875b9+_0x506654(0x134)+_0x298e97+'\x0a'),logger[_0x506654(0x133)](_0x506654(0x131),_0x506654(0x123)+_0xd3c78d[_0x506654(0x112)],{'datasetCode':_0xd3c78d[_0x506654(0x112)],'datasetName':_0xd3c78d[_0x506654(0x115)],'error':_0x298e97,'progress':_0xa8c64a+'/'+_0x33c66a}),_0x51a307[_0x506654(0x13c)]({'datasetCode':_0xd3c78d[_0x506654(0x112)],'datasetName':_0xd3c78d['name'],'filePath':'','success':![],'error':_0x298e97}),_0xa8c64a<_0x33c66a&&(console[_0x506654(0x128)](_0x506654(0x124)),await delay(0xbb8));}}return _0x51a307;}
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 +1 @@
1
- (function(_0x48bf46,_0x2d0ca7){const _0x238900=a5_0x142c,_0x31bc75=_0x48bf46();while(!![]){try{const _0x474472=-parseInt(_0x238900(0x158))/0x1*(parseInt(_0x238900(0x155))/0x2)+parseInt(_0x238900(0x140))/0x3+parseInt(_0x238900(0x146))/0x4*(-parseInt(_0x238900(0x14e))/0x5)+-parseInt(_0x238900(0x15a))/0x6+parseInt(_0x238900(0x14d))/0x7+-parseInt(_0x238900(0x154))/0x8+parseInt(_0x238900(0x14f))/0x9;if(_0x474472===_0x2d0ca7)break;else _0x31bc75['push'](_0x31bc75['shift']());}catch(_0x47a0f3){_0x31bc75['push'](_0x31bc75['shift']());}}}(a5_0xee2e,0xb7cfc));import{jsx as a5_0x45f2ac,jsxs as a5_0x18761d}from'react/jsx-runtime';function a5_0x142c(_0x571426,_0x5bd7ad){const _0xee2e0a=a5_0xee2e();return a5_0x142c=function(_0x142c68,_0x22b505){_0x142c68=_0x142c68-0x137;let _0xd1a7cc=_0xee2e0a[_0x142c68];return _0xd1a7cc;},a5_0x142c(_0x571426,_0x5bd7ad);}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{fetchDatasets}from'./fetch-datasets.js';import{generateApiFile}from'./generate-api-file.js';function a5_0xee2e(){const _0x4bac69=['\x20个,过滤重复','\x20from\x20\x27@/','\x20个数据集,生成','datasetCount','{\x20lovrabetClient\x20}','-\x20模型配置文件\x20(','拉取\x20API\x20配置失败:\x20','*\x20已生成文件:','red','env','cyan','online','duplicateCount','split','originalCount','\x20个模型','client','√\x20成功拉取\x20','-client','yellow','🚀\x20正在从服务器拉取\x20API\x20配置...\x20(环境:\x20','3133680WiorgG','-api','column','green','string','api-pull','8756cIFMas','.ts','endsWith','modelCount','setLogPath','gray','slice','7269941PaWDSg','535STBhDX','10541799xhufdz','!\x20原始数据集\x20','\x20-\x20客户端实例文件','api','replace','4853312QdKHYr','398FiQjLB','import\x20','join','4663oZwYNa','未提供应用AppCode,且配置中也没有默认值','4396308FLOKsf','./src/api/','使用指定的应用AppCode:\x20','使用配置的应用AppCode:\x20','dim','includes','*\x20导入方式:','white'];a5_0xee2e=function(){return _0x4bac69;};return a5_0xee2e();}import{logger}from'../utils/logger.js';export const ApiPullUI=({appCode:_0x36032f,env:_0x961f75,output:_0xd0f132})=>{const _0x5d442=a5_0x142c,{exit:_0x1b4913}=useApp(),[_0x1d07a2,_0x17c5c2]=useState(![]),[_0x1514b4,_0x190357]=useState(![]),[_0x3eafdd,_0x3c249e]=useState(null),[_0x59f210,_0x4d890e]=useState(null),_0x2904dc=readConfig(),_0x3d2856=getConfigAppCode(),_0x53b432=_0x36032f||_0x3d2856,_0x224a79=typeof _0x2904dc?.['env']===_0x5d442(0x144)?_0x2904dc[_0x5d442(0x16b)]:undefined,_0x4d15d8=_0x961f75||_0x224a79||_0x5d442(0x16d);initEnv(_0x4d15d8);const _0x462df1=_0xd0f132||_0x5d442(0x15b),_0x1bf854=_0x36032f&&_0x36032f['includes']('-')?_0x36032f[_0x5d442(0x138)]('-')[_0x5d442(0x14c)](0x1)[_0x5d442(0x157)]('-'):'',_0x2e9612=_0x36032f?_0x5d442(0x15c)+_0x53b432:_0x5d442(0x15d)+_0x53b432,_0x4171f2=_0x1bf854?_0x1bf854+_0x5d442(0x141):_0x5d442(0x152),_0x4653cb=_0x1bf854?_0x1bf854+_0x5d442(0x13d):_0x5d442(0x13b);useEffect(()=>{_0x17c5c2(!![]),_0x1d4f88();},[]),useEffect(()=>{(_0x1514b4||_0x3eafdd)&&_0x1b4913();},[_0x1514b4,_0x3eafdd,_0x1b4913]);async function _0x1d4f88(){const _0x41d7a1=_0x5d442;if(!_0x53b432){_0x3c249e(_0x41d7a1(0x159));return;}try{logger[_0x41d7a1(0x14a)](process['cwd']());const {rawData:_0x14d60e,originalCount:_0x422cba,filteredCount:_0xd80088,duplicateCount:_0xeaefc}=await fetchDatasets(_0x53b432),_0x25d69b=_0xd80088,_0x11419a=!_0x36032f,_0x54cc1b=await generateApiFile(_0x14d60e,_0x1bf854,_0x53b432,_0x11419a,_0x4d15d8,_0x462df1),_0x665d33=_0x462df1[_0x41d7a1(0x148)]('/')?_0x462df1:_0x462df1+'/';_0x4d890e({'api':''+_0x665d33+_0x4171f2+_0x41d7a1(0x147),'client':''+_0x665d33+_0x4653cb+_0x41d7a1(0x147),'modelCount':_0x54cc1b[_0x41d7a1(0x149)],'datasetCount':_0x25d69b,'originalCount':_0x422cba,'duplicateCount':_0xeaefc}),_0x190357(!![]);}catch(_0x28abe6){const _0x224f95=_0x28abe6 instanceof Error?_0x28abe6['message']:String(_0x28abe6);logger['error'](_0x41d7a1(0x145),_0x41d7a1(0x168)+_0x224f95,{'appCode':_0x53b432,'error':_0x224f95}),_0x3c249e(_0x41d7a1(0x168)+_0x224f95);}finally{_0x17c5c2(![]);}}return a5_0x18761d(Box,{'flexDirection':_0x5d442(0x142),'children':[(_0x1d07a2||_0x1514b4)&&a5_0x18761d(Box,{'children':[a5_0x45f2ac(Text,{'color':_0x5d442(0x14b),'children':'*\x20'}),a5_0x45f2ac(Text,{'color':_0x36032f?_0x5d442(0x161):'dim','children':_0x2e9612})]}),_0x1d07a2&&a5_0x45f2ac(Box,{'children':a5_0x18761d(Text,{'children':[_0x5d442(0x13f),_0x4d15d8,')']})}),_0x1514b4&&_0x59f210&&a5_0x18761d(Box,{'flexDirection':_0x5d442(0x142),'children':[a5_0x45f2ac(Box,{'children':a5_0x18761d(Text,{'color':_0x5d442(0x143),'children':[_0x5d442(0x13c),_0x59f210[_0x5d442(0x165)],_0x5d442(0x164),'\x20',_0x59f210[_0x5d442(0x149)],_0x5d442(0x13a)]})}),_0x59f210[_0x5d442(0x137)]>0x0&&a5_0x45f2ac(Box,{'marginTop':0x1,'children':a5_0x18761d(Text,{'color':_0x5d442(0x13e),'children':[_0x5d442(0x150),_0x59f210[_0x5d442(0x139)],_0x5d442(0x162),'\x20',_0x59f210['duplicateCount'],'\x20个']})}),a5_0x45f2ac(Box,{'marginTop':0x1,'children':a5_0x45f2ac(Text,{'color':'gray','children':_0x5d442(0x169)})}),a5_0x18761d(Box,{'marginLeft':0x2,'children':[a5_0x18761d(Text,{'color':'cyan','children':['•\x20',_0x59f210['api']]}),a5_0x18761d(Text,{'color':'dim','children':['\x20',_0x5d442(0x167),_0x59f210[_0x5d442(0x149)],'\x20个模型)']})]}),a5_0x18761d(Box,{'marginLeft':0x2,'children':[a5_0x18761d(Text,{'color':'cyan','children':['•\x20',_0x59f210[_0x5d442(0x13b)]]}),a5_0x45f2ac(Text,{'color':_0x5d442(0x15e),'children':_0x5d442(0x151)})]}),a5_0x45f2ac(Box,{'marginTop':0x1,'children':a5_0x45f2ac(Text,{'color':_0x5d442(0x14b),'children':_0x5d442(0x160)})}),a5_0x45f2ac(Box,{'marginLeft':0x2,'children':a5_0x18761d(Text,{'color':'yellow','children':[_0x5d442(0x156),_0x5d442(0x166),_0x5d442(0x163),_0x59f210[_0x5d442(0x13b)][_0x5d442(0x153)](/^\.\//,'')[_0x5d442(0x153)](_0x5d442(0x147),''),'\x27']})})]}),_0x3eafdd&&a5_0x18761d(Box,{'flexDirection':'column','children':[a5_0x45f2ac(Box,{'children':a5_0x18761d(Text,{'color':_0x5d442(0x16a),'children':['❌\x20',_0x3eafdd]})}),_0x3eafdd[_0x5d442(0x15f)]('登录')&&a5_0x18761d(Box,{'marginTop':0x1,'children':[a5_0x45f2ac(Text,{'color':'yellow','children':'💡\x20请使用\x20'}),a5_0x45f2ac(Text,{'color':_0x5d442(0x16c),'children':'lovrabet\x20auth'}),a5_0x45f2ac(Text,{'color':_0x5d442(0x13e),'children':'\x20重新登录后再试'})]})]})]});};
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();}
@@ -0,0 +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 +1 @@
1
- const a8_0x344d00=a8_0x2543;(function(_0x557c56,_0xdd33c7){const _0x17cad9=a8_0x2543,_0x523231=_0x557c56();while(!![]){try{const _0x34b9e9=-parseInt(_0x17cad9(0xb4))/0x1*(-parseInt(_0x17cad9(0xd7))/0x2)+-parseInt(_0x17cad9(0xd3))/0x3*(parseInt(_0x17cad9(0xb5))/0x4)+-parseInt(_0x17cad9(0xb3))/0x5*(parseInt(_0x17cad9(0xb2))/0x6)+parseInt(_0x17cad9(0xd5))/0x7*(-parseInt(_0x17cad9(0xc8))/0x8)+-parseInt(_0x17cad9(0xc4))/0x9*(parseInt(_0x17cad9(0xc3))/0xa)+parseInt(_0x17cad9(0xdd))/0xb*(parseInt(_0x17cad9(0xc5))/0xc)+parseInt(_0x17cad9(0xd8))/0xd;if(_0x34b9e9===_0xdd33c7)break;else _0x523231['push'](_0x523231['shift']());}catch(_0x14c6e7){_0x523231['push'](_0x523231['shift']());}}}(a8_0x3f9c,0xaa311));import a8_0x5aff0c from'prettier';import{mkdirSync,writeFileSync,readFileSync}from'node:fs';import a8_0x2068f0 from'node:path';function a8_0x3f9c(){const _0x236136=['请先通过\x20`lovrabet\x20config\x20set\x20app\x20<value>`\x20配置应用\x20Code','{\x20apiConfigName:\x20','keys','name','endsWith','client.ts.tpl','tableName','10xByPRw','10631403blLILF','115452VtobXJ','join','slice','24mjbEGd','online',',\x20env:\x20\x22','string','format','-client','resolve','API\x20文件生成成功!','CONFIG_NAMES.DEFAULT','dirname','.ts','4012653ZWSFVk','env','2861201UEmaLS','templates/generate-api','2gCzRgG','59811037RlnBfU','api.ts.tpl','code','./src/api/','length','341fCiLzv','\x22\x20}','-api','6473022VtVdQO','5uCacyX','621889ynrLCq','4iZqyLL','utf8','modelName','success','forEach','replaceApiContent','typescript'];a8_0x3f9c=function(){return _0x236136;};return a8_0x3f9c();}import{fileURLToPath}from'node:url';import{readConfig}from'../utils/config.js';import{formatDataset}from'./format-dataset.js';import{TemplateReplacer}from'../utils/template-replacer.js';import{logger}from'../utils/logger.js';function a8_0x2543(_0x60a345,_0x164683){const _0x3f9c26=a8_0x3f9c();return a8_0x2543=function(_0x25438a,_0x2169bb){_0x25438a=_0x25438a-0xb2;let _0x5335c6=_0x3f9c26[_0x25438a];return _0x5335c6;},a8_0x2543(_0x60a345,_0x164683);}export async function generateApiFile(_0x3f52ea,_0x31ac3d='',_0x41374f,_0x4b31ec=![],_0x53f264,_0x2cc35e=a8_0x344d00(0xdb)){const _0x549eed=a8_0x344d00,_0x5de0ef=readConfig(),_0x50ea97=_0x41374f||_0x5de0ef?.['app'];if(typeof _0x50ea97!=='string'||!_0x50ea97)throw new Error(_0x549eed(0xbc));const _0x45e96b=_0x4b31ec?_0x549eed(0xd0):'\x22'+_0x50ea97+'\x22',_0x5622ea=typeof _0x5de0ef[_0x549eed(0xd4)]===_0x549eed(0xcb)?_0x5de0ef['env']:undefined,_0x2630fe=_0x53f264||_0x5622ea||_0x549eed(0xc9),_0x5b8a43=_0x2630fe!==_0x549eed(0xc9);let _0x37d8c7;if(_0x4b31ec)_0x5b8a43?_0x37d8c7=_0x549eed(0xbd)+_0x45e96b+_0x549eed(0xca)+_0x2630fe+_0x549eed(0xde):_0x37d8c7='';else{const _0x2a8275=_0x5b8a43?',\x20env:\x20\x22'+_0x2630fe+'\x22':'';_0x37d8c7='{\x20apiConfigName:\x20\x22'+_0x50ea97+'\x22'+_0x2a8275+'\x20}';}const _0x52edca=_0x31ac3d?_0x31ac3d+_0x549eed(0xdf):'api',_0xdde871=_0x31ac3d?_0x31ac3d+_0x549eed(0xcd):'client',_0x2149be=formatDataset(_0x3f52ea),_0x39e154={};_0x2149be[_0x549eed(0xb9)](_0x27f0ff=>{const _0x2e65f0=_0x549eed;_0x39e154[_0x27f0ff[_0x2e65f0(0xb7)]]={'tableName':_0x27f0ff[_0x2e65f0(0xc2)],'datasetCode':_0x27f0ff[_0x2e65f0(0xda)],'name':_0x27f0ff[_0x2e65f0(0xbf)]||''};});const _0x258513=fileURLToPath(import.meta['url']),_0x679bb7=a8_0x2068f0[_0x549eed(0xce)](a8_0x2068f0[_0x549eed(0xd1)](_0x258513),'../..'),_0x162f23=a8_0x2068f0[_0x549eed(0xc6)](_0x679bb7,_0x549eed(0xd6)),_0xb17a97=a8_0x2068f0['join'](_0x162f23,_0x549eed(0xd9)),_0x3bc5d0=a8_0x2068f0[_0x549eed(0xc6)](_0x162f23,_0x549eed(0xc1)),_0x1404a7=_0x2cc35e[_0x549eed(0xc0)]('/')?_0x2cc35e[_0x549eed(0xc7)](0x0,-0x1):_0x2cc35e;mkdirSync(_0x1404a7,{'recursive':!![]});const _0x401219=readFileSync(_0xb17a97,_0x549eed(0xb6)),_0x244f48=TemplateReplacer[_0x549eed(0xba)](_0x401219,_0x50ea97,_0x39e154,Object[_0x549eed(0xbe)](_0x39e154)[0x0],_0x52edca,_0x45e96b),_0x210177=await a8_0x5aff0c[_0x549eed(0xcc)](_0x244f48,{'parser':_0x549eed(0xbb)}),_0x34a2c0=_0x1404a7+'/'+_0x52edca+_0x549eed(0xd2);writeFileSync(_0x34a2c0,_0x210177,{'encoding':_0x549eed(0xb6)});const _0x10a720=readFileSync(_0x3bc5d0,_0x549eed(0xb6)),_0x3be8d3=TemplateReplacer[_0x549eed(0xba)](_0x10a720,_0x50ea97,_0x39e154,Object[_0x549eed(0xbe)](_0x39e154)[0x0],_0x52edca,_0x45e96b,_0x37d8c7),_0x2a6ef5=await a8_0x5aff0c[_0x549eed(0xcc)](_0x3be8d3,{'parser':'typescript'}),_0x4f22b8=_0x1404a7+'/'+_0xdde871+_0x549eed(0xd2);writeFileSync(_0x4f22b8,_0x2a6ef5,{'encoding':_0x549eed(0xb6)});const _0x112cc4=Object[_0x549eed(0xbe)](_0x39e154)[_0x549eed(0xdc)];return logger[_0x549eed(0xb8)]('init-api',_0x549eed(0xcf),undefined,{'apiFile':_0x34a2c0,'clientFile':_0x4f22b8,'modelCount':_0x112cc4,'configName':_0x45e96b}),{'modelCount':_0x112cc4,'apiFilePath':_0x34a2c0,'clientFilePath':_0x4f22b8,'configName':_0x45e96b};}
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};}
package/lib/api/main.js CHANGED
@@ -1 +1 @@
1
- (function(_0x2cddf9,_0x42fd3e){const _0x2b99a6=a9_0x1d5b,_0x55b5eb=_0x2cddf9();while(!![]){try{const _0x441152=parseInt(_0x2b99a6(0x16e))/0x1*(-parseInt(_0x2b99a6(0x16b))/0x2)+-parseInt(_0x2b99a6(0x15f))/0x3+parseInt(_0x2b99a6(0x17f))/0x4+-parseInt(_0x2b99a6(0x180))/0x5+-parseInt(_0x2b99a6(0x167))/0x6+-parseInt(_0x2b99a6(0x17b))/0x7+parseInt(_0x2b99a6(0x178))/0x8;if(_0x441152===_0x42fd3e)break;else _0x55b5eb['push'](_0x55b5eb['shift']());}catch(_0x19f5f1){_0x55b5eb['push'](_0x55b5eb['shift']());}}}(a9_0x5e85,0x45798));function a9_0x5e85(){const _0x5793d5=['Unknown\x20api\x20command:\x20','doc','\x1b[90m\x20\x20(注:\x20--appcode\x20参数与配置一致,将使用默认配置)\x1b[0m','parse','help','flags','pull','object','\x20\x20lovrabet\x20api\x20pull\x20--output\x20<dir>\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定输出目录(默认:\x20./src/api/)','❌\x20错误:不再支持位置参数方式','\x1b[90m*\x20使用配置的应用AppCode:\x20','params','469008SpFvhj','env','\x20\x20lovrabet\x20api\x20doc\x20--appcode\x20<code>\x20\x20\x20\x20\x20\x20\x20//\x20使用指定的\x20appcode','exit','×\x20--datasetcode\x20参数不能为空','message','appcode','!\x20请使用以下方式之一:','1730802aJMowe','\x20\x20\x202.\x20使用参数:\x20lovrabet\x20api\x20doc\x20--appcode\x20<app-code>','×\x20--params\x20参数不是有效的\x20JSON\x20格式','请使用\x20--appcode\x20参数,例如:','2JSNxvB','string','\x1b[0m','130297YDOaKC','Available\x20commands:','join','log','input','output','\x20\x20错误:\x20','\x0alovrabet\x20api\x20-\x20API\x20相关操作\x0a\x0a用法:\x0a\x20\x20$\x20lovrabet\x20api\x20pull\x20[options]\x0a\x20\x20$\x20lovrabet\x20api\x20doc\x20[options]\x0a\x0a选项:\x0a\x20\x20--appcode\x20<code>\x20\x20\x20\x20\x20\x20指定应用代码\x0a\x20\x20--output\x20<dir>\x20\x20\x20\x20\x20\x20\x20\x20指定输出目录(pull:\x20./src/api/,doc:\x20./docs)\x0a\x20\x20--env\x20<env>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20指定环境(如:daily、online)\x0a\x20\x20--datasetcode\x20<codes>\x20指定要生成文档的数据集代码(多个用逗号分隔,仅\x20doc\x20命令)\x0a\x20\x20--help\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20显示此帮助信息\x0a\x0a示例:\x0a\x20\x20$\x20lovrabet\x20api\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20拉取并生成\x20API\x20配置文件\x0a\x20\x20$\x20lovrabet\x20api\x20pull\x20--appcode\x20myapp\x20\x20\x20\x20\x20\x20\x20//\x20使用指定的\x20appcode\x0a\x20\x20$\x20lovrabet\x20api\x20pull\x20--output\x20./api\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定输出目录\x0a\x20\x20$\x20lovrabet\x20api\x20pull\x20--env\x20daily\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定环境拉取\x20API\x0a\x0a\x20\x20$\x20lovrabet\x20api\x20doc\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20生成所有数据集的文档\x0a\x20\x20$\x20lovrabet\x20api\x20doc\x20--appcode\x20myapp\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20使用指定的\x20appcode\x0a\x20\x20$\x20lovrabet\x20api\x20doc\x20--output\x20./docs\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定文档输出目录\x0a\x20\x20$\x20lovrabet\x20api\x20doc\x20--env\x20daily\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定环境生成文档\x0a\x20\x20$\x20lovrabet\x20api\x20doc\x20--datasetcode\x20ds_001\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20只生成指定数据集的文档\x0a\x20\x20$\x20lovrabet\x20api\x20doc\x20--datasetcode\x20ds_001,ds_002\x20\x20\x20\x20\x20\x20//\x20生成多个数据集的文档\x0a','\x20\x20\x201.\x20配置默认值:\x20lovrabet\x20config\x20set\x20appcode\x20<app-code>','error','13018400cZkDcs','\x20\x20lovrabet\x20api\x20doc\x20--appcode\x20','map','1828540QmfqUI','filter','\x20\x20lovrabet\x20api\x20doc\x20--output\x20<dir>\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定文档输出目录(默认:\x20./docs)','\x20\x20lovrabet\x20api\x20pull\x20--appcode\x20','153940PXioWi','2724485yoVvbm','\x20\x20lovrabet\x20api\x20doc\x20--env\x20<env>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定环境(如:\x20daily,\x20online)','\x20\x20lovrabet\x20api\x20pull\x20--appcode\x20<code>\x20\x20\x20\x20\x20\x20//\x20使用指定的\x20appcode'];a9_0x5e85=function(){return _0x5793d5;};return a9_0x5e85();}import{jsx as a9_0x2fc234}from'react/jsx-runtime';import{render}from'ink';import{ApiPullUI}from'./api-pull-ui.js';import{ApiDocUI}from'./api-doc-ui.js';function a9_0x1d5b(_0x1bbf00,_0x14e8a3){const _0x5e8589=a9_0x5e85();return a9_0x1d5b=function(_0x1d5ba7,_0x5971ef){_0x1d5ba7=_0x1d5ba7-0x157;let _0x40fe1a=_0x5e8589[_0x1d5ba7];return _0x40fe1a;},a9_0x1d5b(_0x1bbf00,_0x14e8a3);}import{getConfigAppCode}from'../utils/config.js';export async function apiCli(_0x1d6fe9){const _0x283257=a9_0x1d5b,_0x101508=_0x1d6fe9[_0x283257(0x172)][0x1];if(_0x1d6fe9[_0x283257(0x158)][_0x283257(0x157)]){console[_0x283257(0x171)](_0x283257(0x175));return;}if(_0x101508===_0x283257(0x159)){_0x1d6fe9[_0x283257(0x172)][0x2]&&(console['error'](_0x283257(0x15c)),console[_0x283257(0x171)]('请使用\x20--appcode\x20参数,例如:'),console[_0x283257(0x171)](_0x283257(0x17e)+_0x1d6fe9[_0x283257(0x172)][0x2]),process['exit'](0x1));const _0xe85672=getConfigAppCode();let _0x1acea4=_0x1d6fe9[_0x283257(0x158)][_0x283257(0x165)];const _0x3b246a=typeof _0x1d6fe9[_0x283257(0x158)][_0x283257(0x160)]===_0x283257(0x16c)?_0x1d6fe9[_0x283257(0x158)]['env']:undefined,_0x3b8253=_0x1d6fe9['flags'][_0x283257(0x173)];!_0x1acea4&&!_0xe85672&&(console[_0x283257(0x177)]('×\x20未配置\x20AppCode'),console[_0x283257(0x171)](_0x283257(0x166)),console[_0x283257(0x171)](_0x283257(0x176)),console[_0x283257(0x171)]('\x20\x20\x202.\x20使用参数:\x20lovrabet\x20api\x20pull\x20--appcode\x20<app-code>'),process[_0x283257(0x162)](0x1)),_0x1acea4&&_0xe85672&&_0x1acea4===_0xe85672&&(console[_0x283257(0x171)](_0x283257(0x15d)+_0x1acea4+'\x1b[0m'),console[_0x283257(0x171)](_0x283257(0x185)),_0x1acea4=undefined),render(a9_0x2fc234(ApiPullUI,{'appCode':_0x1acea4,'env':_0x3b246a,'output':_0x3b8253}));}else{if(_0x101508===_0x283257(0x184)){_0x1d6fe9['input'][0x2]&&(console[_0x283257(0x177)]('❌\x20错误:不再支持位置参数方式'),console['log'](_0x283257(0x16a)),console[_0x283257(0x171)](_0x283257(0x179)+_0x1d6fe9[_0x283257(0x172)][0x2]),process[_0x283257(0x162)](0x1));const _0x217179=getConfigAppCode();let _0x4e76ec=_0x1d6fe9[_0x283257(0x158)][_0x283257(0x165)];const _0x33ca52=typeof _0x1d6fe9[_0x283257(0x158)]['env']===_0x283257(0x16c)?_0x1d6fe9[_0x283257(0x158)][_0x283257(0x160)]:undefined,_0x37b509=_0x1d6fe9[_0x283257(0x158)]['output'],_0x39b754=_0x1d6fe9[_0x283257(0x158)][_0x283257(0x15e)],_0x57307e=_0x1d6fe9[_0x283257(0x158)]['datasetcode'];!_0x4e76ec&&!_0x217179&&(console['error']('×\x20未配置\x20AppCode'),console[_0x283257(0x171)](_0x283257(0x166)),console['log'](_0x283257(0x176)),console[_0x283257(0x171)](_0x283257(0x168)),process['exit'](0x1));_0x4e76ec&&_0x217179&&_0x4e76ec===_0x217179&&(console[_0x283257(0x171)](_0x283257(0x15d)+_0x4e76ec+_0x283257(0x16d)),_0x4e76ec=undefined);let _0x58f0d6;if(_0x39b754)try{_0x58f0d6=JSON[_0x283257(0x186)](_0x39b754),(typeof _0x58f0d6!==_0x283257(0x15a)||_0x58f0d6===null||Array['isArray'](_0x58f0d6))&&(console['error']('×\x20--params\x20参数必须是一个有效的\x20JSON\x20对象'),process[_0x283257(0x162)](0x1));}catch(_0x5e1f80){console[_0x283257(0x177)](_0x283257(0x169)),console[_0x283257(0x177)](_0x283257(0x174)+(_0x5e1f80 instanceof Error?_0x5e1f80[_0x283257(0x164)]:String(_0x5e1f80))),process['exit'](0x1);}let _0x1bcd30;_0x57307e&&(_0x1bcd30=_0x57307e['split'](',')[_0x283257(0x17a)](_0x5ca36b=>_0x5ca36b['trim']())[_0x283257(0x17c)](_0x3444ec=>_0x3444ec['length']>0x0),_0x1bcd30['length']===0x0&&(console[_0x283257(0x177)](_0x283257(0x163)),process[_0x283257(0x162)](0x1)),console[_0x283257(0x171)]('\x1b[90m*\x20仅生成指定数据集的文档:\x20'+_0x1bcd30[_0x283257(0x170)](',\x20')+'\x1b[0m')),render(a9_0x2fc234(ApiDocUI,{'appCode':_0x4e76ec,'env':_0x33ca52,'output':_0x37b509,'extraParams':_0x58f0d6,'datasetCodes':_0x1bcd30}));}else console[_0x283257(0x177)](_0x283257(0x183)+_0x101508),console[_0x283257(0x171)](_0x283257(0x16f)),console[_0x283257(0x171)]('\x20\x20lovrabet\x20api\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20拉取并生成\x20API\x20配置文件'),console[_0x283257(0x171)](_0x283257(0x182)),console['log'](_0x283257(0x15b)),console[_0x283257(0x171)]('\x20\x20lovrabet\x20api\x20pull\x20--env\x20<env>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定环境(如:\x20daily,\x20online)'),console['log'](''),console[_0x283257(0x171)]('\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[_0x283257(0x171)](_0x283257(0x161)),console['log'](_0x283257(0x17d)),console['log'](_0x283257(0x181)),process[_0x283257(0x162)](0x1);}}
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 +1 @@
1
- function a10_0x1026(){const _0x3dccc8=['data','-client','4732HkqhoV','api','获取数据集失败,原因:登录鉴权失败,登录已过期','env','1132116jQpgCH','15556236LoltnF','string','-api','4956WLmBBh','\x20个数据集...','9694030ynmaqZ','API\x20配置拉取失败:\x20','×\x20无法读取错误响应内容','2790lIrYJO','modelCount','url','7sIKxzt','*\x20正在处理\x20','×\x20错误详情:','×\x20API\x20配置拉取异常:','cwd','API\x20配置拉取成功:\x20','success','error','message','*\x20开始生成\x20API\x20配置文件:','client','22eTmavp','√\x20成功拉取\x20','*\x20正在从服务器拉取\x20API\x20配置...\x20(环境:\x20','未知错误','.ts\x20-\x20模型配置文件','1260jOyKpb','create-api-pull','\x20个模型','8215408JsyAdg','获取数据集失败,HTTP状态码:\x20','status','&pageSize=999&currentPage=1','\x20\x20\x20•\x20','log','chdir','98936xnfAjx','tableData','/smartapi/dataset/getList?appCode=',',且无法读取错误响应内容','×\x20服务器返回错误:','9xoQKvL','length','API\x20配置拉取异常:\x20','\x20个数据集,生成\x20','.ts\x20-\x20客户端实例文件','×\x20文件前缀格式不正确。只能包含字母、数字、连字符和下划线,且必须以字母开头。'];a10_0x1026=function(){return _0x3dccc8;};return a10_0x1026();}(function(_0x1c7308,_0x4d8abc){const _0xcb3f54=a10_0x3756,_0x50df22=_0x1c7308();while(!![]){try{const _0x4b0fdf=-parseInt(_0xcb3f54(0x14d))/0x1+parseInt(_0xcb3f54(0x15a))/0x2*(parseInt(_0xcb3f54(0x143))/0x3)+parseInt(_0xcb3f54(0x12b))/0x4*(parseInt(_0xcb3f54(0x130))/0x5)+-parseInt(_0xcb3f54(0x127))/0x6+parseInt(_0xcb3f54(0x133))/0x7*(parseInt(_0xcb3f54(0x146))/0x8)+-parseInt(_0xcb3f54(0x152))/0x9*(-parseInt(_0xcb3f54(0x12d))/0xa)+parseInt(_0xcb3f54(0x13e))/0xb*(-parseInt(_0xcb3f54(0x128))/0xc);if(_0x4b0fdf===_0x4d8abc)break;else _0x50df22['push'](_0x50df22['shift']());}catch(_0x42bb97){_0x50df22['push'](_0x50df22['shift']());}}}(a10_0x1026,0xc393b));import{readConfig}from'../utils/config.js';import{getCookie}from'../auth/get-cookie.js';function a10_0x3756(_0x4771d8,_0x15f22b){const _0x10267f=a10_0x1026();return a10_0x3756=function(_0x3756a5,_0x52b122){_0x3756a5=_0x3756a5-0x125;let _0x4d0681=_0x10267f[_0x3756a5];return _0x4d0681;},a10_0x3756(_0x4771d8,_0x15f22b);}import{getApiDomain}from'../constant/domain.js';import{initEnv}from'../constant/env.js';import{generateApiFile}from'./generate-api-file.js';import{logger}from'../utils/logger.js';import{httpRequest}from'../utils/http-client.js';export async function pullApiSilent(_0x5baa74,_0x4ae244,_0x4314fc,_0x13e456){const _0x5bc18e=a10_0x3756;let _0x208d1c;try{const _0x1cc24f=_0x4ae244?.['trim']()||'';if(_0x1cc24f){const _0x5ee7da=/^[a-zA-Z][a-zA-Z0-9_-]*$/;if(!_0x5ee7da['test'](_0x1cc24f))return console['error'](_0x5bc18e(0x157)),![];}_0x4314fc&&(_0x208d1c=process[_0x5bc18e(0x137)](),process[_0x5bc18e(0x14c)](_0x4314fc));const _0x26e2c1=readConfig(),_0x277dee=typeof _0x26e2c1[_0x5bc18e(0x126)]===_0x5bc18e(0x129)?_0x26e2c1['env']:undefined,_0x5ea106=_0x13e456||_0x277dee||'online';initEnv(_0x5ea106),console[_0x5bc18e(0x14b)](_0x5bc18e(0x140)+_0x5ea106+')');const _0x23e737=getApiDomain()+_0x5bc18e(0x14f)+_0x5baa74+_0x5bc18e(0x149),_0x446993=await httpRequest(_0x23e737,{'headers':{'Cookie':getCookie()},'timeout':0xea60,'retries':0x2});if(_0x446993['ok']){const _0x4fb18b=_0x446993['data'];if(_0x4fb18b[_0x5bc18e(0x139)]){const _0x2ad5a2=_0x1cc24f?_0x1cc24f+_0x5bc18e(0x12a):_0x5bc18e(0x15b),_0x2fa464=_0x1cc24f?_0x1cc24f+_0x5bc18e(0x159):_0x5bc18e(0x13d);console[_0x5bc18e(0x14b)](_0x5bc18e(0x13c)),console[_0x5bc18e(0x14b)](_0x5bc18e(0x14a)+_0x2ad5a2+_0x5bc18e(0x142)),console['log'](_0x5bc18e(0x14a)+_0x2fa464+_0x5bc18e(0x156)),console[_0x5bc18e(0x14b)](_0x5bc18e(0x134)+_0x4fb18b[_0x5bc18e(0x158)][_0x5bc18e(0x14e)][_0x5bc18e(0x153)]+_0x5bc18e(0x12c));const _0x33440a=await generateApiFile(_0x4fb18b[_0x5bc18e(0x158)][_0x5bc18e(0x14e)],_0x1cc24f,_0x5baa74,!![],_0x5ea106);return console[_0x5bc18e(0x14b)](_0x5bc18e(0x13f)+_0x4fb18b[_0x5bc18e(0x158)][_0x5bc18e(0x14e)][_0x5bc18e(0x153)]+_0x5bc18e(0x155)+_0x33440a[_0x5bc18e(0x131)]+_0x5bc18e(0x145)),_0x4314fc&&logger['info'](_0x5bc18e(0x144),_0x5bc18e(0x138)+_0x5baa74,{'projectPath':_0x4314fc,'appCode':_0x5baa74,'datasetCount':_0x4fb18b[_0x5bc18e(0x158)][_0x5bc18e(0x14e)][_0x5bc18e(0x153)],'filePrefix':_0x1cc24f}),!![];}else return console['error'](_0x5bc18e(0x151),_0x4fb18b['message']||_0x5bc18e(0x141)),_0x4314fc&&logger[_0x5bc18e(0x13a)](_0x5bc18e(0x144),_0x5bc18e(0x12e)+(_0x4fb18b[_0x5bc18e(0x13b)]||_0x5bc18e(0x141)),{'projectPath':_0x4314fc,'appCode':_0x5baa74}),![];}else{if(_0x446993[_0x5bc18e(0x148)]===0x191){const _0x1d2b1c=_0x5bc18e(0x125);console['error']('×\x20'+_0x1d2b1c),_0x4314fc&&logger[_0x5bc18e(0x13a)](_0x5bc18e(0x144),_0x1d2b1c,{'status':_0x446993['status'],'appCode':_0x5baa74,'url':_0x446993[_0x5bc18e(0x132)],'projectPath':_0x4314fc});}else{const _0x3a4168=_0x5bc18e(0x147)+_0x446993[_0x5bc18e(0x148)];console[_0x5bc18e(0x13a)]('×\x20'+_0x3a4168);try{const _0x25c979=await _0x446993['text']();_0x25c979&&console[_0x5bc18e(0x13a)](_0x5bc18e(0x135),_0x25c979),_0x4314fc&&logger[_0x5bc18e(0x13a)](_0x5bc18e(0x144),_0x3a4168,{'status':_0x446993[_0x5bc18e(0x148)],'appCode':_0x5baa74,'url':_0x446993['url'],'errorBody':_0x25c979,'projectPath':_0x4314fc});}catch(_0x25e0e1){console[_0x5bc18e(0x13a)](_0x5bc18e(0x12f)),_0x4314fc&&logger['error'](_0x5bc18e(0x144),_0x3a4168+_0x5bc18e(0x150),{'status':_0x446993[_0x5bc18e(0x148)],'appCode':_0x5baa74,'url':_0x446993[_0x5bc18e(0x132)],'readError':_0x25e0e1 instanceof Error?_0x25e0e1[_0x5bc18e(0x13b)]:String(_0x25e0e1),'projectPath':_0x4314fc});}}return![];}}catch(_0x2f5b7c){const _0x5bc8eb=_0x2f5b7c instanceof Error?_0x2f5b7c['message']:String(_0x2f5b7c);return console[_0x5bc18e(0x13a)](_0x5bc18e(0x136),_0x5bc8eb),_0x4314fc&&logger['error']('create-api-pull',_0x5bc18e(0x154)+_0x5bc8eb,{'appCode':_0x5baa74,'projectPath':_0x4314fc}),![];}finally{_0x208d1c&&process[_0x5bc18e(0x14c)](_0x208d1c);}}
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 +1 @@
1
- const a13_0x536cbd=a13_0x1109;(function(_0x5aea37,_0x8f9e65){const _0x13b64e=a13_0x1109,_0x596d32=_0x5aea37();while(!![]){try{const _0x299b53=parseInt(_0x13b64e(0x1f1))/0x1+-parseInt(_0x13b64e(0x204))/0x2*(parseInt(_0x13b64e(0x207))/0x3)+parseInt(_0x13b64e(0x20b))/0x4*(parseInt(_0x13b64e(0x209))/0x5)+-parseInt(_0x13b64e(0x1f8))/0x6+-parseInt(_0x13b64e(0x20f))/0x7*(-parseInt(_0x13b64e(0x1f7))/0x8)+parseInt(_0x13b64e(0x206))/0x9*(parseInt(_0x13b64e(0x205))/0xa)+-parseInt(_0x13b64e(0x1f9))/0xb*(-parseInt(_0x13b64e(0x1fd))/0xc);if(_0x299b53===_0x8f9e65)break;else _0x596d32['push'](_0x596d32['shift']());}catch(_0x46071f){_0x596d32['push'](_0x596d32['shift']());}}}(a13_0x316e,0x91aa4));import{jsx as a13_0x46887a,jsxs as a13_0x1b8359,Fragment as a13_0x47b21f}from'react/jsx-runtime';function a13_0x1109(_0x231760,_0x15f9fe){const _0x316e39=a13_0x316e();return a13_0x1109=function(_0x110977,_0x547570){_0x110977=_0x110977-0x1ea;let _0x367ad=_0x316e39[_0x110977];return _0x367ad;},a13_0x1109(_0x231760,_0x15f9fe);}import{Text,Box,useInput,useApp,render}from'ink';import{useState}from'react';import a13_0x2bc582 from'ink-spinner';import{useGetOnlineMenuList}from'./get-online-menu-list.js';import{getLocalPages}from'./get-local-pages.js';import{createMenus}from'./create-menu.js';function a13_0x316e(){const _0x2d0cab=['length','gray','red','1368283UBbqNs','path','dots','菜单创建完成','local','菜单名称','delete','return','*\x20CSS\x20链接:\x20','按\x20Enter\x20创建菜单','\x20正在获取线上菜单列表...','需要创建的菜单:','main','fill','326193aZldbt','请输入链接','JS\x20链接无法访问','includes','column','max','8LJhWgu','2566632hGtSLx','2856095gErxez','green','trim','CSS\x20链接无法访问','12AuKtyO','label','Lovrabet平台','join','*\x20JS\x20链接:\x20','filter','map','774916CBDdev','703590oPfeBC','36RFObqt','9QGCRxH','online','305VcltjQ','then','73708XIoJnh'];a13_0x316e=function(){return _0x2d0cab;};return a13_0x316e();}import{isUrlReachable,isValidCssHttpsUrl,isValidJsHttpsUrl}from'./valid-url.js';import.meta[a13_0x536cbd(0x1ef)]&&render(a13_0x46887a(AppMenuSyncUI,{}));export function AppMenuSyncUI(){const _0x44df95=a13_0x536cbd,{exit:_0x11bd30}=useApp(),{loading:_0x52af11,menuList:_0x16c883}=useGetOnlineMenuList(),[_0x295c26,_0x2cc609]=useState(![]),[_0x2c545a,_0xeec481]=useState(''),[_0x4647c3,_0x338b58]=useState(''),_0x55036a=getLocalPages(),_0x400950=_0x16c883[_0x44df95(0x203)](_0x3f7c39=>_0x3f7c39[_0x44df95(0x210)]),_0x3410d2=[_0x44df95(0x214),..._0x55036a[_0x44df95(0x203)](_0x23a684=>_0x23a684['label'])],_0x2a144f=getStringWidth(getMaxWidth(_0x3410d2,0x4)),_0x576139=getStringWidth(getMaxWidth([_0x44df95(0x214)])),[_0x3441a7,_0x4d6d78]=useState(''),[_0x23cc34,_0x807437]=useState(''),_0x28e080=_0x55036a['map'](_0x2a2969=>({'label':_0x2a2969[_0x44df95(0x1fe)],'path':_0x2a2969[_0x44df95(0x210)],'local':!![],'online':_0x400950[_0x44df95(0x1f4)](_0x2a2969[_0x44df95(0x210)])})),_0x5453bc=_0x55036a[_0x44df95(0x202)](_0x1aecee=>{const _0x11dcfd=_0x44df95;return!_0x400950[_0x11dcfd(0x1f4)](_0x1aecee['path']);});useInput(async(_0x178ef0,_0x164e46)=>{const _0x9c8e06=_0x44df95;if(_0x164e46[_0x9c8e06(0x1ea)]){if(!_0x5453bc[_0x9c8e06(0x20c)]){_0x11bd30();return;}if(_0x2c545a&&_0x4647c3){createMenus(_0x5453bc,[_0x2c545a,_0x4647c3])[_0x9c8e06(0x20a)](()=>{_0x2cc609(!![]),setTimeout(()=>{_0x11bd30();});});return;}if(!_0x2c545a||!_0x4647c3){const _0x510add=_0x3441a7[_0x9c8e06(0x1fb)]();if(_0x510add==='')return;if(!_0x2c545a){if(!isValidJsHttpsUrl(_0x510add)){_0x807437('请输入有效的\x20JS\x20https\x20链接');return;}if(!await isUrlReachable(_0x510add)){_0x807437(_0x9c8e06(0x1f3));return;}_0xeec481(_0x510add),_0x4d6d78(''),_0x807437('');return;}if(!_0x4647c3){if(!isValidCssHttpsUrl(_0x510add)){_0x807437('请输入有效的\x20CSS\x20https\x20链接');return;}if(!await isUrlReachable(_0x510add)){_0x807437(_0x9c8e06(0x1fc));return;}_0x338b58(_0x510add),_0x4d6d78(''),_0x807437('');return;}}createMenus(_0x5453bc)[_0x9c8e06(0x20a)](()=>{_0x2cc609(!![]),setTimeout(()=>{_0x11bd30();});});return;}(_0x164e46['backspace']||_0x164e46[_0x9c8e06(0x215)])&&_0x4d6d78(_0x1b585a=>{const _0x56d290=_0x1b585a['slice'](0x0,-0x1);return _0x56d290;}),_0x4d6d78(_0xf1d46=>{const _0x59ca68=_0xf1d46+_0x178ef0;return _0x59ca68;}),_0x2c545a&&_0x4647c3&&(_0x178ef0==='q'&&_0x11bd30());});if(_0x52af11)return a13_0x1b8359(Box,{'marginTop':0x1,'marginBottom':0x1,'children':[a13_0x46887a(Text,{'children':'\x20\x20'}),a13_0x46887a(a13_0x2bc582,{'type':_0x44df95(0x211)}),a13_0x46887a(Text,{'children':_0x44df95(0x1ed)})]});return a13_0x1b8359(Box,{'flexDirection':_0x44df95(0x1f5),'marginTop':0x1,'marginBottom':0x1,'children':[a13_0x1b8359(Box,{'children':[a13_0x1b8359(Text,{'bold':!![],'children':['\x20\x20',_0x44df95(0x214),getRemainingSpaces(_0x2a144f,_0x44df95(0x214))]}),a13_0x1b8359(Text,{'bold':!![],'children':['本地',getRemainingSpaces(_0x576139,'菜单名称')]}),a13_0x1b8359(Text,{'bold':!![],'children':[_0x44df95(0x1ff),getRemainingSpaces(_0x576139,_0x44df95(0x214))]})]}),_0x28e080[_0x44df95(0x203)](_0x1d3e89=>a13_0x1b8359(Box,{'children':[a13_0x1b8359(Text,{'children':['\x20\x20',_0x1d3e89[_0x44df95(0x1fe)],getRemainingSpaces(_0x2a144f,_0x1d3e89[_0x44df95(0x1fe)])]}),a13_0x1b8359(Text,{'color':_0x44df95(0x1fa),'children':[_0x1d3e89[_0x44df95(0x213)]?'✓':'✗',getRemainingSpaces(_0x576139,'✓')]}),a13_0x1b8359(Text,{'color':_0x1d3e89[_0x44df95(0x208)]?'green':_0x44df95(0x20e),'children':[_0x1d3e89[_0x44df95(0x208)]?'✓':'✗',getRemainingSpaces(_0x576139,'✓')]})]},_0x1d3e89[_0x44df95(0x210)])),_0x5453bc['length']>0x0?a13_0x1b8359(a13_0x47b21f,{'children':[a13_0x1b8359(Box,{'marginTop':0x1,'flexDirection':_0x44df95(0x1f5),'children':[a13_0x1b8359(Text,{'children':['\x20\x20',_0x44df95(0x1ee)]}),_0x5453bc['map'](_0x8d798d=>a13_0x1b8359(Text,{'children':['\x20\x20','-\x20',_0x8d798d[_0x44df95(0x1fe)]]},_0x8d798d[_0x44df95(0x210)]))]}),a13_0x1b8359(Box,{'marginTop':0x1,'flexDirection':_0x44df95(0x1f5),'children':[a13_0x1b8359(Box,{'children':[a13_0x1b8359(Text,{'children':['\x20\x20',_0x44df95(0x201)]}),a13_0x46887a(Text,{'color':_0x2c545a?_0x44df95(0x1fa):_0x44df95(0x20d),'children':_0x2c545a||_0x3441a7||_0x44df95(0x1f2)})]}),_0x2c545a?a13_0x1b8359(Box,{'children':[a13_0x1b8359(Text,{'children':['\x20\x20',_0x44df95(0x1eb)]}),a13_0x46887a(Text,{'color':_0x4647c3?_0x44df95(0x1fa):_0x44df95(0x20d),'children':_0x4647c3||_0x3441a7||_0x44df95(0x1f2)})]}):null,_0x2c545a&&_0x4647c3?a13_0x46887a(Box,{'marginTop':0x1,'children':a13_0x1b8359(Text,{'children':['\x20\x20',_0x44df95(0x1ec)]})}):null]})]}):a13_0x46887a(Box,{'marginTop':0x1,'children':a13_0x1b8359(Text,{'children':['\x20\x20','所有菜单均已存在,按\x20q\x20或\x20Enter\x20退出']})}),_0x295c26?a13_0x46887a(Box,{'marginTop':0x1,'children':a13_0x1b8359(Text,{'children':['\x20\x20',_0x44df95(0x212)]})}):null,_0x23cc34&&a13_0x46887a(Box,{'marginTop':0x1,'children':a13_0x1b8359(Text,{'color':_0x44df95(0x20e),'children':['\x20\x20','←\x20',_0x23cc34]})})]});}function getStringWidth(_0x43e294){let _0xeefb22=0x0;for(const _0x52d3aa of _0x43e294){/[\u4e00-\u9fa5]/['test'](_0x52d3aa)?_0xeefb22+=0x2:_0xeefb22+=0x1;}return _0xeefb22;}function getRemainingSpaces(_0x175508,_0x21d181){const _0x1ff201=a13_0x536cbd,_0x2e8c8e=getStringWidth(_0x21d181);return Array(Math[_0x1ff201(0x1f6)](0x0,_0x175508-_0x2e8c8e))[_0x1ff201(0x1f0)]('\x20')[_0x1ff201(0x200)]('');}function getMaxWidth(_0x400639,_0x7188cd=0x2){let _0x2ebcd4='',_0x20fbc4=0x0;for(const _0x334be9 of _0x400639){const _0x100ff8=getStringWidth(_0x334be9);_0x100ff8>_0x20fbc4&&(_0x20fbc4=_0x100ff8,_0x2ebcd4=_0x334be9);}return _0x2ebcd4+'\x20'['repeat'](_0x7188cd);}
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 +1 @@
1
- (function(_0x2f082e,_0x433c14){const _0x23ebed=a14_0x11b5,_0x564d47=_0x2f082e();while(!![]){try{const _0x5dedd5=-parseInt(_0x23ebed(0x1a5))/0x1+-parseInt(_0x23ebed(0x1b7))/0x2+parseInt(_0x23ebed(0x1ad))/0x3*(parseInt(_0x23ebed(0x1b5))/0x4)+-parseInt(_0x23ebed(0x1a9))/0x5*(-parseInt(_0x23ebed(0x1b8))/0x6)+-parseInt(_0x23ebed(0x1ab))/0x7+parseInt(_0x23ebed(0x1a7))/0x8+parseInt(_0x23ebed(0x1a4))/0x9;if(_0x5dedd5===_0x433c14)break;else _0x564d47['push'](_0x564d47['shift']());}catch(_0x259608){_0x564d47['push'](_0x564d47['shift']());}}}(a14_0x4133,0xc66bf));import{getCookie}from'../auth/get-cookie.js';function a14_0x4133(){const _0x4a2f09=['json','×\x20未提供应用AppCode,且配置中也没有默认值','20auToDq','resources','2161102XdQOUa','1128NuEqbk','创建菜单结果:','procode','label','!\x20请使用以下方式之一:','error','import','1153269qxPWVr','770080TuzdTU','application/json','7796368blcElI','\x20\x20\x202.\x20配置默认值:\x20lovrabet\x20config\x20set\x20app\x20<app-code>','17065oluRhO','log','2201150UkKjib','\x20\x20\x201.\x20直接指定:\x20lovrabet\x20api\x20pull\x20<app-code>','740091HsVjbj','all','/smartapi/menu/create','appcode','stringify','POST'];a14_0x4133=function(){return _0x4a2f09;};return a14_0x4133();}import{getApiDomain}from'../constant/domain.js';import{readConfig}from'../utils/config.js';const config=readConfig();function a14_0x11b5(_0x20ab31,_0x3bbdf5){const _0x41337e=a14_0x4133();return a14_0x11b5=function(_0x11b533,_0x25cd60){_0x11b533=_0x11b533-0x1a0;let _0x17a011=_0x41337e[_0x11b533];return _0x17a011;},a14_0x11b5(_0x20ab31,_0x3bbdf5);}export async function createMenu(_0x1f7074){const _0x1b1c5b=a14_0x11b5,_0x4eba20=config?.[_0x1b1c5b(0x1b0)];if(!_0x4eba20){console['error']('×\x20未提供应用AppCode,且配置中也没有默认值'),console[_0x1b1c5b(0x1aa)](_0x1b1c5b(0x1a1)),console[_0x1b1c5b(0x1aa)](_0x1b1c5b(0x1ac)),console[_0x1b1c5b(0x1aa)](_0x1b1c5b(0x1a8));return;}const _0x4d6666={'appCode':_0x4eba20,'type':'procode','sort':0x0,'extend':{'loadScriptMode':_0x1b1c5b(0x1a3),'resources':_0x1f7074[_0x1b1c5b(0x1b6)]?JSON['stringify'](_0x1f7074[_0x1b1c5b(0x1b6)]):undefined},..._0x1f7074},_0x2d7a45=await fetch(getApiDomain()+_0x1b1c5b(0x1af),{'method':_0x1b1c5b(0x1b2),'body':JSON['stringify'](_0x4d6666),'headers':{'Content-Type':'application/json','Cookie':getCookie()}});_0x2d7a45['ok']&&console[_0x1b1c5b(0x1aa)](_0x1b1c5b(0x1b9),await _0x2d7a45[_0x1b1c5b(0x1b3)]());}async function _createMenu(_0x4be750,_0x18cefa){const _0x1d129f=a14_0x11b5,_0x241633=config?.[_0x1d129f(0x1b0)];if(!_0x241633){console[_0x1d129f(0x1a2)](_0x1d129f(0x1b4)),console[_0x1d129f(0x1aa)]('!\x20请使用以下方式之一:'),console['log']('\x20\x20\x201.\x20直接指定:\x20lovrabet\x20api\x20pull\x20<app-code>'),console[_0x1d129f(0x1aa)](_0x1d129f(0x1a8));return;}const _0x5477a2={'appCode':_0x241633,'type':_0x1d129f(0x1ba),'sort':0x0,'extend':{'loadScriptMode':_0x1d129f(0x1a3),'resources':_0x18cefa?JSON[_0x1d129f(0x1b1)](_0x18cefa):undefined},'label':_0x4be750[_0x1d129f(0x1a0)],'path':_0x4be750['path']},_0x18ca83=await fetch(getApiDomain()+'/smartapi/menu/create',{'method':'POST','body':JSON[_0x1d129f(0x1b1)](_0x5477a2),'headers':{'Content-Type':_0x1d129f(0x1a6),'Cookie':getCookie()}});}export async function createMenus(_0x4d3377,_0x364feb){const _0x3b234b=a14_0x11b5;await Promise[_0x3b234b(0x1ae)](_0x4d3377['map'](async _0x7f948e=>{await _createMenu(_0x7f948e,_0x364feb);}));}
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);}));}